mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Walkman: bonus 20% to morale when in head slot.
Update soldier morale every turn. Update soldier morale when changing inventory. Improved code for 'l' hotkey. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8783 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -9881,6 +9881,9 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// sevenfm: update morale, as we could add/remove walkman
|
||||
RefreshSoldierMorale(pSoldier);
|
||||
}
|
||||
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_DWN)
|
||||
{
|
||||
|
||||
@@ -4005,6 +4005,9 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// Flugente: we have to recheck our flashlights, as we changed items
|
||||
//gpSMCurrentMerc->usSoldierFlagMask |= SOLDIER_REDOFLASHLIGHT;
|
||||
gpSMCurrentMerc->HandleFlashLights();
|
||||
|
||||
// sevenfm: update morale, as we could add/remove walkman
|
||||
RefreshSoldierMorale(gpSMCurrentMerc);
|
||||
}
|
||||
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_DWN)
|
||||
{
|
||||
|
||||
+6
-8
@@ -12254,19 +12254,17 @@ INT8 FindLocksmithKit( SOLDIERTYPE * pSoldier )
|
||||
return( FoundKit );
|
||||
}
|
||||
|
||||
INT8 FindWalkman( SOLDIERTYPE * pSoldier )
|
||||
INT8 FindWalkman(SOLDIERTYPE * pSoldier)
|
||||
{
|
||||
for (INT8 bLoop = BODYPOSSTART; bLoop < BODYPOSFINAL; ++bLoop)
|
||||
// sevenfm: walkman only works from head slot
|
||||
for (INT8 bLoop = HEAD1POS; bLoop <= HEAD2POS; bLoop++)
|
||||
{
|
||||
if (pSoldier->inv[bLoop].exists() )
|
||||
if (pSoldier->inv[bLoop].exists() && Item[pSoldier->inv[bLoop].usItem].walkman)
|
||||
{
|
||||
if (Item[pSoldier->inv[bLoop].usItem].walkman )
|
||||
{
|
||||
return( bLoop );
|
||||
}
|
||||
return(bLoop);
|
||||
}
|
||||
}
|
||||
return( NO_SLOT );
|
||||
return(NO_SLOT);
|
||||
}
|
||||
|
||||
INT8 FindTrigger( SOLDIERTYPE * pSoldier )
|
||||
|
||||
@@ -391,6 +391,15 @@ void RefreshSoldierMorale( SOLDIERTYPE * pSoldier )
|
||||
// Flugente: drug system has been redone
|
||||
iActualMorale += pSoldier->newdrugs.size[DRUG_EFFECT_MORALE];
|
||||
|
||||
// sevenfm: bonus 20% to morale when using walkman
|
||||
if (FindWalkman(pSoldier) != NO_SLOT && pSoldier->bDeafenedCounter == 0)
|
||||
{
|
||||
if (pSoldier->ubProfile != NO_PROFILE && gMercProfiles[pSoldier->ubProfile].bDisability == DEAF)
|
||||
iActualMorale += iActualMorale / 10;
|
||||
else
|
||||
iActualMorale += iActualMorale / 5;
|
||||
}
|
||||
|
||||
iActualMorale = __min( 100, iActualMorale );
|
||||
iActualMorale = __max( 0, iActualMorale );
|
||||
|
||||
|
||||
@@ -7875,6 +7875,9 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou
|
||||
HandleEndTurnDrugAdjustments_New( this );
|
||||
}
|
||||
|
||||
// sevenfm: update morale
|
||||
RefreshSoldierMorale(this);
|
||||
|
||||
// ATE: Don't bleed if in AUTO BANDAGE!
|
||||
if ( !gTacticalStatus.fAutoBandageMode )
|
||||
{
|
||||
|
||||
@@ -3840,7 +3840,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
if (fAlt )
|
||||
else if (fAlt )
|
||||
{
|
||||
// used for quickloading
|
||||
}
|
||||
@@ -3849,37 +3849,6 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
// used for loading game
|
||||
}
|
||||
else
|
||||
/*
|
||||
if( fAlt )
|
||||
{
|
||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
{
|
||||
LeaveTacticalScreen( GAME_SCREEN );
|
||||
|
||||
DoQuickLoad();
|
||||
}
|
||||
}
|
||||
|
||||
else if( fCtrl )
|
||||
{
|
||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
{
|
||||
|
||||
gfSaveGame = FALSE;
|
||||
gfCameDirectlyFromGame = TRUE;
|
||||
|
||||
guiPreviousOptionScreen = GAME_SCREEN;
|
||||
LeaveTacticalScreen( SAVE_LOAD_SCREEN );
|
||||
}
|
||||
*//*
|
||||
if ( INFORMATION_CHEAT_LEVEL( ) )
|
||||
{
|
||||
*puiNewEvent = I_LEVELNODEDEBUG;
|
||||
CountLevelNodes();
|
||||
}
|
||||
*//*
|
||||
}
|
||||
else*/
|
||||
{
|
||||
// nothing in hand and either not in SM panel, or the matching button is enabled if we are in SM panel
|
||||
if ( ( gpItemPointer == NULL ) &&
|
||||
|
||||
@@ -2960,8 +2960,6 @@ void CheckIfShotPossible(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot)
|
||||
{
|
||||
INT16 ubMinAPcost;
|
||||
pBestShot->ubPossible = FALSE;
|
||||
pBestShot->bWeaponIn = NO_SLOT;
|
||||
|
||||
pBestShot->bWeaponIn = FindAIUsableObjClass(pSoldier, IC_GUN);
|
||||
|
||||
// if the soldier does have a gun
|
||||
|
||||
Reference in New Issue
Block a user