New Feature: Bombs can now be armed from the inventory. This requires an attached detonator or remote detonator. (by Flugente)

- they can then be thrown, dropped or whatever else you can think of.
- to arm/disarm a bomb, enter the Enhanced description box and click on the item's picture.
- timed bombs will blow up once the time is up, wether they are in the sector or in your inventory. Remote bombs can be also detonated in your inventory.
- see this thread for more info: http://www.bears-pit.com/board/ubbthreads.php/topics/305534.html#Post305534

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5327 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-06-03 16:53:03 +00:00
parent 4750b07f16
commit de09d4e80f
8 changed files with 637 additions and 28 deletions
+17 -2
View File
@@ -7656,7 +7656,6 @@ BOOLEAN ArmBomb( OBJECTTYPE * pObj, INT8 bSetting )
return( FALSE );
}
// Flugente TODO determine correct frequency and detonate/defuse stuff
// Flugente: decide how to interpret the bSetting we just got.
// Due to limitations in the message system, we only receive a single value to interpret, as we currently can't have a message box return 2 values
// It might be possible to have proper checkboxes, but I'll rather not research this right now.
@@ -7669,7 +7668,7 @@ BOOLEAN ArmBomb( OBJECTTYPE * pObj, INT8 bSetting )
// d) if we have a remote detonator plus a remote defuse: frequency on which the bomb will blow plus frequency to defuse: 1-16
//
// I we are placing tripwire, consider this:
// e) if we palce tripwire: the tripwire network plus the hierachy in that network: 1-16
// e) if we place tripwire: the tripwire network plus the hierachy in that network: 1-16
//
// It is clear that we only have to reinterpret the values if a defuse is equiped, or we are placing tripwire
INT8 detonatesetting = bSetting;
@@ -13860,3 +13859,19 @@ UINT64 GetAvailableAttachmentPoint (OBJECTTYPE * pObject, UINT8 subObject)
return point;
}
// Flugente: check if and how a bomb has been set up
void CheckBombSpecifics( OBJECTTYPE * pObj, INT8* detonatortype, INT8* setting, INT8* defusefrequency )
{
if ( pObj && pObj->exists() )
{
*detonatortype = (*pObj)[0]->data.misc.bDetonatorType;
if ( *detonatortype == BOMB_TIMED )
*setting = (*pObj)[0]->data.misc.bDelay;
else
*setting = (*pObj)[0]->data.misc.bFrequency;
*defusefrequency = (*pObj)[0]->data.bDefuseFrequency;
}
}