- wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
- wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
- make
- - EXPECT=de6a7d95ce65fb6c66558a93a9fb994f
+ - EXPECT=b8f4fa5002af1f9f2d5ac3d1809ed188
- HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
| tee /dev/stderr
| grep '^:'
set g_balance_crylink_reload_ammo 0
set g_balance_crylink_reload_time 2
set g_balance_crylink_secondary 1
-set g_balance_crylink_secondary_ammo 2
+set g_balance_crylink_secondary_ammo 3
set g_balance_crylink_secondary_animtime 0.2
set g_balance_crylink_secondary_bouncedamagefactor 0.5
set g_balance_crylink_secondary_bounces 0
set g_balance_crylink_reload_ammo 0
set g_balance_crylink_reload_time 2
set g_balance_crylink_secondary 1
-set g_balance_crylink_secondary_ammo 2
+set g_balance_crylink_secondary_ammo 3
set g_balance_crylink_secondary_animtime 0.2
set g_balance_crylink_secondary_bouncedamagefactor 0
set g_balance_crylink_secondary_bounces 0
set g_balance_devastator_guideratedelay 999
set g_balance_devastator_guidestop 1
set g_balance_devastator_health 30
-set g_balance_devastator_lifetime 100
+set g_balance_devastator_lifetime 20
set g_balance_devastator_radius 110
set g_balance_devastator_refire 0.9
set g_balance_devastator_reload_ammo 0
set g_balance_crylink_reload_ammo 0
set g_balance_crylink_reload_time 2
set g_balance_crylink_secondary 1
-set g_balance_crylink_secondary_ammo 2
+set g_balance_crylink_secondary_ammo 3
set g_balance_crylink_secondary_animtime 0.2
set g_balance_crylink_secondary_bouncedamagefactor 0.5
set g_balance_crylink_secondary_bounces 0
set g_balance_okmachinegun_primary_damage 25
set g_balance_okmachinegun_primary_force 5
set g_balance_okmachinegun_primary_refire 0.1
-set g_balance_okmachinegun_primary_solidpenetration 13.1
+set g_balance_okmachinegun_primary_solidpenetration 63
set g_balance_okmachinegun_primary_spread_add 0.012
set g_balance_okmachinegun_primary_spread_max 0.05
set g_balance_okmachinegun_primary_spread_min 0
set g_balance_crylink_reload_ammo 0
set g_balance_crylink_reload_time 2
set g_balance_crylink_secondary 1
-set g_balance_crylink_secondary_ammo 2
+set g_balance_crylink_secondary_ammo 3
set g_balance_crylink_secondary_animtime 0.2
set g_balance_crylink_secondary_bouncedamagefactor 0.5
set g_balance_crylink_secondary_bounces 0
cl_playerdetailreduction 4
gl_flashblend 0
gl_picmip -1
+gl_texturecompression_2d 0
+gl_texturecompression_sky 0
mod_q3bsp_nolightmaps 0
r_bloom 1
r_coronas 1
cl_playerdetailreduction 4
gl_flashblend 1
gl_picmip 1
+gl_texturecompression_2d 1
+gl_texturecompression_sky 1
mod_q3bsp_nolightmaps 1
r_bloom 0
r_coronas 1
cl_playerdetailreduction 4
gl_flashblend 0
gl_picmip 0
+gl_texturecompression_2d 0
+gl_texturecompression_sky 1
mod_q3bsp_nolightmaps 0
r_bloom 0
r_coronas 1
cl_playerdetailreduction 4
gl_flashblend 0
gl_picmip 0
+gl_texturecompression_2d 0
+gl_texturecompression_sky 1
mod_q3bsp_nolightmaps 0
r_bloom 0
r_coronas 1
cl_playerdetailreduction 4
gl_flashblend 1
gl_picmip 1337
+gl_texturecompression_2d 1
+gl_texturecompression_sky 1
mod_q3bsp_nolightmaps 1
r_bloom 0
r_coronas 1
cl_playerdetailreduction 0
gl_flashblend 0
gl_picmip -1
+gl_texturecompression_2d 0
+gl_texturecompression_sky 0
mod_q3bsp_nolightmaps 0
r_bloom 1
r_coronas 1
cl_playerdetailreduction 0
gl_flashblend 0
gl_picmip -1
+gl_texturecompression_2d 0
+gl_texturecompression_sky 0
mod_q3bsp_nolightmaps 0
r_bloom 1
r_coronas 1
bone_aim2 0.35 bip01 r hand
bone_weapon bip01 r hand
fixbone 1
+hidden 1
-name Gak Masked
+name Gak
species alien
sex Male
weight 87
bone_aim3 0.35 bip01 r hand
bone_weapon bip01 r hand
fixbone 1
+hidden 1
bone_aim2 0.35 bip01 r hand
bone_weapon bip01 r hand
fixbone 1
+hidden 1
g_mod_physics Xonotic
-// current Xonotic physics
+// Xonotic 0.7 physics
sv_gravity 800
sv_maxspeed 360
case "clickradar":
{
- HUD_Radar_Show_Maximized(!hud_panel_radar_mouse, 1);
+ if(!isdemo())
+ HUD_Radar_Show_Maximized(!hud_panel_radar_mouse, 1);
return;
}
}
{
LOG_INFO(_("You can modify the scoreboard using the ^2scoreboard_columns_set command."));
LOG_INFO(_("Usage:"));
- LOG_INFO("^2scoreboard_columns_set default");
- LOG_INFO(_("^2scoreboard_columns_set ^7field1 field2 ..."));
+ LOG_INFO("^2scoreboard_columns_set ^3default");
+ LOG_INFO(_("^2scoreboard_columns_set ^3field1 field2 ..."));
+ LOG_INFO(_("^2scoreboard_columns_set ^7without arguments reads the arguments from the cvar scoreboard_columns"));
+ LOG_INFO(_(" ^5Note: ^7scoreboard_columns_set without arguments is executed on every map start"));
+ LOG_INFO(_("^2scoreboard_columns_set ^3expand_default ^7loads default layout and expands it into the cvar scoreboard_columns so you can edit it"));
LOG_INFO(_("You can use a ^3|^7 to start the right-aligned fields."));
LOG_INFO(_("The following field names are recognized (case insensitive):"));
LOG_INFO("");
if(argc == 3)
{
- if(argv(2) == "default")
+ if(argv(2) == "default" || argv(2) == "expand_default")
+ {
+ if(argv(2) == "expand_default")
+ cvar_set("scoreboard_columns", SCOREBOARD_DEFAULT_COLUMNS);
argc = tokenizebyseparator(strcat("0 1 ", SCOREBOARD_DEFAULT_COLUMNS), " ");
+ }
else if(argv(2) == "all")
{
string s = "ping pl name |"; // scores without a label
if(zoomfactor < 1 || zoomfactor > 30)
zoomfactor = 2.5;
zoomspeed = autocvar_cl_zoomspeed;
- if(zoomspeed >= 0)
- if(zoomspeed < 0.5 || zoomspeed > 16)
- zoomspeed = 3.5;
+ if (zoomspeed >= 0 && (zoomspeed < 0.5 || zoomspeed > 16))
+ zoomspeed = 3.5;
zoomdir = button_zoom;
if(zoomdir) { zoomin_effect = 0; }
- if(camera_active)
+ if (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2)
+ {
+ current_viewzoom = 1;
+ }
+ else if (camera_active)
{
current_viewzoom = min(1, current_viewzoom + drawframetime);
}
if(autocvar_cl_velocityzoom_enabled && autocvar_cl_velocityzoom_type) // _type = 0 disables velocity zoom too
{
- if(intermission) { curspeed = 0; }
+ if (intermission || (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2))
+ curspeed = 0;
else
{
-
makevectors(view_angles);
v = pmove_vel;
if(csqcplayer)
vector target_objective_spawn_evalfunc(entity this, entity player, entity spot, vector current)
{
- if(GetResourceAmount(this, RESOURCE_HEALTH) < 0 || GetResourceAmount(this, RESOURCE_HEALTH) >= ASSAULT_VALUE_INACTIVE)
+ float hlth = GetResourceAmount(this, RESOURCE_HEALTH);
+ if (hlth < 0 || hlth >= ASSAULT_VALUE_INACTIVE)
return '-1 0 0';
return current;
}
else
return; // already activated! cannot activate again!
- if(GetResourceAmount(this.enemy, RESOURCE_HEALTH) < ASSAULT_VALUE_INACTIVE)
+ float hlth = GetResourceAmount(this.enemy, RESOURCE_HEALTH);
+ if (hlth < ASSAULT_VALUE_INACTIVE)
{
- if(GetResourceAmount(this.enemy, RESOURCE_HEALTH) - this.dmg > 0.5)
+ if (hlth - this.dmg > 0.5)
{
GameRules_scoring_add_team(actor, SCORE, this.dmg);
TakeResource(this.enemy, RESOURCE_HEALTH, this.dmg);
}
else
{
- GameRules_scoring_add_team(actor, SCORE, GetResourceAmount(this.enemy, RESOURCE_HEALTH));
+ GameRules_scoring_add_team(actor, SCORE, hlth);
GameRules_scoring_add_team(actor, ASSAULT_OBJECTIVES, 1);
SetResourceAmountExplicit(this.enemy, RESOURCE_HEALTH, -1);
bool destructible_heal(entity targ, entity inflictor, float amount, float limit)
{
float true_limit = ((limit != RESOURCE_LIMIT_NONE) ? limit : targ.max_health);
- if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
+ float hlth = GetResourceAmount(targ, RESOURCE_HEALTH);
+ if (hlth <= 0 || hlth >= true_limit)
return false;
GiveResourceWithLimit(targ, RESOURCE_HEALTH, amount, true_limit);
entity destr = it;
IL_EACH(g_assault_objectivedecreasers, it.targetname == destr.target,
{
- if(GetResourceAmount(it.enemy, RESOURCE_HEALTH) > 0 && GetResourceAmount(it.enemy, RESOURCE_HEALTH) < ASSAULT_VALUE_INACTIVE)
+ float hlth = GetResourceAmount(it.enemy, RESOURCE_HEALTH);
+ if (hlth > 0 && hlth < ASSAULT_VALUE_INACTIVE)
{
found = true;
break;
FOREACH_CLIENT(IS_PLAYER(it), {
switch(it.team)
{
- case NUM_TEAM_1: ++total_players; if(GetResourceAmount(it, RESOURCE_HEALTH) >= 1 && STAT(FROZEN, it) != 1) ++redalive; break;
- case NUM_TEAM_2: ++total_players; if(GetResourceAmount(it, RESOURCE_HEALTH) >= 1 && STAT(FROZEN, it) != 1) ++bluealive; break;
- case NUM_TEAM_3: ++total_players; if(GetResourceAmount(it, RESOURCE_HEALTH) >= 1 && STAT(FROZEN, it) != 1) ++yellowalive; break;
- case NUM_TEAM_4: ++total_players; if(GetResourceAmount(it, RESOURCE_HEALTH) >= 1 && STAT(FROZEN, it) != 1) ++pinkalive; break;
+ case NUM_TEAM_1: ++total_players; if(STAT(FROZEN, it) != 1 && GetResourceAmount(it, RESOURCE_HEALTH) >= 1) ++redalive; break;
+ case NUM_TEAM_2: ++total_players; if(STAT(FROZEN, it) != 1 && GetResourceAmount(it, RESOURCE_HEALTH) >= 1) ++bluealive; break;
+ case NUM_TEAM_3: ++total_players; if(STAT(FROZEN, it) != 1 && GetResourceAmount(it, RESOURCE_HEALTH) >= 1) ++yellowalive; break;
+ case NUM_TEAM_4: ++total_players; if(STAT(FROZEN, it) != 1 && GetResourceAmount(it, RESOURCE_HEALTH) >= 1) ++pinkalive; break;
}
});
FOREACH_CLIENT(IS_REAL_CLIENT(it), {
entity freezetag_LastPlayerForTeam(entity this)
{
entity last_pl = NULL;
- FOREACH_CLIENT(IS_PLAYER(it) && it != this, {
- if(GetResourceAmount(it, RESOURCE_HEALTH) >= 1)
- if(!STAT(FROZEN, it))
- if(SAME_TEAM(it, this))
- if(!last_pl)
- last_pl = it;
- else
- return NULL;
+ FOREACH_CLIENT(IS_PLAYER(it) && it != this && SAME_TEAM(it, this), {
+ if (!STAT(FROZEN, it) && GetResourceAmount(it, RESOURCE_HEALTH) >= 1)
+ {
+ if (!last_pl)
+ last_pl = it;
+ else
+ return NULL;
+ }
});
return last_pl;
}
// else nothing - got frozen by the game type rules themselves
}
+// to be called when the player is frozen by freezetag (on death, spectator join etc), gives the score
void freezetag_Freeze(entity targ, entity attacker)
{
if(STAT(FROZEN, targ))
freezetag_Add_Score(targ, attacker);
}
-void freezetag_Unfreeze(entity this)
-{
- this.freezetag_frozen_time = 0;
- this.freezetag_frozen_timeout = 0;
-
- Unfreeze(this);
-}
-
float freezetag_isEliminated(entity e)
{
if(IS_PLAYER(e) && (STAT(FROZEN, e) == 1 || IS_DEAD(e)))
SetResourceAmountExplicit(this, RESOURCE_HEALTH, 0); // neccessary to update correctly alive stats
if(!STAT(FROZEN, this))
freezetag_LastPlayerForTeam_Notify(this);
- freezetag_Unfreeze(this);
+ Unfreeze(this);
freezetag_count_alive_players();
}
if(round_handler_CountdownRunning())
{
if(STAT(FROZEN, frag_target))
- freezetag_Unfreeze(frag_target);
+ Unfreeze(frag_target);
freezetag_count_alive_players();
return true; // let the player die so that he can respawn whenever he wants
}
freezetag_LastPlayerForTeam_Notify(frag_target);
}
else
- freezetag_Unfreeze(frag_target); // remove ice
+ Unfreeze(frag_target); // remove ice
SetResourceAmountExplicit(frag_target, RESOURCE_HEALTH, 0); // Unfreeze resets health
frag_target.freezetag_frozen_timeout = -2; // freeze on respawn
return true;
return true;
}
+MUTATOR_HOOKFUNCTION(ft, Unfreeze)
+{
+ entity targ = M_ARGV(0, entity);
+ targ.freezetag_frozen_time = 0;
+ targ.freezetag_frozen_timeout = 0;
+
+ freezetag_count_alive_players();
+}
+
MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
{
if(game_stopped)
if(STAT(REVIVE_PROGRESS, player) >= 1)
{
- freezetag_Unfreeze(player);
+ Unfreeze(player);
freezetag_count_alive_players();
if(n == -1)
return; // target was already frozen, so this is just pushing them off the cliff
Send_Notification(NOTIF_ONE, frag_attacker, MSG_CHOICE, CHOICE_FRAG_FREEZE, frag_target.netname, kill_count_to_attacker, (IS_BOT_CLIENT(frag_target) ? -1 : CS(frag_target).ping));
- Send_Notification(NOTIF_ONE, frag_target, MSG_CHOICE, CHOICE_FRAGGED_FREEZE, frag_attacker.netname, kill_count_to_target,
- GetResourceAmount(frag_attacker, RESOURCE_HEALTH), GetResourceAmount(frag_attacker, RESOURCE_ARMOR), (IS_BOT_CLIENT(frag_attacker) ? -1 : CS(frag_attacker).ping));
+ Send_Notification(NOTIF_ONE, frag_target, MSG_CHOICE, CHOICE_FRAGGED_FREEZE, frag_attacker.netname, kill_count_to_target,
+ GetResourceAmount(frag_attacker, RESOURCE_HEALTH), GetResourceAmount(frag_attacker, RESOURCE_ARMOR), (IS_BOT_CLIENT(frag_attacker) ? -1 : CS(frag_attacker).ping));
return true;
}
freezetag_teams = BITS(bound(2, freezetag_teams, 4));
GameRules_scoring(freezetag_teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
- field(SP_FREEZETAG_REVIVALS, "revivals", 0);
+ field(SP_FREEZETAG_REVIVALS, "revivals", 0);
});
round_handler_Spawn(freezetag_CheckTeams, freezetag_CheckWinner, func_null);
bool ons_ControlPoint_Icon_Heal(entity targ, entity inflictor, float amount, float limit)
{
+ float hlth = GetResourceAmount(targ, RESOURCE_HEALTH);
float true_limit = ((limit != RESOURCE_LIMIT_NONE) ? limit : targ.max_health);
- if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
+ if (hlth <= 0 || hlth >= true_limit)
return false;
GiveResourceWithLimit(targ, RESOURCE_HEALTH, amount, true_limit);
+ hlth = GetResourceAmount(targ, RESOURCE_HEALTH);
if(targ.owner.iscaptured)
- WaypointSprite_UpdateHealth(targ.owner.sprite, GetResourceAmount(targ, RESOURCE_HEALTH));
+ WaypointSprite_UpdateHealth(targ.owner.sprite, hlth);
else
- WaypointSprite_UpdateBuildFinished(targ.owner.sprite, time + (targ.max_health - GetResourceAmount(targ, RESOURCE_HEALTH)) / (targ.count / ONS_CP_THINKRATE));
+ WaypointSprite_UpdateBuildFinished(targ.owner.sprite, time + (targ.max_health - hlth) / (targ.count / ONS_CP_THINKRATE));
targ.SendFlags |= CPSF_STATUS;
return true;
}
}
}
TakeResource(this, RESOURCE_HEALTH, damage);
- WaypointSprite_UpdateHealth(this.sprite, GetResourceAmount(this, RESOURCE_HEALTH));
+ float hlth = GetResourceAmount(this, RESOURCE_HEALTH);
+ WaypointSprite_UpdateHealth(this.sprite, hlth);
// choose an animation frame based on health
- this.frame = 10 * bound(0, (1 - GetResourceAmount(this, RESOURCE_HEALTH) / this.max_health), 1);
+ this.frame = 10 * bound(0, (1 - hlth / this.max_health), 1);
// see if the generator is still functional, or dying
- if (GetResourceAmount(this, RESOURCE_HEALTH) > 0)
+ if (hlth > 0)
{
- this.lasthealth = GetResourceAmount(this, RESOURCE_HEALTH);
+ this.lasthealth = hlth;
}
else
{
bool ons_GeneratorHeal(entity targ, entity inflictor, float amount, float limit)
{
float true_limit = ((limit != RESOURCE_LIMIT_NONE) ? limit : targ.max_health);
- if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
+ float hlth = GetResourceAmount(targ, RESOURCE_HEALTH);
+ if (hlth <= 0 || hlth >= true_limit)
return false;
GiveResourceWithLimit(targ, RESOURCE_HEALTH, amount, true_limit);
- WaypointSprite_UpdateHealth(targ.sprite, GetResourceAmount(targ, RESOURCE_HEALTH));
- targ.frame = 10 * bound(0, (1 - GetResourceAmount(targ, RESOURCE_HEALTH) / targ.max_health), 1);
- targ.lasthealth = GetResourceAmount(targ, RESOURCE_HEALTH);
+ hlth = GetResourceAmount(targ, RESOURCE_HEALTH);
+ WaypointSprite_UpdateHealth(targ.sprite, hlth);
+ targ.frame = 10 * bound(0, (1 - hlth / targ.max_health), 1);
+ targ.lasthealth = hlth;
targ.SendFlags |= GSF_STATUS;
return true;
}
// to mean no restrictions, so use a yaw of 360 instead.
SetMovedir(this);
this.solid = SOLID_TRIGGER;
- SetBrushEntityModel(this);
+ SetBrushEntityModelNoLOD(this);
set_movetype(this, MOVETYPE_NONE);
this.modelindex = 0;
this.model = "";
// to mean no restrictions, so use a yaw of 360 instead.
SetMovedir(this);
this.solid = SOLID_BSP;
- SetBrushEntityModel(this);
+ SetBrushEntityModelNoLOD(this);
set_movetype(this, MOVETYPE_NONE); // why was this PUSH? -div0
// this.modelindex = 0;
this.model = "";
REGISTER_MUTATOR(damagetext, true);
-#define SV_DAMAGETEXT_DISABLED() (autocvar_sv_damagetext <= 0 || MUTATOR_IS_ENABLED(mutator_instagib))
+#define SV_DAMAGETEXT_DISABLED() (autocvar_sv_damagetext <= 0)
#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1)
#define SV_DAMAGETEXT_PLAYERS() (autocvar_sv_damagetext >= 2)
#define SV_DAMAGETEXT_ALL() (autocvar_sv_damagetext >= 3)
const float armor = M_ARGV(3, float);
const int deathtype = M_ARGV(5, int);
const float potential_damage = M_ARGV(6, float);
+ if(DEATH_WEAPONOF(deathtype) == WEP_VAPORIZER) return;
FOREACH_CLIENT(IS_REAL_CLIENT(it), {
if (
(SV_DAMAGETEXT_ALL()) ||
});
}
+bool autocvar__movetype_debug = false;
void _Movetype_LinkEdict(entity this, bool touch_triggers) // SV_LinkEdict
{
- vector mi, ma;
- if(this.solid == SOLID_BSP)
+ if(autocvar__movetype_debug)
{
- // TODO set the absolute bbox
- mi = this.mins;
- ma = this.maxs;
- }
- else
- {
- mi = this.mins;
- ma = this.maxs;
- }
- mi += this.origin;
- ma += this.origin;
+ vector mi, ma;
+ if(this.solid == SOLID_BSP)
+ {
+ // TODO set the absolute bbox
+ mi = this.mins;
+ ma = this.maxs;
+ }
+ else
+ {
+ mi = this.mins;
+ ma = this.maxs;
+ }
+ mi += this.origin;
+ ma += this.origin;
- if(this.flags & FL_ITEM)
- {
- mi -= '15 15 1';
- ma += '15 15 1';
+ if(this.flags & FL_ITEM)
+ {
+ mi -= '15 15 1';
+ ma += '15 15 1';
+ }
+ else
+ {
+ mi -= '1 1 1';
+ ma += '1 1 1';
+ }
+
+ this.absmin = mi;
+ this.absmax = ma;
}
else
{
- mi -= '1 1 1';
- ma += '1 1 1';
+ setorigin(this, this.origin); // calls SV_LinkEdict
+ #ifdef CSQC
+ // NOTE: CSQC's version of setorigin doesn't expand
+ this.absmin -= '1 1 1';
+ this.absmax += '1 1 1';
+ #endif
}
- this.absmin = mi;
- this.absmax = ma;
-
if(touch_triggers)
_Movetype_LinkEdict_TouchAreaGrid(this);
}
case MOVETYPE_FLY:
case MOVETYPE_FLY_WORLDONLY:
_Movetype_Physics_Toss(this, movedt);
+ if(wasfreed(this))
+ return;
_Movetype_LinkEdict(this, true);
break;
case MOVETYPE_PHYSICS:
{
return false;
}
- GiveResourceWithLimit(player, resource_type, amount, ammomax);
+ GiveOrTakeResourceWithLimit(player, resource_type, amount, ammomax);
return true;
}
if (g_weapon_stay != 2)
{
return false;
}
- GiveResourceWithLimit(player, resource_type, amount, min(amount, ammomax));
+ GiveOrTakeResourceWithLimit(player, resource_type, amount, min(amount, ammomax));
return true;
}
vehicles_exit_running = true;
- // TODO: this was in an IS_CLIENT check, make sure it isn't actually needed!
if(vehic.vehicle_flags & VHF_PLAYERSLOT)
{
vehic.vehicle_exit(vehic, eject);
}
else if(fire & 2)
{
- if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(arc, bolt_refire)))
+ if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR(arc, bolt_refire)))
{
W_Arc_Attack_Bolt(thiswep, actor, weaponentity);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(arc, bolt_refire), w_ready);
void W_Hagar_Attack2_Load(Weapon thiswep, entity actor, .entity weaponentity)
{
// loadable hagar secondary attack, must always run each frame
- if(!weapon_prepareattack_check(thiswep, actor, weaponentity, true, -1))
+ if(time < game_starttime || time < actor.race_penalty || timeout_status == TIMEOUT_ACTIVE)
return;
bool loaded = actor.(weaponentity).hagar_load >= WEP_CVAR_SEC(hagar, load_max);
+ (v_up * swing_factor * WEP_CVAR_SEC(shotgun, melee_swing_up))
+ (v_right * swing_factor * WEP_CVAR_SEC(shotgun, melee_swing_side)));
- WarpZone_traceline_antilag(this, this.realowner.origin + this.realowner.view_ofs, targpos, false, this.realowner, ((IS_CLIENT(this.realowner)) ? ANTILAG_LATENCY(this.realowner) : 0));
+ WarpZone_traceline_antilag(this.realowner, this.realowner.origin + this.realowner.view_ofs, targpos, false, this.realowner, ((IS_CLIENT(this.realowner)) ? ANTILAG_LATENCY(this.realowner) : 0));
// draw lightning beams for debugging
//te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
if((trace_fraction < 1) // if trace is good, apply the damage and remove this
- && (trace_ent.takedamage == DAMAGE_AIM)
+ && (trace_ent.takedamage != DAMAGE_NO)
&& (trace_ent != this.swing_alreadyhit)
&& (is_player || WEP_CVAR_SEC(shotgun, melee_nonplayerdamage)))
{
void sys_phys_simulate(entity this, float dt);
void sys_phys_simulate_simple(entity this, float dt);
+void sys_phys_postupdate(entity this);
+
void sys_phys_update(entity this, float dt)
{
if (!IS_CLIENT(this)) {
// if(pointcontents(midpoint + '0 0 2') == CONTENT_WATER)
// { this.velocity_z = 70; }
}
- goto end;
+ sys_phys_postupdate(this);
+ return;
}
PM_check_slick(this);
this.com_phys_air = false;
}
- LABEL(end)
+ sys_phys_postupdate(this);
+}
+
+void sys_phys_postupdate(entity this)
+{
if (IS_ONGROUND(this)) { this.lastground = time; }
// conveyors: then break velocity again
if (this.conveyor.active) { this.velocity += this.conveyor.movedir; }
name = bot_name;
// number bots with identical names
- int j = 0;
- FOREACH_CLIENT(IS_BOT_CLIENT(it), {
- if(it.cleanname == name)
- ++j;
- });
- if (j)
- this.netname = this.netname_freeme = strzone(strcat(prefix, name, "(", ftos(j), ")", suffix));
- else
+ if (name == "")
+ {
+ name = ftos(etof(this));
this.netname = this.netname_freeme = strzone(strcat(prefix, name, suffix));
-
+ }
+ else
+ {
+ int j = 0;
+ FOREACH_CLIENT(IS_BOT_CLIENT(it), {
+ if(it.cleanname == name)
+ ++j;
+ });
+ if (j)
+ this.netname = this.netname_freeme = strzone(strcat(prefix, name, "(", ftos(j), ")", suffix));
+ else
+ this.netname = this.netname_freeme = strzone(strcat(prefix, name, suffix));
+ }
this.cleanname = strzone(name);
// pick the model and skin
{
// Calculate brake distance in xy
float d = vlen(vec2(this.origin - (this.goalcurrent.absmin + this.goalcurrent.absmax) * 0.5));
- float v = vlen(vec2(this.velocity));
- float db = ((v ** 2) / (autocvar_g_jetpack_acceleration_side * 2)) + 100;
+ float vel2 = vlen2(vec2(this.velocity));
+ float db = (vel2 / (autocvar_g_jetpack_acceleration_side * 2)) + 100;
//LOG_INFOF("distance %d, velocity %d, brake at %d ", ceil(d), ceil(v), ceil(db));
if(d < db || d < 500)
{
// Brake
- if(v > maxspeed * 0.3)
+ if (vel2 > (maxspeed * 0.3) ** 2)
{
CS(this).movement_x = dir * v_forward * -maxspeed;
return;
else
PHYS_INPUT_BUTTON_JUMP(this) = false;
makevectors(this.v_angle.y * '0 1 0');
- CS(this).movement_x = dir * v_forward * maxspeed;
- CS(this).movement_y = dir * v_right * maxspeed;
- CS(this).movement_z = dir * v_up * maxspeed;
+ vector v = dir * maxspeed;
+ CS(this).movement.x = v * v_forward;
+ CS(this).movement.y = v * v_right;
+ CS(this).movement.z = v * v_up;
}
// if there is nowhere to go, exit
this.(weaponentity).weaponname = "";
this.(weaponentity).m_switchingweapon = WEP_Null;
this.(weaponentity).cnt = -1;
-
- W_WeaponFrame(this, weaponentity);
}
MUTATOR_CALLHOOK(PlayerWeaponSelect, this);
+ if (CS(this).impulse) ImpulseCommands(this);
+
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ W_WeaponFrame(this, weaponentity);
+ }
+
if (!warmup_stage && !this.alivetime)
this.alivetime = time;
this.nextthink = time;
}
-void Freeze (entity targ, float revivespeed, float frozen_type, float show_waypoint)
+void Freeze(entity targ, float revivespeed, int frozen_type, bool show_waypoint)
{
- if(!IS_PLAYER(targ) && !IS_MONSTER(targ)) // only specified entities can be freezed
+ if(!IS_PLAYER(targ) && !IS_MONSTER(targ)) // TODO: only specified entities can be freezed
return;
if(STAT(FROZEN, targ))
});
// add waypoint
- if(show_waypoint)
+ if(MUTATOR_CALLHOOK(Freeze, targ, revivespeed, frozen_type) || show_waypoint)
WaypointSprite_Spawn(WP_Frozen, 0, 0, targ, '0 0 64', NULL, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT);
}
-void Unfreeze (entity targ)
+void Unfreeze(entity targ)
{
if(!STAT(FROZEN, targ))
return;
if(targ.iceblock)
delete(targ.iceblock);
targ.iceblock = NULL;
+
+ MUTATOR_CALLHOOK(Unfreeze, targ);
}
void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
void Ice_Think(entity this);
-void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypoint);
+void Freeze(entity targ, float freeze_time, int frozen_type, bool show_waypoint);
void Unfreeze (entity targ);
MUT_VOTEPARSE_INVALID, // return -1 (vote parsed but counted as invalid, no action or vote)
MUT_VOTEPARSE_UNACCEPTABLE // return 0 (vote parameter counted as unacceptable, warns caller)
};
+
+/**
+ * Called when freezing an entity (monster or player), return true to force showing a waypoint
+ */
+#define EV_Freeze(i, o) \
+ /** targ */ i(entity, MUTATOR_ARGV_0_entity) \
+ /** revive speed */ i(float, MUTATOR_ARGV_1_float) \
+ /** frozen type */ i(int, MUTATOR_ARGV_2_int) \
+ /**/
+MUTATOR_HOOKABLE(Freeze, EV_Freeze);
+
+/**
+ * Called when an entity (monster or player) is defrosted
+ */
+#define EV_Unfreeze(i, o) \
+ /** targ */ i(entity, MUTATOR_ARGV_0_entity) \
+ /**/
+MUTATOR_HOOKABLE(Unfreeze, EV_Unfreeze);
this.v_angle_y = this.v_angle.y + (random() * 2 - 1) * shake;
this.v_angle_x = bound(-90, this.v_angle.x, 90);
}
+
+ if (this != attacker) {
+ float realdmg = damage - excess;
+ if (IS_PLAYER(attacker)) {
+ GameRules_scoring_add(attacker, DMG, realdmg);
+ }
+ if (IS_PLAYER(this)) {
+ GameRules_scoring_add(this, DMGTAKEN, realdmg);
+ }
+ }
}
else
this.max_armorvalue += (save + take);
this.dmg_take = this.dmg_take + take;//max(take - 10, 0);
this.dmg_inflictor = inflictor;
- if (this != attacker) {
- float realdmg = damage - excess;
- if (IS_PLAYER(attacker)) {
- GameRules_scoring_add(attacker, DMG, realdmg);
- }
- if (IS_PLAYER(this)) {
- GameRules_scoring_add(this, DMGTAKEN, realdmg);
- }
- }
-
bool abot = (IS_BOT_CLIENT(attacker));
bool vbot = (IS_BOT_CLIENT(this));
return;
}
float current_amount = GetResourceAmount(receiver, resource_type);
- if (current_amount - amount < limit)
+ if (current_amount - amount < -limit)
{
- amount = limit + current_amount;
+ amount = -limit + current_amount;
}
TakeResource(receiver, resource_type, amount);
}
+void GiveOrTakeResource(entity receiver, int resource_type, float amount)
+{
+ if(amount < 0)
+ {
+ TakeResource(receiver, resource_type, amount * -1);
+ }
+ else
+ {
+ GiveResource(receiver, resource_type, amount);
+ }
+}
+
+void GiveOrTakeResourceWithLimit(entity receiver, int resource_type, float amount,
+ float limit)
+{
+ if(amount < 0)
+ {
+ TakeResourceWithLimit(receiver, resource_type, amount * -1, limit);
+ }
+ else
+ {
+ GiveResourceWithLimit(receiver, resource_type, amount, limit);
+ }
+}
+
int GetResourceType(.float resource_field)
{
switch (resource_field)
void TakeResourceWithLimit(entity receiver, int resource_type, float amount,
float limit);
+/// \brief Gives to or takes from an entity resource.
+/// \param[in,out] receiver Entity to give or take resource.
+/// \param[in] resource_type Type of the resource (a RESOURCE_* constant).
+/// \param[in] amount Amount of resource to give or take.
+/// \return No return.
+void GiveOrTakeResource(entity receiver, int resource_type, float amount);
+
+/// \brief Gives to or takes from an entity resource but not more/less than a limit.
+/// \param[in,out] receiver Entity to give or take resource.
+/// \param[in] resource_type Type of the resource (a RESOURCE_* constant).
+/// \param[in] amount Amount of resource to give or take.
+/// \param[in] limit Limit of resources to give or take.
+/// \return No return.
+void GiveOrTakeResourceWithLimit(entity receiver, int resource_type, float amount,
+ float limit);
+
// ===================== Legacy and/or internal API ===========================
/// \brief Converts an entity field to resource type.
--- /dev/null
+explosive_ammo
+{
+ dpreflectcube cubemaps/default/sky
+ {
+ map textures/items/explosiveammo.tga
+ rgbgen lightingDiffuse
+ }
+}
+explosive_ammo_icons
+{
+ {
+
+ animMap 2 textures/items/explosiveammo_icon_01.tga textures/items/explosiveammo_icon_01.tga textures/items/explosiveammo_icon_01.tga textures/items/explosiveammo_icon_blank.tga textures/items/explosiveammo_icon_02.tga textures/items/explosiveammo_icon_02.tga textures/items/explosiveammo_icon_02.tga textures/items/explosiveammo_icon_blank.tga textures/items/explosiveammo_icon_03.tga textures/items/explosiveammo_icon_03.tga textures/items/explosiveammo_icon_03.tga textures/items/explosiveammo_icon_blank.tga
+ blendFunc GL_ONE GL_ONE
+ rgbGen wave sawtooth 0 1 0 10
+ }
+
+}
+
+
set g_maplist_votable_abstain 0 "when 1, you can abstain from your vote"
set g_maplist_votable_screenshot_dir "maps levelshots" "where to look for map screenshots"
-set sv_vote_gametype 0 "show a vote screen for gametypes before map vote screen"
+set sv_vote_gametype 1 "show a vote screen for gametypes before map vote screen"
set sv_vote_gametype_keeptwotime 10 "show only 2 options after this amount of time during gametype vote screen"
-set sv_vote_gametype_options "dm tdm ctf"
+set sv_vote_gametype_options "dm tdm ctf" "Keep the identifiers short, otherwise you'll run into issues with too long alias names (max is 31 characters) when using sv_vote_gametype_hook_*"
set sv_vote_gametype_timeout 20
set sv_vote_gametype_default_current 1 "Keep the current gametype if no one votes"