Zombie Update (by Flugente)

- new variables for additional strength, dexterity, agility, wisdom and experience level due to drugs, traits etc.
- new flagmask for soldiers (so no new variables have to be added in the future)
- fix: stat-altering drugs work again and can now have a higher magnitude
- drug-altered stats now show up purple
- fix: option screen help texts were missing

WARING! This will break savegame compatibility

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5325 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-06-02 15:50:54 +00:00
parent defef00330
commit 4750b07f16
38 changed files with 339 additions and 326 deletions
+1 -1
View File
@@ -2854,7 +2854,7 @@ void SayQuoteFromNearbyMercInSector( INT32 sGridNo, INT8 bDistance, UINT16 usQuo
if ( OK_INSECTOR_MERC( pTeamSoldier ) && PythSpacesAway( sGridNo, pTeamSoldier->sGridNo ) < bDistance && !AM_AN_EPC( pTeamSoldier ) && !( pTeamSoldier->flags.uiStatusFlags & SOLDIER_GASSED ) && !(AM_A_ROBOT( pTeamSoldier )) && !pTeamSoldier->flags.fMercAsleep &&
SoldierTo3DLocationLineOfSightTest( pTeamSoldier, sGridNo, 0, 0, TRUE ) )
{
if ( usQuoteNum == 66 && (INT8) Random( 100 ) > EffectiveWisdom( pTeamSoldier ) )
if ( usQuoteNum == 66 && (INT16) Random( 100 ) > EffectiveWisdom( pTeamSoldier ) )
{
continue;
}
+4 -94
View File
@@ -364,107 +364,17 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
// only do the checks for the player team, as soldiers do not have a gMercProfiles
if ( pSoldier->bTeam == gbPlayerNum)
{
// Flugente 2012-05-25: the status drugs cause weird behaviour with the stat repairing behaviour of doctoring, so this is commented out till a working solution has been found
/*
//////////////// STRENGTH ////////////////
// strength we would normally have right now
INT8 strength = gMercProfiles[ pSoldier->ubProfile ].bStrength;// Madd: commenting out this part b/c it breaks doctoring! - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_STRENGTH ];
INT8 strengthmodifier = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_STRENGTH ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_STRENGTH ];
// cap modifier at 25, as currently stats cant go above 127 (INT8)
strengthmodifier = min(25, strengthmodifier);
UINT32 newstrength = max(1, strength + strengthmodifier);
newstrength = min(126, newstrength);
pSoldier->stats.bStrength = (INT8)newstrength;
if ( strengthmodifier > 0 )
{
pSoldier->timeChanges.uiChangeStrengthTime = GetJA2Clock();
pSoldier->usValueGoneUp |= ( STRENGTH_INCREASE );
}
else if ( strengthmodifier < 0 )
{
pSoldier->timeChanges.uiChangeStrengthTime = GetJA2Clock();
pSoldier->usValueGoneUp &= ~( STRENGTH_INCREASE );
}
pSoldier->bExtraStrength = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_STRENGTH ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_STRENGTH ];
//////////////// DEXTERITY ////////////////
// dexterity we would normally have right now
INT8 dexterity = gMercProfiles[ pSoldier->ubProfile ].bDexterity;// Madd: commenting out this part b/c it breaks doctoring! - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_DEXTERITY ];
INT8 dexteritymodifier = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_DEXTERITY ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_DEXTERITY ];
// cap modifier at 25, as currently stats cant go above 127 (INT8)
dexteritymodifier = min(25, dexteritymodifier);
UINT32 newdexterity = max(1, dexterity + dexteritymodifier);
newdexterity = min(126, newdexterity);
pSoldier->stats.bDexterity = newdexterity;
if ( dexteritymodifier > 0 )
{
pSoldier->timeChanges.uiChangeDexterityTime = GetJA2Clock();
pSoldier->usValueGoneUp |= ( DEX_INCREASE );
}
else if ( dexteritymodifier < 0 )
{
pSoldier->timeChanges.uiChangeDexterityTime = GetJA2Clock();
pSoldier->usValueGoneUp &= ~( DEX_INCREASE );
}
pSoldier->bExtraDexterity = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_DEXTERITY ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_DEXTERITY ];
//////////////// AGILITY ////////////////
// agility we would normally have right now
INT8 agility = gMercProfiles[ pSoldier->ubProfile ].bAgility;// Madd: commenting out this part b/c it breaks doctoring! - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_AGILITY ];
INT8 agilitymodifier = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_AGILITY ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_AGILITY ];
// cap modifier at 25, as currently stats cant go above 127 (INT8)
agilitymodifier = min(25, agilitymodifier);
UINT32 newagility = max(1, agility + agilitymodifier);
newagility = min(126, newagility);
pSoldier->stats.bAgility = newagility;
if ( agilitymodifier > 0 )
{
pSoldier->timeChanges.uiChangeAgilityTime = GetJA2Clock();
pSoldier->usValueGoneUp |= ( AGIL_INCREASE );
}
else if ( agilitymodifier < 0 )
{
pSoldier->timeChanges.uiChangeAgilityTime = GetJA2Clock();
pSoldier->usValueGoneUp &= ~( AGIL_INCREASE );
}
pSoldier->bExtraAgility = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_AGILITY ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_AGILITY ];
//////////////// WISDOM ////////////////
// wisdom we would normally have right now
INT8 wisdom = gMercProfiles[ pSoldier->ubProfile ].bWisdom;// Madd: commenting out this part b/c it breaks doctoring! - pSoldier->ubCriticalStatDamage[ DAMAGED_STAT_WISDOM ];
INT8 wisdommodifier = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_WISDOM ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_WISDOM ];
// cap modifier at 25, as currently stats cant go above 127 (INT8)
wisdommodifier = min(25, wisdommodifier);
UINT32 newwisdom = max(1, wisdom + wisdommodifier);
newwisdom = min(126, newwisdom);
pSoldier->stats.bWisdom = newwisdom;
if ( wisdommodifier > 0 )
{
pSoldier->timeChanges.uiChangeWisdomTime = GetJA2Clock();
pSoldier->usValueGoneUp |= ( WIS_INCREASE );
}
else if ( wisdommodifier < 0 )
{
pSoldier->timeChanges.uiChangeWisdomTime = GetJA2Clock();
pSoldier->usValueGoneUp &= ~( WIS_INCREASE );
}*/
pSoldier->bExtraWisdom = pSoldier->drugs.bDrugEffect[ DRUG_TYPE_WISDOM ] - pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_WISDOM ];
// if our sideeffect count is 1 (which should occur a while AFTER we took the drug), we suddenly become blind for a few turns...
if ( pSoldier->drugs.bDrugEffect[ DRUG_TYPE_BLIND ] == 0 && pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_BLIND ] == 1 )
+1 -1
View File
@@ -289,7 +289,7 @@ void InteractWithClosedDoor( SOLDIERTYPE *pSoldier, UINT8 ubHandleCode )
BOOLEAN DoTrapCheckOnStartingMenu( SOLDIERTYPE * pSoldier, DOOR * pDoor )
{
INT8 bDetectLevel;
INT16 bDetectLevel;
if ( pDoor && pDoor->fLocked && pDoor->ubTrapID != NO_TRAP && pDoor->bPerceivedTrapped == DOOR_PERCEIVED_UNKNOWN )
{
+6 -3
View File
@@ -4599,7 +4599,8 @@ void SetOffBoobyTrap( ITEM_POOL * pItemPool )
BOOLEAN ContinuePastBoobyTrap( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel, INT32 iItemIndex, BOOLEAN fInStrategic, BOOLEAN *pfSaidQuote )
{
BOOLEAN fBoobyTrapKnowledge;
INT8 bTrapDifficulty, bTrapDetectLevel;
INT8 bTrapDifficulty;
INT16 bTrapDetectLevel;
OBJECTTYPE * pObj;
pObj = &(gWorldItems[ iItemIndex ].object);
@@ -5028,7 +5029,8 @@ BOOLEAN NearbyGroundSeemsWrong( SOLDIERTYPE * pSoldier, INT32 sGridNo, BOOLEAN f
{
INT32 sNextGridNo;
// BOOLEAN fWorthChecking = FALSE, fProblemExists = FALSE, fDetectedProblem = FALSE;
UINT8 ubDetectLevel, ubDirection;
UINT16 ubDetectLevel;
UINT8 ubDirection;
MAP_ELEMENT * pMapElement;
UINT32 fCheckFlag;
UINT32 uiWorldBombIndex;
@@ -5451,7 +5453,8 @@ void ToggleItemGlow( BOOLEAN fOn )
BOOLEAN ContinuePastBoobyTrapInMapScreen( OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier )
{
BOOLEAN fBoobyTrapKnowledge;
INT8 bTrapDifficulty, bTrapDetectLevel;
INT8 bTrapDifficulty;
INT16 bTrapDetectLevel;
if ((*pObject)[0]->data.bTrap > 0)
{
+2 -2
View File
@@ -11196,7 +11196,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
//swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s",
INT8 accuracy = (UsingNewCTHSystem()==true?Weapon[ usItem ].nAccuracy:Weapon[ usItem ].bAccuracy);
accuracy *= accuracyheatmultiplicator;
accuracy = (INT8)(accuracy * accuracyheatmultiplicator);
#ifdef CHINESE
swprintf( pStr, ChineseSpecString4,
#else
@@ -11264,7 +11264,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
//Info for weapons
INT8 accuracy = (UsingNewCTHSystem()==true?Weapon[ usItem ].nAccuracy:Weapon[ usItem ].bAccuracy);
accuracy *= accuracyheatmultiplicator;
accuracy = (INT8)(accuracy * accuracyheatmultiplicator);
#ifdef CHINESE
swprintf( pStr, L"%s [%d%£¥]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s",
+21 -17
View File
@@ -572,7 +572,7 @@ void UpdateSelectedSoldier( UINT16 usSoldierID, BOOLEAN fSelect );
void CheckForFacePanelStartAnims( SOLDIERTYPE *pSoldier, INT16 sPanelX, INT16 sPanelY );
void HandleSoldierFaceFlash( SOLDIERTYPE *pSoldier, INT16 sFaceX, INT16 sFaceY );
BOOLEAN PlayerExistsInSlot( UINT8 ubID );
void UpdateStatColor( UINT32 uiTimer, BOOLEAN fIncrease, BOOLEAN fDamaged ); // SADNRO - added argument
void UpdateStatColor( UINT32 uiTimer, BOOLEAN fIncrease, BOOLEAN fDamaged, BOOLEAN fAugmented ); // SANDRO - added argument // Flugente - me too
extern void UpdateItemHatches();
@@ -2755,61 +2755,61 @@ void RenderSMPanel( BOOLEAN *pfDirty )
mprintf( SM_CAMMO_PERCENT_X, SM_CAMMO_PERCENT_Y, L"%%" );
#endif
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeAgilityTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & AGIL_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_AGILITY] > 0 )) ? TRUE : FALSE)); // SANDRO
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeAgilityTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & AGIL_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_AGILITY] > 0 )) ? TRUE : FALSE), MercUnderTheInfluence(gpSMCurrentMerc, DRUG_TYPE_AGILITY)); // SANDRO
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bAgility );
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bAgility + gpSMCurrentMerc->bExtraAgility );
FindFontRightCoordinates(SM_AGI_X, SM_AGI_Y ,SM_STATS_WIDTH ,SM_STATS_HEIGHT ,sString, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY , sString );
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeDexterityTime,( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & DEX_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_DEXTERITY] > 0 )) ? TRUE : FALSE)); // SANDRO
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeDexterityTime,( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & DEX_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_DEXTERITY] > 0 )) ? TRUE : FALSE), MercUnderTheInfluence(gpSMCurrentMerc, DRUG_TYPE_DEXTERITY)); // SANDRO
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bDexterity );
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bDexterity + gpSMCurrentMerc->bExtraDexterity );
FindFontRightCoordinates(SM_DEX_X, SM_DEX_Y ,SM_STATS_WIDTH ,SM_STATS_HEIGHT ,sString, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY , sString );
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeStrengthTime, ( BOOLEAN )( gpSMCurrentMerc->usValueGoneUp & STRENGTH_INCREASE?TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_STRENGTH] > 0 )) ? TRUE : FALSE)); // SANDRO
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeStrengthTime, ( BOOLEAN )( gpSMCurrentMerc->usValueGoneUp & STRENGTH_INCREASE?TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_STRENGTH] > 0 )) ? TRUE : FALSE), MercUnderTheInfluence(gpSMCurrentMerc, DRUG_TYPE_STRENGTH)); // SANDRO
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bStrength );
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bStrength + gpSMCurrentMerc->bExtraStrength );
FindFontRightCoordinates(SM_STR_X, SM_STR_Y ,SM_STATS_WIDTH ,SM_STATS_HEIGHT ,sString, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY , sString );
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeLeadershipTime, ( BOOLEAN )( gpSMCurrentMerc->usValueGoneUp & LDR_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_LEADERSHIP] > 0 )) ? TRUE : FALSE)); // SANDRO
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeLeadershipTime, ( BOOLEAN )( gpSMCurrentMerc->usValueGoneUp & LDR_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_LEADERSHIP] > 0 )) ? TRUE : FALSE), FALSE); // SANDRO
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bLeadership );
FindFontRightCoordinates(SM_CHAR_X, SM_CHAR_Y ,SM_STATS_WIDTH ,SM_STATS_HEIGHT ,sString, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY , sString );
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeWisdomTime,( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & WIS_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_WISDOM] > 0 )) ? TRUE : FALSE)); // SANDRO
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeWisdomTime,( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & WIS_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_WISDOM] > 0 )) ? TRUE : FALSE), MercUnderTheInfluence(gpSMCurrentMerc, DRUG_TYPE_WISDOM)); // SANDRO
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bWisdom );
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bWisdom + gpSMCurrentMerc->bExtraWisdom );
FindFontRightCoordinates(SM_WIS_X, SM_WIS_Y ,SM_STATS_WIDTH ,SM_STATS_HEIGHT ,sString, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY , sString );
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeLevelTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & LVL_INCREASE? TRUE: FALSE ), FALSE );
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeLevelTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & LVL_INCREASE? TRUE: FALSE ), FALSE , FALSE);
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bExpLevel );
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bExpLevel + gpSMCurrentMerc->bExtraExpLevel );
FindFontRightCoordinates(SM_EXPLVL_X, SM_EXPLVL_Y ,SM_STATS_WIDTH ,SM_STATS_HEIGHT ,sString, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY , sString );
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeMarksmanshipTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & MRK_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_MARKSMANSHIP] > 0 )) ? TRUE : FALSE)); // SANDRO
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeMarksmanshipTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & MRK_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_MARKSMANSHIP] > 0 )) ? TRUE : FALSE), FALSE); // SANDRO
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bMarksmanship );
FindFontRightCoordinates(SM_MRKM_X, SM_MRKM_Y ,SM_STATS_WIDTH ,SM_STATS_HEIGHT ,sString, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY , sString );
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeExplosivesTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & EXP_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_EXPLOSIVES] > 0 )) ? TRUE : FALSE)); // SANDRO
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeExplosivesTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & EXP_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_EXPLOSIVES] > 0 )) ? TRUE : FALSE), FALSE); // SANDRO
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bExplosive );
FindFontRightCoordinates(SM_EXPL_X, SM_EXPL_Y ,SM_STATS_WIDTH ,SM_STATS_HEIGHT ,sString, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY , sString );
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeMechanicalTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & MECH_INCREASE ? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_MECHANICAL] > 0 )) ? TRUE : FALSE)); // SANDRO
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeMechanicalTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & MECH_INCREASE ? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_MECHANICAL] > 0 )) ? TRUE : FALSE), FALSE); // SANDRO
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bMechanical );
FindFontRightCoordinates(SM_MECH_X, SM_MECH_Y ,SM_STATS_WIDTH ,SM_STATS_HEIGHT ,sString, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY , sString );
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeMedicalTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & MED_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_MEDICAL] > 0 )) ? TRUE : FALSE)); // SANDRO
UpdateStatColor( gpSMCurrentMerc->timeChanges.uiChangeMedicalTime, ( BOOLEAN ) ( gpSMCurrentMerc->usValueGoneUp & MED_INCREASE? TRUE: FALSE ), ( BOOLEAN ) ( ( gGameOptions.fNewTraitSystem && ( gpSMCurrentMerc->ubCriticalStatDamage[DAMAGED_STAT_MEDICAL] > 0 )) ? TRUE : FALSE), FALSE); // SANDRO
swprintf( sString, L"%2d", gpSMCurrentMerc->stats.bMedical );
FindFontRightCoordinates(SM_MED_X, SM_MED_Y ,SM_STATS_WIDTH ,SM_STATS_HEIGHT ,sString, BLOCKFONT2, &usX, &usY);
@@ -3057,7 +3057,7 @@ void RenderSMPanel( BOOLEAN *pfDirty )
}
void UpdateStatColor( UINT32 uiTimer, BOOLEAN fIncrease, BOOLEAN fDamaged ) // SANDRO - added argument
void UpdateStatColor( UINT32 uiTimer, BOOLEAN fIncrease, BOOLEAN fDamaged, BOOLEAN fAugmented ) // SANDRO - added argument // Flugente - me too
{
if ( gpSMCurrentMerc->stats.bLife >= OKLIFE )
{
@@ -3077,6 +3077,10 @@ void UpdateStatColor( UINT32 uiTimer, BOOLEAN fIncrease, BOOLEAN fDamaged ) // S
SetFontForeground( FONT_RED );
}
}
else if ( fAugmented )
{
SetRGBFontForeground( 250, 5, 250 );
}
else
{
SetFontBackground( FONT_MCOLOR_BLACK );
+7 -7
View File
@@ -3042,7 +3042,7 @@ UINT32 CalculateCarriedWeight( SOLDIERTYPE * pSoldier )
UINT32 uiTotalWeight = 0;
UINT32 uiPercent;
UINT8 ubLoop;
UINT16 ubStrengthForCarrying;
UINT32 ubStrengthForCarrying;
//Pulmu: Changes for dynamic ammo weight
for( ubLoop = 0; ubLoop < pSoldier->inv.size(); ubLoop++)
@@ -3053,7 +3053,7 @@ UINT32 CalculateCarriedWeight( SOLDIERTYPE * pSoldier )
// for now, assume soldiers can carry 1/2 their strength in KGs without penalty.
// instead of multiplying by 100 for percent, and then dividing by 10 to account
// for weight units being in 10ths of kilos, not kilos... we just start with 10 instead of 100!
ubStrengthForCarrying = EffectiveStrength( pSoldier );
ubStrengthForCarrying = EffectiveStrength( pSoldier, FALSE );
if ( ubStrengthForCarrying > 80 )
{
ubStrengthForCarrying += (ubStrengthForCarrying - 80);
@@ -12991,17 +12991,17 @@ INT32 GetGunAccuracy( OBJECTTYPE *pObj )
if ( gGameOptions.fWeaponOverheating )
{
FLOAT overheatdamagepercentage = GetGunOverheatDamagePercentage( pObj );
FLOAT accuracymalus = (max((FLOAT)1.0, overheatdamagepercentage) - (FLOAT)1.0) * 0.1;
accuracyheatmultiplicator = max((FLOAT)0.0, (FLOAT)1.0 - accuracymalus);
FLOAT accuracymalus = (max(1.0f, overheatdamagepercentage) - 1.0f) * 0.1;
accuracyheatmultiplicator = max(0.0f, 1.0f - accuracymalus);
}
if(UsingNewCTHSystem() == false)
return(accuracyheatmultiplicator * Weapon[pObj->usItem].bAccuracy);
return( (INT32)(accuracyheatmultiplicator * Weapon[pObj->usItem].bAccuracy) );
INT32 bonus = 0;
if ( pObj->exists() == true )
{
bonus = accuracyheatmultiplicator * Weapon[Item[pObj->usItem].uiIndex].nAccuracy;
bonus = (INT32)(accuracyheatmultiplicator * Weapon[Item[pObj->usItem].uiIndex].nAccuracy);
bonus = (bonus * (*pObj)[0]->data.gun.bGunStatus) / 100;
INT32 iModifier = GetAccuracyModifier( pObj );
@@ -13487,7 +13487,7 @@ BOOLEAN OBJECTTYPE::TransformObject( SOLDIERTYPE * pSoldier, UINT8 ubStatusIndex
UINT16 usOrigItem = this->usItem;
UINT32 uiOrigClass = Item[this->usItem].usItemClass;
UINT8 ubOrigNumObjects = this->ubNumberOfObjects;
UINT8 ubOrigStatus = (*this)[ubStatusIndex]->data.objectStatus; //Madd: moved this up here, since it was getting corrupted when applied to multiple results -- all statuses were coming back as 0
INT16 ubOrigStatus = (*this)[ubStatusIndex]->data.objectStatus; //Madd: moved this up here, since it was getting corrupted when applied to multiple results -- all statuses were coming back as 0
UINT16 usAPCost = 0;
INT32 iBPCost = 0;
+5 -4
View File
@@ -306,7 +306,8 @@ BOOLEAN AttemptToLockDoor( SOLDIERTYPE * pSoldier, DOOR * pDoor )
BOOLEAN AttemptToCrowbarLock( SOLDIERTYPE * pSoldier, DOOR * pDoor )
{
INT32 iResult;
INT8 bStress, bSlot;
INT16 bStress;
INT8 bSlot;
bSlot = FindUsableCrowbar( pSoldier );
if ( bSlot == ITEM_NOT_FOUND )
@@ -339,7 +340,7 @@ BOOLEAN AttemptToCrowbarLock( SOLDIERTYPE * pSoldier, DOOR * pDoor )
}
// possibly damage crowbar
bStress = __min( EffectiveStrength( pSoldier ), LockTable[pDoor->ubLockID].ubSmashDifficulty + 30 );
bStress = __min( EffectiveStrength( pSoldier, FALSE ), LockTable[pDoor->ubLockID].ubSmashDifficulty + 30 );
// reduce crowbar status by random % between 0 and 5%
DamageObj( &(pSoldier->inv[ bSlot ]), (INT8) PreRandom( bStress / 20 ) );
@@ -597,7 +598,7 @@ BOOLEAN AttemptToUntrapDoor( SOLDIERTYPE * pSoldier, DOOR * pDoor )
BOOLEAN ExamineDoorForTraps( SOLDIERTYPE * pSoldier, DOOR * pDoor )
{
// Check to see if there is a trap or not on this door
INT8 bDetectLevel;
INT16 bDetectLevel;
if (pDoor->ubTrapID == NO_TRAP)
{
@@ -632,7 +633,7 @@ BOOLEAN ExamineDoorForTraps( SOLDIERTYPE * pSoldier, DOOR * pDoor )
BOOLEAN HasDoorTrapGoneOff( SOLDIERTYPE * pSoldier, DOOR * pDoor )
{
// Check to see if the soldier causes the trap to go off
INT8 bDetectLevel;
INT16 bDetectLevel;
if (pDoor->ubTrapID != NO_TRAP)
{
+7 -7
View File
@@ -7339,7 +7339,7 @@ void CalcTargetMovementOffset( SOLDIERTYPE *pShooter, SOLDIERTYPE *pTarget, OBJE
// Now let's figure out how competent our shooter is.
FLOAT iCombinedSkill = gGameCTHConstants.MOVEMENT_MRK * EffectiveMarksmanship( pShooter );
iCombinedSkill += gGameCTHConstants.MOVEMENT_WIS * EffectiveWisdom( pShooter );
iCombinedSkill += gGameCTHConstants.MOVEMENT_DEX * EffectiveDexterity( pShooter );
iCombinedSkill += gGameCTHConstants.MOVEMENT_DEX * EffectiveDexterity( pShooter, FALSE );
iCombinedSkill += gGameCTHConstants.MOVEMENT_EXP_LEVEL * (EffectiveExpLevel( pShooter ) * 10);
// Average
@@ -7514,7 +7514,7 @@ void CalcRangeCompensationOffset( SOLDIERTYPE *pShooter, FLOAT *dMuzzleOffsetY,
// matter, and a skilled shooter will have a far greater chance of guessing the extra muzzle angle required.
FLOAT iCombinedSkill = gGameCTHConstants.MOVEMENT_MRK * EffectiveMarksmanship( pShooter );
iCombinedSkill += gGameCTHConstants.MOVEMENT_WIS * EffectiveWisdom( pShooter );
iCombinedSkill += gGameCTHConstants.MOVEMENT_DEX * EffectiveDexterity( pShooter );
iCombinedSkill += gGameCTHConstants.MOVEMENT_DEX * EffectiveDexterity( pShooter, FALSE );
iCombinedSkill += gGameCTHConstants.MOVEMENT_EXP_LEVEL * (EffectiveExpLevel( pShooter ) * 10);
// Average
@@ -7839,7 +7839,7 @@ UINT32 CalcCounterForceFrequency(SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon)
{
INT8 traitLoop;
FLOAT iCounterForceFrequency = gGameCTHConstants.RECOIL_COUNTER_FREQUENCY_AGI * EffectiveAgility(pShooter);
FLOAT iCounterForceFrequency = gGameCTHConstants.RECOIL_COUNTER_FREQUENCY_AGI * EffectiveAgility(pShooter, FALSE);
iCounterForceFrequency += gGameCTHConstants.RECOIL_COUNTER_FREQUENCY_EXP_LEVEL * EffectiveExpLevel(pShooter) * 10;
// Average
@@ -7895,8 +7895,8 @@ FLOAT CalcCounterForceMax(SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon, UINT8 uiSt
if(uiStance == 0)
uiStance = gAnimControl[ pShooter->usAnimState ].ubHeight;
FLOAT iCounterForceMax = gGameCTHConstants.RECOIL_MAX_COUNTER_STR * EffectiveStrength(pShooter);
iCounterForceMax += gGameCTHConstants.RECOIL_MAX_COUNTER_AGI * EffectiveAgility(pShooter);
FLOAT iCounterForceMax = gGameCTHConstants.RECOIL_MAX_COUNTER_STR * EffectiveStrength(pShooter, FALSE);
iCounterForceMax += gGameCTHConstants.RECOIL_MAX_COUNTER_AGI * EffectiveAgility(pShooter, FALSE);
iCounterForceMax += gGameCTHConstants.RECOIL_MAX_COUNTER_EXP_LEVEL * EffectiveExpLevel(pShooter) * 10;
FLOAT iDivisor = gGameCTHConstants.RECOIL_MAX_COUNTER_STR +
@@ -7921,9 +7921,9 @@ UINT32 CalcCounterForceAccuracy(SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon, UINT
{
INT8 traitLoop;
FLOAT iCounterForceAccuracy = gGameCTHConstants.RECOIL_COUNTER_ACCURACY_DEX * EffectiveDexterity(pShooter);
FLOAT iCounterForceAccuracy = gGameCTHConstants.RECOIL_COUNTER_ACCURACY_DEX * EffectiveDexterity(pShooter, FALSE);
iCounterForceAccuracy += gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS * EffectiveWisdom(pShooter);
iCounterForceAccuracy += gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI * EffectiveAgility(pShooter);
iCounterForceAccuracy += gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI * EffectiveAgility(pShooter, FALSE);
iCounterForceAccuracy += gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL * EffectiveExpLevel(pShooter) * 10;
FLOAT iDivisor = gGameCTHConstants.RECOIL_COUNTER_ACCURACY_DEX +
+4 -4
View File
@@ -236,10 +236,10 @@ FLOAT CalcCounterForceChange( SOLDIERTYPE * pShooter, UINT32 uiCounterForceAccur
// HEADROCK HAM 4: Required for shooting mechanic
extern INT8 EffectiveMarksmanship( SOLDIERTYPE * pSoldier );
extern INT8 EffectiveWisdom( SOLDIERTYPE * pSoldier );
extern INT16 EffectiveWisdom( SOLDIERTYPE * pSoldier );
extern INT8 EffectiveExpLevel( SOLDIERTYPE * pSoldier );
extern INT8 EffectiveDexterity( SOLDIERTYPE * pSoldier );
extern INT8 EffectiveStrength( SOLDIERTYPE * pSoldier );
extern INT8 EffectiveAgility( SOLDIERTYPE * pSoldier );
extern INT16 EffectiveDexterity( SOLDIERTYPE * pSoldier, BOOLEAN fTrainer );
extern INT16 EffectiveStrength( SOLDIERTYPE * pSoldier, BOOLEAN fTrainer );
extern INT16 EffectiveAgility( SOLDIERTYPE * pSoldier, BOOLEAN fTrainer );
#endif
+4 -4
View File
@@ -1726,9 +1726,9 @@ INT16 MinAPsToAttack(SOLDIERTYPE *pSoldier, INT32 sGridno, UINT8 ubAddTurningCos
return sAPCost;
}
INT8 CalcAimSkill( SOLDIERTYPE * pSoldier, UINT16 usWeapon )
INT16 CalcAimSkill( SOLDIERTYPE * pSoldier, UINT16 usWeapon )
{
INT8 bAimSkill;
INT16 bAimSkill;
if ( Item[ usWeapon ].usItemClass == IC_GUN || Item[ usWeapon ].usItemClass == IC_LAUNCHER )
{
@@ -1740,7 +1740,7 @@ INT8 CalcAimSkill( SOLDIERTYPE * pSoldier, UINT16 usWeapon )
//if ( Item[ usInHand ].usItemClass == IC_BLADE )
{
// KNIVES: modify aiming cost by avg of attacker's DEXTERITY & AGILITY
bAimSkill = ( EffectiveDexterity( pSoldier ) + EffectiveAgility( pSoldier ) ) / 2;
bAimSkill = ( EffectiveDexterity( pSoldier, FALSE ) + EffectiveAgility( pSoldier, FALSE ) ) / 2;
//return( 4 );
}
return( bAimSkill );
@@ -1938,7 +1938,7 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubAddTurni
UINT32 uiMercFlags;
UINT16 usTargID;
INT16 bFullAPs;
INT8 bAimSkill;
INT16 bAimSkill;
INT16 bAPCost = APBPConstants[AP_MIN_AIM_ATTACK];
BOOLEAN fAddingTurningCost = FALSE;
BOOLEAN fAddingRaiseGunCost = FALSE;
+74 -2
View File
@@ -46,6 +46,7 @@
#include "Campaign Types.h"
//#include "Queen Command.h"
#include "text.h" // added by Flugente
#endif
#include "Animation Control.h"
@@ -2268,8 +2269,20 @@ void CreateZombiefromCorpse( ROTTING_CORPSE * pCorpse, UINT16 usAnimState )
pNewSoldier->bPoisonAbsorption = 200 + Random(100);
//////////////////////////////////////////////////////////////////////
memcpy( &(pNewSoldier->name), &(pCorpse->name), sizeof(CHAR16) * 10 );
pNewSoldier->name[9] = '\0';
if ( !memcmp( pCorpse->name, TacticalStr[ CIV_TEAM_MINER_NAME ], sizeof(pCorpse->name) )
|| !memcmp( pCorpse->name, TacticalStr[ MILITIA_TEAM_MERC_NAME ], sizeof(pCorpse->name) )
|| !memcmp( pCorpse->name, TacticalStr[ CREATURE_TEAM_MERC_NAME ], sizeof(pCorpse->name) )
|| !memcmp( pCorpse->name, TacticalStr[ CIV_TEAM_MERC_NAME ], sizeof(pCorpse->name) )
|| !memcmp( pCorpse->name, TacticalStr[ ZOMBIE_TEAM_MERC_NAME ], sizeof(pCorpse->name) )
|| !memcmp( pCorpse->name, TacticalStr[ ENEMY_TEAM_MERC_NAME ], sizeof(pCorpse->name) ) )
{
swprintf( pNewSoldier->name, TacticalStr[ ZOMBIE_TEAM_MERC_NAME ] );
}
else
{
memcpy( &(pNewSoldier->name), &(pCorpse->name), sizeof(CHAR16) * 10 );
pNewSoldier->name[9] = '\0';
}
// add skills according to difficulty level
switch( gGameExternalOptions.sZombieDifficultyLevel )
@@ -2369,6 +2382,65 @@ void CreateZombiefromCorpse( ROTTING_CORPSE * pCorpse, UINT16 usAnimState )
// Set a pending animation to change stance first...
//SendChangeSoldierStanceEvent( pNewSoldier, ANIM_CROUCH );
// search for armour and equip if found
if ( gGameExternalOptions.fZombieRiseWithArmour )
{
BOOLEAN fHelmetFound = FALSE;
BOOLEAN fVestFound = FALSE;
BOOLEAN fPantsFound = FALSE;
ITEM_POOL * pItemPool, * pItemPoolNext;
GetItemPool( pCorpse->def.sGridNo, &pItemPool, pCorpse->def.bLevel );
while( pItemPool && ( !fHelmetFound || !fVestFound ||!fPantsFound ) )
{
pItemPoolNext = pItemPool->pNext;
OBJECTTYPE* pObj = &(gWorldItems[ pItemPool->iItemIndex ].object);
if ( Item[ pObj->usItem ].usItemClass == IC_ARMOUR )
{
switch (Armour[Item[pObj->usItem].ubClassIndex].ubArmourClass)
{
case ARMOURCLASS_HELMET:
{
if( !fHelmetFound && AutoPlaceObject(pNewSoldier, pObj, FALSE))
{
// remove item from the ground
RemoveItemFromPool( pCorpse->def.sGridNo, pItemPool->iItemIndex, pCorpse->def.bLevel );
fHelmetFound = TRUE;
}
break;
}
case ARMOURCLASS_VEST:
{
if( !fVestFound && AutoPlaceObject(pNewSoldier, pObj, FALSE))
{
// remove item from the ground
RemoveItemFromPool( pCorpse->def.sGridNo, pItemPool->iItemIndex, pCorpse->def.bLevel );
fVestFound = TRUE;
}
break;
}
case ARMOURCLASS_LEGGINGS:
{
if( !fPantsFound && AutoPlaceObject(pNewSoldier, pObj, FALSE))
{
// remove item from the ground
RemoveItemFromPool( pCorpse->def.sGridNo, pItemPool->iItemIndex, pCorpse->def.bLevel );
fPantsFound = TRUE;
}
break;
}
default:
break;
}
}
pItemPool = pItemPoolNext;
}
}
// Change to standing,unless we can getup with an animation
pNewSoldier->EVENT_InitNewSoldierAnim( STANDING, 0, TRUE );
+39 -21
View File
@@ -18,7 +18,7 @@
#include "Soldier Control.h"
#endif
INT8 EffectiveStrength( SOLDIERTYPE *pSoldier)
INT16 EffectiveStrength( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer )
{
INT8 bBandaged;
INT32 iEffStrength;
@@ -29,9 +29,17 @@ INT8 EffectiveStrength( SOLDIERTYPE *pSoldier)
bBandaged = pSoldier->stats.bLifeMax - pSoldier->stats.bLife - pSoldier->bBleeding;
if (pSoldier->stats.bStrength > 0)
{
iEffStrength = ( pSoldier->stats.bStrength )/ 2;
iEffStrength += ( (pSoldier->stats.bStrength ) / 2) * (pSoldier->stats.bLife + bBandaged / 2) / (pSoldier->stats.bLifeMax);
{
if ( fTrainer )
{
iEffStrength = pSoldier->stats.bStrength / 2;
iEffStrength += ( pSoldier->stats.bStrength / 2) * (pSoldier->stats.bLife + bBandaged / 2) / (pSoldier->stats.bLifeMax);
}
else
{
iEffStrength = ( pSoldier->stats.bStrength + pSoldier->bExtraStrength )/ 2;
iEffStrength += ( (pSoldier->stats.bStrength + pSoldier->bExtraStrength) / 2) * (pSoldier->stats.bLife + bBandaged / 2) / (pSoldier->stats.bLifeMax);
}
}
else
{
@@ -41,27 +49,32 @@ INT8 EffectiveStrength( SOLDIERTYPE *pSoldier)
// ATE: Make sure at least 2...
iEffStrength = __max( iEffStrength, 2 );
return( (INT8) iEffStrength );
return( (INT16) iEffStrength );
}
INT8 EffectiveWisdom( SOLDIERTYPE * pSoldier )
INT16 EffectiveWisdom( SOLDIERTYPE * pSoldier)
{
INT32 iEffWisdom;
iEffWisdom = pSoldier->stats.bWisdom;
iEffWisdom += pSoldier->bExtraWisdom;
iEffWisdom = EffectStatForBeingDrunk( pSoldier, iEffWisdom );
return( (INT8) iEffWisdom );
return( (INT16) iEffWisdom );
}
INT8 EffectiveAgility( SOLDIERTYPE * pSoldier )
INT16 EffectiveAgility( SOLDIERTYPE * pSoldier, BOOLEAN fTrainer )
{
INT32 iEffAgility;
iEffAgility = pSoldier->stats.bAgility;
if ( !fTrainer )
iEffAgility += pSoldier->bExtraAgility;
iEffAgility = EffectStatForBeingDrunk( pSoldier, iEffAgility );
if ( pSoldier->sWeightCarriedAtTurnStart > 100 )
@@ -69,7 +82,7 @@ INT8 EffectiveAgility( SOLDIERTYPE * pSoldier )
iEffAgility = (iEffAgility * 100) / pSoldier->sWeightCarriedAtTurnStart;
}
return( (INT8) iEffAgility );
return( (INT16) iEffAgility );
}
@@ -164,6 +177,8 @@ INT8 EffectiveExpLevel( SOLDIERTYPE * pSoldier )
iEffExpLevel -= 1;
}
}
iEffExpLevel += pSoldier->bExtraExpLevel;
if (iEffExpLevel > 10)
{
@@ -192,15 +207,18 @@ INT8 EffectiveMarksmanship( SOLDIERTYPE * pSoldier )
return( (INT8) iEffMarksmanship );
}
INT8 EffectiveDexterity( SOLDIERTYPE * pSoldier )
INT16 EffectiveDexterity( SOLDIERTYPE * pSoldier, BOOLEAN fTrainer )
{
INT32 iEffDexterity;
iEffDexterity = pSoldier->stats.bDexterity;
if ( !fTrainer )
iEffDexterity += pSoldier->bExtraDexterity;
iEffDexterity = EffectStatForBeingDrunk( pSoldier, iEffDexterity );
return( (INT8) iEffDexterity );
return( (INT16) iEffDexterity );
}
@@ -220,7 +238,7 @@ UINT8 GetPenaltyForFatigue( SOLDIERTYPE *pSoldier )
return( ubPercentPenalty );
}
void ReducePointsForFatigue( SOLDIERTYPE *pSoldier, UINT16 *pusPoints )
void ReducePointsForFatigue( SOLDIERTYPE *pSoldier, UINT32 *pusPoints )
{
*pusPoints -= (*pusPoints * GetPenaltyForFatigue( pSoldier )) / 100;
}
@@ -259,7 +277,7 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
// adjust skill based on wisdom (knowledge)
iSkill = iSkill * (EffectiveWisdom( pSoldier ) + 100) / 200;
// and dexterity (clumsy?)
iSkill = iSkill * (EffectiveDexterity( pSoldier ) + 100) / 200;
iSkill = iSkill * (EffectiveDexterity( pSoldier, FALSE ) + 100) / 200;
// factor in experience
iSkill = iSkill + EffectiveExpLevel( pSoldier ) * 3;
@@ -310,7 +328,7 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
{
break;
}
iSkill = (iSkill * 3 + EffectiveDexterity( pSoldier ) ) / 4;
iSkill = (iSkill * 3 + EffectiveDexterity( pSoldier, FALSE ) ) / 4;
// SANDRO - STOMP traits - Demolitions trait detonator attaching bonus
if ( gGameOptions.fNewTraitSystem )
@@ -401,7 +419,7 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
}
}
iSkill += EffectiveDexterity( pSoldier ) * 2;
iSkill += EffectiveDexterity( pSoldier, FALSE ) * 2;
iSkill += EffectiveExpLevel( pSoldier ) * 10;
iSkill = iSkill / 10; // bring the value down to a percentage
@@ -445,7 +463,7 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
break;
}
}
iSkill += EffectiveDexterity( pSoldier ) * 2;
iSkill += EffectiveDexterity( pSoldier, FALSE ) * 2;
iSkill += EffectiveExpLevel( pSoldier ) * 10;
iSkill = iSkill / 10; // bring the value down to a percentage
// penalty based on poor wisdom
@@ -475,12 +493,12 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
case OPEN_WITH_CROWBAR:
// Add for crowbar...
iSkill = EffectiveStrength( pSoldier ) + 20;
iSkill = EffectiveStrength( pSoldier, FALSE ) + 20;
fForceDamnSound = TRUE;
break;
case SMASH_DOOR_CHECK:
iSkill = EffectiveStrength( pSoldier );
iSkill = EffectiveStrength( pSoldier, FALSE );
// SANDRO - STOMP traits - Martial Arts trait kick doors bonus
if ( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, MARTIAL_ARTS_NT ))
{
@@ -519,7 +537,7 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
// adjust skill based on wisdom (knowledge)
iSkill = iSkill * (EffectiveWisdom( pSoldier ) + 100) / 200;
// and dexterity (clumsy?)
iSkill = iSkill * (EffectiveDexterity( pSoldier ) + 100) / 200;
iSkill = iSkill * (EffectiveDexterity( pSoldier, FALSE ) + 100) / 200;
// factor in experience
iSkill = iSkill + EffectiveExpLevel( pSoldier ) * 3;
@@ -777,11 +795,11 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
}
INT8 CalcTrapDetectLevel( SOLDIERTYPE * pSoldier, BOOLEAN fExamining )
INT16 CalcTrapDetectLevel( SOLDIERTYPE * pSoldier, BOOLEAN fExamining )
{
// return the level of trap which the guy is able to detect
INT8 bDetectLevel;
INT16 bDetectLevel;
// formula: 1 pt for every exp_level
// plus 1 pt for every 40 explosives
+6 -6
View File
@@ -5,20 +5,20 @@
#include "types.h"
#include "Soldier Control.h"
extern void ReducePointsForFatigue( SOLDIERTYPE *pSoldier, UINT16 *pusPoints );
extern void ReducePointsForFatigue( SOLDIERTYPE *pSoldier, UINT32 *pusPoints );
extern INT32 GetSkillCheckPenaltyForFatigue( SOLDIERTYPE *pSoldier, INT32 iSkill );
extern INT32 SkillCheck( SOLDIERTYPE *pSoldier, INT8 bReason, INT8 bDifficulty );
extern INT8 CalcTrapDetectLevel( SOLDIERTYPE *pSoldier, BOOLEAN fExamining );
extern INT16 CalcTrapDetectLevel( SOLDIERTYPE *pSoldier, BOOLEAN fExamining );
extern INT8 EffectiveStrength( SOLDIERTYPE *pSoldier );
extern INT8 EffectiveWisdom( SOLDIERTYPE *pSoldier );
extern INT8 EffectiveAgility( SOLDIERTYPE *pSoldier );
extern INT16 EffectiveStrength( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer );
extern INT16 EffectiveWisdom( SOLDIERTYPE *pSoldier );
extern INT16 EffectiveAgility( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer );
extern INT8 EffectiveMechanical( SOLDIERTYPE *pSoldier );
extern INT8 EffectiveExplosive( SOLDIERTYPE *pSoldier );
extern INT8 EffectiveLeadership( SOLDIERTYPE *pSoldier );
extern INT8 EffectiveMarksmanship( SOLDIERTYPE *pSoldier );
extern INT8 EffectiveDexterity( SOLDIERTYPE *pSoldier );
extern INT16 EffectiveDexterity( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer );
extern INT8 EffectiveExpLevel( SOLDIERTYPE *pSoldier );
extern INT8 EffectiveMedical( SOLDIERTYPE *pSoldier );
+21 -8
View File
@@ -1914,9 +1914,9 @@ INT16 SOLDIERTYPE::CalcActionPoints( void )
// 2 * this->stats.bLifeMax +
// 2 * EffectiveDexterity( this ) ) + 20) / 40);
ubPoints = 20 + (((10 * EffectiveExpLevel( this ) +
3 * EffectiveAgility( this ) +
3 * EffectiveAgility( this, FALSE ) +
2 * this->stats.bLifeMax +
2 * EffectiveDexterity( this ) ) + 5) / 10);
2 * EffectiveDexterity( this, FALSE ) ) + 5) / 10);
//if (GameOption[INCREASEDAP] % 2 == 1)
//points += APBPConstants[AP_INCREASE];
@@ -7063,6 +7063,9 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou
this->aiData.bUnderFire--;
}
// Flugente: reset extra stats. Currently they only depend on drug effects, and those are reset every turn
this->ResetExtraStats();
// ATE: Add decay effect sfor drugs...
if ( fFromRealTime ) //&& iRealTimeCounter % 300 )
{
@@ -8085,7 +8088,8 @@ void CalculateSoldierAniSpeed( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pStatsSoldier
UINT32 uiTerrainDelay;
UINT32 uiSpeed = 0;
INT8 bBreathDef, bLifeDef, bAgilDef;
INT8 bBreathDef, bLifeDef;
INT16 bAgilDef;
INT8 bAdditional = 0;
// for those animations which have a speed of zero, we have to calculate it
@@ -8208,7 +8212,7 @@ void CalculateSoldierAniSpeed( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pStatsSoldier
if ( bBreathDef > 30 )
bBreathDef = 30;
bAgilDef = 50 - ( EffectiveAgility( pStatsSoldier ) / 4 );
bAgilDef = 50 - ( EffectiveAgility( pStatsSoldier, FALSE ) / 4 );
bLifeDef = 50 - ( pStatsSoldier->stats.bLife / 2 );
uiTerrainDelay += ( bLifeDef + bBreathDef + bAgilDef + bAdditional );
@@ -8833,7 +8837,7 @@ UINT32 SleepDartSuccumbChance( SOLDIERTYPE * pSoldier )
INT16 bEffectiveStrength;
// figure out base chance of succumbing,
bEffectiveStrength = EffectiveStrength( pSoldier );
bEffectiveStrength = EffectiveStrength( pSoldier, TRUE );
if (bEffectiveStrength > 90)
{
@@ -9428,7 +9432,7 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
INT16 sTestOne, sTestTwo, sChanceToDrop;
INT8 bVisible = -1;
sTestOne = EffectiveStrength( this );
sTestOne = EffectiveStrength( this, FALSE );
sTestTwo = ( 2 * ( __max( sLifeDeduct, ( sBreathLoss / 100 ) ) ) );
@@ -11894,14 +11898,14 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
uiDressSkill = ( ( 7 * EffectiveMedical( this ) ) + // medical knowledge
( sStatus) + // state of medical kit
(10 * EffectiveExpLevel( this ) ) + // battle injury experience
EffectiveDexterity( this ) ) / 10; // general "handiness"
EffectiveDexterity( this, FALSE ) ) / 10; // general "handiness"
}
else
{
uiDressSkill = ( ( 3 * EffectiveMedical( this ) ) + // medical knowledge
( 2 * sStatus) + // state of medical kit
(10 * EffectiveExpLevel( this ) ) + // battle injury experience
EffectiveDexterity( this ) ) / 7; // general "handiness"
EffectiveDexterity( this, FALSE ) ) / 7; // general "handiness"
}
// try to use every AP that the merc has left
@@ -13494,6 +13498,15 @@ INT16 SOLDIERTYPE::GetPoisonDamagePercentage( void )
return( val );
}
// reset the extra stat variables
void SOLDIERTYPE::ResetExtraStats()
{
bExtraStrength = 0;
bExtraDexterity = 0;
bExtraAgility = 0;
bExtraWisdom = 0;
bExtraExpLevel = 0;
}
INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
+12
View File
@@ -1158,6 +1158,15 @@ public:
INT16 bPoisonAbsorption; // for x points of poison damage received, you gain x * (bPoisonAbsorption / 100) poison life points
///////////////////////////////////////////////////////
// Flugente: new variables for extra stats
INT16 bExtraStrength; // additional strength gained via power armor
INT16 bExtraDexterity; // additional dexterity gained via drugs
INT16 bExtraAgility; // additional agility gained via drugs
INT16 bExtraWisdom; // additional wisdom gained via drugs
INT8 bExtraExpLevel; // corruption can temporarily alter our ExpLevel without messing up our stats this way
INT32 bSoldierFlagMask; // for various soldier-related flags (Illusion, Kill streak, etc.). Easier than adding 32 bool variables
#ifdef JA2UB
//ja25
@@ -1355,6 +1364,9 @@ public:
INT16 GetPoisonAbsorption( void );
// returns the poison percentage of the damage we will be doing with the weapon currently in our hand
INT16 GetPoisonDamagePercentage( void );
// reset the extra stat variables
void ResetExtraStats();
//////////////////////////////////////////////////////////////////////////////
}; // SOLDIERTYPE;
+2 -2
View File
@@ -1759,13 +1759,13 @@ INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, UINT8 ubOpponentID, BOOLEAN f
//iPoints = EffectiveExpLevel( MercPtrs[ pSoldier->ubRobotRemoteHolderID ] ) - 2;
// Snap: (do some proper rounding here)
iPoints = ( 20*EffectiveExpLevel( MercPtrs[ pSoldier->ubRobotRemoteHolderID ] )
+ EffectiveAgility( MercPtrs[ pSoldier->ubRobotRemoteHolderID ] ) + 15 ) / 30 - 2;
+ EffectiveAgility( MercPtrs[ pSoldier->ubRobotRemoteHolderID ], FALSE ) + 15 ) / 30 - 2;
}
else
{
//iPoints = EffectiveExpLevel( pSoldier );
// Snap:
iPoints = ( 20*EffectiveExpLevel( pSoldier ) + EffectiveAgility( pSoldier ) + 15 ) / 30;
iPoints = ( 20*EffectiveExpLevel( pSoldier ) + EffectiveAgility( pSoldier, FALSE ) + 15 ) / 30;
/*
if ( pSoldier->bTeam == ENEMY_TEAM )
+35 -29
View File
@@ -4790,8 +4790,8 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
INT8 bExperience = EffectiveExpLevel( pSoldier );
INT8 bMarksmanship = EffectiveMarksmanship( pSoldier );
INT8 bDexterity = EffectiveDexterity( pSoldier );;
INT8 bWisdom = EffectiveWisdom( pSoldier );
INT16 bDexterity = EffectiveDexterity( pSoldier, FALSE );
INT16 bWisdom = EffectiveWisdom( pSoldier );
if ( bMarksmanship == 0 || bDexterity == 0 )
{
@@ -6165,7 +6165,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
// Determine iMarksmanship and Base CTH
if (Item[usItemUsed].rocketlauncher ){
// use the same calculation as for mechanical thrown weapons
iMarksmanship = ( EffectiveDexterity( pSoldier ) + EffectiveMarksmanship( pSoldier ) + EffectiveWisdom( pSoldier ) + (10 * EffectiveExpLevel( pSoldier ) )) / 4;
iMarksmanship = ( EffectiveDexterity( pSoldier, FALSE ) + EffectiveMarksmanship( pSoldier ) + EffectiveWisdom( pSoldier ) + (10 * EffectiveExpLevel( pSoldier ) )) / 4;
// heavy weapons trait helps out
if (HAS_SKILL_TRAIT( pSoldier, HEAVY_WEAPS_OT ) && !( gGameOptions.fNewTraitSystem )) // SANDRO - old/new traits
iMarksmanship += gbSkillTraitBonus[HEAVY_WEAPS_OT] * NUM_SKILL_TRAITS( pSoldier, HEAVY_WEAPS_OT );
@@ -6326,7 +6326,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
// but ability to dodge is reduced if crouched or prone!
if (pTarget->aiData.bOppList[pSoldier->ubID] == SEEN_CURRENTLY && !TANK( pTarget ) && !(pSoldier->ubBodyType != QUEENMONSTER) )
{
iPenalty = ( EffectiveAgility( pTarget ) / 5 + EffectiveExpLevel( pTarget ) * 2);
iPenalty = ( EffectiveAgility( pTarget, FALSE ) / 5 + EffectiveExpLevel( pTarget ) * 2);
switch( gAnimControl[ pTarget->usAnimState ].ubHeight )
{
case ANIM_CROUCH:
@@ -6338,7 +6338,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
}
// reduce dodge ability by the attacker's stats
iBonus = ( EffectiveDexterity( pSoldier ) / 5 + EffectiveExpLevel( pSoldier ) * 2);
iBonus = ( EffectiveDexterity( pSoldier, FALSE ) / 5 + EffectiveExpLevel( pSoldier ) * 2);
if ( TANK( pTarget ) || (pSoldier->ubBodyType != QUEENMONSTER) )
{
// reduce ability to track shots
@@ -6929,7 +6929,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
// breath penalty is based on % breath missing (max 1/2 chance)
iPenalty = (iChance * (100 - pSoldier->bBreath)) / 200;
// reduce breath penalty due to merc's dexterity (he can compensate!)
iChance -= (iPenalty * (100 - ( EffectiveDexterity( pSoldier ) - 10))) / 100;
iChance -= (iPenalty * (100 - ( EffectiveDexterity( pSoldier, FALSE ) - 10))) / 100;
}
/////////////////////////////////////////////////////////////////////////////////////
@@ -9227,7 +9227,7 @@ INT32 HTHImpact( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTarget, INT32 iHitBy, BO
iImpact += GetDamage(pObj);
iImpact += EffectiveStrength( pSoldier ) / 20; // 0 to 5 for strength, adjusted by damage taken
iImpact += EffectiveStrength( pSoldier, FALSE ) / 20; // 0 to 5 for strength, adjusted by damage taken
if ( AM_A_ROBOT( pTarget ) )
{
@@ -9237,7 +9237,7 @@ INT32 HTHImpact( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTarget, INT32 iHitBy, BO
else
{
iImpact = ( EffectiveExpLevel( pSoldier ) / 2); // 0 to 4 for level
iImpact += EffectiveStrength( pSoldier ) / 5; // 0 to 20 for strength, adjusted by damage taken
iImpact += EffectiveStrength( pSoldier, FALSE ) / 5; // 0 to 20 for strength, adjusted by damage taken
// NB martial artists don't get a bonus for using brass knuckles! - oh, they do in STOMP - SANDRO
if (pSoldier->usAttackingWeapon )
@@ -9550,26 +9550,29 @@ UINT32 CalcChanceHTH( SOLDIERTYPE * pAttacker,SOLDIERTYPE *pDefender, INT16 ubAi
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
{
// We need to be agile and dexterous
iAttRating = ( 2 * EffectiveDexterity( pAttacker ) + // coordination, accuracy *
2 * EffectiveAgility( pAttacker ) + // speed & reflexes
pAttacker->stats.bStrength + // physical strength
iAttRating = ( 2 * EffectiveDexterity( pAttacker, FALSE ) + // coordination, accuracy *
2 * EffectiveAgility( pAttacker, FALSE ) + // speed & reflexes
pAttacker->stats.bStrength + // physical strength
pDefender->bExtraStrength + // additional strength from power armour
(10 * EffectiveExpLevel( pAttacker ) ) ); // experience, knowledge
}
else
{
// this is more of a brute force strength-vs-strength check
iAttRating = ( EffectiveDexterity( pAttacker ) + // coordination, accuracy
EffectiveAgility( pAttacker ) + // speed & reflexes
iAttRating = ( EffectiveDexterity( pAttacker, FALSE ) + // coordination, accuracy
EffectiveAgility( pAttacker, FALSE ) + // speed & reflexes
3 * pAttacker->stats.bStrength + // physical strength (TRIPLED!)
3 * pDefender->bExtraStrength + // additional strength from power armour
(10 * EffectiveExpLevel( pAttacker ) ) ); // experience, knowledge
}
///////////////////////////////////////////////////////////////////////////////////////
}
else
{
iAttRating = (3 * EffectiveDexterity( pAttacker ) + // coordination, accuracy (TRIPLED!)
EffectiveAgility( pAttacker ) + // speed & reflexes
iAttRating = (3 * EffectiveDexterity( pAttacker, FALSE ) + // coordination, accuracy (TRIPLED!)
EffectiveAgility( pAttacker, FALSE ) + // speed & reflexes
pAttacker->stats.bStrength + // physical strength
pDefender->bExtraStrength + // additional strength from power armour
(10 * EffectiveExpLevel( pAttacker ) ) ); // experience, knowledge
}
@@ -9732,24 +9735,27 @@ UINT32 CalcChanceHTH( SOLDIERTYPE * pAttacker,SOLDIERTYPE *pDefender, INT16 ubAi
// SANDRO - Enhanced Close Combat System - stealing defence based on dexterity and strength
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
{
iDefRating = ( EffectiveAgility( pDefender )) + // speed & reflexes
2 * EffectiveDexterity( pDefender ) + // coordination, accuracy
iDefRating = ( EffectiveAgility( pDefender, FALSE )) + // speed & reflexes
2 * EffectiveDexterity( pDefender, FALSE ) + // coordination, accuracy
2 * pDefender->stats.bStrength + // physical strength
2 * pDefender->bExtraStrength + // additional strength from power armour
(10 * EffectiveExpLevel( pDefender ) ); // experience, knowledge
}
else
{
iDefRating = (EffectiveAgility( pDefender )) + // speed & reflexes
EffectiveDexterity( pDefender ) + // coordination, accuracy
iDefRating = (EffectiveAgility( pDefender, FALSE )) + // speed & reflexes
EffectiveDexterity( pDefender, FALSE ) + // coordination, accuracy
3 * pDefender->stats.bStrength + // physical strength (TRIPLED!)
3 * pDefender->bExtraStrength + // additional strength from power armour
(10 * EffectiveExpLevel( pDefender ) ); // experience, knowledge
}
}
else
{
iDefRating = (3 * EffectiveAgility( pDefender ) ) + // speed & reflexes (TRIPLED!)
EffectiveDexterity( pDefender ) + // coordination, accuracy
iDefRating = (3 * EffectiveAgility( pDefender, FALSE ) ) + // speed & reflexes (TRIPLED!)
EffectiveDexterity( pDefender, FALSE ) + // coordination, accuracy
pDefender->stats.bStrength + // physical strength
pDefender->bExtraStrength + // additional strength from power armour
(10 * EffectiveExpLevel( pDefender ) ); // experience, knowledge
}
@@ -10346,13 +10352,13 @@ INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed )
// start with the range based on the soldier's strength and the item's weight
// Altered by Digicrab on 14 March, 2004
// Reversed a Ja2Gold change that made grenades of weight 3 or more have the same throw distance as those of weight 3.
INT32 iThrowingStrength = ( EffectiveStrength( pSoldier ) * 2 + 100 ) / 3;
INT32 iThrowingStrength = ( EffectiveStrength( pSoldier, FALSE ) * 2 + 100 ) / 3;
iRange = 2 + ( iThrowingStrength / (3 + (Item[usItem].ubWeight) / 3 ));
}
else
{ // not as aerodynamic!
// start with the range based on the soldier's strength and the item's weight
iRange = 2 + ( ( EffectiveStrength( pSoldier ) / ( 5 + Item[usItem].ubWeight) ) );
iRange = 2 + ( ( EffectiveStrength( pSoldier, FALSE ) / ( 5 + Item[usItem].ubWeight) ) );
}
// adjust for thrower's remaining breath (lose up to 1/2 of range)
@@ -10432,7 +10438,7 @@ UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
{
// PHYSICALLY THROWN arced projectile (ie. grenade)
// for lack of anything better, base throwing accuracy on dex & marskmanship
iChance = ( EffectiveDexterity( pSoldier ) + EffectiveMarksmanship( pSoldier ) ) / 2;
iChance = ( EffectiveDexterity( pSoldier, FALSE ) + EffectiveMarksmanship( pSoldier ) ) / 2;
////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - old/new traits
if ( gGameOptions.fNewTraitSystem )
@@ -10464,7 +10470,7 @@ UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
{
// MECHANICALLY FIRED arced projectile (ie. mortar), need brains & know-how
iChance = ( EffectiveDexterity( pSoldier ) + EffectiveMarksmanship( pSoldier ) + EffectiveWisdom( pSoldier ) + pSoldier->stats.bExpLevel ) / 4;
iChance = ( EffectiveDexterity( pSoldier, FALSE ) + EffectiveMarksmanship( pSoldier ) + EffectiveWisdom( pSoldier ) + pSoldier->stats.bExpLevel ) / 4;
////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - old/new traits
@@ -10646,7 +10652,7 @@ UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
bPenalty /= 2;
// reduce breath penalty due to merc's dexterity (he can compensate!)
iChance -= (bPenalty * (100 - ( EffectiveDexterity( pSoldier ) - 10))) / 100;
iChance -= (bPenalty * (100 - ( EffectiveDexterity( pSoldier, FALSE ) - 10))) / 100;
}
// if iChance exists, but it's a mechanical item being used
@@ -11085,8 +11091,8 @@ void EstimateBulletsLeft( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj )
{
UINT16 usExpLevel;
UINT16 usDexterity;
UINT16 usWisdom;
UINT32 usDexterity;
UINT32 usWisdom;
UINT16 ubMagSize = Weapon[pObj->usItem].ubMagSize;
UINT16 usRealBulletCount = (*pObj)[0]->data.gun.ubGunShotsLeft;
UINT16 i = 0;
@@ -11103,7 +11109,7 @@ void EstimateBulletsLeft( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj )
}
usExpLevel = EffectiveExpLevel(pSoldier);
usDexterity = EffectiveDexterity(pSoldier);
usDexterity = EffectiveDexterity(pSoldier, FALSE);
usWisdom = EffectiveWisdom(pSoldier);
if ( gGameExternalOptions.usBulletHideIntensity <= 0 )
+3 -3
View File
@@ -3969,13 +3969,13 @@ void DebugSoldierPage1( )
SetFontShade(LARGEFONT1, FONT_SHADE_GREEN);
gprintf( 200, LINE_HEIGHT * ubLine, L"Agility:");
SetFontShade(LARGEFONT1, FONT_SHADE_NEUTRAL);
gprintf( 350, LINE_HEIGHT * ubLine, L"%d ( %d )", pSoldier->stats.bAgility, EffectiveAgility( pSoldier ) );
gprintf( 350, LINE_HEIGHT * ubLine, L"%d ( %d )", pSoldier->stats.bAgility, EffectiveAgility( pSoldier, FALSE ) );
ubLine++;
SetFontShade(LARGEFONT1, FONT_SHADE_GREEN);
gprintf( 200, LINE_HEIGHT * ubLine, L"Dexterity:");
SetFontShade(LARGEFONT1, FONT_SHADE_NEUTRAL);
gprintf( 350, LINE_HEIGHT * ubLine, L"%d( %d )", pSoldier->stats.bDexterity, EffectiveDexterity( pSoldier ) );
gprintf( 350, LINE_HEIGHT * ubLine, L"%d( %d )", pSoldier->stats.bDexterity, EffectiveDexterity( pSoldier, FALSE ) );
ubLine++;
SetFontShade(LARGEFONT1, FONT_SHADE_GREEN);
@@ -5235,7 +5235,7 @@ UINT8 MovementNoise( SOLDIERTYPE *pSoldier )
// CHANGED BY SANDRO - LET'S MAKE THE STEALTH BASED ON AGILITY LIKE IT SHOULD BE
//iStealthSkill = 20 + 4 * EffectiveExpLevel( pSoldier ) + ((EffectiveDexterity( pSoldier ) * 4) / 10); // 24-100
iStealthSkill = 20 + 4 * EffectiveExpLevel( pSoldier ) + ((EffectiveAgility( pSoldier ) * 4) / 10); // 24-100
iStealthSkill = 20 + 4 * EffectiveExpLevel( pSoldier ) + ((EffectiveAgility( pSoldier, FALSE ) * 4) / 10); // 24-100
// big bonus for those "extra stealthy" mercs
if ( pSoldier->ubBodyType == BLOODCAT )