mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Merged New Inventory Project into main branch
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+267
-263
@@ -8,10 +8,10 @@
|
||||
#include "wcheck.h"
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "soldier control.h"
|
||||
//#include "soldier control.h"
|
||||
#include "weapons.h"
|
||||
#include "handle items.h"
|
||||
#include "worlddef.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "animation control.h"
|
||||
#include "tile animation.h"
|
||||
@@ -30,6 +30,11 @@
|
||||
|
||||
#include "SaveLoadGame.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
|
||||
|
||||
INT8 FromWorldFlagsToSmokeType( UINT16 ubWorldFlags );
|
||||
UINT16 FromSmokeTypeToWorldFlags( INT8 bType );
|
||||
@@ -153,10 +158,10 @@ UINT16 FromSmokeTypeToWorldFlags( INT8 bType )
|
||||
return( MAPELEMENT_EXT_BURNABLEGAS );
|
||||
break;
|
||||
|
||||
case CREATURE_SMOKE_EFFECT:
|
||||
|
||||
return( MAPELEMENT_EXT_CREATUREGAS );
|
||||
break;
|
||||
case CREATURE_SMOKE_EFFECT:
|
||||
|
||||
return( MAPELEMENT_EXT_CREATUREGAS );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -192,8 +197,8 @@ INT32 NewSmokeEffect( INT16 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner )
|
||||
}
|
||||
|
||||
|
||||
switch( Explosive[Item[usItem].ubClassIndex].ubType )
|
||||
{
|
||||
switch( Explosive[Item[usItem].ubClassIndex].ubType )
|
||||
{
|
||||
case EXPLOSV_MUSTGAS:
|
||||
|
||||
bSmokeEffectType = MUSTARDGAS_SMOKE_EFFECT;
|
||||
@@ -205,54 +210,54 @@ INT32 NewSmokeEffect( INT16 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner )
|
||||
break;
|
||||
|
||||
case EXPLOSV_TEARGAS:
|
||||
bSmokeEffectType = TEARGAS_SMOKE_EFFECT;
|
||||
bSmokeEffectType = TEARGAS_SMOKE_EFFECT;
|
||||
break;
|
||||
|
||||
case EXPLOSV_SMOKE:
|
||||
|
||||
bSmokeEffectType = NORMAL_SMOKE_EFFECT;
|
||||
bSmokeEffectType = NORMAL_SMOKE_EFFECT;
|
||||
break;
|
||||
|
||||
// case SMALL_CREATURE_GAS:
|
||||
//bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
// case SMALL_CREATURE_GAS:
|
||||
//bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
//ubDuration = 3;
|
||||
//ubStartRadius = 1;
|
||||
//break;
|
||||
|
||||
case EXPLOSV_CREATUREGAS:
|
||||
bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
case EXPLOSV_CREATUREGAS:
|
||||
bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
break;
|
||||
|
||||
// case VERY_SMALL_CREATURE_GAS:
|
||||
// case VERY_SMALL_CREATURE_GAS:
|
||||
|
||||
//bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
//bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
//ubDuration = 2;
|
||||
//ubStartRadius = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
pSmoke->ubDuration = (UINT8)Explosive[ Item[ usItem ].ubClassIndex ].ubDuration;
|
||||
pSmoke->ubRadius = (UINT8)Explosive[ Item[ usItem ].ubClassIndex ].ubStartRadius;
|
||||
pSmoke->ubRadius = (UINT8)Explosive[ Item[ usItem ].ubClassIndex ].ubStartRadius;
|
||||
pSmoke->bAge = 0;
|
||||
pSmoke->fAllocated = TRUE;
|
||||
pSmoke->fAllocated = TRUE;
|
||||
pSmoke->bType = bSmokeEffectType;
|
||||
pSmoke->ubOwner = ubOwner;
|
||||
pSmoke->ubOwner = ubOwner;
|
||||
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_INDOORS )
|
||||
{
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_INDOORS )
|
||||
{
|
||||
// Duration is increased by 2 turns...indoors
|
||||
pSmoke->ubDuration += 3;
|
||||
}
|
||||
}
|
||||
|
||||
if ( bLevel )
|
||||
{
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_ON_ROOF;
|
||||
}
|
||||
if ( bLevel )
|
||||
{
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_ON_ROOF;
|
||||
}
|
||||
|
||||
// ATE: FALSE into subsequent-- it's the first one!
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, FALSE, bLevel, iSmokeIndex );
|
||||
// ATE: FALSE into subsequent-- it's the first one!
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, FALSE, bLevel, iSmokeIndex );
|
||||
|
||||
return( iSmokeIndex );
|
||||
}
|
||||
@@ -264,17 +269,17 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT16 sGridNo, INT8
|
||||
{
|
||||
ANITILE_PARAMS AniParams;
|
||||
ANITILE *pAniTile;
|
||||
SMOKEEFFECT *pSmoke;
|
||||
BOOLEAN fDissipating = FALSE;
|
||||
SMOKEEFFECT *pSmoke;
|
||||
BOOLEAN fDissipating = FALSE;
|
||||
|
||||
pSmoke = &gSmokeEffectData[ iSmokeEffectID ];
|
||||
|
||||
if ( ( pSmoke->ubDuration - pSmoke->bAge ) < 2 )
|
||||
{
|
||||
fDissipating = TRUE;
|
||||
// Remove old one...
|
||||
RemoveSmokeEffectFromTile( sGridNo, bLevel );
|
||||
}
|
||||
if ( ( pSmoke->ubDuration - pSmoke->bAge ) < 2 )
|
||||
{
|
||||
fDissipating = TRUE;
|
||||
// Remove old one...
|
||||
RemoveSmokeEffectFromTile( sGridNo, bLevel );
|
||||
}
|
||||
|
||||
|
||||
// If smoke effect exists already.... stop
|
||||
@@ -282,31 +287,31 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT16 sGridNo, INT8
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// OK, Create anitile....
|
||||
|
||||
// OK, Create anitile....
|
||||
memset( &AniParams, 0, sizeof( ANITILE_PARAMS ) );
|
||||
AniParams.sGridNo = sGridNo;
|
||||
|
||||
if ( bLevel == 0 )
|
||||
{
|
||||
AniParams.ubLevelID = ANI_STRUCT_LEVEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.ubLevelID = ANI_ONROOF_LEVEL;
|
||||
}
|
||||
if ( bLevel == 0 )
|
||||
{
|
||||
AniParams.ubLevelID = ANI_STRUCT_LEVEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.ubLevelID = ANI_ONROOF_LEVEL;
|
||||
}
|
||||
|
||||
|
||||
AniParams.sDelay = (INT16)( 300 + Random( 300 ) );
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
AniParams.sStartFrame = (INT16)0;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.sStartFrame = (INT16)Random( 5 );
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
AniParams.sStartFrame = (INT16)0;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.sStartFrame = (INT16)Random( 5 );
|
||||
}
|
||||
|
||||
|
||||
// Bare bones flags are...
|
||||
@@ -314,14 +319,14 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT16 sGridNo, INT8
|
||||
//AniParams.uiFlags = ANITILE_CACHEDTILE | ANITILE_FORWARD | ANITILE_SMOKE_EFFECT | ANITILE_LOOPING;
|
||||
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
AniParams.uiFlags = ANITILE_PAUSED | ANITILE_CACHEDTILE | ANITILE_FORWARD | ANITILE_SMOKE_EFFECT | ANITILE_LOOPING;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.uiFlags = ANITILE_CACHEDTILE | ANITILE_FORWARD | ANITILE_SMOKE_EFFECT | ANITILE_LOOPING | ANITILE_ALWAYS_TRANSLUCENT;
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
AniParams.uiFlags = ANITILE_PAUSED | ANITILE_CACHEDTILE | ANITILE_FORWARD | ANITILE_SMOKE_EFFECT | ANITILE_LOOPING;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.uiFlags = ANITILE_CACHEDTILE | ANITILE_FORWARD | ANITILE_SMOKE_EFFECT | ANITILE_LOOPING | ANITILE_ALWAYS_TRANSLUCENT;
|
||||
}
|
||||
|
||||
AniParams.sX = CenterX( sGridNo );
|
||||
AniParams.sY = CenterY( sGridNo );
|
||||
@@ -332,97 +337,97 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT16 sGridNo, INT8
|
||||
{
|
||||
case NORMAL_SMOKE_EFFECT:
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smkechze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalsmke.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\SMOKE.STI" );
|
||||
}
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smkechze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalsmke.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\SMOKE.STI" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TEARGAS_SMOKE_EFFECT:
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\tearchze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smaltear.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\TEARGAS.STI" );
|
||||
}
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\tearchze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smaltear.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\TEARGAS.STI" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MUSTARDGAS_SMOKE_EFFECT:
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\mustchze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalmust.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\MUSTARD2.STI" );
|
||||
}
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\mustchze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalmust.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\MUSTARD2.STI" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case BURNABLEGAS_SMOKE_EFFECT:
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\FLAMCHZE.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalflam.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\FLAMETH2.STI" );
|
||||
}
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\FLAMCHZE.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalflam.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\FLAMETH2.STI" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CREATURE_SMOKE_EFFECT:
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -455,7 +460,7 @@ void RemoveSmokeEffectFromTile( INT16 sGridNo, INT8 bLevel )
|
||||
}
|
||||
|
||||
pAniTile = GetCachedAniTileOfType( sGridNo, ubLevelID, ANITILE_SMOKE_EFFECT );
|
||||
|
||||
|
||||
if ( pAniTile != NULL )
|
||||
{
|
||||
DeleteAniTile( pAniTile );
|
||||
@@ -476,71 +481,71 @@ void DecaySmokeEffects( UINT32 uiTime )
|
||||
{
|
||||
SMOKEEFFECT *pSmoke;
|
||||
UINT32 cnt, cnt2;
|
||||
BOOLEAN fUpdate = FALSE;
|
||||
BOOLEAN fSpreadEffect;
|
||||
INT8 bLevel;
|
||||
UINT16 usNumUpdates = 1;
|
||||
BOOLEAN fUpdate = FALSE;
|
||||
BOOLEAN fSpreadEffect;
|
||||
INT8 bLevel;
|
||||
UINT16 usNumUpdates = 1;
|
||||
|
||||
for ( cnt = 0; cnt < guiNumMercSlots; cnt++ )
|
||||
{
|
||||
if ( MercSlots[ cnt ] )
|
||||
{
|
||||
// reset 'hit by gas' flags
|
||||
MercSlots[ cnt ]->fHitByGasFlags = 0;
|
||||
MercSlots[ cnt ]->flags.fHitByGasFlags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// ATE: 1 ) make first pass and delete/mark any smoke effect for update
|
||||
// all the deleting has to be done first///
|
||||
// ATE: 1 ) make first pass and delete/mark any smoke effect for update
|
||||
// all the deleting has to be done first///
|
||||
|
||||
// age all active tear gas clouds, deactivate those that are just dispersing
|
||||
for ( cnt = 0; cnt < guiNumSmokeEffects; cnt++ )
|
||||
{
|
||||
// age all active tear gas clouds, deactivate those that are just dispersing
|
||||
for ( cnt = 0; cnt < guiNumSmokeEffects; cnt++ )
|
||||
{
|
||||
fSpreadEffect = TRUE;
|
||||
|
||||
pSmoke = &gSmokeEffectData[ cnt ];
|
||||
|
||||
|
||||
if ( pSmoke->fAllocated )
|
||||
{
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
|
||||
|
||||
// Do things differently for combat /vs realtime
|
||||
// always try to update during combat
|
||||
if (gTacticalStatus.uiFlags & INCOMBAT )
|
||||
{
|
||||
fUpdate = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ATE: Do this every so ofte, to acheive the effect we want...
|
||||
if ( ( uiTime - pSmoke->uiTimeOfLastUpdate ) > 10 )
|
||||
{
|
||||
fUpdate = TRUE;
|
||||
// Do things differently for combat /vs realtime
|
||||
// always try to update during combat
|
||||
if (gTacticalStatus.uiFlags & INCOMBAT )
|
||||
{
|
||||
fUpdate = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ATE: Do this every so ofte, to acheive the effect we want...
|
||||
if ( ( uiTime - pSmoke->uiTimeOfLastUpdate ) > 10 )
|
||||
{
|
||||
fUpdate = TRUE;
|
||||
|
||||
usNumUpdates = ( UINT16 ) ( ( uiTime - pSmoke->uiTimeOfLastUpdate ) / 10 );
|
||||
}
|
||||
}
|
||||
usNumUpdates = ( UINT16 ) ( ( uiTime - pSmoke->uiTimeOfLastUpdate ) / 10 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( fUpdate )
|
||||
{
|
||||
if ( fUpdate )
|
||||
{
|
||||
pSmoke->uiTimeOfLastUpdate = uiTime;
|
||||
|
||||
for ( cnt2 = 0; cnt2 < usNumUpdates; cnt2++ )
|
||||
{
|
||||
pSmoke->bAge++;
|
||||
for ( cnt2 = 0; cnt2 < usNumUpdates; cnt2++ )
|
||||
{
|
||||
pSmoke->bAge++;
|
||||
|
||||
if ( pSmoke->bAge == 1 )
|
||||
{
|
||||
// ATE: At least mark for update!
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_MARK_FOR_UPDATE;
|
||||
// ATE: At least mark for update!
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_MARK_FOR_UPDATE;
|
||||
fSpreadEffect = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -548,66 +553,66 @@ void DecaySmokeEffects( UINT32 uiTime )
|
||||
fSpreadEffect = TRUE;
|
||||
}
|
||||
|
||||
if ( fSpreadEffect )
|
||||
{
|
||||
// if this cloud remains effective (duration not reached)
|
||||
if ( pSmoke->bAge <= pSmoke->ubDuration)
|
||||
{
|
||||
// ATE: Only mark now and increse radius - actual drawing is done
|
||||
// in another pass cause it could
|
||||
// just get erased...
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_MARK_FOR_UPDATE;
|
||||
if ( fSpreadEffect )
|
||||
{
|
||||
// if this cloud remains effective (duration not reached)
|
||||
if ( pSmoke->bAge <= pSmoke->ubDuration)
|
||||
{
|
||||
// ATE: Only mark now and increse radius - actual drawing is done
|
||||
// in another pass cause it could
|
||||
// just get erased...
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_MARK_FOR_UPDATE;
|
||||
|
||||
// calculate the new cloud radius
|
||||
// cloud expands by 1 every turn outdoors, and every other turn indoors
|
||||
// calculate the new cloud radius
|
||||
// cloud expands by 1 every turn outdoors, and every other turn indoors
|
||||
|
||||
// ATE: If radius is < maximun, increase radius, otherwise keep at max
|
||||
if ( pSmoke->ubRadius < Explosive[ Item[ pSmoke->usItem ].ubClassIndex ].ubRadius )
|
||||
{
|
||||
pSmoke->ubRadius++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// deactivate tear gas cloud (use last known radius)
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, ERASE_SPREAD_EFFECT, bLevel, cnt );
|
||||
pSmoke->fAllocated = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ATE: If radius is < maximun, increase radius, otherwise keep at max
|
||||
if ( pSmoke->ubRadius < Explosive[ Item[ pSmoke->usItem ].ubClassIndex ].ubRadius )
|
||||
{
|
||||
pSmoke->ubRadius++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// deactivate tear gas cloud (use last known radius)
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, ERASE_SPREAD_EFFECT, bLevel, cnt );
|
||||
pSmoke->fAllocated = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// damage anyone standing in cloud
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, REDO_SPREAD_EFFECT, bLevel, cnt );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( cnt = 0; cnt < guiNumSmokeEffects; cnt++ )
|
||||
{
|
||||
for ( cnt = 0; cnt < guiNumSmokeEffects; cnt++ )
|
||||
{
|
||||
pSmoke = &gSmokeEffectData[ cnt ];
|
||||
|
||||
|
||||
if ( pSmoke->fAllocated )
|
||||
{
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
|
||||
// if this cloud remains effective (duration not reached)
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_MARK_FOR_UPDATE )
|
||||
// if this cloud remains effective (duration not reached)
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_MARK_FOR_UPDATE )
|
||||
{
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, TRUE, bLevel, cnt );
|
||||
pSmoke->bFlags &= (~SMOKE_EFFECT_MARK_FOR_UPDATE);
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, TRUE, bLevel, cnt );
|
||||
pSmoke->bFlags &= (~SMOKE_EFFECT_MARK_FOR_UPDATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AllTeamsLookForAll( TRUE );
|
||||
}
|
||||
@@ -665,10 +670,10 @@ BOOLEAN LoadSmokeEffectsFromLoadGameFile( HWFILE hFile )
|
||||
UINT32 uiNumBytesRead;
|
||||
UINT32 uiCount;
|
||||
UINT32 uiCnt=0;
|
||||
INT8 bLevel;
|
||||
INT8 bLevel;
|
||||
|
||||
//no longer need to load smoke effects. They are now in temp files
|
||||
if( guiSaveGameVersion < 75 )
|
||||
//no longer need to load smoke effects. They are now in temp files
|
||||
if( guiCurrentSaveGameVersion < 75 )
|
||||
{
|
||||
//Clear out the old list
|
||||
memset( gSmokeEffectData, 0, sizeof( SMOKEEFFECT ) * NUM_SMOKE_EFFECT_SLOTS );
|
||||
@@ -681,7 +686,7 @@ BOOLEAN LoadSmokeEffectsFromLoadGameFile( HWFILE hFile )
|
||||
}
|
||||
|
||||
//This is a TEMP hack to allow us to use the saves
|
||||
if( guiSaveGameVersion < 37 && guiNumSmokeEffects == 0 )
|
||||
if( guiCurrentSaveGameVersion < 37 && guiNumSmokeEffects == 0 )
|
||||
{
|
||||
//Load the Smoke effect Data
|
||||
FileRead( hFile, gSmokeEffectData, sizeof( SMOKEEFFECT ), &uiNumBytesRead );
|
||||
@@ -702,7 +707,7 @@ BOOLEAN LoadSmokeEffectsFromLoadGameFile( HWFILE hFile )
|
||||
return( FALSE );
|
||||
}
|
||||
//This is a TEMP hack to allow us to use the saves
|
||||
if( guiSaveGameVersion < 37 )
|
||||
if( guiCurrentSaveGameVersion < 37 )
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -713,14 +718,14 @@ BOOLEAN LoadSmokeEffectsFromLoadGameFile( HWFILE hFile )
|
||||
//if this slot is allocated
|
||||
if( gSmokeEffectData[uiCount].fAllocated )
|
||||
{
|
||||
if ( gSmokeEffectData[uiCount].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
if ( gSmokeEffectData[uiCount].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
|
||||
SpreadEffect( gSmokeEffectData[uiCount].sGridNo, gSmokeEffectData[uiCount].ubRadius, gSmokeEffectData[uiCount].usItem, gSmokeEffectData[uiCount].ubOwner, TRUE, bLevel, uiCount );
|
||||
}
|
||||
@@ -815,9 +820,8 @@ BOOLEAN LoadSmokeEffectsFromMapTempFile( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
UINT32 uiCount;
|
||||
UINT32 uiCnt=0;
|
||||
HWFILE hFile;
|
||||
UINT32 uiNumBytesWritten=0;
|
||||
CHAR8 zMapName[ 128 ];
|
||||
INT8 bLevel;
|
||||
INT8 bLevel;
|
||||
|
||||
GetMapTempFileName( SF_SMOKE_EFFECTS_TEMP_FILE_EXISTS, zMapName, sMapX, sMapY, bMapZ );
|
||||
|
||||
@@ -860,14 +864,14 @@ BOOLEAN LoadSmokeEffectsFromMapTempFile( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
//if this slot is allocated
|
||||
if( gSmokeEffectData[uiCount].fAllocated )
|
||||
{
|
||||
if ( gSmokeEffectData[uiCount].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
if ( gSmokeEffectData[uiCount].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
|
||||
SpreadEffect( gSmokeEffectData[uiCount].sGridNo, gSmokeEffectData[uiCount].ubRadius, gSmokeEffectData[uiCount].usItem, gSmokeEffectData[uiCount].ubOwner, TRUE, bLevel, uiCount );
|
||||
}
|
||||
@@ -889,9 +893,9 @@ void ResetSmokeEffects()
|
||||
|
||||
void UpdateSmokeEffectGraphics( )
|
||||
{
|
||||
UINT32 uiCnt;
|
||||
UINT32 uiCnt;
|
||||
SMOKEEFFECT *pSmoke;
|
||||
INT8 bLevel;
|
||||
INT8 bLevel;
|
||||
|
||||
//loop through and save the number of smoke effects
|
||||
for( uiCnt=0; uiCnt < guiNumSmokeEffects; uiCnt++)
|
||||
@@ -901,18 +905,18 @@ void UpdateSmokeEffectGraphics( )
|
||||
//if the smoke is active
|
||||
if( gSmokeEffectData[ uiCnt ].fAllocated )
|
||||
{
|
||||
if ( gSmokeEffectData[uiCnt].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
if ( gSmokeEffectData[uiCnt].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, ERASE_SPREAD_EFFECT, bLevel, uiCnt );
|
||||
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, TRUE, bLevel, uiCnt );
|
||||
}
|
||||
}
|
||||
}
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, TRUE, bLevel, uiCnt );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user