If a tank just took a heavy hit, but cannot see an enemy to fire upon, it can detonate a smoke grenade on itself to hide.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8127 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-03-26 23:16:41 +00:00
parent 33ab9c5e82
commit 7bf2943849
7 changed files with 71 additions and 1 deletions
+41
View File
@@ -7604,6 +7604,9 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou
// UnderFire now starts at 2 for "under fire this turn",
// down to 1 for "under fire last turn", to 0.
this->aiData.bUnderFire--;
if ( !this->aiData.bUnderFire )
this->usSoldierFlagMask2 &= ~SOLDIER_TAKEN_LARGE_HIT;
}
// Flugente: reset extra stats. Currently they only depend on drug effects, and those are reset every turn
@@ -9888,6 +9891,9 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sBr
}
}
}
if ( sLifeDeduct > 30 )
this->usSoldierFlagMask2 |= SOLDIER_TAKEN_LARGE_HIT;
VehicleTakeDamage( this->bVehicleID, ubReason, sLifeDeduct, this->sGridNo, ubAttacker );
HandleTakeDamageDeath( this, bOldLife, ubReason );
@@ -18989,6 +18995,41 @@ FLOAT SOLDIERTYPE::GetConstructionPoints( )
return dval;
}
BOOLEAN SOLDIERTYPE::HasItem(UINT16 usItem)
{
INT8 invsize = (INT8)inv.size( );
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop )
{
if ( inv[bLoop].exists( ) == true && inv[bLoop].usItem == usItem )
return TRUE;
}
return FALSE;
}
// AI-only: heal self. Do NOT, repeat, NOT use this with mercs!
BOOLEAN SOLDIERTYPE::SelfDetonate( )
{
if ( !(this->flags.uiStatusFlags & SOLDIER_UNDERAICONTROL) )
return FALSE;
INT8 invsize = (INT8)inv.size( );
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop )
{
if ( inv[bLoop].exists( ) == true && inv[bLoop].usItem == this->aiData.usActionData )
{
IgniteExplosion( this->ubID, this->sX, this->sY, (INT16)(gpWorldLevelData[this->sGridNo].sHeight), this->sGridNo, inv[bLoop].usItem, this->pathing.bLevel, this->ubDirection );
// Remove item!
DeleteObj( &(this->inv[bLoop]) );
return TRUE;
}
}
return FALSE;
}
INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
{
INT8 bBandaged; //,savedOurTurn;