- New command: On [Alt] + [N], all team members in the sector try to put on gas masks

- Fix: gasmask status was not always evaluated correctly

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8315 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-10-14 21:07:49 +00:00
parent a0c2b0a39a
commit 68294910b8
7 changed files with 45 additions and 69 deletions
+7
View File
@@ -2063,6 +2063,13 @@ BOOLEAN WearGasMaskIfAvailable( SOLDIERTYPE * pSoldier )
}
RearrangePocket( pSoldier, bSlot, bNewSlot, TRUE );
if ( pSoldier->bTeam == gbPlayerNum )
{
pSoldier->DeleteSoldierLight( );
pSoldier->PositionSoldierLight( );
}
return( TRUE );
}
+2 -1
View File
@@ -27,6 +27,7 @@
#include "Reinforcement.h" // added by Flugente
#include "Town Militia.h" // added by Flugente
#include "Queen Command.h" // added by Flugente
#include "Explosion Control.h" // added by Flugente for GASMASK_MIN_STATUS
#endif
// anv: for enemy taunts
@@ -2161,7 +2162,7 @@ INT32 EstimateThrowDamage( SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *
iBreathDamage /= 2; // reduce effective breath damage by 1/2
bSlot = FindGasMask(pOpponent); //FindObj( pOpponent, GASMASK );
if ((bSlot == HEAD1POS || bSlot == HEAD2POS || bSlot == HELMETPOS) && pSoldier->inv[bSlot][0]->data.objectStatus >= 70)
if ( (bSlot == HEAD1POS || bSlot == HEAD2POS || bSlot == HELMETPOS) && pSoldier->inv[bSlot][0]->data.objectStatus >= GASMASK_MIN_STATUS )
{
// take condition of the gas mask into account - it could be leaking
iBreathDamage = (iBreathDamage * (100 - pOpponent->inv[bSlot][0]->data.objectStatus)) / 100;
+2 -31
View File
@@ -16,38 +16,10 @@ extern SECTOR_EXT_DATA SectorExternalData[256][4];
void CallAvailableEnemiesTo( INT32 sGridNo )
{
INT32 iLoop;
INT32 iLoop2;
SOLDIERTYPE * pSoldier;
// All enemy teams become aware of a very important "noise" coming from here!
for (iLoop = 0; iLoop < LAST_TEAM; iLoop++)
for ( INT32 iLoop = 0; iLoop < LAST_TEAM; ++iLoop )
{
// if this team is active
if (gTacticalStatus.Team[iLoop].bTeamActive)
{
// if this team is computer-controlled, and isn't the CIVILIAN "team"
if (!(gTacticalStatus.Team[iLoop].bHuman) && (iLoop != CIV_TEAM))
{
// make this team (publicly) aware of the "noise"
gsPublicNoiseGridNo[iLoop] = sGridNo;
gubPublicNoiseVolume[iLoop] = MAX_MISC_NOISE_DURATION;
// new situation for everyone;
iLoop2 = gTacticalStatus.Team[ iLoop ].bFirstID;
for ( pSoldier = MercPtrs[iLoop2]; iLoop2 <= gTacticalStatus.Team[ iLoop ].bLastID; iLoop2++, pSoldier++ )
{
if (pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife >= OKLIFE)
{
SetNewSituation( pSoldier );
WearGasMaskIfAvailable( pSoldier );
}
}
}
}
CallAvailableTeamEnemiesTo( sGridNo, iLoop );
}
}
@@ -77,7 +49,6 @@ void CallAvailableTeamEnemiesTo( INT32 sGridNo, INT8 bTeam )
WearGasMaskIfAvailable( pSoldier );
}
}
}
}
}
+3 -1
View File
@@ -16,6 +16,7 @@
#include "Soldier macros.h"
#include "Render Fun.h"
#include "Soldier Functions.h" // added by Flugente
#endif
#include "connect.h"
//forward declarations of common classes to eliminate includes
@@ -87,10 +88,11 @@ int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubPathMode,
//Madd: added to prevent people from running into gas and fire
if ( (gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
FindGasMask(pSoldier) == NO_SLOT )
!DoesSoldierWearGasMask( pSoldier ) )
{
return( FALSE );
}
if ( gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & MAPELEMENT_EXT_BURNABLEGAS )
{
return( FALSE );