- new item: when planting tripwire roll (Item# 1640), a tripwire item is created, thereby making planting multiple wires much easier. Teipwires can be merged to create a roll

- new item tag: <buddyitem> connects items to other items. Connection specifics depend on items involved

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6455 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-09-29 17:06:37 +00:00
parent 2169fbd6a9
commit 3c01b5364e
4 changed files with 72 additions and 9 deletions
+25 -5
View File
@@ -4986,27 +4986,47 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
}
}
if ( ArmBomb( &(gpTempSoldier->inv[HANDPOS]), ubExitValue ) )
// Flugente: tripwire rolls are not planted - instead we spawn tripwire and plant that
OBJECTTYPE* pObj = &(gpTempSoldier->inv[HANDPOS]);
if ( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].usItemFlag & TRIPWIREROLL && Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].usBuddyItem != NOTHING )
{
(*pObj)[0]->data.objectStatus--;
if ( !(*pObj)[0]->data.objectStatus )
{
// Delete object
DeleteObj( pObj );
// dirty interface panel
DirtyMercPanelInterface( gpTempSoldier, DIRTYLEVEL2 );
}
CreateItem( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].usBuddyItem, 100, &gTempObject );
pObj = &gTempObject;
}
if ( ArmBomb( pObj, ubExitValue ) )
{
// SANDRO - STOMP traits - Demolitions bonus to trap level
if ( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( gpTempSoldier, DEMOLITIONS_NT ))
{
// increase trap level for Demolitions trait
gpTempSoldier->inv[ HANDPOS ][0]->data.bTrap = __min( max( 10, (8 + gSkillTraitValues.ubDEPlacedBombLevelBonus)), (( EffectiveExplosive( gpTempSoldier ) / 20) + (EffectiveExpLevel( gpTempSoldier ) / 3) + gSkillTraitValues.ubDEPlacedBombLevelBonus) );
(*pObj)[0]->data.bTrap = __min( max( 10, (8 + gSkillTraitValues.ubDEPlacedBombLevelBonus)), (( EffectiveExplosive( gpTempSoldier ) / 20) + (EffectiveExpLevel( gpTempSoldier ) / 3) + gSkillTraitValues.ubDEPlacedBombLevelBonus) );
}
else
{
gpTempSoldier->inv[ HANDPOS ][0]->data.bTrap = __min( 10, ( EffectiveExplosive( gpTempSoldier ) / 20) + (EffectiveExpLevel( gpTempSoldier ) / 3) );
(*pObj)[0]->data.bTrap = __min( 10, ( EffectiveExplosive( gpTempSoldier ) / 20) + (EffectiveExpLevel( gpTempSoldier ) / 3) );
}
// Flugente: backgrounds
if ( gpTempSoldier->HasBackgroundFlag( BACKGROUND_TRAPLEVEL ) )
gpTempSoldier->inv[ HANDPOS ][0]->data.bTrap++;
(*pObj)[0]->data.bTrap++;
// HACK IMMINENT!
// value of 1 is stored in maps for SIDE of bomb owner... when we want to use IDs!
// so we add 2 to all owner IDs passed through here and subtract 2 later
if (gpTempSoldier->inv[HANDPOS].MoveThisObjectTo(gTempObject, 1) == 0)
if ( pObj != &(gpTempSoldier->inv[HANDPOS]) || gpTempSoldier->inv[HANDPOS].MoveThisObjectTo(gTempObject, 1) == 0)
{
gTempObject[0]->data.misc.ubBombOwner = gpTempSoldier->ubID + 2;
gTempObject[0]->data.ubDirection = gpTempSoldier->ubDirection; // Flugente: direction of bomb is direction of soldier