Explosive improvements and fixes (by Sevenfm)

- New mine disarm dialogue (only for realtime): Disarm, Inspect, Remove Blue Flag, Blow up.
- You can now attach tripwire-activated explosives to tripwire.
- attached explosives volatility is now used in chain explosion calculation: added new function CalcTotalVolatility.
- new function CheckForBuriedBombsAndRemoveFlags removes MAPELEMENT_XXX_MINE_PRESENT flags if there is no buried bomb at checked tile. This should fix problems with flag not removed correctly after chain explosions and such.
- trip klaxon no longer calls enemies if it's activated as attached explosive (instead it makes some noise).
- added check to MineSpottedDialogueCallBack. It should fix problem with game crash with tiles that have MAPELEMENT_PLAYER_MINE_PRESENT flag set but no buried mine
- disarmed item will keep it's attachments if ALLOW_ATTACHED_EXPLOSIVES is TRUE.
- IMPROVED_BOMB_PLANTING feature can be used to auto-take tripwire items from inventory.
- see: http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/172712/15/Code_Snippets.html


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6663 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-11-29 07:38:41 +00:00
parent 18af587c75
commit 2cba26ab07
17 changed files with 518 additions and 123 deletions
+13 -2
View File
@@ -8507,10 +8507,21 @@ INT8 CheckItemForDamage( UINT16 usItem, INT32 iMaxDamage )
return( bDamage );
}
BOOLEAN CheckForChainReaction( UINT16 usItem, INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround )
//BOOLEAN CheckForChainReaction( UINT16 usItem, INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround )
BOOLEAN CheckForChainReaction( OBJECTTYPE * pObj , INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround )
{
INT32 iChance;
UINT16 usItem;
if(pObj == NULL)
return FALSE;
usItem = pObj->usItem;
// sevenfm: if ALLOW_EXPLOSIVE_ATTACHMENTS = TRUE calculate total average volatility of (item + explosive attachments)
if(gGameExternalOptions.bAllowExplosiveAttachments && pObj)
iChance = CalcTotalVolatility( pObj );
else
iChance = Explosive[Item[usItem].ubClassIndex].ubVolatility;
if (iChance > 0)
{
@@ -8591,7 +8602,7 @@ BOOLEAN DamageItem( OBJECTTYPE * pObject, INT32 iDamage, BOOLEAN fOnGround )
// FUN STUFF! Check for explosives going off as a result!
if (Item[pObject->usItem].usItemClass & IC_EXPLOSV)
{
if (CheckForChainReaction( pObject->usItem, (*pObject)[bLoop]->data.objectStatus, bDamage, fOnGround ))
if (CheckForChainReaction( pObject, (*pObject)[bLoop]->data.objectStatus, bDamage, fOnGround ))
{
return( TRUE );
}