#ifndef SERVER_DEFS_H
#define SERVER_DEFS_H
-#include "../common/weapons/weapons.qh"
+#include "../common/weapons/all.qh"
#define INDEPENDENT_ATTACK_FINISHED
-noref float require_spawnfunc_prefix; // if this float exists, only functions with spawnfunc_ name prefix qualify as spawn functions
-
#define BUTTON_ATCK button0
#define BUTTON_JUMP button2
#define BUTTON_ATCK2 button3
float sv_clones;
float sv_foginterval;
-entity activator;
-
float player_count;
float currentbots;
float bots_would_leave;
//.string map;
//.float worldtype;
-.float delay;
-.float wait;
-.float lip;
-//.float light_lev;
-.float speed;
-//.float style;
-//.float skill;
-.float sounds;
-.string platmovetype;
-.float platmovetype_start, platmovetype_end;
-
-.string killtarget;
-
-.vector pos1, pos2;
-.vector mangle;
+// Needed for dynamic clientwalls
+.float inactive; // Clientwall disappears when inactive
+.float alpha_max, alpha_min;
+.float fade_start, fade_end, fade_vertical_offset;
+.float default_solid; // Variable to store default self.solid for clientwalls
.float pain_finished; //Added by Supajoe
.float pain_frame; //"
.float invincible_finished;
.float superweapons_finished;
-.vector finaldest, finalangle; //plat.qc stuff
-.void() think1;
-.float state;
-.float t_length, t_width;
-
-.vector destvec; // for rain
-.vector destvec2; // for train
-.float cnt; // for rain
+.float cnt; // used in too many places
.float count;
//.float cnt2;
.float fade_time;
.float fade_rate;
-// player animation state
-.float animstate_startframe;
-.float animstate_numframes;
-.float animstate_framerate;
-.float animstate_starttime;
-.float animstate_endtime;
-.float animstate_override;
-.float animstate_looping;
-
// weapon animation vectors:
.vector anim_fire1;
.vector anim_fire2;
.float pauserothealth_finished;
.float pauserotarmor_finished;
.float pauserotfuel_finished;
+// string overrides entity
.string item_pickupsound;
+.entity item_pickupsound_ent;
// definitions for weaponsystem
// more WEAPONTODO: move these to their proper files
// WEAPONTODO
.float autoswitch;
-//float WEP_ACTION(float wpn, float wrequest);
float client_hasweapon(entity cl, float wpn, float andammo, float complain);
-void w_clear();
-void w_ready();
+void w_clear(Weapon thiswep, entity actor, bool fire1, bool fire2);
+void w_ready(Weapon thiswep, entity actor, bool fire1, bool fire2);
// VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
.float weapon_nextthink;
-.void() weapon_think;
+.void(Weapon thiswep, entity actor, bool fire1, bool fire2) weapon_think;
// weapon states (self.weaponentity.state)
void weapon_defaultspawnfunc(float wpn);
-.vector dest1, dest2;
-
float gameover;
float intermission_running;
float intermission_exittime;
float alreadychangedlevel;
-// Keys player is holding
-.float itemkeys;
-// message delay for func_door locked by keys and key locks
-// this field is used on player entities
-.float key_door_messagetime;
-
-
.float version;
-//swamp
-.float in_swamp; // bool
-.entity swampslug; // Uses this to release from swamp ("untouch" fix)
-
// footstep interval
.float nextstep;
.float version_nagtime;
-const int NUM_JUMPPADSUSED = 3;
-.int jumppadcount;
-.entity jumppadsused[NUM_JUMPPADSUSED];
-
string gamemode_name;
float startitem_failed;
// WEAPONTODO: remove this
WepSet weaponsInMap;
+.WepSet weaponsinmap;
+
.float respawn_countdown; // next number to count
float bot_waypoints_for_items;
-.float attack_finished_for[WEP_MAXCOUNT];
+.float attack_finished_for[Weapons_MAX];
.float attack_finished_single;
#ifdef INDEPENDENT_ATTACK_FINISHED
#define ATTACK_FINISHED_FOR(ent,w) ((ent).(attack_finished_for[(w) - WEP_FIRST]))
float next_pingtime;
-.float Version;
-.int SendFlags;
-.bool(entity to, int sendflags) SendEntity;
-
// player sounds, voice messages
// TODO implemented fall and falling
#define ALLPLAYERSOUNDS \
// _VOICEMSG(droppedflag) \
// _VOICEMSG(negative) \
// _VOICEMSG(seenenemy) \
+// /**/
string globalsound_fall;
string globalsound_metalfall;
.float version_mismatch;
-float independent_players;
+int autocvar__independent_players;
+bool independent_players;
#define INDEPENDENT_PLAYERS (autocvar__independent_players ? (autocvar__independent_players > 0) : independent_players)
#define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
-#define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER) + ((e).frags = FRAGS_PLAYER_NONSOLID))
-// we're using + here instead of , because fteqcc sucks
+#define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER), ((e).frags = FRAGS_PLAYER_NONSOLID))
string clientstuff;
.float phase;
.int pressedkeys;
-.float porto_forbidden;
-
.string fog;
string cvar_changes;
.float stat_game_starttime;
.float stat_round_starttime;
-.float stat_sv_airaccel_qw;
-.float stat_sv_airstrafeaccel_qw;
-.float stat_sv_airspeedlimit_nonqw;
-.float stat_sv_maxspeed;
-
void W_Porto_Remove (entity p);
.int projectiledeathtype;
// may be useful to all weapons
.float bulletcounter;
-void target_voicescript_next(entity pl);
-void target_voicescript_clear(entity pl);
-
-.string target2;
-.string target3;
-.string target4;
-.string curvetarget;
-.float target_random;
-.float trigger_reverse;
-
// Nexball
.entity ballcarried; // Also used for keepaway
-.float metertime;
float g_nexball_meter_period;
void SUB_DontUseTargets();
float client_cefc_accumulatortime;
#endif
-.float weapon_load[WEP_MAXCOUNT];
+.float weapon_load[Weapons_MAX];
.int ammo_none; // used by the reloading system, must always be 0
.float clip_load;
.float old_clip_load;
.float clip_size;
-.entity lastrocket;
.float minelayer_mines;
.float vortex_charge;
.float vortex_charge_rottime;
.void (float act_state) setactive;
.entity realowner;
-.float item_armor_large_time;
-.float item_health_mega_time;
-.float item_invisible_time;
-.float item_speed_time;
-.float item_extralife_time;
-.float item_strength_time;
-.float item_shield_time;
-.float item_fuelregen_time;
-.float item_jetpack_time;
-.float item_superweapons_time;
-
//float serverflags;
.float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
typedef vector(entity player, entity spot, vector current) spawn_evalfunc_t;
.spawn_evalfunc_t spawn_evalfunc;
-.entity conveyor;
-
string modname;
.float missile_flags;
-const int MIF_SPLASH = 2;
-const int MIF_ARC = 4;
-const int MIF_PROXY = 8;
-const int MIF_GUIDED_MANUAL = 16;
-const int MIF_GUIDED_HEAT = 32;
-const int MIF_GUIDED_LASER = 64;
-const int MIF_GUIDED_AI = 128;
-const int MIF_GUIDED_TAG = 128;
-#define MIF_GUIDED_ALL (MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
-#define MIF_GUIDED_TRACKING (MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
-#define MIF_GUIDED_CONFUSABLE (MIF_GUIDED_HEAT | MIF_GUIDED_AI)
+const int MIF_SPLASH = BIT(1);
+const int MIF_ARC = BIT(2);
+const int MIF_PROXY = BIT(3);
+const int MIF_GUIDED_MANUAL = BIT(4);
+const int MIF_GUIDED_HEAT = BIT(5);
+const int MIF_GUIDED_LASER = BIT(6);
+const int MIF_GUIDED_AI = BIT(7);
+const int MIF_GUIDED_TAG = BIT(7);
+const int MIF_GUIDED_ALL = MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
+const int MIF_GUIDED_TRACKING = MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
+const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI;
#define MISSILE_IS_CONFUSABLE(m) ((m.missile_flags & MIF_GUIDED_CONFUSABLE) ? true : false)
#define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? true : false)
.float elos;
.float ranks;
+.string cvar_cl_physics;
+
.float init_for_player_needed;
.void(entity) init_for_player;