-Fri Mar 6 07:24:27 CET 2020
+Sun Mar 29 07:24:37 CEST 2020
seta hud_progressbar_health_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_armor_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_fuel_color "" "R G B vector of the progress bar background color"
+seta hud_progressbar_oxygen_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_nexball_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_speed_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_acceleration_color "" "R G B vector of the progress bar background color"
#
# Translators:
# Ximielga <dorian@openmailbox.org>, 2014-2015
-# Ḷḷumex03 <tornes@opmbx.org>, 2014
-# Ḷḷumex03 <tornes@opmbx.org>, 2014-2015
+# Ḷḷumex03, 2014
+# Ḷḷumex03, 2014-2015
# Tornes Ḷḷume <tornes.llume@openmailbox.org>, 2015-2017
# Ximielga <dorian@openmailbox.org>, 2014
msgid ""
// ===========
// this means that timelimit can be overidden globally and fraglimit can be overidden for each game mode: DM/TDM, Domination, CTF, and Runematch.
set leadlimit 0
-set leadlimit_and_fraglimit 0 "if set, leadlimit is ANDed with fraglimit (otherwise ORed)"
+set leadlimit_and_fraglimit 0 "both leadlimit AND fraglimit must be reached"
set timelimit_override -1 "Time limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
set fraglimit_override -1 "Frag limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
set leadlimit_override -1 "Lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
seta hud_progressbar_health_color "0.83 0.12 0"
seta hud_progressbar_armor_color "0.28 0.8 0"
seta hud_progressbar_fuel_color "0.77 0.67 0"
+seta hud_progressbar_oxygen_color "0.1 1 1"
seta hud_progressbar_nexball_color "0.2 0.65 0.93"
seta hud_progressbar_speed_color "0.77 0.67 0"
seta hud_progressbar_acceleration_color "0.2 0.65 0.93"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
set g_campcheck_interval 10
set g_campcheck_damage 100
set g_campcheck_distance 1800
+set g_campcheck_typecheck 0 "damage campers who are typing"
// ==========
set g_random_items 0 "Whether to enable random items."
set g_random_loot 0 "Whether to enable random loot."
exec randomitems-xonotic.cfg
+
+// ===============
+// pinata
+// ===============
+set g_pinata 0 "if set to 1 you will not only drop your current weapon when you are killed, but you will drop all weapons that you possessed"
+set g_pinata_offhand 0 "if enabled, the second weapon will drop as well while dual wielding"
float autocvar_hud_progressbar_alpha;
vector autocvar_hud_progressbar_armor_color;
vector autocvar_hud_progressbar_fuel_color;
+vector autocvar_hud_progressbar_oxygen_color = '0.1 1 1';
vector autocvar_hud_progressbar_health_color;
vector autocvar_hud_progressbar_nexball_color;
vector autocvar_hud_progressbar_shield_color;
float autocvar_cl_hitsound_antispam_time;
bool autocvar_cl_eventchase_spectated_change = false;
float autocvar_cl_eventchase_spectated_change_time = 1;
-int autocvar_cl_eventchase_death = 1;
+int autocvar_cl_eventchase_death = 2;
float autocvar_cl_eventchase_distance = 140;
bool autocvar_cl_eventchase_frozen = false;
float autocvar_cl_eventchase_speed = 1.3;
HUD_Write_Cvar("hud_progressbar_health_color");
HUD_Write_Cvar("hud_progressbar_armor_color");
HUD_Write_Cvar("hud_progressbar_fuel_color");
+ HUD_Write_Cvar("hud_progressbar_oxygen_color");
HUD_Write_Cvar("hud_progressbar_nexball_color");
HUD_Write_Cvar("hud_progressbar_speed_color");
HUD_Write_Cvar("hud_progressbar_acceleration_color");
void HUD_HealthArmor()
{
- int armor, health, fuel;
+ int armor, health, fuel, air_time;
if(!autocvar__hud_configure)
{
if((!autocvar_hud_panel_healtharmor) || (spectatee_status == -1))
prev_armor = 0;
}
fuel = STAT(FUEL);
+ air_time = bound(0, STAT(AIR_FINISHED) - time, 10);
}
else
{
health = 150;
armor = 75;
fuel = 20;
+ air_time = 6;
}
HUD_Panel_LoadCvars();
mySize -= '2 2 0' * panel_bg_padding;
}
+ float air_alpha = 1;
+ if (STAT(AIR_FINISHED) && time > STAT(AIR_FINISHED))
+ {
+ air_alpha = blink_synced(0.5, 0.5, 7, STAT(AIR_FINISHED), -1);
+ air_time = 10;
+ }
+
int baralign = autocvar_hud_panel_healtharmor_baralign;
int iconalign = autocvar_hud_panel_healtharmor_iconalign;
if(fuel)
HUD_Panel_DrawProgressBar(pos, vec2(mySize.x, 0.2 * mySize.y), "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ if(air_time)
+ HUD_Panel_DrawProgressBar(pos + eY * 0.8 * mySize.y, vec2(mySize.x, 0.2 * mySize.y), "progressbar", air_time / 10, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_oxygen_color, air_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
else
{
armor_offset.y = mySize.y;
}
- bool health_baralign, armor_baralign, fuel_baralign;
+ bool health_baralign, armor_baralign, fuel_baralign, air_align;
bool health_iconalign, armor_iconalign;
if (autocvar_hud_panel_healtharmor_flip)
{
armor_baralign = (autocvar_hud_panel_healtharmor_baralign == 2 || autocvar_hud_panel_healtharmor_baralign == 1);
health_baralign = (autocvar_hud_panel_healtharmor_baralign == 3 || autocvar_hud_panel_healtharmor_baralign == 1);
- fuel_baralign = health_baralign;
+ air_align = fuel_baralign = health_baralign;
armor_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 2 || autocvar_hud_panel_healtharmor_iconalign == 1);
health_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 3 || autocvar_hud_panel_healtharmor_iconalign == 1);
}
{
health_baralign = (autocvar_hud_panel_healtharmor_baralign == 2 || autocvar_hud_panel_healtharmor_baralign == 1);
armor_baralign = (autocvar_hud_panel_healtharmor_baralign == 3 || autocvar_hud_panel_healtharmor_baralign == 1);
- fuel_baralign = armor_baralign;
+ air_align = fuel_baralign = armor_baralign;
health_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 2 || autocvar_hud_panel_healtharmor_iconalign == 1);
armor_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 3 || autocvar_hud_panel_healtharmor_iconalign == 1);
}
if (health <= autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth)
{
- float BLINK_FACTOR = 0.15;
- float BLINK_BASE = 0.85;
- float BLINK_FREQ = 9;
- pain_health_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
+ pain_health_alpha = blink(0.85, 0.15, 9);
}
}
HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, p_health/maxhealth, is_vertical, health_baralign, autocvar_hud_progressbar_health_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * pain_health_alpha, DRAWFLAG_NORMAL);
DrawNumIcon(pos + armor_offset, mySize, armor, "armor", is_vertical, armor_iconalign, HUD_Get_Num_Color(armor, maxarmor), 1);
}
- if(fuel)
+ vector cell_size = mySize;
+ if (fuel || air_time)
{
if (is_vertical)
mySize.x *= 0.2 / 2; //if vertical always halve x to not cover too much numbers with 3 digits
mySize.x *= 2; //restore full panel size
else if (panel_ar < 1/4)
mySize.y *= 2; //restore full panel size
- HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, fuel_baralign, autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ if (fuel)
+ HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, fuel_baralign, autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ if (air_time)
+ {
+ if (panel_ar > 1 && panel_ar < 4)
+ pos.y += cell_size.y;
+ else if (panel_ar > 1/4 && panel_ar <= 1)
+ pos.x += cell_size.x;
+ if (is_vertical)
+ pos.x += cell_size.x - mySize.x;
+ else
+ pos.y += cell_size.y - mySize.y;
+ HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", air_time / 10, is_vertical, air_align, autocvar_hud_progressbar_oxygen_color, air_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ }
}
}
return boxsize * (0.5 * (1 - sz));
}
+// NOTE base is the central value
+// freq: circle frequency, = 2*pi*frequency in hertz
+// start_pos:
+// -1 start from the lower value
+// 0 start from the base value
+// 1 start from the higher value
+float blink_synced(float base, float range, float freq, float start_time, int start_pos)
+{
+ // note:
+ // RMS = sqrt(base^2 + 0.5 * range^2)
+ // thus
+ // base = sqrt(RMS^2 - 0.5 * range^2)
+ // ensure RMS == 1
+
+ return base + range * sin((time - start_time - (M_PI / 2) * start_pos) * freq);
+}
+
+float blink(float base, float range, float freq)
+{
+ return blink_synced(base, range, freq, 0, 0);
+}
+
void drawborderlines(float thickness, vector pos, vector dim, vector color, float theAlpha, float drawflag)
{
vector line_dim = '0 0 0';
vector expandingbox_resize_centered_box_offset(float sz, vector boxsize, float boxxsizefactor);
+float blink_synced(float base, float range, float freq, float start_time, int start_blink);
+float blink(float base, float range, float freq);
+
void drawborderlines(float thickness, vector pos, vector dim, vector color, float theAlpha, float drawflag);
void drawpic_tiled(vector pos, string pic, vector sz, vector area, vector color, float theAlpha, float drawflag);
}
if (autocvar_crosshair_ring_inner && ring_inner_value) // lets draw a ring inside a ring so you can ring while you ring
- DrawCircleClippedPic(wcross_origin, wcross_size.x * ring_scale, ring_inner_image, ring_inner_value, ring_inner_rgb, wcross_alpha * ring_inner_alpha, DRAWFLAG_ADDITIVE);
+ DrawCircleClippedPic(wcross_origin, wcross_size.x * wcross_resolution * ring_scale, ring_inner_image, ring_inner_value, ring_inner_rgb, wcross_alpha * ring_inner_alpha, DRAWFLAG_ADDITIVE);
if (ring_value)
- DrawCircleClippedPic(wcross_origin, wcross_size.x * ring_scale, ring_image, ring_value, ring_rgb, wcross_alpha * ring_alpha, DRAWFLAG_ADDITIVE);
+ DrawCircleClippedPic(wcross_origin, wcross_size.x * wcross_resolution * ring_scale, ring_image, ring_value, ring_rgb, wcross_alpha * ring_alpha, DRAWFLAG_ADDITIVE);
}
#define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \
X(neutral);
#undef X
- const float BLINK_FACTOR = 0.15;
- const float BLINK_BASE = 0.85;
- // note:
- // RMS = sqrt(BLINK_BASE^2 + 0.5 * BLINK_FACTOR^2)
- // thus
- // BLINK_BASE = sqrt(RMS^2 - 0.5 * BLINK_FACTOR^2)
- // ensure RMS == 1
- const float BLINK_FREQ = 5; // circle frequency, = 2*pi*frequency in hertz
-
#define X(team, cond) \
string team##_icon = string_null, team##_icon_prevstatus = string_null; \
int team##_alpha, team##_alpha_prevstatus; \
switch (team##flag) { \
case 1: team##_icon = "flag_" #team "_taken"; break; \
case 2: team##_icon = "flag_" #team "_lost"; break; \
- case 3: team##_icon = "flag_" #team "_carrying"; team##_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; \
+ case 3: team##_icon = "flag_" #team "_carrying"; team##_alpha = blink(0.85, 0.15, 5); break; \
default: \
if ((stat_items & CTF_SHIELDED) && (cond)) { \
team##_icon = "flag_" #team "_shielded"; \
switch (team##flag_prevstatus) { \
case 1: team##_icon_prevstatus = "flag_" #team "_taken"; break; \
case 2: team##_icon_prevstatus = "flag_" #team "_lost"; break; \
- case 3: team##_icon_prevstatus = "flag_" #team "_carrying"; team##_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; \
+ case 3: team##_icon_prevstatus = "flag_" #team "_carrying"; team##_alpha_prevstatus = blink(0.85, 0.15, 5); break; \
default: \
if (team##flag == 3) { \
team##_icon_prevstatus = "flag_" #team "_carrying"; /* make it more visible */\
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
- TeamScore_AddToTeam(winner_team, ST_SCORE, +1);
+ TeamScore_AddToTeam(winner_team, ST_FT_ROUNDS, +1);
}
else if(winner_team == -1)
{
return false;
}
+MUTATOR_HOOKFUNCTION(ft, Scores_CountFragsRemaining)
+{
+ // announce remaining frags
+ return true;
+}
+
void freezetag_Initialize()
{
freezetag_teams = autocvar_g_freezetag_teams_override;
freezetag_teams = BITS(bound(2, freezetag_teams, 4));
GameRules_scoring(freezetag_teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
+ field_team(ST_FT_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
field(SP_FREEZETAG_REVIVALS, "revivals", 0);
});
bool autocvar_g_freezetag_team_spawns;
string autocvar_g_freezetag_weaponarena = "most_available";
+const int ST_FT_ROUNDS = 1;
+
void freezetag_Initialize();
REGISTER_MUTATOR(ft, false)
{
mod_active = 1; // keepaway should always show the mod HUD
- float BLINK_FACTOR = 0.15;
- float BLINK_BASE = 0.85;
- float BLINK_FREQ = 5;
- float kaball_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
+ float kaball_alpha = blink(0.85, 0.15, 5);
int stat_items = STAT(ITEMS);
int kaball = (stat_items/IT_KEY1) & 1;
float autocvar_g_campcheck_damage;
float autocvar_g_campcheck_distance;
float autocvar_g_campcheck_interval;
+bool autocvar_g_campcheck_typecheck;
REGISTER_MUTATOR(campcheck, expr_evaluate(autocvar_g_campcheck));
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
- if(IS_PLAYER(frag_target))
- if(IS_PLAYER(frag_attacker))
- if(frag_attacker != frag_target)
+ if(frag_attacker != frag_target && IS_PLAYER(frag_target) && IS_PLAYER(frag_attacker))
{
frag_target.campcheck_traveled_distance = autocvar_g_campcheck_distance;
frag_attacker.campcheck_traveled_distance = autocvar_g_campcheck_distance;
if(autocvar_g_campcheck_interval)
if(!game_stopped && !warmup_stage && time >= game_starttime)
- if(IS_PLAYER(player))
- if(!IS_DEAD(player))
- if(!STAT(FROZEN, player))
- if(!PHYS_INPUT_BUTTON_CHAT(player))
- if(IS_REAL_CLIENT(player)) // bots may camp, but that's no reason to constantly kill them
+ if(IS_PLAYER(player) && !IS_DEAD(player) && !STAT(FROZEN, player))
+ if(autocvar_g_campcheck_typecheck || !PHYS_INPUT_BUTTON_CHAT(player))
+ if(IS_REAL_CLIENT(player)) // only apply to real clients (bots may "camp" due to missing waypoints in the map, but that's no reason to constantly kill them, clones can't move)
if(!weaponLocked(player))
{
// calculate player movement (in 2 dimensions only, so jumping on one spot doesn't count as movement)
if (autocvar_hud_panel_itemstime_hidespawned == 2)
picalpha = 1;
else if (item_available)
- {
- float BLINK_FACTOR = 0.15;
- float BLINK_BASE = 0.85;
- float BLINK_FREQ = 5;
- picalpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
- }
+ picalpha = blink(0.85, 0.15, 5);
else
picalpha = 0.5;
t = floor(item_time - time + 0.999);
#include "sv_pinata.qh"
string autocvar_g_pinata;
+bool autocvar_g_pinata_offhand;
REGISTER_MUTATOR(pinata, expr_evaluate(autocvar_g_pinata) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok));
MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
if(frag_target.(weaponentity).m_weapon == WEP_Null)
continue;
+ if(slot > 0 && !autocvar_g_pinata_offhand)
+ break;
+
FOREACH(Weapons, it != WEP_Null, {
if(STAT(WEAPONS, frag_target) & WepSet_FromWeapon(it))
if(frag_target.(weaponentity).m_weapon != it)
void PlayerState_attach(entity this)
{
- if (PS(this))
+ if (PS(this) && PS(this).m_client == this)
return;
this._ps = NEW(PlayerState, this);
REGISTER_STAT(DAMAGE_DEALT_TOTAL, int)
REGISTER_STAT(TYPEHIT_TIME, float)
REGISTER_STAT(SUPERWEAPONS_FINISHED, float)
+REGISTER_STAT(AIR_FINISHED, float)
REGISTER_STAT(VEHICLESTAT_HEALTH, int)
REGISTER_STAT(VEHICLESTAT_SHIELD, int)
REGISTER_STAT(VEHICLESTAT_ENERGY, int)
vector a = '0 0 0';
switch(fr)
{
+ default:
case WFRAME_IDLE: a = wepent.anim_idle; break;
case WFRAME_FIRE1: a = wepent.anim_fire1; break;
case WFRAME_FIRE2: a = wepent.anim_fire2; break;
- default:
case WFRAME_RELOAD: a = wepent.anim_reload; break;
}
a.z *= t;
}
.vector vorg1, vorg2;
-.float spawn_time;
void VaporizerBeam_Draw(entity this)
{
//draw either the old v2.3 beam or the new beam
{
CSQCPlayer_CalcRefdef(view);
}
-
}
else
{
//const int PMF_DUCKED = 4;
//const int PMF_ONGROUND = 8;
-const int FL_DUCKED = 524288;
+const int FL_DUCKED = BIT(19);
void CSQCPlayer_SetCamera();
float CSQCPlayer_PreUpdate(entity this);
/** color code replace, place inside of sprintf and parse the string */
string CCR(string input)
{
- // See the autocvar declarations in util.qh for default values
-
// foreground/normal colors
input = strreplace("^F1", strcat("^", autocvar_hud_colorset_foreground_1), input);
input = strreplace("^F2", strcat("^", autocvar_hud_colorset_foreground_2), input);
}
bool isnan(float e)
{
- // the sane way to detect NaN is broken because of a compiler bug
- // (works with constants but breaks when assigned to variables)
- // use conversion to string instead
- //float f = e;
- //return (e != f);
+ // The sane way to detect NaN is this:
+ // float f = e;
+ // return (e != f);
+ // but darkplaces used to be compiled with -ffinite-math-only which broke it.
+ // DP is fixed now but until all clients update (so after 0.8.3) we have to use the following workaround
+ // or they'd have issues when connecting to newer servers.
// Negative NaN ("-nan") is much more common but plain "nan" can be created by negating *some* -nans so we need to check both.
// DP's QCVM and GMQCC's QCVM behave differently - one needs ftos(-(0.0 / 0.0)), the other ftos(-sqrt(-1)).
{
return fabs(e) * ((f>0) ? 1 : -1);
}
-/// Always use `isnan` function to compare because `float x = nan(); x == x;` gives true
+
float nan(string tag)
{
return sqrt(-1);
me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "chase_active", "0", _("1st person perspective")));
me.TR(me);
me.TDempty(me, 0.2);
- me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_eventchase_death", _("Slide to third person upon death")));
+ me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(2, 0, "cl_eventchase_death", _("Slide to third person upon death")));
setDependent(e, "chase_active", -1, 0);
me.TR(me);
me.TDempty(me, 0.2);
_("Brightness of white")));
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gamma:")));
- setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
+ setDependent(e, "vid_gl20", 1, 1);
me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "v_gamma",
_("Inverse gamma correction value, a brightness effect that does not affect white or black")));
- setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
+ setDependent(e, "vid_gl20", 1, 1);
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast boost:")));
- setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
+ setDependent(e, "vid_gl20", 1, 1);
me.TD(me, 1, 2, e = makeXonoticSlider_T(1.0, 5.0, 0.1, "v_contrastboost",
_("By how much to multiply the contrast in dark areas")));
- setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
+ setDependent(e, "vid_gl20", 1, 1);
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Saturation:")));
setDependent(e, "vid_gl20", 1, 1);
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
e.applyButton = videoApplyButton;
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "v_glslgamma", _("Use GLSL to handle color control"),
- _("Enable use of GLSL to apply gamma correction, note that it might decrease performance by a lot")));
- setDependent(e, "vid_gl20", 1, 1);
if(cvar("developer") > 0)
{
me.TR(me);
void bot_setnameandstuff(entity this)
{
string readfile, s;
- float file, tokens, prio;
-
- string bot_name, bot_model, bot_skin, bot_shirt, bot_pants;
- string name, prefix, suffix;
-
- if(autocvar_g_campaign)
- {
- prefix = "";
- suffix = "";
- }
- else
- {
- prefix = autocvar_bot_prefix;
- suffix = autocvar_bot_suffix;
- }
+ int file, tokens, prio;
file = fopen(autocvar_bot_config_file, FILE_READ);
fclose(file);
}
+ string bot_name, bot_model, bot_skin, bot_shirt, bot_pants;
+
tokens = tokenizebyseparator(readfile, "\t");
if(argv(0) != "") bot_name = argv(0);
else bot_name = "Bot";
setcolor(this, stof(bot_shirt) * 16 + stof(bot_pants));
this.bot_preferredcolors = this.clientcolors;
- // pick the name
- if (autocvar_bot_usemodelnames)
- name = bot_model;
- else
- name = bot_name;
+ string prefix = (autocvar_g_campaign ? "" : autocvar_bot_prefix);
+ string suffix = (autocvar_g_campaign ? "" : autocvar_bot_suffix);
+ string name = (autocvar_bot_usemodelnames ? bot_model : bot_name);
- // number bots with identical names
if (name == "")
{
name = ftos(etof(this));
}
else
{
+ // number bots with identical names
int j = 0;
FOREACH_CLIENT(IS_BOT_CLIENT(it), {
if(it.cleanname == name)
this.strength_finished = 0;
this.invincible_finished = 0;
this.superweapons_finished = 0;
+ this.air_finished_stat = 0;
//this.dphitcontentsmask = 0;
this.dphitcontentsmask = DPCONTENTS_SOLID;
if (autocvar_g_playerclip_collisions)
STAT(BUFFS, this) = 0;
STAT(BUFF_TIME, this) = 0;
- this.air_finished = time + 12;
+ this.air_finished = time + autocvar_g_balance_contents_drowndelay;
this.waterlevel = WATERLEVEL_NONE;
this.watertype = CONTENT_EMPTY;
this.strength_finished = spectatee.strength_finished;
this.invincible_finished = spectatee.invincible_finished;
this.superweapons_finished = spectatee.superweapons_finished;
+ this.air_finished_stat = spectatee.air_finished_stat;
STAT(PRESSED_KEYS, this) = STAT(PRESSED_KEYS, spectatee);
STAT(WEAPONS, this) = STAT(WEAPONS, spectatee);
this.punchangle = spectatee.punchangle;
if(this.air_finished < time)
PlayerSound(this, playersound_gasp, CH_PLAYER, VOL_BASE, VOICETYPE_PLAYERSOUND);
this.air_finished = time + autocvar_g_balance_contents_drowndelay;
+ this.air_finished_stat = 0;
}
else if (this.air_finished < time)
{ // drown!
Damage (this, NULL, NULL, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN.m_id, DMG_NOWEP, this.origin, '0 0 0');
this.pain_finished = time + 0.5;
}
+ this.air_finished_stat = this.air_finished;
}
+ else
+ this.air_finished_stat = this.air_finished;
}
.bool move_qcphysics;
.float crouch; // Crouching or not?
const .float superweapons_finished = _STAT(SUPERWEAPONS_FINISHED);
+const .float air_finished_stat = _STAT(AIR_FINISHED);
.float cnt; // used in too many places
.float count;
break;
}
}
-
+
if (i == Map_Count)
{
bprint( "Maplist contains no usable maps! Resetting it to default map list.\n" );
cvar_set("g_maplist", shufflewords(autocvar_g_maplist));
}
-float leaderfrags;
+float leaderscore;
+float secondscore;
+int fragsleft_last;
float WinningCondition_Scores(float limit, float leadlimit)
{
float limitreached;
if(MUTATOR_CALLHOOK(Scores_CountFragsRemaining))
// these modes always score in increments of 1, thus this makes sense
{
- if(leaderfrags != WinningConditionHelper_topscore)
+ if (leaderscore != WinningConditionHelper_topscore ||
+ secondscore != WinningConditionHelper_secondscore)
{
- leaderfrags = WinningConditionHelper_topscore;
+ int fragsleft = 0, leadingfragsleft = 0;
+
+ leaderscore = WinningConditionHelper_topscore;
+ secondscore = WinningConditionHelper_secondscore;
if (limit)
+ fragsleft = limit - leaderscore;
+ if (leadlimit)
+ leadingfragsleft = secondscore + leadlimit - leaderscore;
+
+ if (autocvar_leadlimit_and_fraglimit && leadlimit)
+ {
+ if (limit)
+ fragsleft = max(leadingfragsleft, fragsleft);
+ }
+ else if (leadlimit)
{
- if (leaderfrags == limit - 1)
+ if (limit)
+ fragsleft = min(fragsleft, leadingfragsleft);
+ else
+ fragsleft = leadingfragsleft;
+ }
+
+ if (fragsleft_last != fragsleft) // do not announce same remaining frags multiple times
+ {
+ if (fragsleft == 1)
Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_1);
- else if (leaderfrags == limit - 2)
+ else if (fragsleft == 2)
Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_2);
- else if (leaderfrags == limit - 3)
+ else if (fragsleft == 3)
Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_3);
+
+ fragsleft_last = fragsleft;
}
}
}
{
if (Ban_IsClientBanned(client, -1))
{
- string s = sprintf("^1NOTE:^7 banned client %s just tried to enter\n", client.netaddress);
+ if (!client.crypto_idfp)
+ LOG_INFOF("^1NOTE:^7 banned client %s just tried to enter\n",
+ client.netaddress);
+ else
+ LOG_INFOF("^1NOTE:^7 banned client %s (%s) just tried to enter\n",
+ client.netaddress, client.crypto_idfp);
+
if(autocvar_g_ban_telluser)
sprint(client, "You are banned from this server.\n");
dropclient(client);
- bprint(s);
return true;
}
return false;
reason = strcat(reason, ", ");
reason = strcat(reason, it.netname);
}
- s = strcat(s, "^1NOTE:^7 banned client ", it.netaddress, "^7 has to go\n");
+ s = strcat(s, "^1NOTE:^7 banned client ", it.netname, "^7 has to go\n");
dropclient(it);
}
});
float Cosine_Interpolate(float a, float b, float c)
{
- float ft = c * 3.1415927;
+ float ft = c * M_PI;
float f = (1 - cos(ft)) * 0.5;
return a*(1-f) + b*f;
this.flags &= ~FL_INWATER;
this.dmgtime = 0;
}
- this.air_finished = time + 12;
+ this.air_finished = time + autocvar_g_balance_contents_drowndelay;
}
}
bool restartanim;
if (fr == WFRAME_DONTCHANGE)
{
+ // this can happen when the weapon entity is newly spawned, since it has a clear state and no previous weapon frame
+ if (this.wframe == WFRAME_DONTCHANGE)
+ this.wframe = WFRAME_IDLE;
fr = this.wframe;
restartanim = false;
}
seta cl_eventchase_spectated_change 0 "camera goes into 3rd person mode for a moment when changing spectated player"
seta cl_eventchase_spectated_change_time 1 "how much time the effect lasts when changing spectated player"
-seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead; set to 2 to active the effect only when the corpse doesn't move anymore"
+seta cl_eventchase_death 2 "camera goes into 3rd person mode when the player is dead; set to 2 to active the effect only when the corpse doesn't move anymore"
seta cl_eventchase_frozen 0 "camera goes into 3rd person mode when the player is frozen"
seta cl_eventchase_nexball 1 "camera goes into 3rd person mode when in nexball game-mode"
seta cl_eventchase_distance 140 "final camera distance"
set g_shootfromeye 0 "shots are fired from your eye/crosshair; visual gun position can still be influenced by cl_gunalign 1 and 2"
set g_shootfromcenter 0 "weapon gets moved to the center, shots still come from the barrel of your weapon; visual gun position can still be influenced by cl_gunalign 1 and 2"
set g_shootfromfixedorigin "" "if set to a string like 0 y z, the gun is moved to the given y and z coordinates. If set to a string like x y z, the whole shot origin is used"
-set g_pinata 0 "if set to 1 you will not only drop your current weapon when you are killed, but you will drop all weapons that you possessed"
set g_weapon_stay 0 "1: ghost weapons can be picked up but give no ammo, thrown guns have ammo 2: ghost weapons can be picked up and refill ammo to one pickup size, thrown guns have no ammo (to prevent infinite ammo abuse)"
set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"