mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Made direction variables more consistent as unsigned chars. Several function prototypes updated for this. Many memory leaks plugged: External options, video overlays, laptop file lists, tactical message queue, strategic pathing, autobandage, merc hiring, detailed placements, crate in Drassen, tactical placement New functions and attributes for soldiers in LUA (still for debugging at best): Soldier.APs (current APs), Soldier.changestance (changes stance, uses game heights) File catalog ignores .SVN directories (game load speedup) Fix CTD in mouse regions JA2 window now refuses to move to negative coords Checks to prevent DirectX-related infinite loops due to minimizing and task switching Invading enemies should now appear on the borders even when reinforcements disabled in .ini Suppression should no longer work on mercs in medium water Infant/Young creatures use restored spit instead of Molotov Creatures begin with their 'guns' (spit) 'locked and loaded' (cartridge in chamber) Further fix to AXP and AlaarDB's weapon ready check: Now 'firing' is always counted as 'ready'. Prevent mercs from falling and flying back through obstacles Check whether battle group is even set before testing its location for battle setup Burst spread locations now limited to 6, the limit within the soldier struct Extra burst spread locations zeroed out so that they aren't used unless necessary Spread code now only shoots at locations in the spread, and will shoot at all 6 Only mercs in the sector where autobandage happens will be made to stand up after it's done Throwing a grenade at the tail of the plane in Drassen should not result in a CTD Reset attack busy count when loading a new sector git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1347 3b4a5df2-a311-0410-b5c6-a8a6f20db521
192 lines
4.8 KiB
C
192 lines
4.8 KiB
C
#ifndef _ROTTING_CORPSES_H
|
|
#define _ROTTING_CORPSES_H
|
|
|
|
#include "tile animation.h"
|
|
|
|
#define NUM_CORPSE_SHADES 17
|
|
|
|
enum RottingCorpseDefines
|
|
{
|
|
NO_CORPSE,
|
|
SMERC_JFK,
|
|
SMERC_BCK,
|
|
SMERC_FWD,
|
|
SMERC_DHD,
|
|
SMERC_PRN,
|
|
SMERC_WTR,
|
|
SMERC_FALL,
|
|
SMERC_FALLF,
|
|
|
|
MMERC_JFK,
|
|
MMERC_BCK,
|
|
MMERC_FWD,
|
|
MMERC_DHD,
|
|
MMERC_PRN,
|
|
MMERC_WTR,
|
|
MMERC_FALL,
|
|
MMERC_FALLF,
|
|
|
|
FMERC_JFK,
|
|
FMERC_BCK,
|
|
FMERC_FWD,
|
|
FMERC_DHD,
|
|
FMERC_PRN,
|
|
FMERC_WTR,
|
|
FMERC_FALL,
|
|
FMERC_FALLF,
|
|
|
|
// CIVS
|
|
M_DEAD1,
|
|
K_DEAD1,
|
|
H_DEAD1,
|
|
FT_DEAD1,
|
|
S_DEAD1,
|
|
W_DEAD1,
|
|
C_DEAD1,
|
|
M_DEAD2,
|
|
K_DEAD2,
|
|
H_DEAD2,
|
|
|
|
FT_DEAD2,
|
|
S_DEAD2,
|
|
W_DEAD2,
|
|
C_DEAD2,
|
|
BLOODCAT_DEAD,
|
|
COW_DEAD,
|
|
ADULTMONSTER_DEAD,
|
|
INFANTMONSTER_DEAD,
|
|
LARVAEMONSTER_DEAD,
|
|
ROTTING_STAGE2,
|
|
|
|
TANK1_DEAD,
|
|
TANK2_DEAD,
|
|
HUMMER_DEAD,
|
|
ICECREAM_DEAD,
|
|
QUEEN_MONSTER_DEAD,
|
|
ROBOT_DEAD,
|
|
BURNT_DEAD,
|
|
EXPLODE_DEAD,
|
|
|
|
NUM_CORPSES,
|
|
|
|
} ;
|
|
|
|
|
|
|
|
#define ROTTING_CORPSE_FIND_SWEETSPOT_FROM_GRIDNO 0x001 //Find the closest spot to the given gridno
|
|
#define ROTTING_CORPSE_USE_NORTH_ENTRY_POINT 0x002 //Find the spot closest to the north entry grid
|
|
#define ROTTING_CORPSE_USE_SOUTH_ENTRY_POINT 0x004 //Find the spot closest to the south entry grid
|
|
#define ROTTING_CORPSE_USE_EAST_ENTRY_POINT 0x008 //Find the spot closest to the east entry grid
|
|
#define ROTTING_CORPSE_USE_WEST_ENTRY_POINT 0x010 //Find the spot closest to the west entry grid
|
|
#define ROTTING_CORPSE_USE_CAMO_PALETTE 0x020 //We use cammo palette here....
|
|
#define ROTTING_CORPSE_VEHICLE 0x040 //Vehicle Corpse
|
|
#define ROTTING_CORPSE_USE_STEALTH_PALETTE 0x080 //We use stealth palette here....
|
|
#define ROTTING_CORPSE_USE_URBAN_CAMO_PALETTE 0x100 //We use urban palette here....
|
|
#define ROTTING_CORPSE_USE_DESERT_CAMO_PALETTE 0x200 //We use desert palette here....
|
|
#define ROTTING_CORPSE_USE_SNOW_CAMO_PALETTE 0x400 //We use snow palette here....
|
|
|
|
typedef struct
|
|
{
|
|
UINT8 ubType;
|
|
UINT8 ubBodyType;
|
|
INT16 sGridNo;
|
|
FLOAT dXPos;
|
|
FLOAT dYPos;
|
|
INT16 sHeightAdjustment;
|
|
|
|
PaletteRepID HeadPal; // Palette reps
|
|
PaletteRepID PantsPal;
|
|
PaletteRepID VestPal;
|
|
PaletteRepID SkinPal;
|
|
|
|
UINT8 ubDirection;
|
|
UINT32 uiTimeOfDeath;
|
|
|
|
UINT16 usFlags;
|
|
|
|
INT8 bLevel;
|
|
|
|
INT8 bVisible;
|
|
INT8 bNumServicingCrows;
|
|
UINT8 ubProfile;
|
|
BOOLEAN fHeadTaken;
|
|
UINT8 ubAIWarningValue;
|
|
|
|
UINT8 ubFiller[ 12 ];
|
|
|
|
} ROTTING_CORPSE_DEFINITION;
|
|
|
|
|
|
typedef struct
|
|
{
|
|
ROTTING_CORPSE_DEFINITION def;
|
|
BOOLEAN fActivated;
|
|
|
|
ANITILE *pAniTile;
|
|
|
|
SGPPaletteEntry *p8BPPPalette;
|
|
UINT16 *p16BPPPalette;
|
|
UINT16 *pShades[ NUM_CORPSE_SHADES ];
|
|
INT16 sGraphicNum;
|
|
INT32 iCachedTileID;
|
|
FLOAT dXPos;
|
|
FLOAT dYPos;
|
|
|
|
BOOLEAN fAttractCrowsOnlyWhenOnScreen;
|
|
INT32 iID;
|
|
|
|
} ROTTING_CORPSE;
|
|
|
|
|
|
|
|
INT32 AddRottingCorpse( ROTTING_CORPSE_DEFINITION *pCorpseDef );
|
|
|
|
void RemoveCorpse( INT32 iCorpseID );
|
|
void RemoveCorpses( );
|
|
|
|
|
|
BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLEAN fCheckForLOS );
|
|
|
|
INT16 FindNearestRottingCorpse( SOLDIERTYPE *pSoldier );
|
|
|
|
void AllMercsOnTeamLookForCorpse( ROTTING_CORPSE *pCorpse, INT8 bTeam );
|
|
void MercLooksForCorpses( SOLDIERTYPE *pSoldier );
|
|
void RebuildAllCorpseShadeTables( );
|
|
|
|
UINT16 CreateCorpsePaletteTables( ROTTING_CORPSE *pCorpse );
|
|
|
|
INT16 FindNearestAvailableGridNoForCorpse( ROTTING_CORPSE_DEFINITION *pCorpseDef, INT8 ubRadius );
|
|
|
|
|
|
void HandleRottingCorpses( );
|
|
void AddCrowToCorpse( ROTTING_CORPSE *pCorpse );
|
|
|
|
void VaporizeCorpse( INT16 sGridNo, UINT16 usStructureID );
|
|
void CorpseHit( INT16 sGridNo, UINT16 usStructureID );
|
|
|
|
void HandleCrowLeave( SOLDIERTYPE *pSoldier );
|
|
|
|
void HandleCrowFlyAway( SOLDIERTYPE *pSoldier );
|
|
|
|
#define MAX_ROTTING_CORPSES 100
|
|
|
|
extern ROTTING_CORPSE gRottingCorpse[ MAX_ROTTING_CORPSES ];
|
|
extern INT32 giNumRottingCorpse;
|
|
extern UINT8 gb4DirectionsFrom8[8];
|
|
|
|
ROTTING_CORPSE *GetCorpseAtGridNo( INT16 sGridNo , INT8 bLevel );
|
|
BOOLEAN IsValidDecapitationCorpse( ROTTING_CORPSE *pCorpse );
|
|
void DecapitateCorpse( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel );
|
|
|
|
void GetBloodFromCorpse( SOLDIERTYPE *pSoldier );
|
|
|
|
UINT16 GetCorpseStructIndex( ROTTING_CORPSE_DEFINITION *pCorpseDef, BOOLEAN fForImage );
|
|
|
|
void LookForAndMayCommentOnSeeingCorpse( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubLevel );
|
|
|
|
INT16 GetGridNoOfCorpseGivenProfileID( UINT8 ubProfileID );
|
|
|
|
void DecayRottingCorpseAIWarnings( void );
|
|
UINT8 GetNearestRottingCorpseAIWarning( INT16 sGridNo );
|
|
|
|
#endif |