string autocvar_hud_skin;
float autocvar_menu_mouse_speed;
string autocvar_menu_skin;
-float autocvar_r_drawviewmodel;
int autocvar_r_fakelight;
int autocvar_r_fullbright;
float autocvar_r_letterbox;
float autocvar_crosshair_rpc_alpha = 1;
float autocvar_crosshair_rpc_size = 1;
int autocvar_cl_nade_timer;
+bool autocvar_r_drawviewmodel;
bool autocvar_cl_items_nofade;
float g_trueaim_minrange;
-float hud;
+int hud;
float view_quality;
int num_spectators;
/** is new to client */ i(bool, MUTATOR_ARGV_1_bool) \
/**/
MUTATOR_HOOKABLE(Ent_Update, EV_Ent_Update);
+
+/** Return true to not draw crosshair */
+MUTATOR_HOOKABLE(DrawCrosshair, EV_NO_ARGS);
float f, i, j;
vector v;
if(!scoreboard_active && !camera_active && intermission != 2 &&
- spectatee_status != -1 && !csqcplayer.viewloc &&
+ spectatee_status != -1 && !csqcplayer.viewloc && !MUTATOR_CALLHOOK(DrawCrosshair) &&
!HUD_MinigameMenu_IsOpened() )
{
if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering
DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(NADE_TIMER), '0.25 0.90 1' + ('1 0 0' * STAT(NADE_TIMER)) - ('0 1 1' * STAT(NADE_TIMER)), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
}
+ else if(STAT(CAPTURE_PROGRESS))
+ {
+ DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(CAPTURE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+ drawstring_aspect(eY * 0.64 * vid_conheight, _("Capture progress"), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
+ }
else if(STAT(REVIVE_PROGRESS))
{
DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
float oldr_useinfinitefarclip;
void cl_notice_run();
+
float prev_myteam;
int lasthud;
float vh_notice_time;
else if(csqcplayer.viewloc) { setproperty(VF_FOV, GetViewLocationFOV(110)); } // enforce 110 fov, so things dont look odd
else { setproperty(VF_FOV, GetCurrentFov(fov)); }
- // Camera for demo playback
- if(camera_active)
+ if(camera_active) // Camera for demo playback
{
if(autocvar_camera_enable)
CSQC_Demo_Camera();
.float teleport_antispam;
-.bool ons_roundlost = _STAT(ROUNDLOST);
-
// waypoint sprites
.entity bot_basewaypoint; // generator waypointsprite
round_handler_Init(7, autocvar_g_onslaught_warmup, autocvar_g_onslaught_round_timelimit);
FOREACH_CLIENT(IS_PLAYER(it), {
- it.ons_roundlost = true;
+ STAT(ROUNDLOST, it) = true;
it.player_blocked = true;
nades_Clear(it);
MUTATOR_HOOKFUNCTION(ons, reset_map_global)
{
FOREACH_CLIENT(IS_PLAYER(it), {
- it.ons_roundlost = false;
+ STAT(ROUNDLOST, it) = false;
it.ons_deathloc = '0 0 0';
PutClientInServer(it);
});
entity spectatee = M_ARGV(0, entity);
entity client = M_ARGV(1, entity);
- client.ons_roundlost = spectatee.ons_roundlost; // make spectators see it too
+ STAT(ROUNDLOST, client) = STAT(ROUNDLOST, spectatee); // make spectators see it too
}
MUTATOR_HOOKFUNCTION(ons, SV_ParseClientCommand)
|| (SAME_TEAM(targ, this))
|| (STAT(FROZEN, targ))
|| (targ.alpha != 0 && targ.alpha < 0.5)
+ || (MUTATOR_CALLHOOK(MonsterValidTarget, this, targ))
)
{
// if any of the above checks fail, target is not valid
if(IS_PLAYER(player))
if(IS_REAL_CLIENT(player)) // bots may camp, but that's no reason to constantly kill them
if(!IS_DEAD(player))
+ if(!forbidWeaponUse(player))
if(!STAT(FROZEN, player))
if(!PHYS_INPUT_BUTTON_CHAT(player))
if(autocvar_g_campcheck_interval)
if(it.msnt_timer < time)
if(SAME_TEAM(player, it))
if(time > it.spawnshieldtime) // spawn shielding
+ if(!forbidWeaponUse(it))
if(STAT(FROZEN, it) == 0)
if(it != player)
{
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)
REGISTER_STAT(ITEMSTIME, int, autocvar_sv_itemstime)
}
#endif
+
/*
==============================
SUB_UseTargets
==============================
*/
-void SUB_UseTargets(entity this, entity actor, entity trigger)
+
+void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventReuse)
{
//
// check for a delay
int aw_flag = this.antiwall_flag;
for(entity t = NULL; (t = find(t, targetname, s)); )
{
- if(t.use)
+ if(t.use && (t.sub_target_used != time || !preventReuse))
{
if(this.target_random)
{
t.antiwall_flag = aw_flag;
t.use(t, actor, this);
+ if(preventReuse)
+ t.sub_target_used = time;
}
}
}
}
if(this.target_random && RandomSelection_chosen_ent)
+ {
RandomSelection_chosen_ent.use(RandomSelection_chosen_ent, actor, this);
+ if(preventReuse)
+ RandomSelection_chosen_ent.sub_target_used = time;
+ }
}
+void SUB_UseTargets(entity this, entity actor, entity trigger) { SUB_UseTargets_Ex(this, actor, trigger, false); }
+void SUB_UseTargets_PreventReuse(entity this, entity actor, entity trigger) { SUB_UseTargets_Ex(this, actor, trigger, true); }
+
void SUB_UseTargets_self(entity this)
{
SUB_UseTargets(this, NULL, NULL);
void target_voicescript_next(entity pl);
void target_voicescript_clear(entity pl);
+
+void SUB_ForEachTarget_Init();
+void SUB_ForEachTarget(entity s, void(entity, float, vector, string, entity) cback, float recursive, float fdata, vector vdata, string sdata, entity edata);
+void SUB_UseTargets_PreventReuse(entity this, entity actor, entity trigger);
#endif
+.float sub_target_used;
+
.float volume, atten;
.vector dest;
#define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? true : false)
#define MISSILE_IS_TRACKING(m) ((m.missile_flags & MIF_GUIDED_TRACKING) ? true : false)
-
////
.entity player_stats;
/** called when a monster looks for another target */
MUTATOR_HOOKABLE(MonsterFindTarget, EV_NO_ARGS);
+/**
+ * called when validating a monster's target
+ */
+#define EV_MonsterValidTarget(i, o) \
+ /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
+ /** target */ i(entity, MUTATOR_ARGV_1_entity) \
+ /**/
+MUTATOR_HOOKABLE(MonsterValidTarget, EV_MonsterValidTarget);
+
/** called to change a random monster to a miniboss */
#define EV_MonsterCheckBossFlag(i, o) \
/** monster */ i(entity, MUTATOR_ARGV_0_entity) \
/** data */ i(string, MUTATOR_ARGV_2_string) \
/**/
MUTATOR_HOOKABLE(URI_GetCallback, EV_URI_GetCallback);
+
+/**
+ * return true to prevent weapon use for a player
+ */
+ #define EV_ForbidWeaponUse(i, o) \
+ /** player */ i(entity, MUTATOR_ARGV_0_entity) \
+ /**/
+MUTATOR_HOOKABLE(ForbidWeaponUse, EV_ForbidWeaponUse);
#pragma once
#include "../gamemode.qh"
+
+void AnimateDomPoint(entity this);
if (gameover) return true;
if (STAT(FROZEN, player)) return true;
if (player.weapon_blocked) return true;
+ if (MUTATOR_CALLHOOK(ForbidWeaponUse, player)) return true;
return false;
}
vector CL_Weapon_GetShotOrg(float wpn);
-float forbidWeaponUse(entity player);
+bool forbidWeaponUse(entity player);
void W_AttachToShotorg(entity actor, .entity weaponentity, entity flash, vector offset);