SCM := $(shell if [ -d .svn ]; then echo svn; elif [ -d ../.git ]; then echo git; fi)
FTEQCC ?= fteqcc
PERL ?= perl
-PK3NAME ?= `date +../data%Y%m%d.pk3`
ZIP ?= 7za a -tzip -mx=9
ZIPEXCLUDE ?= -x\!*.pk3 -xr\!\.svn -x\!qcsrc
DIFF ?= diff
.PHONY: skin
skin: gfx/menu/default/skinvalues.txt
-.PHONY: pk3
-pk3: $(PK3NAME)
-
-.PHONY: pk3here
-pk3here: qc
- $(RM) $(PK3NAME); \
- set -ex; \
- ABSPK3NAME=$(PK3NAME); \
- case $$ABSPK3NAME in \
- /*) \
- ;; \
- *) \
- ABSPK3NAME=$$PWD/$$ABSPK3NAME; \
- ;; \
- esac; \
- $(ZIP) $(ZIPEXCLUDE) $$ABSPK3NAME .
-
.PHONY: clean
clean:
rm -f progs.dat menu.dat csprogs.dat
gfx/menu/default/skinvalues.txt: qcsrc/menu/skin-customizables.inc
$(PERL) qcsrc/menu/skin-customizables.inc > gfx/menu/default/skinvalues.txt
-$(PK3NAME): qc
- $(RM) $(PK3NAME)
- set -ex; \
- ABSPK3NAME=$(PK3NAME); \
- case $$ABSPK3NAME in \
- /*) \
- ;; \
- *) \
- ABSPK3NAME=$$PWD/$$ABSPK3NAME; \
- ;; \
- esac; \
- TDIR=`mktemp -d -t xonoticpk3.XXXXXX`; \
- cp -v progs.dat csprogs.dat menu.dat $$TDIR/; \
- svn export --force . $$TDIR; \
- cd $$TDIR; \
- $(ZIP) $$ABSPK3NAME .
-
.PHONY: testcase
testcase:
cd qcsrc/testcase && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS) -DTESTCASE="$$TESTCASE"
-
-.PHONY: update commit diff log logv logupdate logvupdate revert
-update: $(SCM)-update
-commit: $(SCM)-commit
-diff: $(SCM)-diff
-log: $(SCM)-log
-logv: $(SCM)-logv
-revert: $(SCM)-revert
-logupdate: log update
-logvupdate: logv update
-
-.PHONY: svn-update
-svn-update:
- cd .. && svn update
-
-.PHONY: svn-commit
-svn-commit:
- cd .. && svn commit
-
-.PHONY: svn-diff
-svn-diff:
- cd .. && svn diff
-
-.PHONY: svn-log
-svn-log:
- cd .. && svn log -r HEAD:BASE
-
-.PHONY: svn-logv
-svn-logv:
- cd .. && svn log -r HEAD:BASE -v
-
-.PHONY: svn-revert
-svn-revert:
- svn revert -- $(FILE)
-
-.PHONY: git-update
-git-update:
- git pull origin
-
-.PHONY: git-commit
-git-commit:
- git commit -a || true
- if echo -n 'Also send to server? Hit Enter for yes, ^C for no. '; read -r L; then \
- git config svn-remote.svn.url svn://svn.icculus.org/xonotic; \
- git config svn-remote.svn.fetch trunk:refs/remotes/origin/master; \
- git svn dcommit; \
- fi
-
-.PHONY: git-diff
-git-diff:
- git diff; git diff origin/master..HEAD; true
-
-.PHONY: git-log
-git-log:
- git fetch && git log HEAD..origin/master
-
-.PHONY: git-logv
-git-logv:
- git fetch && git log -v HEAD..origin/master
-
-.PHONY: git-revert
-git-revert:
- git checkout -- $(FILE)
set g_balance_pause_health_rot_spawn 0
set g_balance_health_regenstable 100
set g_balance_health_rotstable 100
-set g_balance_health_limit 200
+set g_balance_health_limit 999
set g_balance_armor_regen 0
set g_balance_armor_regenlinear 0
set g_balance_armor_rot 0
set g_balance_pause_armor_rot_spawn 0
set g_balance_armor_regenstable 100
set g_balance_armor_rotstable 100
-set g_balance_armor_limit 200
+set g_balance_armor_limit 999
set g_balance_armor_blockpercent 0.7
set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
set g_balance_fuel_regenlinear 0
set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
set g_balance_shotgun_secondary 1
set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
-set g_balance_shotgun_secondary_melee_range 60
+set g_balance_shotgun_secondary_melee_range 85
set g_balance_shotgun_secondary_melee_swing 50
set g_balance_shotgun_secondary_melee_time 0.1
-set g_balance_shotgun_secondary_damage 115
+set g_balance_shotgun_secondary_damage 110
set g_balance_shotgun_secondary_force 150
set g_balance_shotgun_secondary_refire 1.1
set g_balance_shotgun_secondary_animtime 1
set g_balance_uzi_first_spread 0.03
set g_balance_uzi_first_refire 0.2
set g_balance_uzi_first_ammo 2
-set g_balance_uzi_sustained_damage 7
+set g_balance_uzi_sustained_damage 9
set g_balance_uzi_sustained_force 7.5
set g_balance_uzi_sustained_spread 0.1
set g_balance_uzi_sustained_refire 0.075
set g_balance_electro_primary_lifetime 0
set g_balance_electro_primary_refire 0.03333333
set g_balance_electro_primary_animtime 0.03333333
-set g_balance_electro_primary_ammo 10
+set g_balance_electro_primary_ammo 5
set g_balance_electro_primary_range 800
set g_balance_electro_secondary_damage 25
set g_balance_electro_secondary_spread 0
set g_balance_electro_combo_speed 400
// }}}
// {{{ crylink
-set g_balance_crylink_primary_damage 10
-set g_balance_crylink_primary_edgedamage 8
-set g_balance_crylink_primary_force -60
-set g_balance_crylink_primary_radius 100
+set g_balance_crylink_primary_damage 8
+set g_balance_crylink_primary_edgedamage 6
+set g_balance_crylink_primary_force 40
+set g_balance_crylink_primary_radius 80
set g_balance_crylink_primary_speed 1100
set g_balance_crylink_primary_spread 0.1
set g_balance_crylink_primary_shots 7
set g_balance_crylink_primary_other_fadetime 0.25
set g_balance_crylink_secondary 1
-set g_balance_crylink_secondary_damage 4
+set g_balance_crylink_secondary_damage 2
set g_balance_crylink_secondary_edgedamage 0
set g_balance_crylink_secondary_force -20
-set g_balance_crylink_secondary_radius 15
+set g_balance_crylink_secondary_radius 5
set g_balance_crylink_secondary_speed 1600
set g_balance_crylink_secondary_spread 0.03
set g_balance_crylink_secondary_shots 3
set g_balance_crylink_secondary_bounces 0
-set g_balance_crylink_secondary_refire 0.1
-set g_balance_crylink_secondary_animtime 0.1
+set g_balance_crylink_secondary_refire 0.15
+set g_balance_crylink_secondary_animtime 0.15
set g_balance_crylink_secondary_ammo 1
set g_balance_crylink_secondary_bouncedamagefactor 0.5
// }}}
// {{{ nex
set g_balance_nex_primary_damage 80
-set g_balance_nex_primary_force 200
+set g_balance_nex_primary_force 400
set g_balance_nex_primary_refire 1.25
set g_balance_nex_primary_animtime 0.75
set g_balance_nex_primary_ammo 5
-set g_balance_nex_primary_damagefalloff_mindist 1000
-set g_balance_nex_primary_damagefalloff_maxdist 3000
-set g_balance_nex_primary_damagefalloff_halflife 4000
-set g_balance_nex_primary_damagefalloff_forcehalflife 4000
+set g_balance_nex_primary_damagefalloff_mindist 0
+set g_balance_nex_primary_damagefalloff_maxdist 4000
+set g_balance_nex_primary_damagefalloff_halflife 2000
+set g_balance_nex_primary_damagefalloff_forcehalflife 2000
set g_balance_nex_secondary 1
set g_balance_nex_secondary_damage 80
-set g_balance_nex_secondary_force -200
+set g_balance_nex_secondary_force -500
set g_balance_nex_secondary_refire 1.25
set g_balance_nex_secondary_animtime 0.75
set g_balance_nex_secondary_ammo 5
-set g_balance_nex_secondary_damagefalloff_mindist 1000
-set g_balance_nex_secondary_damagefalloff_maxdist 3000
-set g_balance_nex_secondary_damagefalloff_halflife 4000
-set g_balance_nex_secondary_damagefalloff_forcehalflife 4000
+set g_balance_nex_secondary_damagefalloff_mindist 0
+set g_balance_nex_secondary_damagefalloff_maxdist 4000
+set g_balance_nex_secondary_damagefalloff_halflife 2000
+set g_balance_nex_secondary_damagefalloff_forcehalflife 2000
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1.25
set g_balance_hlac_secondary_shots 6
// }}}
// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 4 // make it pretty much useless in close combat
+set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
set g_balance_campingrifle_reloadtime 2 // matches reload anim
set g_balance_campingrifle_auto_reload_after_changing_weapons 0
set g_balance_campingrifle_bursttime 0
set g_balance_campingrifle_tracer 1
-set g_balance_campingrifle_primary_damage 60
+set g_balance_campingrifle_primary_damage 50
set g_balance_campingrifle_primary_headshotaddeddamage 50
set g_balance_campingrifle_primary_spread 0
set g_balance_campingrifle_primary_force 2
set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
set g_balance_campingrifle_secondary 1
set g_balance_campingrifle_secondary_damage 25
-set g_balance_campingrifle_secondary_headshotaddeddamage 20 // 45 damage only on head
+set g_balance_campingrifle_secondary_headshotaddeddamage 25 // 50 damage only on head
set g_balance_campingrifle_secondary_spread 0.008
set g_balance_campingrifle_secondary_force 1
set g_balance_campingrifle_secondary_speed 20000
alias movetoteam_yellow "sv_cmd movetoteam $1 yellow"
alias movetoteam_auto "sv_cmd movetoteam $1 auto"
-// merge lightmaps up to 1024x1024 textures
-// the default of 2048x2048 is too heavy for my rig (SavageX)
-mod_q3bsp_lightmapmergepower 3
+// merge lightmaps up to 2048x2048 textures
+mod_q3bsp_lightmapmergepower 4
// player defaults
_cl_color 102
seta cl_particles_oldnexbeam 0 "Uses the old v2.3 Nexgun beam instead of the new beam, only works if server allows it (g_allow_oldnexbeam 1)"
set sv_qcweaponanimation 0
-set g_telefrags 1
-set g_telefrags_avoid 0
+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"
set g_teleport_maxspeed 0 "maximum speed that a player can keep when going through a teleporter (if a misc_teleporter_dest also has a cap the smallest one of these will be used), 0 = don't limit, -1 = keep no speed"
set g_respawn_ghosts 0 "if 1 dead bodies become ghosts and float away when the player respawns"
cl_netfps 60 // should match
sv_gameplayfix_delayprojectiles 0
sv_gameplayfix_q2airaccelerate 1
+sv_gameplayfix_stepmultipletimes 1
// delay for "kill" to prevent abuse
set g_balance_kill_delay 5
// "NoQWBunny" physics based on XPM
sv_gravity 800
sv_maxspeed 320
-
-sv_maxairspeed 320
+sv_maxairspeed 400
sv_stopspeed 100
sv_accelerate 15
sv_airaccelerate 2
sv_friction 8
edgefriction 1
-sv_stepheight 34
+sv_stepheight 26
+// Q1: 16+2
+// Nex: 32+2
+// we try: 24+2
-sv_jumpvelocity 250
-sv_wateraccelerate 4
-sv_waterfriction 1
+// actually, what we want is 266.6666 for 180bpm
+// but 260 takes same amount of frames and is nicer to mappers
+sv_jumpvelocity 260
+sv_wateraccelerate -1
+sv_waterfriction -1
sv_airaccel_sideways_friction 0
-sv_airaccel_qw -0.937
+sv_airaccel_qw -0.8
sv_airstopaccelerate 3
-sv_airstrafeaccelerate 20
-sv_maxairstrafespeed 96
-sv_airstrafeaccel_qw -0.979
+sv_airstrafeaccelerate 24
+sv_maxairstrafespeed 100
+sv_airstrafeaccel_qw -0.97
sv_aircontrol 125
sv_aircontrol_penalty 100
-sv_aircontrol_power 2.5
-sv_airspeedlimit_nonqw 0
+sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 1000
sv_warsowbunny_turnaccel 0
sv_warsowbunny_accel 0.1593
sv_warsowbunny_topspeed 925
p = p - view_up * 16;
if(idx-1 >= portal1_idx)
{
- Draw_CylindricLine(p, q, 4, "", 1, 0, '0 0 1', 0.5, DRAWFLAG_NORMAL);
+ Draw_CylindricLine(p, q, 4, "", 1, 0, '0 0 1', 0.5, DRAWFLAG_NORMAL, view_origin);
}
else
{
- Draw_CylindricLine(p, q, 4, "", 1, 0, '1 0 0', 0.5, DRAWFLAG_NORMAL);
+ Draw_CylindricLine(p, q, 4, "", 1, 0, '1 0 0', 0.5, DRAWFLAG_NORMAL, view_origin);
}
--idx;
}
float fov;
float f, i, j;
vector v, vo;
+ vector vf_size, vf_min;
+
+ vf_size = R_SetView3fv(VF_SIZE);
+ vf_min = R_SetView3fv(VF_MIN);
+ vid_width = vf_size_x;
+ vid_height = vf_size_y;
vector reticle_pos, reticle_size;
view_set = 1;
}
- vid_width = w;
- vid_height = h;
-
#ifdef BLURTEST
if(time > blurtest_time0 && time < blurtest_time1)
{
// ALWAYS Clear Current Scene First
R_ClearScene();
+ // FIXME engine bug? VF_SIZE and VF_MIN are not restored to sensible values by this
+ R_SetView(VF_SIZE, vf_size);
+ R_SetView(VF_MIN, vf_min);
+
// Assign Standard Viewflags
// Draw the World (and sky)
R_SetView(VF_DRAWWORLD, 1);
if(autocvar__hud_configure)
HUD_Panel_Mouse();
+
+ // let's reset the view back to normal for the end
+ R_SetView(VF_MIN, '0 0 0');
+ R_SetView(VF_SIZE, '1 0 0' * w + '0 1 0' * h);
+
// be safe against triggerbots until everyone has the fixed engine
// this call is meant to overwrite the trace globals by something
// unsuspicious
var float autocvar_cl_gentle_gibs;
var float autocvar_cl_gentle_messages;
-var float autocvar_hud_color_bg_team;
+var float autocvar_scoreboard_color_bg_team;
var float autocvar__menu_alpha;
void (float mask) R_AddEntities = #301;
void (entity e) R_AddEntity = #302;
float (float property, ...) R_SetView = #303;
+vector (float property, ...) R_SetView3fv = #303;
void () R_RenderScene = #304;
void (vector org, float radius, vector rgb) R_AddDynamicLight = #305;
void () R_CalcRefDef = #306;
void b_draw()
{
- //Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, 0, time * 3, '1 1 1', 0.7, DRAWFLAG_ADDITIVE);
- Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, (self.fx_with/256), 0, '1 1 1', 1, DRAWFLAG_ADDITIVE);
+ //Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, 0, time * 3, '1 1 1', 0.7, DRAWFLAG_ADDITIVE, view_origin);
+ Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, (self.fx_with/256), 0, '1 1 1', 1, DRAWFLAG_ADDITIVE, view_origin);
}
void b_make(vector s,vector e, string t,float l,float z)
.float HookSilent;
.float HookRange;
-void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float alpha, float drawflag)
+void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float alpha, float drawflag, vector vieworg)
{
// I want to draw a quad...
// from and to are MIDPOINTS.
length_tex = aspect * vlen(to - from) / thickness;
// direction is perpendicular to the view normal, and perpendicular to the axis
- thickdir = normalize(cross(axis, view_origin - from));
+ thickdir = normalize(cross(axis, vieworg - from));
/*
print("from ", vtos(from), "\n");
void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end)
{
float i;
+ vector vorg;
+ vorg = WarpZone_TransformOrigin(WarpZone_trace_transform, view_origin);
for(i = 0; i < Draw_GrapplingHook_trace_callback_a; ++i)
- Draw_CylindricLine(hit, start, 8, Draw_GrapplingHook_trace_callback_tex, 0.25, Draw_GrapplingHook_trace_callback_rnd, Draw_GrapplingHook_trace_callback_rgb, min(1, Draw_GrapplingHook_trace_callback_a - i), DRAWFLAG_NORMAL);
+ Draw_CylindricLine(hit, start, 8, Draw_GrapplingHook_trace_callback_tex, 0.25, Draw_GrapplingHook_trace_callback_rnd, Draw_GrapplingHook_trace_callback_rgb, min(1, Draw_GrapplingHook_trace_callback_a - i), DRAWFLAG_NORMAL, vorg);
Draw_GrapplingHook_trace_callback_rnd += 0.25 * vlen(hit - start) / 8;
}
self.iorigin2 = self.origin;
if(self.iflags & IFLAG_AUTOANGLES)
- self.angles = vectoangles(self.iorigin2 - self.iorigin1);
+ if(self.iorigin2 != self.iorigin1)
+ self.angles = vectoangles(self.iorigin2 - self.iorigin1);
if(self.iflags & IFLAG_ANGLES)
{
{
if(self.alpha)
{
- Draw_CylindricLine(self.origin, trace_endpos, self.scale, "particles/laserbeam", 0, time * 3, self.colormod, self.alpha, DRAWFLAG_NORMAL); // TODO make a texture to make the laser look smoother
+ Draw_CylindricLine(self.origin, trace_endpos, self.scale, "particles/laserbeam", 0, time * 3, self.colormod, self.alpha, DRAWFLAG_NORMAL, view_origin);
}
else
{
- Draw_CylindricLine(self.origin, trace_endpos, self.scale, "particles/laserbeam", 0, time * 3, self.colormod, 0.5, DRAWFLAG_ADDITIVE); // TODO make a texture to make the laser look smoother
+ Draw_CylindricLine(self.origin, trace_endpos, self.scale, "particles/laserbeam", 0, time * 3, self.colormod, 0.5, DRAWFLAG_ADDITIVE, view_origin);
}
}
if not(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT))
else
Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
if(!(self.move_flags & FL_ONGROUND))
- self.angles = vectoangles(self.velocity);
+ if(self.velocity != '0 0 0')
+ self.angles = vectoangles(self.velocity);
}
else
{
self.maxs = '3 3 3';
break;
case PROJECTILE_GRENADE:
- self.mins = '0 0 -3';
- self.maxs = '0 0 -3';
+ self.mins = '-3 -3 -3';
+ self.maxs = '3 3 3';
break;
case PROJECTILE_GRENADE_BOUNCING:
- self.mins = '0 0 -3';
- self.maxs = '0 0 -3';
+ self.mins = '-3 -3 -3';
+ self.maxs = '3 3 3';
self.move_movetype = MOVETYPE_BOUNCE;
self.move_touch = SUB_Null;
self.move_bounce_factor = g_balance_grenadelauncher_secondary_bouncefactor;
for(j = 0; j < hud_num_fields; ++j)
if(j != i)
if (hud_field[i] != SP_SEPARATOR)
- namesize -= hud_size[j] + 1;
- namesize += 1;
+ namesize -= hud_size[j] + hud_fontsize_x;
+ namesize += hud_fontsize_x;
hud_size[i] = namesize;
if (hud_fixscoreboardcolumnwidth_iconlen != 0)
tmp_y = 1.25 * hud_fontsize_y;
// rounded header
- drawpic(pos, "gfx/scoreboard/scoreboard_tableheader", tmp, (rgb * autocvar_hud_color_bg_team) + '0.5 0.5 0.5', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ if (teamplay)
+ drawpic(pos, "gfx/scoreboard/scoreboard_tableheader", tmp, (rgb * autocvar_scoreboard_color_bg_team) + '0.5 0.5 0.5', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ else
+ drawpic(pos, "gfx/scoreboard/scoreboard_tableheader", tmp, rgb + '0.5 0.5 0.5', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
// table border
tmp_y += hud_border_thickness;
// table background
tmp_y = body_table_height;
- drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_hud_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ if (teamplay)
+ drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ else
+ drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
// anyway, apply some color
//drawfill(pos, tmp + '2 0 0', rgb, 0.1, DRAWFLAG_NORMAL);
tmp_x = sbwidth;
tmp_y = height * rows;
- drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_hud_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ if (teamplay)
+ drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ else
+ drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
drawborderlines(hud_accuracy_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
// column highlighting
{
float i;
RANKINGS_RECEIVED_CNT = 0;
- for (i=RANKINGS_CNT-1; i>=0; --i)
- if (grecordtime[i])
- RANKINGS_RECEIVED_CNT = RANKINGS_RECEIVED_CNT + 1;
+ for (i=RANKINGS_CNT-1; i>=0; --i)
+ if (grecordtime[i])
+ ++RANKINGS_RECEIVED_CNT;
if (RANKINGS_RECEIVED_CNT == 0)
return pos;
float is_spec;
is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
vector hl_rgb;
- hl_rgb_x = cvar("scoreboard_color_bg_r") + 0.5;
- hl_rgb_y = cvar("scoreboard_color_bg_g") + 0.5;
- hl_rgb_z = cvar("scoreboard_color_bg_b") + 0.5;
+ hl_rgb_x = cvar("scoreboard_color_bg_r") + 0.5;
+ hl_rgb_y = cvar("scoreboard_color_bg_g") + 0.5;
+ hl_rgb_z = cvar("scoreboard_color_bg_b") + 0.5;
pos_y += hud_fontsize_y;
drawstring(pos, strcat("Rankings"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
tmp_x = sbwidth;
tmp_y = hud_fontsize_y * RANKINGS_RECEIVED_CNT;
- drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_hud_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ if (teamplay)
+ drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
+ else
+ drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
drawborderlines(hud_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
// row highlighting
for(i = 0; i < n; ++i)
{
s = search_getfilename(dh, i);
- if(substring(s, 0, 15) != "models/sprites/")
- continue;
- if(substring(s, strlen(s) - 4, 4) != ".tga")
- continue;
- s = substring(s, 15, strlen(s) - 19);
+ s = substring(s, 15, strlen(s) - 15 - 4); // strip models/sprites/ and .tga
o = strstrofs(s, "_frame", 0);
sname = strcat("/spriteframes/", substring(s, 0, o));
void draw_Picture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha)
{
+ if(theSize_x == 0 || theSize_y <= 0) // no default sizing please
+ return;
pic = draw_UseSkinFor(pic);
drawpic(boxToGlobal(theOrigin, draw_shift, draw_scale), pic, boxToGlobalSize(theSize, draw_scale), theColor, theAlpha * draw_alpha, 0);
}
theAlpha *= draw_alpha;
width = eX * theSize_x;
height = eY * theSize_y;
- if(theSize_x <= theBorderSize_x * 2)
+ // zero size? bail out, we cannot handle this
+ if(theSize_x <= 0 || theSize_y <= 0)
+ return;
+ if(theBorderSize_x <= 0) // no x border
+ {
+ if(theBorderSize_y <= 0)
+ {
+ drawsubpic(theOrigin, width + height, pic, '0.25 0.25 0', '0.5 0.5 0', theColor, theAlpha, 0);
+ }
+ else if(theSize_y <= theBorderSize_y * 2)
+ {
+ // not high enough... draw just top and bottom then
+ bH = eY * (0.25 * theSize_y / (theBorderSize_y * 2));
+ drawsubpic(theOrigin, width + height * 0.5, pic, '0.25 0 0', '0.5 0 0' + bH, theColor, theAlpha, 0);
+ drawsubpic(theOrigin + height * 0.5, width + height * 0.5, pic, '0.25 0 0' + eY - bH, '0.5 0 0' + bH, theColor, theAlpha, 0);
+ }
+ else
+ {
+ dY = theBorderSize_y * eY;
+ drawsubpic(theOrigin, width + dY, pic, '0.25 0 0', '0.5 0.25 0', theColor, theAlpha, 0);
+ drawsubpic(theOrigin + dY, width + height - 2 * dY, pic, '0.25 0.25 0', '0.5 0.5 0', theColor, theAlpha, 0);
+ drawsubpic(theOrigin + height - dY, width + dY, pic, '0.25 0.75 0', '0.5 0.25 0', theColor, theAlpha, 0);
+ }
+ }
+ else if(theSize_x <= theBorderSize_x * 2)
{
// not wide enough... draw just left and right then
bW = eX * (0.25 * theSize_x / (theBorderSize_x * 2));
- if(theSize_y <= theBorderSize_y * 2)
+ if(theBorderSize_y <= 0)
+ {
+ drawsubpic(theOrigin, width * 0.5 + height, pic, '0 0.25 0', '0 0.5 0' + bW, theColor, theAlpha, 0);
+ drawsubpic(theOrigin + width * 0.5, width * 0.5 + height, pic, '0 0.25 0' + eX - bW, '0 0.5 0' + bW, theColor, theAlpha, 0);
+ }
+ else if(theSize_y <= theBorderSize_y * 2)
{
// not high enough... draw just corners
bH = eY * (0.25 * theSize_y / (theBorderSize_y * 2));
}
else
{
- dY = theBorderSize_x * eY;
+ dY = theBorderSize_y * eY;
drawsubpic(theOrigin, width * 0.5 + dY, pic, '0 0 0', '0 0.25 0' + bW, theColor, theAlpha, 0);
drawsubpic(theOrigin + width * 0.5, width * 0.5 + dY, pic, '0 0 0' + eX - bW, '0 0.25 0' + bW, theColor, theAlpha, 0);
drawsubpic(theOrigin + dY, width * 0.5 + height - 2 * dY, pic, '0 0.25 0', '0 0.5 0' + bW, theColor, theAlpha, 0);
}
else
{
- if(theSize_y <= theBorderSize_y * 2)
+ if(theBorderSize_y <= 0)
+ {
+ dX = theBorderSize_x * eX;
+ drawsubpic(theOrigin, dX + height, pic, '0 0.25 0', '0.25 0.5 0', theColor, theAlpha, 0);
+ drawsubpic(theOrigin + dX, width - 2 * dX + height, pic, '0.25 0.25 0', '0.5 0.5 0', theColor, theAlpha, 0);
+ drawsubpic(theOrigin + width - dX, dX + height, pic, '0.75 0.25 0', '0.25 0.5 0', theColor, theAlpha, 0);
+ }
+ else if(theSize_y <= theBorderSize_y * 2)
{
// not high enough... draw just top and bottom then
bH = eY * (0.25 * theSize_y / (theBorderSize_y * 2));
else
{
dX = theBorderSize_x * eX;
- dY = theBorderSize_x * eY;
+ dY = theBorderSize_y * eY;
drawsubpic(theOrigin, dX + dY, pic, '0 0 0', '0.25 0.25 0', theColor, theAlpha, 0);
drawsubpic(theOrigin + dX, width - 2 * dX + dY, pic, '0.25 0 0', '0.5 0.25 0', theColor, theAlpha, 0);
drawsubpic(theOrigin + width - dX, dX + dY, pic, '0.75 0 0', '0.25 0.25 0', theColor, theAlpha, 0);
me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeXonoticButton("Play", '0 0 0'));
me.startButton.onClick = MapList_LoadMap;
me.startButton.onClickEntity = NULL; // filled later
- me.TDempty(me, 0.5);
}
#endif
me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "crosshair_hittest", "1.25", "Enemies"));
me.TR(me);
me.TDempty(me, 0.4);
- me.TD(me, 1, 2.2, e = makeXonoticButton("Waypoints Setup", '0 0 0'));
+ me.TD(me, 1, 2.2, e = makeXonoticButton("Waypoints setup...", '0 0 0'));
e.onClick = DialogOpenButton_Click;
e.onClickEntity = main.waypointDialog;
me.TDempty(me, 0.5);
e.addValue(e, "Lots", "0");
e.configureXonoticTextSliderValues(e);
setDependent(e, "cl_gentle", 0, 0);
- me.TR(me);
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, makeXonoticCommandButton("Apply immediately", '0 0 0', "color -1 -1;name \"$_cl_name\";cl_cmd sendcvar cl_weaponpriority;sendcvar cl_zoomfactor;sendcvar cl_zoomspeed;sendcvar cl_autoswitch;sendcvar cl_shownames;sendcvar cl_forceplayermodelsfromxonotic;sendcvar cl_forceplayermodels;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
if(sl.value != e.savedValue)
e.savedValue = 0.65; // default
me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticTextLabel(0.1, "Frequency:"));
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Frequency:"));
me.TD(me, 1, 2, sl);
me.TR(me);
me.TR(me);
me.TR(me);
me.TR(me);
me.TDempty(me, 0.2);
- me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "host_sleep", "Minimize input latency"));
+ me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_maxfps_alwayssleep", "Minimize input latency"));
me.TR(me);
me.TR(me);
me.TDempty(me, 0.5);
me.TD(me, 1, 2, e = makeXonoticButton("Advanced settings...", '0 0 0'));
e.onClick = DialogOpenButton_Click;
e.onClickEntity = main.cvarsDialog;
- me.TDempty(me, 0.5);
}
#endif
MEAN_ACCUMULATE(anticheat_div0_evade, 1 - (self.anticheat_div0_evade_forward_initial * v_forward), 1);
}
- MEAN_ACCUMULATE(anticheat_div0_strafebot_old, movement_oddity(self.movement, self.anticheat_div0_strafebot_movement_prev), max(0, 0.05 - frametime));
+ MEAN_ACCUMULATE(anticheat_div0_strafebot_old, movement_oddity(self.movement, self.anticheat_div0_strafebot_movement_prev), max(0, sys_frametime - frametime));
self.anticheat_div0_strafebot_movement_prev = self.movement;
if(vlen(self.anticheat_div0_strafebot_forward_prev))
- MEAN_ACCUMULATE(anticheat_div0_strafebot_new, 1 - (self.anticheat_div0_strafebot_forward_prev * v_forward), max(0, 0.05 - frametime));
+ MEAN_ACCUMULATE(anticheat_div0_strafebot_new, 1 - (self.anticheat_div0_strafebot_forward_prev * v_forward), max(0, sys_frametime - frametime));
self.anticheat_div0_strafebot_forward_prev = v_forward;
// generic speedhack detection: correlate anticheat_speedhack_movetime (UPDATED BEFORE THIS) and server time
END_CHEAT_FUNCTION();
}
+void crosshair_trace_plusvisibletriggers(entity pl);
void Drag_Begin(entity dragger, entity draggee, vector touchpoint);
void Drag_Finish(entity dragger);
float Drag_IsDraggable(entity draggee);
if(Drag_CanDrag(self))
if(self.BUTTON_DRAG)
{
- crosshair_trace(self);
+ crosshair_trace_plusvisibletriggers(self);
if(trace_ent)
if(Drag_IsDraggable(trace_ent))
switch(0)
// ENTITY DRAGGING
+void crosshair_trace_plusvisibletriggers(entity pl)
+{
+ entity first;
+ entity e;
+ first = findchainfloat(solid, SOLID_TRIGGER);
+
+ for (e = first; e; e = e.chain)
+ if (e.model != "")
+ e.solid = SOLID_BSP;
+
+ crosshair_trace(pl);
+
+ for (e = first; e; e = e.chain)
+ e.solid = SOLID_TRIGGER;
+}
+
// on dragger:
.float draggravity;
.float dragspeed; // speed of mouse wheel action
return FALSE;
if(draggee.classname == "func_button")
return FALSE;
- if(draggee.model == "")
- return FALSE;
+// if(draggee.model == "")
+// return FALSE;
if(draggee.classname == "spectator")
return FALSE;
if(draggee.classname == "observer")
return FALSE;
if(draggee.classname == "exteriorweaponentity")
return FALSE;
+ if(draggee.classname == "weaponentity")
+ return FALSE;
return TRUE;
}
curspeed = max(
vlen(vec2(self.velocity)), // current xy speed
- vlen(vec2(antilag_takebackavgvelocity(self, max(self.lastteleporttime + 0.05, time - 0.25), time))) // average xy topspeed over the last 0.25 secs
+ vlen(vec2(antilag_takebackavgvelocity(self, max(self.lastteleporttime + sys_frametime, time - 0.25), time))) // average xy topspeed over the last 0.25 secs
);
makevectors(self.v_angle_y * '0 1 0');
wishvel = v_forward * self.movement_x + v_right * self.movement_y;
.float selectweapon; // last selected weapon of the player
.float ballistics_density; // wall piercing factor, larger = bullet can pass through more
+
+.entity realowner;
wait_time = self.wait;
bprint("^3", head.netname, "^3", self.message);
- bprint(" ^7(", ftos(points), " points every ", ftos(wait_time), " seconds)\n");
+ if (points != 1)
+ bprint(" ^7(", ftos(points), " points every ", ftos(wait_time), " seconds)\n");
+ else
+ bprint(" ^7(", ftos(points), " point every ", ftos(wait_time), " seconds)\n");
if(self.enemy.playerid == self.enemy_playerid)
PlayerScore_Add(self.enemy, SP_DOM_TAKES, 1);
// Otherwise mdl_dead will be displayed at the map origin, and nobody would
// want that!
-.vector mins_save, maxs_save;
-
void func_breakable_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
//
{
local float floor_z;
+ if(self.solid == SOLID_BSP) // in case a misc_follow moved me, save the current origin first
+ self.dropped_origin = self.origin;
+
if(self.mdl_dead == "")
self.model = "";
else {
- setmodel(self, self.mdl_dead);
if (self.origin == '0 0 0') { // probably no origin brush, so don't spawn in the middle of the map..
floor_z = self.absmin_z;
setorigin(self,((self.absmax+self.absmin)*.5));
self.origin_z = floor_z;
}
+ setmodel(self, self.mdl_dead);
}
self.solid = SOLID_NOT;
void func_breakable_look_restore()
{
setmodel(self, self.mdl);
+ if(self.mdl_dead != "") // only do this if we use mdl_dead, to behave better with misc_follow
+ setorigin(self, self.dropped_origin);
self.solid = SOLID_BSP;
}
self.takedamage = DAMAGE_NO;
self.event_damage = SUB_Null;
self.state = 1;
- setsize(self, '0 0 0', '0 0 0');
func_breakable_colormod();
}
self.takedamage = DAMAGE_AIM;
self.event_damage = func_breakable_damage;
self.state = 0;
- setsize(self, self.mins_save, self.maxs_save);
func_breakable_colormod();
}
string oldmsg;
activator = self.owner;
+ self.owner = world; // set by W_PrepareExplosionByDamage
// now throw around the debris
n = tokenize_console(self.debris);
self.mdl = self.model;
SetBrushEntityModel();
- self.mins_save = self.mins;
- self.maxs_save = self.maxs;
self.use = func_breakable_restore;
precache_sound(self.noise);
self.team_saved = self.team;
+ self.dropped_origin = self.origin;
self.reset = func_breakable_reset;
func_breakable_reset();
// NOTE: for best experience, you need to swap MGs with SGs in the map or it won't have a MG
// SG -> SG
-void spawnfunc_ammo_shells() { spawnfunc_item_shells(); }
-
-// MG -> MG
-void spawnfunc_weapon_machinegun() { spawnfunc_weapon_uzi(); }
-void spawnfunc_ammo_bullets() { spawnfunc_item_bullets(); }
-
-// GL -> Mortar
-void spawnfunc_ammo_grenades() { spawnfunc_item_rockets(); }
-
-// LG -> Electro
-void spawnfunc_weapon_lightning() { spawnfunc_weapon_electro(); }
-void spawnfunc_ammo_lightning() { spawnfunc_item_cells(); }
-
-// Plasma -> Hagar
-void spawnfunc_weapon_plasmagun() { spawnfunc_weapon_hagar(); }
-void spawnfunc_ammo_cells() { spawnfunc_item_rockets(); }
-
-// Rail -> Nex
-void spawnfunc_weapon_railgun() { spawnfunc_weapon_nex(); }
-void spawnfunc_ammo_slugs() { spawnfunc_item_cells(); }
-
-// BFG -> Crylink
-void spawnfunc_weapon_bfg() { spawnfunc_weapon_crylink(); }
-void spawnfunc_ammo_bfg() { spawnfunc_item_cells(); }
+void spawnfunc_ammo_shells() { spawnfunc_item_shells(); }
+
+// MG -> MG
+void spawnfunc_weapon_machinegun() { spawnfunc_weapon_uzi(); }
+void spawnfunc_ammo_bullets() { spawnfunc_item_bullets(); }
+
+// GL -> Mortar
+void spawnfunc_ammo_grenades() { spawnfunc_item_rockets(); }
+
+// LG -> Electro
+void spawnfunc_weapon_lightning() { spawnfunc_weapon_electro(); }
+void spawnfunc_ammo_lightning() { spawnfunc_item_cells(); }
+
+// Plasma -> Hagar
+void spawnfunc_weapon_plasmagun() { spawnfunc_weapon_hagar(); }
+void spawnfunc_ammo_cells() { spawnfunc_item_rockets(); }
+
+// Rail -> Rifle
+void spawnfunc_weapon_railgun() { spawnfunc_weapon_campingrifle(); }
+void spawnfunc_ammo_slugs() { spawnfunc_item_bullets(); }
+
+// BFG -> Crylink
+void spawnfunc_weapon_bfg() { spawnfunc_weapon_crylink(); }
+void spawnfunc_ammo_bfg() { spawnfunc_item_cells(); }
// RL -> RL
-void spawnfunc_ammo_rockets() { spawnfunc_item_rockets(); }
-
-// Armor
-void spawnfunc_item_armor_body() { spawnfunc_item_armor_large(); }
-void spawnfunc_item_armor_combat() { spawnfunc_item_armor_big(); }
-void spawnfunc_item_armor_shard() { spawnfunc_item_armor_small(); }
-void spawnfunc_item_enviro() { spawnfunc_item_invincible(); }
+void spawnfunc_ammo_rockets() { spawnfunc_item_rockets(); }
+
+// Armor
+void spawnfunc_item_armor_body() { spawnfunc_item_armor_large(); }
+void spawnfunc_item_armor_combat() { spawnfunc_item_armor_big(); }
+void spawnfunc_item_armor_shard() { spawnfunc_item_armor_small(); }
+void spawnfunc_item_enviro() { spawnfunc_item_invincible(); }
// weapon remove ent from defrag
-void spawnfunc_target_init()
+void spawnfunc_target_init()
{
self.spawnflags = 0; // remove all weapons except the ones listed below
self.netname = "laser uzi"; // keep these weapons through the remove trigger
float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax)
{
- TDEATHLOOP(org)
+ if (player.classname == "player" && player.health >= 1)
{
- if ((player.classname == "player") && (player.health >= 1))
+ TDEATHLOOP(org)
{
- if(head.classname == "player")
- if(head.health >= 1)
- return 1;
+ if not(teamplay && cvar("g_telefrags_teamplay") && head.team == player.team)
+ if(head.classname == "player")
+ if(head.health >= 1)
+ return 1;
}
}
return 0;
{
TDEATHLOOP(player.origin)
{
- if ((player.classname == "player") && (player.health >= 1))
+ if (player.classname == "player" && player.health >= 1)
{
- if(head.classname == "player")
- if(head.health >= 1)
- ++tdeath_hit;
- Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
+ if not(teamplay && cvar("g_telefrags_teamplay") && head.team == player.team)
+ {
+ if(head.classname == "player")
+ if(head.health >= 1)
+ ++tdeath_hit;
+ Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
+ }
}
- else if (telefragger.health < 1) // corpses gib
- Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
else // dead bodies and monsters gib themselves instead of telefragging
Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG, telefragger.origin, '0 0 0');
}
#define TELEPORT_FLAG_SOUND 1
#define TELEPORT_FLAG_PARTICLES 2
#define TELEPORT_FLAG_TDEATH 4
+#define TELEPORT_FLAG_FORCE_TDEATH 8
#define TELEPORT_FLAGS_WARPZONE 0
-#define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES)
+#define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH)
#define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
{
if(player.classname == "player")
{
if(tflags & TELEPORT_FLAG_TDEATH)
- if(player.takedamage && player.deadflag == DEAD_NO && !g_race && !g_cts && cvar("g_telefrags"))
+ if(player.takedamage && player.deadflag == DEAD_NO && !g_race && !g_cts && (cvar("g_telefrags") || (tflags & TELEPORT_FLAG_FORCE_TDEATH)))
tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
// player no longer is on ground
self.takedamage = DAMAGE_NO;
self.event_damage = SUB_Null;
self.owner = attacker;
+ self.realowner = attacker;
// do not explode NOW but in the NEXT FRAME!
// because recursive calls to RadiusDamage are not allowed
#ifdef SVQC
.float gravity;
-.entity realowner;
-
.entity queuenext;
.entity queueprev;
self.event_damage = SUB_Null;
self.takedamage = DAMAGE_NO;
+
+ if(self.movetype == MOVETYPE_NONE)
+ self.velocity = self.oldvelocity;
+
RadiusDamage (self, self.owner, cvar("g_balance_grenadelauncher_secondary_damage"), cvar("g_balance_grenadelauncher_secondary_edgedamage"), cvar("g_balance_grenadelauncher_secondary_radius"), world, cvar("g_balance_grenadelauncher_secondary_force"), self.projectiledeathtype, other);
remove (self);
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_primary_ammo");
- W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', FALSE, 4, "weapons/grenade_fire.wav", cvar("g_balance_grenadelauncher_primary_damage"));
+ W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", cvar("g_balance_grenadelauncher_primary_damage"));
w_shotdir = v_forward; // no TrueAim for grenades please
pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
PROJECTILE_MAKETRIGGER(gren);
gren.projectiledeathtype = WEP_GRENADE_LAUNCHER;
setorigin(gren, w_shotorg);
- setsize(gren, '0 0 -3', '0 0 -3');
+ setsize(gren, '-3 -3 -3', '3 3 3');
gren.nextthink = time + cvar("g_balance_grenadelauncher_primary_lifetime");
gren.think = adaptor_think2use_hittype_splash;
PROJECTILE_MAKETRIGGER(gren);
gren.projectiledeathtype = WEP_GRENADE_LAUNCHER | HITTYPE_SECONDARY;
setorigin(gren, w_shotorg);
- setsize(gren, '0 0 -3', '0 0 -3');
+ setsize(gren, '-3 -3 -3', '3 3 3');
gren.nextthink = time + cvar("g_balance_grenadelauncher_secondary_lifetime");
gren.think = adaptor_think2use_hittype_splash;
{
vector force;
force = angle * cvar("g_balance_shotgun_secondary_force");
- Damage (trace_ent, self.owner, self.owner, cvar("g_balance_shotgun_secondary_damage") * ((f + 1) / 2), WEP_SHOTGUN | HITTYPE_SECONDARY , self.owner.origin + self.owner.view_ofs, force);
- Damage_RecordDamage(self.owner, WEP_SHOTGUN | HITTYPE_SECONDARY, cvar("g_balance_shotgun_secondary_damage") * ((f + 1) / 2));
+ Damage (trace_ent, self.owner, self.owner, cvar("g_balance_shotgun_secondary_damage") * min(1, f + 1), WEP_SHOTGUN | HITTYPE_SECONDARY , self.owner.origin + self.owner.view_ofs, force);
+ Damage_RecordDamage(self.owner, WEP_SHOTGUN | HITTYPE_SECONDARY, cvar("g_balance_shotgun_secondary_damage") * min(1, f + 1));
remove(self);
}
else if(time >= self.cnt + cvar("g_balance_shotgun_secondary_melee_time")) // missed, remove ent
{
// if we are near any warpzone planes - MOVE AWAY (work around nearclip)
entity e;
+ if(!warpzone_warpzones_exist)
+ return world;
for(e = world; (e = find(e, classname, "trigger_warpzone")); )
if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, world))
return e;
void WarpZone_MakeAllSolid()
{
entity e;
+ if(!warpzone_warpzones_exist)
+ return;
for(e = world; (e = find(e, classname, "trigger_warpzone")); )
e.solid = SOLID_BSP;
}
void WarpZone_MakeAllOther()
{
entity e;
+ if(!warpzone_warpzones_exist)
+ return;
for(e = world; (e = find(e, classname, "trigger_warpzone")); )
e.solid = SOLID_TRIGGER;
}
vector vf, vr, vu, v0, o0;
entity wz;
+ o0 = e.origin;
+ v0 = e.velocity;
+
WarpZone_Trace_InitTransform();
WarpZone_tracetoss_time = 0;
if(!warpzone_warpzones_exist)
cb(e.origin, trace_endpos, trace_endpos);
dt = vlen(e.origin - o0) / vlen(e.velocity);
WarpZone_tracetoss_time += dt;
+ e.velocity_z -= dt * g;
+ WarpZone_tracetoss_velocity = e.velocity;
+ e.velocity = v0;
return;
}
vf = v_forward;
vr = v_right;
vu = v_up;
- o0 = e.origin;
- v0 = e.velocity;
// if starting in warpzone, first transform
wz = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
e.origin = trace_endpos;
dt = vlen(e.origin - o0) / vlen(e.velocity);
WarpZone_tracetoss_time += dt;
- e.velocity_z -= WarpZone_tracetoss_time * g;
+ e.velocity_z -= dt * g;
if(trace_fraction >= 1)
break;
if(trace_ent.classname != "trigger_warpzone")