2015-05-19 21:54:34 +00:00
//-------------------------------------------------------------------------
/*
Copyright ( C ) 1997 , 2005 - 3 D Realms Entertainment
This file is part of Shadow Warrior version 1.2
Shadow Warrior is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE .
See the GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 , USA .
Original Source : 1997 - Frank Maddin and Jim Norwood
Prepared for public release : 03 / 28 / 2005 - Charlie Wiederhold , 3 D Realms
*/
//-------------------------------------------------------------------------
# ifndef GAME_H
# define GAME_H
2019-10-09 17:58:09 +00:00
# ifdef _MSC_VER
# pragma warning(disable:4101) // there's too many of these... :(
# endif
2020-05-21 14:25:41 +00:00
# include "build.h"
2021-05-03 17:01:00 +00:00
# include "d_net.h"
2021-11-19 21:35:08 +00:00
# include "gamefuncs.h"
2021-11-25 20:42:49 +00:00
# include "coreactor.h"
2015-05-19 21:54:34 +00:00
# include "sounds.h"
2019-10-21 22:05:21 +00:00
# include "gamecvars.h"
2020-04-12 06:09:38 +00:00
# include "raze_sound.h"
2020-08-05 15:07:19 +00:00
# include "c_cvars.h"
2020-08-16 12:39:18 +00:00
# include "mapinfo.h"
2020-08-16 15:09:59 +00:00
# include "gamecontrol.h"
2020-08-28 07:06:49 +00:00
# include "gamestruct.h"
2020-08-26 15:12:48 +00:00
# include "packet.h"
2023-10-02 00:28:09 +00:00
# include "coreplayer.h"
2021-12-05 23:35:12 +00:00
# include "serialize_obj.h"
2022-12-06 19:49:49 +00:00
# include "texturemanager.h"
2023-05-27 10:37:24 +00:00
# include "states.h"
# include "vm.h"
2020-08-05 15:07:19 +00:00
EXTERN_CVAR ( Bool , sw_ninjahack )
EXTERN_CVAR ( Bool , sw_darts )
2020-09-02 23:32:51 +00:00
EXTERN_CVAR ( Bool , sw_bunnyrockets )
2015-05-19 21:54:34 +00:00
2019-10-09 16:09:05 +00:00
BEGIN_SW_NS
2021-10-31 09:54:34 +00:00
class DSWActor ;
2021-11-26 14:14:10 +00:00
using HitInfo = THitInfo < DSWActor > ;
using Collision = TCollision < DSWActor > ;
2021-11-24 15:39:29 +00:00
2021-12-29 08:27:13 +00:00
constexpr int BIT ( int shift )
{
return 1 < < shift ;
}
2021-10-31 09:54:34 +00:00
2021-12-31 14:40:29 +00:00
struct GAME_SET
2020-08-16 21:21:24 +00:00
{
// Net Options from Menus
uint8_t NetGameType ; // 0=DeathMatch [spawn], 1=Cooperative 2=DeathMatch [no spawn]
uint8_t NetMonsters ; // Cycle skill levels
2020-09-09 18:32:24 +00:00
bool NetHurtTeammate ; // Allow friendly kills
bool NetSpawnMarkers ; // Respawn markers on/off
bool NetTeamPlay ; // Team play
2020-08-16 21:21:24 +00:00
uint8_t NetKillLimit ; // Number of frags at which game ends
uint8_t NetTimeLimit ; // Limit time of game
uint8_t NetColor ; // Chosen color for player
2020-09-09 18:32:24 +00:00
bool NetNuke ;
2021-12-31 14:40:29 +00:00
} ;
2020-08-16 21:21:24 +00:00
extern const GAME_SET gs_defaults ;
extern GAME_SET gs ;
2020-08-15 11:04:15 +00:00
enum
{
DREALMSPAL = 1 ,
2020-08-16 21:21:24 +00:00
MAXMIRRORS = 8 ,
// This is just some, high, blank tile number not used
// by real graphics to put the MAXMIRRORS mirrors in
MIRRORLABEL = 6000 ,
2020-08-15 11:04:15 +00:00
} ;
2015-05-19 21:54:34 +00:00
//#define SW_SHAREWARE 1 // This determines whether game is shareware compile or not!
2020-08-16 14:57:42 +00:00
# define SW_SHAREWARE (!!(g_gameType & GAMEFLAG_SHAREWARE))
2015-05-19 21:54:34 +00:00
// Turn warning off for unreferenced variables.
// I really should fix them at some point
//#pragma off(unreferenced)
2019-12-03 09:44:56 +00:00
# define PRODUCTION_ASSERT(f) \
2022-01-27 19:40:44 +00:00
assert ( f ) ; \
2019-12-03 09:44:56 +00:00
do { \
if ( ! ( f ) ) \
2020-08-16 16:18:56 +00:00
I_FatalError ( " Assertion failed: %s %s, line %u " , # f , __FILE__ , __LINE__ ) ; \
2019-12-03 09:44:56 +00:00
} while ( 0 )
2020-08-15 14:41:08 +00:00
# define ASSERT assert
2019-12-03 09:44:56 +00:00
2015-05-19 21:54:34 +00:00
int RandomRange ( int ) ;
2020-08-16 16:18:56 +00:00
inline int RANDOM ( void )
{
randomseed = ( ( randomseed * 21 + 1 ) & 65535 ) ;
return randomseed ;
}
2022-09-03 20:57:07 +00:00
inline double RandomRangeF ( double range )
{
return RANDOM ( ) * range / 65536 ;
}
2022-09-04 22:04:29 +00:00
inline DAngle RandomAngle ( double range = 360. )
{
return DAngle : : fromDeg ( RandomRangeF ( range ) ) ;
}
inline DAngle RandomAngle ( DAngle range )
{
return DAngle : : fromDeg ( RandomRangeF ( range . Degrees ( ) ) ) ;
}
2021-12-27 20:13:00 +00:00
int RANDOM_P2 ( int pwr_of_2 ) { return ( RANDOM ( ) & ( pwr_of_2 - 1 ) ) ; }
2022-10-11 20:09:15 +00:00
double RANDOM_P2F ( int pwr_of_2 , int shift ) { return ( RANDOM ( ) & ( ( pwr_of_2 < < shift ) - 1 ) ) * ( 1. / ( 1 < < shift ) ) ; }
2015-05-19 21:54:34 +00:00
//
// Map directions/degrees
//
2015-05-19 22:01:44 +00:00
#if 0
2015-05-19 21:54:34 +00:00
y - -
^ 1536
|
|
|
|
|
| 2047
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
1024 | 0
x - - | x + +
|
|
|
|
V 512
y + +
# endif
//////////////////////////////////////////////////////
//
// KEYBOARD
//
//////////////////////////////////////////////////////
2020-09-09 18:32:24 +00:00
extern bool MenuInputMode ;
2015-05-19 21:54:34 +00:00
//
// Defines
//
2022-09-04 19:35:03 +00:00
// dist at which actors will not move (unless shot?? to do)
constexpr int MAX_ACTIVE_RANGE = 2625 ;
2021-12-27 17:24:38 +00:00
enum
{
CIRCLE_CAMERA_DIST_MIN = 12000 ,
// dist at which actors roam about on their own
MIN_ACTIVE_RANGE = 20000 ,
} ;
2015-05-19 21:54:34 +00:00
2022-09-07 11:00:21 +00:00
constexpr double CIRCLE_CAMERA_DIST_MINF = 12000. / 65536. ;
2022-09-08 14:54:34 +00:00
constexpr int32_t FIXED ( int32_t msw , int32_t lsw )
2020-09-01 13:00:35 +00:00
{
return IntToFixed ( msw ) | lsw ;
}
2015-05-19 21:54:34 +00:00
2020-08-30 21:34:40 +00:00
// Ouch...
2021-12-14 11:08:48 +00:00
# ifndef WORDS_BIGENDIAN
2015-05-19 21:58:29 +00:00
# define MSB_VAR(fixed) (*(((uint8_t*)&(fixed)) + 1))
# define LSB_VAR(fixed) (*((uint8_t*)&(fixed)))
2015-05-19 21:54:34 +00:00
# else
2015-05-19 21:58:29 +00:00
# define LSB_VAR(fixed) (*(((uint8_t*)&(fixed)) + 1))
# define MSB_VAR(fixed) (*((uint8_t*)&(fixed)))
2015-05-19 21:54:34 +00:00
# endif
2019-11-17 17:02:17 +00:00
# define TRAVERSE_CONNECT(i) for (i = connecthead; i != -1; i = connectpoint2[i])
2015-05-19 21:54:34 +00:00
2021-12-27 17:24:38 +00:00
constexpr int NORM_ANGLE ( int ang ) { return ( ( ang ) & 2047 ) ; }
2015-05-19 21:54:34 +00:00
int StdRandomRange ( int range ) ;
2021-12-27 17:19:30 +00:00
2020-04-04 19:42:00 +00:00
2020-11-23 07:39:20 +00:00
2021-12-23 19:20:29 +00:00
// actual Z for TOS and BOS - handles both WYSIWYG and old style
2022-09-08 14:30:43 +00:00
inline double GetSpriteZOfTop ( const spritetypebase * sp )
2020-11-23 07:39:20 +00:00
{
2022-12-06 19:49:49 +00:00
auto tex = TexMan . GetGameTexture ( sp - > spritetexture ( ) ) ;
auto sizez = tex - > GetDisplayHeight ( ) * sp - > scale . Y ;
2021-12-27 20:13:00 +00:00
return ( sp - > cstat & CSTAT_SPRITE_YCENTER ) ?
2022-12-06 19:49:49 +00:00
sp - > pos . Z - ( ( sizez * 0.5 ) + tex - > GetDisplayTopOffset ( ) ) :
sp - > pos . Z - sizez ;
2020-11-23 07:39:20 +00:00
}
2015-05-19 21:54:34 +00:00
2022-09-08 14:30:43 +00:00
inline double GetSpriteZOfBottom ( const spritetypebase * sp )
2021-12-04 18:08:50 +00:00
{
2022-12-06 19:49:49 +00:00
auto tex = TexMan . GetGameTexture ( sp - > spritetexture ( ) ) ;
auto sizez = tex - > GetDisplayHeight ( ) * sp - > scale . Y ;
2021-12-27 20:13:00 +00:00
return ( sp - > cstat & CSTAT_SPRITE_YCENTER ) ?
2022-12-06 19:49:49 +00:00
sp - > pos . Z + ( ( sizez * 0.5 ) - tex - > GetDisplayTopOffset ( ) ) :
2022-09-08 14:30:43 +00:00
sp - > pos . Z ;
2021-12-04 18:08:50 +00:00
}
2021-12-23 19:20:29 +00:00
// mid and upper/lower sprite calculations
constexpr int Z ( int value )
{
return value < < 8 ;
}
2015-05-19 21:54:34 +00:00
2021-12-23 19:20:29 +00:00
constexpr int PIXZ ( int value )
{
return value > > 8 ;
}
2015-05-19 21:54:34 +00:00
2021-12-25 00:58:34 +00:00
constexpr int SEC ( int value )
{
return ( ( value ) * 120 ) ;
}
2015-05-19 21:54:34 +00:00
2021-12-25 00:58:34 +00:00
enum
{
2022-08-30 22:46:02 +00:00
CEILING_DIST = 4 ,
FLOOR_DIST = 4
2021-12-25 00:58:34 +00:00
} ;
2015-05-19 21:54:34 +00:00
// Clip Sprite adjustment
2021-12-23 19:20:29 +00:00
constexpr int CS ( int sprite_bit )
{
return ( sprite_bit ) < < 16 ;
}
enum EClip
{
// for players to clip against walls
CLIPMASK_PLAYER = CS ( CSTAT_SPRITE_BLOCK ) | CSTAT_WALL_BLOCK ,
// for actors to clip against walls
CLIPMASK_ACTOR = CS ( CSTAT_SPRITE_BLOCK ) | CSTAT_WALL_BLOCK | CSTAT_WALL_BLOCK_ACTOR ,
// for missiles to clip against actors
CLIPMASK_MISSILE = CS ( CSTAT_SPRITE_BLOCK_HITSCAN | CSTAT_SPRITE_BLOCK_MISSILE ) | CSTAT_WALL_BLOCK_HITSCAN ,
CLIPMASK_WARP_HITSCAN = CS ( CSTAT_SPRITE_BLOCK_HITSCAN ) | CSTAT_WALL_BLOCK_HITSCAN | CSTAT_WALL_WARP_HITSCAN ,
} ;
2015-05-19 21:54:34 +00:00
2020-09-08 16:48:18 +00:00
# define SIZ countof
2015-05-19 21:54:34 +00:00
//
// Directions
//
2021-10-31 15:00:55 +00:00
enum
{
DEGREE_45 = 256 ,
DEGREE_90 = 512
} ;
2015-05-19 21:54:34 +00:00
////
//
// Directional enumerations
//
////
enum DirOrd
{
ORD_NORTH , ORD_NE , ORD_EAST , ORD_SE , ORD_SOUTH , ORD_SW , ORD_WEST , ORD_NW
} ;
enum Dir8
{
NORTH = ORD_NORTH * DEGREE_45 ,
NE = ORD_NE * DEGREE_45 ,
EAST = ORD_EAST * DEGREE_45 ,
SE = ORD_SE * DEGREE_45 ,
SOUTH = ORD_SOUTH * DEGREE_45 ,
SW = ORD_SW * DEGREE_45 ,
WEST = ORD_WEST * DEGREE_45 ,
NW = ORD_NW * DEGREE_45 ,
} ;
// Auto building enumerations
# include "digi.h"
# define DAMAGE_ENUM
enum dam
{
# include "damage.h"
} ;
# undef DAMAGE_ENUM
////
//
// State declarations
//
////
// Forward declarations
2021-12-31 14:40:29 +00:00
struct STATE ;
2021-12-31 12:49:34 +00:00
struct PANEL_STATE ;
2023-10-02 19:03:59 +00:00
class DSWPlayer ;
2021-12-31 14:40:29 +00:00
struct PERSONALITY ;
struct ATTRIBUTE ;
2021-12-31 14:50:44 +00:00
struct SECTOR_OBJECT ;
2023-10-03 10:27:15 +00:00
class DPanelSprite ;
2021-12-31 14:47:10 +00:00
struct ANIM ;
2021-10-29 18:49:57 +00:00
class DSWActor ;
2015-05-19 21:54:34 +00:00
2023-10-03 10:27:15 +00:00
typedef void pANIMATOR ( DPanelSprite * ) ;
2021-12-31 14:50:44 +00:00
typedef void ( * soANIMATORp ) ( SECTOR_OBJECT * ) ;
2015-05-19 21:54:34 +00:00
2023-05-24 15:27:14 +00:00
// this needs to work with incomplete data, so avoid the asserting macros.
# define DEF_ANIMATOR(func) \
int func ( DSWActor * ) ; \
DEFINE_ACTION_FUNCTION_NATIVE ( DSWActor , func , func ) \
{ \
auto self = ( DSWActor * ) ( param [ 0 ] . a ) ; \
2023-05-24 17:48:21 +00:00
ACTION_RETURN_INT ( func ( self ) ) ; \
2023-05-24 15:27:14 +00:00
}
2023-05-24 17:40:05 +00:00
# define AF(func) DSWActor_##func##_VMPtr
2023-05-24 15:27:14 +00:00
2021-12-31 14:40:29 +00:00
struct STATE
2015-05-19 21:54:34 +00:00
{
short Pic ;
int Tics ;
2023-05-24 15:27:14 +00:00
VMNativeFunction * * Animator ; // go through the scripting interface
2015-05-19 21:54:34 +00:00
2021-12-31 15:00:14 +00:00
STATE * NextState ;
2015-05-19 21:54:34 +00:00
} ;
//
// State Flags
//
2021-12-27 17:24:38 +00:00
enum
{
SF_TICS_MASK = 0xFFFF ,
SF_QUICK_CALL = BIT ( 16 ) ,
SF_PLAYER_FUNC = BIT ( 17 ) , // only for players to execute
SF_TIC_ADJUST = BIT ( 18 ) , // use tic adjustment for these frames
SF_WALL_STATE = BIT ( 19 ) , // use for walls instead of sprite
} ;
2015-05-19 21:54:34 +00:00
///////////////////////////////////////////////////////////////////////////////
// Jim's MISC declarations from other files
///////////////////////////////////////////////////////////////////////////////
2021-12-31 14:40:29 +00:00
enum FOOT_TYPE
{ WATER_FOOT , BLOOD_FOOT } ;
2015-05-19 21:54:34 +00:00
extern FOOT_TYPE FootMode ;
2021-11-03 22:00:56 +00:00
int QueueFootPrint ( DSWActor * ) ; // Weapon.c
2021-11-03 20:40:56 +00:00
void QueueLoWangs ( DSWActor * ) ; // Weapon.c
2021-11-01 11:25:35 +00:00
int SpawnShell ( DSWActor * actor , int ShellNum ) ; // JWeapon.c
2021-11-01 08:10:19 +00:00
void UnlockKeyLock ( short key_num , DSWActor * actor ) ; // JSector.c
2015-05-19 21:54:34 +00:00
2021-12-27 20:13:00 +00:00
enum
{
MAX_PAIN = 5 ,
MAX_TAUNTAI = 33 ,
MAX_GETSOUNDS = 5 ,
MAX_YELLSOUNDS = 3 ,
} ;
2015-05-19 21:54:34 +00:00
extern int PlayerPainVocs [ MAX_PAIN ] ;
extern int PlayerLowHealthPainVocs [ MAX_PAIN ] ;
extern int TauntAIVocs [ MAX_TAUNTAI ] ;
extern int PlayerGetItemVocs [ MAX_GETSOUNDS ] ;
extern int PlayerYellVocs [ MAX_YELLSOUNDS ] ;
2015-05-19 21:58:29 +00:00
void BossHealthMeter ( void ) ;
2015-05-19 21:54:34 +00:00
// Global variables used for modifying variouse things from the Console
///////////////////////////////////////////////////////////////////////////////////////////
//
// JPlayer
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
//
// Weapon
//
///////////////////////////////////////////////////////////////////////////////////////////
2021-12-27 20:13:00 +00:00
enum
{
MAX_WEAPONS_KEYS = 10 ,
MAX_WEAPONS_EXTRA = 4 , // extra weapons like the two extra head attacks
MAX_WEAPONS = ( MAX_WEAPONS_KEYS + MAX_WEAPONS_EXTRA ) ,
2015-05-19 21:54:34 +00:00
2021-12-27 20:13:00 +00:00
// weapons that not missile type sprites
WPN_NM_LAVA = ( - 8 ) ,
WPN_NM_SECTOR_SQUISH = ( - 9 ) ,
} ;
2015-05-19 21:54:34 +00:00
//#define WEAP_ENTRY(id, init_func, damage_lo, damage_hi, radius)
2021-12-31 14:40:29 +00:00
struct DAMAGE_DATA
2015-05-19 21:54:34 +00:00
{
2023-10-02 19:03:59 +00:00
void ( * Init ) ( DSWPlayer * ) ;
2015-05-19 21:58:29 +00:00
int16_t damage_lo ;
int16_t damage_hi ;
2015-05-19 21:54:34 +00:00
unsigned int radius ;
2015-05-19 21:58:29 +00:00
int16_t max_ammo ;
int16_t min_ammo ;
int16_t with_weapon ;
int16_t weapon_pickup ;
int16_t ammo_pickup ;
2021-12-31 14:40:29 +00:00
} ;
2015-05-19 21:54:34 +00:00
extern DAMAGE_DATA DamageData [ ] ;
// bit arrays that determine if a) Weapon has no ammo b) Weapon is the ammo (no weapon exists)
extern int WeaponHasNoAmmo , WeaponIsAmmo ;
2023-10-02 19:03:59 +00:00
void InitWeaponFist ( DSWPlayer * ) ;
void InitWeaponStar ( DSWPlayer * ) ;
void InitWeaponShotgun ( DSWPlayer * ) ;
void InitWeaponRocket ( DSWPlayer * ) ;
void InitWeaponRail ( DSWPlayer * ) ;
void InitWeaponMicro ( DSWPlayer * ) ;
void InitWeaponUzi ( DSWPlayer * ) ;
void InitWeaponSword ( DSWPlayer * ) ;
void InitWeaponHothead ( DSWPlayer * ) ;
void InitWeaponElectro ( DSWPlayer * ) ;
void InitWeaponHeart ( DSWPlayer * ) ;
void InitWeaponGrenade ( DSWPlayer * ) ;
void InitWeaponMine ( DSWPlayer * ) ;
2015-05-19 21:54:34 +00:00
2023-10-02 19:03:59 +00:00
void InitWeaponNapalm ( DSWPlayer * ) ;
void InitWeaponRing ( DSWPlayer * ) ;
2015-05-19 21:54:34 +00:00
2023-10-02 19:03:59 +00:00
extern void ( * InitWeapon [ MAX_WEAPONS ] ) ( DSWPlayer * ) ;
2015-05-19 21:54:34 +00:00
///////////////////////////////////////////////////////////////////////////////////////////
//
// Player
//
///////////////////////////////////////////////////////////////////////////////////////////
2021-12-27 20:13:00 +00:00
enum
{
MAX_SW_PLAYERS_SW = ( 4 ) ,
MAX_SW_PLAYERS_REG = ( 8 )
} ;
2020-08-16 14:57:42 +00:00
# define MAX_SW_PLAYERS (SW_SHAREWARE ? MAX_SW_PLAYERS_SW : MAX_SW_PLAYERS_REG)
2015-05-19 21:54:34 +00:00
2019-11-17 17:02:17 +00:00
extern int ThemeTrack [ 6 ] ; // w
2019-12-09 19:12:54 +00:00
extern FString ThemeSongs [ 6 ] ; //
2015-05-19 21:54:34 +00:00
2019-12-09 17:40:07 +00:00
enum
{
MAX_KEYS = 8 ,
MAX_FORTUNES = 16 ,
2019-12-09 18:00:30 +00:00
MAX_INVENTORY_Q = 11 , //InvDecl_TOTAL
2019-12-09 17:40:07 +00:00
QUOTE_KEYMSG = 1 ,
QUOTE_DOORMSG = QUOTE_KEYMSG + MAX_KEYS ,
// 23+24 are reserved.
QUOTE_COOKIE = 25 ,
2019-12-09 18:00:30 +00:00
QUOTE_INVENTORY = QUOTE_COOKIE + MAX_FORTUNES ,
2019-12-09 18:49:36 +00:00
QUOTE_WPNFIST = QUOTE_INVENTORY + MAX_INVENTORY_Q ,
QUOTE_WPNSWORD ,
QUOTE_WPNSHURIKEN ,
QUOTE_WPNSTICKY ,
QUOTE_WPNUZI ,
QUOTE_WPNLAUNCH ,
QUOTE_WPNNUKE ,
QUOTE_WPNGRENADE ,
QUOTE_WPNRAILGUN ,
QUOTE_WPNRIOT ,
QUOTE_WPNHEAD ,
QUOTE_WPNRIPPER ,
// Here a gap of two needs to be inserted because the weapon array contains two bogus entries the parser can access.
// Not all ammo types here are used, but the entries must be reserved for the parser.
QUOTE_AMMOFIST = QUOTE_WPNRIPPER + 2 ,
QUOTE_AMMOSWORD ,
QUOTE_AMMOSHURIKEN ,
QUOTE_AMMOSTICKY ,
QUOTE_AMMOUZI ,
QUOTE_AMMOLAUNCH ,
QUOTE_AMMONUKE ,
QUOTE_AMMOGRENADE ,
QUOTE_AMMORAILGUN ,
QUOTE_AMMORIOT ,
QUOTE_AMMOHEAD ,
QUOTE_AMMORIPPER ,
// Again, here a gap of two needs to be inserted because the weapon array contains two bogus entries the parser can access.
2019-12-09 17:40:07 +00:00
} ;
2015-05-19 21:54:34 +00:00
enum PlayerDeathTypes
{
PLAYER_DEATH_FLIP , PLAYER_DEATH_CRUMBLE , PLAYER_DEATH_EXPLODE , PLAYER_DEATH_RIPPER , PLAYER_DEATH_SQUISH , PLAYER_DEATH_DROWN , MAX_PLAYER_DEATHS
} ;
2023-10-02 19:03:59 +00:00
typedef void ( * PLAYER_ACTION_FUNCp ) ( DSWPlayer * ) ;
2015-05-19 21:54:34 +00:00
# include "inv.h"
2021-12-31 14:40:29 +00:00
struct REMOTE_CONTROL
2015-05-19 21:54:34 +00:00
{
2021-11-25 18:29:59 +00:00
sectortype * cursectp , * lastcursectp ;
int pang ;
2022-10-12 22:25:30 +00:00
DVector2 vect , ovect , slide_vect ;
2022-08-21 13:51:28 +00:00
DVector3 pos ;
2021-12-31 14:50:44 +00:00
SECTOR_OBJECT * sop_control ;
2021-12-31 14:40:29 +00:00
} ;
2015-05-19 21:54:34 +00:00
//
// Player Flags
//
2020-09-02 22:41:32 +00:00
enum
{
2020-09-07 20:22:47 +00:00
PF_DEAD = ( BIT ( 1 ) ) ,
PF_JUMPING = ( BIT ( 2 ) ) ,
PF_FALLING = ( BIT ( 3 ) ) ,
PF_PLAYER_MOVED = ( BIT ( 7 ) ) ,
PF_PLAYER_RIDING = ( BIT ( 8 ) ) ,
PF_RECOIL = ( BIT ( 10 ) ) ,
PF_FLYING = ( BIT ( 11 ) ) ,
PF_WEAPON_RETRACT = ( BIT ( 12 ) ) ,
PF_PICKED_UP_AN_UZI = ( BIT ( 13 ) ) ,
PF_CRAWLING = ( BIT ( 14 ) ) ,
PF_CLIMBING = ( BIT ( 15 ) ) ,
PF_SWIMMING = ( BIT ( 16 ) ) ,
PF_DIVING = ( BIT ( 17 ) ) ,
PF_DIVING_IN_LAVA = ( BIT ( 18 ) ) ,
PF_TWO_UZI = ( BIT ( 19 ) ) ,
PF_DEAD_HEAD = ( BIT ( 22 ) ) , // are your a dead head
PF_HEAD_CONTROL = ( BIT ( 23 ) ) , // have control of turning when a head?
PF_CLIP_CHEAT = ( BIT ( 24 ) ) , // cheat for wall clipping
PF_SLIDING = ( BIT ( 25 ) ) , // cheat for wall clipping
PF_VIEW_FROM_OUTSIDE = ( BIT ( 26 ) ) ,
PF_VIEW_OUTSIDE_WEAPON = ( BIT ( 27 ) ) ,
PF_VIEW_FROM_CAMERA = ( BIT ( 28 ) ) ,
PF_TANK = ( BIT ( 29 ) ) , // Doin the tank thang
PF_WEAPON_DOWN = ( BIT ( 31 ) ) ,
PF2_TELEPORTED = ( BIT ( 0 ) ) ,
2020-09-08 14:34:51 +00:00
PF2_INPUT_CAN_TURN_VEHICLE = ( BIT ( 3 ) ) , // Allow calling DoPlayerTurnVehicle() from processMovement()
2020-09-09 13:00:43 +00:00
PF2_INPUT_CAN_TURN_TURRET = ( BIT ( 4 ) ) , // Allow calling DoPlayerTurnTurret() from processMovement()
2020-09-02 22:41:32 +00:00
} ;
2015-05-19 21:54:34 +00:00
///////////////////////////////////////////////////////////////////////////////////////////
//
// Actor
//
///////////////////////////////////////////////////////////////////////////////////////////
//
// Hit Points
//
2021-12-27 20:13:00 +00:00
enum
{
HEALTH_RIPPER = 70 ,
HEALTH_RIPPER2 = 200 ,
HEALTH_MOMMA_RIPPER = 500 ,
HEALTH_NINJA = 40 ,
HEALTH_RED_NINJA = 160 ,
HEALTH_COOLIE = 120 ,
HEALTH_COOLIE_GHOST = 65 ,
HEALTH_SKEL_PRIEST = 90 ,
HEALTH_GORO = 200 ,
HEALTH_HORNET = 4 ,
HEALTH_SKULL = 4 ,
HEALTH_EEL = 100 ,
HEALTH_SERP_GOD = 3800 ,
} ;
2015-05-19 21:54:34 +00:00
//
// Action Set Structure
//
2021-12-27 20:13:00 +00:00
enum
{
MAX_ACTOR_CLOSE_ATTACK = 2 ,
MAX_ACTOR_ATTACK = 6 ,
} ;
2021-12-31 14:27:18 +00:00
struct ACTOR_ACTION_SET
2015-05-19 21:54:34 +00:00
{
2021-12-31 15:00:14 +00:00
STATE * * Stand ;
STATE * * Run ;
STATE * * Jump ;
STATE * * Fall ;
STATE * * Crawl ;
STATE * * Swim ;
STATE * * Fly ;
STATE * * Rise ;
STATE * * Sit ;
STATE * * Look ;
STATE * * Climb ;
STATE * * Pain ;
STATE * * Death1 ;
STATE * * Death2 ;
STATE * * Dead ;
STATE * * DeathJump ;
STATE * * DeathFall ;
STATE * * CloseAttack [ MAX_ACTOR_CLOSE_ATTACK ] ;
2021-11-21 20:45:12 +00:00
int16_t CloseAttackPercent [ MAX_ACTOR_CLOSE_ATTACK ] ;
2015-05-19 21:54:34 +00:00
2021-12-31 15:00:14 +00:00
STATE * * Attack [ MAX_ACTOR_ATTACK ] ;
2021-11-21 20:45:12 +00:00
int16_t AttackPercent [ MAX_ACTOR_ATTACK ] ;
2015-05-19 21:54:34 +00:00
2021-12-31 15:00:14 +00:00
STATE * * Special [ 2 ] ;
STATE * * Duck ;
STATE * * Dive ;
2021-12-31 14:27:18 +00:00
} ;
2015-05-19 21:54:34 +00:00
2021-04-02 08:44:41 +00:00
struct ROTATOR
2015-05-19 21:54:34 +00:00
{
int pos ; // current position - always moves toward tgt
int open_dest ; // destination of open position
int tgt ; // current target
int speed ; // speed of movement
int orig_speed ; // original speed - vel jacks with speed
int vel ; // velocity adjuments
2021-04-02 08:44:41 +00:00
2022-09-05 22:45:22 +00:00
TArray < DVector2 > orig ;
2021-04-02 08:44:41 +00:00
void SetNumWalls ( int num )
{
2022-09-05 22:45:22 +00:00
orig . Resize ( num ) ;
memset ( orig . Data ( ) , 0 , num * sizeof ( DVector2 ) ) ;
2021-04-02 08:44:41 +00:00
}
void ClearWalls ( )
{
2022-09-05 22:45:22 +00:00
orig . Reset ( ) ;
2021-04-02 08:44:41 +00:00
}
} ;
2015-05-19 21:54:34 +00:00
//
// User Extension record
//
2021-04-02 08:28:18 +00:00
struct USER
2015-05-19 21:54:34 +00:00
{
2021-04-02 10:00:38 +00:00
void Clear ( )
2021-04-02 08:28:18 +00:00
{
2021-04-02 10:00:38 +00:00
rotator . Clear ( ) ;
WallShade . Clear ( ) ;
memset ( & WallP , 0 , sizeof ( USER ) - myoffsetof ( USER , WallP ) ) ;
2021-04-02 08:28:18 +00:00
}
2022-08-30 22:41:34 +00:00
// frequently repeated patterns
2022-09-08 18:12:23 +00:00
void addCounterToChange ( ) { change . Z + = Counter * zmaptoworld ; }
2022-08-30 22:41:34 +00:00
2022-08-20 19:40:42 +00:00
2015-05-19 21:54:34 +00:00
//
// Variables that can be used by actors and Player
//
2021-04-02 08:28:18 +00:00
TPointer < ROTATOR > rotator ;
2015-05-19 21:54:34 +00:00
// wall vars for lighting
2021-04-02 08:44:41 +00:00
TArray < int8_t > WallShade ;
2015-05-19 21:54:34 +00:00
2021-12-31 14:41:39 +00:00
walltype * WallP ; // operate on wall instead of sprite
2023-05-24 17:54:58 +00:00
VMFunction * ActorActionFunc ;
PERSONALITY * Personality ;
2023-05-27 10:37:24 +00:00
2023-05-27 10:37:24 +00:00
struct LegacyState
{
2023-05-27 10:37:24 +00:00
STATE * State ;
STATE * * Rot ;
STATE * StateStart ;
STATE * StateEnd ;
STATE * * StateFallOverride ; // a bit kludgy - override std fall state
ACTOR_ACTION_SET * ActorActionSet ;
int16_t RotNum ;
ATTRIBUTE * Attrib ;
2023-05-27 10:37:24 +00:00
} ;
LegacyState __legacyState ;
2023-05-27 10:37:24 +00:00
2021-12-31 14:50:44 +00:00
SECTOR_OBJECT * sop_parent ; // denotes that this sprite is a part of the
2015-05-19 21:54:34 +00:00
// sector object - contains info for the SO
2021-10-31 08:04:24 +00:00
// referenced actors
2021-12-05 23:35:12 +00:00
TObjPtr < DSWActor * > lowActor , highActor ;
TObjPtr < DSWActor * > targetActor ; // target player for the enemy - can only handle one player at at time
TObjPtr < DSWActor * > flameActor ;
TObjPtr < DSWActor * > attachActor ; // attach to sprite if needed - electro snake
TObjPtr < DSWActor * > flagOwnerActor ;
TObjPtr < DSWActor * > WpnGoalActor ;
2021-10-31 08:04:24 +00:00
2022-08-21 07:25:15 +00:00
DVector3 pos ;
2022-08-30 22:44:45 +00:00
DVector3 change ; // precalculated vectors
2022-08-20 21:47:24 +00:00
double hiz , loz ;
2022-08-20 20:31:35 +00:00
double oz ; // serialized copy of sprite.oz
2022-08-20 20:42:05 +00:00
double z_tgt ;
2022-08-20 21:35:05 +00:00
double ceiling_dist ;
double floor_dist ;
2022-08-20 22:01:00 +00:00
double zclip ; // z height to move up for clipmove
2022-08-30 22:44:45 +00:00
2022-08-20 20:42:05 +00:00
2015-05-19 21:54:34 +00:00
int Flags ;
int Flags2 ;
int Tics ;
2021-11-21 20:45:12 +00:00
int16_t ID ;
2015-05-19 21:54:34 +00:00
// Health/Pain related
2021-11-21 20:45:12 +00:00
int16_t Health ;
int16_t MaxHealth ;
2015-05-19 21:54:34 +00:00
2021-11-21 20:45:12 +00:00
int16_t LastDamage ; // last damage amount taken
int16_t PainThreshold ; // amount of damage that can be taken before
2015-05-19 21:54:34 +00:00
// going into pain frames.
// jump & fall
2021-11-21 20:45:12 +00:00
int16_t jump_speed ;
int16_t jump_grav ;
2015-05-19 21:54:34 +00:00
// clipmove
2022-09-01 16:21:30 +00:00
double lo_step ;
2021-11-19 23:18:23 +00:00
int active_range ;
2021-12-31 14:43:47 +00:00
sectortype * hi_sectp , * lo_sectp ;
2015-05-19 21:54:34 +00:00
// if a player's sprite points to player structure
2023-10-02 19:03:59 +00:00
DSWPlayer * PlayerP ;
2021-11-21 20:45:12 +00:00
int16_t Sibling ;
2015-05-19 21:54:34 +00:00
//
// Possibly used by both.
//
// velocity
int vel_tgt ;
2021-11-21 20:45:12 +00:00
int16_t vel_rate ;
2015-05-19 21:58:29 +00:00
uint8_t speed ; // Ordinal Speed Range 0-3 from slow to fast
2015-05-19 21:54:34 +00:00
2021-11-21 20:45:12 +00:00
int16_t Counter ;
int16_t Counter2 ;
int16_t Counter3 ;
int16_t DamageTics ;
int16_t BladeDamageTics ;
2015-05-19 21:54:34 +00:00
unsigned int Radius ; // for distance checking
2022-09-08 15:06:41 +00:00
double fRadius ( ) const { return Radius * inttoworld ; }
2022-08-30 22:59:03 +00:00
double OverlapZ ; // for z overlap variable
2015-05-19 21:54:34 +00:00
//
// Only have a place for actors
//
2021-12-30 09:30:21 +00:00
2015-05-19 21:54:34 +00:00
// scaling
2021-11-21 20:45:12 +00:00
int16_t scale_speed ;
2015-05-19 21:54:34 +00:00
unsigned short scale_value ;
2021-11-21 20:45:12 +00:00
int16_t scale_tgt ;
2015-05-19 21:54:34 +00:00
// zig zagging
2022-09-04 10:53:35 +00:00
double DistCheck ;
2015-05-19 21:54:34 +00:00
2022-09-04 15:23:34 +00:00
double Dist ;
2022-09-04 10:53:35 +00:00
double TargetDist ;
2021-11-21 20:45:12 +00:00
int16_t WaitTics ;
2015-05-19 21:54:34 +00:00
// track
2021-11-21 20:45:12 +00:00
int16_t track ;
int16_t point ;
int16_t track_dir ;
2015-05-19 21:54:34 +00:00
int track_vel ;
// sliding variables - slide backwards etc
2022-09-04 18:23:54 +00:00
DAngle slide_ang ;
double slide_vel ;
double slide_dec ;
2015-05-19 21:54:34 +00:00
2021-11-21 20:45:12 +00:00
int16_t motion_blur_dist ;
int16_t motion_blur_num ;
2015-05-19 21:54:34 +00:00
2021-11-21 20:45:12 +00:00
int16_t wait_active_check ; // for enemy checking of player
int16_t inactive_time ; // length of time actor has been unaware of his tgt
2022-09-01 17:28:33 +00:00
DAngle sang ;
2021-05-12 14:50:20 +00:00
uint8_t spal ; // save off default palette number
2015-05-19 21:54:34 +00:00
2021-10-31 09:54:34 +00:00
Collision coll ; // same thing broken up into useful components.
2015-05-19 21:54:34 +00:00
// Need to get rid of these flags
int Flag1 ;
2015-05-19 21:58:29 +00:00
int8_t LastWeaponNum ;
int8_t WeaponNum ;
2015-05-19 21:54:34 +00:00
2021-11-21 20:45:12 +00:00
int16_t bounce ; // count bounces off wall for killing shrap stuff
2015-05-19 21:54:34 +00:00
// !JIM! my extensions
int ShellNum ; // This is shell no. 0 to whatever
// Shell gets deleted when ShellNum < (ShellCount - MAXSHELLS)
2021-11-21 20:45:12 +00:00
int16_t FlagOwner ; // Not the spritenum of the original flag (abused to hell by other things)
int16_t Vis ; // Shading upgrade, for shooting, etc...
2020-09-09 18:32:24 +00:00
bool DidAlert ; // Has actor done his alert noise before?
2015-05-19 22:04:06 +00:00
2022-09-01 17:28:33 +00:00
DAngle oangdiff ; // Used for interpolating sprite angles
2020-04-30 21:56:26 +00:00
2015-05-19 22:04:06 +00:00
uint8_t filler ;
2021-04-02 08:28:18 +00:00
} ;
2021-10-31 14:54:02 +00:00
enum
{
// sprite->extra flags
// BUILD AND GAME - DO NOT MOVE THESE
SPRX_SKILL = ( BIT ( 0 ) | BIT ( 1 ) | BIT ( 2 ) ) ,
// BIT(4) ST1 BUILD AND GAME
SPRX_STAY_PUT_VATOR = ( BIT ( 5 ) ) , // BUILD AND GAME - will not move with vators etc
// DO NOT MOVE THIS
SPRX_STAG = ( BIT ( 6 ) ) , // BUILD AND GAME - NON-ST1 sprite with ST1 type tagging
// DO NOT MOVE
SPRX_QUEUE_SPRITE = ( BIT ( 7 ) ) , // Queue sprite -check queue when deleting
SPRX_MULTI_ITEM = ( BIT ( 9 ) ) , // BUILD AND GAME - multi player item
// have users - could be moved
SPRX_PLAYER_OR_ENEMY = ( BIT ( 11 ) ) , // for checking quickly if sprite is a
// player or actor
// do not need Users
SPRX_FOUND = ( BIT ( 12 ) ) , // BUILD ONLY INTERNAL - used for finding sprites
SPRX_BLADE = ( BIT ( 12 ) ) , // blade sprite
SPRX_BREAKABLE = ( BIT ( 13 ) ) , // breakable items
SPRX_BURNABLE = ( BIT ( 14 ) ) , // used for burnable sprites in the game
// temp use
SPRX_BLOCK = ( BIT ( 15 ) ) , // BUILD AND GAME
} ;
2015-05-19 21:54:34 +00:00
// BUILD - tell which actors should not spawn
// GAME - used for internal game code
// ALT-M debug mode
// !LIGHT
// all three bits set - should never happen with skill
// #define SPRX_USER_NON_STANDARD (BIT(0)|BIT(1)|BIT(2)) // used for lighting
// boolean flags carried over from build
2021-12-24 14:47:56 +00:00
enum
{
SPRX_BOOL11 = ( BIT ( 5 ) ) ,
SPRX_BOOL1 = ( BIT ( 6 ) ) ,
SPRX_BOOL2 = ( BIT ( 7 ) ) ,
SPRX_BOOL3 = ( BIT ( 8 ) ) ,
SPRX_BOOL4 = ( BIT ( 9 ) ) ,
SPRX_BOOL5 = ( BIT ( 10 ) ) ,
SPRX_BOOL6 = ( BIT ( 11 ) ) ,
SPRX_BOOL7 = ( BIT ( 4 ) ) , // bit 12 was used build
SPRX_BOOL8 = ( BIT ( 13 ) ) ,
SPRX_BOOL9 = ( BIT ( 14 ) ) ,
SPRX_BOOL10 = ( BIT ( 15 ) ) ,
} ;
2022-12-09 08:36:03 +00:00
enum ETexFlags
{
TFLAG_BUNNYFRIENDLY = 1 , // bunnies like to stay in sectors with this as floor.
} ;
2015-05-19 21:54:34 +00:00
2022-12-09 09:03:36 +00:00
enum ESurfType
{
TSURF_WATER = 1 ,
TSURF_LAVA = 2 ,
2022-12-10 17:29:53 +00:00
TSURF_SHALLOWWATER = 3 ,
2022-12-09 09:03:36 +00:00
} ;
2015-05-19 21:54:34 +00:00
// User->Flags flags
2021-10-31 08:04:24 +00:00
enum
{
SPR_MOVED = BIT ( 0 ) , // Did actor move
SPR_ATTACKED = BIT ( 1 ) , // Is sprite being attacked?
SPR_TARGETED = BIT ( 2 ) , // Is sprite a target of a weapon?
SPR_ACTIVE = BIT ( 3 ) , // Is sprite aware of the player?
SPR_ELECTRO_TOLERANT = BIT ( 4 ) , // Electro spell does not slow actor
SPR_JUMPING = BIT ( 5 ) , // Actor is jumping
SPR_FALLING = BIT ( 6 ) , // Actor is falling
SPR_CLIMBING = BIT ( 7 ) , // Actor is falling
SPR_DEAD = BIT ( 8 ) , // Actor is dying
2021-12-30 09:30:21 +00:00
2021-10-31 08:04:24 +00:00
SPR_ZDIFF_MODE = BIT ( 10 ) , // For following tracks at different z heights
SPR_SPEED_UP = BIT ( 11 ) , // For following tracks at different speeds
SPR_SLOW_DOWN = BIT ( 12 ) , // For following tracks at different speeds
SPR_DONT_UPDATE_ANG = BIT ( 13 ) , // For tracks - don't update the angle for a while
2021-12-30 09:30:21 +00:00
2021-10-31 08:04:24 +00:00
SPR_SO_ATTACHED = BIT ( 14 ) , // sprite is part of a sector object
SPR_SUICIDE = BIT ( 15 ) , // sprite is set to kill itself
2021-12-30 09:30:21 +00:00
2021-10-31 08:04:24 +00:00
SPR_RUN_AWAY = BIT ( 16 ) , // sprite is in "Run Away" track mode.
SPR_FIND_PLAYER = BIT ( 17 ) , // sprite is in "Find Player" track mode.
2021-12-30 09:30:21 +00:00
2021-10-31 08:04:24 +00:00
SPR_SWIMMING = BIT ( 18 ) , // Actor is swimming
SPR_WAIT_FOR_PLAYER = BIT ( 19 ) , // Track Mode - Actor is waiting for player to come close
SPR_WAIT_FOR_TRIGGER = BIT ( 20 ) , // Track Mode - Actor is waiting for player to trigger
SPR_SLIDING = BIT ( 21 ) , // Actor is sliding
SPR_ON_SO_SECTOR = BIT ( 22 ) , // sprite is on a sector object sector
2021-12-30 09:30:21 +00:00
2021-10-31 08:04:24 +00:00
SPR_SHADE_DIR = BIT ( 23 ) , // sprite is on a sector object sector
SPR_XFLIP_TOGGLE = BIT ( 24 ) , // sprite rotation xflip bit
SPR_NO_SCAREDZ = BIT ( 25 ) , // not afraid of falling
2021-12-30 09:30:21 +00:00
2021-10-31 08:04:24 +00:00
SPR_SET_POS_DONT_KILL = BIT ( 26 ) , // Don't kill sprites in MissileSetPos
SPR_SKIP2 = BIT ( 27 ) , // 20 moves ps
SPR_SKIP4 = BIT ( 28 ) , // 10 moves ps
2021-12-30 09:30:21 +00:00
2021-10-31 08:04:24 +00:00
SPR_BOUNCE = BIT ( 29 ) , // For shrapnel types that can bounce once
SPR_UNDERWATER = BIT ( 30 ) , // For missiles etc
2021-12-30 09:30:21 +00:00
2021-10-31 08:04:24 +00:00
SPR_SHADOW = BIT ( 31 ) , // Sprites that have shadows
// User->Flags2 flags
SPR2_BLUR_TAPER = BIT ( 13 ) | BIT ( 14 ) , // taper type
SPR2_BLUR_TAPER_FAST = BIT ( 13 ) , // taper fast
SPR2_BLUR_TAPER_SLOW = BIT ( 14 ) , // taper slow
SPR2_SPRITE_FAKE_BLOCK = BIT ( 15 ) , // fake blocking bit for damage
SPR2_NEVER_RESPAWN = BIT ( 16 ) , // for item respawning
SPR2_ATTACH_WALL = BIT ( 17 ) ,
SPR2_ATTACH_FLOOR = BIT ( 18 ) ,
SPR2_ATTACH_CEILING = BIT ( 19 ) ,
SPR2_CHILDREN = BIT ( 20 ) , // sprite OWNS children
SPR2_SO_MISSILE = BIT ( 21 ) , // this is a missile from a SO
SPR2_DYING = BIT ( 22 ) , // Sprite is currently dying
SPR2_VIS_SHADING = BIT ( 23 ) , // Sprite shading to go along with vis adjustments
SPR2_DONT_TARGET_OWNER = BIT ( 24 ) ,
SPR2_FLAMEDIE = BIT ( 25 ) , // was previously 'flame == -2'
} ;
2015-05-19 21:54:34 +00:00
///////////////////////////////////////////////////////////////////////////////////////////
//
// Sector Stuff - Sector Objects and Tracks
//
///////////////////////////////////////////////////////////////////////////////////////////
// flags in EXTRA variable
2021-12-27 16:31:36 +00:00
enum
{
SECTFX_SINK = BIT ( 0 ) ,
SECTFX_OPERATIONAL = BIT ( 1 ) ,
SECTFX_WARP_SECTOR = BIT ( 2 ) ,
SECTFX_CURRENT = BIT ( 3 ) ,
SECTFX_Z_ADJUST = BIT ( 4 ) , // adjust ceiling/floor
SECTFX_NO_RIDE = BIT ( 5 ) , // moving sector - don't ride it
SECTFX_DYNAMIC_AREA = BIT ( 6 ) ,
SECTFX_DIVE_AREA = BIT ( 7 ) , // Diving area
SECTFX_UNDERWATER = BIT ( 8 ) , // Underwater area
SECTFX_UNDERWATER2 = BIT ( 9 ) , // Underwater area
2021-12-30 09:30:21 +00:00
2021-12-27 16:31:36 +00:00
SECTFX_LIQUID_MASK = ( BIT ( 10 ) | BIT ( 11 ) ) , // only valid for sectors with depth
SECTFX_LIQUID_NONE = ( 0 ) ,
SECTFX_LIQUID_LAVA = BIT ( 10 ) ,
SECTFX_LIQUID_WATER = BIT ( 11 ) ,
SECTFX_SECTOR_OBJECT = BIT ( 12 ) , // for collision detection
SECTFX_VATOR = BIT ( 13 ) , // denotes that this is a vertical moving sector vator type
SECTFX_TRIGGER = BIT ( 14 ) , // trigger type to replace tags.h trigger types
} ;
2015-05-19 21:54:34 +00:00
// flags in sector USER structure
2021-12-27 16:31:36 +00:00
enum
{
SECTFU_SO_DONT_BOB = BIT ( 0 ) ,
SECTFU_SO_SINK_DEST = BIT ( 1 ) ,
SECTFU_SO_DONT_SINK = BIT ( 2 ) ,
SECTFU_DONT_COPY_PALETTE = BIT ( 3 ) ,
SECTFU_SO_SLOPE_FLOOR_TO_POINT = BIT ( 4 ) ,
SECTFU_SO_SLOPE_CEILING_TO_POINT = BIT ( 5 ) ,
SECTFU_DAMAGE_ABOVE_SECTOR = BIT ( 6 ) ,
SECTFU_VATOR_BOTH = BIT ( 7 ) , // vators set up for both ceiling and floor
SECTFU_CANT_SURFACE = BIT ( 8 ) , // for diving
SECTFU_SLIDE_SECTOR = BIT ( 9 ) , // for diving
} ;
2015-05-19 21:54:34 +00:00
# define MAKE_STAG_ENUM
2021-12-31 14:27:18 +00:00
enum STAG_ID
2015-05-19 21:54:34 +00:00
{
# include "stag.h"
} ;
# undef MAKE_STAG_ENUM
2021-12-27 16:31:36 +00:00
enum {
WALLFX_LOOP_DONT_SPIN = BIT ( 0 ) ,
WALLFX_LOOP_REVERSE_SPIN = BIT ( 1 ) ,
WALLFX_LOOP_SPIN_2X = BIT ( 2 ) ,
WALLFX_LOOP_SPIN_4X = BIT ( 3 ) ,
WALLFX_LOOP_OUTER = BIT ( 4 ) , // for sector object
WALLFX_DONT_MOVE = BIT ( 5 ) , // for sector object
WALLFX_SECTOR_OBJECT = BIT ( 6 ) , // for collision detection
WALLFX_DONT_STICK = BIT ( 7 ) , // for bullet holes and stars
WALLFX_DONT_SCALE = BIT ( 8 ) , // for sector object
WALLFX_LOOP_OUTER_SECONDARY = BIT ( 9 ) , // for sector object
} ;
2015-05-19 21:54:34 +00:00
enum ShrapType
{
SHRAP_NONE = 0 ,
SHRAP_GLASS = 1 , //
SHRAP_TREE_BARK = 2 , // (NEED) outside tree bark
SHRAP_SO_SMOKE = 3 , // only used for damaged SO's
SHRAP_PAPER = 4 , //
SHRAP_BLOOD = 5 , // std blood from gibs
SHRAP_EXPLOSION = 6 , // small explosion
SHRAP_LARGE_EXPLOSION = 7 , // large explosion
SHRAP_METAL = 8 , //
SHRAP_STONE = 9 , // what we have might be ok
SHRAP_PLANT = 10 , // (NEED)
SHRAP_GIBS = 11 , // std blood and guts
SHRAP_WOOD = 12 , //
SHRAP_GENERIC = 13 , // what we have might be ok - sort of gray brown rock look
SHRAP_TREE_PULP = 14 , // (NEED) inside tree wood
SHRAP_COIN = 15 ,
SHRAP_METALMIX = 16 ,
SHRAP_WOODMIX = 17 ,
SHRAP_MARBELS = 18 ,
SHRAP_PAPERMIX = 19 ,
SHRAP_USER_DEFINED = 99
} ;
2020-08-05 14:40:07 +00:00
# define CallocMem(size, num) M_Calloc(size, num)
# define FreeMem(ptr) M_Free(ptr)
2015-05-19 21:54:34 +00:00
2021-12-31 14:27:18 +00:00
struct TARGET_SORT
2015-05-19 21:54:34 +00:00
{
2021-11-01 17:10:38 +00:00
DSWActor * actor ;
2022-09-04 17:04:18 +00:00
DAngle dangle ;
double dst ;
double weight ;
2021-12-31 14:27:18 +00:00
} ;
2015-05-19 21:54:34 +00:00
2021-11-01 17:10:38 +00:00
enum { MAX_TARGET_SORT = 16 } ;
2015-05-19 21:54:34 +00:00
extern TARGET_SORT TargetSort [ MAX_TARGET_SORT ] ;
extern unsigned TargetSortCount ;
2021-12-31 14:27:18 +00:00
enum DOOR_TYPE
2015-05-19 21:54:34 +00:00
{
OPERATE_TYPE ,
DOOR_HORIZ_TYPE ,
DOOR_SLIDE_TYPE ,
DOOR_SWING_TYPE ,
DOOR_ROTATE_TYPE
} ;
2021-12-31 14:27:18 +00:00
struct DOOR_AUTO_CLOSE
2015-05-19 21:54:34 +00:00
{
DOOR_TYPE Type ;
2021-11-21 20:45:12 +00:00
int Sector ;
int16_t Speed ;
int16_t TimeOut ;
2021-12-31 14:27:18 +00:00
} ;
2015-05-19 21:54:34 +00:00
2021-12-31 14:27:18 +00:00
struct SWING
2015-05-19 21:54:34 +00:00
{
int origx [ 17 ] , origy [ 17 ] ;
2021-11-21 20:45:12 +00:00
int sector ;
2021-11-24 21:20:44 +00:00
int16_t angopen , angclosed , angopendir , sang , anginc ;
2021-12-31 14:27:18 +00:00
} ;
2015-05-19 21:54:34 +00:00
2021-12-31 14:27:18 +00:00
struct SINE_WAVE_FLOOR
2015-05-19 21:54:34 +00:00
{
2021-11-24 22:16:28 +00:00
sectortype * sectp ;
2022-09-05 22:50:15 +00:00
double floorOrigz , ceilingOrigz , Range ;
2021-11-21 20:45:12 +00:00
int16_t sintable_ndx , speed_shift ;
2021-04-02 11:05:24 +00:00
uint8_t flags ;
2021-12-31 14:27:18 +00:00
} ;
2015-05-19 21:54:34 +00:00
2021-12-27 16:31:36 +00:00
enum
{
2022-01-29 11:53:30 +00:00
MAX_SINE_WAVE = 12 ,
2021-12-27 16:31:36 +00:00
MAX_SINE_WALL = 10 ,
MAX_SINE_WALL_POINTS = 64 ,
} ;
2015-05-19 21:54:34 +00:00
extern SINE_WAVE_FLOOR SineWaveFloor [ MAX_SINE_WAVE ] [ 21 ] ;
2021-12-31 14:27:18 +00:00
struct SINE_WALL
2015-05-19 21:54:34 +00:00
{
2021-11-24 21:20:44 +00:00
walltype * wallp ;
2022-09-05 22:47:13 +00:00
double origXY ;
double Range ;
2021-11-21 20:45:12 +00:00
int16_t sintable_ndx , speed_shift , type ;
2021-12-31 14:27:18 +00:00
} ;
2015-05-19 21:54:34 +00:00
extern SINE_WALL SineWall [ MAX_SINE_WALL ] [ MAX_SINE_WALL_POINTS ] ;
2021-04-02 11:05:24 +00:00
struct SPRING_BOARD
2015-05-19 21:54:34 +00:00
{
2021-11-25 16:02:27 +00:00
sectortype * sectp ;
int TimeOut ;
2021-04-02 11:05:24 +00:00
} ;
2015-05-19 21:54:34 +00:00
extern SPRING_BOARD SpringBoard [ 20 ] ;
extern SWING Rotate [ 17 ] ;
2021-12-27 20:13:00 +00:00
enum
{
MAX_DOOR_AUTO_CLOSE = 16 ,
MAXANIM = 256
} ;
2015-05-19 21:54:34 +00:00
extern DOOR_AUTO_CLOSE DoorAutoClose [ MAX_DOOR_AUTO_CLOSE ] ;
2021-12-31 14:47:10 +00:00
typedef void ( * ANIM_CALLBACKp ) ( ANIM * , void * ) ;
2015-05-19 21:54:34 +00:00
2020-12-08 19:42:52 +00:00
enum
2015-05-19 21:54:34 +00:00
{
2020-12-08 19:42:52 +00:00
ANIM_Floorz ,
ANIM_SopZ ,
ANIM_Spritez ,
ANIM_Userz ,
ANIM_SUdepth ,
2015-05-19 21:54:34 +00:00
} ;
2021-12-31 14:13:05 +00:00
struct TRACK_POINT
2015-05-19 21:54:34 +00:00
{
2022-08-21 20:14:04 +00:00
DVector3 pos ;
DAngle angle ;
int16_t tag_low , tag_high ;
2021-12-31 14:13:05 +00:00
} ;
2015-05-19 21:54:34 +00:00
2021-12-31 14:13:05 +00:00
struct TRACK
2015-05-19 21:54:34 +00:00
{
2021-12-31 14:13:05 +00:00
TRACK_POINT * TrackPoint ;
2015-05-19 21:54:34 +00:00
int ttflags ;
2021-04-18 21:55:21 +00:00
int flags ;
int NumPoints ;
2020-12-01 15:53:29 +00:00
void FreeTrackPoints ( )
{
if ( TrackPoint )
{
M_Free ( TrackPoint ) ;
// !JIM! I added null assigner
TrackPoint = nullptr ;
}
}
2021-12-31 14:13:05 +00:00
TRACK_POINT * SetTrackSize ( unsigned newsize )
2020-12-01 15:53:29 +00:00
{
FreeTrackPoints ( ) ;
2021-12-31 14:13:05 +00:00
TrackPoint = ( TRACK_POINT * ) M_Calloc ( ( newsize * sizeof ( TRACK_POINT ) ) , 1 ) ;
2020-12-01 15:53:29 +00:00
return TrackPoint ;
}
2021-12-31 14:13:05 +00:00
} ;
2015-05-19 21:54:34 +00:00
// Most track type flags are in tags.h
// Regular track flags
2021-12-31 14:13:05 +00:00
struct COLOR_MAP
2015-05-19 21:54:34 +00:00
{
2015-05-19 21:58:29 +00:00
uint8_t FromRange , ToRange , FromColor , ToColor ;
2021-12-31 14:13:05 +00:00
} ;
2015-05-19 21:54:34 +00:00
2021-12-27 20:13:00 +00:00
enum
{
TF_TRACK_OCCUPIED = BIT ( 0 ) ,
MAX_TRACKS = 100 ,
2022-01-29 11:53:30 +00:00
MAX_SO_SECTOR = 50 ,
2021-12-27 20:13:00 +00:00
MAX_SO_POINTS = ( MAX_SO_SECTOR * 15 ) ,
MAX_SO_SPRITE = 60 ,
MAX_CLIPBOX = 32
} ;
2015-05-19 21:54:34 +00:00
extern TRACK Track [ MAX_TRACKS ] ;
2023-05-28 08:55:50 +00:00
enum
{
SOType_None = 0 ,
SOType_Floor = 1 ,
SOType_Tornado = 2 ,
SOType_AutoTurret = 3
} ;
2021-12-31 14:50:44 +00:00
struct SECTOR_OBJECT
2015-05-19 21:54:34 +00:00
{
2023-05-28 08:47:17 +00:00
bool PreMoveScale ;
2023-05-28 08:55:50 +00:00
uint8_t AnimType ;
2021-12-05 23:35:12 +00:00
TObjPtr < DSWActor * > controller ;
2015-05-19 21:54:34 +00:00
2021-12-05 23:35:12 +00:00
TObjPtr < DSWActor * > sp_child ; // child sprite that holds info for the sector object
2015-05-19 21:54:34 +00:00
2022-08-18 17:14:50 +00:00
DVector3 pmid ; // midpoints of the sector object
2021-12-30 09:30:21 +00:00
2021-12-05 23:35:12 +00:00
TObjPtr < DSWActor * > so_actors [ MAX_SO_SPRITE ] ; // hold the actors of the object
TObjPtr < DSWActor * > match_event_actor ; // spritenum of the match event sprite
2021-11-02 17:45:21 +00:00
2021-11-25 17:16:56 +00:00
sectortype
* sectp [ MAX_SO_SECTOR ] ,
2021-11-24 22:01:43 +00:00
* scratch , // Just a filler to account for shitty loop tests.
2021-11-24 22:07:02 +00:00
* op_main_sector , // main sector operational SO moves in - for speed purposes
2021-11-24 22:01:43 +00:00
* mid_sector ; // middle sector
2021-11-24 21:49:00 +00:00
2021-11-25 17:16:56 +00:00
walltype
* morph_wall_point ; // actual wall point to drag
2022-08-21 21:10:51 +00:00
double
2022-08-21 21:13:53 +00:00
target_dist , // distance to next point
2022-08-21 21:10:51 +00:00
zdelta ; // z delta from original
2021-11-24 21:49:00 +00:00
2020-12-01 18:01:38 +00:00
int vel , // velocity
2015-05-19 21:54:34 +00:00
vel_tgt , // target velocity
2022-09-03 21:56:48 +00:00
update ; // Distance from player at which you continue updating
2022-09-01 17:33:49 +00:00
2022-09-03 22:00:53 +00:00
double zorig_floor [ MAX_SO_SECTOR ] , // original z values for all sectors
z_tgt ; // target z delta
2022-09-03 22:08:01 +00:00
int z_rate ; // rate at which z aproaches target
2015-05-19 21:54:34 +00:00
// only works for single player.
2022-09-03 22:08:01 +00:00
double bob_diff , // bobbing difference for the frame
floor_loz , // floor low z
floor_hiz , // floor hi z
bob_amt ; // bob amount max in z coord
2022-09-01 17:33:49 +00:00
2015-05-19 21:54:34 +00:00
// variables set by mappers for drivables
2022-09-30 10:51:50 +00:00
double drive_angspeed ;
int drive_angslide ,
2015-05-19 21:54:34 +00:00
drive_speed ,
drive_slide ,
2021-11-24 22:01:43 +00:00
flags ;
2015-05-19 21:54:34 +00:00
2022-09-05 15:35:08 +00:00
double crush_z ,
morph_z , // morphing point z
2022-09-03 18:23:41 +00:00
morph_z_min , // morphing point z min
morph_z_max ;
2022-09-03 19:36:47 +00:00
DVector2 orig [ MAX_SO_POINTS ] ; // save the original x & y location of each wall so it can be
int16_t max_damage , // max damage
2015-05-19 21:54:34 +00:00
ram_damage , // damage taken by ramming
wait_tics , //
num_sectors , // number of sectors
num_walls , // number of sectors
track , // the track # 0 to 20
point , // the point on the track that the sector object is headed toward
vel_rate , // rate at which velocity aproaches target
2022-09-30 16:14:37 +00:00
dir ; // direction traveling on the track
double clipdist ; // cliping distance for operational sector objects
double clipbox_dist [ MAX_CLIPBOX ] ; // mult-clip box variables (clipdist equivalent)
2022-09-03 20:12:32 +00:00
double clipbox_vdist [ MAX_CLIPBOX ] ; // mult-clip box variables
DAngle clipbox_ang [ MAX_CLIPBOX ] ; // mult-clip box variables
2022-10-03 18:46:23 +00:00
2022-10-03 19:43:55 +00:00
int16_t clipbox_num ;
DAngle ang ; // angle facing
DAngle ang_moving ; // angle the SO is facing
DAngle ang_tgt ; // target angle
DAngle ang_orig ; // original angle
DAngle last_ang , // last angle before started spinning
old_ang ; // holding variable for the old angle
DAngle spin_speed , // spin_speed
save_spin_speed , // save spin speed
spin_ang ; // spin angle
int16_t turn_speed , // shift value determines how fast SO turns to match new angle
2015-05-19 21:54:34 +00:00
bob_sine_ndx , // index into sine table
bob_speed , // shift value for speed
save_vel , // save velocity
match_event , // match number
// SO Scaling Vector Info
scale_type , // type of scaling - enum controled
scale_active_type , // activated by a switch or trigger
// values for whole SO
2022-09-03 18:40:57 +00:00
scale_rand_freq ; // freqency of direction change - based on rand(1024)
double scale_dist , // distance from center
scale_dist_min , // absolute min
scale_dist_max , // absolute max
2022-09-03 20:57:07 +00:00
scale_speed , // speed of scaling
2015-05-19 21:54:34 +00:00
// values for single point scaling
2022-09-03 20:57:07 +00:00
scale_point_dist [ MAX_SO_POINTS ] , // distance from center
scale_point_speed [ MAX_SO_POINTS ] , // speed of scaling
scale_point_base_speed , // base speed of scaling
scale_point_dist_min , // absolute min
scale_point_dist_max ; // absolute max
int16_t scale_point_rand_freq , // freqency of direction change - based on rand(1024)
2015-05-19 21:54:34 +00:00
scale_x_mult , // x multiplyer for scaling
scale_y_mult , // y multiplyer for scaling
// Used for center point movement
2022-09-03 18:23:41 +00:00
morph_rand_freq ; // freq of dir change
DAngle morph_ang ; // angle moving from CENTER
double morph_speed , // speed of movement
morph_dist_max , // radius boundry
morph_dist , // dist from CENTER
morph_z_speed ; // z speed for morph point
DVector2 morph_off ; // save yoff from center
2015-05-19 21:54:34 +00:00
2022-08-27 06:04:55 +00:00
//scale_rand_reverse; // random at random interval
2015-05-19 21:54:34 +00:00
// limit rotation angle
2022-08-27 06:04:55 +00:00
DAngle limit_ang_center , // for limiting the angle of turning - turrets etc
2015-05-19 21:54:34 +00:00
limit_ang_delta ; //
2021-11-19 21:35:08 +00:00
2015-05-19 21:54:34 +00:00
} ;
2021-12-27 16:31:36 +00:00
enum
{
SOBJ_SPEED_UP = BIT ( 0 ) ,
SOBJ_SLOW_DOWN = BIT ( 1 ) ,
SOBJ_ZUP = BIT ( 2 ) ,
SOBJ_ZDOWN = BIT ( 3 ) ,
SOBJ_ZDIFF_MODE = BIT ( 4 ) ,
SOBJ_MOVE_VERTICAL = BIT ( 5 ) , // for sprite objects - move straight up/down
SOBJ_ABSOLUTE_ANGLE = BIT ( 7 ) ,
SOBJ_SPRITE_OBJ = BIT ( 8 ) ,
SOBJ_DONT_ROTATE = BIT ( 9 ) ,
SOBJ_WAIT_FOR_EVENT = BIT ( 10 ) ,
SOBJ_HAS_WEAPON = BIT ( 11 ) ,
SOBJ_SYNC1 = BIT ( 12 ) , // for syncing up several SO's perfectly
SOBJ_SYNC2 = BIT ( 13 ) , // for syncing up several SO's perfectly
SOBJ_DYNAMIC = BIT ( 14 ) , // denotes scaling or morphing object
SOBJ_ZMID_FLOOR = BIT ( 15 ) , // can't remember which sector objects need this think its the bobbing and sinking ones
SOBJ_SLIDE = BIT ( 16 ) ,
SOBJ_OPERATIONAL = BIT ( 17 ) ,
SOBJ_KILLABLE = BIT ( 18 ) ,
SOBJ_DIE_HARD = BIT ( 19 ) ,
SOBJ_UPDATE_ONCE = BIT ( 20 ) ,
SOBJ_UPDATE = BIT ( 21 ) ,
SOBJ_NO_QUAKE = BIT ( 22 ) ,
SOBJ_REMOTE_ONLY = BIT ( 23 ) ,
SOBJ_RECT_CLIP = BIT ( 24 ) ,
SOBJ_BROKEN = BIT ( 25 ) ,
} ;
2015-05-19 21:54:34 +00:00
// track set to these to tell them apart
2021-12-27 16:31:36 +00:00
enum
{
MAX_SECTOR_OBJECTS = 20 ,
SO_OPERATE_TRACK_START = 90 ,
SO_TURRET_MGUN = 96 , // machine gun
SO_TURRET = 97 ,
SO_VEHICLE = 98 ,
// #define SO_SPEED_BOAT 99
} ;
2015-05-19 21:54:34 +00:00
2022-08-20 08:03:21 +00:00
// make sure this does not overflow when converted to a Build int coordinate and survives a round trip through conversions.
constexpr double MAXSO = 0x7fffffe0 / 32 ;
static_assert ( MAXSO = = int ( MAXSO * worldtoint ) * inttoworld ) ;
2022-08-18 17:14:50 +00:00
inline bool SO_EMPTY ( SECTOR_OBJECT * sop ) { return ( sop - > pmid . X = = MAXSO ) ; }
2020-05-22 12:11:03 +00:00
2015-05-19 21:54:34 +00:00
extern SECTOR_OBJECT SectorObject [ MAX_SECTOR_OBJECTS ] ;
2020-12-08 19:42:52 +00:00
2015-05-19 21:54:34 +00:00
///////////////////////////////////////////////////////////////////////////////////////////
//
// Prototypes
//
///////////////////////////////////////////////////////////////////////////////////////////
2021-12-31 15:00:14 +00:00
int NewStateGroup ( DSWActor * actor , STATE * SpriteGroup [ ] ) ;
2022-08-20 07:25:05 +00:00
DVector3 SectorMidPoint ( sectortype * sectp ) ;
2021-12-31 15:00:14 +00:00
void SpawnUser ( DSWActor * actor , short id , STATE * state ) ;
2015-05-19 21:54:34 +00:00
2021-11-21 20:45:12 +00:00
short ActorFindTrack ( DSWActor * actor , int8_t player_dir , int track_type , int * track_point_num , int * track_dir ) ;
2015-05-19 21:54:34 +00:00
2019-12-18 18:17:37 +00:00
// Some sounds were checked by storing handles in static local variables.
// Problems with this design:
// 1. The variables were unmaintained and could refer to handles that had been reused already.
// 2. No proper sound ownership tracking.
// 3. In some cases items that were supposed to use the same check referred to different handle variables.
2021-05-15 08:23:50 +00:00
// In short: It was very broken. This is a list of all sound items used this way, now each one gets a dedicated channel
2019-12-18 18:17:37 +00:00
// so that proper checks can be performed and sound ownership be tracked.
enum
{
CHAN_ToiletFart = 1000 ,
CHAN_AnimeMad = 1001 ,
CHAN_AnimeSing = 1002 ,
CHAN_CoyHandle = 1003 ,
CHAN_RipHeart = 1004 ,
} ;
2015-05-19 21:54:34 +00:00
short SoundAngle ( int x , int y ) ;
//void PlaySound(int num, short angle, short vol);
2023-10-02 19:03:59 +00:00
int _PlaySound ( FSoundID num , DSWActor * sprite , DSWPlayer * player , const DVector3 * const pos , int flags , int channel , EChanFlags sndflags ) ;
2021-11-02 22:08:59 +00:00
void InitAmbient ( int num , DSWActor * actor ) ;
2021-11-06 09:09:53 +00:00
2023-10-02 19:03:59 +00:00
inline void PlaySound ( int num , DSWPlayer * player , int flags , int channel = 8 , EChanFlags sndflags = CHANF_NONE )
2019-12-18 10:09:01 +00:00
{
2023-05-26 21:27:46 +00:00
_PlaySound ( soundEngine - > FindSoundByResID ( num ) , nullptr , player , nullptr , flags | v3df_follow , channel , sndflags ) ;
2019-12-18 10:09:01 +00:00
}
2021-12-31 21:36:56 +00:00
inline void PlaySound ( int num , int flags , int channel = 8 , EChanFlags sndflags = CHANF_NONE )
2019-12-18 10:09:01 +00:00
{
2023-05-26 21:27:46 +00:00
_PlaySound ( soundEngine - > FindSoundByResID ( num ) , nullptr , nullptr , nullptr , flags , channel , sndflags ) ;
2019-12-18 10:09:01 +00:00
}
2022-09-05 23:05:29 +00:00
inline void PlaySound ( int num , const DVector3 & pos , int flags , int channel = 8 , EChanFlags sndflags = CHANF_NONE )
2022-08-16 22:59:32 +00:00
{
2023-05-26 21:27:46 +00:00
_PlaySound ( soundEngine - > FindSoundByResID ( num ) , nullptr , nullptr , & pos , flags , channel , sndflags ) ;
2022-08-16 22:59:32 +00:00
}
2019-12-18 10:09:01 +00:00
2023-10-02 19:03:59 +00:00
int _PlayerSound ( int num , DSWPlayer * pp ) ;
inline int PlayerSound ( int num , int flags , DSWPlayer * pp ) { return _PlayerSound ( num , pp ) ; }
void StopPlayerSound ( DSWPlayer * pp , int which = - 1 ) ;
2021-11-28 10:34:29 +00:00
bool SoundValidAndActive ( DSWActor * spr , int channel ) ;
2019-12-18 10:09:01 +00:00
2015-05-19 21:54:34 +00:00
2021-10-31 15:55:24 +00:00
struct BREAK_INFO ;
int SpawnShrap ( DSWActor * , DSWActor * , int = - 1 , BREAK_INFO * breakinfo = nullptr ) ;
2015-05-19 21:54:34 +00:00
2023-10-02 19:03:59 +00:00
void PlayerUpdateHealth ( DSWPlayer * pp , short value ) ;
void PlayerUpdateAmmo ( DSWPlayer * pp , short WeaponNum , short value ) ;
void PlayerUpdateWeapon ( DSWPlayer * pp , short WeaponNum ) ;
void PlayerUpdateKills ( DSWPlayer * pp , short value ) ;
void RefreshInfoLine ( DSWPlayer * pp ) ;
2015-05-19 21:54:34 +00:00
2015-05-19 21:58:29 +00:00
void DoAnim ( int numtics ) ;
2021-11-02 17:39:27 +00:00
void AnimDelete ( int animtype , int animindex , DSWActor * ) ;
short AnimGetGoal ( int animtype , int animindex , DSWActor * ) ;
2022-10-12 13:11:07 +00:00
int AnimSet ( int animtype , int animindex , DSWActor * animactor , double thegoal , double thevel ) ;
int AnimSet ( int animtype , sectortype * animindex , double thegoal , double thevel )
2021-11-24 21:49:00 +00:00
{
2022-11-15 11:03:44 +00:00
return AnimSet ( animtype , sectindex ( animindex ) , nullptr , thegoal , thevel ) ;
2021-11-24 21:49:00 +00:00
}
2021-11-26 19:07:42 +00:00
2021-12-31 14:50:44 +00:00
short AnimSetCallback ( short anim_ndx , ANIM_CALLBACKp call , SECTOR_OBJECT * data ) ;
2022-08-21 14:42:38 +00:00
short AnimSetVelAdj ( short anim_ndx , double vel_adj ) ;
2015-05-19 21:54:34 +00:00
2021-12-31 14:40:29 +00:00
void EnemyDefaults ( DSWActor * actor , ACTOR_ACTION_SET * action , PERSONALITY * person ) ;
2015-05-19 21:54:34 +00:00
2022-09-06 18:19:55 +00:00
void getzrangepoint ( const DVector3 & pos , sectortype * sect , double * hiz , Collision * ceilhit , double * loz , Collision * florhit ) ;
2022-10-03 21:31:02 +00:00
2022-09-06 17:33:38 +00:00
Collision move_sprite ( DSWActor * actor , const DVector3 & change , double ceildist , double flordist , uint32_t cliptype , int numtics ) ;
2022-08-30 22:46:24 +00:00
Collision move_missile ( DSWActor * actor , const DVector3 & change , double ceildist , double flordist , uint32_t cliptype , int numtics ) ;
2022-08-30 22:45:23 +00:00
2022-09-04 17:04:18 +00:00
DSWActor * DoPickTarget ( DSWActor * , DAngle max_delta_ang , int skip_targets ) ;
2022-08-30 22:45:23 +00:00
2021-11-03 18:52:51 +00:00
void change_actor_stat ( DSWActor * actor , int stat , bool quick = false ) ;
2021-11-02 23:12:20 +00:00
void SetOwner ( DSWActor * , DSWActor * , bool flag = true ) ;
2021-10-30 14:12:19 +00:00
void SetOwner ( int a , int b ) ; // we still need this...
void ClearOwner ( DSWActor * ownr ) ;
2021-10-31 18:07:50 +00:00
DSWActor * GetOwner ( DSWActor * child ) ;
2021-10-31 11:20:03 +00:00
void SetAttach ( DSWActor * , DSWActor * ) ;
2021-03-25 20:21:48 +00:00
void CollectPortals ( ) ;
2015-05-19 21:54:34 +00:00
2022-09-01 20:15:54 +00:00
int SpawnBlood ( DSWActor * actor , DSWActor * weapActor , DAngle hit_angle = nullAngle , const DVector3 * hitpos = nullptr ) ;
2021-10-30 19:02:14 +00:00
2022-12-06 10:11:50 +00:00
inline FTextureID FAFPlaceMirrorPic [ 2 ] ;
inline FTextureID FAFMirrorPic [ 2 ] ;
2021-11-06 11:19:08 +00:00
2021-11-24 23:45:55 +00:00
inline bool FAF_ConnectCeiling ( sectortype * sect )
2021-11-06 11:19:08 +00:00
{
2022-12-09 09:48:47 +00:00
return ( sect & & sect - > ceilingtexture = = FAFMirrorPic [ 0 ] ) ;
2021-11-06 11:19:08 +00:00
}
2021-11-24 23:45:55 +00:00
inline bool FAF_ConnectFloor ( sectortype * sect )
2021-11-06 11:19:08 +00:00
{
2022-12-09 09:48:47 +00:00
return ( sect & & sect - > floortexture = = FAFMirrorPic [ 0 ] ) ;
2021-11-06 11:19:08 +00:00
}
2021-11-24 23:45:55 +00:00
inline bool FAF_ConnectArea ( sectortype * sect )
2021-11-06 11:19:08 +00:00
{
2021-12-12 12:11:59 +00:00
return sect & & ( FAF_ConnectCeiling ( sect ) | | FAF_ConnectFloor ( sect ) ) ;
2021-11-06 11:19:08 +00:00
}
2021-03-25 20:21:48 +00:00
2015-05-19 21:54:34 +00:00
2022-09-05 22:18:50 +00:00
void FAFhitscan ( const DVector3 & start , sectortype * sect , const DVector3 & vect , HitInfo & hit , int32_t clipmask ) ;
2022-09-05 22:33:56 +00:00
bool FAFcansee ( const DVector3 & start , sectortype * sects , const DVector3 & end , sectortype * secte ) ;
2022-09-29 17:52:01 +00:00
void FAFgetzrange ( const DVector3 & pos , sectortype * sect , double * hiz , Collision * ceilhit , double * loz , Collision * florhit , double clipdist , int32_t clipmask ) ;
2022-10-03 21:43:35 +00:00
void FAFgetzrangepoint ( const DVector3 & pos , sectortype * sect , double * hiz , Collision * ceilhit , double * loz , Collision * florhit ) ;
2015-05-19 21:54:34 +00:00
2022-08-21 07:45:54 +00:00
2015-05-19 21:54:34 +00:00
enum SoundType
{
SOUND_OBJECT_TYPE ,
SOUND_EVERYTHING_TYPE
} ;
2015-05-19 21:58:29 +00:00
void DoSoundSpotMatch ( short match , short sound_num , short sound_type ) ;
2015-05-19 21:54:34 +00:00
///////////////////////////////////////////////////////////////////////////////////////////
//
// Externs
//
///////////////////////////////////////////////////////////////////////////////////////////
2020-09-09 18:32:24 +00:00
extern bool NewGame ;
2015-05-19 21:58:29 +00:00
extern uint8_t CommPlayers ;
2020-09-09 18:32:24 +00:00
extern bool CommEnabled ;
2015-05-19 21:54:34 +00:00
extern int LastFrameTics ;
extern char ds [ ] ;
extern short Skill ;
extern int GodMode ;
2020-09-09 18:32:24 +00:00
extern bool ReloadPrompt ;
2020-04-17 14:31:23 +00:00
2020-09-02 18:56:09 +00:00
extern int lockspeed ;
2015-05-19 21:54:34 +00:00
2021-12-27 20:13:00 +00:00
// Various scattered constants
2021-11-06 08:29:19 +00:00
enum
{
2021-12-27 20:13:00 +00:00
ACTOR_GRAVITY = 8 ,
// subtract value from clipdist on getzrange calls
STAT_DAMAGE_LIST_SIZE = 20 ,
COLOR_PAIN = 128 , // Light red range
2015-05-19 21:54:34 +00:00
2021-12-27 20:13:00 +00:00
ANIM_SERP = 1 ,
ANIM_SUMO = 2 ,
ANIM_ZILLA = 3
} ;
2015-05-19 21:54:34 +00:00
2023-01-21 09:26:07 +00:00
constexpr int synctics = 3 ;
constexpr int ACTORMOVETICS = ( synctics < < 1 ) ;
constexpr int TICSPERMOVEMENT = synctics ;
2022-09-29 17:52:01 +00:00
constexpr double GETZRANGE_CLIP_ADJ = 0.5 ;
2015-05-19 21:54:34 +00:00
extern int * lastpacket2clock ;
///////////////////////////
//
// RECENT network additions
//
///////////////////////////
2020-09-09 18:28:05 +00:00
extern int MoveSkip4 , MoveSkip2 , MoveSkip8 ;
2021-07-06 08:26:43 +00:00
extern int MinEnemySkill ;
2015-05-19 21:54:34 +00:00
extern short screenpeek ;
2015-05-19 21:58:29 +00:00
extern int16_t StatDamageList [ STAT_DAMAGE_LIST_SIZE ] ;
2015-05-19 21:54:34 +00:00
///////////////////////////////////////////////////////////////
//
// Stuff for player palette flashes when hurt or getting items
//
///////////////////////////////////////////////////////////////
2023-10-02 19:03:59 +00:00
extern void SetFadeAmt ( DSWPlayer * pp , short damage , uint8_t startcolor ) ;
extern void DoPaletteFlash ( DSWPlayer * pp ) ;
2020-09-09 18:32:24 +00:00
extern bool NightVision ;
2015-05-19 21:54:34 +00:00
2019-12-17 22:25:07 +00:00
2015-05-19 21:54:34 +00:00
///////////////////////////////////////////////////////////////
//
// Stuff added by JonoF. These should get put into their own
// headers and included by that which needs them.
//
///////////////////////////////////////////////////////////////
2021-11-01 13:31:24 +00:00
int PickJumpMaxSpeed ( DSWActor * , short max_speed ) ; // ripper.c
2021-11-02 17:56:26 +00:00
int DoRipperRipHeart ( DSWActor * ) ; // ripper.c
2021-11-02 17:58:49 +00:00
int DoRipper2RipHeart ( DSWActor * ) ; // ripper2.c
2021-10-31 19:44:39 +00:00
DSWActor * BunnyHatch2 ( DSWActor * ) ; // bunny.c
2015-05-19 21:54:34 +00:00
void TerminateLevel ( void ) ; // game.c
void DrawMenuLevelScreen ( void ) ; // game.c
2015-05-19 21:58:29 +00:00
void DebugWriteString ( char * string ) ; // game.c
2015-05-19 21:54:34 +00:00
void getsyncstat ( void ) ; // sync.c
void SyncStatMessage ( void ) ; // sync.c
int COVERsetgamemode ( int mode , int xdim , int ydim , int bpp ) ; // draw.c
2015-05-19 21:58:29 +00:00
void ScreenCaptureKeys ( void ) ; // draw.c
2015-05-19 21:54:34 +00:00
void SetupMirrorTiles ( void ) ; // rooms.c
2021-11-26 15:44:45 +00:00
bool FAF_Sector ( sectortype * sect ) ; // rooms.c
2022-10-03 21:31:02 +00:00
double GetZadjustment ( sectortype * sect , short hitag ) ; // rooms.c
2015-05-19 21:54:34 +00:00
void InitSetup ( void ) ; // setup.c
2022-12-08 17:26:09 +00:00
void LoadKVXFromScript ( TilesetBuildInfo & info , const char * filename ) ; // scrip2.c
2019-04-08 06:25:22 +00:00
void LoadCustomInfoFromScript ( const char * filename ) ; // scrip2.c
2015-05-19 21:54:34 +00:00
2023-10-02 19:03:59 +00:00
int PlayerInitChemBomb ( DSWPlayer * pp ) ; // jweapon.c
int PlayerInitFlashBomb ( DSWPlayer * pp ) ; // jweapon.c
int PlayerInitCaltrops ( DSWPlayer * pp ) ; // jweapon.c
2021-11-01 10:50:50 +00:00
int InitPhosphorus ( DSWActor * ) ; // jweapon.c
2021-11-01 08:23:52 +00:00
void SpawnFloorSplash ( DSWActor * ) ; // jweapon.c
2015-05-19 21:54:34 +00:00
int SaveGame ( short save_num ) ; // save.c
int LoadGame ( short save_num ) ; // save.c
int LoadGameFullHeader ( short save_num , char * descr , short * level , short * skill ) ; // save,c
void LoadGameDescr ( short save_num , char * descr ) ; // save.c
2021-11-02 18:41:37 +00:00
void SetRotatorActive ( DSWActor * actor ) ; // rotator.c
2015-05-19 21:54:34 +00:00
2020-09-09 18:32:24 +00:00
bool VatorSwitch ( short match , short setting ) ; // vator.c
2022-09-06 16:45:45 +00:00
void MoveSpritesWithSector ( sectortype * sect , double z_amt , bool type ) ; // vator.c
2021-11-02 23:45:43 +00:00
void SetVatorActive ( DSWActor * ) ; // vator.c
2015-05-19 21:54:34 +00:00
2021-11-02 23:09:14 +00:00
void DoSpikeMatch ( short match ) ; // spike.c
void SpikeAlign ( DSWActor * ) ; // spike.c
2015-05-19 21:54:34 +00:00
short DoSectorObjectSetScale ( short match ) ; // morph.c
short DoSOevent ( short match , short state ) ; // morph.c
2022-08-21 14:12:38 +00:00
void SOBJ_AlignCeilingToPoint ( SECTOR_OBJECT * sop , const DVector3 & pos ) ; // morph.c
void SOBJ_AlignFloorToPoint ( SECTOR_OBJECT * sop , const DVector3 & pos ) ; // morph.c
2021-12-31 14:50:44 +00:00
void ScaleSectorObject ( SECTOR_OBJECT * sop ) ; // morph.c
void MorphTornado ( SECTOR_OBJECT * sop ) ; // morph.c
void MorphFloor ( SECTOR_OBJECT * sop ) ; // morph.c
2022-09-04 22:35:11 +00:00
DVector2 ScaleRandomPoint ( SECTOR_OBJECT * sop , int k , DAngle ang , const DVector2 & pos ) ; // morph.c
2015-05-19 21:54:34 +00:00
2021-11-21 20:50:26 +00:00
void CopySectorMatch ( int match ) ; // copysect.c
2015-05-19 21:54:34 +00:00
int DoWallMoveMatch ( short match ) ; // wallmove.c
2021-11-02 23:50:01 +00:00
int DoWallMove ( DSWActor * sp ) ; // wallmove.c
2021-12-24 19:03:38 +00:00
bool CanSeeWallMove ( DSWActor * wp , int match ) ; // wallmove.c
2015-05-19 21:54:34 +00:00
2021-11-25 18:25:05 +00:00
void DoSpikeOperate ( sectortype * sect ) ; // spike.c
2021-11-02 23:09:14 +00:00
void SetSpikeActive ( DSWActor * ) ; // spike.c
2015-05-19 21:54:34 +00:00
2021-12-04 21:04:16 +00:00
DSWActor * insertActor ( sectortype * sect , int statnum ) ;
2015-05-19 21:54:34 +00:00
void AudioUpdate ( void ) ; // stupid
2019-10-09 16:09:05 +00:00
2019-11-30 06:10:26 +00:00
extern short LastSaveNum ;
void LoadSaveMsg ( const char * msg ) ;
2020-09-02 16:59:56 +00:00
void UpdateStatusBar ( ) ;
2020-08-16 21:21:24 +00:00
int32_t registerosdcommands ( void ) ;
2020-08-13 15:54:17 +00:00
2020-08-15 13:29:47 +00:00
extern int OrigCommPlayers ;
2021-11-16 17:53:40 +00:00
extern uint8_t PlayerGravity ;
2020-08-16 16:18:56 +00:00
extern short wait_active_check_offset ;
//extern short Zombies;
2022-10-03 21:31:02 +00:00
extern double PlaxCeilGlobZadjust , PlaxFloorGlobZadjust ;
2020-09-09 18:32:24 +00:00
extern bool left_foot ;
2021-05-02 15:35:25 +00:00
extern bool bosswasseen [ 3 ] ;
2021-11-02 23:19:48 +00:00
extern DSWActor * BossSpriteNum [ 3 ] ;
2020-08-16 16:18:56 +00:00
extern int ChopTics ;
2021-11-28 07:40:41 +00:00
extern int Bunny_Count ;
2023-05-29 19:31:28 +00:00
int HitBreakSprite ( DSWActor * breakActor , int type ) ;
2020-08-16 16:18:56 +00:00
2021-12-24 19:47:32 +00:00
END_SW_NS
2021-11-03 23:03:08 +00:00
2021-12-24 19:47:32 +00:00
# include "swactor.h"
BEGIN_SW_NS
2021-11-03 23:03:08 +00:00
2023-10-02 19:03:59 +00:00
class DSWPlayer final : public DCorePlayer
2022-11-16 06:28:57 +00:00
{
2023-10-02 19:03:59 +00:00
DECLARE_CLASS ( DSWPlayer , DCorePlayer )
HAS_OBJECT_POINTERS
DSWPlayer ( ) = default ;
public :
2023-10-03 10:27:15 +00:00
void Clear ( ) ;
DSWPlayer ( uint8_t p ) ;
DSWPlayer & operator = ( DSWPlayer & ) = delete ;
DSWPlayer ( DSWPlayer & ) = delete ;
void OnDestroy ( ) override ;
2023-10-02 19:38:58 +00:00
void Serialize ( FSerializer & arc ) override ;
2022-11-16 06:28:57 +00:00
TObjPtr < DSWActor * > lowActor , highActor ;
TObjPtr < DSWActor * > remoteActor ;
TObjPtr < DSWActor * > PlayerUnderActor ;
TObjPtr < DSWActor * > KillerActor ; //who killed me
TObjPtr < DSWActor * > HitBy ; // Sprite num of whatever player was last hit by
TObjPtr < DSWActor * > last_camera_act ;
// holds last valid move position
DVector3 lv ;
REMOTE_CONTROL remote ;
SECTOR_OBJECT * sop_remote ;
SECTOR_OBJECT * sop ; // will either be sop_remote or sop_control
double hiz , loz ;
double opbob_amt , pbob_amt ;
int jump_count , jump_speed ; // jumping
double z_speed ;
int climb_ndx ;
double p_ceiling_dist , p_floor_dist ;
sectortype * hi_sectp , * lo_sectp ;
double circle_camera_dist ;
DVector3 si ; // save player interp position for PlayerSprite
DVector2 vect , ovect , slide_vect ; // these need floatification, but must be done together. vect is in 14.18 format!
int friction ;
int16_t slide_ang ; // todo: floatify
int slide_dec ;
float drive_avel ;
DAngle circle_camera_ang ;
int16_t camera_check_time_delay ;
sectortype
* cursector ,
* lastcursector ,
* lv_sector ;
void setcursector ( sectortype * s ) { cursector = s ; }
bool insector ( ) const { return cursector ! = nullptr ; }
// variables that do not fit into sprite structure
double recoil_amt ;
int16_t recoil_speed ;
int16_t recoil_ndx ;
DAngle recoil_ohorizoff , recoil_horizoff ;
DVector3 Revolve ;
DAngle RevolveDeltaAng ;
DAngle RevolveAng ;
sectortype * LadderSector ;
DVector2 LadderPosition ; // ladder x and y
int16_t JumpDuration ;
int16_t WadeDepth ;
int16_t bob_ndx ;
int16_t bcnt ; // bob count
double bob_z , obob_z ;
// must start out as 0
int playerreadyflag ;
PLAYER_ACTION_FUNCp DoPlayerAction ;
int Flags , Flags2 ;
ESyncBits KeyPressBits ;
SECTOR_OBJECT * sop_control ; // sector object pointer
SECTOR_OBJECT * sop_riding ; // sector object pointer
2023-10-03 10:27:15 +00:00
DPanelSprite * PanelSpriteList ; // this is just a sentinel object that does not do anything. No read barrier here as this is strictly owned by the player.
2022-11-16 06:28:57 +00:00
2023-10-03 10:27:15 +00:00
DPanelSprite * GetPanelSpriteList ( )
2022-11-16 06:28:57 +00:00
{
2023-10-03 10:27:15 +00:00
return PanelSpriteList ;
2022-11-16 06:28:57 +00:00
}
// Key stuff
uint8_t HasKey [ 8 ] ;
// Weapon stuff
int16_t SwordAng ;
int WpnGotOnceFlags ; // for no respawn mode where weapons are allowed grabbed only once
int WpnFlags ;
int16_t WpnAmmo [ MAX_WEAPONS ] ;
int16_t WpnNum ;
2023-10-03 10:27:15 +00:00
TObjPtr < DPanelSprite * > CurWpn ;
TObjPtr < DPanelSprite * > Wpn [ MAX_WEAPONS ] ;
TObjPtr < DPanelSprite * > Chops ;
2022-11-16 06:28:57 +00:00
uint8_t WpnRocketType ; // rocket type
uint8_t WpnRocketHeat ; // 5 to 0 range
uint8_t WpnRocketNuke ; // 1, you have it, or you don't
uint8_t WpnFlameType ; // Guardian weapons fire
uint8_t WpnFirstType ; // First weapon type - Sword/Shuriken
uint8_t WeaponType ; // for weapons with secondary functions
int16_t FirePause ; // for sector objects - limits rapid firing
//
// Inventory Vars
//
int16_t InventoryNum ;
int16_t InventoryBarTics ;
int16_t InventoryTics [ MAX_INVENTORY ] ;
int16_t InventoryPercent [ MAX_INVENTORY ] ;
int8_t InventoryAmount [ MAX_INVENTORY ] ;
bool InventoryActive [ MAX_INVENTORY ] ;
int16_t DiveTics ;
int16_t DiveDamageTics ;
// Death stuff
uint16_t DeathType ;
int16_t KilledPlayer [ MAX_SW_PLAYERS_REG ] ;
// Health
int16_t Armor ;
int16_t MaxHealth ;
char PlayerName [ 32 ] ;
uint8_t UziShellLeftAlt ;
uint8_t UziShellRightAlt ;
uint8_t TeamColor ; // used in team play and also used in regular mulit-play for show
// palette fading up and down for player hit and get items
int16_t FadeTics ; // Tics between each fade cycle
int16_t FadeAmt ; // Current intensity of fade
bool NightVision ; // Is player's night vision active?
uint8_t StartColor ; // Darkest color in color range being used
//short electro[64];
bool IsAI ; // Is this and AI character?
int16_t fta , ftq ; // First time active and first time quote, for talking in multiplayer games
int16_t NumFootPrints ; // Number of foot prints left to lay down
uint8_t WpnUziType ; // Toggle between single or double uzi's if you own 2.
uint8_t WpnShotgunType ; // Shotgun has normal or fully automatic fire
uint8_t WpnShotgunAuto ; // 50-0 automatic shotgun rounds
uint8_t WpnShotgunLastShell ; // Number of last shell fired
uint8_t WpnRailType ; // Normal Rail Gun or EMP Burst Mode
bool Bloody ; // Is player gooey from the slaughter?
bool InitingNuke ;
bool TestNukeInit ;
bool NukeInitialized ; // Nuke already has counted down
int16_t FistAng ; // KungFu attack angle
uint8_t WpnKungFuMove ; // KungFu special moves
int16_t Reverb ; // Player's current reverb setting
int16_t Heads ; // Number of Accursed Heads orbiting player
int PlayerVersion ;
char cookieQuote [ 256 ] ; // Should be an FString but must be POD for now so that PLAYER remains POD.
int cookieTime ;
2022-11-22 07:30:41 +00:00
double height ;
2023-04-22 09:34:44 +00:00
double svel ;
2022-11-16 06:28:57 +00:00
uint8_t WpnReloadState ;
2023-10-02 02:27:16 +00:00
inline DSWActor * GetActor ( ) override
2023-09-30 10:51:34 +00:00
{
2023-10-02 02:27:16 +00:00
return static_cast < DSWActor * > ( actor ) ;
2023-09-30 10:51:34 +00:00
}
2022-12-23 07:54:58 +00:00
void posZset ( const double val )
2022-11-23 07:19:12 +00:00
{
2023-09-30 10:51:34 +00:00
GetActor ( ) - > spr . pos . Z = val - GetActor ( ) - > viewzoffset ;
2022-11-23 07:19:12 +00:00
}
2022-11-16 06:28:57 +00:00
} ;
2023-10-02 19:03:59 +00:00
inline DSWPlayer * getPlayer ( int index )
2023-10-02 03:55:55 +00:00
{
2023-10-02 19:03:59 +00:00
return static_cast < DSWPlayer * > ( PlayerArray [ index ] ) ;
2023-10-02 03:55:55 +00:00
}
2022-11-16 06:28:57 +00:00
2023-03-18 05:31:38 +00:00
struct GameInterface : public : : GameInterface
{
const char * Name ( ) override { return " ShadowWarrior " ; }
void app_init ( ) override ;
void LoadTextureInfo ( TilesetBuildInfo & info ) override ;
void SetupSpecialTextures ( TilesetBuildInfo & info ) override ;
void loadPalette ( ) override ;
void FreeLevelData ( ) override ;
bool GenerateSavePic ( ) override ;
void MenuSound ( EMenuSounds snd ) override ;
bool CanSave ( ) override ;
bool StartGame ( FNewGameStartup & gs ) override ;
FSavegameInfo GetSaveSig ( ) override ;
void SerializeGameState ( FSerializer & arc ) ;
void SetAmbience ( bool on ) override { if ( on ) StartAmbientSound ( ) ; else StopAmbientSound ( ) ; }
void UpdateSounds ( ) override ;
void ErrorCleanup ( ) override ;
void DrawBackground ( void ) override ;
2023-10-02 05:05:16 +00:00
void Ticker ( void ) override ;
2023-03-18 05:31:38 +00:00
void Render ( ) override ;
//void DrawWeapons() override;
void Startup ( ) override ;
const char * CheckCheatMode ( ) override ;
const char * GenericCheat ( int player , int cheat ) override ;
void LevelCompleted ( MapRecord * map , int skill ) override ;
void NextLevel ( MapRecord * map , int skill ) override ;
void NewGame ( MapRecord * map , int skill , bool ) override ;
bool DrawAutomapPlayer ( const DVector2 & mxy , const DVector2 & cpos , const DAngle cang , const DVector2 & xydim , const double czoom , double const interpfrac ) override ;
void ToggleThirdPerson ( ) override ;
void SwitchCoopView ( ) override ;
void processSprites ( tspriteArray & tsprites , const DVector3 & view , DAngle viewang , double smoothRatio ) override ;
void UpdateCameras ( double smoothratio ) override ;
void EnterPortal ( DCoreActor * viewer , int type ) override ;
void LeavePortal ( DCoreActor * viewer , int type ) override ;
void ExitFromMenu ( ) override ;
int GetCurrentSkill ( ) override ;
void StartSoundEngine ( ) override ;
2023-09-24 03:40:15 +00:00
unsigned getCrouchState ( ) override ;
2023-10-04 05:08:03 +00:00
void doPlayerMovement ( ) override
2023-03-19 00:13:48 +00:00
{
2023-10-02 03:55:55 +00:00
const auto pp = getPlayer ( myconnectindex ) ;
2023-10-04 05:08:03 +00:00
gameInput . processMovement ( ! pp - > sop_control ? 1 : ( 3. / 1.40625 ) , ! pp - > sop ) ;
2023-03-19 00:13:48 +00:00
}
2023-03-18 05:31:38 +00:00
} ;
2021-12-24 19:47:32 +00:00
// OVER and UNDER water macros
2021-11-24 22:50:02 +00:00
inline bool SectorIsDiveArea ( sectortype * sect )
2021-11-03 23:03:08 +00:00
{
2022-05-30 10:51:24 +00:00
return sect - > extra & SECTFX_DIVE_AREA ;
2021-11-03 23:03:08 +00:00
}
2021-11-24 21:55:31 +00:00
inline bool SectorIsUnderwaterArea ( sectortype * sect )
2021-11-03 23:03:08 +00:00
{
2023-04-24 11:00:27 +00:00
return sect & & sect - > extra & ( SECTFX_UNDERWATER | SECTFX_UNDERWATER2 ) ;
2021-11-03 23:03:08 +00:00
}
2023-10-02 19:03:59 +00:00
inline bool PlayerFacingRange ( DSWPlayer * pp , DSWActor * a , DAngle range )
2021-12-24 17:09:40 +00:00
{
2023-09-30 10:51:34 +00:00
return absangle ( ( a - > spr . pos . XY ( ) - pp - > GetActor ( ) - > spr . pos . XY ( ) ) . Angle ( ) , pp - > GetActor ( ) - > spr . Angles . Yaw ) < range ;
2021-12-24 17:09:40 +00:00
}
2022-09-08 15:59:02 +00:00
inline bool FacingRange ( DSWActor * a1 , DSWActor * a2 , DAngle range )
2021-12-24 18:10:11 +00:00
{
2022-11-25 12:13:50 +00:00
return absangle ( ( a1 - > spr . pos - a2 - > spr . pos ) . Angle ( ) , a2 - > spr . Angles . Yaw ) < range ;
2021-12-24 18:10:11 +00:00
}
2021-12-24 14:47:56 +00:00
inline void SET_BOOL1 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL1 ; }
inline void SET_BOOL2 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL2 ; }
inline void SET_BOOL3 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL3 ; }
inline void SET_BOOL4 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL4 ; }
inline void SET_BOOL5 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL5 ; }
inline void SET_BOOL6 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL6 ; }
inline void SET_BOOL7 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL7 ; }
inline void SET_BOOL8 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL8 ; }
inline void SET_BOOL9 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL9 ; }
inline void SET_BOOL10 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL10 ; }
inline void SET_BOOL11 ( DSWActor * sp ) { sp - > spr . extra | = SPRX_BOOL11 ; }
inline void RESET_BOOL1 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL1 ; }
inline void RESET_BOOL2 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL2 ; }
inline void RESET_BOOL3 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL3 ; }
inline void RESET_BOOL4 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL4 ; }
inline void RESET_BOOL5 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL5 ; }
inline void RESET_BOOL6 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL6 ; }
inline void RESET_BOOL7 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL7 ; }
inline void RESET_BOOL8 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL8 ; }
inline void RESET_BOOL9 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL9 ; }
inline void RESET_BOOL10 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL10 ; }
inline void RESET_BOOL11 ( DSWActor * sp ) { sp - > spr . extra & = ~ SPRX_BOOL11 ; }
inline int TEST_BOOL1 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL1 ; }
inline int TEST_BOOL2 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL2 ; }
inline int TEST_BOOL3 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL3 ; }
inline int TEST_BOOL4 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL4 ; }
inline int TEST_BOOL5 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL5 ; }
inline int TEST_BOOL6 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL6 ; }
inline int TEST_BOOL7 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL7 ; }
inline int TEST_BOOL8 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL8 ; }
inline int TEST_BOOL9 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL9 ; }
inline int TEST_BOOL10 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL10 ; }
inline int TEST_BOOL11 ( DSWActor * sp ) { return sp - > spr . extra & SPRX_BOOL11 ; }
2021-12-24 12:42:50 +00:00
// Defines for reading in ST1 sprite tagging
2021-12-24 13:12:21 +00:00
inline int16_t SP_TAG1 ( DSWActor * actor ) { return actor - > spr . hitag ; }
inline int16_t & SP_TAG2 ( DSWActor * actor ) { return actor - > spr . lotag ; }
2021-12-24 14:19:05 +00:00
inline uint8_t & SP_TAG3 ( DSWActor * actor ) { return actor - > spr . clipdist ; }
2022-08-16 21:29:54 +00:00
inline int16_t & SP_TAG4 ( DSWActor * actor ) { return actor - > spr . intangle ; } // this may not be transitioned to a real angular type
2022-09-01 14:36:07 +00:00
inline int16_t & SP_TAG5 ( DSWActor * actor ) { return actor - > spr . xint ; }
inline int16_t & SP_TAG6 ( DSWActor * actor ) { return actor - > spr . yint ; }
2022-08-31 22:00:36 +00:00
inline uint8_t & SP_TAG7 ( DSWActor * actor ) { return MSB_VAR ( actor - > spr . inittype ) ; }
inline uint8_t & SP_TAG8 ( DSWActor * actor ) { return LSB_VAR ( actor - > spr . inittype ) ; }
2022-05-23 22:30:41 +00:00
inline uint8_t & SP_TAG9 ( DSWActor * actor ) { return MSB_VAR ( actor - > spr . intowner ) ; }
inline uint8_t & SP_TAG10 ( DSWActor * actor ) { return LSB_VAR ( actor - > spr . intowner ) ; }
2021-12-24 14:19:05 +00:00
inline int8_t & SP_TAG11 ( DSWActor * actor ) { return actor - > spr . shade ; }
inline uint8_t & SP_TAG12 ( DSWActor * actor ) { return actor - > spr . pal ; }
2021-12-28 10:32:25 +00:00
inline int16_t SP_TAG13 ( DSWActor * actor ) { return int16_t ( uint8_t ( actor - > spr . xoffset ) + ( actor - > spr . yoffset < < 8 ) ) ; }
2021-12-24 14:19:05 +00:00
inline void SET_SP_TAG13 ( DSWActor * actor , int val ) { actor - > spr . xoffset = uint8_t ( val ) ; actor - > spr . yoffset = uint8_t ( val > > 8 ) ; }
2021-12-24 12:42:50 +00:00
2021-12-23 22:31:28 +00:00
// actual Z for TOS and BOS - handles both WYSIWYG and old style
2022-08-21 07:49:25 +00:00
inline double ActorZOfTop ( DSWActor * actor )
{
2022-09-08 14:30:43 +00:00
return GetSpriteZOfTop ( & actor - > spr ) ;
2022-08-21 07:49:25 +00:00
}
2022-08-21 14:57:51 +00:00
inline DVector3 ActorVectOfTop ( DSWActor * actor )
{
return DVector3 ( actor - > spr . pos . XY ( ) , ActorZOfTop ( actor ) ) ;
}
2022-08-21 07:49:25 +00:00
inline double ActorZOfBottom ( DSWActor * actor )
{
2022-09-08 14:30:43 +00:00
return GetSpriteZOfBottom ( & actor - > spr ) ;
2022-08-21 07:49:25 +00:00
}
2022-10-10 22:21:49 +00:00
inline DVector3 ActorVectOfBottom ( DSWActor * actor )
{
return DVector3 ( actor - > spr . pos . XY ( ) , ActorZOfBottom ( actor ) ) ;
}
2022-08-16 22:10:55 +00:00
inline double ActorZOfMiddle ( DSWActor * actor )
{
2022-08-31 21:10:50 +00:00
return ( ActorZOfTop ( actor ) + ActorZOfBottom ( actor ) ) * 0.5 ;
2022-08-16 22:10:55 +00:00
}
2022-08-21 15:21:31 +00:00
inline DVector3 ActorVectOfMiddle ( DSWActor * actor )
{
return DVector3 ( actor - > spr . pos . XY ( ) , ActorZOfMiddle ( actor ) ) ;
}
2022-08-21 08:00:08 +00:00
inline double ActorSizeZ ( DSWActor * actor )
2021-10-30 12:03:02 +00:00
{
2022-12-06 20:49:04 +00:00
auto tex = TexMan . GetGameTexture ( actor - > spr . spritetexture ( ) ) ;
return ( tex - > GetDisplayHeight ( ) * actor - > spr . scale . Y ) ;
2022-08-21 08:00:08 +00:00
}
inline double ActorUpperZ ( DSWActor * actor )
{
return ( ActorZOfTop ( actor ) + ( ActorSizeZ ( actor ) * 0.25 ) ) ;
2021-10-30 12:03:02 +00:00
}
2022-08-21 14:57:51 +00:00
inline DVector3 ActorUpperVect ( DSWActor * actor )
{
return DVector3 ( actor - > spr . pos . XY ( ) , ActorUpperZ ( actor ) ) ;
}
2022-08-20 08:34:51 +00:00
inline double ActorLowerZ ( DSWActor * actor )
{
2022-08-31 21:10:50 +00:00
return ( ActorZOfBottom ( actor ) - ( ActorSizeZ ( actor ) * 0.25 ) ) ;
2022-08-20 08:34:51 +00:00
}
2022-08-21 15:51:41 +00:00
inline DVector3 ActorLowerVect ( DSWActor * actor )
{
return DVector3 ( actor - > spr . pos . XY ( ) , ActorLowerZ ( actor ) ) ;
}
2021-12-24 15:56:50 +00:00
// Z size of top (TOS) and bottom (BOS) part of sprite
2022-08-31 21:10:50 +00:00
inline double ActorSizeToTop ( DSWActor * a )
2021-12-24 15:56:50 +00:00
{
2022-12-06 19:49:49 +00:00
auto tex = TexMan . GetGameTexture ( a - > spr . spritetexture ( ) ) ;
return ( ActorSizeZ ( a ) + tex - > GetDisplayTopOffset ( ) ) * 0.5 ;
2021-12-24 15:56:50 +00:00
}
2022-09-09 16:29:02 +00:00
inline void SetActorSizeX ( DSWActor * sp )
2021-12-23 18:47:42 +00:00
{
2022-12-06 19:49:49 +00:00
auto tex = TexMan . GetGameTexture ( sp - > spr . spritetexture ( ) ) ;
sp - > clipdist = tex - > GetDisplayWidth ( ) * sp - > spr . scale . X * 0.25 ;
2021-12-24 14:34:57 +00:00
}
2022-05-30 10:51:24 +00:00
inline bool Facing ( DSWActor * actor1 , DSWActor * actor2 )
2021-10-30 13:01:38 +00:00
{
2022-11-25 12:13:50 +00:00
return absangle ( ( actor1 - > spr . pos - actor2 - > spr . pos ) . Angle ( ) , actor2 - > spr . Angles . Yaw ) < DAngle90 ;
2021-10-30 13:01:38 +00:00
}
2021-10-30 12:03:02 +00:00
2021-12-24 18:40:23 +00:00
// Given a z height and sprite return the correct y repeat value
2022-08-31 16:43:02 +00:00
inline int GetRepeatFromHeight ( DSWActor * sp , double zh )
2021-12-24 18:40:23 +00:00
{
2022-12-06 19:49:49 +00:00
auto tex = TexMan . GetGameTexture ( sp - > spr . spritetexture ( ) ) ;
return int ( zh * 64 ) / int ( tex - > GetDisplayHeight ( ) ) ;
2021-12-24 18:40:23 +00:00
}
2021-12-24 17:39:18 +00:00
inline bool SpriteInDiveArea ( DSWActor * a )
{
2022-05-30 10:51:24 +00:00
return a - > sector ( ) - > extra & SECTFX_DIVE_AREA ;
2021-12-24 17:39:18 +00:00
}
inline bool SpriteInUnderwaterArea ( DSWActor * a )
{
2022-05-30 10:51:24 +00:00
return a - > sector ( ) - > extra & ( SECTFX_UNDERWATER | SECTFX_UNDERWATER2 ) ;
2021-12-24 17:39:18 +00:00
}
2021-11-02 17:37:57 +00:00
// just determine if the player is moving
2023-10-02 19:03:59 +00:00
inline bool PLAYER_MOVING ( DSWPlayer * pp )
2021-11-02 17:37:57 +00:00
{
2022-10-12 22:55:40 +00:00
return ! pp - > vect . isZero ( ) ;
2021-11-02 17:37:57 +00:00
}
2021-12-31 21:36:56 +00:00
inline void PlaySound ( int num , DSWActor * actor , int flags , int channel = 8 , EChanFlags sndflags = CHANF_NONE )
2021-11-02 22:08:59 +00:00
{
2023-05-26 21:27:46 +00:00
_PlaySound ( soundEngine - > FindSoundByResID ( num ) , actor , nullptr , nullptr , flags , channel , sndflags ) ;
2021-11-02 22:08:59 +00:00
}
2021-12-31 14:47:10 +00:00
struct ANIM
2021-11-02 17:39:27 +00:00
{
int animtype , animindex ;
2022-02-02 23:12:15 +00:00
double goal ;
2022-08-21 14:42:38 +00:00
double vel ;
double vel_adj ;
2021-12-05 23:35:12 +00:00
TObjPtr < DSWActor * > animactor ;
2021-11-02 17:39:27 +00:00
ANIM_CALLBACKp callback ;
2021-12-31 14:50:44 +00:00
SECTOR_OBJECT * callbackdata ; // only gets used in one place for this so having a proper type makes serialization easier.
2021-11-02 17:39:27 +00:00
2022-02-02 23:12:15 +00:00
double getValue ( )
2021-11-02 17:39:27 +00:00
{
switch ( animtype )
{
case ANIM_Floorz :
2022-08-21 14:42:38 +00:00
return sector [ animindex ] . floorz ;
2021-11-02 17:39:27 +00:00
case ANIM_SopZ :
2022-08-21 14:42:38 +00:00
return SectorObject [ animindex ] . pmid . Z ;
2021-11-02 17:39:27 +00:00
case ANIM_Spritez :
2022-02-02 23:12:15 +00:00
if ( animactor = = nullptr ) return 0 ;
2022-08-21 14:42:38 +00:00
return animactor - > spr . pos . Z ;
2021-11-02 17:39:27 +00:00
case ANIM_Userz :
2022-02-02 23:12:15 +00:00
if ( animactor = = nullptr ) return 0 ;
2022-08-21 14:42:38 +00:00
return animactor - > user . pos . Z ;
2021-11-02 17:39:27 +00:00
case ANIM_SUdepth :
2021-11-20 22:20:43 +00:00
return sector [ animindex ] . depth_fixed ;
2021-11-02 17:39:27 +00:00
default :
2022-02-02 23:12:15 +00:00
return 0 ;
2021-11-02 17:39:27 +00:00
}
}
2022-02-02 23:12:15 +00:00
void setValue ( double value )
{
switch ( animtype )
{
case ANIM_Floorz :
2022-08-21 14:42:38 +00:00
sector [ animindex ] . setfloorz ( value ) ;
2022-02-02 23:12:15 +00:00
break ;
case ANIM_SopZ :
2022-08-21 14:42:38 +00:00
SectorObject [ animindex ] . pmid . Z = value ;
break ;
2022-02-02 23:12:15 +00:00
case ANIM_Spritez :
if ( animactor = = nullptr ) return ;
2022-08-21 14:42:38 +00:00
animactor - > spr . pos . Z = value ;
2023-10-04 07:11:00 +00:00
break ;
2022-02-02 23:12:15 +00:00
case ANIM_Userz :
if ( animactor = = nullptr ) return ;
2022-08-21 14:42:38 +00:00
animactor - > user . pos . Z = value ;
2022-02-02 23:12:15 +00:00
break ;
case ANIM_SUdepth :
2022-10-12 17:00:29 +00:00
sector [ animindex ] . depth_fixed = ( int ) value ;
2022-02-02 23:12:15 +00:00
default :
return ;
}
}
2021-11-02 17:39:27 +00:00
} ;
extern ANIM Anim [ MAXANIM ] ;
extern short AnimCnt ;
2021-12-25 20:08:03 +00:00
struct USERSAVE
{
int16_t Health ;
int8_t WeaponNum ;
int8_t LastWeaponNum ;
void CopyFromUser ( DSWActor * u )
{
Health = u - > user . Health ;
WeaponNum = u - > user . WeaponNum ;
LastWeaponNum = u - > user . LastWeaponNum ;
}
void CopyToUser ( DSWActor * u )
{
u - > user . Health = Health ;
u - > user . WeaponNum = WeaponNum ;
u - > user . LastWeaponNum = LastWeaponNum ;
}
} ;
// save player info when moving to a new level (shortened to only cover the fields that actually are copied back.)
extern USERSAVE puser [ MAX_SW_PLAYERS_REG ] ;
2022-08-21 12:08:03 +00:00
constexpr double JUMP_FACTOR = 1. / 256. ;
2021-11-02 17:37:57 +00:00
2023-05-24 15:27:14 +00:00
// declare all used state animators here for now.
DEF_ANIMATOR ( DoBunnyMove )
DEF_ANIMATOR ( DoBunnyGrowUp )
DEF_ANIMATOR ( DoBunnyEat )
DEF_ANIMATOR ( DoBunnyScrew )
DEF_ANIMATOR ( NullBunny )
DEF_ANIMATOR ( InitBunnySlash )
DEF_ANIMATOR ( DoBunnyStandKill )
DEF_ANIMATOR ( DoBunnyPain )
DEF_ANIMATOR ( DoBunnyMoveJump )
DEF_ANIMATOR ( DoBunnyBeginJumpAttack )
DEF_ANIMATOR ( BunnySpew )
DEF_ANIMATOR ( DoCoolgMove )
DEF_ANIMATOR ( NullCoolg )
DEF_ANIMATOR ( InitCoolgBash )
DEF_ANIMATOR ( InitCoolgFire )
DEF_ANIMATOR ( DoCoolgPain )
DEF_ANIMATOR ( DoCoolgDeath )
DEF_ANIMATOR ( DoCoolgBirth )
DEF_ANIMATOR ( DoCoolieMove )
DEF_ANIMATOR ( CooliePain )
DEF_ANIMATOR ( NullCoolie )
DEF_ANIMATOR ( SpawnCoolieExp )
DEF_ANIMATOR ( DoCoolieWaitBirth )
DEF_ANIMATOR ( SpawnCoolg )
DEF_ANIMATOR ( DoEelMove )
DEF_ANIMATOR ( InitEelFire )
DEF_ANIMATOR ( NullEel )
DEF_ANIMATOR ( DoEelDeath )
DEF_ANIMATOR ( NullGirlNinja )
DEF_ANIMATOR ( DoGirlNinjaMove )
DEF_ANIMATOR ( DoGirlNinjaPain )
DEF_ANIMATOR ( DoGirlNinjaSpecial )
DEF_ANIMATOR ( InitEnemyMine )
DEF_ANIMATOR ( InitEnemyCrossbow )
DEF_ANIMATOR ( DoGoroMove )
DEF_ANIMATOR ( NullGoro )
DEF_ANIMATOR ( InitGoroChop )
DEF_ANIMATOR ( DoGoroPain )
DEF_ANIMATOR ( InitEnemyFireball )
DEF_ANIMATOR ( DoHornetMove )
DEF_ANIMATOR ( DoHornetDeath )
DEF_ANIMATOR ( BloodSprayFall )
DEF_ANIMATOR ( DoSuicide )
DEF_ANIMATOR ( DoRadiationCloud )
DEF_ANIMATOR ( DoChemBomb )
DEF_ANIMATOR ( DoCaltrops )
DEF_ANIMATOR ( DoCaltropsStick )
DEF_ANIMATOR ( DoCarryFlag )
DEF_ANIMATOR ( DoCarryFlagNoDet )
DEF_ANIMATOR ( DoFlag )
DEF_ANIMATOR ( DoPhosphorus )
DEF_ANIMATOR ( DoBloodSpray )
DEF_ANIMATOR ( DoWallBloodDrip )
DEF_ANIMATOR ( DoLavaMove )
DEF_ANIMATOR ( NullLava )
DEF_ANIMATOR ( InitLavaThrow )
DEF_ANIMATOR ( InitLavaFlame )
DEF_ANIMATOR ( DoActorDeathMove )
DEF_ANIMATOR ( QueueFloorBlood )
DEF_ANIMATOR ( DoActorDebris )
DEF_ANIMATOR ( InitActorDecide )
DEF_ANIMATOR ( DoToiletGirl )
DEF_ANIMATOR ( ToiletGirlPain )
DEF_ANIMATOR ( ToiletGirlUzi )
DEF_ANIMATOR ( InitEnemyUzi )
DEF_ANIMATOR ( DoWashGirl )
DEF_ANIMATOR ( WashGirlUzi )
DEF_ANIMATOR ( DoTrashCan )
DEF_ANIMATOR ( TrashCanPain )
DEF_ANIMATOR ( PachinkoLightOperate )
DEF_ANIMATOR ( Pachinko1Operate )
DEF_ANIMATOR ( PachinkoCheckWin )
DEF_ANIMATOR ( DoCarGirl )
DEF_ANIMATOR ( CarGirlPain )
DEF_ANIMATOR ( CarGirlUzi )
DEF_ANIMATOR ( DoMechanicGirl )
DEF_ANIMATOR ( MechanicGirlPain )
DEF_ANIMATOR ( MechanicGirlDrill )
DEF_ANIMATOR ( DoSailorGirl )
DEF_ANIMATOR ( SailorGirlPain )
DEF_ANIMATOR ( SailorGirlThrow )
DEF_ANIMATOR ( DoPruneGirl )
DEF_ANIMATOR ( PruneGirlPain )
DEF_ANIMATOR ( WashGirlPain )
DEF_ANIMATOR ( DoNinjaMove )
DEF_ANIMATOR ( NullNinja )
DEF_ANIMATOR ( DoNinjaCeiling )
DEF_ANIMATOR ( DoNinjaPain )
DEF_ANIMATOR ( InitEnemyStar )
DEF_ANIMATOR ( InitEnemyMirv )
DEF_ANIMATOR ( InitEnemyNapalm )
DEF_ANIMATOR ( InitEnemyRocket )
DEF_ANIMATOR ( InitSpriteGrenade )
DEF_ANIMATOR ( InitFlashBomb )
DEF_ANIMATOR ( CheckFire )
DEF_ANIMATOR ( DoNinjaSpecial )
DEF_ANIMATOR ( DoNinjaGrabThroat )
DEF_ANIMATOR ( DoNinjaHariKari )
DEF_ANIMATOR ( DoRipperMove )
DEF_ANIMATOR ( NullRipper )
DEF_ANIMATOR ( InitRipperSlash )
DEF_ANIMATOR ( DoRipperStandHeart )
DEF_ANIMATOR ( DoRipperHang )
DEF_ANIMATOR ( DoRipperPain )
DEF_ANIMATOR ( DoRipperMoveJump )
DEF_ANIMATOR ( DoRipperBeginJumpAttack )
DEF_ANIMATOR ( DoRipperHangJF )
DEF_ANIMATOR ( DoRipper2Move )
DEF_ANIMATOR ( NullRipper2 )
DEF_ANIMATOR ( DoRipper2Hang )
DEF_ANIMATOR ( DoRipper2Pain )
DEF_ANIMATOR ( DoRipper2MoveJump )
DEF_ANIMATOR ( DoRipper2BeginJumpAttack )
DEF_ANIMATOR ( DoRipper2HangJF )
DEF_ANIMATOR ( DoRipper2StandHeart )
DEF_ANIMATOR ( ChestRipper2 )
DEF_ANIMATOR ( DoSerpMove )
DEF_ANIMATOR ( NullSerp )
DEF_ANIMATOR ( InitSerpSlash )
DEF_ANIMATOR ( InitSerpRing )
DEF_ANIMATOR ( InitSerpSpell )
DEF_ANIMATOR ( InitSerpMonstSpell )
DEF_ANIMATOR ( DoDeathSpecial )
DEF_ANIMATOR ( DoSkelMove )
DEF_ANIMATOR ( NullSkel )
DEF_ANIMATOR ( InitSkelSlash )
DEF_ANIMATOR ( InitSkelSpell )
DEF_ANIMATOR ( DoSkelPain )
DEF_ANIMATOR ( DoSkelInitTeleport )
DEF_ANIMATOR ( DoSkelTeleport )
DEF_ANIMATOR ( DoSkelTermTeleport )
DEF_ANIMATOR ( DoSkullWait )
DEF_ANIMATOR ( DoSerpRing )
DEF_ANIMATOR ( DoSkullJump )
DEF_ANIMATOR ( DoDamageTest )
DEF_ANIMATOR ( DoSkullSpawnShrap )
DEF_ANIMATOR ( DoBettyWait )
DEF_ANIMATOR ( DoBettyJump )
DEF_ANIMATOR ( DoSumoMove )
DEF_ANIMATOR ( NullSumo )
DEF_ANIMATOR ( InitSumoFart )
DEF_ANIMATOR ( InitSumoClap )
DEF_ANIMATOR ( InitSumoStomp )
DEF_ANIMATOR ( DoSumoDeathMelt )
DEF_ANIMATOR ( DoDefaultStat )
DEF_ANIMATOR ( DoPuff )
DEF_ANIMATOR ( DoRailPuff )
DEF_ANIMATOR ( DoTracer )
DEF_ANIMATOR ( DoEMP )
DEF_ANIMATOR ( DoEMPBurst )
DEF_ANIMATOR ( DoFastShrapJumpFall )
DEF_ANIMATOR ( DoTankShell )
DEF_ANIMATOR ( DoVehicleSmoke )
DEF_ANIMATOR ( DoWaterSmoke )
DEF_ANIMATOR ( DoUziSmoke )
DEF_ANIMATOR ( DoShotgunSmoke )
DEF_ANIMATOR ( DoUziBullet )
DEF_ANIMATOR ( DoBubble )
DEF_ANIMATOR ( DoCrossBolt )
DEF_ANIMATOR ( DoStar )
DEF_ANIMATOR ( DoLavaBoulder )
DEF_ANIMATOR ( DoShrapDamage )
DEF_ANIMATOR ( DoVulcanBoulder )
DEF_ANIMATOR ( DoGrenade )
DEF_ANIMATOR ( DoMineStuck )
DEF_ANIMATOR ( DoMine )
DEF_ANIMATOR ( DoMineSpark )
DEF_ANIMATOR ( DoMeteor )
DEF_ANIMATOR ( DoMirvMissile )
DEF_ANIMATOR ( DoSerpMeteor )
DEF_ANIMATOR ( DoSpear )
DEF_ANIMATOR ( DoRocket )
DEF_ANIMATOR ( DoRail )
DEF_ANIMATOR ( DoLaser )
DEF_ANIMATOR ( DoMicro )
DEF_ANIMATOR ( DoMicroMini )
DEF_ANIMATOR ( DoBoltThinMan )
DEF_ANIMATOR ( DoBoltSeeker )
DEF_ANIMATOR ( DoBoltFatMan )
DEF_ANIMATOR ( DoBoltShrapnel )
DEF_ANIMATOR ( DoCoolgFire )
DEF_ANIMATOR ( DoCoolgDrip )
DEF_ANIMATOR ( DoPlasma )
DEF_ANIMATOR ( DoShrapJumpFall )
DEF_ANIMATOR ( DoTracerShrap )
DEF_ANIMATOR ( DoVomitSplash )
DEF_ANIMATOR ( DoVomit )
DEF_ANIMATOR ( DoMirv )
DEF_ANIMATOR ( DoBloodWorm )
DEF_ANIMATOR ( DoNapalm )
DEF_ANIMATOR ( DoRing )
DEF_ANIMATOR ( DoFireball )
DEF_ANIMATOR ( DoBreakFlames )
DEF_ANIMATOR ( DoFireballFlames )
DEF_ANIMATOR ( DoSectorExp )
DEF_ANIMATOR ( SpawnShrapX )
DEF_ANIMATOR ( DoExpDamageTest )
DEF_ANIMATOR ( DoMineExpMine )
DEF_ANIMATOR ( DoMineExp )
DEF_ANIMATOR ( SpawnGrenadeSmallExp )
DEF_ANIMATOR ( DoElectro )
DEF_ANIMATOR ( DoTeleRipper )
DEF_ANIMATOR ( DoPlasmaDone )
DEF_ANIMATOR ( DoPlasmaFountain )
DEF_ANIMATOR ( DoFootPrints )
DEF_ANIMATOR ( DoPlayerSpriteReset )
DEF_ANIMATOR ( DoFloorBlood )
DEF_ANIMATOR ( DoWallBlood )
DEF_ANIMATOR ( DoGet )
DEF_ANIMATOR ( DoCoin )
DEF_ANIMATOR ( DoFireFly )
DEF_ANIMATOR ( DoZillaMove )
DEF_ANIMATOR ( DoZillaStomp )
DEF_ANIMATOR ( NullZilla )
DEF_ANIMATOR ( InitZillaRail )
DEF_ANIMATOR ( InitZillaRocket )
DEF_ANIMATOR ( DoZillaDeathMelt )
DEF_ANIMATOR ( DoZombieMove )
DEF_ANIMATOR ( NullZombie )
DEF_ANIMATOR ( DoZombiePain )
DEF_ANIMATOR ( InitEnemyNuke )
DEF_ANIMATOR ( InitEnemyRail )
2023-05-24 16:03:16 +00:00
DEF_ANIMATOR ( InitActorRunAway )
DEF_ANIMATOR ( InitActorAttack )
DEF_ANIMATOR ( InitActorDuck )
DEF_ANIMATOR ( InitActorEvade )
DEF_ANIMATOR ( InitActorFindPlayer )
DEF_ANIMATOR ( InitActorMoveCloser )
DEF_ANIMATOR ( InitActorReposition )
DEF_ANIMATOR ( InitActorWanderAround )
DEF_ANIMATOR ( InitCoolgCircle )
DEF_ANIMATOR ( InitCoolieCharge )
DEF_ANIMATOR ( InitHornetCircle )
DEF_ANIMATOR ( InitHornetSting )
DEF_ANIMATOR ( InitRipper2Charge )
DEF_ANIMATOR ( InitRipper2Hang )
DEF_ANIMATOR ( InitRipperHang )
DEF_ANIMATOR ( InitActorRunToward )
2023-05-24 16:48:25 +00:00
DEF_ANIMATOR ( InitActorSetDecide )
2023-05-24 17:35:19 +00:00
DEF_ANIMATOR ( DoActorDecide )
DEF_ANIMATOR ( DoActorMoveJump )
DEF_ANIMATOR ( DoActorDuck )
DEF_ANIMATOR ( NinjaJumpActionFunc )
DEF_ANIMATOR ( DoActorMoveCloser )
DEF_ANIMATOR ( DoActorAttack )
DEF_ANIMATOR ( DoActorReposition )
DEF_ANIMATOR ( DoCoolgCircle )
DEF_ANIMATOR ( DoHornetCircle )
DEF_ANIMATOR ( GenerateDrips )
DEF_ANIMATOR ( DoSpawnSpot )
DEF_ANIMATOR ( DoGrating )
DEF_ANIMATOR ( DoVator )
DEF_ANIMATOR ( DoVatorAuto )
DEF_ANIMATOR ( DoRotator )
DEF_ANIMATOR ( DoActorPause )
DEF_ANIMATOR ( DoSlidor )
DEF_ANIMATOR ( DoSpike )
DEF_ANIMATOR ( DoSpikeAuto )
DEF_ANIMATOR ( DoLavaErupt )
DEF_ANIMATOR ( SpawnVehicleSmoke )
DEF_ANIMATOR ( DoLaserStart )
DEF_ANIMATOR ( DoTracerStart )
DEF_ANIMATOR ( DoRailStart )
2023-05-28 08:25:27 +00:00
DEF_ANIMATOR ( DoGenerateSewerDebris )
2021-10-29 21:03:47 +00:00
END_SW_NS
2021-11-19 21:35:08 +00:00
2019-10-09 17:58:09 +00:00
# endif