mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,8 +98,8 @@ extern EXPLOSIONTYPE gExplosionData[ NUM_EXPLOSION_SLOTS ];
|
||||
extern UINT8 gubElementsOnExplosionQueue;
|
||||
extern BOOLEAN gfExplosionQueueActive;
|
||||
|
||||
void IgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubDirection = DIRECTION_IRRELEVANT );
|
||||
void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection = DIRECTION_IRRELEVANT );
|
||||
void IgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubDirection = DIRECTION_IRRELEVANT, OBJECTTYPE * pObj =NULL );
|
||||
void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection = DIRECTION_IRRELEVANT, OBJECTTYPE * pObj =NULL );
|
||||
|
||||
|
||||
void GenerateExplosion( EXPLOSION_PARAMS *pExpParams );
|
||||
@@ -163,4 +163,6 @@ extern void HandleSeeingFortifiedDoor( UINT32 sGridNo );//Ja25 UB
|
||||
// Flugente: handle secondary explosive effects
|
||||
void HandleBuddyExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection );
|
||||
|
||||
// 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 );
|
||||
#endif
|
||||
|
||||
@@ -40,6 +40,8 @@ void AddRemoveExitGridToUnloadedMapTempFile( UINT32 usGridNo, INT16 sSectorX, IN
|
||||
void RemoveSavedStructFromMap( INT32 uiMapIndex, UINT16 usIndex );
|
||||
void AddObjectFromMapTempFileToMap( INT32 uiMapIndex, UINT16 usIndex );
|
||||
void AddBloodOrSmellFromMapTempFileToMap( MODIFY_MAP *pMap );
|
||||
// sevenfm
|
||||
void AddMineFlagFromMapTempFileToMap( MODIFY_MAP *pMap );
|
||||
void SetSectorsRevealedBit( UINT32 usMapIndex );
|
||||
void SetMapRevealedStatus();
|
||||
void DamageStructsFromMapTempFile( MODIFY_MAP * pMap );
|
||||
@@ -450,7 +452,10 @@ BOOLEAN LoadAllMapChangesFromMapTempFileAndApplyThem( )
|
||||
case SLM_BLOOD_SMELL:
|
||||
AddBloodOrSmellFromMapTempFileToMap( pMap );
|
||||
break;
|
||||
|
||||
// sevenfm
|
||||
case SLM_MINE_PRESENT:
|
||||
AddMineFlagFromMapTempFileToMap( pMap );
|
||||
break;
|
||||
case SLM_DAMAGED_STRUCT:
|
||||
DamageStructsFromMapTempFile( pMap );
|
||||
break;
|
||||
@@ -665,8 +670,23 @@ void RemoveSavedStructFromMap( INT32 uiMapIndex, UINT16 usIndex )
|
||||
}
|
||||
|
||||
|
||||
// sevenfm
|
||||
void SaveMineFlagFromMapToTempFile()
|
||||
{
|
||||
MODIFY_MAP Map;
|
||||
INT32 cnt;
|
||||
|
||||
|
||||
for ( cnt = 0; cnt < WORLD_MAX; cnt++ )
|
||||
{
|
||||
if( gpWorldLevelData[cnt].uiFlags & MAPELEMENT_PLAYER_MINE_PRESENT )
|
||||
{
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
Map.usGridNo = cnt;
|
||||
Map.ubType = SLM_MINE_PRESENT;
|
||||
SaveModifiedMapStructToMapTempFile( &Map, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
}
|
||||
}
|
||||
}
|
||||
void SaveBloodSmellAndRevealedStatesFromMapToTempFile()
|
||||
{
|
||||
MODIFY_MAP Map;
|
||||
@@ -786,6 +806,11 @@ void AddBloodOrSmellFromMapTempFileToMap( MODIFY_MAP *pMap )
|
||||
gpWorldLevelData[ pMap->usGridNo ].ubSmellInfo = (UINT8)pMap->usSubImageIndex;
|
||||
}
|
||||
|
||||
//sevenfm
|
||||
void AddMineFlagFromMapTempFileToMap( MODIFY_MAP *pMap )
|
||||
{
|
||||
gpWorldLevelData[ pMap->usGridNo ].uiFlags |= MAPELEMENT_PLAYER_MINE_PRESENT;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN SaveRevealedStatusArrayToRevealedTempFile( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
||||
|
||||
@@ -46,6 +46,8 @@ enum
|
||||
#ifdef JA2UB
|
||||
SLM_REMOVE_EXIT_GRID,
|
||||
#endif
|
||||
// sevenfm
|
||||
SLM_MINE_PRESENT,
|
||||
};
|
||||
|
||||
typedef struct
|
||||
@@ -88,6 +90,8 @@ void AddRemoveObjectToMapTempFile( INT32 uiMapIndex, UINT16 usIndex );
|
||||
|
||||
void SaveBloodSmellAndRevealedStatesFromMapToTempFile();
|
||||
|
||||
// sevenfm
|
||||
void SaveMineFlagFromMapToTempFile();
|
||||
|
||||
BOOLEAN SaveRevealedStatusArrayToRevealedTempFile( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
|
||||
|
||||
|
||||
@@ -2708,7 +2708,7 @@ void HandleArmedObjectImpact( REAL_OBJECT *pObject )
|
||||
}
|
||||
*/
|
||||
|
||||
IgniteExplosion( pObject->ubOwner, (INT16)pObject->Position.x, (INT16)pObject->Position.y, sZ, pObject->sGridNo, pObject->Obj.usItem, GET_OBJECT_LEVEL( pObject->Position.z - CONVERT_PIXELS_TO_HEIGHTUNITS( gpWorldLevelData[ pObject->sGridNo ].sHeight ) ) );
|
||||
IgniteExplosion( pObject->ubOwner, (INT16)pObject->Position.x, (INT16)pObject->Position.y, sZ, pObject->sGridNo, pObject->Obj.usItem, GET_OBJECT_LEVEL( pObject->Position.z - CONVERT_PIXELS_TO_HEIGHTUNITS( gpWorldLevelData[ pObject->sGridNo ].sHeight ) ), DIRECTION_IRRELEVANT, &pObject->Obj );
|
||||
}
|
||||
else if ( Item[ pObject->Obj.usItem ].usItemClass == IC_BOMB ) //if ( pObject->Obj.usItem == MORTAR_SHELL )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user