2015-05-19 21:54:34 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1997, 2005 - 3D 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, 3D Realms
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef WEAPON_H
|
|
|
|
#define WEAPON_H
|
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
BEGIN_SW_NS
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
#define NEW_ELECTRO 1
|
2022-08-31 19:50:49 +00:00
|
|
|
#define HORIZ_MULT 128
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-24 17:59:49 +00:00
|
|
|
inline int AngToSprite(DSWActor* actor, DSWActor* other)
|
|
|
|
{
|
2022-08-20 13:34:51 +00:00
|
|
|
return getangle(actor->spr.pos - other->spr.pos);
|
2021-12-24 17:59:49 +00:00
|
|
|
}
|
|
|
|
|
2021-12-31 14:59:11 +00:00
|
|
|
inline int AngToPlayer(PLAYER* player, DSWActor* other)
|
2021-12-24 17:59:49 +00:00
|
|
|
{
|
2022-08-20 13:34:51 +00:00
|
|
|
return getangle(player->pos - other->spr.pos);
|
2021-12-24 17:59:49 +00:00
|
|
|
}
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
#define MAX_HOLE_QUEUE 64
|
|
|
|
#define MAX_STAR_QUEUE 32
|
|
|
|
#define MAX_WALLBLOOD_QUEUE 32
|
|
|
|
#define MAX_FLOORBLOOD_QUEUE 32
|
|
|
|
#define MAX_GENERIC_QUEUE 32
|
|
|
|
#define MAX_LOWANGS_QUEUE 16
|
|
|
|
|
|
|
|
//#define NUKE_RADIUS 16384
|
|
|
|
#define NUKE_RADIUS 30000
|
|
|
|
#define RAIL_RADIUS 3500
|
|
|
|
|
|
|
|
// This is how many bullet shells have been spawned since the beginning of the game.
|
|
|
|
extern FOOT_TYPE FootMode;
|
|
|
|
extern int ShellCount;
|
|
|
|
#define MAXSHELLS 32
|
|
|
|
|
2021-11-01 11:25:35 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
UZI_SHELL = 2152,
|
|
|
|
SHOT_SHELL = 2180
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-11-21 20:45:12 +00:00
|
|
|
extern int StarQueueHead;
|
2021-12-05 23:35:12 +00:00
|
|
|
extern TObjPtr<DSWActor*> StarQueue[MAX_STAR_QUEUE];
|
2021-11-21 20:45:12 +00:00
|
|
|
extern int HoleQueueHead;
|
2021-12-05 23:35:12 +00:00
|
|
|
extern TObjPtr<DSWActor*> HoleQueue[MAX_HOLE_QUEUE];
|
2021-11-21 20:45:12 +00:00
|
|
|
extern int WallBloodQueueHead;
|
2021-12-05 23:35:12 +00:00
|
|
|
extern TObjPtr<DSWActor*> WallBloodQueue[MAX_WALLBLOOD_QUEUE];
|
2021-11-21 20:45:12 +00:00
|
|
|
extern int FloorBloodQueueHead;
|
2021-12-05 23:35:12 +00:00
|
|
|
extern TObjPtr<DSWActor*> FloorBloodQueue[MAX_FLOORBLOOD_QUEUE];
|
2021-11-21 20:45:12 +00:00
|
|
|
extern int GenericQueueHead;
|
2021-12-05 23:35:12 +00:00
|
|
|
extern TObjPtr<DSWActor*> GenericQueue[MAX_GENERIC_QUEUE];
|
2021-11-21 20:45:12 +00:00
|
|
|
extern int LoWangsQueueHead;
|
2021-12-05 23:35:12 +00:00
|
|
|
extern TObjPtr<DSWActor*> LoWangsQueue[MAX_LOWANGS_QUEUE];
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
void ChangeState(DSWActor* actor, STATE* statep);
|
2021-12-31 14:59:11 +00:00
|
|
|
void DoPlayerBeginRecoil(PLAYER* pp, short pix_amt);
|
2021-12-31 14:50:44 +00:00
|
|
|
SECTOR_OBJECT* DetectSectorObject(sectortype*);
|
|
|
|
SECTOR_OBJECT* DetectSectorObjectByWall(walltype*);
|
2021-11-01 12:08:41 +00:00
|
|
|
void ScaleSpriteVector(DSWActor* actor, int scale);
|
2022-08-18 14:42:06 +00:00
|
|
|
void QueueHole(sectortype* hit_sect, walltype* hit_wall, const DVector3& pos);
|
2021-11-02 17:51:14 +00:00
|
|
|
DSWActor* QueueWallBlood(DSWActor* hit, short ang);
|
2021-11-03 21:02:01 +00:00
|
|
|
bool SlopeBounce(DSWActor*, bool *hit_wall);
|
2021-12-31 14:59:11 +00:00
|
|
|
int SpawnSwordSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall, int hit_x, int hit_y, int hit_z, short hit_ang);
|
2021-11-01 20:58:16 +00:00
|
|
|
DSWActor* SpawnBubble(DSWActor*);
|
2021-11-05 14:55:02 +00:00
|
|
|
void SpawnFireballExp(DSWActor*);
|
2021-11-05 15:54:28 +00:00
|
|
|
void SpawnFireballFlames(DSWActor* actor, DSWActor* enemyActor);
|
2021-11-01 09:51:25 +00:00
|
|
|
int SpawnRadiationCloud(DSWActor* actor);
|
2021-11-04 23:18:16 +00:00
|
|
|
void SpawnGrenadeExp(DSWActor*);
|
2021-11-04 23:16:01 +00:00
|
|
|
DSWActor* SpawnSectorExp(DSWActor*);
|
2021-11-03 21:02:01 +00:00
|
|
|
int DoShrapVelocity(DSWActor*);
|
2021-11-03 20:55:34 +00:00
|
|
|
int ShrapKillSprite(DSWActor*);
|
2021-12-31 22:09:34 +00:00
|
|
|
bool MissileSetPos(DSWActor*,ANIMATOR* DoWeapon,int dist);
|
2021-11-05 22:23:02 +00:00
|
|
|
int ActorPain(DSWActor*);
|
2021-10-31 17:13:10 +00:00
|
|
|
int SpawnBreakFlames(DSWActor*);
|
2021-12-31 14:59:11 +00:00
|
|
|
bool PlayerTakeDamage(PLAYER* pp, DSWActor* weapActor);
|
2021-11-05 21:43:59 +00:00
|
|
|
const char *DeathString(DSWActor*);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Damage Amounts defined in damage.h
|
|
|
|
//
|
|
|
|
|
|
|
|
// Damage Times - takes damage after this many tics
|
|
|
|
#define DAMAGE_BLADE_TIME (10)
|
|
|
|
|
|
|
|
// Player Missile Speeds
|
|
|
|
#define STAR_VELOCITY (1800)
|
|
|
|
#define BOLT_VELOCITY (900)
|
|
|
|
#define ROCKET_VELOCITY (1350)
|
|
|
|
#define BOLT_SEEKER_VELOCITY (820)
|
|
|
|
#define FIREBALL_VELOCITY (2000)
|
|
|
|
#define ELECTRO_VELOCITY (800)
|
|
|
|
#define PLASMA_VELOCITY (1000)
|
|
|
|
#define UZI_BULLET_VELOCITY (2500)
|
|
|
|
#define TRACER_VELOCITY (1200)
|
|
|
|
#define TANK_SHELL_VELOCITY (1200)
|
|
|
|
#define GRENADE_VELOCITY (900)
|
|
|
|
#define MINE_VELOCITY (520) // Was 420
|
|
|
|
#define CHEMBOMB_VELOCITY (420)
|
|
|
|
|
|
|
|
// Player Spell Missile Speeds
|
|
|
|
#define BLOOD_WORM_VELOCITY (800)
|
|
|
|
#define NAPALM_VELOCITY (800)
|
|
|
|
#define MIRV_VELOCITY (600)
|
|
|
|
#define SPIRAL_VELOCITY (600)
|
|
|
|
|
|
|
|
// Trap Speeds
|
|
|
|
#define BOLT_TRAP_VELOCITY (950)
|
|
|
|
#define SPEAR_TRAP_VELOCITY (650)
|
|
|
|
#define FIREBALL_TRAP_VELOCITY (750)
|
|
|
|
|
|
|
|
// NPC Missile Speeds
|
|
|
|
#define NINJA_STAR_VELOCITY (1800)
|
|
|
|
#define NINJA_BOLT_VELOCITY (500)
|
|
|
|
#define GORO_FIREBALL_VELOCITY (800)
|
|
|
|
#define SKEL_ELECTRO_VELOCITY (850)
|
|
|
|
#define COOLG_FIRE_VELOCITY (400)
|
|
|
|
|
|
|
|
#define GRENADE_RECOIL_AMT (12)
|
|
|
|
#define ROCKET_RECOIL_AMT (7)
|
|
|
|
#define RAIL_RECOIL_AMT (7)
|
|
|
|
#define SHOTGUN_RECOIL_AMT (12)
|
|
|
|
//#define MICRO_RECOIL_AMT (15)
|
|
|
|
|
|
|
|
// Damage amounts that determine the type of player death
|
|
|
|
// The standard flip over death is default
|
|
|
|
#define PLAYER_DEATH_CRUMBLE_DAMMAGE_AMT (25)
|
|
|
|
#define PLAYER_DEATH_EXPLODE_DAMMAGE_AMT (65)
|
|
|
|
|
|
|
|
// electro weapon
|
|
|
|
#define ELECTRO_MAX_JUMP_DIST 25000
|
|
|
|
|
|
|
|
extern int WeaponIsAmmo;
|
|
|
|
|
|
|
|
#define MISSILEMOVETICS 6
|
|
|
|
|
2021-12-24 18:10:11 +00:00
|
|
|
inline int CloseRangeDist(DSWActor* a1, DSWActor* a2, int fudge)
|
2021-12-24 17:09:40 +00:00
|
|
|
{
|
|
|
|
return (((int)a1->spr.clipdist << 2) + ((int)a2->spr.clipdist << 2) + fudge);
|
|
|
|
}
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
extern short target_ang;
|
|
|
|
|
2021-12-31 14:59:11 +00:00
|
|
|
DSWActor* SpawnShotgunSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall, int hit_x, int hit_y, int hit_z, short hit_ang);
|
2021-11-21 20:45:12 +00:00
|
|
|
int DoActorBeginSlide(DSWActor* actor, int ang, int vel, int dec);
|
2021-11-24 22:34:28 +00:00
|
|
|
int GetOverlapSector(int x, int y, sectortype** over, sectortype** under);
|
|
|
|
|
2021-11-03 16:52:16 +00:00
|
|
|
bool MissileHitDiveArea(DSWActor*);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-29 18:49:57 +00:00
|
|
|
int DoDamageTest(DSWActor*);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
extern short StatDamageList[STAT_DAMAGE_LIST_SIZE];
|
|
|
|
|
|
|
|
#define RADIATION_CLOUD 3258
|
|
|
|
#define MUSHROOM_CLOUD 3280
|
|
|
|
extern STATE s_NukeMushroom[];
|
|
|
|
|
2022-08-30 22:48:43 +00:00
|
|
|
void WallBounce(DSWActor*, DAngle ang);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
#define PUFF 1748
|
|
|
|
#define CALTROPS 2218
|
|
|
|
#define PHOSPHORUS 1397
|
|
|
|
|
2021-12-31 14:59:11 +00:00
|
|
|
int PlayerInitChemBomb(PLAYER* pp);
|
2021-11-01 10:30:28 +00:00
|
|
|
int InitChemBomb(DSWActor*);
|
2021-12-31 14:59:11 +00:00
|
|
|
int PlayerInitCaltrops(PLAYER* pp);
|
2021-11-01 10:57:51 +00:00
|
|
|
int InitBloodSpray(DSWActor* actor, bool dogib, short velocity);
|
2021-11-04 23:30:47 +00:00
|
|
|
int SpawnBunnyExp(DSWActor* actor);
|
2021-12-31 14:59:11 +00:00
|
|
|
int InitBunnyRocket(PLAYER* pp);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-11-05 22:00:31 +00:00
|
|
|
int GetDamage(DSWActor*, DSWActor*, int DamageNdx);
|
2021-11-05 21:22:28 +00:00
|
|
|
int DoFlamesDamageTest(DSWActor*);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-31 12:26:07 +00:00
|
|
|
struct SHRAP
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* state;
|
2015-05-19 21:54:34 +00:00
|
|
|
short id, num, zlevel, min_jspeed, max_jspeed, min_vel, max_vel, random_disperse, ang_range;
|
|
|
|
// state, id, num, min_jspeed, max_jspeed, min_vel, max_vel, size,
|
|
|
|
// random_disperse, ang_range
|
2021-12-31 12:26:07 +00:00
|
|
|
};
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
enum ShrapPos
|
|
|
|
{
|
|
|
|
Z_TOP,
|
|
|
|
Z_MID,
|
|
|
|
Z_BOT
|
|
|
|
};
|
|
|
|
|
2021-10-30 20:44:16 +00:00
|
|
|
int SetSuicide(DSWActor*);
|
2021-10-30 19:07:15 +00:00
|
|
|
void UpdateSinglePlayKills(DSWActor* actor);
|
2021-11-05 19:32:45 +00:00
|
|
|
int InitPlasmaFountain(DSWActor* wActor, DSWActor* sActor);
|
2021-10-31 20:09:57 +00:00
|
|
|
int InitCoolgDrip(DSWActor*);
|
2021-12-31 14:59:11 +00:00
|
|
|
int InitFireball(PLAYER* pp);
|
|
|
|
void InitSpellRing(PLAYER* pp);
|
|
|
|
void InitSpellNapalm(PLAYER* pp);
|
2021-11-04 19:28:03 +00:00
|
|
|
int DoStaticFlamesDamage(DSWActor*);
|
2021-12-31 14:59:11 +00:00
|
|
|
int InitUzi(PLAYER* pp);
|
|
|
|
int InitSobjGun(PLAYER* pp);
|
2021-11-04 17:23:30 +00:00
|
|
|
void InitFireballTrap(DSWActor* actor);
|
|
|
|
void InitBoltTrap(DSWActor* actor);
|
|
|
|
void InitSpearTrap(DSWActor*);
|
2021-12-31 14:50:44 +00:00
|
|
|
int InitTurretMgun(SECTOR_OBJECT* sop);
|
2021-11-04 22:59:37 +00:00
|
|
|
void InitVulcanBoulder(DSWActor* actor);
|
2021-11-04 20:26:08 +00:00
|
|
|
int DoBladeDamage(DSWActor*);
|
2021-11-04 23:10:26 +00:00
|
|
|
int DoFindGround(DSWActor*);
|
2021-10-30 22:01:08 +00:00
|
|
|
int DoFindGroundPoint(DSWActor* actor);
|
2021-10-31 17:10:59 +00:00
|
|
|
void SpriteQueueDelete(DSWActor* actor);
|
2021-11-04 22:27:04 +00:00
|
|
|
int HelpMissileLateral(DSWActor*, int dist);
|
2021-12-31 14:50:44 +00:00
|
|
|
void AddSpriteToSectorObject(DSWActor*,SECTOR_OBJECT* sop);
|
2015-05-19 21:54:34 +00:00
|
|
|
void QueueReset(void);
|
2021-12-31 14:59:11 +00:00
|
|
|
int PlayerCheckDeath(PLAYER* pp,DSWActor*);
|
2021-11-03 23:10:36 +00:00
|
|
|
bool SpriteWarpToUnderwater(DSWActor* actor);
|
2021-12-31 14:59:11 +00:00
|
|
|
int PlayerDamageSlide(PLAYER* pp,int damage,short ang);
|
2021-11-02 23:14:09 +00:00
|
|
|
bool VehicleMoveHit(DSWActor*);
|
2021-11-03 23:08:58 +00:00
|
|
|
int SpawnSplash(DSWActor*);
|
2021-11-04 23:16:01 +00:00
|
|
|
void SpawnMineExp(DSWActor*);
|
2021-11-04 23:13:44 +00:00
|
|
|
void SpawnLittleExp(DSWActor*);
|
2021-11-04 23:16:01 +00:00
|
|
|
DSWActor* SpawnLargeExp(DSWActor*);
|
2021-11-04 23:29:58 +00:00
|
|
|
void SpawnNuclearExp(DSWActor* actor);
|
2021-11-04 23:30:47 +00:00
|
|
|
void SpawnBoltExp(DSWActor* actor);
|
2021-11-04 23:24:23 +00:00
|
|
|
void SpawnTracerExp(DSWActor* Weapon);
|
2021-11-05 14:55:02 +00:00
|
|
|
void SpawnGoroFireballExp(DSWActor* Weapon);
|
2021-11-04 23:31:54 +00:00
|
|
|
bool MissileHitMatch(DSWActor* weapActor, int WeaponNum, DSWActor* hitActor);
|
2021-11-03 20:44:22 +00:00
|
|
|
int DoItemFly(DSWActor*);
|
2021-10-29 18:49:57 +00:00
|
|
|
int SpawnVehicleSmoke(DSWActor* actor);
|
2021-11-24 17:58:14 +00:00
|
|
|
walltype* PrevWall(walltype* wall_num);
|
2021-11-05 21:32:53 +00:00
|
|
|
int DoDamage(DSWActor*, DSWActor*);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
END_SW_NS
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
#endif
|