Quake II RTX doxygen
1.0 dev
|
|
Go to the documentation of this file.
20 #include "shared/shared.h"
21 #include "shared/list.h"
27 #include "shared/game.h"
30 #define G_FEATURES (GMF_PROPERINUSE|GMF_WANT_ALL_DISCONNECTS|GMF_ENHANCED_SAVEGAMES)
33 #define GAMEVERSION "baseq2"
36 #define svc_muzzleflash 1
37 #define svc_muzzleflash2 2
38 #define svc_temp_entity 3
40 #define svc_inventory 5
41 #define svc_stufftext 11
46 #define DAMAGE_TIME 0.5
52 #define SPAWNFLAG_NOT_EASY 0x00000100
53 #define SPAWNFLAG_NOT_MEDIUM 0x00000200
54 #define SPAWNFLAG_NOT_HARD 0x00000400
55 #define SPAWNFLAG_NOT_DEATHMATCH 0x00000800
56 #define SPAWNFLAG_NOT_COOP 0x00001000
59 #define FL_FLY 0x00000001
60 #define FL_SWIM 0x00000002 // implied immunity to drowining
61 #define FL_IMMUNE_LASER 0x00000004
62 #define FL_INWATER 0x00000008
63 #define FL_GODMODE 0x00000010
64 #define FL_NOTARGET 0x00000020
65 #define FL_IMMUNE_SLIME 0x00000040
66 #define FL_IMMUNE_LAVA 0x00000080
67 #define FL_PARTIALGROUND 0x00000100 // not all corners are valid
68 #define FL_WATERJUMP 0x00000200 // player jumping out of water
69 #define FL_TEAMSLAVE 0x00000400 // not the first on the team
70 #define FL_NO_KNOCKBACK 0x00000800
71 #define FL_POWER_ARMOR 0x00001000 // power armor (if any) is active
72 #define FL_RESPAWN 0x80000000 // used for item respawning
78 #define TAG_GAME 765 // clear when unloading the dll
79 #define TAG_LEVEL 766 // clear when loading a new level
82 #define MELEE_DISTANCE 80
84 #define BODY_QUEUE_SIZE 8
113 #define DEAD_RESPAWNABLE 3
116 #define RANGE_MELEE 0
122 #define GIB_ORGANIC 0
123 #define GIB_METALLIC 1
126 #define AI_STAND_GROUND 0x00000001
127 #define AI_TEMP_STAND_GROUND 0x00000002
128 #define AI_SOUND_TARGET 0x00000004
129 #define AI_LOST_SIGHT 0x00000008
130 #define AI_PURSUIT_LAST_SEEN 0x00000010
131 #define AI_PURSUE_NEXT 0x00000020
132 #define AI_PURSUE_TEMP 0x00000040
133 #define AI_HOLD_FRAME 0x00000080
134 #define AI_GOOD_GUY 0x00000100
135 #define AI_BRUTAL 0x00000200
136 #define AI_NOSTEP 0x00000400
137 #define AI_DUCKED 0x00000800
138 #define AI_COMBAT_POINT 0x00001000
139 #define AI_MEDIC 0x00002000
140 #define AI_RESURRECTING 0x00004000
143 #define AS_STRAIGHT 1
150 #define ARMOR_JACKET 1
151 #define ARMOR_COMBAT 2
153 #define ARMOR_SHARD 4
156 #define POWER_ARMOR_NONE 0
157 #define POWER_ARMOR_SCREEN 1
158 #define POWER_ARMOR_SHIELD 2
161 #define RIGHT_HANDED 0
162 #define LEFT_HANDED 1
163 #define CENTER_HANDED 2
167 #define SFL_CROSS_TRIGGER_1 0x00000001
168 #define SFL_CROSS_TRIGGER_2 0x00000002
169 #define SFL_CROSS_TRIGGER_3 0x00000004
170 #define SFL_CROSS_TRIGGER_4 0x00000008
171 #define SFL_CROSS_TRIGGER_5 0x00000010
172 #define SFL_CROSS_TRIGGER_6 0x00000020
173 #define SFL_CROSS_TRIGGER_7 0x00000040
174 #define SFL_CROSS_TRIGGER_8 0x00000080
175 #define SFL_CROSS_TRIGGER_MASK 0x000000ff
179 #define PNOISE_SELF 0
180 #define PNOISE_WEAPON 1
181 #define PNOISE_IMPACT 2
211 #define IT_WEAPON 1 // use makes active weapon
214 #define IT_STAY_COOP 8
216 #define IT_POWERUP 32
219 #define WEAP_BLASTER 1
220 #define WEAP_SHOTGUN 2
221 #define WEAP_SUPERSHOTGUN 3
222 #define WEAP_MACHINEGUN 4
223 #define WEAP_CHAINGUN 5
224 #define WEAP_GRENADES 6
225 #define WEAP_GRENADELAUNCHER 7
226 #define WEAP_ROCKETLAUNCHER 8
227 #define WEAP_HYPERBLASTER 9
228 #define WEAP_RAILGUN 10
230 #define WEAP_FLAREGUN 12
268 char helpmessage1[512];
269 char helpmessage2[512];
277 char spawnpoint[512];
301 char level_name[MAX_QPATH];
302 char mapname[MAX_QPATH];
303 char nextmap[MAX_QPATH];
395 void (*aifunc)(edict_t *
self,
float dist);
397 void (*thinkfunc)(edict_t *
self);
404 void (*endfunc)(edict_t *
self);
418 void (*dodge)(edict_t *
self, edict_t *
other,
float eta);
422 qboolean (*checkattack)(edict_t *
self);
444 extern game_import_t
gi;
457 #define MOD_UNKNOWN 0
458 #define MOD_BLASTER 1
459 #define MOD_SHOTGUN 2
460 #define MOD_SSHOTGUN 3
461 #define MOD_MACHINEGUN 4
462 #define MOD_CHAINGUN 5
463 #define MOD_GRENADE 6
464 #define MOD_G_SPLASH 7
466 #define MOD_R_SPLASH 9
467 #define MOD_HYPERBLASTER 10
468 #define MOD_RAILGUN 11
469 #define MOD_BFG_LASER 12
470 #define MOD_BFG_BLAST 13
471 #define MOD_BFG_EFFECT 14
472 #define MOD_HANDGRENADE 15
473 #define MOD_HG_SPLASH 16
478 #define MOD_TELEFRAG 21
479 #define MOD_FALLING 22
480 #define MOD_SUICIDE 23
481 #define MOD_HELD_GRENADE 24
482 #define MOD_EXPLOSIVE 25
483 #define MOD_BARREL 26
486 #define MOD_SPLASH 29
487 #define MOD_TARGET_LASER 30
488 #define MOD_TRIGGER_HURT 31
490 #define MOD_TARGET_BLASTER 33
491 #define MOD_FRIENDLY_FIRE 0x8000000
498 #define FOFS(x) q_offsetof(edict_t, x)
499 #define STOFS(x) q_offsetof(spawn_temp_t, x)
500 #define LLOFS(x) q_offsetof(level_locals_t, x)
501 #define GLOFS(x) q_offsetof(game_locals_t, x)
502 #define CLOFS(x) q_offsetof(gclient_t, x)
504 #define random() ((rand () & 0x7fff) / ((float)0x7fff))
505 #define crandom() (2.0 * (random() - 0.5))
511 extern cvar_t *
skill;
550 #define world (&g_edicts[0])
553 #define ITEM_TRIGGER_SPAWN 0x00000001
554 #define ITEM_NO_TOUCH 0x00000002
557 #define DROPPED_ITEM 0x00010000
558 #define DROPPED_PLAYER_ITEM 0x00020000
559 #define ITEM_TARGETS_USED 0x00040000
600 #define ITEM_INDEX(x) ((x)-itemlist)
610 void Touch_Item(edict_t *ent, edict_t *
other, cplane_t *plane, csurface_t *surf);
615 qboolean
KillBox(edict_t *ent);
617 edict_t *
G_Find(edict_t *from,
int fieldofs,
char *match);
618 edict_t *
findradius(edict_t *from, vec3_t org,
float rad);
632 float *
tv(
float x,
float y,
float z);
633 char *
vtos(vec3_t v);
641 qboolean
OnSameTeam(edict_t *ent1, edict_t *ent2);
642 qboolean
CanDamage(edict_t *targ, edict_t *inflictor);
643 void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, vec3_t point, vec3_t normal,
int damage,
int knockback,
int dflags,
int mod);
644 void T_RadiusDamage(edict_t *inflictor, edict_t *attacker,
float damage, edict_t *ignore,
float radius,
int mod);
647 #define DAMAGE_RADIUS 0x00000001 // damage was indirect
648 #define DAMAGE_NO_ARMOR 0x00000002 // armour does not protect from this damage
649 #define DAMAGE_ENERGY 0x00000004 // damage is from an energy based weapon
650 #define DAMAGE_NO_KNOCKBACK 0x00000008 // do not affect velocity, just view angles
651 #define DAMAGE_BULLET 0x00000010 // damage is from a bullet (used for ricochets)
652 #define DAMAGE_NO_PROTECTION 0x00000020 // armor, shields, invulnerability, and godmode have no effect
654 #define DEFAULT_BULLET_HSPREAD 300
655 #define DEFAULT_BULLET_VSPREAD 500
656 #define DEFAULT_SHOTGUN_HSPREAD 1000
657 #define DEFAULT_SHOTGUN_VSPREAD 500
658 #define DEFAULT_DEATHMATCH_SHOTGUN_COUNT 12
659 #define DEFAULT_SHOTGUN_COUNT 12
660 #define DEFAULT_SSHOTGUN_COUNT 20
665 void monster_fire_bullet(edict_t *
self, vec3_t start, vec3_t dir,
int damage,
int kick,
int hspread,
int vspread,
int flashtype);
666 void monster_fire_shotgun(edict_t *
self, vec3_t start, vec3_t aimdir,
int damage,
int kick,
int hspread,
int vspread,
int count,
int flashtype);
667 void monster_fire_blaster(edict_t *
self, vec3_t start, vec3_t dir,
int damage,
int speed,
int flashtype,
int effect);
668 void monster_fire_grenade(edict_t *
self, vec3_t start, vec3_t aimdir,
int damage,
int speed,
int flashtype);
669 void monster_fire_rocket(edict_t *
self, vec3_t start, vec3_t dir,
int damage,
int speed,
int flashtype);
670 void monster_fire_railgun(edict_t *
self, vec3_t start, vec3_t aimdir,
int damage,
int kick,
int flashtype);
671 void monster_fire_bfg(edict_t *
self, vec3_t start, vec3_t aimdir,
int damage,
int speed,
int kick,
float damage_radius,
int flashtype);
687 void ThrowHead(edict_t *
self,
char *gibname,
int damage,
int type);
689 void ThrowGib(edict_t *
self,
char *gibname,
int damage,
int type);
692 #define CLOCK_MESSAGE_SIZE 16
701 void ai_stand(edict_t *
self,
float dist);
702 void ai_move(edict_t *
self,
float dist);
703 void ai_walk(edict_t *
self,
float dist);
704 void ai_turn(edict_t *
self,
float dist);
705 void ai_run(edict_t *
self,
float dist);
706 void ai_charge(edict_t *
self,
float dist);
718 qboolean
fire_hit(edict_t *
self, vec3_t aim,
int damage,
int kick);
719 void fire_bullet(edict_t *
self, vec3_t start, vec3_t aimdir,
int damage,
int kick,
int hspread,
int vspread,
int mod);
720 void fire_shotgun(edict_t *
self, vec3_t start, vec3_t aimdir,
int damage,
int kick,
int hspread,
int vspread,
int count,
int mod);
721 void fire_blaster(edict_t *
self, vec3_t start, vec3_t aimdir,
int damage,
int speed,
int effect, qboolean hyper);
722 void fire_grenade(edict_t *
self, vec3_t start, vec3_t aimdir,
int damage,
int speed,
float timer,
float damage_radius);
723 void fire_grenade2(edict_t *
self, vec3_t start, vec3_t aimdir,
int damage,
int speed,
float timer,
float damage_radius, qboolean held);
724 void fire_rocket(edict_t *
self, vec3_t start, vec3_t dir,
int damage,
int speed,
float damage_radius,
int radius_damage);
725 void fire_rail(edict_t *
self, vec3_t start, vec3_t aimdir,
int damage,
int kick);
726 void fire_bfg(edict_t *
self, vec3_t start, vec3_t dir,
int damage,
int speed,
float damage_radius);
753 void player_die(edict_t *
self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point);
779 void PlayerNoise(edict_t *who, vec3_t where,
int type);
785 qboolean
M_walkmove(edict_t *ent,
float yaw,
float dist);
811 #define ANIM_BASIC 0 // stand / run
815 #define ANIM_ATTACK 4
817 #define ANIM_REVERSE 6
822 char userinfo[MAX_INFO_STRING];
835 int inventory[MAX_ITEMS];
1033 void (*
die)(edict_t *
self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point);
void G_SetSpectatorStats(edict_t *ent)
void ChasePrev(edict_t *ent)
void PlayerTrail_Init(void)
void MoveClientToIntermission(edict_t *client)
void AI_SetSightClient(void)
void G_ProjectSource(const vec3_t point, const vec3_t distance, const vec3_t forward, const vec3_t right, vec3_t result)
void monster_fire_railgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int flashtype)
void ClientBeginServerFrame(edict_t *ent)
void ThrowGib(edict_t *self, char *gibname, int damage, int type)
qboolean visible(edict_t *self, edict_t *other)
gitem_t * GetItemByIndex(int index)
void G_RunEntity(edict_t *ent)
int ArmorIndex(edict_t *ent)
edict_t * PlayerTrail_PickNext(edict_t *self)
void InitClientPersistant(gclient_t *client)
void AttackFinished(edict_t *self, float time)
void PutClientInServer(edict_t *ent)
void fire_rail(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick)
void FoundTarget(edict_t *self)
qboolean M_walkmove(edict_t *ent, float yaw, float dist)
client_persistant_t coop_respawn
void fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage)
qboolean(* pickup)(struct edict_s *ent, struct edict_s *other)
void monster_death_use(edict_t *self)
void player_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void fire_bfg(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius)
void ai_run(edict_t *self, float dist)
void G_TouchTriggers(edict_t *ent)
void InitClientResp(gclient_t *client)
edict_t * G_Find(edict_t *from, int fieldofs, char *match)
void BecomeExplosion1(edict_t *self)
qboolean SV_FilterPacket(char *from)
void Think_Weapon(edict_t *ent)
void(* blocked)(edict_t *self, edict_t *other)
void M_droptofloor(edict_t *ent)
float vectoyaw(vec3_t vec)
void fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius)
void fire_grenade2(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius, qboolean held)
float * tv(float x, float y, float z)
void(* prethink)(edict_t *ent)
void monster_fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int flashtype)
qboolean Add_Ammo(edict_t *ent, gitem_t *item, int count)
void ValidateSelectedItem(edict_t *ent)
qboolean fire_hit(edict_t *self, vec3_t aim, int damage, int kick)
gitem_t * FindItem(char *pickup_name)
void ThrowDebris(edict_t *self, char *modelname, float speed, vec3_t origin)
int groundentity_linkcount
qboolean M_CheckAttack(edict_t *self)
void walkmonster_start(edict_t *self)
void BeginIntermission(edict_t *targ)
int sight_entity_framenum
void G_InitEdict(edict_t *e)
vec3_t intermission_origin
void(* use)(struct edict_s *ent, struct gitem_s *item)
void G_SetStats(edict_t *ent)
gitem_t * FindItemByClassname(char *classname)
void PlayerTrail_New(vec3_t spot)
qboolean infront(edict_t *self, edict_t *other)
void ai_turn(edict_t *self, float dist)
void vectoangles(vec3_t vec, vec3_t angles)
void Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
edict_t * findradius(edict_t *from, vec3_t org, float rad)
char * G_CopyString(char *in)
void G_FreeEdict(edict_t *e)
void M_MoveToGoal(edict_t *ent, float dist)
void FetchClientEntData(edict_t *ent)
void swimmonster_start(edict_t *self)
edict_t * PlayerTrail_LastSpot(void)
cvar_t * spectator_password
void DeathmatchScoreboardMessage(edict_t *client, edict_t *killer)
void(* think)(edict_t *self)
qboolean M_CheckBottom(edict_t *ent)
int PowerArmorType(edict_t *ent)
void(APIENTRY *qwglDrawBuffer)(GLenum mode)
weaponstate_t weaponstate
void Cmd_Score_f(edict_t *ent)
void respawn(edict_t *ent)
void M_CatagorizePosition(edict_t *ent)
float damage_debounce_time
void monster_fire_bullet(edict_t *self, vec3_t start, vec3_t dir, int damage, int kick, int hspread, int vspread, int flashtype)
float touch_debounce_time
void monster_fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype)
void ai_charge(edict_t *self, float dist)
void monster_think(edict_t *self)
void(* pain)(edict_t *self, edict_t *other, float kick, int damage)
void ai_stand(edict_t *self, float dist)
qboolean FacingIdeal(edict_t *self)
struct gclient_s * client
void M_CheckGround(edict_t *ent)
void monster_fire_bfg(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int kick, float damage_radius, int flashtype)
void GetChaseTarget(edict_t *ent)
void monster_fire_blaster(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect)
void fire_bullet(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int mod)
void Cmd_Help_f(edict_t *ent)
void player_pain(edict_t *self, edict_t *other, float kick, int damage)
edict_t * PlayerTrail_PickFirst(edict_t *self)
void(* use)(edict_t *self, edict_t *other, edict_t *activator)
monsterinfo_t monsterinfo
void ThrowClientHead(edict_t *self, int damage)
int range(edict_t *self, edict_t *other)
void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, vec3_t point, vec3_t normal, int damage, int knockback, int dflags, int mod)
int sound_entity_framenum
void ai_walk(edict_t *self, float dist)
void ClientEndServerFrame(edict_t *ent)
void(* weaponthink)(struct edict_s *ent)
void G_UseTargets(edict_t *ent, edict_t *activator)
void(* drop)(struct edict_s *ent, struct gitem_s *item)
void M_FlyCheck(edict_t *self)
void PlayerNoise(edict_t *who, vec3_t where, int type)
int clusternums[MAX_ENT_CLUSTERS]
void G_SetMovedir(vec3_t angles, vec3_t movedir)
qboolean KillBox(edict_t *ent)
void ThrowHead(edict_t *self, char *gibname, int damage, int type)
void(* touch)(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void func_clock_use(edict_t *self, edict_t *other, edict_t *activator)
void G_TouchSolids(edict_t *ent)
void fire_blaster(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int effect, qboolean hyper)
void G_CheckChaseStats(edict_t *ent)
qboolean OnSameTeam(edict_t *ent1, edict_t *ent2)
void ChangeWeapon(edict_t *ent)
void func_clock_think(edict_t *self)
void ChaseNext(edict_t *ent)
void UpdateChaseCam(edict_t *ent)
void SaveClientData(void)
void M_ChangeYaw(edict_t *ent)
void PrecacheItem(gitem_t *it)
void fire_shotgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int mod)
edict_t * G_PickTarget(char *targetname)
void T_RadiusDamage(edict_t *inflictor, edict_t *attacker, float damage, edict_t *ignore, float radius, int mod)
edict_t * Drop_Item(edict_t *ent, gitem_t *item)
int sound2_entity_framenum
void monster_fire_shotgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int flashtype)
void PlayerTrail_Add(vec3_t spot)
void ai_move(edict_t *self, float dist)
void SetRespawn(edict_t *ent, float delay)
void(* die)(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void SpawnItem(edict_t *ent, gitem_t *item)
qboolean CanDamage(edict_t *targ, edict_t *inflictor)
void flymonster_start(edict_t *self)
vec3_t intermission_angle
float fly_sound_debounce_time