}
}
-const int MAX_SPECIALCOMMAND = 15;
-vector specialcommand_slots[MAX_SPECIALCOMMAND];
-vector specialcommand_colors[MAX_SPECIALCOMMAND];
-const float SPECIALCOMMAND_SPEED = 150;
-const float SPECIALCOMMAND_TURNSPEED = 2;
-const float SPECIALCOMMAND_SIZE = 0.025;
-const float SPECIALCOMMAND_CHANCE = 0.35;
-float sc_spawntime, sc_changetime;
-vector sc_color = '1 1 1';
-void SpecialCommand()
-{
- if(!STAT(MOVEVARS_SPECIALCOMMAND))
- return;
-
- if(time >= sc_changetime)
- {
- sc_changetime = time + 1;
- sc_color = randomvec() * 1.5;
- sc_color.x = bound(0.2, sc_color.x, 0.75);
- sc_color.y = bound(0.2, sc_color.y, 0.75);
- sc_color.z = bound(0.2, sc_color.z, 0.75);
- }
- drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), sc_color, autocvar_hud_colorflash_alpha * bound(0.1, sc_changetime - time, 0.3), DRAWFLAG_ADDITIVE);
-
- if(!precache_pic("gfx/smile"))
- return; // damn party poopers
-
- for(int j = MAX_SPECIALCOMMAND - 1; j >= 0; --j)
- {
- vector slot = specialcommand_slots[j];
- if(slot.y)
- slot.y += SPECIALCOMMAND_SPEED * frametime;
- //if(slot.z)
- //slot.z = sin(SPECIALCOMMAND_TURNSPEED * M_PI * time);
- if(slot.y >= vid_conheight)
- slot = '0 0 0';
-
- if(slot == '0 0 0')
- {
- if(random() <= SPECIALCOMMAND_CHANCE && time > sc_spawntime) // low chance to spawn!
- {
- slot.x = bound(0, (random() * vid_conwidth + 1), vid_conwidth);
- slot.y = 1; // start it off 0 so we can use it
- slot.z = floor(random() * REGISTRY_COUNT(Weapons));
- sc_spawntime = time + bound(0.4, random(), 0.75); // prevent spawning another one for this amount of time!
- vector newcolor = randomvec() * 2;
- newcolor.x = bound(0.4, newcolor.x, 1);
- newcolor.y = bound(0.4, newcolor.y, 1);
- newcolor.z = bound(0.4, newcolor.z, 1);
- specialcommand_colors[j] = newcolor;
- }
- }
- else
- {
- vector splash_size = '0 0 0';
- splash_size.x = max(vid_conwidth, vid_conheight) * SPECIALCOMMAND_SIZE;
- splash_size.y = max(vid_conwidth, vid_conheight) * SPECIALCOMMAND_SIZE;
- entity wep = REGISTRY_GET(Weapons, slot.z);
- if(wep == WEP_Null)
- drawpic(vec2(slot), "gfx/smile", vec2(splash_size), specialcommand_colors[j], 0.95, DRAWFLAG_NORMAL);
- else
- drawpic_skin(vec2(slot), wep.model2, vec2(splash_size), specialcommand_colors[j], 0.95, DRAWFLAG_NORMAL);
- //drawrotpic(vec2(slot), slot.z, "gfx/smile", vec2(splash_size), vec2(splash_size) / 2, specialcommand_colors[j], 0.95, DRAWFLAG_NORMAL);
- }
-
- specialcommand_slots[j] = slot;
- }
-}
-
void HUD_Draw(entity this)
{
// if we don't know gametype and scores yet avoid drawing the scoreboard
}
// crosshair goes VERY LAST
- SpecialCommand();
UpdateDamage();
HUD_Crosshair(this);
HitSound();
float redflag_statuschange_elapsedtime = 0, blueflag_statuschange_elapsedtime = 0, yellowflag_statuschange_elapsedtime = 0, pinkflag_statuschange_elapsedtime = 0, neutralflag_statuschange_elapsedtime = 0; // time since the status changed
bool ctf_oneflag; // one-flag CTF mode enabled/disabled
bool ctf_stalemate; // currently in stalemate
- int stat_items = STAT(CTF_FLAGSTATUS);
+ int stat_items = STAT(OBJECTIVE_STATUS);
float fs, fs2, fs3, size1, size2;
vector e1, e2;
bool b1 = false, b2 = false, b3 = false, b4 = false, b5 = false; // TODO: kill this, we WANT to show the other flags, somehow! (note: also means you don't see if you're FC)
// initially clear items so they can be set as necessary later.
- STAT(CTF_FLAGSTATUS, player) &= ~(CTF_RED_FLAG_CARRYING | CTF_RED_FLAG_TAKEN | CTF_RED_FLAG_LOST
+ STAT(OBJECTIVE_STATUS, player) &= ~(CTF_RED_FLAG_CARRYING | CTF_RED_FLAG_TAKEN | CTF_RED_FLAG_LOST
| CTF_BLUE_FLAG_CARRYING | CTF_BLUE_FLAG_TAKEN | CTF_BLUE_FLAG_LOST
| CTF_YELLOW_FLAG_CARRYING | CTF_YELLOW_FLAG_TAKEN | CTF_YELLOW_FLAG_LOST
| CTF_PINK_FLAG_CARRYING | CTF_PINK_FLAG_TAKEN | CTF_PINK_FLAG_LOST
if(flag.team == NUM_TEAM_2 && !b2) { b2 = true; t = CTF_BLUE_FLAG_CARRYING; t2 = CTF_BLUE_FLAG_TAKEN; t3 = CTF_BLUE_FLAG_LOST; }
if(flag.team == NUM_TEAM_3 && !b3) { b3 = true; t = CTF_YELLOW_FLAG_CARRYING; t2 = CTF_YELLOW_FLAG_TAKEN; t3 = CTF_YELLOW_FLAG_LOST; }
if(flag.team == NUM_TEAM_4 && !b4) { b4 = true; t = CTF_PINK_FLAG_CARRYING; t2 = CTF_PINK_FLAG_TAKEN; t3 = CTF_PINK_FLAG_LOST; }
- if(flag.team == 0 && !b5) { b5 = true; t = CTF_NEUTRAL_FLAG_CARRYING; t2 = CTF_NEUTRAL_FLAG_TAKEN; t3 = CTF_NEUTRAL_FLAG_LOST; STAT(CTF_FLAGSTATUS, player) |= CTF_FLAG_NEUTRAL; }
+ if(flag.team == 0 && !b5) { b5 = true; t = CTF_NEUTRAL_FLAG_CARRYING; t2 = CTF_NEUTRAL_FLAG_TAKEN; t3 = CTF_NEUTRAL_FLAG_LOST; STAT(OBJECTIVE_STATUS, player) |= CTF_FLAG_NEUTRAL; }
switch(flag.ctf_status)
{
case FLAG_CARRY:
{
if((flag.owner == player) || (flag.pass_sender == player))
- STAT(CTF_FLAGSTATUS, player) |= t; // carrying: player is currently carrying the flag
+ STAT(OBJECTIVE_STATUS, player) |= t; // carrying: player is currently carrying the flag
else
- STAT(CTF_FLAGSTATUS, player) |= t2; // taken: someone else is carrying the flag
+ STAT(OBJECTIVE_STATUS, player) |= t2; // taken: someone else is carrying the flag
break;
}
case FLAG_DROPPED:
{
- STAT(CTF_FLAGSTATUS, player) |= t3; // lost: the flag is dropped somewhere on the map
+ STAT(OBJECTIVE_STATUS, player) |= t3; // lost: the flag is dropped somewhere on the map
break;
}
}
// item for stopping players from capturing the flag too often
if(player.ctf_captureshielded)
- STAT(CTF_FLAGSTATUS, player) |= CTF_SHIELDED;
+ STAT(OBJECTIVE_STATUS, player) |= CTF_SHIELDED;
if(ctf_stalemate)
- STAT(CTF_FLAGSTATUS, player) |= CTF_STALEMATE;
+ STAT(OBJECTIVE_STATUS, player) |= CTF_STALEMATE;
// update the health of the flag carrier waypointsprite
if(player.wps_flagcarrier)
M_ARGV(1, string) = "ctf_team";
}
-MUTATOR_HOOKFUNCTION(ctf, SpectateCopy)
-{
- entity spectatee = M_ARGV(0, entity);
- entity client = M_ARGV(1, entity);
-
- STAT(CTF_FLAGSTATUS, client) = STAT(CTF_FLAGSTATUS, spectatee);
-}
-
MUTATOR_HOOKFUNCTION(ctf, GetRecords)
{
int record_page = M_ARGV(0, int);
float kaball_alpha = blink(0.85, 0.15, 5);
- int stat_items = STAT(ITEMS);
- int kaball = (stat_items/IT_KEY1) & 1;
+ int kaball = (STAT(OBJECTIVE_STATUS) & KA_CARRYING);
if(kaball != kaball_prevstatus)
{
#endif
ENDCLASS(Keepaway)
REGISTER_GAMETYPE(KEEPAWAY, NEW(Keepaway));
+
+#ifdef GAMEQC
+const int KA_CARRYING = BIT(0);
+#endif
{
entity player = M_ARGV(0, entity);
- // clear the item used for the ball in keepaway
- player.items &= ~IT_KEY1;
-
// if the player has the ball, make sure they have the item for it (Used for HUD primarily)
- if(player.ballcarried)
- player.items |= IT_KEY1;
+ STAT(OBJECTIVE_STATUS, player) = BITSET(STAT(OBJECTIVE_STATUS, player), KA_CARRYING, player.ballcarried != NULL);
}
MUTATOR_HOOKFUNCTION(ka, PlayerUseKey)
mod_active = 1; // keyhunt should never hide the mod icons panel
// Read current state
- int state = STAT(KH_KEYS);
+ int state = STAT(OBJECTIVE_STATUS);
if(!state) return;
int i, key_state;
s |= (32 ** key.count) * f;
}
- FOREACH_CLIENT(true, { STAT(KH_KEYS, it) = s; });
+ FOREACH_CLIENT(true, { STAT(OBJECTIVE_STATUS, it) = s; });
FOR_EACH_KH_KEY(key)
{
if(key.owner)
- STAT(KH_KEYS, key.owner) |= (32 ** key.count) * 31;
+ STAT(OBJECTIVE_STATUS, key.owner) |= (32 ** key.count) * 31;
}
//print(ftos((nextent(NULL)).kh_state), "\n");
}
settouch(key, kh_Key_Touch);
setthink(key, kh_Key_Think);
key.nextthink = time;
- key.items = IT_KEY1 | IT_KEY2;
key.cnt = _angle;
key.angles = '0 360 0' * random();
key.event_damage = kh_Key_Damage;
return true;
}
-MUTATOR_HOOKFUNCTION(kh, SpectateCopy)
-{
- entity spectatee = M_ARGV(0, entity);
- entity client = M_ARGV(1, entity);
-
- STAT(KH_KEYS, client) = STAT(KH_KEYS, spectatee);
-}
-
MUTATOR_HOOKFUNCTION(kh, PlayerUseKey)
{
entity player = M_ARGV(0, entity);
// Nexball HUD mod icon
void HUD_Mod_NexBall(vector pos, vector mySize)
{
- float nb_pb_starttime, dt, p;
- int stat_items;
+ int stat_items = STAT(OBJECTIVE_STATUS);
+ float nb_pb_starttime = STAT(NB_METERSTART);
- stat_items = STAT(ITEMS);
- nb_pb_starttime = STAT(NB_METERSTART);
-
- if (stat_items & IT_KEY1)
- mod_active = 1;
- else
- mod_active = 0;
+ mod_active = (stat_items & NB_CARRYING);
//Manage the progress bar if any
if (nb_pb_starttime > 0)
{
- dt = (time - nb_pb_starttime) % nb_pb_period;
+ float dt = (time - nb_pb_starttime) % nb_pb_period;
// one period of positive triangle
- p = 2 * dt / nb_pb_period;
+ float p = 2 * dt / nb_pb_period;
if (p > 1)
p = 2 - p;
HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", p, (mySize.x <= mySize.y), 0, autocvar_hud_progressbar_nexball_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- if (stat_items & IT_KEY1)
+ if (stat_items & NB_CARRYING)
drawpic_aspect_skin(pos, "nexball_carrying", eX * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
}
ENDCLASS(NexBall)
REGISTER_GAMETYPE(NEXBALL, NEW(NexBall));
#define g_nexball IS_GAMETYPE(NEXBALL)
+
+#ifdef GAMEQC
+const int NB_CARRYING = BIT(0);
+#endif
void nexball_setstatus(entity this)
{
- this.items &= ~IT_KEY1;
+ STAT(OBJECTIVE_STATUS, this) &= ~NB_CARRYING;
if(this.ballcarried)
{
if(this.ballcarried.lifetime && (this.ballcarried.lifetime < time))
ResetBall(e);
}
else
- this.items |= IT_KEY1;
+ STAT(OBJECTIVE_STATUS, this) |= NB_CARRYING;
}
}
#include "bugrigs.qh"
+#ifdef SVQC // NOTE: disabled on the client side until prediction can be fixed!
+
#ifdef GAMEQC
#ifdef SVQC
#endif
+#if 0
#define PHYS_BUGRIGS(s) STAT(BUGRIGS, s)
#define PHYS_BUGRIGS_ACCEL(s) STAT(BUGRIGS_ACCEL, s)
#define PHYS_BUGRIGS_AIR_STEERING(s) STAT(BUGRIGS_AIR_STEERING, s)
#define PHYS_BUGRIGS_SPEED_POW(s) STAT(BUGRIGS_SPEED_POW, s)
#define PHYS_BUGRIGS_SPEED_REF(s) STAT(BUGRIGS_SPEED_REF, s)
#define PHYS_BUGRIGS_STEER(s) STAT(BUGRIGS_STEER, s)
+#else
+#define PHYS_BUGRIGS(s) g_bugrigs
+#define PHYS_BUGRIGS_ACCEL(s) g_bugrigs_accel
+#define PHYS_BUGRIGS_AIR_STEERING(s) g_bugrigs_air_steering
+#define PHYS_BUGRIGS_ANGLE_SMOOTHING(s) g_bugrigs_angle_smoothing
+#define PHYS_BUGRIGS_CAR_JUMPING(s) g_bugrigs_planar_movement_car_jumping
+#define PHYS_BUGRIGS_FRICTION_AIR(s) g_bugrigs_friction_air
+#define PHYS_BUGRIGS_FRICTION_BRAKE(s) g_bugrigs_friction_brake
+#define PHYS_BUGRIGS_FRICTION_FLOOR(s) g_bugrigs_friction_floor
+#define PHYS_BUGRIGS_PLANAR_MOVEMENT(s) g_bugrigs_planar_movement
+#define PHYS_BUGRIGS_REVERSE_SPEEDING(s) g_bugrigs_reverse_speeding
+#define PHYS_BUGRIGS_REVERSE_SPINNING(s) g_bugrigs_reverse_spinning
+#define PHYS_BUGRIGS_REVERSE_STOPPING(s) g_bugrigs_reverse_stopping
+#define PHYS_BUGRIGS_SPEED_POW(s) g_bugrigs_speed_pow
+#define PHYS_BUGRIGS_SPEED_REF(s) g_bugrigs_speed_ref
+#define PHYS_BUGRIGS_STEER(s) g_bugrigs_steer
+#endif
#if defined(SVQC)
#endif
#endif
+
+#endif
if (!CheatImpulse(this, CHIMPULSE_GIVE_ALL.impulse))
LOG_INFO("A hollow voice says \"Plugh\".");
}
- else
- STAT(MOVEVARS_SPECIALCOMMAND, this) = true;
}
#endif
REGISTER_STAT(PL_MAX, vector)
REGISTER_STAT(PL_CROUCH_MAX, vector)
-REGISTER_STAT(KH_KEYS, int)
+// networked bitflag for game objective display (modicons)
+REGISTER_STAT(OBJECTIVE_STATUS, int)
+#ifdef SVQC
+SPECTATE_COPYFIELD(_STAT(OBJECTIVE_STATUS))
+#endif
#ifdef SVQC
float W_WeaponRateFactor(entity this);
float game_stopped;
float game_starttime; //point in time when the countdown to game start is over
float round_starttime; //point in time when the countdown to round start is over
-bool autocvar_g_allow_oldvortexbeam;
int autocvar_leadlimit;
// TODO: world.qh can't be included here due to circular includes!
#define autocvar_fraglimit cvar("fraglimit")
REGISTER_STAT(INVINCIBLE_FINISHED, float)
/** arc heat in [0,1] */
REGISTER_STAT(PRESSED_KEYS, int)
-/** this stat could later contain some other bits of info, like, more server-side particle config */
-REGISTER_STAT(ALLOW_OLDVORTEXBEAM, bool, autocvar_g_allow_oldvortexbeam)
REGISTER_STAT(FUEL, int)
REGISTER_STAT(NB_METERSTART, float)
/** compressShotOrigin */
REGISTER_STAT(REVIVE_PROGRESS, float)
REGISTER_STAT(ROUNDLOST, int)
REGISTER_STAT(BUFF_TIME, float)
-REGISTER_STAT(CTF_FLAGSTATUS, int)
REGISTER_STAT(CAPTURE_PROGRESS, float)
REGISTER_STAT(ENTRAP_ORB, float)
REGISTER_STAT(ENTRAP_ORB_ALPHA, float)
float g_bugrigs_speed_pow;
float g_bugrigs_steer;
#endif
+#if 0
REGISTER_STAT(BUGRIGS, int, g_bugrigs)
REGISTER_STAT(BUGRIGS_ACCEL, float, g_bugrigs_accel)
REGISTER_STAT(BUGRIGS_AIR_STEERING, int, g_bugrigs_air_steering)
REGISTER_STAT(BUGRIGS_SPEED_POW, float, g_bugrigs_speed_pow)
REGISTER_STAT(BUGRIGS_SPEED_REF, float, g_bugrigs_speed_ref)
REGISTER_STAT(BUGRIGS_STEER, float, g_bugrigs_steer)
+#endif
#ifdef SVQC
int autocvar_sv_gameplayfix_downtracesupportsongroundflag = 1;
REGISTER_STAT(MOVEVARS_STEPHEIGHT, float, autocvar_sv_stepheight)
REGISTER_STAT(MOVEVARS_AIRACCEL_QW, float)
REGISTER_STAT(MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION, float)
-REGISTER_STAT(MOVEVARS_SPECIALCOMMAND, bool)
#ifdef SVQC
int autocvar_sv_wallclip;
#endif
Draw_VaporizerBeam_trace_callback_tex = string_null;
/*if(!MUTATOR_CALLHOOK(Particles_VaporizerBeam, this.vorg1, this.vorg2))
- if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo()))
+ if(autocvar_cl_particles_oldvortexbeam)
WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
else
WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);*/
if(!MUTATOR_CALLHOOK(Particles_VortexBeam, shotorg, endpos))
{
- if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo()))
+ if(autocvar_cl_particles_oldvortexbeam)
WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
else
WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
STAT(SUPERWEAPONS_FINISHED, this) = 0;
STAT(AIR_FINISHED, this) = 0;
- STAT(MOVEVARS_SPECIALCOMMAND, this) = false; // sweet release
-
this.death_time = time;
if (random() < 0.5)
animdecide_setstate(this, this.anim_state | ANIMSTATE_DEAD1, true);
set sv_timeout_leadtime 4 "how long the players will be informed that a timeout was called before it starts, in seconds"
set sv_timeout_resumetime 3 "how long the remaining timeout-time will be after a player called the timein command"
-set g_allow_oldvortexbeam 1 "If enabled, clients are allowed to use old v2.3 Vortex beam"
-
set g_telefrags 1 "telefragging, i.e. killing someone who stands in the way of someone who is teleporting"
set g_telefrags_teamplay 1 "never telefrag team mates"
set g_telefrags_avoid 1 "when teleporters have a random destination, avoid teleporting to locations where a telefrag would happen"