- Fix: item name in spy disguise notification was wrong

- MTAs don't have to stop when no hand item is found (the ones in the trunk use this though)
- Fix: militia drops sector equipment it took, even if it should not drop other gear - otherwise militia ould 'consume' sector invetories

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6141 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-06-20 17:41:23 +00:00
parent 3ade79cf63
commit 821893ce68
2 changed files with 71 additions and 66 deletions
+48 -43
View File
@@ -925,19 +925,19 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
{ {
Corpse.usFlags |= ROTTING_CORPSE_VEHICLE; Corpse.usFlags |= ROTTING_CORPSE_VEHICLE;
if ( pSoldier->ubBodyType != ICECREAMTRUCK && pSoldier->ubBodyType != HUMVEE ) if ( pSoldier->ubBodyType != ICECREAMTRUCK && pSoldier->ubBodyType != HUMVEE )
{ {
Corpse.ubDirection = 7; Corpse.ubDirection = 7;
} }
else else
{ {
Corpse.ubDirection = gb2DirectionsFrom8[ Corpse.ubDirection ]; Corpse.ubDirection = gb2DirectionsFrom8[ Corpse.ubDirection ];
} }
} }
if ( ubType == QUEEN_MONSTER_DEAD || ubType == BURNT_DEAD || ubType == EXPLODE_DEAD ) if ( ubType == QUEEN_MONSTER_DEAD || ubType == BURNT_DEAD || ubType == EXPLODE_DEAD )
{ {
Corpse.ubDirection = 7; Corpse.ubDirection = 7;
} }
@@ -971,42 +971,42 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
} }
else if ( ubType == QUEEN_MONSTER_DEAD ) else if ( ubType == QUEEN_MONSTER_DEAD )
{ {
gTacticalStatus.fLockItemLocators = FALSE; gTacticalStatus.fLockItemLocators = FALSE;
ubNumGoo = 6 - ( gGameOptions.ubDifficultyLevel - DIF_LEVEL_EASY ); ubNumGoo = 6 - ( gGameOptions.ubDifficultyLevel - DIF_LEVEL_EASY );
sNewGridNo = pSoldier->sGridNo + ( WORLD_COLS * 2 ); sNewGridNo = pSoldier->sGridNo + ( WORLD_COLS * 2 );
for ( cnt = 0; cnt < ubNumGoo; cnt++ ) for ( cnt = 0; cnt < ubNumGoo; cnt++ )
{ {
CreateItem( JAR_QUEEN_CREATURE_BLOOD, 100, &gTempObject ); CreateItem( JAR_QUEEN_CREATURE_BLOOD, 100, &gTempObject );
AddItemToPool( sNewGridNo, &gTempObject, bVisible , pSoldier->pathing.bLevel, usItemFlags, -1 ); AddItemToPool( sNewGridNo, &gTempObject, bVisible , pSoldier->pathing.bLevel, usItemFlags, -1 );
} }
} }
else else
{ {
// OK, Place what objects this guy was carrying on the ground! // OK, Place what objects this guy was carrying on the ground!
for ( cnt = 0; cnt < pSoldier->inv.size(); cnt++ ) for ( cnt = 0; cnt < pSoldier->inv.size(); ++cnt )
{
pObj = &( pSoldier->inv[ cnt ] );
if ( pObj->exists() == true )
{ {
// Check if it's supposed to be dropped pObj = &( pSoldier->inv[ cnt ] );
if ( !( (*pObj).fFlags & OBJECT_UNDROPPABLE ) || pSoldier->bTeam == gbPlayerNum )
if ( pObj->exists() == true )
{ {
// and make sure that it really is a droppable item type // Check if it's supposed to be dropped
// if ( !(Item[ pObj->usItem ].fFlags & ITEM_DEFAULT_UNDROPPABLE) ) if ( !( (*pObj).fFlags & OBJECT_UNDROPPABLE ) || pSoldier->bTeam == gbPlayerNum )
if ( !(Item[ pObj->usItem ].defaultundroppable ) )
{ {
ReduceAmmoDroppedByNonPlayerSoldiers( pSoldier, cnt ); // and make sure that it really is a droppable item type
//if this soldier was an enemy // if ( !(Item[ pObj->usItem ].fFlags & ITEM_DEFAULT_UNDROPPABLE) )
// Kaiden: Added from UB's reveal all items after combat feature! if ( !(Item[ pObj->usItem ].defaultundroppable ) )
// HEADROCK HAM B2.8: Now also reveals equipment dropped by militia, if requirement is met. {
if( pSoldier->bTeam == ENEMY_TEAM || ReduceAmmoDroppedByNonPlayerSoldiers( pSoldier, cnt );
( gGameExternalOptions.ubMilitiaDropEquipment == 2 && pSoldier->bTeam == MILITIA_TEAM ) || //if this soldier was an enemy
( gGameExternalOptions.ubMilitiaDropEquipment == 1 && pSoldier->bTeam == MILITIA_TEAM && Menptr[ pSoldier->ubAttackerID ].bTeam != OUR_TEAM )) // Kaiden: Added from UB's reveal all items after combat feature!
// HEADROCK HAM B2.8: Now also reveals equipment dropped by militia, if requirement is met.
if( pSoldier->bTeam == ENEMY_TEAM ||
( gGameExternalOptions.ubMilitiaDropEquipment == 2 && pSoldier->bTeam == MILITIA_TEAM ) ||
( gGameExternalOptions.ubMilitiaDropEquipment == 1 && pSoldier->bTeam == MILITIA_TEAM && Menptr[ pSoldier->ubAttackerID ].bTeam != OUR_TEAM ))
{ {
//add a flag to the item so when all enemies are killed, we can run through and reveal all the enemies items //add a flag to the item so when all enemies are killed, we can run through and reveal all the enemies items
usItemFlags |= WORLD_ITEM_DROPPED_FROM_ENEMY; usItemFlags |= WORLD_ITEM_DROPPED_FROM_ENEMY;
@@ -1020,21 +1020,26 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
} }
} }
if(UsingNewAttachmentSystem()==true){ if(UsingNewAttachmentSystem()==true)
{
ReduceAttachmentsOnGunForNonPlayerChars(pSoldier, pObj); ReduceAttachmentsOnGunForNonPlayerChars(pSoldier, pObj);
} }
// HEADROCK HAM B2.8: Militia will drop items only if allowed.
if (!(gGameExternalOptions.ubMilitiaDropEquipment == 0 && pSoldier->bTeam == MILITIA_TEAM ) && // HEADROCK HAM B2.8: Militia will drop items only if allowed.
!(gGameExternalOptions.ubMilitiaDropEquipment == 1 && pSoldier->bTeam == MILITIA_TEAM && Menptr[ pSoldier->ubAttackerID ].bTeam == OUR_TEAM )) if (!(gGameExternalOptions.ubMilitiaDropEquipment == 0 && pSoldier->bTeam == MILITIA_TEAM ) &&
{ !(gGameExternalOptions.ubMilitiaDropEquipment == 1 && pSoldier->bTeam == MILITIA_TEAM && Menptr[ pSoldier->ubAttackerID ].bTeam == OUR_TEAM ))
AddItemToPool( pSoldier->sGridNo, pObj, bVisible , pSoldier->pathing.bLevel, usItemFlags, -1 ); {
AddItemToPool( pSoldier->sGridNo, pObj, bVisible , pSoldier->pathing.bLevel, usItemFlags, -1 );
}
} }
} }
} }
} }
}
DropKeysInKeyRing( pSoldier, pSoldier->sGridNo, pSoldier->pathing.bLevel, bVisible, FALSE, 0, FALSE ); DropKeysInKeyRing( pSoldier, pSoldier->sGridNo, pSoldier->pathing.bLevel, bVisible, FALSE, 0, FALSE );
// Flugente: even if we forbid militia from dropping their equipment, they will still drop what they took via sector inventory (this functions only drops what they took)
pSoldier->DropSectorEquipment();
} }
// Make team look for items // Make team look for items
+22 -22
View File
@@ -14722,7 +14722,7 @@ BOOLEAN SOLDIERTYPE::LooksLikeACivilian( void )
( Item[this->inv[bLoop].usItem].nightvisionrangebonus > 0 || Item[this->inv[bLoop].usItem].hearingrangebonus > 0 ) ( Item[this->inv[bLoop].usItem].nightvisionrangebonus > 0 || Item[this->inv[bLoop].usItem].hearingrangebonus > 0 )
) )
{ {
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_MILITARYGEARFOUND], this->GetName(), Item[bLoop].szItemName ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_MILITARYGEARFOUND], this->GetName(), Item[this->inv[bLoop].usItem].szItemName );
return FALSE; return FALSE;
} }
} }
@@ -14744,7 +14744,7 @@ BOOLEAN SOLDIERTYPE::LooksLikeACivilian( void )
( Item[this->inv[bLoop].usItem].nightvisionrangebonus > 0 || Item[this->inv[bLoop].usItem].hearingrangebonus > 0 ) ( Item[this->inv[bLoop].usItem].nightvisionrangebonus > 0 || Item[this->inv[bLoop].usItem].hearingrangebonus > 0 )
) )
{ {
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_MILITARYGEARFOUND], this->GetName(), Item[bLoop].szItemName ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_MILITARYGEARFOUND], this->GetName(), Item[this->inv[bLoop].usItem].szItemName );
return FALSE; return FALSE;
} }
} }
@@ -15657,13 +15657,13 @@ BOOLEAN SOLDIERTYPE::UpdateMultiTurnAction()
// determine the gridno before us and the item we have in our main hand, this is enough for the current actions // determine the gridno before us and the item we have in our main hand, this is enough for the current actions
OBJECTTYPE* pObj = &(this->inv[HANDPOS]); OBJECTTYPE* pObj = &(this->inv[HANDPOS]);
if ( !pObj || !(pObj->exists()) )
fActionStillValid = FALSE;
// error if the gridno we started working on is not the gridno we are currently looking at // error if the gridno we started working on is not the gridno we are currently looking at
if ( usMultiTurnAction == MTA_FORTIFY || usMultiTurnAction == MTA_REMOVE_FORTIFY || usMultiTurnAction == MTA_FILL_SANDBAG ) if ( usMultiTurnAction == MTA_FORTIFY || usMultiTurnAction == MTA_REMOVE_FORTIFY || usMultiTurnAction == MTA_FILL_SANDBAG )
{ {
if ( this->sMTActionGridNo != NewGridNo( this->sGridNo, DirectionInc( this->ubDirection ) ) ) if ( !pObj || !(pObj->exists()) )
fActionStillValid = FALSE;
else if ( this->sMTActionGridNo != NewGridNo( this->sGridNo, DirectionInc( this->ubDirection ) ) )
fActionStillValid = FALSE; fActionStillValid = FALSE;
} }
@@ -15731,29 +15731,29 @@ BOOLEAN SOLDIERTYPE::UpdateMultiTurnAction()
return FALSE; return FALSE;
} }
// if we are not in turnbased and no enemies are around, we reduce the number of necessary action points to 0. No need to keep waiting if there's nobody around anyway // refresh animations
if ( !( gTacticalStatus.uiFlags & TURNBASED && gTacticalStatus.uiFlags & INCOMBAT ) ) switch( usMultiTurnAction )
bOverTurnAPS = 0;
// otherwise this might take longer, so we refresh our animation
else
{ {
// refresh animations case MTA_FORTIFY:
switch( usMultiTurnAction ) case MTA_REMOVE_FORTIFY:
case MTA_FILL_SANDBAG:
{ {
case MTA_FORTIFY: // if we are not in turnbased and no enemies are around, we reduce the number of necessary action points to 0. No need to keep waiting if there's nobody around anyway
case MTA_REMOVE_FORTIFY: if ( !( gTacticalStatus.uiFlags & TURNBASED && gTacticalStatus.uiFlags & INCOMBAT ) )
case MTA_FILL_SANDBAG: bOverTurnAPS = 0;
{ // otherwise this might take longer, so we refresh our animation
if (!is_networked)
this->EVENT_InitNewSoldierAnim( CUTTING_FENCE, 0 , FALSE );
else else
this->ChangeSoldierState( CUTTING_FENCE, 0, 0 ); {
if (!is_networked)
this->EVENT_InitNewSoldierAnim( CUTTING_FENCE, 0 , FALSE );
else
this->ChangeSoldierState( CUTTING_FENCE, 0, 0 );
// as setting the new animation costs APBPConstants[AP_USEWIRECUTTERS] APs every time, account for that // as setting the new animation costs APBPConstants[AP_USEWIRECUTTERS] APs every time, account for that
this->bActionPoints += APBPConstants[AP_USEWIRECUTTERS]; this->bActionPoints += APBPConstants[AP_USEWIRECUTTERS];
} }
break;
} }
break;
} }
// if we can afford it, do it now // if we can afford it, do it now