- Stat losses are now displayed in the laptop

- Breath regeneration through sleep is now displayed in a tooltip
- If NOTIFY_IF_SLEEP_FAILS is set to FALSE, there is no popup box is ordering a merc to sleep fails

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7884 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-06-01 20:23:02 +00:00
parent 2d5e68a86d
commit ec90c52bd2
20 changed files with 284 additions and 221 deletions
+1
View File
@@ -2127,6 +2127,7 @@ void LoadGameExternalOptions()
////////// ALL ASSIGNMENTS //////////
gGameExternalOptions.ubMinutesForAssignmentToCount = iniReader.ReadInteger("Strategic Assignment Settings","MINUTES_FOR_ASSIGNMENT_TO_COUNT",45, 1, NUM_MIN_IN_DAY);
gGameExternalOptions.fSleepDisplayFailNotification = iniReader.ReadBoolean("Strategic Assignment Settings","NOTIFY_IF_SLEEP_FAILS", TRUE );
////////// PRACTICE/TRAIN/STUDY //////////
+1
View File
@@ -612,6 +612,7 @@ typedef struct
//Merc Assignment settings
INT32 ubAssignmentUnitsPerDay;
INT32 ubMinutesForAssignmentToCount;
BOOLEAN fSleepDisplayFailNotification;
INT32 ubTrainingSkillMin;
INT32 ubTrainingSkillMax;
+9 -9
View File
@@ -15,9 +15,9 @@
#ifdef JA2EDITOR
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7870 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7884 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7870 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7884 (Development Build)" };
#endif
// ------------------------------
@@ -27,11 +27,11 @@
//DEBUG BUILD VERSION
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7870 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7884 (Development Build)" };
#elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7870 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7884 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7870 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7884 (Development Build)" };
#endif
#elif defined CRIPPLED_VERSION
@@ -46,16 +46,16 @@
//RELEASE BUILD VERSION
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7870 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7884 (Development Build)" };
#elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7870 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7884 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Release v1.13.7870 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release v1.13.7884 (Development Build)" };
#endif
#endif
CHAR8 czVersionNumber[16] = { "Build 15.05.20" }; //YY.MM.DD
CHAR8 czVersionNumber[16] = { "Build 15.06.01" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" };
// SAVE_GAME_VERSION is defined in header, change it there
+143 -130
View File
@@ -1419,86 +1419,92 @@ void DisplayCharStats(INT32 iId, INT32 iSlot)
// health
if( Menptr[iId].bAssignment != ASSIGNMENT_POW )
{
if( gMercProfiles[Menptr[iId].ubProfile].bLifeDelta > 0 )
// Flugente: stats can have gone up or down, find out which
INT16 change = gMercProfiles[Menptr[iId].ubProfile].bLifeDelta - (INT16)(pSoldier->ubCriticalStatDamage[DAMAGED_STAT_HEALTH]);
if ( change )
{
swprintf(sString, L"( %+d )", gMercProfiles[Menptr[iId].ubProfile].bLifeDelta);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20+TEXT_DELTA_OFFSET ),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
swprintf( sString, change > 0 ? L"( +%d )" : L"( %d )", change );
FindFontRightCoordinates( (INT16)(pPersonnelScreenPoints[iCounter].x + (iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH - 20 + TEXT_DELTA_OFFSET), 0, 30, 0, sString, PERS_FONT, &sX, &sY );
mprintf( sX, pPersonnelScreenPoints[iCounter].y, sString );
}
//else
//{
swprintf(sString, L"%d/%d",Menptr[iId].stats.bLife,Menptr[iId].stats.bLifeMax);
//}
swprintf( sString, L"%d/%d", Menptr[iId].stats.bLife, Menptr[iId].stats.bLifeMax );
}
else
{
swprintf( sString, pPOWStrings[ 1 ] );
}
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[PRSNL_TXT_HEALTH]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[PRSNL_TXT_HEALTH]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
break;
case 1:
// agility
if( !fAmIaRobot )
{
if( gMercProfiles[Menptr[iId].ubProfile].bAgilityDelta > 0 )
// Flugente: stats can have gone up or down, find out which
INT16 change = gMercProfiles[Menptr[iId].ubProfile].bAgilityDelta - (INT16)(pSoldier->ubCriticalStatDamage[DAMAGED_STAT_AGILITY]);
if ( change )
{
swprintf(sString, L"( %+d )", gMercProfiles[Menptr[iId].ubProfile].bAgilityDelta);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20+TEXT_DELTA_OFFSET ),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString); }
//else
//{
swprintf(sString, L"%d",Menptr[iId].stats.bAgility);
//}
swprintf( sString, change > 0 ? L"( +%d )" : L"( %d )", change );
FindFontRightCoordinates( (INT16)(pPersonnelScreenPoints[iCounter].x + (iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH - 20 + TEXT_DELTA_OFFSET), 0, 30, 0, sString, PERS_FONT, &sX, &sY );
mprintf( sX, pPersonnelScreenPoints[iCounter].y, sString );
}
swprintf( sString, L"%d", Menptr[iId].stats.bAgility );
}
else
{
swprintf( sString, L"%s", gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
}
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
break;
case 2:
// dexterity
if( !fAmIaRobot )
if ( !fAmIaRobot )
{
if( gMercProfiles[Menptr[iId].ubProfile].bDexterityDelta > 0 )
// Flugente: stats can have gone up or down, find out which
INT16 change = gMercProfiles[Menptr[iId].ubProfile].bDexterityDelta - (INT16)(pSoldier->ubCriticalStatDamage[DAMAGED_STAT_DEXTERITY]);
if ( change )
{
swprintf(sString, L"( %+d )", gMercProfiles[Menptr[iId].ubProfile].bDexterityDelta);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20+TEXT_DELTA_OFFSET ),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString); }
//else
//{
swprintf(sString, L"%d",Menptr[iId].stats.bDexterity);
//}
swprintf( sString, change > 0 ? L"( +%d )" : L"( %d )", change );
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20+TEXT_DELTA_OFFSET ),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
}
swprintf(sString, L"%d",Menptr[iId].stats.bDexterity);
}
else
{
swprintf( sString, L"%s", gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
}
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
break;
case 3:
// strength
if( !fAmIaRobot )
{
if( gMercProfiles[Menptr[iId].ubProfile].bStrengthDelta > 0 )
// Flugente: stats can have gone up or down, find out which
INT16 change = gMercProfiles[Menptr[iId].ubProfile].bStrengthDelta - (INT16)(pSoldier->ubCriticalStatDamage[DAMAGED_STAT_STRENGTH]);
if ( change )
{
swprintf(sString, L"( %+d )", gMercProfiles[Menptr[iId].ubProfile].bStrengthDelta);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20+TEXT_DELTA_OFFSET ),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString); }
//else
//{
swprintf(sString, L"%d",Menptr[iId].stats.bStrength );
//}
swprintf( sString, change > 0 ? L"( +%d )" : L"( %d )", change );
FindFontRightCoordinates( (INT16)(pPersonnelScreenPoints[iCounter].x + (iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH - 20 + TEXT_DELTA_OFFSET), 0, 30, 0, sString, PERS_FONT, &sX, &sY );
mprintf( sX, pPersonnelScreenPoints[iCounter].y, sString );
}
swprintf( sString, L"%d", Menptr[iId].stats.bStrength );
}
else
{
@@ -1513,15 +1519,17 @@ void DisplayCharStats(INT32 iId, INT32 iSlot)
// leadership
if( !fAmIaRobot )
{
if( gMercProfiles[Menptr[iId].ubProfile].bLeadershipDelta > 0 )
// Flugente: stats can have gone up or down, find out which
INT16 change = gMercProfiles[Menptr[iId].ubProfile].bLeadershipDelta - (INT16)(pSoldier->ubCriticalStatDamage[DAMAGED_STAT_LEADERSHIP]);
if ( change )
{
swprintf(sString, L"( %+d )", gMercProfiles[Menptr[iId].ubProfile].bLeadershipDelta);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20 +TEXT_DELTA_OFFSET),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString); }
//else
//{
swprintf(sString, L"%d",Menptr[iId].stats.bLeadership );
//}
swprintf( sString, change > 0 ? L"( +%d )" : L"( %d )", change );
FindFontRightCoordinates( (INT16)(pPersonnelScreenPoints[iCounter].x + (iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH - 20 + TEXT_DELTA_OFFSET), 0, 30, 0, sString, PERS_FONT, &sX, &sY );
mprintf( sX, pPersonnelScreenPoints[iCounter].y, sString );
}
swprintf( sString, L"%d", Menptr[iId].stats.bLeadership );
}
else
{
@@ -1536,16 +1544,17 @@ void DisplayCharStats(INT32 iId, INT32 iSlot)
// wisdom
if( !fAmIaRobot )
{
if( gMercProfiles[Menptr[iId].ubProfile].bWisdomDelta > 0 )
// Flugente: stats can have gone up or down, find out which
INT16 change = gMercProfiles[Menptr[iId].ubProfile].bWisdomDelta - (INT16)(pSoldier->ubCriticalStatDamage[DAMAGED_STAT_WISDOM]);
if ( change )
{
swprintf(sString, L"( %+d )", gMercProfiles[Menptr[iId].ubProfile].bWisdomDelta);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20+TEXT_DELTA_OFFSET ),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
swprintf( sString, change > 0 ? L"( +%d )" : L"( %d )", change );
FindFontRightCoordinates( (INT16)(pPersonnelScreenPoints[iCounter].x + (iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH - 20 + TEXT_DELTA_OFFSET), 0, 30, 0, sString, PERS_FONT, &sX, &sY );
mprintf( sX, pPersonnelScreenPoints[iCounter].y, sString );
}
//else
//{
swprintf(sString, L"%d",Menptr[iId].stats.bWisdom );
//}
swprintf( sString, L"%d", Menptr[iId].stats.bWisdom );
}
else
{
@@ -1586,98 +1595,102 @@ void DisplayCharStats(INT32 iId, INT32 iSlot)
//mrkmanship
if( !fAmIaRobot )
{
if( gMercProfiles[Menptr[iId].ubProfile].bMarksmanshipDelta > 0 )
// Flugente: stats can have gone up or down, find out which
INT16 change = gMercProfiles[Menptr[iId].ubProfile].bMarksmanshipDelta - (INT16)(pSoldier->ubCriticalStatDamage[DAMAGED_STAT_MARKSMANSHIP]);
if ( change )
{
swprintf(sString, L"( %+d )", gMercProfiles[Menptr[iId].ubProfile].bMarksmanshipDelta);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20+TEXT_DELTA_OFFSET ),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString); }
//else
//{
swprintf(sString, L"%d",Menptr[iId].stats.bMarksmanship);
//}
swprintf( sString, change > 0 ? L"( +%d )" : L"( %d )", change );
FindFontRightCoordinates( (INT16)(pPersonnelScreenPoints[iCounter].x + (iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH - 20 + TEXT_DELTA_OFFSET), 0, 30, 0, sString, PERS_FONT, &sX, &sY );
mprintf( sX, pPersonnelScreenPoints[iCounter].y, sString );
}
swprintf( sString, L"%d", Menptr[iId].stats.bMarksmanship );
}
else
{
swprintf( sString, L"%s", gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
}
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
break;
case 8:
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
break;
case 8:
// mech
if( !fAmIaRobot )
{
// Flugente: stats can have gone up or down, find out which
INT16 change = gMercProfiles[Menptr[iId].ubProfile].bMechanicDelta - (INT16)(pSoldier->ubCriticalStatDamage[DAMAGED_STAT_MECHANICAL]);
if( gMercProfiles[Menptr[iId].ubProfile].bMechanicDelta > 0 )
if ( change )
{
swprintf(sString, L"( %+d )", gMercProfiles[Menptr[iId].ubProfile].bMechanicDelta);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20+TEXT_DELTA_OFFSET ),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString); }
//else
//{
swprintf(sString, L"%d",Menptr[iId].stats.bMechanical);
//}
swprintf( sString, change > 0 ? L"( +%d )" : L"( %d )", change );
FindFontRightCoordinates( (INT16)(pPersonnelScreenPoints[iCounter].x + (iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH - 20 + TEXT_DELTA_OFFSET), 0, 30, 0, sString, PERS_FONT, &sX, &sY );
mprintf( sX, pPersonnelScreenPoints[iCounter].y, sString );
}
swprintf( sString, L"%d", Menptr[iId].stats.bMechanical );
}
else
{
swprintf( sString, L"%s", gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
}
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
break;
case 9:
// exp
if( !fAmIaRobot )
{
if( gMercProfiles[Menptr[iId].ubProfile].bExplosivesDelta > 0 )
{
swprintf(sString, L"( %+d )", gMercProfiles[Menptr[iId].ubProfile].bExplosivesDelta);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20+TEXT_DELTA_OFFSET ),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString); }
//else
//{
swprintf(sString, L"%d",Menptr[iId].stats.bExplosive);
//}
}
else
{
swprintf( sString, L"%s", gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
}
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
break;
case 10:
// med
if( !fAmIaRobot )
{
if( gMercProfiles[Menptr[iId].ubProfile].bMedicalDelta > 0 )
{
swprintf(sString, L"( %+d )", gMercProfiles[Menptr[iId].ubProfile].bMedicalDelta);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH-20 +TEXT_DELTA_OFFSET),0,30,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString); }
//else
//{
swprintf(sString, L"%d",Menptr[iId].stats.bMedical);
//}
}
else
{
swprintf( sString, L"%s", gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
}
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
break;
break;
case 9:
// exp
if( !fAmIaRobot )
{
// Flugente: stats can have gone up or down, find out which
INT16 change = gMercProfiles[Menptr[iId].ubProfile].bExplosivesDelta - (INT16)(pSoldier->ubCriticalStatDamage[DAMAGED_STAT_EXPLOSIVES]);
if ( change )
{
swprintf( sString, change > 0 ? L"( +%d )" : L"( %d )", change );
FindFontRightCoordinates( (INT16)(pPersonnelScreenPoints[iCounter].x + (iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH - 20 + TEXT_DELTA_OFFSET), 0, 30, 0, sString, PERS_FONT, &sX, &sY );
mprintf( sX, pPersonnelScreenPoints[iCounter].y, sString );
}
swprintf( sString, L"%d", Menptr[iId].stats.bExplosive );
}
else
{
swprintf( sString, L"%s", gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
}
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
break;
case 10:
// med
if( !fAmIaRobot )
{
// Flugente: stats can have gone up or down, find out which
INT16 change = gMercProfiles[Menptr[iId].ubProfile].bMedicalDelta - (INT16)(pSoldier->ubCriticalStatDamage[DAMAGED_STAT_MEDICAL]);
if ( change )
{
swprintf( sString, change > 0 ? L"( +%d )" : L"( %d )", change );
FindFontRightCoordinates( (INT16)(pPersonnelScreenPoints[iCounter].x + (iSlot*TEXT_BOX_WIDTH) + TEXT_BOX_WIDTH - 20 + TEXT_DELTA_OFFSET), 0, 30, 0, sString, PERS_FONT, &sX, &sY );
mprintf( sX, pPersonnelScreenPoints[iCounter].y, sString );
}
swprintf( sString, L"%d", Menptr[iId].stats.bMedical );
}
else
{
swprintf( sString, L"%s", gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
}
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[iCounter]);
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
break;
// Added by Flugente
case 16:
+2 -80
View File
@@ -617,8 +617,6 @@ BOOLEAN PlayerSoldierTooTiredToTravel( SOLDIERTYPE *pSoldier );
void AssignmentAborted( SOLDIERTYPE *pSoldier, UINT8 ubReason );
UINT8 CalcSoldierNeedForSleep( SOLDIERTYPE *pSoldier );
UINT32 GetLastSquadListedInSquadMenu( void );
BOOLEAN IsAnythingAroundForSoldierToRepair( SOLDIERTYPE * pSoldier );
@@ -4969,84 +4967,8 @@ INT8 GetRegainDueToSleepNeeded( SOLDIERTYPE *pSoldier, INT32 iRateOfReGain )
void RestCharacter( SOLDIERTYPE *pSoldier )
{
// handle the sleep of this character, update bBreathMax based on sleep they have
INT8 bMaxBreathRegain = 0;
INT16 sSectorModifier = 100;
FLOAT bDivisor = 0;
// Determine how many hours a day this merc must sleep. Normally this would range between 6 and 12 hours.
// Injuries and/or martial arts trait can change the limits to between 3 and 18 hours a day.
bDivisor = CalcSoldierNeedForSleep( pSoldier );
// HEADROCK HAM 3.6:
// Night ops specialists sleep better during the day. Others sleep better during the night.
// silversurfer: The code below did the complete opposite. A higher bDivisor means LESS regeneration. Fixed.
if (DayTime()) //if (NightTime())
{
if ( gGameOptions.fNewTraitSystem ) // SANDRO - Old/New traits
{
if ( !HAS_SKILL_TRAIT( pSoldier, NIGHT_OPS_NT ) )
bDivisor += 3;
}
else
bDivisor += 4-(2*NUM_SKILL_TRAITS( pSoldier, NIGHTOPS_OT ));
}
else
{
if ( gGameOptions.fNewTraitSystem ) // SANDRO - Old/New traits
{
if ( HAS_SKILL_TRAIT( pSoldier, NIGHT_OPS_NT ) )
bDivisor += 3;
}
else
bDivisor += (2*NUM_SKILL_TRAITS( pSoldier, NIGHTOPS_OT ));
}
// HEADROCK HAM 3.5: Read adjustment from local sector facilities
if (pSoldier->bSectorZ == 0)
{
if (pSoldier->flags.fMercAsleep)
{
sSectorModifier = GetSectorModifier( pSoldier, FACILITY_SLEEP_MOD );
}
else
{
// Resting can be done at a facility now, and the program will automatically apply a performance bonus
// to this if the facility has one. If the character is simply resting ("On Duty", assigned to a squad),
// then only Ambient effects take place.
sSectorModifier = GetSectorModifier( pSoldier, FACILITY_PERFORMANCE_MOD );
}
bDivisor = (bDivisor * 100) / sSectorModifier;
}
// silversurfer: Items can provide a bonus to regeneration, sleeping bags for example.
// They will not provide such bonus if the merc is already using a bed in a facility.
if ( GetSoldierFacilityAssignmentIndex( pSoldier ) != FAC_PATIENT && GetSoldierFacilityAssignmentIndex( pSoldier ) != FAC_REST )
{
bDivisor = ( bDivisor * 100 ) / ( 100 + GetInventorySleepModifier( pSoldier ) );
}
// silversurfer: I moved all modifiers above this point because we don't want anybody to rest faster or slower than the already extreme thresholds.
// Re-enforce limits
bDivisor = __min(18, __max(3, bDivisor));
// round up so the bonuses above make more sense
bMaxBreathRegain = ( 50 / bDivisor + 0.5 );
// Limit so that characters can't regain faster than 3 hours, ever
if (bMaxBreathRegain > 17)
{
bMaxBreathRegain = 17;
}
// if breath max is below the "really tired" threshold
if( pSoldier->bBreathMax < BREATHMAX_PRETTY_TIRED )
{
// real tired, rest rate is 50% higher (this is to prevent absurdly long sleep times for totally exhausted mercs)
bMaxBreathRegain = (UINT8)( bMaxBreathRegain * 3 / 2 );
}
pSoldier->bBreathMax += bMaxBreathRegain;
// handle the sleep of this character, update bBreathMax based on sleep they have
pSoldier->bBreathMax += pSoldier->GetSleepBreathRegeneration( );
// Flugente: diseases can affect stat effectivity
UINT16 diseasemaxbreathreduction = 0;
+2
View File
@@ -479,6 +479,8 @@ BOOLEAN MercStaffsMilitaryHQ();
BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier );
UINT8 CalcSoldierNeedForSleep( SOLDIERTYPE *pSoldier );
#endif
+2
View File
@@ -2028,6 +2028,8 @@ void UpdateCharRegionHelpText( void )
pSoldier->PrintFoodDesc( sString, TRUE );
pSoldier->PrintDiseaseDesc( sString, TRUE );
pSoldier->PrintSleepDesc( sString );
}
}
else
+2 -1
View File
@@ -11429,7 +11429,8 @@ void TeamListSleepRegionBtnCallBack( MOUSE_REGION *pRegion, INT32 iReason )
else // awake
{
// try to put him to sleep
if( SetMercAsleep( pSoldier, TRUE ) )
// Flugente: externalised option on whether messages on why merc cannot sleep appear
if ( SetMercAsleep( pSoldier, gGameExternalOptions.fSleepDisplayFailNotification ) )
{
// HEADROCK HAM B2.8: New feature sends all trainees/trainers to sleep automatically
HandleTrainingSleepSynchronize( pSoldier );
+2
View File
@@ -14510,6 +14510,8 @@ void UpdateMercBodyRegionHelpText( )
pSoldier->PrintFoodDesc( sString, TRUE );
pSoldier->PrintDiseaseDesc( sString, TRUE );
pSoldier->PrintSleepDesc( sString );
}
}
}
+98 -1
View File
@@ -96,6 +96,7 @@
#include "Queen Command.h" // added by Flugente
#include "Town Militia.h" // added by Flugente
#include "Auto Bandage.h" // added by Flugente
#include "Facilities.h" // added by Flugente
#endif
#include "ub_config.h"
@@ -18750,7 +18751,7 @@ void SOLDIERTYPE::PrintFoodDesc( CHAR16* apStr, BOOLEAN fFullDesc )
if ( !gGameOptions.fFoodSystem )
return;
// only for living mercs with a profile with a valid infection method
// only for living mercs with a profile
if ( this->flags.uiStatusFlags & SOLDIER_VEHICLE || this->ubProfile == NO_PROFILE )
return;
@@ -18849,6 +18850,19 @@ void SOLDIERTYPE::PrintFoodDesc( CHAR16* apStr, BOOLEAN fFullDesc )
}
}
void SOLDIERTYPE::PrintSleepDesc( CHAR16* apStr )
{
// only for people
if ( this->flags.uiStatusFlags & SOLDIER_VEHICLE )
return;
CHAR16 atStr[100];
swprintf( atStr, L"" );
swprintf( atStr, gpStrategicString[STR_BREATH_REGEN_SLEEP], this->GetSleepBreathRegeneration( ) );
wcscat( apStr, atStr );
}
// get percentage protection from infections via contact
FLOAT SOLDIERTYPE::GetDiseaseContactProtection( )
{
@@ -18901,6 +18915,89 @@ INT16 SOLDIERTYPE::GetDiseaseResistance( )
return(val);
}
// Flugente: hourly breath regen calculation
INT8 SOLDIERTYPE::GetSleepBreathRegeneration( )
{
// handle the sleep of this character, update bBreathMax based on sleep they have
INT8 bMaxBreathRegain = 0;
INT16 sSectorModifier = 100;
FLOAT bDivisor = 0;
// Determine how many hours a day this merc must sleep. Normally this would range between 6 and 12 hours.
// Injuries and/or martial arts trait can change the limits to between 3 and 18 hours a day.
bDivisor = CalcSoldierNeedForSleep( this );
// HEADROCK HAM 3.6:
// Night ops specialists sleep better during the day. Others sleep better during the night.
// silversurfer: The code below did the complete opposite. A higher bDivisor means LESS regeneration. Fixed.
if ( DayTime( ) ) //if (NightTime())
{
if ( gGameOptions.fNewTraitSystem ) // SANDRO - Old/New traits
{
if ( !HAS_SKILL_TRAIT( this, NIGHT_OPS_NT ) )
bDivisor += 3;
}
else
bDivisor += 4 - (2 * NUM_SKILL_TRAITS( this, NIGHTOPS_OT ));
}
else
{
if ( gGameOptions.fNewTraitSystem ) // SANDRO - Old/New traits
{
if ( HAS_SKILL_TRAIT( this, NIGHT_OPS_NT ) )
bDivisor += 3;
}
else
bDivisor += (2 * NUM_SKILL_TRAITS( this, NIGHTOPS_OT ));
}
// HEADROCK HAM 3.5: Read adjustment from local sector facilities
if ( this->bSectorZ == 0 )
{
if ( this->flags.fMercAsleep )
{
sSectorModifier = GetSectorModifier( this, FACILITY_SLEEP_MOD );
}
else
{
// Resting can be done at a facility now, and the program will automatically apply a performance bonus
// to this if the facility has one. If the character is simply resting ("On Duty", assigned to a squad),
// then only Ambient effects take place.
sSectorModifier = GetSectorModifier( this, FACILITY_PERFORMANCE_MOD );
}
bDivisor = (bDivisor * 100) / sSectorModifier;
}
// silversurfer: Items can provide a bonus to regeneration, sleeping bags for example.
// They will not provide such bonus if the merc is already using a bed in a facility.
if ( GetSoldierFacilityAssignmentIndex( this ) != FAC_PATIENT && GetSoldierFacilityAssignmentIndex( this ) != FAC_REST )
{
bDivisor = (bDivisor * 100) / (100 + GetInventorySleepModifier( this ));
}
// silversurfer: I moved all modifiers above this point because we don't want anybody to rest faster or slower than the already extreme thresholds.
// Re-enforce limits
bDivisor = __min( 18, __max( 3, bDivisor ) );
// round up so the bonuses above make more sense
bMaxBreathRegain = (50 / bDivisor + 0.5);
// Limit so that characters can't regain faster than 3 hours, ever
if ( bMaxBreathRegain > 17 )
{
bMaxBreathRegain = 17;
}
// if breath max is below the "really tired" threshold
if ( this->bBreathMax < BREATHMAX_PRETTY_TIRED )
{
// real tired, rest rate is 50% higher (this is to prevent absurdly long sleep times for totally exhausted mercs)
bMaxBreathRegain = (UINT8)(bMaxBreathRegain * 3 / 2);
}
return bMaxBreathRegain;
}
INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
{
+4
View File
@@ -1868,9 +1868,13 @@ public:
FLOAT GetDiseaseMagnitude( UINT8 aDisease ); // get the magnitude os a disease we might have, used to determine wether there are any effects
void PrintDiseaseDesc( CHAR16* apStr, BOOLEAN fFullDesc = FALSE );
void PrintFoodDesc( CHAR16* apStr, BOOLEAN fFullDesc = FALSE );
void PrintSleepDesc( CHAR16* apStr );
FLOAT GetDiseaseContactProtection(); // get percentage protection from infections via contact
INT16 GetDiseaseResistance();
// Flugente: hourly breath regen calculation
INT8 GetSleepBreathRegeneration();
//////////////////////////////////////////////////////////////////////////////
}; // SOLDIERTYPE;
+2
View File
@@ -1853,6 +1853,8 @@ enum
STR_AR_TANK_NAME,
STR_BREATH_REGEN_SLEEP,
TEXT_NUM_STRATEGIC_TEXT
};
+2
View File
@@ -2851,6 +2851,8 @@ STR16 gpStrategicString[] =
L"War room isn't staffed - militia move aborted!",
L"Tank", //STR_AR_TANK_NAME,
L"\nBreath regeneration per hour: %d", // STR_BREATH_REGEN_SLEEP
};
STR16 gpGameClockString[] =
+2
View File
@@ -2848,6 +2848,8 @@ STR16 gpStrategicString[] =
L"War room isn't staffed - militia move aborted!",
L"Tank", //STR_AR_TANK_NAME,
L"\nBreath regeneration per hour: %d", // STR_BREATH_REGEN_SLEEP
};
STR16 gpGameClockString[] =
+2
View File
@@ -2851,6 +2851,8 @@ STR16 gpStrategicString[] =
L"War room isn't staffed - militia move aborted!",
L"Tank", //STR_AR_TANK_NAME,
L"\nBreath regeneration per hour: %d", // STR_BREATH_REGEN_SLEEP
};
STR16 gpGameClockString[] =
+2
View File
@@ -2857,6 +2857,8 @@ STR16 gpStrategicString[] =
L"La salle d'opérations n'est pas ouverte... Le mouvement de la milice a avorté !",
L"Tank", //STR_AR_TANK_NAME, // TODO.Translate
L"\nBreath regeneration per hour: %d", // STR_BREATH_REGEN_SLEEP
};
STR16 gpGameClockString[] =
+2
View File
@@ -2860,6 +2860,8 @@ STR16 gpStrategicString[] =
L"War room isn't staffed - militia move aborted!",
L"Panzer", //STR_AR_TANK_NAME,
L"\nBreath regeneration per hour: %d", // STR_BREATH_REGEN_SLEEP
};
STR16 gpGameClockString[] =
+2
View File
@@ -2844,6 +2844,8 @@ STR16 gpStrategicString[] =
L"War room isn't staffed - militia move aborted!",
L"Tank", //STR_AR_TANK_NAME,
L"\nBreath regeneration per hour: %d", // STR_BREATH_REGEN_SLEEP
};
STR16 gpGameClockString[] =
+2
View File
@@ -2859,6 +2859,8 @@ STR16 gpStrategicString[] =
L"War room isn't staffed - militia move aborted!",
L"Tank", //STR_AR_TANK_NAME,
L"\nBreath regeneration per hour: %d", // STR_BREATH_REGEN_SLEEP
};
STR16 gpGameClockString[] =
+2
View File
@@ -2849,6 +2849,8 @@ STR16 gpStrategicString[] =
L"War room isn't staffed - militia move aborted!",
L"Tank", //STR_AR_TANK_NAME,
L"\nBreath regeneration per hour: %d", // STR_BREATH_REGEN_SLEEP
};
STR16 gpGameClockString[] =