mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- New behaviour for gas grenades:
Gas grenades now don't cause direct damage on hit anymore. They will cause damage on start of turn or if you move inside a gas cloud. Of course gas mask still helps (except for creature gas and fire). Every tile moved inside a gas cloud deals a percentage of the normal damage (default 10%). This is set in Item_Settings.ini (DAMAGE_HEALTH_MOVE_EXPLOSIVE_MODIFIER, DAMAGE_BREATH_MOVE_EXPLOSIVE_MODIFIER). Tiles can now have multiple gas effects on them. Unfortunately this is not visualized (yet). Smoke doesn't make a character immune to other gas types anymore. The 25% chance of taking damage while moving through a gas cloud has been removed. Damage is now applied 100% of the time. - New modifiers for explosive damage in Item_Settings.ini (DAMAGE_HEALTH_EXPLOSIVE_MODIFIER, DAMAGE_BREATH_EXPLOSIVE_MODIFIER). These could fully replace EXPLOSIVES_DAMAGE_MODIFIER in Ja2_Options.ini but I left that general modifier untouched for now. - Some compiler warning fixes. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6517 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1904,7 +1904,7 @@ BOOLEAN DamageSoldierFromBlast( UINT8 ubPerson, UINT8 ubOwner, INT32 sBombGridNo
|
||||
|
||||
BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, INT16 sSubsequent, BOOLEAN fRecompileMovementCosts, INT16 sWoundAmt, INT16 sBreathAmt, UINT8 ubOwner , BOOL fFromRemoteClient )
|
||||
{
|
||||
// OJW - 20091028
|
||||
// OJW - 20091028
|
||||
if (is_networked && is_client)
|
||||
{
|
||||
// only the owner of a merc may send damage (as this takes into account equipped gas mask)
|
||||
@@ -1925,6 +1925,8 @@ BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, IN
|
||||
#endif
|
||||
}
|
||||
|
||||
FLOAT fGasDamageModifier = 1.0;
|
||||
FLOAT fGasBreathDamageModifier = 1.0;
|
||||
INT8 bPosOfMask = NO_SLOT;
|
||||
|
||||
if (!pSoldier->bActive || !pSoldier->bInSector || !pSoldier->stats.bLife || AM_A_ROBOT( pSoldier ) )
|
||||
@@ -1941,6 +1943,7 @@ BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, IN
|
||||
}
|
||||
}
|
||||
|
||||
// no gas mask helps from creature attacks and fire
|
||||
if ( pExplosive->ubType == EXPLOSV_CREATUREGAS || pExplosive->ubType == EXPLOSV_BURNABLEGAS)
|
||||
{
|
||||
if ( sSubsequent && pSoldier->flags.fHitByGasFlags & HIT_BY_CREATUREGAS )
|
||||
@@ -1948,13 +1951,16 @@ BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, IN
|
||||
// already affected by creature gas this turn
|
||||
return( fRecompileMovementCosts );
|
||||
}
|
||||
if ( sSubsequent && pSoldier->flags.fHitByGasFlags & HIT_BY_BURNABLEGAS )
|
||||
// Who cares if he was affected already? Running through a gas cloud is not good for health so let him suffer!
|
||||
if ( /*sSubsequent &&*/ pSoldier->flags.fHitByGasFlags & HIT_BY_BURNABLEGAS )
|
||||
{
|
||||
// already affected by BURNABLEGAS this turn
|
||||
return( fRecompileMovementCosts );
|
||||
// Already affected by burnable gas this turn. Lower damage value by ini setting.
|
||||
fGasDamageModifier = gItemSettings.fDamageHealthMoveModifierExplosive;
|
||||
fGasBreathDamageModifier = gItemSettings.fDamageBreathMoveModifierExplosive;
|
||||
//return( fRecompileMovementCosts );
|
||||
}
|
||||
}
|
||||
else // no gas mask help from creature attacks
|
||||
else //
|
||||
// ATE/CJC: gas stuff
|
||||
{
|
||||
if ( pExplosive->ubType == EXPLOSV_TEARGAS )
|
||||
@@ -1970,10 +1976,13 @@ BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, IN
|
||||
}
|
||||
|
||||
// ignore whether subsequent or not if hit this turn
|
||||
// Who cares if he was affected already? Running through a gas cloud is not good for health so let him suffer!
|
||||
if ( pSoldier->flags.fHitByGasFlags & HIT_BY_TEARGAS )
|
||||
{
|
||||
// already affected by creature gas this turn
|
||||
return( fRecompileMovementCosts );
|
||||
// Already affected by tear gas this turn. Lower damage value by ini setting.
|
||||
fGasDamageModifier = gItemSettings.fDamageHealthMoveModifierExplosive;
|
||||
fGasBreathDamageModifier = gItemSettings.fDamageBreathMoveModifierExplosive;
|
||||
//return( fRecompileMovementCosts );
|
||||
}
|
||||
}
|
||||
else if ( pExplosive->ubType == EXPLOSV_MUSTGAS )
|
||||
@@ -1988,20 +1997,36 @@ BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, IN
|
||||
return( fRecompileMovementCosts );
|
||||
}
|
||||
|
||||
if ( sSubsequent && pSoldier->flags.fHitByGasFlags & HIT_BY_MUSTARDGAS )
|
||||
// Who cares if he was affected already? Running through a gas cloud is not good for health so let him suffer!
|
||||
if ( /*sSubsequent &&*/ pSoldier->flags.fHitByGasFlags & HIT_BY_MUSTARDGAS )
|
||||
{
|
||||
// already affected by creature gas this turn
|
||||
return( fRecompileMovementCosts );
|
||||
// Already affected by mustard gas this turn. Lower damage value by ini setting.
|
||||
fGasDamageModifier = gItemSettings.fDamageHealthMoveModifierExplosive;
|
||||
fGasBreathDamageModifier = gItemSettings.fDamageBreathMoveModifierExplosive;
|
||||
//return( fRecompileMovementCosts );
|
||||
}
|
||||
|
||||
}
|
||||
else if(pExplosive->ubType == EXPLOSV_SMOKE)//dnl ch40 200909
|
||||
{
|
||||
// ignore whether subsequent or not if hit this turn
|
||||
if(AM_A_ROBOT(pSoldier) || (pSoldier->flags.fHitByGasFlags & HIT_BY_SMOKEGAS))
|
||||
// robots are unaffected by smoke
|
||||
if( AM_A_ROBOT(pSoldier) )
|
||||
return(fRecompileMovementCosts);
|
||||
|
||||
// Who cares if he was affected already? Running through a gas cloud is not good for health so let him suffer!
|
||||
if ( pSoldier->flags.fHitByGasFlags & HIT_BY_SMOKEGAS )
|
||||
{
|
||||
// Already affected by smoke this turn. Lower damage value by ini setting.
|
||||
fGasDamageModifier = gItemSettings.fDamageHealthMoveModifierExplosive;
|
||||
fGasBreathDamageModifier = gItemSettings.fDamageBreathMoveModifierExplosive;
|
||||
//return( fRecompileMovementCosts );
|
||||
}
|
||||
}
|
||||
|
||||
// modify damage values
|
||||
sWoundAmt *= fGasDamageModifier;
|
||||
sBreathAmt *= fGasBreathDamageModifier;
|
||||
|
||||
bPosOfMask = FindGasMask(pSoldier);
|
||||
if(!DoesSoldierWearGasMask(pSoldier))//dnl ch40 200909
|
||||
bPosOfMask = NO_SLOT;
|
||||
@@ -2212,7 +2237,7 @@ BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usIte
|
||||
|
||||
// Calculate wound amount
|
||||
// HEADROCK HAM 3.6: Can now use negative modifier.
|
||||
INT16 newDamage = (INT16)GetModifiedExplosiveDamage( pExplosive->ubDamage );
|
||||
INT16 newDamage = (INT16)GetModifiedExplosiveDamage( pExplosive->ubDamage, 0 );
|
||||
//INT16 newDamage = pExplosive->ubDamage + (INT16)(( pExplosive->ubDamage * gGameExternalOptions.ubExplosivesDamageMultiplier) / 100); //lal
|
||||
|
||||
//DBrot: apply a modifier to confined explosions
|
||||
@@ -2222,7 +2247,7 @@ BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usIte
|
||||
sWoundAmt = newDamage + (INT16) ( (newDamage * uiRoll) / 100 );
|
||||
|
||||
// Calculate breath amount ( if stun damage applicable )
|
||||
INT16 newBreath = (INT16)GetModifiedExplosiveDamage( pExplosive->ubStunDamage );
|
||||
INT16 newBreath = (INT16)GetModifiedExplosiveDamage( pExplosive->ubStunDamage, 1 );
|
||||
//INT16 newBreath = pExplosive->ubStunDamage + (INT16)(( pExplosive->ubStunDamage * gGameExternalOptions.ubExplosivesDamageMultiplier) / 100); //lal
|
||||
|
||||
if(InARoom(sBombGridNo, NULL)){
|
||||
@@ -2416,7 +2441,10 @@ BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usIte
|
||||
|
||||
pSoldier = MercPtrs[ ubPerson ]; // someone is here, and they're gonna get hurt
|
||||
|
||||
fRecompileMovementCosts = DishOutGasDamage( pSoldier, pExplosive, sSubsequent, fRecompileMovementCosts, sWoundAmt, sBreathAmt, ubOwner );
|
||||
// silversurfer: Gas now only has an effect when the container had time to emit some. Initially it will do nothing.
|
||||
// This prevents the problem that we have to suffer two times without a chance to react (1st when the grenade hits our position, 2nd when our turn starts)
|
||||
if ( sSubsequent > 0 )
|
||||
fRecompileMovementCosts = DishOutGasDamage( pSoldier, pExplosive, sSubsequent, fRecompileMovementCosts, sWoundAmt, sBreathAmt, ubOwner );
|
||||
/*
|
||||
if (!pSoldier->bActive || !pSoldier->bInSector || !pSoldier->stats.bLife || AM_A_ROBOT( pSoldier ) )
|
||||
{
|
||||
|
||||
@@ -315,8 +315,11 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT32 sGridNo, INT8
|
||||
|
||||
|
||||
// If smoke effect exists already.... stop
|
||||
// silversurfer: Why? What if we throw another grenade of different type? Set at least the flag for the gas type...
|
||||
if ( gpWorldLevelData[ sGridNo ].ubExtFlags[ bLevel ] & ANY_SMOKE_EFFECT )
|
||||
{
|
||||
// Set world flags
|
||||
gpWorldLevelData[ sGridNo ].ubExtFlags[ bLevel ] |= FromSmokeTypeToWorldFlags( bType );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -841,7 +841,7 @@ BOOLEAN LightAddTile(UINT32 uiLightType, INT16 iSrcX, INT16 iSrcY, INT16 iX, INT
|
||||
{
|
||||
LEVELNODE *pLand, *pStruct, *pObject, *pMerc, *pRoof, *pOnRoof;
|
||||
UINT8 ubShadeAdd;
|
||||
UINT32 uiTile;
|
||||
INT32 uiTile;
|
||||
BOOLEAN fLitWall=FALSE;
|
||||
BOOLEAN fFake;
|
||||
|
||||
@@ -983,7 +983,7 @@ BOOLEAN LightSubtractTile(UINT32 uiLightType, INT16 iSrcX, INT16 iSrcY, INT16 iX
|
||||
{
|
||||
LEVELNODE *pLand, *pStruct, *pObject, *pMerc, *pRoof, *pOnRoof;
|
||||
UINT8 ubShadeSubtract;
|
||||
UINT32 uiTile;
|
||||
INT32 uiTile;
|
||||
BOOLEAN fLitWall=FALSE;
|
||||
BOOLEAN fFake; // only passed in to land and roof layers; others get fed FALSE
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ void InitNewOverheadDB( UINT8 ubTilesetID )
|
||||
UINT32 dbSize = 0;
|
||||
|
||||
|
||||
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
|
||||
for (uiLoop = 0; uiLoop < (UINT32)giNumberOfTileTypes; uiLoop++)
|
||||
{
|
||||
|
||||
// Create video object
|
||||
@@ -189,7 +189,7 @@ void InitNewOverheadDB( UINT8 ubTilesetID )
|
||||
}
|
||||
|
||||
// NOW LOOP THROUGH AND CREATE DATABASE
|
||||
for( cnt1 = 0; cnt1 < giNumberOfTileTypes; cnt1++ )
|
||||
for( cnt1 = 0; cnt1 < (UINT32)giNumberOfTileTypes; cnt1++ )
|
||||
{
|
||||
// Get number of regions
|
||||
s = gSmTileSurf[ cnt1 ];
|
||||
@@ -2051,7 +2051,7 @@ void CopyOverheadDBShadetablesFromTileset( )
|
||||
|
||||
|
||||
// Loop through tileset
|
||||
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
|
||||
for (uiLoop = 0; uiLoop < (UINT32)giNumberOfTileTypes; uiLoop++)
|
||||
{
|
||||
pTileSurf = ( gTileSurfaceArray[ uiLoop ] );
|
||||
|
||||
|
||||
@@ -648,7 +648,7 @@ void CreateTileDatabase( )
|
||||
TILE_ELEMENT TileElement;
|
||||
|
||||
// Loop through all surfaces and tiles and build database
|
||||
for( cnt1 = 0; cnt1 < giNumberOfTileTypes; cnt1++ )
|
||||
for( cnt1 = 0; cnt1 < (UINT32)giNumberOfTileTypes; cnt1++ )
|
||||
{
|
||||
// Get number of regions
|
||||
TileSurf = gTileSurfaceArray[ cnt1 ];
|
||||
@@ -1013,7 +1013,7 @@ BOOLEAN GetTypeSubIndexFromTileIndex( UINT32 uiCheckType, UINT16 usIndex, UINT16
|
||||
|
||||
*pusSubIndex = 0xffff;
|
||||
|
||||
CHECKF ( uiCheckType < giNumberOfTileTypes );
|
||||
CHECKF ( uiCheckType < (UINT32)giNumberOfTileTypes );
|
||||
|
||||
*pusSubIndex = usIndex - gTileTypeStartIndex[ uiCheckType ] + 1;
|
||||
|
||||
@@ -1026,7 +1026,7 @@ BOOLEAN GetTypeSubIndexFromTileIndexChar( UINT32 uiCheckType, UINT16 usIndex, UI
|
||||
|
||||
// Tile database is zero-based, Type indecies are 1-based!
|
||||
|
||||
CHECKF ( uiCheckType < giNumberOfTileTypes );
|
||||
CHECKF ( uiCheckType < (UINT32)giNumberOfTileTypes );
|
||||
|
||||
*pubSubIndex = (UINT8)(usIndex - gTileTypeStartIndex[ uiCheckType ] + 1);
|
||||
|
||||
@@ -1039,7 +1039,7 @@ BOOLEAN GetTileIndexFromTypeSubIndex( UINT32 uiCheckType, UINT16 usSubIndex, UIN
|
||||
|
||||
*pusTileIndex = 0xffff;
|
||||
|
||||
CHECKF ( uiCheckType < giNumberOfTileTypes );
|
||||
CHECKF ( uiCheckType < (UINT32)giNumberOfTileTypes );
|
||||
|
||||
*pusTileIndex = usSubIndex + gTileTypeStartIndex[ uiCheckType ] - 1;
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ BOOLEAN LoadTileSurfaces( char ppTileSurfaceFilenames[][32], UINT8 ubTilesetID )
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
|
||||
for (uiLoop = 0; uiLoop < (UINT32)giNumberOfTileTypes; uiLoop++)
|
||||
strcpy( TileSurfaceFilenames[uiLoop], ppTileSurfaceFilenames[uiLoop] );//(ppTileSurfaceFilenames + (65 * uiLoop)) );
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ BOOLEAN LoadTileSurfaces( char ppTileSurfaceFilenames[][32], UINT8 ubTilesetID )
|
||||
//uiFillColor = Get16BPPColor(FROMRGB( 100, 0, 0 ));
|
||||
// load the tile surfaces
|
||||
SetRelativeStartAndEndPercentage( 0, 1, 35, L"Tile Surfaces" );
|
||||
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
|
||||
for (uiLoop = 0; uiLoop < (UINT32)giNumberOfTileTypes; uiLoop++)
|
||||
{
|
||||
|
||||
|
||||
@@ -711,7 +711,7 @@ void BuildTileShadeTables( )
|
||||
memset( gbNewTileSurfaceLoaded, 1, sizeof( gbNewTileSurfaceLoaded ) );
|
||||
}
|
||||
|
||||
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
|
||||
for (uiLoop = 0; uiLoop < (UINT32)giNumberOfTileTypes; uiLoop++)
|
||||
{
|
||||
if ( gTileSurfaceArray[ uiLoop ] != NULL )
|
||||
{
|
||||
@@ -757,7 +757,7 @@ void DestroyTileShadeTables( )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
|
||||
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
|
||||
for (uiLoop = 0; uiLoop < (UINT32)giNumberOfTileTypes; uiLoop++)
|
||||
{
|
||||
if ( gTileSurfaceArray[ uiLoop ] != NULL )
|
||||
{
|
||||
@@ -781,7 +781,7 @@ void DestroyTileSurfaces( )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
|
||||
for (uiLoop = 0; uiLoop < giNumberOfTileTypes; uiLoop++)
|
||||
for (uiLoop = 0; uiLoop < (UINT32)giNumberOfTileTypes; uiLoop++)
|
||||
{
|
||||
if ( gTileSurfaceArray[ uiLoop ] != NULL )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user