mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- New camo handling:
Camo Kits can now only be used to paint naked skin which usually means face and hands. Clothing will take care of the rest Together they can reach 100% camo. CAMO_KIT_USABLE_AREA = 5 in Ja2_Options.ini sets the area that can be painted. CAMO_LBE_OVER_VEST_MODIFIER = 0.2 CAMO_LBE_OVER_PANTS_MODIFIER = 0.6 These two set the amount of camo that armor vest/pants can provide if LBE is worn over them. http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/327902/Re_Code_Snippets.html#Post327902 - New Mine avoidance for civilians (by Sevenfm) Civilians can now avoid player placed mines. CIVILIANS_AVOID_PLAYER_MINES = TRUE in Ja2_Options.INI takes care of that. I set the default to TRUE which will allow players to use mine fields in city sectors. http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/327817/Re_Code_Snippets.html#Post327817 - Smoke effects and explosive attachments (by Sevenfm) Normal explosions can now cause a smoke effect. Explosives can be attached to other exlosives to create a more potent bundle. Ja2_Options.INI has some new options for that: ADD_SMOKE_AFTER_EXPLOSION = FALSE ALLOW_EXPLOSIVE_ATTACHMENTS = FALSE ALLOW_SPECIAL_EXPLOSIVE_ATTACHMENTS = FALSE http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/327918/Re_Code_Snippets.html#Post327918 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6582 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -273,7 +273,7 @@ void RecountExplosions( void )
|
||||
extern void HandleLoyaltyForDemolitionOfBuilding( SOLDIERTYPE *pSoldier, INT16 sPointsDmg );
|
||||
|
||||
// GENERATE EXPLOSION
|
||||
void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection )
|
||||
void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection, OBJECTTYPE * pObj )
|
||||
{
|
||||
#ifdef JA2BETAVERSION
|
||||
if (is_networked) {
|
||||
@@ -377,13 +377,25 @@ void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32
|
||||
|
||||
// Flugente: Items can have secondary explosions
|
||||
HandleBuddyExplosions(ubOwner, sX, sY, sZ, sGridNo, usItem, fLocate, bLevel, ubDirection );
|
||||
|
||||
// sevenfm: handle explosive items from attachments
|
||||
if( gGameExternalOptions.bAllowExplosiveAttachments )
|
||||
HandleAttachedExplosions(ubOwner, sX, sY, sZ, sGridNo, usItem, fLocate, bLevel, ubDirection, pObj );
|
||||
|
||||
// sevenfm: add smoke effect if not in room and not underground, only for normal explosions
|
||||
if(!InARoom( sGridNo, &tmp ) && !gbWorldSectorZ && gGameExternalOptions.bAddSmokeAfterExplosion)
|
||||
{
|
||||
if( Explosive[ Item[ usItem ].ubClassIndex ].ubType == 0 )
|
||||
{
|
||||
NewSmokeEffect( sGridNo, SMALL_SMOKE, 0, NOBODY );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void IgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubDirection )
|
||||
void IgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubDirection, OBJECTTYPE * pObj )
|
||||
{
|
||||
InternalIgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, usItem, TRUE, bLevel, ubDirection );
|
||||
InternalIgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, usItem, TRUE, bLevel, ubDirection, pObj );
|
||||
}
|
||||
|
||||
void GenerateExplosion( EXPLOSION_PARAMS *pExpParams )
|
||||
@@ -4043,7 +4055,7 @@ void HandleExplosionQueue( void )
|
||||
// bomb objects only store the SIDE who placed the bomb! :-(
|
||||
if ( (*pObj)[0]->data.misc.ubBombOwner > 1 )
|
||||
{
|
||||
IgniteExplosion( (UINT8) ((*pObj)[0]->data.misc.ubBombOwner - 2), CenterX( sGridNo ), CenterY( sGridNo ), 0, sGridNo, (*pObj)[0]->data.misc.usBombItem, ubLevel, (*pObj)[0]->data.ubDirection );
|
||||
IgniteExplosion( (UINT8) ((*pObj)[0]->data.misc.ubBombOwner - 2), CenterX( sGridNo ), CenterY( sGridNo ), 0, sGridNo, (*pObj)[0]->data.misc.usBombItem, ubLevel, (*pObj)[0]->data.ubDirection, pObj);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4204,7 +4216,7 @@ void DecayBombTimers( void )
|
||||
}
|
||||
|
||||
// ignite explosions manually - this item is not in the WorldBombs-structure, so we can't add it to the queue
|
||||
IgniteExplosion( gubPersonToSetOffExplosions, pSoldier->sX, pSoldier->sY, (INT16) (gpWorldLevelData[pSoldier->sGridNo].sHeight), pSoldier->sGridNo, pObj->usItem, pSoldier->pathing.bLevel, pSoldier->ubDirection );
|
||||
IgniteExplosion( gubPersonToSetOffExplosions, pSoldier->sX, pSoldier->sY, (INT16) (gpWorldLevelData[pSoldier->sGridNo].sHeight), pSoldier->sGridNo, pObj->usItem, pSoldier->pathing.bLevel, pSoldier->ubDirection, pObj );
|
||||
|
||||
DeleteObj( pObj );
|
||||
}
|
||||
@@ -4365,7 +4377,7 @@ void SetOffBombsByFrequency( UINT8 ubID, INT8 bFrequency )
|
||||
gubPersonToSetOffExplosions = ubID;
|
||||
|
||||
// ignite explosions manually - this item is not in the WorldBobms-structure, so we can't add it to the queue
|
||||
IgniteExplosion( ubID, pSoldier->sX, pSoldier->sY, (INT16) (gpWorldLevelData[pSoldier->sGridNo].sHeight), pSoldier->sGridNo, pObj->usItem, pSoldier->pathing.bLevel, pSoldier->ubDirection );
|
||||
IgniteExplosion( ubID, pSoldier->sX, pSoldier->sY, (INT16) (gpWorldLevelData[pSoldier->sGridNo].sHeight), pSoldier->sGridNo, pObj->usItem, pSoldier->pathing.bLevel, pSoldier->ubDirection, pObj );
|
||||
|
||||
DeleteObj( pObj );
|
||||
}
|
||||
@@ -5426,3 +5438,55 @@ void HandleBuddyExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sG
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// sevenfm: handle explosive items from attachments
|
||||
void HandleAttachedExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection, OBJECTTYPE * pObj)
|
||||
{
|
||||
BOOLEAN binderFound = FALSE;
|
||||
attachmentList::iterator iterend;
|
||||
attachmentList::iterator iter;
|
||||
UINT8 direction;
|
||||
|
||||
if(pObj==NULL)
|
||||
return;
|
||||
|
||||
// check all attachments, search for ELASTIC or DUCT_TAPE;
|
||||
iterend = (*pObj)[0]->attachments.end();
|
||||
for (iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
|
||||
{
|
||||
if ( iter->exists() && Item[iter->usItem].usItemClass == IC_MISC )
|
||||
{
|
||||
if(Item[iter->usItem].uiIndex == ELASTIC || Item[iter->usItem].uiIndex == DUCT_TAPE )
|
||||
{
|
||||
binderFound = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !binderFound )
|
||||
return;
|
||||
|
||||
// search for attached explosives
|
||||
for (iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
|
||||
{
|
||||
if ( iter->exists() && Item[iter->usItem].usItemClass & (IC_GRENADE|IC_BOMB) )
|
||||
{
|
||||
if(Item[iter->usItem].directional && ubDirection == DIRECTION_IRRELEVANT)
|
||||
direction=Random(8);
|
||||
else
|
||||
direction=ubDirection;
|
||||
if( Explosive[Item[iter->usItem].ubClassIndex].ubVolatility > 0 )
|
||||
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, Item[iter->usItem].uiIndex, bLevel, direction , NULL );
|
||||
}
|
||||
if ( gGameExternalOptions.bAllowSpecialExplosiveAttachments && iter->exists() && Item[iter->usItem].usItemClass & IC_MISC )
|
||||
{
|
||||
if(Item[iter->usItem].gascan)
|
||||
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, GAS_EXPLOSION, bLevel, DIRECTION_IRRELEVANT , NULL );
|
||||
if(Item[iter->usItem].alcohol)
|
||||
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, MOLOTOV_EXPLOSION, bLevel, DIRECTION_IRRELEVANT , NULL );
|
||||
if(Item[iter->usItem].marbles)
|
||||
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, FRAG_EXPLOSION, bLevel, DIRECTION_IRRELEVANT , NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user