mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
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:
@@ -11529,7 +11529,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio
|
||||
if ( pTSoldier->stats.bLife - damage < 0 )
|
||||
damage = oldlife;
|
||||
|
||||
// We've got a problem if we kill someone outright ithout him collapsing properly...
|
||||
// We've got a problem if we kill someone outright without him collapsing properly...
|
||||
// FIX: We'll adjust our damage, so if we'd kill someone without collapsing first, we lower our damage, to let him collapse
|
||||
// After all, this whole thing's a rig up, so there shouldn't be a problem with that
|
||||
if ( oldlife >= OKLIFE && oldlife <= damage )
|
||||
@@ -13508,6 +13508,70 @@ void SOLDIERTYPE::ResetExtraStats()
|
||||
bExtraExpLevel = 0;
|
||||
}
|
||||
|
||||
// Flugente: inventory bombs can ignite while in mapscreen. Workaround: Damage items and health
|
||||
void SOLDIERTYPE::InventoryExplosion( void )
|
||||
{
|
||||
INT8 invsize = (INT8)this->inv.size(); // remember inventorysize, so we don't call size() repeatedly
|
||||
|
||||
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
|
||||
{
|
||||
if (this->inv[bLoop].exists() == true )
|
||||
{
|
||||
OBJECTTYPE * pObj = &(this->inv[bLoop]); // ... get pointer for this item ...
|
||||
|
||||
if ( pObj != NULL ) // ... if pointer is not obviously useless ...
|
||||
{
|
||||
for(INT16 i = 0; i < pObj->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ...
|
||||
{
|
||||
INT16 status = (*pObj)[0]->data.objectStatus;
|
||||
(*pObj)[0]->data.objectStatus = max(1, (INT16)(status/2));
|
||||
|
||||
// for every objects, we also have to check wether there are weapon attachments (eg. underbarrel grenade launchers), and cool them down too
|
||||
attachmentList::iterator iterend = (*pObj)[i]->attachments.end();
|
||||
for (attachmentList::iterator iter = (*pObj)[i]->attachments.begin(); iter != iterend; ++iter)
|
||||
{
|
||||
if ( iter->exists() )
|
||||
{
|
||||
INT16 status = (*iter)[0]->data.objectStatus;
|
||||
(*iter)[0]->data.objectStatus = max(1, (INT16)(status/2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// now damage our health
|
||||
INT8 oldlife = stats.bLife;
|
||||
|
||||
INT16 damage = (INT16)(30 + Random(20));
|
||||
if ( stats.bLife - damage < 0 )
|
||||
damage = oldlife;
|
||||
|
||||
// We've got a problem if we kill someone outright without him collapsing properly...
|
||||
// FIX: We'll adjust our damage, so if we'd kill someone without collapsing first, we lower our damage, to let him collapse
|
||||
// After all, this whole thing's a rig up, so there shouldn't be a problem with that
|
||||
if ( oldlife >= OKLIFE && oldlife <= damage )
|
||||
damage -= (INT16)((5 + Random(5)));
|
||||
|
||||
INT16 breathdamage = (INT16)(500 + Random(1500));
|
||||
if ( bBreath - breathdamage < 0 )
|
||||
breathdamage = bBreath;
|
||||
|
||||
SoldierTakeDamage( 0, damage, 0, breathdamage, TAKE_DAMAGE_EXPLOSION, this->ubID, sGridNo, 0, TRUE );
|
||||
|
||||
if ( stats.bLife <= 0 )
|
||||
{
|
||||
// FINISH HIM!
|
||||
HandleTakeDamageDeath( this, oldlife, TAKE_DAMAGE_BLOODLOSS );
|
||||
}
|
||||
else if ( stats.bLife < OKLIFE && !bCollapsed )
|
||||
{
|
||||
// let the target collapse...
|
||||
SoldierCollapse(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user