Hope to god that this works.
ZIPEXCLUDE ?= -x\!*.pk3 -xr\!\.svn -x\!qcsrc
DIFF ?= diff
-FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"^1$(shell git describe) TEST BUILD"'
+FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"^1$(shell git describe) TEST BUILD"' -DCVAR_POPCON
FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-c -Ono-cs $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
FTEQCCFLAGS_PROGS ?=
FTEQCCFLAGS_MENU ?=
clean:
rm -f progs.dat menu.dat csprogs.dat
-FILES_CSPROGS = qcsrc/client/progs.src $(shell sed '/\.dat/d; s,//.*,,; s,[^ ],qcsrc/client/&,' < qcsrc/client/progs.src)
+FILES_CSPROGS = $(shell find qcsrc/client qcsrc/common qcsrc/warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) qcsrc/server/w_*.qc
csprogs.dat: $(FILES_CSPROGS)
@echo make[1]: Entering directory \`$(PWD)/qcsrc/client\'
cd qcsrc/client && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS)
-FILES_PROGS = qcsrc/server/progs.src $(shell sed '/\.dat/d; s,//.*,,; s,[^ ],qcsrc/server/&,' < qcsrc/server/progs.src)
+FILES_PROGS = $(shell find qcsrc/server qcsrc/common qcsrc/warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) qcsrc/server/w_*.qc
progs.dat: $(FILES_PROGS)
@echo make[1]: Entering directory \`$(PWD)/qcsrc/server\'
cd qcsrc/server && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_PROGS)
-FILES_MENU = qcsrc/menu/progs.src $(shell sed '/\.dat/d; s,//.*,,; s,[^ ],qcsrc/menu/&,' < qcsrc/menu/progs.src)
+FILES_MENU = $(shell find qcsrc/menu qcsrc/common qcsrc/warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) qcsrc/server/w_*.qc
menu.dat: $(FILES_MENU)
@echo make[1]: Entering directory \`$(PWD)/qcsrc/menu\'
cd qcsrc/menu && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_MENU)
set g_balance_nex_secondary 0
set g_balance_nex_secondary_charge 0
set g_balance_nex_secondary_charge_rate 0.1
-set g_balance_nex_secondary_charge_pool 0
-set g_balance_nex_secondary_charge_pool_regen 0.15
-set g_balance_nex_secondary_charge_pool_pause_regen 1
-set g_balance_nex_secondary_charge_pool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool 0
+set g_balance_nex_secondary_chargepool_regen 0.15
+set g_balance_nex_secondary_chargepool_pause_regen 1
+set g_balance_nex_secondary_chargepool_pause_health_regen 1
set g_balance_nex_secondary_damage 100
set g_balance_nex_secondary_force 600
set g_balance_nex_secondary_refire 1.5
// {{{ campingrifle
set g_balance_campingrifle_magazinecapacity 8
set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
set g_balance_campingrifle_bursttime 0
set g_balance_campingrifle_primary_tracer 0
set g_balance_campingrifle_primary_damage 60
set g_balance_seeker_flac_speed_up 1000
set g_balance_seeker_flac_speed_z 0
set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 3000
set g_balance_seeker_missile_ammo 2
set g_balance_seeker_missile_animtime 0.3
set g_balance_seeker_missile_count 4
set g_balance_seeker_missile_damage 40
set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 6000
set g_balance_seeker_missile_delay 0.25
set g_balance_seeker_missile_edgedamage 10
set g_balance_seeker_missile_force 250
set g_balance_seeker_missile_smart_trace_max 2500
set g_balance_seeker_missile_smart_trace_min 1000
set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
set g_balance_seeker_missile_speed_up 300
set g_balance_seeker_missile_speed_z 0
set g_balance_seeker_missile_speed_max 1250
set g_balance_nex_secondary 0
set g_balance_nex_secondary_charge 0
set g_balance_nex_secondary_charge_rate 0.1
-set g_balance_nex_secondary_charge_pool 0
-set g_balance_nex_secondary_charge_pool_regen 0.15
-set g_balance_nex_secondary_charge_pool_pause_regen 1
-set g_balance_nex_secondary_charge_pool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool 0
+set g_balance_nex_secondary_chargepool_regen 0.15
+set g_balance_nex_secondary_chargepool_pause_regen 1
+set g_balance_nex_secondary_chargepool_pause_health_regen 1
set g_balance_nex_secondary_damage 80
set g_balance_nex_secondary_force -500
set g_balance_nex_secondary_refire 1.25
// {{{ campingrifle
set g_balance_campingrifle_magazinecapacity 8
set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
set g_balance_campingrifle_bursttime 0.85 // 0.35 - 0.1 + 0.35 - 0.1 + 0.35 = three secondaries
set g_balance_campingrifle_primary_tracer 0
set g_balance_campingrifle_primary_damage 75
set g_balance_seeker_flac_speed_up 1000
set g_balance_seeker_flac_speed_z 0
set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 3000
set g_balance_seeker_missile_ammo 2
set g_balance_seeker_missile_animtime 0.3
set g_balance_seeker_missile_count 8
set g_balance_seeker_missile_damage 25
set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 6000
set g_balance_seeker_missile_delay 0.25
set g_balance_seeker_missile_edgedamage 10
set g_balance_seeker_missile_force 250
set g_balance_seeker_missile_smart_trace_max 2500
set g_balance_seeker_missile_smart_trace_min 1000
set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
set g_balance_seeker_missile_speed_up 300
set g_balance_seeker_missile_speed_z 0
set g_balance_seeker_missile_speed_max 1250
set g_balance_nex_secondary 0
set g_balance_nex_secondary_charge 0
set g_balance_nex_secondary_charge_rate 0.1
-set g_balance_nex_secondary_charge_pool 0
-set g_balance_nex_secondary_charge_pool_regen 0.15
-set g_balance_nex_secondary_charge_pool_pause_regen 1
-set g_balance_nex_secondary_charge_pool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool 0
+set g_balance_nex_secondary_chargepool_regen 0.15
+set g_balance_nex_secondary_chargepool_pause_regen 1
+set g_balance_nex_secondary_chargepool_pause_health_regen 1
set g_balance_nex_secondary_damage 0
set g_balance_nex_secondary_force 0
set g_balance_nex_secondary_refire 0
// {{{ campingrifle
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_auto_reload_on_switch 0
set g_balance_campingrifle_bursttime 0
set g_balance_campingrifle_primary_tracer 1
set g_balance_campingrifle_primary_damage 65
set g_balance_seeker_flac_speed_up 1000
set g_balance_seeker_flac_speed_z 0
set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 3000
set g_balance_seeker_missile_ammo 2
set g_balance_seeker_missile_animtime 0.3
set g_balance_seeker_missile_count 4
set g_balance_seeker_missile_damage 40
set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 6000
set g_balance_seeker_missile_delay 0.25
set g_balance_seeker_missile_edgedamage 10
set g_balance_seeker_missile_force 250
set g_balance_seeker_missile_smart_trace_max 2500
set g_balance_seeker_missile_smart_trace_min 1000
set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
set g_balance_seeker_missile_speed_up 300
set g_balance_seeker_missile_speed_z 0
set g_balance_seeker_missile_speed_max 1250
set g_pickup_respawntime_medium 20
set g_pickup_respawntime_long 30
set g_pickup_respawntime_powerup 120
-set g_pickup_respawntime_weapon 5
+set g_pickup_respawntime_weapon 10
set g_pickup_respawntime_ammo 25
set g_pickup_respawntimejitter_short 0
set g_pickup_respawntimejitter_medium 0
set g_balance_laser_primary_edgedamage 20
set g_balance_laser_primary_force 150 // this looks insanely low, but actually isn't with zscale and velocitybias
set g_balance_laser_primary_radius 60
-set g_balance_laser_primary_speed 4000
+set g_balance_laser_primary_speed 5000
set g_balance_laser_primary_spread 0
set g_balance_laser_primary_refire 0.6
set g_balance_laser_primary_animtime 0.6
// }}}
// {{{ mortar
set g_balance_grenadelauncher_primary_type 0
-set g_balance_grenadelauncher_primary_damage 50
+set g_balance_grenadelauncher_primary_damage 44
set g_balance_grenadelauncher_primary_edgedamage 32
set g_balance_grenadelauncher_primary_force 300
set g_balance_grenadelauncher_primary_radius 115
set g_balance_grenadelauncher_primary_remote_minbouncecnt 0
set g_balance_grenadelauncher_secondary_type 1
-set g_balance_grenadelauncher_secondary_damage 70
+set g_balance_grenadelauncher_secondary_damage 62
set g_balance_grenadelauncher_secondary_edgedamage 32
set g_balance_grenadelauncher_secondary_force 300
set g_balance_grenadelauncher_secondary_radius 150
set g_balance_grenadelauncher_bouncestop 0.12
// }}}
// {{{ minelayer
-set g_balance_minelayer_damage 35
+set g_balance_minelayer_damage 42
set g_balance_minelayer_edgedamage 30
set g_balance_minelayer_force 250
set g_balance_minelayer_radius 175
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 1250
+set g_balance_crylink_primary_speed 1500
set g_balance_crylink_primary_spread 0.05
set g_balance_crylink_primary_shots 7
set g_balance_crylink_primary_bounces 2
set g_balance_crylink_secondary_line_fadetime 2
// }}}
// {{{ nex
-set g_balance_nex_primary_damage 100
+set g_balance_nex_primary_damage 90
set g_balance_nex_primary_force 500
set g_balance_nex_primary_refire 1
set g_balance_nex_primary_animtime 0.4
set g_balance_nex_secondary 1
set g_balance_nex_secondary_charge 1
set g_balance_nex_secondary_charge_rate 0.4
-set g_balance_nex_secondary_charge_pool 1
-set g_balance_nex_secondary_charge_pool_regen 0.15
-set g_balance_nex_secondary_charge_pool_pause_regen 1
-set g_balance_nex_secondary_charge_pool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool 1
+set g_balance_nex_secondary_chargepool_regen 0.15
+set g_balance_nex_secondary_chargepool_pause_regen 1
+set g_balance_nex_secondary_chargepool_pause_health_regen 1
set g_balance_nex_secondary_damage 0
set g_balance_nex_secondary_force 0
set g_balance_nex_secondary_refire 0
set g_balance_hagar_secondary_ammo 1
// }}}
// {{{ rocketlauncher
-set g_balance_rocketlauncher_damage 90
-set g_balance_rocketlauncher_edgedamage 30
+set g_balance_rocketlauncher_damage 82
+set g_balance_rocketlauncher_edgedamage 32
set g_balance_rocketlauncher_force 350
-set g_balance_rocketlauncher_radius 125
+set g_balance_rocketlauncher_radius 130
set g_balance_rocketlauncher_speed 1400
set g_balance_rocketlauncher_speedaccel 1400
set g_balance_rocketlauncher_speedstart 800
set g_balance_rocketlauncher_health 0
set g_balance_rocketlauncher_damageforcescale 0
set g_balance_rocketlauncher_detonatedelay 0.05 // positive: timer till detonation is allowed, negative: "security device" that prevents ANY remote detonation if it could hurt its owner, zero: detonatable at any time
-set g_balance_rocketlauncher_guiderate 40 // max degrees per second
+set g_balance_rocketlauncher_guiderate 42 // max degrees per second
set g_balance_rocketlauncher_guideratedelay 0.01 // immediate
set g_balance_rocketlauncher_guidegoal 512 // goal distance for (non-laser) guiding (higher = less control, lower = erratic)
set g_balance_rocketlauncher_guidedelay 0.15 // delay before guiding kicks in
set g_balance_hlac_primary_edgedamage 10
set g_balance_hlac_primary_force 70
set g_balance_hlac_primary_radius 40
-set g_balance_hlac_primary_speed 2500
+set g_balance_hlac_primary_speed 9000
set g_balance_hlac_primary_lifetime 5
set g_balance_hlac_primary_refire 0.1
set g_balance_hlac_secondary_edgedamage 13
set g_balance_hlac_secondary_force 100
set g_balance_hlac_secondary_radius 45
-set g_balance_hlac_secondary_speed 2500
+set g_balance_hlac_secondary_speed 9000
set g_balance_hlac_secondary_lifetime 5
set g_balance_hlac_secondary_refire 0.8
// {{{ campingrifle
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_auto_reload_on_switch 0
set g_balance_campingrifle_bursttime 0
set g_balance_campingrifle_primary_tracer 1
-set g_balance_campingrifle_primary_damage 70
-set g_balance_campingrifle_primary_headshotaddeddamage 110
+set g_balance_campingrifle_primary_damage 60
+set g_balance_campingrifle_primary_headshotaddeddamage 100
set g_balance_campingrifle_primary_spread 0
set g_balance_campingrifle_primary_force 2
set g_balance_campingrifle_primary_speed 40000
set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
set g_balance_campingrifle_secondary 1
set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 50
-set g_balance_campingrifle_secondary_headshotaddeddamage 75
+set g_balance_campingrifle_secondary_damage 42
+set g_balance_campingrifle_secondary_headshotaddeddamage 70
set g_balance_campingrifle_secondary_spread 0
set g_balance_campingrifle_secondary_force 2
set g_balance_campingrifle_secondary_speed 20000
set g_balance_seeker_flac_speed_up 1000
set g_balance_seeker_flac_speed_z 0
set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 1400
set g_balance_seeker_missile_ammo 2
set g_balance_seeker_missile_animtime 0.3
set g_balance_seeker_missile_count 8
set g_balance_seeker_missile_damage 15
set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 1400
set g_balance_seeker_missile_delay 0.25
set g_balance_seeker_missile_edgedamage 10
set g_balance_seeker_missile_force 250
set g_balance_seeker_missile_smart_trace_max 2500
set g_balance_seeker_missile_smart_trace_min 1000
set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
set g_balance_seeker_missile_speed_up 300
set g_balance_seeker_missile_speed_z 0
-set g_balance_seeker_missile_speed_max 1250
+set g_balance_seeker_missile_speed_max 1400
set g_balance_seeker_missile_spread 0
set g_balance_seeker_missile_turnrate 0.65
set g_balance_seeker_tag_ammo 1
set g_balance_seeker_tag_health 5
set g_balance_seeker_tag_lifetime 15
set g_balance_seeker_tag_refire 0.7
-set g_balance_seeker_tag_speed 9000
+set g_balance_seeker_tag_speed 5000
set g_balance_seeker_tag_spread 0
// End new seeker
set g_balance_nex_secondary 1
set g_balance_nex_secondary_charge 1
set g_balance_nex_secondary_charge_rate 0.55
-set g_balance_nex_secondary_charge_pool 0
-set g_balance_nex_secondary_charge_pool_regen 0.15
-set g_balance_nex_secondary_charge_pool_pause_regen 1
-set g_balance_nex_secondary_charge_pool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool 0
+set g_balance_nex_secondary_chargepool_regen 0.15
+set g_balance_nex_secondary_chargepool_pause_regen 1
+set g_balance_nex_secondary_chargepool_pause_health_regen 1
set g_balance_nex_secondary_damage 100
set g_balance_nex_secondary_force 600
set g_balance_nex_secondary_refire 1.5
set g_balance_hlac_primary_edgedamage 2
set g_balance_hlac_primary_force -100
set g_balance_hlac_primary_radius 100
-set g_balance_hlac_primary_speed 5000
+set g_balance_hlac_primary_speed 15000
set g_balance_hlac_primary_lifetime 3
set g_balance_hlac_primary_refire 0.1
set g_balance_hlac_secondary_edgedamage 3
set g_balance_hlac_secondary_force 100
set g_balance_hlac_secondary_radius 50
-set g_balance_hlac_secondary_speed 9000
+set g_balance_hlac_secondary_speed 15000
set g_balance_hlac_secondary_lifetime 3
set g_balance_hlac_secondary_refire 1
set g_balance_hlac_secondary_animtime 0.7
// {{{ campingrifle
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_auto_reload_on_switch 0
set g_balance_campingrifle_bursttime 0
set g_balance_campingrifle_primary_tracer 1
set g_balance_campingrifle_primary_damage 40
set g_balance_seeker_flac_speed_z 0
set g_balance_seeker_flac_spread 0.25
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 1400
set g_balance_seeker_missile_ammo 2
set g_balance_seeker_missile_animtime 0.3
set g_balance_seeker_missile_count 4
set g_balance_seeker_missile_damage 50
set g_balance_seeker_missile_damageforcescale 2
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 1400
set g_balance_seeker_missile_delay 0.25
set g_balance_seeker_missile_edgedamage 10
set g_balance_seeker_missile_force 250
set g_balance_seeker_missile_smart_trace_max 2500
set g_balance_seeker_missile_smart_trace_min 1000
set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
set g_balance_seeker_missile_speed_up 300
set g_balance_seeker_missile_speed_z 0
-set g_balance_seeker_missile_speed_max 1250
+set g_balance_seeker_missile_speed_max 1400
set g_balance_seeker_missile_spread 0
set g_balance_seeker_missile_turnrate 0.65
+// Xonotic ProMode
exec defaultXonotic.cfg
-exec physicsXPM.cfg
-set g_start_weapon_laser 0
-set g_balance_weaponswitchdelay 0
+//==============
+// pure changes
+//==============
-set g_shootfromcenter 1
+// players
+sv_fbskin_green // visible playermodel forced on everyone
-set g_forced_respawn 1
+//================
+// impure changes
+//================
-set g_mirrordamage 0
-set g_friendlyfire 1
+// players
+g_jump_grunt 1 // make enemies even easier to hear when they're jumping around
-set timelimit_overtimes 1
+// physics
+exec physicsXPM.cfg // XPM physics. Similar to vanilla Xonotic physics, with a different way to accelerate: through strafejumping
-set sv_fragmessage_information_stats 0
+// balance
+set g_balance_weaponswitchdelay 0 // no switch animation, this is standard in "pro modes" ;)
+set g_shootfromcenter 1 // hit where you point at with the crosshair (almost so, no shooteye because it's really ugly)
-// force a visible playermodel!
-set sv_defaultcharacter 1
-set sv_defaultplayermodel "models/player/nyx.iqm"
-set sv_defaultplayercolors 60
-set g_fullbrightplayers 1
+// match rules
+set timelimit_overtimes 1 // overtimes on, draw matches are less interesting! :)
+set g_forced_respawn 1 // no delaying/cheating a match by not spawning
+set g_mirrordamage 0 // hurting teammates does not hurt you...
+set g_friendlyfire 1 // ...it hurts them.
+
+// info
+set sv_fragmessage_information_stats 0 // don't reveal how much health/armor the attacker had
// server about changes)
alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
+seta cl_firststart "" "how many times the client has been run"
+seta cl_startcount 0 "how many times the client has been run"
+
// detect dedicated server or client
alias "_detect_dedicated_$qport" "${* asis}"
alias "_detect_dedicated_0" ""
seta crosshair_pickup 0.25
seta crosshair_pickup_speed 4
seta crosshair_per_weapon 0 "when 1, each gun will display a different crosshair"
-seta crosshair_color_override 0 "when 1, crosshair_color_* overrides the per-weapon color"
-seta crosshair_color_per_weapon 1 "when 1, each gun will display a different colored crosshair"
+seta crosshair_color_per_weapon 1 "when 1, each gun will display the crosshair with a different color"
seta crosshair_effect_speed -1 "how fast (in seconds) some crosshair effects should take place, 0 = instant, -1 = 2x weapon switch time"
seta crosshair_effect_scalefade 1 "use scaling and fading for crosshair effects"
seta crosshair_hittest 1 "do a crosshair hit evaluation; also, the crosshair is scaled by the given number when aiming at an enemy, and blurred when aiming at a team mate"
r_motionblur 0 // motion blur value, default is 0
r_damageblur 0 // motion blur when damaged, default is 0
+r_bloom_blur 8
+r_bloom_brighten 3
+r_bloom_colorexponent 1
+r_bloom_colorscale 1
+r_bloom_colorsubtract 0.25
+r_bloom_resolution 320
+r_hdr_range 4
+
seta vid_x11_display "" "xonotic-linux-*.sh will use this to start xonotic on an other/new X display"
// This can have three possible settings:
// "" run as usual
cl_movement 1
cl_stairsmoothspeed 200
-cl_forwardspeed $sv_maxspeed
-cl_backspeed $sv_maxspeed
-cl_sidespeed $sv_maxspeed
-cl_upspeed $sv_maxspeed
-cl_movement_accelerate $sv_accelerate
-cl_movement_airaccel_qw $sv_airaccel_qw
-cl_movement_airaccel_sideways_friction $sv_airaccel_sideways_friction
-cl_movement_airaccelerate $sv_airaccelerate
-cl_movement_edgefriction $edgefriction
-cl_movement_friction $sv_friction
-cl_movement_jumpvelocity $sv_jumpvelocity
-cl_movement_maxairspeed $sv_maxairspeed
-cl_movement_maxspeed $sv_maxspeed
-cl_movement_stepheight $sv_stepheight
-cl_movement_stopspeed $sv_stopspeed
-cl_movement_track_canjump 0 // till DP bug gets fixed
-cl_movement_wallfriction $sv_wallfriction
-cl_movement_wateraccelerate $sv_wateraccelerate
-cl_movement_waterfriction $sv_waterfriction
seta cl_autoswitch 1 "automatically switch to newly picked up weapons if they are better than what you are carrying"
alias autoswitch "set cl_autoswitch $1 ; cmd autoswitch $1"
set bot_ai_aimskill_offset 0.3 "Amount of error induced to the bots aim"
set bot_ai_aimskill_think 1 "Aiming velocity. Use values below 1 for slower aiming"
set bot_ai_custom_weapon_priority_distances "300 850" "Define close and far distances in any order. Based on the distance to the enemy bots will choose different weapons"
-set bot_ai_custom_weapon_priority_far "minstanex nex campingrifle rocketlauncher minelayer grenadelauncher electro hagar hlac crylink laser uzi fireball seeker shotgun tuba" "Desired weapons for far distances ordered by priority"
-set bot_ai_custom_weapon_priority_mid "minstanex rocketlauncher nex fireball seeker minelayer grenadelauncher electro uzi campingrifle crylink hlac hagar shotgun laser tuba" "Desired weapons for middle distances ordered by priority"
-set bot_ai_custom_weapon_priority_close "minstanex nex uzi hlac tuba seeker hagar crylink minelayer grenadelauncher shotgun electro campingrifle rocketlauncher laser fireball" "Desired weapons for close distances ordered by priority"
+set bot_ai_custom_weapon_priority_far "minstanex nex campingrifle electro rocketlauncher grenadelauncher hagar hlac crylink laser uzi fireball seeker shotgun tuba minelayer" "Desired weapons for far distances ordered by priority"
+set bot_ai_custom_weapon_priority_mid "minstanex rocketlauncher nex fireball seeker grenadelauncher electro uzi campingrifle crylink hlac hagar shotgun laser tuba minelayer" "Desired weapons for middle distances ordered by priority"
+set bot_ai_custom_weapon_priority_close "minstanex shotgun nex uzi hlac tuba seeker hagar crylink grenadelauncher electro campingrifle rocketlauncher laser fireball minelayer" "Desired weapons for close distances ordered by priority"
set bot_ai_weapon_combo 1 "Enable bots to do weapon combos"
set bot_ai_weapon_combo_threshold 0.3 "Try to make a combo N seconds after the last attack"
set bot_ai_friends_aware_pickup_radius "500" "Bots will not pickup items if a team mate is this distance near the item"
// to force disable delay or waves, set them to 0.125
set g_ctf_respawn_delay 0
set g_ctf_respawn_waves 0
+set g_ctf_weapon_stay 0
set g_dm_respawn_delay 0
set g_dm_respawn_waves 0
+set g_dm_weapon_stay 0
set g_dom_respawn_delay 0
set g_dom_respawn_waves 0
+set g_dom_weapon_stay 0
set g_lms_respawn_delay 0
set g_lms_respawn_waves 0
+set g_lms_weapon_stay 0
set g_rune_respawn_delay 0
set g_rune_respawn_waves 0
+set g_rune_weapon_stay 0
set g_tdm_respawn_delay 0
set g_tdm_respawn_waves 0
+set g_tdm_weapon_stay 0
set g_kh_respawn_delay 0
set g_kh_respawn_waves 0
+set g_kh_weapon_stay 0
set g_arena_respawn_delay 0
set g_arena_respawn_waves 0
+set g_arena_weapon_stay 0
set g_ca_respawn_delay 0
set g_ca_respawn_waves 0
+set g_ca_weapon_stay 0
set g_ca_damage2score_multiplier 0.01
set g_ca_round_timelimit 180
set g_nexball_respawn_delay 0
set g_nexball_respawn_waves 0
+set g_nexball_weapon_stay 0
set g_as_respawn_delay 0
set g_as_respawn_waves 0
+set g_as_weapon_stay 0
set g_ons_respawn_delay 0
set g_ons_respawn_waves 0
+set g_ons_weapon_stay 0
set g_rc_respawn_waves 0
set g_rc_respawn_delay 0
+set g_rc_weapon_stay 0
set g_cts_respawn_waves 0
-set g_cts_respawn_delay 0.25
+set g_cts_respawn_delay 0
set g_cts_selfdamage 1 "0 = disable all selfdamage and falldamage in cts"
set g_cts_finish_kill_delay 10 "prevent cheating by running back to the start line, and starting out with more speed than otherwise possible"
+set g_cts_weapon_stay 1
set g_freezetag_respawn_waves 0
-set g_freezetag_respawn_delay 0.25
+set g_freezetag_respawn_delay 0
+set g_freezetag_weapon_stay 0
set g_ka_respawn_delay 0
set g_ka_respawn_waves 0
+set g_ka_weapon_stay 0
// overtime
seta timelimit_overtime 2 "duration in minutes of one added overtime, added to the timelimit"
// common team values
set g_tdm 0 "Team Deathmatch: the team who kills their opponents most often wins"
-seta teamplay_default 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the following four cvars"
+seta teamplay_mode 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the following four cvars"
seta g_mirrordamage 0.300000 "for teamplay 4: mirror damage factor"
seta g_friendlyfire 0.100000 "for teamplay 4: fiendly fire factor"
seta g_teamdamage_threshold 50 "for teamplay 4: threshold over which to apply mirror damage"
sv_gameplayfix_stepmultipletimes 1
// delay for "kill" to prevent abuse
-set g_balance_kill_delay 5
+set g_balance_kill_delay 2
+set g_balance_kill_antispam 5
// this feature is currently buggy in the engine (it appears to PREVENT any dropping in lots of maps, leading to weirdly aligned entities, and in some cases even CAUSES them to drop through solid, like in facing worlds nex)
sv_gameplayfix_droptofloorstartsolid 0
alias ons_map "cl_cmd radar" // legacy alias
alias radar "cl_cmd radar"
-alias scoreboard_columns_set "cl_cmd scoreboard_columns_set $*"
+alias scoreboard_columns_set "" // aliased later
alias scoreboard_columns_help "cl_cmd scoreboard_columns_help $*"
alias _gl_flashblend_update_00 "gl_flashblend 1"
alias menu_showteamselect "menu_cmd directmenu TeamSelect"
alias menu_showhudexit "menu_cmd directmenu HUDExit"
alias menu_showhudoptions "menu_cmd directpanelhudmenu $*"
-alias menu_sync "menu_cmd sync"
bind f5 menu_showteamselect
set g_bugrigs 0
set cl_lerpanim_maxdelta_framegroups 0.05 // must be faster than fastest weapon refire
set cl_lerpanim_maxdelta_server 0.1 // must be slower than slowest server controlled anim (e.g. animinfo stuff)
-// player ID
-seta _cl_userid "" "player ID (e.g. for tournaments)"
-
// FIXME workaround for engine bug
sv_gameplayfix_nudgeoutofsolid 0
// to div0: remove this once 5b7ac1706712977bbc0297d2d53294e73574c7cd (svn r9537) is in the stable branch of the engine again
set g_forced_team_pink "" "list of player IDs for pink team"
set g_forced_team_otherwise "default" "action if a non listed player joins (can be default for default action, spectate for forcing to spectate, or red, blue, yellow, pink)"
+// random charge stuff :P
+set g_weapon_charge_colormod_hdrmultiplier 4 "how much to multiply the colors by in the colormod vector"
+set g_weapon_charge_colormod_red_half 0
+set g_weapon_charge_colormod_green_half 0.5
+set g_weapon_charge_colormod_blue_half 1
+set g_weapon_charge_colormod_red_full 1
+set g_weapon_charge_colormod_green_full -0.5
+set g_weapon_charge_colormod_blue_full -1
+
// player statistics server URI
set g_playerstats_uri ""
+// create this cvar in case the engine did not
+set snd_soundradius 1200
+
+// loading screen
+scr_loadingscreen_scale 1
+scr_loadingscreen_scale_base 1
+scr_loadingscreen_scale_limit 1
+
// other config files
exec balanceXonotic.cfg
exec ctfscoring-ai.cfg
exec effects-normal.cfg
exec physicsX0.cfg
exec turrets.cfg
+exec font-nimbussansl.cfg
// hud cvar descriptions
exec _hud_descriptions.cfg
// please add any new cvars into the hud_save script in qcsrc/client/hud.qc for consistency
exec hud_luminos.cfg
-set g_weapon_charge_colormod_hdrmultiplier 4 "how much to multiply the colors by in the colormod vector"
-set g_weapon_charge_colormod_red_half 0
-set g_weapon_charge_colormod_green_half 0.5
-set g_weapon_charge_colormod_blue_half 1
-set g_weapon_charge_colormod_red_full 1
-set g_weapon_charge_colormod_green_full -0.5
-set g_weapon_charge_colormod_blue_full -1
+// enable menu syncing
+alias menu_sync "menu_cmd sync"
+alias scoreboard_columns_set "cl_cmd scoreboard_columns_set $*"
seta hud_panel_ammo_iconalign "0"
seta hud_panel_ammo_progressbar "1"
seta hud_panel_ammo_progressbar_name "progressbar_ammo"
+seta hud_panel_ammo_progressbar_xoffset "0.32"
seta hud_panel_ammo_text "1"
seta hud_panel_powerups 1
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
156 16 15.000000 0 // jump
172 15 15.000000 0 // painone
187 17 15.000000 0 // paintwo
-204 5 15.000000 1 // shoot
+204 5 15.000000 0 // shoot
209 21 15.000000 1 // taunt
230 21 40.000000 1 // run
251 21 40.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
184 21 25.000000 0 // jump
205 15 15.000000 0 // painone
220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
240 21 15.000000 1 // taunt
261 21 35.000000 1 // run
282 21 35.000000 1 // runbackwards
156 16 15.000000 0 // jump
172 15 15.000000 0 // painone
187 17 15.000000 0 // paintwo
-204 5 15.000000 1 // shoot
+204 5 15.000000 0 // shoot
209 21 15.000000 1 // taunt
230 21 40.000000 1 // run
251 21 40.000000 1 // runbackwards
sprite wpn-fireball "Fireball" ff8000 000000 0.0 # orange
sprite wpn-hlac "HLAC" 00ff00 000000 0.0 # green
sprite wpn-campingrifle "Rifle" 80ff00 000000 0.0 # orange
+sprite wpn-minelayer "Mine Layer" ccff00 000000 0.0 # yellowish orange
sprite dom-neut "Control point" 00ffff 000000 0.0
sprite dom-red "Control point" ff0000 000000 0.0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 320
sv_jumpspeedcap_min 0 // need predicting? (it should already be in CSQC prediction code)
sv_jumpspeedcap_max 0.35
sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min 0 // need predicting? (it should already be in CSQC prediction code)
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max 0.38
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 320
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
sv_jumpspeedcap_min 0
sv_jumpspeedcap_max 0.5
sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 320
sv_jumpspeedcap_min ""
sv_jumpspeedcap_max ""
sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
--- /dev/null
+#!/bin/sh
+set -ex
+git checkout divVerent/autocvarizer_test
+trap 'git reset --hard; git checkout divVerent/autocvarizer' EXIT
+trap 'exit 1' INT
+git merge --no-commit -s ours divVerent/autocvarizer
+git read-tree -m -u divVerent/autocvarizer # "theirs"
+find server \( -type f -a \( -name \*.c -o -name \*.qc -o -name \*.h -o -name \*.qh \) \) -print0 | AUTOCVARING_SVQC=1 xargs -0 perl autocvarize.pl > server/autocvars.qh.new
+diff -Nu server/autocvars.qh server/autocvars.qh.new || true
+mv server/autocvars.qh.new server/autocvars.qh
+find client \( -type f -a \( -name \*.c -o -name \*.qc -o -name \*.h -o -name \*.qh \) \) -print0 | xargs -0 perl autocvarize.pl > client/autocvars.qh.new
+diff -Nu client/autocvars.qh client/autocvars.qh.new || true
+mv client/autocvars.qh.new client/autocvars.qh
+if make -C .. FTEQCC=../../../../fteqcc/fteqcc.bin FTEQCCFLAGS=; then
+ echo "Commit? ^C to not"
+ read -r L
+ git add server/autocvars.qh
+ git add client/autocvars.qh
+ git commit -a
+else
+ echo "FAILED. Exit this shell when done examining."
+ sh -i
+fi
--- /dev/null
+#!/usr/bin/perl
+# this tool generates JUST the autocvar declarations for cvars
+use strict;
+use warnings;
+
+my @files = @ARGV;
+
+my %cvars = ();
+my %old = ();
+my %menu = ();
+my %defaults = ();
+
+sub found($$$$)
+{
+ my ($name, $type, $default, $force) = @_;
+ if(length $name >= 55)
+ {
+ warn "cvar $name is a Dr. honorificabilitudinitatibis causa BRLOGENSHFEGLE";
+ $type = 'cvar_toolong';
+ return;
+ }
+# $old{$name} = 1
+# if $force;
+# $menu{$name} = 1
+# if $force > 1;
+ if(exists $cvars{$name} and not defined $cvars{name})
+ {
+ # have already warned
+ }
+ elsif(exists $cvars{$name} and $type ne $cvars{$name})
+ {
+ warn "cvar $name used with different types";
+ if($force)
+ {
+ $defaults{$name} = $default;
+ $cvars{$name} = $type;
+ }
+ else
+ {
+ undef $cvars{$name}
+ unless $old{$name};
+ }
+ return;
+ }
+ elsif(exists $cvars{$name} and exists $defaults{$name} and $default ne $defaults{$name})
+ {
+ warn "cvar $name used with different defaults";
+ if($force)
+ {
+ $defaults{$name} = $default;
+ $cvars{$name} = $type;
+ }
+ else
+ {
+ undef $cvars{$name}
+ unless $old{$name};
+ }
+ }
+ else
+ {
+ $defaults{$name} = $default;
+ $cvars{$name} = $type;
+ }
+}
+
+for my $f(@files)
+{
+ print STDERR "In file $f\n";
+ open my $fh, "<", $f;
+ while(<$fh>)
+ {
+ chomp;
+ if(/^\/\/#NO AUTOCVARS START/ .. /^\/\/#NO AUTOCVARS END/)
+ {
+ next;
+ }
+ s/\/\/.*//;
+ if(/^(?:var )?float autocvar_(\w+);$/)
+ {
+ found $1, 'cvar', 0, 1;
+ next;
+ }
+ if(/^var float autocvar_(\w+) = (.*);$/)
+ {
+ found $1, 'cvar', $2, 1;
+ next;
+ }
+ if(/^(?:var )?vector autocvar_(\w+);$/)
+ {
+ found $1, 'cvar_vector', "0 0 0", 1;
+ next;
+ }
+ if(/^var vector autocvar_(\w+) = '(.*)';$/)
+ {
+ found $1, 'cvar_vector', $2, 1;
+ next;
+ }
+ if(/^(?:var )?string autocvar_(\w+);$/)
+ {
+ found $1, 'cvar_string', "", 1;
+ next;
+ }
+ if(/^var string autocvar_(\w+) = "(.*)";$/)
+ {
+ found $1, 'cvar_string', $2, 1;
+ next;
+ }
+ if(/^#define autocvar_(\w+) cvar("\1")$/)
+ {
+ found $1, 'cvar', 0, 2;
+ next;
+ }
+ if(/^#define autocvar_(\w+) cvar_or("\1", (.*))$/)
+ {
+ found $1, 'cvar', $1, 2;
+ next;
+ }
+ if(/^#define autocvar_(\w+) cvar_string("\1")$/)
+ {
+ found $1, 'cvar_string', "", 2;
+ next;
+ }
+ while(/\bcvar\s*\(\s*"(\w+)"\s*\)/g)
+ {
+ found $1, 'cvar', 0, 0;
+ }
+ while(/\bcvar_string\s*\(\s*"(\w+)"\s*\)/g)
+ {
+ found $1, 'cvar_string', "", 0;
+ }
+ while(/\bcvar_vector\s*\(\s*"(\w+)"\s*\)/g)
+ {
+ found $1, 'cvar_vector', "0 0 0", 0;
+ }
+ while(/\bcvar_or\s*\(\s*"(\w+)"\s*,\s*([^\s)]+)\s*\)/g)
+ {
+ found $1, 'cvar', $2, 0;
+ }
+ }
+}
+
+if($ENV{AUTOCVARING_SVQC})
+{
+ for my $f(<menu/xonotic/*.c>)
+ {
+ print STDERR "In file $f\n";
+ open my $fh, "<", $f;
+ while(<$fh>)
+ {
+ for(/"([^"]*)"/g)
+ {
+ $menu{$1} = 1;
+ }
+ }
+ }
+
+ for my $f(<../maps/campaign*.txt>)
+ {
+ print STDERR "In file $f\n";
+ open my $fh, "<", $f;
+ while(<$fh>)
+ {
+ for(/\b(.+?)\b/g)
+ {
+ $menu{$1} = 1;
+ }
+ }
+ }
+}
+
+for my $name(sort keys %cvars)
+{
+ my $type = $cvars{$name};
+ my $menu = $menu{$name};
+ my $default = $defaults{$name};
+ die "wtf" if $name =~ /\0/;
+ if(not defined $type)
+ {
+ print "// cannot declare $name, it is used with different types\n";
+ }
+ elsif($type eq 'cvar_toolong')
+ {
+ print "// cannot declare $name, name is too long\n";
+ }
+ elsif($type eq 'cvar' and not $menu and $default eq "0")
+ {
+ print "float autocvar_$name;\n";
+ }
+ elsif($type eq 'cvar' and not $menu and $default ne "0")
+ {
+ print "var float autocvar_$name = $default;\n";
+ }
+ elsif($type eq 'cvar_vector' and not $menu and $default eq "0 0 0")
+ {
+ print "vector autocvar_$name;\n";
+ }
+ elsif($type eq 'cvar_vector' and not $menu and $default ne "0 0 0")
+ {
+ print "var vector autocvar_$name = '$default';\n";
+ }
+ elsif($type eq 'cvar_string' and not $menu and $default eq "")
+ {
+ print "string autocvar_$name;\n";
+ }
+ elsif($type eq 'cvar_string' and not $menu and $default ne "")
+ {
+ print "var string autocvar_$name = \"$default\";\n";
+ }
+ elsif($type eq 'cvar' and $menu and $default eq "0")
+ {
+ print "#define autocvar_$name cvar(\"$name\")\n";
+ }
+ elsif($type eq 'cvar' and $menu and $default ne "0")
+ {
+ print "#define autocvar_$name cvar_or(\"$name\", \"$default\")\n";
+ }
+ elsif($type eq 'cvar_string' and $menu) # sorry, no cvar_or for these
+ {
+ print "#define autocvar_$name cvar_string(\"$name\")\n";
+ }
+ elsif($type eq 'cvar_vector' and $menu) # sorry, no cvar_or for these
+ {
+ print "#define autocvar_$name cvar_vector(\"$name\")\n";
+ }
+}
+
+for my $f(@files)
+{
+ print STDERR "In file $f\n";
+ open my $fh, "<", $f;
+ my $out = "";
+ while(<$fh>)
+ {
+ chomp;
+ if(/^\/\/#NO AUTOCVARS START/ .. /^\/\/#NO AUTOCVARS END/)
+ {
+ $out .= "$_\n";
+ next;
+ }
+ if(/^(?:var )?float autocvar_(.*);$/)
+ {
+ $out .= "$_\n";
+ next;
+ }
+ if(/^(?:var )?string autocvar_(.*);$/)
+ {
+ $out .= "$_\n";
+ next;
+ }
+ if(/^#define autocvar_(.*) cvar/)
+ {
+ $out .= "$_\n";
+ next;
+ }
+ s{\b(cvar|cvar_string|cvar_vector|cvar_or)\s*\(\s*"([^"]+)"\s*(?:,\s*[^\s)]+\s*)?\)}{
+ my ($type, $name) = ($1, $2);
+ $type = 'cvar' if $type eq 'cvar_or';
+ my $realtype = $cvars{$name};
+ my $r = $&;
+ if(defined $realtype)
+ {
+ #$r = "$realtype(\"$name\")";
+ $r = "autocvar_$name";
+ if($type eq 'cvar' && $realtype eq 'cvar_string')
+ {
+ $r = "stof($r)";
+ }
+ if($type eq 'cvar_string' && $realtype eq 'cvar')
+ {
+ $r = "ftos($r)";
+ }
+ }
+ $r;
+ }ge;
+ $out .= "$_\n";
+ }
+ close $fh;
+ open $fh, ">", $f;
+ print $fh $out;
+ close $fh;
+}
GibSplash_Precache();
Casings_Precache();
DamageInfo_Precache();
- if(cvar_string("cl_announcer") != cl_announcer_prev) {
+ if(autocvar_cl_announcer != cl_announcer_prev) {
Announcer_Precache();
if(cl_announcer_prev)
strunzone(cl_announcer_prev);
- cl_announcer_prev = strzone(cvar_string("cl_announcer"));
+ cl_announcer_prev = strzone(autocvar_cl_announcer);
}
Tuba_Precache();
remove(players);
db_close(binddb);
db_close(tempdb);
- if(cvar("cl_db_saveasdump"))
+ if(autocvar_cl_db_saveasdump)
db_dump(ClientProgsDB, "client.db");
else
db_save(ClientProgsDB, "client.db");
void PostInit(void)
{
print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n"));
- localcmd(strcat("\nscoreboard_columns_set ", cvar_string("scoreboard_columns"), ";\n"));
+ localcmd(strcat("\nscoreboard_columns_set ", autocvar_scoreboard_columns, ";\n"));
entity playerchecker;
playerchecker = spawn();
strCmd = argv(0);
if(strCmd == "hud_configure") { // config hud
- cvar_set("_hud_configure", ftos(!cvar("_hud_configure")));
+ cvar_set("_hud_configure", ftos(!autocvar__hud_configure));
return true;
} else if(strCmd == "hud_save") { // save hud config
if(argv(1) == "" || argv(2)) {
if (previous_game_starttime != startTime) {
if ((time + 5.0) < startTime) {
//if connecting to server while restart was active don't always play prepareforbattle
- sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
}
if (time < startTime) {
restartAnnouncer = spawn();
{
float zoomsensitivity, zoomspeed, zoomfactor, zoomdir, velocityzoom;
- zoomsensitivity = cvar("cl_zoomsensitivity");
- zoomfactor = cvar("cl_zoomfactor");
+ zoomsensitivity = autocvar_cl_zoomsensitivity;
+ zoomfactor = autocvar_cl_zoomfactor;
if(zoomfactor < 1 || zoomfactor > 16)
zoomfactor = 2.5;
- zoomspeed = cvar("cl_zoomspeed");
+ zoomspeed = autocvar_cl_zoomspeed;
if(zoomspeed >= 0)
if(zoomspeed < 0.5 || zoomspeed > 16)
zoomspeed = 3.5;
else
setsensitivityscale(1);
- velocityzoom = bound(0, drawframetime / max(0.000000001, cvar_or("cl_velocityzoomtime", 0.3)), 1);
+ velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoomtime), 1);
avgspeed = avgspeed * (1 - velocityzoom) + (vlen(pmove_vel) / 1000) * velocityzoom;
- velocityzoom = exp(float2range11(avgspeed * -cvar_or("cl_velocityzoom", 0) / 1) * 1);
+ velocityzoom = exp(float2range11(avgspeed * -autocvar_cl_velocityzoom / 1) * 1);
- //print(ftos(avgspeed), " avgspeed, ", ftos(cvar_or("cl_velocityzoom", 0)), " cvar, ", ftos(velocityzoom), " return\n"); // for debugging
+ //print(ftos(avgspeed), " avgspeed, ", ftos(autocvar_cl_velocityzoom), " cvar, ", ftos(velocityzoom), " return\n"); // for debugging
float frustumx, frustumy, fovx, fovy;
frustumy = tan(fov * M_PI / 360.0) * 0.75 * current_viewzoom * velocityzoom;
entity nightvision_noise, nightvision_noise2;
float pickup_crosshair_time, pickup_crosshair_size;
-float use_nex_charge_pool;
+float use_nex_chargepool;
float myhealth, myhealth_prev;
float myhealth_flash;
input_angles = warpzone_fixview_cl_viewangles;
view_angles = warpzone_fixview_angles;
- if(cvar("cl_lockview") || (autocvar__hud_configure && spectatee_status <= 0))
+ if(autocvar_cl_lockview || (autocvar__hud_configure && spectatee_status <= 0))
{
pmove_org = freeze_pmove_org;
input_angles = view_angles = freeze_input_angles;
maptimeAnnouncer();
carrierAnnouncer();
- fov = cvar("fov");
+ fov = autocvar_fov;
if(button_zoom || fov <= 59.5)
{
if(!zoomscript_caught)
}
}
- ColorTranslateMode = cvar("cl_stripcolorcodes");
+ ColorTranslateMode = autocvar_cl_stripcolorcodes;
activeweapon = getstati(STAT_SWITCHWEAPON);
- f = cvar("teamplay");
+ f = (serverflags & SERVERFLAG_TEAMPLAY);
if(f != teamplay)
{
teamplay = f;
R_SetView(VF_DRAWWORLD, 1);
// Set the console size vars
- vid_conwidth = cvar("vid_conwidth");
- vid_conheight = cvar("vid_conheight");
- vid_pixelheight = cvar("vid_pixelheight");
+ vid_conwidth = autocvar_vid_conwidth;
+ vid_conheight = autocvar_vid_conheight;
+ vid_pixelheight = autocvar_vid_pixelheight;
R_SetView(VF_FOV, GetCurrentFov(fov));
// Camera for demo playback
if(camera_active)
{
- if(cvar("camera_enable"))
+ if(autocvar_camera_enable)
CSQC_Demo_Camera();
else
{
}
}
#ifdef CAMERATEST
- else if(cvar("camera_enable"))
+ else if(autocvar_camera_enable)
#else
- else if(cvar("camera_enable") && isdemo())
+ else if(autocvar_camera_enable && isdemo())
#endif
{
// Enable required Darkplaces cvars
- chase_active_backup = cvar("chase_active");
+ chase_active_backup = autocvar_chase_active;
cvar_set("chase_active", "2");
cvar_set("cl_demo_mousegrab", "1");
camera_active = TRUE;
R_SetView(VF_DRAWENGINEHUD, 0);
// fetch this one only once per frame
- hud_showbinds = cvar("hud_showbinds");
- hud_showbinds_limit = cvar("hud_showbinds_limit");
+ hud_showbinds = autocvar_hud_showbinds;
+ hud_showbinds_limit = autocvar_hud_showbinds_limit;
// Update the mouse position
/*
// next R_RenderScene call
drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0);
- if(cvar("r_fakelight") >= 2 || cvar("r_fullbright") >= 1)
+ if(autocvar_r_fakelight >= 2 || autocvar_r_fullbright >= 1)
if not(serverflags & SERVERFLAG_ALLOW_FULLBRIGHT)
{
// apply night vision effect
}
// color tint in yellow
- drawfill('0 0 0', cvar("vid_conwidth") * '1 0 0' + cvar("vid_conheight") * '0 1 0', '0.5 1 0.3', 1, DRAWFLAG_MODULATE);
+ drawfill('0 0 0', autocvar_vid_conwidth * '1 0 0' + autocvar_vid_conheight * '0 1 0', '0.5 1 0.3', 1, DRAWFLAG_MODULATE);
// draw BG
a = Noise_Pink(nightvision_noise, frametime * 1.5) * 0.05 + 0.15;
tc_11 = tc_01 + tc_10 - tc_00;
R_BeginPolygon("gfx/nightvision-bg.tga", DRAWFLAG_ADDITIVE);
R_PolygonVertex('0 0 0', tc_00, rgb, a);
- R_PolygonVertex(cvar("vid_conwidth") * '1 0 0', tc_10, rgb, a);
- R_PolygonVertex(cvar("vid_conwidth") * '1 0 0' + cvar("vid_conheight") * '0 1 0', tc_11, rgb, a);
- R_PolygonVertex(cvar("vid_conheight") * '0 1 0', tc_01, rgb, a);
+ R_PolygonVertex(autocvar_vid_conwidth * '1 0 0', tc_10, rgb, a);
+ R_PolygonVertex(autocvar_vid_conwidth * '1 0 0' + autocvar_vid_conheight * '0 1 0', tc_11, rgb, a);
+ R_PolygonVertex(autocvar_vid_conheight * '0 1 0', tc_01, rgb, a);
R_EndPolygon();
// draw FG
tc_11 = tc_01 + tc_10 - tc_00;
R_BeginPolygon("gfx/nightvision-fg.tga", DRAWFLAG_ADDITIVE);
R_PolygonVertex('0 0 0', tc_00, rgb, a);
- R_PolygonVertex(cvar("vid_conwidth") * '1 0 0', tc_10, rgb, a);
- R_PolygonVertex(cvar("vid_conwidth") * '1 0 0' + cvar("vid_conheight") * '0 1 0', tc_11, rgb, a);
- R_PolygonVertex(cvar("vid_conheight") * '0 1 0', tc_01, rgb, a);
+ R_PolygonVertex(autocvar_vid_conwidth * '1 0 0', tc_10, rgb, a);
+ R_PolygonVertex(autocvar_vid_conwidth * '1 0 0' + autocvar_vid_conheight * '0 1 0', tc_11, rgb, a);
+ R_PolygonVertex(autocvar_vid_conheight * '0 1 0', tc_01, rgb, a);
R_EndPolygon();
}
else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_CAMPINGRIFLE && button_attack2)
reticle_type = 2; // nex zoom
- if(cvar("cl_reticle_stretch"))
+ if(autocvar_cl_reticle_stretch)
{
reticle_size_x = vid_conwidth;
reticle_size_y = vid_conheight;
f = current_zoomfraction;
if(zoomscript_caught)
f = 1;
- if(cvar("cl_reticle_item_normal"))
+ if(autocvar_cl_reticle_item_normal)
{
precache_pic("gfx/reticle_normal");
if(reticle_type == 1 && f)
- drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * cvar("cl_reticle_item_normal"), DRAWFLAG_NORMAL);
+ drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_normal, DRAWFLAG_NORMAL);
}
- if(cvar("cl_reticle_item_nex"))
+ if(autocvar_cl_reticle_item_nex)
{
precache_pic("gfx/reticle_nex");
if(reticle_type == 2 && f)
- drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', f * cvar("cl_reticle_item_nex"), DRAWFLAG_NORMAL);
+ drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_nex, DRAWFLAG_NORMAL);
}
// improved polyblend
vector rgb;
- if(cvar("hud_damage"))
+ if(autocvar_hud_damage)
{
float myhealth_flash_temp;
myhealth = getstati(STAT_HEALTH);
// fade out
- myhealth_flash = max(0, myhealth_flash - cvar("hud_damage_fade_rate") * frametime);
+ myhealth_flash = max(0, myhealth_flash - autocvar_hud_damage_fade_rate * frametime);
// add new damage
- myhealth_flash = bound(0, myhealth_flash + max(0, myhealth_prev - myhealth) * cvar("hud_damage_factor"), cvar("hud_damage_maxalpha"));
+ myhealth_flash = bound(0, myhealth_flash + max(0, myhealth_prev - myhealth) * autocvar_hud_damage_factor, autocvar_hud_damage_maxalpha);
float pain_threshold, pain_threshold_lower, pain_threshold_lower_health;
- pain_threshold = cvar("hud_damage_pain_threshold");
- pain_threshold_lower = cvar("hud_damage_pain_threshold_lower");
- pain_threshold_lower_health = cvar("hud_damage_pain_threshold_lower_health");
+ pain_threshold = autocvar_hud_damage_pain_threshold;
+ pain_threshold_lower = autocvar_hud_damage_pain_threshold_lower;
+ pain_threshold_lower_health = autocvar_hud_damage_pain_threshold_lower_health;
if(pain_threshold_lower && myhealth < pain_threshold_lower_health)
{
- pain_threshold = pain_threshold - max(cvar("hud_damage_pain_threshold_pulsating_min"), fabs(sin(M_PI * time / cvar("hud_damage_pain_threshold_pulsating_period")))) * pain_threshold_lower * (1 - max(0, myhealth)/pain_threshold_lower_health);
+ pain_threshold = pain_threshold - max(autocvar_hud_damage_pain_threshold_pulsating_min, fabs(sin(M_PI * time / autocvar_hud_damage_pain_threshold_pulsating_period))) * pain_threshold_lower * (1 - max(0, myhealth)/pain_threshold_lower_health);
}
myhealth_flash_temp = bound(0, myhealth_flash - pain_threshold, 1);
}
else
{
- myhealth_flash += cvar("hud_damage_fade_rate") * frametime; // dead
+ myhealth_flash += autocvar_hud_damage_fade_rate * frametime; // dead
}
}
myhealth_prev = myhealth;
- if(autocvar_cl_gentle_damage || cvar("cl_gentle"))
+ if(autocvar_cl_gentle_damage || autocvar_cl_gentle)
{
if(autocvar_cl_gentle_damage == 2)
{
}
}
else
- myhealth_gentlergb = stov(cvar_string("hud_damage_gentle_color"));
+ myhealth_gentlergb = stov(autocvar_hud_damage_gentle_color);
- drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, cvar("hud_damage_gentle_alpha_multiplier") * bound(0, myhealth_flash_temp, 1) * cvar("hud_damage"), DRAWFLAG_NORMAL);
+ drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, autocvar_hud_damage_gentle_alpha_multiplier * bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
}
else
- drawpic(reticle_pos, "gfx/blood", reticle_size, stov(cvar_string("hud_damage_color")), bound(0, myhealth_flash_temp, 1) * cvar("hud_damage"), DRAWFLAG_NORMAL);
+ drawpic(reticle_pos, "gfx/blood", reticle_size, stov(autocvar_hud_damage_color), bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
}
// Draw the mouse cursor
if(gametype == GAME_FREEZETAG)
{
if(getstati(STAT_FROZEN))
- drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, '0.25 0.90 1', cvar_or("hud_colorflash_alpha", 0.5), DRAWFLAG_ADDITIVE);
+ drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
if(getstatf(STAT_REVIVE_PROGRESS))
{
- DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_REVIVE_PROGRESS), '0.25 0.90 1', cvar("hud_colorflash_alpha"), DRAWFLAG_ADDITIVE);
+ DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
drawstring_aspect(eY * 0.64 * vid_conheight, "Revival progress", eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
}
}
- if(cvar("r_letterbox") == 0)
- if(cvar("viewsize") < 120)
+ if(autocvar_r_letterbox == 0)
+ if(autocvar_viewsize < 120)
CSQC_common_hud();
// crosshair goes VERY LAST
if(!scoreboard_active && !camera_active && intermission != 2) {
string wcross_style;
float wcross_alpha, wcross_resolution;
- wcross_style = cvar_string("crosshair");
+ wcross_style = autocvar_crosshair;
if (wcross_style == "0")
return;
- wcross_resolution = cvar("crosshair_size");
+ wcross_resolution = autocvar_crosshair_size;
if (wcross_resolution == 0)
return;
- wcross_alpha = cvar("crosshair_alpha");
+ wcross_alpha = autocvar_crosshair_alpha;
if (wcross_alpha == 0)
return;
// wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
wcross_origin = project_3d_to_2d(view_origin + MAX_SHOT_DISTANCE * view_forward);
wcross_origin_z = 0;
- if(cvar("crosshair_hittest"))
+ if(autocvar_crosshair_hittest)
{
vector wcross_oldorigin;
wcross_oldorigin = wcross_origin;
if(vlen(v) > 0.01)
shottype = SHOTTYPE_HITOBSTRUCTION;
}
- if(!cvar("crosshair_hittest_showimpact"))
+ if(!autocvar_crosshair_hittest_showimpact)
wcross_origin = wcross_oldorigin;
}
else
string wcross_wep, wcross_name;
float wcross_scale, wcross_blur;
- if (cvar("crosshair_per_weapon") || cvar("crosshair_color_per_weapon")) {
+ if (autocvar_crosshair_per_weapon || autocvar_crosshair_color_per_weapon) {
e = get_weaponinfo(activeweapon);
if (e && e.netname != "")
{
wcross_wep = e.netname;
- if(cvar("crosshair_per_weapon"))
+ if(autocvar_crosshair_per_weapon)
{
wcross_resolution *= cvar(strcat("crosshair_", wcross_wep, "_size"));
if (wcross_resolution == 0)
}
}
}
- if(wcross_wep != "" && cvar("crosshair_color_per_weapon"))
+ if(wcross_wep != "" && autocvar_crosshair_color_per_weapon)
wcross_color = stov(cvar_string(strcat("crosshair_", wcross_wep, "_color")));
else
- wcross_color = stov(cvar_string("crosshair_color"));
+ wcross_color = stov(autocvar_crosshair_color);
wcross_name = strcat("gfx/crosshair", wcross_style);
- if(cvar("crosshair_effect_scalefade"))
+ if(autocvar_crosshair_effect_scalefade)
{
wcross_scale = wcross_resolution;
wcross_resolution = 1;
wcross_scale = 1;
}
- if(cvar("crosshair_pickup"))
+ if(autocvar_crosshair_pickup)
{
if(pickup_crosshair_time < getstatf(STAT_LAST_PICKUP))
{
}
if(pickup_crosshair_size > 0)
- pickup_crosshair_size -= cvar("crosshair_pickup_speed") * frametime;
+ pickup_crosshair_size -= autocvar_crosshair_pickup_speed * frametime;
else
pickup_crosshair_size = 0;
- wcross_scale += sin(pickup_crosshair_size) * cvar("crosshair_pickup");
+ wcross_scale += sin(pickup_crosshair_size) * autocvar_crosshair_pickup;
}
if(shottype == SHOTTYPE_HITENEMY)
- wcross_scale *= cvar("crosshair_hittest"); // is not queried if hittest is 0
+ wcross_scale *= autocvar_crosshair_hittest; // is not queried if hittest is 0
if(shottype == SHOTTYPE_HITTEAM)
- wcross_scale /= cvar("crosshair_hittest"); // is not queried if hittest is 0
+ wcross_scale /= autocvar_crosshair_hittest; // is not queried if hittest is 0
- f = cvar("crosshair_effect_speed");
+ f = autocvar_crosshair_effect_speed;
if(f < 0)
f *= -2 * g_weaponswitchdelay;
if(wcross_scale != wcross_scale_goal_prev || wcross_alpha != wcross_alpha_goal_prev || wcross_color != wcross_color_goal_prev)
wcross_alpha_goal_prev = wcross_alpha;
wcross_color_goal_prev = wcross_color;
- if(shottype == SHOTTYPE_HITTEAM || (shottype == SHOTTYPE_HITOBSTRUCTION && cvar("crosshair_hittest_blur") && !cvar("chase_active")))
+ if(shottype == SHOTTYPE_HITTEAM || (shottype == SHOTTYPE_HITOBSTRUCTION && autocvar_crosshair_hittest_blur && !autocvar_chase_active))
{
wcross_blur = 1;
wcross_alpha *= 0.75;
wcross_alpha_prev = wcross_alpha;
wcross_color_prev = wcross_color;
- wcross_scale *= 1 - cvar("_menu_alpha");
- wcross_alpha *= 1 - cvar("_menu_alpha");
+ wcross_scale *= 1 - autocvar__menu_alpha;
+ wcross_alpha *= 1 - autocvar__menu_alpha;
- ring_scale = cvar("crosshair_ring_size");
+ ring_scale = autocvar_crosshair_ring_size;
wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
- float nex_charge, nex_charge_pool;
+ float nex_charge, nex_chargepool;
nex_charge = getstatf(STAT_NEX_CHARGE);
- nex_charge_pool = getstatf(STAT_NEX_CHARGEPOOL);
+ nex_chargepool = getstatf(STAT_NEX_CHARGEPOOL);
if(nex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
nex_charge_movingavg = nex_charge;
bullets = getstati(STAT_BULLETS_LOADED);
f = bound(0, bullets / cr_maxbullets, 1);
- a = cvar("crosshair_ring_campingrifle_alpha");
+ a = autocvar_crosshair_ring_campingrifle_alpha;
DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
}
else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
{
- if(nex_charge_pool || use_nex_charge_pool)
+ if(nex_chargepool || use_nex_chargepool)
{
- use_nex_charge_pool = 1;
+ use_nex_chargepool = 1;
- a = cvar("crosshair_ring_nex_inner_alpha");
- rgb = eX * cvar("crosshair_ring_nex_inner_color_red") + eY * cvar("crosshair_ring_nex_inner_color_green") + eZ * cvar("crosshair_ring_nex_inner_color_blue");
- DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", nex_charge_pool, rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+ a = autocvar_crosshair_ring_nex_inner_alpha;
+ rgb = eX * autocvar_crosshair_ring_nex_inner_color_red + eY * autocvar_crosshair_ring_nex_inner_color_green + eZ * autocvar_crosshair_ring_nex_inner_color_blue;
+ DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", nex_chargepool, rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
}
else
{
// indicate how much we're charging right now with an inner circle
- a = cvar("crosshair_ring_nex_inner_alpha");
- nex_charge_movingavg = (1 - cvar("crosshair_ring_nex_currentcharge_movingavg_rate")) * nex_charge_movingavg + cvar("crosshair_ring_nex_currentcharge_movingavg_rate") * nex_charge;
+ a = autocvar_crosshair_ring_nex_inner_alpha;
+ nex_charge_movingavg = (1 - autocvar_crosshair_ring_nex_currentcharge_movingavg_rate) * nex_charge_movingavg + autocvar_crosshair_ring_nex_currentcharge_movingavg_rate * nex_charge;
- rgb = eX * cvar("crosshair_ring_nex_inner_color_red") + eY * cvar("crosshair_ring_nex_inner_color_green") + eZ * cvar("crosshair_ring_nex_inner_color_blue");
- DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, cvar("crosshair_ring_nex_currentcharge_scale") * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+ rgb = eX * autocvar_crosshair_ring_nex_inner_color_red + eY * autocvar_crosshair_ring_nex_inner_color_green + eZ * autocvar_crosshair_ring_nex_inner_color_blue;
+ DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, autocvar_crosshair_ring_nex_currentcharge_scale * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
}
// draw the charge
- a = cvar("crosshair_ring_nex_outer_alpha");
+ a = autocvar_crosshair_ring_nex_outer_alpha;
DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", nex_charge, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
}
wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
CROSSHAIR_DRAW(wcross_resolution, wcross_name, wcross_alpha * f);
- if(cvar("crosshair_dot"))
+ if(autocvar_crosshair_dot)
{
vector wcross_color_old;
wcross_color_old = wcross_color;
- if(cvar_string("crosshair_dot_color") != "0")
- wcross_color = stov(cvar_string("crosshair_dot_color"));
- CROSSHAIR_DRAW(wcross_resolution * cvar("crosshair_dot_size"), "gfx/crosshairdot.tga", f * cvar("crosshair_dot_alpha"));
+ if(autocvar_crosshair_dot_color != "0")
+ wcross_color = stov(autocvar_crosshair_dot_color);
+ CROSSHAIR_DRAW(wcross_resolution * autocvar_crosshair_dot_size, "gfx/crosshairdot.tga", f * autocvar_crosshair_dot_alpha);
wcross_color = wcross_color_old;
}
if(cs_project_is_b0rked == 0)
{
string w0, h0;
- w0 = cvar_string("vid_conwidth");
- h0 = cvar_string("vid_conheight");
+ w0 = ftos(autocvar_vid_conwidth);
+ h0 = ftos(autocvar_vid_conheight);
//R_SetView(VF_VIEWPORT, '0 0 0', '640 480 0');
//R_SetView(VF_FOV, '90 90 0');
R_SetView(VF_ORIGIN, '0 0 0');
// Draw the crosshairs
picsize = drawgetimagesize(SPIDER_CROSS);
- picsize_x *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
- picsize_y *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
- drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', cvar_or("cl_vehicle_spiderbot_cross_alpha",0.6), DRAWFLAG_NORMAL);
+ picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
+ picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
+ drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL);
hudloc_y = 4;
hudloc_x = 4;
// Draw the crosshairs
picsize = drawgetimagesize(SPIDER_CROSS);
- picsize_x *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
- picsize_y *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
- drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', cvar_or("cl_vehicle_spiderbot_cross_alpha",0.6), DRAWFLAG_NORMAL);
+ picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
+ picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
+ drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL);
hudloc_y = 4;
hudloc_x = 4;
vector picsize, hudloc;
picsize = drawgetimagesize(SPIDER_CROSS);
- picsize_x *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
- picsize_y *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
- drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', cvar_or("cl_vehicle_spiderbot_cross_alpha",0.6), DRAWFLAG_NORMAL);
+ picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
+ picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
+ drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL);
/*
const float STAT_VEHICLESTAT_HEALTH = 60;
float i;
if(!(gametype == GAME_RACE || gametype == GAME_CTS))
{
- if(cvar_string("accuracy_color_levels") != acc_color_levels)
+ if(autocvar_accuracy_color_levels != acc_color_levels)
{
if(acc_color_levels)
strunzone(acc_color_levels);
- acc_color_levels = strzone(cvar_string("accuracy_color_levels"));
+ acc_color_levels = strzone(autocvar_accuracy_color_levels);
acc_levels = tokenize(acc_color_levels);
if (acc_levels > MAX_ACCURACY_LEVELS)
acc_levels = MAX_ACCURACY_LEVELS;
HUD_Reset();
centerprint_start_x = 0;
- centerprint_start_y = cvar("scr_centerpos") * vid_conheight;
+ centerprint_start_y = autocvar_scr_centerpos * vid_conheight;
}
else // hud
{
centerprint_start_x = 0;
- centerprint_start_y = cvar("scr_centerpos") * vid_conheight;
+ centerprint_start_y = autocvar_scr_centerpos * vid_conheight;
}
HUD_DrawCenterPrint();
float speed, attenuation, dimensions;
vector tmp, delta;
- if( cvar("camera_reset") || !camera_mode )
+ if( autocvar_camera_reset || !camera_mode )
{
camera_offset = '0 0 0';
current_angles = '0 0 0';
// Camera angles
if( camera_roll )
- mouse_angles_z += camera_roll * cvar("camera_speed_roll");
+ mouse_angles_z += camera_roll * autocvar_camera_speed_roll;
- if(cvar("camera_look_player"))
+ if(autocvar_camera_look_player)
{
local vector dir;
local float n;
else
{
tmp = getmousepos() * 0.1;
- if(vlen(tmp)>cvar("camera_mouse_treshold"))
+ if(vlen(tmp)>autocvar_camera_mouse_treshold)
{
mouse_angles_x += tmp_y * cos(mouse_angles_z * DEG2RAD) + (tmp_x * sin(mouse_angles_z * DEG2RAD));
mouse_angles_y -= tmp_x * cos(mouse_angles_z * DEG2RAD) + (tmp_y * -sin(mouse_angles_z * DEG2RAD));
if(mouse_angles_y > 60 && current_angles_y < -60)
delta = '0 -360 0';
- if(cvar("camera_look_player"))
- attenuation = cvar("camera_look_attenuation");
+ if(autocvar_camera_look_player)
+ attenuation = autocvar_camera_look_attenuation;
else
- attenuation = cvar("camera_speed_attenuation");
+ attenuation = autocvar_camera_speed_attenuation;
attenuation = 1 / max(1, attenuation);
current_angles += (mouse_angles - current_angles + delta) * attenuation;
{
tmp_x = camera_direction_x * cos(current_angles_y * DEG2RAD);
tmp_y = camera_direction_x * sin(current_angles_y * DEG2RAD);
- if( cvar("camera_forward_follows") && !cvar("camera_look_player") )
+ if( autocvar_camera_forward_follows && !autocvar_camera_look_player )
tmp_z = camera_direction_x * -sin(current_angles_x * DEG2RAD);
++dimensions;
}
++dimensions;
}
- if(cvar("camera_free"))
- speed = cvar("camera_speed_free");
+ if(autocvar_camera_free)
+ speed = autocvar_camera_speed_free;
else
- speed = cvar("camera_speed_chase");
+ speed = autocvar_camera_speed_chase;
if(dimensions)
{
current_camera_offset += (camera_offset - current_camera_offset) * attenuation;
// Camera modes
- if( cvar("camera_free") )
+ if( autocvar_camera_free )
{
if ( camera_mode == CAMERA_CHASE )
{
camera_mode = CAMERA_CHASE;
- if(cvar("camera_chase_smoothly"))
+ if(autocvar_camera_chase_smoothly)
current_origin += (view_origin - current_origin) * attenuation;
else
current_origin = view_origin;
-var float autocvar_cl_projectiles_sloppy = 0;
-
-var float autocvar_cl_gibs_ticrate = 0.1;
-var float autocvar_cl_gibs_sloppy = 1;
-
-var float autocvar_cl_casings_ticrate = 0.1;
+float autocvar__con_chat_maximized;
+float autocvar__hud_configure;
+string autocvar__hud_panelorder;
+float autocvar__menu_alpha;
+string autocvar_accuracy_color_levels;
+float autocvar_bgmvolume;
+float autocvar_camera_chase_smoothly;
+float autocvar_camera_enable;
+float autocvar_camera_forward_follows;
+float autocvar_camera_free;
+float autocvar_camera_look_attenuation;
+float autocvar_camera_look_player;
+float autocvar_camera_mouse_treshold;
+float autocvar_camera_reset;
+float autocvar_camera_speed_attenuation;
+float autocvar_camera_speed_chase;
+float autocvar_camera_speed_free;
+float autocvar_camera_speed_roll;
+float autocvar_chase_active;
+float autocvar_cl_allow_uid2name;
+string autocvar_cl_announcer;
+float autocvar_cl_autodemo_delete;
+float autocvar_cl_autodemo_delete_keeprecords;
+float autocvar_cl_casings;
+float autocvar_cl_casings_bronze_time;
+var float autocvar_cl_casings_maxcount = 100;
+float autocvar_cl_casings_shell_time;
var float autocvar_cl_casings_sloppy = 1;
-
-var float autocvar_cl_gentle_damage;
-
-var float autocvar_scoreboard_color_bg_team;
-
-var float autocvar__menu_alpha;
-
-var float autocvar__hud_configure;
-var float autocvar_hud_configure_teamcolorforced;
-var float autocvar_hud_configure_bg_minalpha;
-var float autocvar_hud_configure_grid;
-var float autocvar_hud_configure_grid_xsize;
-var float autocvar_hud_configure_grid_ysize;
-var float autocvar_hud_configure_grid_alpha;
-
-var float autocvar__con_chat_maximized;
-var string autocvar__hud_panelorder;
-
-var string autocvar_hud_dock;
-
-var float autocvar_hud_progressbar_alpha;
-
-var string autocvar_hud_panel_bg;
-var vector autocvar_hud_panel_bg_color;
-var float autocvar_hud_panel_bg_color_team;
-var float autocvar_hud_panel_bg_alpha;
-var float autocvar_hud_panel_bg_border;
-var float autocvar_hud_panel_bg_padding;
-var float autocvar_hud_panel_fg_alpha;
-
-var float autocvar_hud_panel_weapons;
-
-var float autocvar_hud_panel_ammo;
-var float autocvar_hud_panel_ammo_onlycurrent;
-var float autocvar_hud_panel_ammo_iconalign;
-
-var float autocvar_hud_panel_powerups;
-
-var float autocvar_hud_panel_healtharmor;
-
-var float autocvar_hud_panel_notify;
-
-var float autocvar_hud_panel_timer;
-var float autocvar_hud_panel_timer_increment;
-
-var float autocvar_hud_panel_radar;
-
-var float autocvar_hud_panel_score;
-
-var float autocvar_hud_panel_racetimer;
-
-var float autocvar_hud_panel_vote;
-
-var float autocvar_hud_panel_modicons;
-
-var float autocvar_hud_panel_pressedkeys;
-
-var float autocvar_hud_panel_chat;
-
-var float autocvar_hud_panel_engineinfo;
-
-var float autocvar_hud_panel_infomessages;
-var float autocvar_hud_panel_infomessages_flip;
-
-var float autocvar_scoreboard_border_thickness;
-
-var float autocvar_cl_allow_uid2name;
+var float autocvar_cl_casings_ticrate = 0.1;
+float autocvar_cl_db_saveasdump;
+float autocvar_cl_deathscoreboard;
+float autocvar_cl_effects_lightningarc_branchfactor_add;
+float autocvar_cl_effects_lightningarc_branchfactor_start;
+float autocvar_cl_effects_lightningarc_drift_end;
+float autocvar_cl_effects_lightningarc_drift_start;
+float autocvar_cl_effects_lightningarc_segmentlength;
+float autocvar_cl_effects_lightningarc_simple;
+float autocvar_cl_gentle;
+float autocvar_cl_gentle_damage;
+float autocvar_cl_gentle_gibs;
+float autocvar_cl_gentle_messages;
+var float autocvar_cl_gibs_damageforcescale = 3.5;
+var float autocvar_cl_gibs_lifetime = 14;
+var float autocvar_cl_gibs_maxcount = 100;
+var float autocvar_cl_gibs_sloppy = 1;
+var float autocvar_cl_gibs_ticrate = 0.1;
+var float autocvar_cl_gibs_velocity_random = 1;
+var float autocvar_cl_gibs_velocity_scale = 1;
+float autocvar_cl_gibs_velocity_up;
+float autocvar_cl_gunalign;
+float autocvar_cl_hidewaypoints;
+float autocvar_cl_lockview;
+float autocvar_cl_nogibs;
+float autocvar_cl_notify_carried_items;
+float autocvar_cl_particlegibs;
+float autocvar_cl_particles_oldnexbeam;
+float autocvar_cl_particles_quality;
+float autocvar_cl_projectiles_sloppy;
+float autocvar_cl_readpicture_force;
+float autocvar_cl_reticle_item_nex;
+float autocvar_cl_reticle_item_normal;
+float autocvar_cl_reticle_stretch;
+float autocvar_cl_showacceleration;
+float autocvar_cl_showacceleration_alpha;
+string autocvar_cl_showacceleration_color;
+float autocvar_cl_showacceleration_color_custom;
+float autocvar_cl_showacceleration_position;
+float autocvar_cl_showacceleration_scale;
+float autocvar_cl_showacceleration_size;
+float autocvar_cl_showacceleration_z;
+float autocvar_cl_showspeed;
+float autocvar_cl_showspeed_position;
+float autocvar_cl_showspeed_size;
+float autocvar_cl_showspeed_unit;
+float autocvar_cl_showspeed_z;
+float autocvar_cl_sound_maptime_warning;
+float autocvar_cl_stripcolorcodes;
+var float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
+var float autocvar_cl_vehicle_spiderbot_cross_size = 1;
+float autocvar_cl_velocityzoom;
+var float autocvar_cl_velocityzoomtime = 0.3;
+string autocvar_cl_weaponpriority;
+float autocvar_cl_zoomfactor;
+float autocvar_cl_zoomsensitivity;
+float autocvar_cl_zoomspeed;
+float autocvar_con_chat;
+float autocvar_con_chatpos;
+float autocvar_con_chatsize;
+float autocvar_con_chattime;
+float autocvar_con_notify;
+float autocvar_con_notifysize;
+string autocvar_crosshair;
+float autocvar_crosshair_alpha;
+string autocvar_crosshair_color;
+float autocvar_crosshair_color_per_weapon;
+float autocvar_crosshair_dot;
+float autocvar_crosshair_dot_alpha;
+string autocvar_crosshair_dot_color;
+float autocvar_crosshair_dot_size;
+float autocvar_crosshair_effect_scalefade;
+float autocvar_crosshair_effect_speed;
+float autocvar_crosshair_hittest;
+float autocvar_crosshair_hittest_blur;
+float autocvar_crosshair_hittest_showimpact;
+float autocvar_crosshair_per_weapon;
+float autocvar_crosshair_pickup;
+float autocvar_crosshair_pickup_speed;
+float autocvar_crosshair_ring_campingrifle_alpha;
+float autocvar_crosshair_ring_nex_currentcharge_movingavg_rate;
+float autocvar_crosshair_ring_nex_currentcharge_scale;
+float autocvar_crosshair_ring_nex_inner_alpha;
+float autocvar_crosshair_ring_nex_inner_color_blue;
+float autocvar_crosshair_ring_nex_inner_color_green;
+float autocvar_crosshair_ring_nex_inner_color_red;
+float autocvar_crosshair_ring_nex_outer_alpha;
+float autocvar_crosshair_ring_size;
+float autocvar_crosshair_size;
+float autocvar_ekg;
+float autocvar_fov;
+float autocvar_g_balance_tuba_attenuation;
+float autocvar_g_balance_tuba_fadetime;
+float autocvar_g_balance_tuba_volume;
+float autocvar_g_warmup_limit;
+var float autocvar_g_waypointsprite_alpha = 1;
+var float autocvar_g_waypointsprite_crosshairfadealpha = 1;
+float autocvar_g_waypointsprite_crosshairfadedistance;
+var float autocvar_g_waypointsprite_crosshairfadescale = 1;
+float autocvar_g_waypointsprite_distancealphaexponent;
+var float autocvar_g_waypointsprite_distancefadealpha = 1;
+var float autocvar_g_waypointsprite_distancefadedistancemultiplier = 1;
+var float autocvar_g_waypointsprite_distancefadescale = 1;
+var float autocvar_g_waypointsprite_edgefadealpha = 1;
+float autocvar_g_waypointsprite_edgefadedistance;
+var float autocvar_g_waypointsprite_edgefadescale = 1;
+float autocvar_g_waypointsprite_minalpha;
+float autocvar_g_waypointsprite_minscale;
+float autocvar_g_waypointsprite_normdistance;
+var float autocvar_g_waypointsprite_scale = 1;
+float autocvar_g_waypointsprite_timealphaexponent;
+var float autocvar_hud_colorflash_alpha = 0.5;
+float autocvar_hud_configure_bg_minalpha;
+float autocvar_hud_configure_checkcollisions;
+float autocvar_hud_configure_grid;
+float autocvar_hud_configure_grid_alpha;
+float autocvar_hud_configure_grid_xsize;
+float autocvar_hud_configure_grid_ysize;
+float autocvar_hud_configure_teamcolorforced;
+float autocvar_hud_damage;
+string autocvar_hud_damage_color;
+float autocvar_hud_damage_factor;
+float autocvar_hud_damage_fade_rate;
+float autocvar_hud_damage_gentle_alpha_multiplier;
+string autocvar_hud_damage_gentle_color;
+float autocvar_hud_damage_maxalpha;
+float autocvar_hud_damage_pain_threshold;
+float autocvar_hud_damage_pain_threshold_lower;
+float autocvar_hud_damage_pain_threshold_lower_health;
+float autocvar_hud_damage_pain_threshold_pulsating_min;
+float autocvar_hud_damage_pain_threshold_pulsating_period;
+string autocvar_hud_dock;
+float autocvar_hud_dock_alpha;
+string autocvar_hud_dock_color;
+float autocvar_hud_dock_color_team;
+float autocvar_hud_panel_ammo;
+float autocvar_hud_panel_ammo_iconalign;
+float autocvar_hud_panel_ammo_maxammo;
+float autocvar_hud_panel_ammo_onlycurrent;
+float autocvar_hud_panel_ammo_progressbar;
+string autocvar_hud_panel_ammo_progressbar_name;
+float autocvar_hud_panel_ammo_progressbar_xoffset;
+float autocvar_hud_panel_ammo_text;
+string autocvar_hud_panel_bg;
+float autocvar_hud_panel_bg_alpha;
+float autocvar_hud_panel_bg_border;
+vector autocvar_hud_panel_bg_color;
+float autocvar_hud_panel_bg_color_team;
+float autocvar_hud_panel_bg_padding;
+float autocvar_hud_panel_chat;
+float autocvar_hud_panel_engineinfo;
+float autocvar_hud_panel_engineinfo_framecounter_decimals;
+float autocvar_hud_panel_engineinfo_framecounter_time;
+float autocvar_hud_panel_fg_alpha;
+float autocvar_hud_panel_healtharmor;
+float autocvar_hud_panel_healtharmor_baralign;
+float autocvar_hud_panel_healtharmor_flip;
+float autocvar_hud_panel_healtharmor_iconalign;
+float autocvar_hud_panel_healtharmor_maxarmor;
+float autocvar_hud_panel_healtharmor_maxhealth;
+float autocvar_hud_panel_healtharmor_progressbar;
+string autocvar_hud_panel_healtharmor_progressbar_armor;
+string autocvar_hud_panel_healtharmor_progressbar_health;
+float autocvar_hud_panel_healtharmor_text;
+float autocvar_hud_panel_infomessages;
+float autocvar_hud_panel_infomessages_flip;
+float autocvar_hud_panel_modicons;
+float autocvar_hud_panel_notify;
+float autocvar_hud_panel_notify_fadetime;
+float autocvar_hud_panel_notify_flip;
+float autocvar_hud_panel_notify_print;
+float autocvar_hud_panel_notify_time;
+float autocvar_hud_panel_powerups;
+float autocvar_hud_panel_powerups_baralign;
+float autocvar_hud_panel_powerups_flip;
+float autocvar_hud_panel_powerups_iconalign;
+float autocvar_hud_panel_powerups_progressbar;
+string autocvar_hud_panel_powerups_progressbar_shield;
+string autocvar_hud_panel_powerups_progressbar_strength;
+float autocvar_hud_panel_powerups_text;
+float autocvar_hud_panel_pressedkeys;
+float autocvar_hud_panel_pressedkeys_aspect;
+float autocvar_hud_panel_racetimer;
+float autocvar_hud_panel_radar;
+float autocvar_hud_panel_radar_foreground_alpha;
+float autocvar_hud_panel_radar_rotation;
+float autocvar_hud_panel_radar_scale;
+float autocvar_hud_panel_radar_zoommode;
+float autocvar_hud_panel_score;
+float autocvar_hud_panel_timer;
+float autocvar_hud_panel_timer_increment;
+float autocvar_hud_panel_vote;
+float autocvar_hud_panel_vote_alreadyvoted_alpha;
+string autocvar_hud_panel_vote_bg_alpha;
+float autocvar_hud_panel_weapons;
+float autocvar_hud_panel_weapons_accuracy;
+float autocvar_hud_panel_weapons_ammo;
+float autocvar_hud_panel_weapons_ammo_alpha;
+string autocvar_hud_panel_weapons_ammo_color;
+float autocvar_hud_panel_weapons_ammo_full_cells;
+float autocvar_hud_panel_weapons_ammo_full_fuel;
+float autocvar_hud_panel_weapons_ammo_full_nails;
+float autocvar_hud_panel_weapons_ammo_full_rockets;
+float autocvar_hud_panel_weapons_ammo_full_shells;
+float autocvar_hud_panel_weapons_aspect;
+float autocvar_hud_panel_weapons_complainbubble;
+string autocvar_hud_panel_weapons_complainbubble_color_donthave;
+string autocvar_hud_panel_weapons_complainbubble_color_outofammo;
+string autocvar_hud_panel_weapons_complainbubble_color_unavailable;
+float autocvar_hud_panel_weapons_complainbubble_fadetime;
+float autocvar_hud_panel_weapons_complainbubble_padding;
+float autocvar_hud_panel_weapons_complainbubble_time;
+var float autocvar_hud_panel_weapons_fade = 1;
+float autocvar_hud_panel_weapons_label;
+float autocvar_hud_panel_weapons_timeout;
+float autocvar_hud_panel_weapons_timeout_effect;
+float autocvar_hud_progressbar_alpha;
+float autocvar_hud_showbinds;
+float autocvar_hud_showbinds_limit;
+string autocvar_hud_skin;
+float autocvar_loddebug;
+float autocvar_menu_mouse_speed;
+string autocvar_menu_skin;
+float autocvar_r_fakelight;
+float autocvar_r_fullbright;
+float autocvar_r_letterbox;
+float autocvar_scoreboard_accuracy;
+float autocvar_scoreboard_accuracy_doublerows;
+float autocvar_scoreboard_alpha_bg;
+var float autocvar_scoreboard_alpha_fg = 1.0;
+var float autocvar_scoreboard_alpha_name = 0.9;
+var float autocvar_scoreboard_alpha_name_self = 1;
+float autocvar_scoreboard_bg_scale;
+float autocvar_scoreboard_border_thickness;
+float autocvar_scoreboard_color_bg_b;
+float autocvar_scoreboard_color_bg_g;
+float autocvar_scoreboard_color_bg_r;
+float autocvar_scoreboard_color_bg_team;
+string autocvar_scoreboard_columns;
+var float autocvar_scoreboard_fadeinspeed = 10;
+var float autocvar_scoreboard_fadeoutspeed = 5;
+float autocvar_scoreboard_highlight;
+var float autocvar_scoreboard_highlight_alpha = 0.10;
+var float autocvar_scoreboard_highlight_alpha_self = 0.25;
+float autocvar_scoreboard_offset_left;
+float autocvar_scoreboard_offset_right;
+float autocvar_scr_centerpos;
+float autocvar_scr_centersize;
+float autocvar_scr_centertime;
+float autocvar_v_flipped;
+float autocvar_vid_conheight;
+float autocvar_vid_conwidth;
+float autocvar_vid_pixelheight;
+float autocvar_viewsize;
if(e.bgmscript == "")
return 1;
- if(cvar("bgmvolume") <= 0)
+ if(autocvar_bgmvolume <= 0)
return -1;
e.just_toggled = FALSE;
casing.angles_z = ReadByte() * 360 / 256;
casing.drawmask = MASK_NORMAL;
- if(cvar("cl_casings") && isNew) {
+ if(autocvar_cl_casings && isNew) {
casing.draw = Casing_Draw;
casing.move_origin = casing.origin;
casing.move_velocity = casing.velocity + 2 * prandomvec();
{
case 1:
setmodel(casing, "models/casing_shell.mdl");
- casing.cnt = time + cvar("cl_casings_shell_time");
+ casing.cnt = time + autocvar_cl_casings_shell_time;
break;
default:
setmodel(casing, "models/casing_bronze.mdl");
- casing.cnt = time + cvar("cl_casings_bronze_time");
+ casing.cnt = time + autocvar_cl_casings_bronze_time;
break;
}
else
Casing_Delete();
- RubbleLimit("casing", cvar_or("cl_casings_maxcount",100), Casing_Delete);
+ RubbleLimit("casing", autocvar_cl_casings_maxcount, Casing_Delete);
}
void Casings_Precache()
from_x = ReadCoord(); from_y = ReadCoord(); from_z = ReadCoord();
to_x = ReadCoord(); to_y = ReadCoord(); to_z = ReadCoord();
- if(cvar("cl_effects_lightningarc_simple"))
+ if(autocvar_cl_effects_lightningarc_simple)
{
te_lightning1(world,from,to);
}
{
float seglength, drifts, drifte, branchfactor, branchfactor_add;
- seglength = cvar("cl_effects_lightningarc_segmentlength");
- drifts = cvar("cl_effects_lightningarc_drift_start");
- drifte = cvar("cl_effects_lightningarc_drift_end");
- branchfactor = cvar("cl_effects_lightningarc_branchfactor_start");
- branchfactor = cvar("cl_effects_lightningarc_branchfactor_add");
+ seglength = autocvar_cl_effects_lightningarc_segmentlength;
+ drifts = autocvar_cl_effects_lightningarc_drift_start;
+ drifte = autocvar_cl_effects_lightningarc_drift_end;
+ branchfactor = autocvar_cl_effects_lightningarc_branchfactor_start;
+ branchfactor = autocvar_cl_effects_lightningarc_branchfactor_add;
cl_effetcs_lightningarc(from,to,seglength,drifts,drifte,branchfactor,branchfactor_add);
}
void new_te_bloodshower (float ef, vector org, float explosionspeed, float howmany)
{
float i, pmod;
- pmod = cvar("cl_particles_quality");
+ pmod = autocvar_cl_particles_quality;
for (i = 0; i < 250 * pmod; ++i)
pointparticles(ef, org, randomvec() * explosionspeed, howmany / 250);
}
gib.move_touch = SUB_RemoveOnNoImpact;
gib.move_origin = gib.origin = org;
- gib.move_velocity = vconst * cvar_or("cl_gibs_velocity_scale", 1) + vrand * cvar_or("cl_gibs_velocity_random", 1) + '0 0 1' * cvar("cl_gibs_velocity_up");
+ gib.move_velocity = vconst * autocvar_cl_gibs_velocity_scale + vrand * autocvar_cl_gibs_velocity_random + '0 0 1' * autocvar_cl_gibs_velocity_up;
gib.move_avelocity = prandomvec() * vlen(gib.move_velocity);
gib.move_time = time;
- gib.damageforcescale = cvar_or("cl_gibs_damageforcescale", 3.5);
+ gib.damageforcescale = autocvar_cl_gibs_damageforcescale;
- gib.nextthink = time + cvar_or("cl_gibs_lifetime", 14) * (1 + prandom() * 0.15);
+ gib.nextthink = time + autocvar_cl_gibs_lifetime * (1 + prandom() * 0.15);
gib.drawmask = MASK_NORMAL;
- RubbleLimit("gib", cvar_or("cl_gibs_maxcount",100), Gib_Delete);
+ RubbleLimit("gib", autocvar_cl_gibs_maxcount, Gib_Delete);
}
void Ent_GibSplash(float isNew)
org_z = ReadShort() * 4 + 2;
vel = decompressShortVector(ReadShort());
- float cl_gentle_gibs = cvar("cl_gentle_gibs");
- if(cl_gentle_gibs || cvar("cl_gentle"))
+ float cl_gentle_gibs = autocvar_cl_gentle_gibs;
+ if(cl_gentle_gibs || autocvar_cl_gentle)
type |= 0x80; // set gentle bit
if(type & 0x80)
else
gentle_prefix = "morphed_";
}
- else if(cvar("cl_particlegibs"))
+ else if(autocvar_cl_particlegibs)
{
type |= 0x80;
gentle_prefix = "particlegibs_";
}
- if not(cl_gentle_gibs || cvar("cl_gentle"))
- amount *= 1 - cvar("cl_nogibs");
+ if not(cl_gentle_gibs || autocvar_cl_gentle)
+ amount *= 1 - autocvar_cl_nogibs;
- if(cvar("ekg"))
+ if(autocvar_ekg)
amount *= 5;
if(amount <= 0 || !isNew)
InterpolateOrigin_Do();
- s = cvar("cl_gunalign");
+ s = autocvar_cl_gunalign;
if(s != 1 && s != 2 && s != 4)
s = 3; // default value
--s;
centerprint_expire = min(centerprint_expire, time); // if any of the returns happens, this message will fade out
- if(cvar("scr_centertime") <= 0)
+ if(autocvar_scr_centertime <= 0)
return;
if(strMessage == "")
h = centerprint_fontsize_y*hcount;
havail = vid_conheight;
- if(cvar("con_chatpos") < 0)
- havail -= (-cvar("con_chatpos") + cvar("con_chat")) * cvar("con_chatsize"); // avoid overlapping chat
+ if(autocvar_con_chatpos < 0)
+ havail -= (-autocvar_con_chatpos + autocvar_con_chat) * autocvar_con_chatsize; // avoid overlapping chat
if(havail > vid_conheight - 70)
havail = vid_conheight - 70; // avoid overlapping HUD
centerprint_num = i;
- centerprint_expire = time + cvar("scr_centertime");
+ centerprint_expire = time + autocvar_scr_centertime;
}
void HUD_DrawCenterPrint (void)
sz = 0.8 + (a / 5);
- if(centerprint_num * cvar("scr_centersize") > 24 && scoreboard_active) // 24 = height of Scoreboard text
+ if(centerprint_num * autocvar_scr_centersize > 24 && scoreboard_active) // 24 = height of Scoreboard text
centerprint_start_y = scoreboard_bottom + centerprint_fontsize_y;
pos = centerprint_start;
void HUD_Panel_ExportCfg(string cfgname)
{
float fh;
- string filename = strcat("hud_", cvar_string("hud_skin"), "_", cfgname, ".cfg");
+ string filename = strcat("hud_", autocvar_hud_skin, "_", cfgname, ".cfg");
fh = fopen(filename, FILE_WRITE);
if(fh >= 0)
{
HUD_Write_PanelCvar_q("_iconalign");
HUD_Write_PanelCvar_q("_progressbar");
HUD_Write_PanelCvar_q("_progressbar_name");
+ HUD_Write_PanelCvar_q("_progressbar_xoffset");
HUD_Write_PanelCvar_q("_text");
break;
case HUD_PANEL_POWERUPS:
if(highlightedPanel == HUD_PANEL_CHAT) // some panels have their own restrictions, like the chat panel (which actually only moves the engine chat print around). Looks bad if it's too small.
{
- mySize_x = max(17 * cvar("con_chatsize"), mySize_x);
- mySize_y = max(2 * cvar("con_chatsize") + 2 * panel_bg_padding, mySize_y);
+ mySize_x = max(17 * autocvar_con_chatsize, mySize_x);
+ mySize_y = max(2 * autocvar_con_chatsize + 2 * panel_bg_padding, mySize_y);
}
// collision testing|
if (highlightedPanel_prev == -1 || mouseClicked)
return;
- hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && cvar("hud_configure_checkcollisions"));
+ hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
float step;
if(autocvar_hud_configure_grid)
/*
print("menu_enabled: ", ftos(menu_enabled), "\n");
print("Highlighted: ", ftos(highlightedPanel), "\n");
- print("Menu alpha: ", cvar_string("_menu_alpha"), "\n");
+ print("Menu alpha: ", ftos(autocvar__menu_alpha), "\n");
*/
// instantly hide the editor cursor if we open the HUDExit dialog
if(highlightedPanel != -1)
highlightedPanel_prev = highlightedPanel;
- mousepos = mousepos + getmousepos() * cvar("menu_mouse_speed");
+ mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
mousepos_x = bound(0, mousepos_x, vid_conwidth);
mousepos_y = bound(0, mousepos_y, vid_conheight);
if (prev_pos != panel_pos || prev_size != panel_size)
{
- hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && cvar("hud_configure_checkcollisions"));
+ hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
// backup!
panel_pos_backup = prev_pos;
panel_size_backup = prev_size;
cursorsize = '32 32 0';
if(highlightcheck == 0)
- drawpic(mousepos, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+ drawpic(mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
else if(highlightcheck == 1)
- drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor_move.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+ drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_move.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
else if(highlightcheck == 2)
- drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor_resize.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+ drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
else
- drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor_resize2.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+ drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize2.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
prevMouseClicked = mouseClicked;
}
if(!autocvar_hud_panel_weapons && !autocvar__hud_configure)
return;
- float timeout = cvar("hud_panel_weapons_timeout");
+ float timeout = autocvar_hud_panel_weapons_timeout;
float timeout_effect_length, timein_effect_length;
- if (cvar("hud_panel_weapons_timeout_effect") == 0)
+ if (autocvar_hud_panel_weapons_timeout_effect == 0)
{
timeout_effect_length = 0;
timein_effect_length = 0;
if (timeout && time >= weapontime + timeout && !autocvar__hud_configure)
{
f = (time - (weapontime + timeout)) / timeout_effect_length;
- if (cvar("hud_panel_weapons_timeout_effect"))
+ if (autocvar_hud_panel_weapons_timeout_effect)
{
panel_bg_alpha *= (1 - f);
panel_fg_alpha *= (1 - f);
}
- if (cvar("hud_panel_weapons_timeout_effect") == 1)
+ if (autocvar_hud_panel_weapons_timeout_effect == 1)
{
f *= f; // for a cooler movement
center_x = panel_pos_x + panel_size_x/2;
else if (timeout && time < weaponprevtime + timein_effect_length && !autocvar__hud_configure)
{
f = (time - weaponprevtime) / timein_effect_length;
- if (cvar("hud_panel_weapons_timeout_effect"))
+ if (autocvar_hud_panel_weapons_timeout_effect)
{
panel_bg_alpha *= (f);
panel_fg_alpha *= (f);
}
- if (cvar("hud_panel_weapons_timeout_effect") == 1)
+ if (autocvar_hud_panel_weapons_timeout_effect == 1)
{
f *= f; // for a cooler movement
f = 1 - f;
}
// TODO make this configurable
- if(weaponorder_bypriority != cvar_string("cl_weaponpriority"))
+ if(weaponorder_bypriority != autocvar_cl_weaponpriority)
{
if(weaponorder_bypriority)
strunzone(weaponorder_bypriority);
if(weaponorder_byimpulse)
strunzone(weaponorder_byimpulse);
- weaponorder_bypriority = strzone(cvar_string("cl_weaponpriority"));
+ weaponorder_bypriority = strzone(autocvar_cl_weaponpriority);
weaponorder_byimpulse = strzone(W_FixWeaponOrder_BuildImpulseList(W_FixWeaponOrder_ForceComplete(W_NumberWeaponOrder(weaponorder_bypriority))));
weaponorder_cmp_str = strcat(" ", weaponorder_byimpulse, " ");
panel_size -= '2 2 0' * panel_bg_padding;
}
- if(cvar_or("hud_panel_weapons_fade", 1))
+ if(autocvar_hud_panel_weapons_fade)
{
wpnalpha = 3.2 - 2 * (time - weapontime);
wpnalpha = bound(0.7, wpnalpha, 1) * panel_fg_alpha;
HUD_Weapons_Clear();
float rows, columns;
- float aspect = cvar("hud_panel_weapons_aspect");
+ float aspect = autocvar_hud_panel_weapons_aspect;
rows = panel_size_y/panel_size_x;
rows = bound(1, floor((sqrt(4 * aspect * rows * WEP_COUNT + rows * rows) + rows + 0.5) / 2), WEP_COUNT);
float a, type, fullammo;
float when;
- when = cvar("hud_panel_weapons_complainbubble_time");
+ when = autocvar_hud_panel_weapons_complainbubble_time;
float fadetime;
- fadetime = cvar("hud_panel_weapons_complainbubble_fadetime");
+ fadetime = autocvar_hud_panel_weapons_complainbubble_fadetime;
vector color;
vector wpnpos;
float ammo_alpha;
wpnsize = eX * panel_size_x*(1/columns) + eY * panel_size_y*(1/rows);
float barsize_x, barsize_y, baroffset_x, baroffset_y;
- float show_ammo = cvar("hud_panel_weapons_ammo");
+ float show_ammo = autocvar_hud_panel_weapons_ammo;
if (show_ammo)
{
- fullammo_shells = cvar("hud_panel_weapons_ammo_full_shells");
- fullammo_nails = cvar("hud_panel_weapons_ammo_full_nails");
- fullammo_rockets = cvar("hud_panel_weapons_ammo_full_rockets");
- fullammo_cells = cvar("hud_panel_weapons_ammo_full_cells");
- fullammo_fuel = cvar("hud_panel_weapons_ammo_full_fuel");
- ammo_color = stov(cvar_string("hud_panel_weapons_ammo_color"));
- ammo_alpha = panel_fg_alpha * cvar("hud_panel_weapons_ammo_alpha");
+ fullammo_shells = autocvar_hud_panel_weapons_ammo_full_shells;
+ fullammo_nails = autocvar_hud_panel_weapons_ammo_full_nails;
+ fullammo_rockets = autocvar_hud_panel_weapons_ammo_full_rockets;
+ fullammo_cells = autocvar_hud_panel_weapons_ammo_full_cells;
+ fullammo_fuel = autocvar_hud_panel_weapons_ammo_full_fuel;
+ ammo_color = stov(autocvar_hud_panel_weapons_ammo_color);
+ ammo_alpha = panel_fg_alpha * autocvar_hud_panel_weapons_ammo_alpha;
if(wpnsize_x/wpnsize_y > aspect)
float show_accuracy;
float weapon_stats;
- if(cvar("hud_panel_weapons_accuracy") && acc_levels)
+ if(autocvar_hud_panel_weapons_accuracy && acc_levels)
{
show_accuracy = true;
if (acc_col_x[0] == -1)
}
float weapons_st = getstati(STAT_WEAPONS);
- float label = cvar("hud_panel_weapons_label");
+ float label = autocvar_hud_panel_weapons_label;
for(i = 0; i < weapon_cnt; ++i)
{
}
// draw the complain message
- if(time - complain_weapon_time < when + fadetime && self.weapon == complain_weapon && cvar("hud_panel_weapons_complainbubble"))
+ if(time - complain_weapon_time < when + fadetime && self.weapon == complain_weapon && autocvar_hud_panel_weapons_complainbubble)
{
if(fadetime)
{
string s;
if(complain_weapon_type == 0) {
s = "Out of ammo";
- color = stov(cvar_string("hud_panel_weapons_complainbubble_color_outofammo"));
+ color = stov(autocvar_hud_panel_weapons_complainbubble_color_outofammo);
}
else if(complain_weapon_type == 1) {
s = "Don't have";
- color = stov(cvar_string("hud_panel_weapons_complainbubble_color_donthave"));
+ color = stov(autocvar_hud_panel_weapons_complainbubble_color_donthave);
}
else {
s = "Unavailable";
- color = stov(cvar_string("hud_panel_weapons_complainbubble_color_unavailable"));
+ color = stov(autocvar_hud_panel_weapons_complainbubble_color_unavailable);
}
- float padding = cvar("hud_panel_weapons_complainbubble_padding");
+ float padding = autocvar_hud_panel_weapons_complainbubble_padding;
drawpic_aspect_skin(wpnpos + '1 1 0' * padding, "weapon_complainbubble", wpnsize - '2 2 0' * padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
drawstring_aspect(wpnpos + '1 1 0' * padding, s, wpnsize - '2 2 0' * padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
if (currently_selected)
drawpic_aspect_skin(myPos, "ammo_current_bg", mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- if(a > 0 && cvar("hud_panel_ammo_progressbar"))
- HUD_Panel_DrawProgressBar(myPos + eX * cvar("hud_panel_ammo_progressbar_xoffset") * mySize_x, mySize - eX * cvar("hud_panel_ammo_progressbar_xoffset") * mySize_x, cvar_string("hud_panel_ammo_progressbar_name"), 0, 0, min(1, a/cvar("hud_panel_ammo_maxammo")), color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ if(a > 0 && autocvar_hud_panel_ammo_progressbar)
+ HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, autocvar_hud_panel_ammo_progressbar_name, 0, 0, min(1, a/autocvar_hud_panel_ammo_maxammo), color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
- if(cvar("hud_panel_ammo_text"))
+ if(autocvar_hud_panel_ammo_text)
{
if(a > 0)
drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
string leftprogressname, rightprogressname;
float leftcnt, rightcnt;
float leftexact, rightexact;
- float flip = cvar("hud_panel_powerups_flip");
+ float flip = autocvar_hud_panel_powerups_flip;
if (flip) {
leftname = "strength";
- leftprogressname = cvar_string("hud_panel_powerups_progressbar_strength");
+ leftprogressname = autocvar_hud_panel_powerups_progressbar_strength;
leftcnt = ceil(strength_time);
leftexact = strength_time;
rightname = "shield";
- rightprogressname = cvar_string("hud_panel_powerups_progressbar_shield");
+ rightprogressname = autocvar_hud_panel_powerups_progressbar_shield;
rightcnt = ceil(shield_time);
rightexact = shield_time;
} else {
leftname = "shield";
- leftprogressname = cvar_string("hud_panel_powerups_progressbar_shield");
+ leftprogressname = autocvar_hud_panel_powerups_progressbar_shield;
leftcnt = ceil(shield_time);
leftexact = shield_time;
rightname = "strength";
- rightprogressname = cvar_string("hud_panel_powerups_progressbar_strength");
+ rightprogressname = autocvar_hud_panel_powerups_progressbar_strength;
rightcnt = ceil(strength_time);
rightexact = strength_time;
}
drawfont = hud_bigfont;
- float baralign = cvar("hud_panel_powerups_baralign");
+ float baralign = autocvar_hud_panel_powerups_baralign;
float barflip;
- float iconalign = cvar("hud_panel_powerups_iconalign");
- float progressbar = cvar("hud_panel_powerups_progressbar");
+ float iconalign = autocvar_hud_panel_powerups_iconalign;
+ float progressbar = autocvar_hud_panel_powerups_progressbar;
if (mySize_x/mySize_y > 4)
{
barsize = eX * 0.5 * mySize_x + eY * mySize_y;
HUD_Panel_GetProgressBarColorForString(leftname);
HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_powerups_text"))
+ if(autocvar_hud_panel_powerups_text)
{
if(leftcnt > 1)
DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
HUD_Panel_GetProgressBarColorForString(rightname);
HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_powerups_text"))
+ if(autocvar_hud_panel_powerups_text)
{
if(rightcnt > 1)
DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
HUD_Panel_GetProgressBarColorForString(leftname);
HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_powerups_text"))
+ if(autocvar_hud_panel_powerups_text)
{
if(leftcnt > 1)
DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
HUD_Panel_GetProgressBarColorForString(rightname);
HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_powerups_text"))
+ if(autocvar_hud_panel_powerups_text)
{
if(rightcnt > 1)
DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
HUD_Panel_GetProgressBarColorForString(leftname);
HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 1, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_powerups_text"))
+ if(autocvar_hud_panel_powerups_text)
{
if(leftcnt <= 5)
drawpic_aspect_skin_expanding(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (leftcnt - leftexact) / 0.5, 1));
HUD_Panel_GetProgressBarColorForString(rightname);
HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 1, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_powerups_text"))
+ if(autocvar_hud_panel_powerups_text)
{
if(rightcnt <= 5)
drawpic_aspect_skin_expanding(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (rightcnt - rightexact) / 0.5, 1));
vector numpos;
drawfont = hud_bigfont;
- float baralign = cvar("hud_panel_healtharmor_baralign");
- float iconalign = cvar("hud_panel_healtharmor_iconalign");
- float progressbar = cvar("hud_panel_healtharmor_progressbar");
+ float baralign = autocvar_hud_panel_healtharmor_baralign;
+ float iconalign = autocvar_hud_panel_healtharmor_iconalign;
+ float progressbar = autocvar_hud_panel_healtharmor_progressbar;
- float maxhealth = cvar("hud_panel_healtharmor_maxhealth");
- float maxarmor = cvar("hud_panel_healtharmor_maxarmor");
+ float maxhealth = autocvar_hud_panel_healtharmor_maxhealth;
+ float maxarmor = autocvar_hud_panel_healtharmor_maxarmor;
if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display
{
vector v;
if(progressbar)
{
HUD_Panel_GetProgressBarColor(health);
- HUD_Panel_DrawProgressBar(barpos, barsize, cvar_string("hud_panel_healtharmor_progressbar_health"), 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, autocvar_hud_panel_healtharmor_progressbar_health, 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
if(armor)
- if(cvar("hud_panel_healtharmor_text"))
+ if(autocvar_hud_panel_healtharmor_text)
drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "armor", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha * armor / health, DRAWFLAG_NORMAL);
}
else
if(progressbar)
{
HUD_Panel_GetProgressBarColor(armor);
- HUD_Panel_DrawProgressBar(barpos, barsize, cvar_string("hud_panel_healtharmor_progressbar_armor"), 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, barsize, autocvar_hud_panel_healtharmor_progressbar_armor, 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
if(health)
- if(cvar("hud_panel_healtharmor_text"))
+ if(autocvar_hud_panel_healtharmor_text)
drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "health", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_healtharmor_text"))
+ if(autocvar_hud_panel_healtharmor_text)
DrawNumIcon(iconalign, pos, mySize, x, biggercount, 1, HUD_Get_Num_Color(x, maxtotal), 1);
// fuel
float leftmax, rightmax;
float leftactive, rightactive;
float leftalpha, rightalpha;
- float flip = cvar("hud_panel_healtharmor_flip");
+ float flip = autocvar_hud_panel_healtharmor_flip;
float barflip;
if (flip) { // old style layout with armor left/top of health
leftname = "armor";
- leftprogressname = cvar_string("hud_panel_healtharmor_progressbar_armor");
+ leftprogressname = autocvar_hud_panel_healtharmor_progressbar_armor;
leftcnt = armor;
if(leftcnt)
leftactive = 1;
leftmax = maxarmor;
rightname = "health";
- rightprogressname = cvar_string("hud_panel_healtharmor_progressbar_health");
+ rightprogressname = autocvar_hud_panel_healtharmor_progressbar_health;
rightcnt = health;
rightactive = 1;
rightalpha = 1;
rightmax = maxhealth;
} else {
leftname = "health";
- leftprogressname = cvar_string("hud_panel_healtharmor_progressbar_health");
+ leftprogressname = autocvar_hud_panel_healtharmor_progressbar_health;
leftcnt = health;
leftactive = 1;
leftalpha = 1;
leftmax = maxhealth;
rightname = "armor";
- rightprogressname = cvar_string("hud_panel_healtharmor_progressbar_armor");
+ rightprogressname = autocvar_hud_panel_healtharmor_progressbar_armor;
rightcnt = armor;
if(rightcnt)
rightactive = 1;
HUD_Panel_GetProgressBarColorForString(leftname);
HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_healtharmor_text"))
+ if(autocvar_hud_panel_healtharmor_text)
DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, leftmax), 1);
}
HUD_Panel_GetProgressBarColorForString(rightname);
HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_healtharmor_text"))
+ if(autocvar_hud_panel_healtharmor_text)
DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, rightmax), 1);
}
HUD_Panel_GetProgressBarColorForString(leftname);
HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_healtharmor_text"))
+ if(autocvar_hud_panel_healtharmor_text)
DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, leftmax), 1);
}
HUD_Panel_GetProgressBarColorForString(rightname);
HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_healtharmor_text"))
+ if(autocvar_hud_panel_healtharmor_text)
DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, rightmax), 1);
}
HUD_Panel_GetProgressBarColorForString(leftname);
HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 1, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_healtharmor_text"))
+ if(autocvar_hud_panel_healtharmor_text)
{
drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(leftcnt, leftmax), panel_fg_alpha, DRAWFLAG_NORMAL);
HUD_Panel_GetProgressBarColorForString(rightname);
HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 1, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- if(cvar("hud_panel_healtharmor_text"))
+ if(autocvar_hud_panel_healtharmor_text)
{
drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(rightcnt, rightmax), panel_fg_alpha, DRAWFLAG_NORMAL);
{
float w;
float alsoprint, gentle;
- alsoprint = (cvar("hud_panel_notify_print") || !panel_enabled); // print message to console if: notify panel disabled, or cvar to do so enabled
- gentle = (cvar("cl_gentle") || cvar("cl_gentle_messages"));
+ alsoprint = (autocvar_hud_panel_notify_print || !panel_enabled); // print message to console if: notify panel disabled, or cvar to do so enabled
+ gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages);
if ((msg == MSG_SUICIDE || msg == MSG_KILL || msg == MSG_KILL_ACTION) && gametype == GAME_CTS) // selfkill isn't interesting in CTS and only spams up the notify panel
return;
void HUD_Centerprint(string s1, string s2, float type, float msg)
{
float gentle;
- gentle = (cvar("cl_gentle") || cvar("cl_gentle_messages"));
+ gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages);
if(msg == MSG_SUICIDE) {
if (type == DEATH_TEAMCHANGE) {
centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "You are now on: ", s1));
float a;
float when;
- when = cvar("hud_panel_notify_time");
+ when = autocvar_hud_panel_notify_time;
float fadetime;
- fadetime = cvar("hud_panel_notify_fadetime");
+ fadetime = autocvar_hud_panel_notify_fadetime;
string s;
string attacker, victim;
float i, j, w, step, limit;
- if(cvar("hud_panel_notify_flip")) //order items from the top down
+ if(autocvar_hud_panel_notify_flip) //order items from the top down
{
i = 0;
step = +1;
if(hud_panel_radar_rotation == 0)
{
// max-min distance must fit the radar in any rotation
- bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen2d(mi_max - mi_min));
+ bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen2d(mi_scale));
}
else
{
f * bigsize
+ (1 - f) * normalsize;
teamradar_origin3d_in_texcoord = teamradar_3dcoord_to_texcoord(
- f * (mi_min + mi_max) * 0.5
+ f * mi_center
+ (1 - f) * view_origin);
color1 = GetPlayerColor(player_localentnum-1);
if(!autocvar__hud_configure)
{
panel_fg_alpha = autocvar_hud_panel_fg_alpha;
- panel_bg_alpha_str = cvar_string("hud_panel_vote_bg_alpha");
+ panel_bg_alpha_str = autocvar_hud_panel_vote_bg_alpha;
if(panel_bg_alpha_str == "") {
panel_bg_alpha_str = ftos(autocvar_hud_panel_bg_alpha);
pos = panel_pos;
mySize = panel_size;
- a = vote_alpha * bound(cvar("hud_panel_vote_alreadyvoted_alpha"), 1 - vote_highlighted, 1);
+ a = vote_alpha * bound(autocvar_hud_panel_vote_alreadyvoted_alpha, 1 - vote_highlighted, 1);
HUD_Panel_DrawBg(a);
a = panel_fg_alpha * a;
if(score && (score < t || !t)) {
db_put(ClientProgsDB, strcat(shortmapname, rr, "time"), ftos(score));
- if(cvar("cl_autodemo_delete_keeprecords"))
+ if(autocvar_cl_autodemo_delete_keeprecords)
{
- f = cvar("cl_autodemo_delete");
+ f = autocvar_cl_autodemo_delete;
f &~= 1;
cvar_set("cl_autodemo_delete", ftos(f)); // don't delete demo with new record!
}
}
// force custom aspect
- float aspect = cvar("hud_panel_pressedkeys_aspect");
+ float aspect = autocvar_hud_panel_pressedkeys_aspect;
if(aspect)
{
vector newSize;
cvar_set("con_chatrect_y", ftos(pos_y/vid_conheight));
cvar_set("con_chatwidth", ftos(mySize_x/vid_conwidth));
- cvar_set("con_chat", ftos(floor(mySize_y/cvar("con_chatsize") - 0.5)));
+ cvar_set("con_chat", ftos(floor(mySize_y/autocvar_con_chatsize - 0.5)));
if(autocvar__hud_configure)
{
float chatsize;
- chatsize = cvar("con_chatsize");
+ chatsize = autocvar_con_chatsize;
cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
float i, a;
- for(i = 0; i < cvar("con_chat"); ++i)
+ for(i = 0; i < autocvar_con_chat; ++i)
{
- if(i == cvar("con_chat") - 1)
+ if(i == autocvar_con_chat - 1)
a = panel_fg_alpha;
else
- a = panel_fg_alpha * floor(((i + 1) * 7 + cvar("con_chattime"))/45);
+ a = panel_fg_alpha * floor(((i + 1) * 7 + autocvar_con_chattime)/45);
drawcolorcodedstring(pos + eY * i * chatsize, textShortenToWidth("^3Player^7: This is the chat area.", mySize_x, '1 1 0' * chatsize, stringwidth_colors), '1 1 0' * chatsize, a, DRAWFLAG_NORMAL);
}
}
else
{
framecounter += 1;
- if(currentTime - prevfps_time > cvar("hud_panel_engineinfo_framecounter_time"))
+ if(currentTime - prevfps_time > autocvar_hud_panel_engineinfo_framecounter_time)
{
prevfps = framecounter/(currentTime - prevfps_time);
framecounter = 0;
vector color;
color = HUD_Get_Num_Color (prevfps, 100);
drawfont = hud_bigfont;
- drawstring_aspect(pos, strcat("FPS: ", ftos_decimals(prevfps, cvar("hud_panel_engineinfo_framecounter_decimals"))), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(pos, strcat("FPS: ", ftos_decimals(prevfps, autocvar_hud_panel_engineinfo_framecounter_decimals)), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
drawfont = hud_font;
}
float pos, conversion_factor;
string speed, zspeed, unit;
- switch(cvar("cl_showspeed_unit"))
+ switch(autocvar_cl_showspeed_unit)
{
default:
case 0:
speed = strcat(ftos(floor( vlen(pmove_vel - pmove_vel_z * '0 0 1') * conversion_factor + 0.5 )), unit);
- numsize_x = numsize_y = cvar("cl_showspeed_size");
- pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position");
+ numsize_x = numsize_y = autocvar_cl_showspeed_size;
+ pos = (vid_conheight - numsize_y) * autocvar_cl_showspeed_position;
drawfont = hud_bigfont;
drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
- if (cvar("cl_showspeed_z") == 1) {
+ if (autocvar_cl_showspeed_z == 1) {
zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit);
drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
}
top_y = 0;
f = time - acc_prevtime;
- if(cvar("cl_showacceleration_z"))
+ if(autocvar_cl_showacceleration_z)
acceleration = (vlen(pmove_vel) - vlen(acc_prevspeed)) * (1 / f);
else
acceleration = (vlen(pmove_vel - '0 0 1' * pmove_vel_z) - vlen(acc_prevspeed - '0 0 1' * acc_prevspeed_z)) * (1 / f);
if (acceleration == 0)
return;
- pos = top - sz/2 * eY + (cvar("cl_showacceleration_position") * vid_conheight) * eY;
+ pos = top - sz/2 * eY + (autocvar_cl_showacceleration_position * vid_conheight) * eY;
- sz = cvar("cl_showacceleration_size");
- scale = cvar("cl_showacceleration_scale");
- alpha = cvar("cl_showacceleration_alpha");
- if (cvar("cl_showacceleration_color_custom"))
- rgb = stov(cvar_string("cl_showacceleration_color"));
+ sz = autocvar_cl_showacceleration_size;
+ scale = autocvar_cl_showacceleration_scale;
+ alpha = autocvar_cl_showacceleration_alpha;
+ if (autocvar_cl_showacceleration_color_custom)
+ rgb = stov(autocvar_cl_showacceleration_color);
else {
if (acceleration < 0)
rgb = '1 .5 .5' - '0 .5 .5' * bound(0, -acceleration * 0.2, 1);
return;
// Drawing stuff
- if (hud_skin_path != cvar_string("hud_skin"))
+ if (hud_skin_path != autocvar_hud_skin)
{
if (hud_skin_path)
strunzone(hud_skin_path);
- hud_skin_path = strzone(strcat("gfx/hud/", cvar_string("hud_skin")));
+ hud_skin_path = strzone(strcat("gfx/hud/", autocvar_hud_skin));
}
// HUD configure visible grid
{
float f;
vector color;
- float hud_dock_color_team = cvar("hud_dock_color_team");
+ float hud_dock_color_team = autocvar_hud_dock_color_team;
if((teamplay) && hud_dock_color_team) {
f = stof(getplayerkey(player_localentnum - 1, "colors"));
color = colormapPaletteColor(mod(f, 16), 1) * hud_dock_color_team;
}
else
{
- string hud_dock_color = cvar_string("hud_dock_color");
+ string hud_dock_color = autocvar_hud_dock_color;
if(hud_dock_color == "shirt") {
f = stof(getplayerkey(player_localentnum - 1, "colors"));
color = colormapPaletteColor(floor(f / 16), 0);
pic = "gfx/hud/default/dock_medium";
}
}
- drawpic('0 0 0', pic, eX * vid_conwidth + eY * vid_conheight, color, cvar("hud_dock_alpha") * hud_fade_alpha, DRAWFLAG_NORMAL); // no aspect ratio forcing on dock...
+ drawpic('0 0 0', pic, eX * vid_conwidth + eY * vid_conheight, color, autocvar_hud_dock_alpha * hud_fade_alpha, DRAWFLAG_NORMAL); // no aspect ratio forcing on dock...
}
// cache the panel order into the panel_order array
HUD_Chat(); // HUD_DrawPanel(HUD_PANEL_CHAT);
// TODO hud_'ify these
- if (cvar("cl_showspeed"))
+ if (autocvar_cl_showspeed)
HUD_ShowSpeed();
- if (cvar("cl_showacceleration"))
+ if (autocvar_cl_showacceleration)
HUD_ShowAcceleration();
if (autocvar__hud_configure && spectatee_status && hud_configure_prev == -1) // try to join if we are in hud_configure mode, but still spectating, and in the first frame (in order to get rid of motd when launching a server via the menu "HUD Setup" button)
xmin = vid_conwidth*0.05; // 5% border must suffice
xmax = vid_conwidth - xmin;
ymin = 20;
- i = cvar("con_chatpos"); //*cvar("con_chatsize");
+ i = autocvar_con_chatpos; //*autocvar_con_chatsize;
if(i < 0)
- ymax = vid_conheight + (i - cvar("con_chat")) * cvar("con_chatsize");
+ ymax = vid_conheight + (i - autocvar_con_chat) * autocvar_con_chatsize;
if(i >= 0 || ymax < (vid_conheight*0.5))
ymax = vid_conheight - ymin;
MapVote_DrawAbstain(pos, isize, xmax - xmin, tmp, i);
}
- drawpic(mv_mousepos, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor.tga"), '32 32 0', '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawpic(mv_mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), '32 32 0', '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
}
void Cmd_MapVote_MapDownload(float argc)
// check for pending announcement, play it and remove it
if(announce_snd != "")
{
- sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
strunzone(announce_snd);
announce_snd = "";
}
if (!spectatee_status) //do cprint only for players
centerprint("^1Begin!");
- sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/begin.wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/begin.wav"), VOL_BASEVOICE, ATTN_NONE);
//reset maptime announcers now as well
announcer_5min = announcer_1min = FALSE;
centerprint(strcat("^1Game starts in ", ftos(countdown_rounded), " seconds"));
if(countdown_rounded <= 3 && countdown_rounded >= 1) {
- sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/", ftos(countdown_rounded), ".wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/", ftos(countdown_rounded), ".wav"), VOL_BASEVOICE, ATTN_NONE);
}
self.nextthink = getstatf(STAT_GAMESTARTTIME) - (countdown - 1);
float warmuplimit;
float warmuptimeleft;
if(warmup_stage) {
- warmuplimit = cvar("g_warmup_limit");
+ warmuplimit = autocvar_g_warmup_limit;
if(warmuplimit > 0) {
warmuptimeleft = max(0, warmuplimit + getstatf(STAT_GAMESTARTTIME) - time);
}
}
//5 minute check
- if (cvar("cl_sound_maptime_warning") >= 2) {
+ if (autocvar_cl_sound_maptime_warning >= 2) {
//make sure that after connect (and e.g. 4 minutes left) we will not get a wrong sound
if(announcer_5min)
{
if not (warmuplimit == -1 && warmup_stage) {
announcer_5min = TRUE;
//dprint("i will play the sound, I promise!\n");
- sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/5minutesremain.wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"), VOL_BASEVOICE, ATTN_NONE);
}
}
//1 minute check
- if (cvar("cl_sound_maptime_warning") == 1 || cvar("cl_sound_maptime_warning") == 3) {
+ if (autocvar_cl_sound_maptime_warning == 1 || autocvar_cl_sound_maptime_warning == 3) {
if (announcer_1min)
{
if(((!warmup_stage || warmuplimit == 0) && timeleft > 60) || (warmup_stage && warmuplimit > 0 && warmuptimeleft > 60))
//if we're in warmup mode, check whether there's a warmup timelimit
if not (warmuplimit == -1 && warmup_stage) {
announcer_1min = TRUE;
- sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/1minuteremains.wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"), VOL_BASEVOICE, ATTN_NONE);
}
}
}
float pickup;
string item;
- if not(cvar("cl_notify_carried_items"))
+ if not(autocvar_cl_notify_carried_items)
return;
stat_items = getstati(STAT_ITEMS);
if (item)
{
if (pickup) {
- if (cvar("cl_notify_carried_items") & 2)
+ if (autocvar_cl_notify_carried_items & 2)
centerprint(strcat("You picked up the ", item, "!"));
}
else {
- if (cvar("cl_notify_carried_items") & 1)
+ if (autocvar_cl_notify_carried_items & 1)
centerprint(strcat("You got the ", item, "!"));
}
}
* TODO: announcer queues
*/
void Announcer_Precache () {
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/1minuteremains.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/5minutesremain.wav"));
-
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/electrobitch.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/airshot.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/03kills.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/05kills.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/10kills.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/15kills.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/20kills.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/25kills.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/30kills.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/botlike.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/yoda.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/amazing.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/awesome.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/headshot.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/impressive.wav"));
-
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/prepareforbattle.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/begin.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/timeoutcalled.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/1fragleft.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/2fragsleft.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/3fragsleft.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/terminated.wav"));
-
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/1.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/2.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/3.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/4.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/5.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/6.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/7.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/8.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/9.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/10.wav"));
-
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/lastsecond.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/narrowly.wav"));
-
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/voteaccept.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/votecall.wav"));
- precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/votefail.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"));
+
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/electrobitch.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/airshot.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/03kills.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/05kills.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/10kills.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/15kills.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/20kills.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/25kills.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/30kills.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/botlike.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/yoda.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/amazing.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/awesome.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/headshot.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/impressive.wav"));
+
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/begin.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/timeoutcalled.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1fragleft.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/2fragsleft.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/3fragsleft.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/terminated.wav"));
+
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/2.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/3.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/4.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/5.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/6.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/7.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/8.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/9.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/10.wav"));
+
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/lastsecond.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/narrowly.wav"));
+
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/voteaccept.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/votecall.wav"));
+ precache_sound (strcat("announcer/", autocvar_cl_announcer, "/votefail.wav"));
}
void AuditLists()
float f;
string file;
- if(cvar("cl_readpicture_force"))
+ if(autocvar_cl_readpicture_force)
return false;
file = strcat(name, ".tga");
//draw either the old v2.3 beam or the new beam
charge = sqrt(charge); // divide evenly among trail spacing and alpha
particles_alphamin = particles_alphamax = charge;
- if (cvar("cl_particles_oldnexbeam") && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo()))
+ if (autocvar_cl_particles_oldnexbeam && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo()))
WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos, charge, 1);
else
WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("nex_beam"), shotorg, endpos, charge, 1);
// TODO: re enable with gametype dependant cvars?
if(argc < 2) // no arguments provided
- argc = tokenizebyseparator(strcat("x ", cvar_string("scoreboard_columns")), " ");
+ argc = tokenizebyseparator(strcat("x ", autocvar_scoreboard_columns), " ");
if(argc < 2)
argc = tokenizebyseparator(strcat("x ", HUD_DefaultColumnLayout()), " ");
is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
if((rgb == '1 1 1') && (!is_spec)) {
- rgb_x = cvar("scoreboard_color_bg_r") + 0.5;
- rgb_y = cvar("scoreboard_color_bg_g") + 0.5;
- rgb_z = cvar("scoreboard_color_bg_b") + 0.5; }
+ rgb_x = autocvar_scoreboard_color_bg_r + 0.5;
+ rgb_y = autocvar_scoreboard_color_bg_g + 0.5;
+ rgb_z = autocvar_scoreboard_color_bg_b + 0.5; }
// Layout:
tmp_x = sbwidth;
return 1;
else if (intermission == 1)
return 1;
- else if (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard"))
+ else if (getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != GAME_CTS)
return 1;
+ else if (spectatee_status == -1)
+ return 1;
else if (scoreboard_showscores_force)
return 1;
return 0;
float i;
float weapon_cnt = WEP_COUNT - 3; // either minstanex/nex are hidden, no port-o-launch, no tuba
float rows;
- if(cvar("scoreboard_accuracy_doublerows"))
+ if(autocvar_scoreboard_accuracy_doublerows)
rows = 2;
else
rows = 1;
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 = autocvar_scoreboard_color_bg_r + 0.5;
+ hl_rgb_y = autocvar_scoreboard_color_bg_g + 0.5;
+ hl_rgb_z = autocvar_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);
}
if(hud_woulddrawscoreboard) {
- float scoreboard_fadeinspeed = cvar_or("scoreboard_fadeinspeed", 10);
+ float scoreboard_fadeinspeed = autocvar_scoreboard_fadeinspeed;
if (scoreboard_fadeinspeed)
scoreboard_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1);
else
scoreboard_fade_alpha = 1;
}
else {
- float scoreboard_fadeoutspeed = cvar_or("scoreboard_fadeoutspeed", 5);
+ float scoreboard_fadeoutspeed = autocvar_scoreboard_fadeoutspeed;
if (scoreboard_fadeoutspeed)
scoreboard_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1);
else
HUD_UpdatePlayerTeams();
- scoreboard_alpha_bg = cvar("scoreboard_alpha_bg") * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
- scoreboard_alpha_fg = cvar_or("scoreboard_alpha_fg", 1.0) * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
- scoreboard_highlight = cvar("scoreboard_highlight");
- scoreboard_highlight_alpha = cvar_or("scoreboard_highlight_alpha", 0.10) * scoreboard_alpha_fg;
- scoreboard_highlight_alpha_self = cvar_or("scoreboard_highlight_alpha_self", 0.25) * scoreboard_alpha_fg;
- scoreboard_alpha_name = cvar_or("scoreboard_alpha_name", 0.9) * scoreboard_alpha_fg;
- scoreboard_alpha_name_self = cvar_or("scoreboard_alpha_name_self", 1) * scoreboard_alpha_fg;
+ scoreboard_alpha_bg = autocvar_scoreboard_alpha_bg * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
+ scoreboard_alpha_fg = autocvar_scoreboard_alpha_fg * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
+ scoreboard_highlight = autocvar_scoreboard_highlight;
+ scoreboard_highlight_alpha = autocvar_scoreboard_highlight_alpha * scoreboard_alpha_fg;
+ scoreboard_highlight_alpha_self = autocvar_scoreboard_highlight_alpha_self * scoreboard_alpha_fg;
+ scoreboard_alpha_name = autocvar_scoreboard_alpha_name * scoreboard_alpha_fg;
+ scoreboard_alpha_name_self = autocvar_scoreboard_alpha_name_self * scoreboard_alpha_fg;
vector rgb, pos, tmp;
entity pl, tm;
- xmin = cvar("scoreboard_offset_left") * vid_conwidth;
- ymin = cvar("con_notify") * cvar("con_notifysize");
+ xmin = autocvar_scoreboard_offset_left * vid_conwidth;
+ ymin = autocvar_con_notify * autocvar_con_notifysize;
- xmax = (1 - cvar("scoreboard_offset_right")) * vid_conwidth;
+ xmax = (1 - autocvar_scoreboard_offset_right) * vid_conwidth;
ymax = vid_conheight - ymin;
sbwidth = xmax - xmin;
drawfont = hud_font;
// Draw the scoreboard
- vector bg_size = drawgetimagesize("gfx/scoreboard/scoreboard_bg") * cvar("scoreboard_bg_scale");
+ vector bg_size = drawgetimagesize("gfx/scoreboard/scoreboard_bg") * autocvar_scoreboard_bg_scale;
if(teamplay)
{
}
else
{
- rgb_x = cvar("scoreboard_color_bg_r");
- rgb_y = cvar("scoreboard_color_bg_g");
- rgb_z = cvar("scoreboard_color_bg_b");
+ rgb_x = autocvar_scoreboard_color_bg_r;
+ rgb_y = autocvar_scoreboard_color_bg_g;
+ rgb_z = autocvar_scoreboard_color_bg_b;
for(tm = teams.sort_next; tm; tm = tm.sort_next)
{
}
pos = HUD_DrawScoreboardRankings(pos, pl, rgb, bg_size);
}
- else if(cvar("scoreboard_accuracy") && spectatee_status != -1 && !warmup_stage) {
+ else if(autocvar_scoreboard_accuracy && spectatee_status != -1 && !warmup_stage) {
if(teamplay)
pos = HUD_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size);
else
else
e.state = 0;
}
- vol = e.state * e.volume * cvar("bgmvolume");
+ vol = e.state * e.volume * autocvar_bgmvolume;
if(vol != vol0)
{
if(vol0 < 0)
void teamradar_loadcvars()
{
- v_flipped = cvar("v_flipped");
- hud_panel_radar_scale = cvar("hud_panel_radar_scale");
- hud_panel_radar_foreground_alpha = cvar("hud_panel_radar_foreground_alpha") * panel_fg_alpha;
- hud_panel_radar_rotation = cvar("hud_panel_radar_rotation");
- hud_panel_radar_zoommode = cvar("hud_panel_radar_zoommode");
+ v_flipped = autocvar_v_flipped;
+ hud_panel_radar_scale = autocvar_hud_panel_radar_scale;
+ hud_panel_radar_foreground_alpha = autocvar_hud_panel_radar_foreground_alpha * panel_fg_alpha;
+ hud_panel_radar_rotation = autocvar_hud_panel_radar_rotation;
+ hud_panel_radar_zoommode = autocvar_hud_panel_radar_zoommode;
// others default to 0
// match this to defaultXonotic.cfg!
void Ent_TubaNote_Think()
{
float f;
- f = cvar("g_balance_tuba_fadetime");
+ f = autocvar_g_balance_tuba_fadetime;
if(f > 0)
self.cnt -= frametime * self.count / f;
else
remove(self);
}
else
- sound(self, CHAN_PROJECTILE, "", self.cnt, self.attenuate * cvar("g_balance_tuba_attenuation"));
+ sound(self, CHAN_PROJECTILE, "", self.cnt, self.attenuate * autocvar_g_balance_tuba_attenuation);
}
void Ent_TubaNote_UpdateSound()
{
- self.enemy.cnt = bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1);
+ self.enemy.cnt = bound(0, VOL_BASE * autocvar_g_balance_tuba_volume, 1);
self.enemy.count = self.enemy.cnt;
- sound(self.enemy, CHAN_PROJECTILE, TUBA_STARTNOTE(self.cnt), self.enemy.cnt, self.enemy.attenuate * cvar("g_balance_tuba_attenuation"));
+ sound(self.enemy, CHAN_PROJECTILE, TUBA_STARTNOTE(self.cnt), self.enemy.cnt, self.enemy.attenuate * autocvar_g_balance_tuba_attenuation);
}
void Ent_TubaNote_StopSound()
if(self.lodmodelindex1)
{
- d = cvar("loddebug");
+ d = autocvar_loddebug;
if(d > 0)
{
if(d == 1)
if(self.hideflags & 2)
return; // radar only
- if(cvar("cl_hidewaypoints") >= 2)
+ if(autocvar_cl_hidewaypoints >= 2)
return;
if(self.hideflags & 1)
- if(cvar("cl_hidewaypoints"))
+ if(autocvar_cl_hidewaypoints)
return; // fixed waypoint
InterpolateOrigin_Do();
d = o - '0.5 0 0' * vid_conwidth - '0 0.5 0' * vid_conheight;
/*
- if(cvar("v_flipped"))
+ if(autocvar_v_flipped)
d_x = -d_x;
*/
void WaypointSprite_Load()
{
- waypointsprite_fadedistance = vlen(mi_max - mi_min);
- waypointsprite_normdistance = cvar("g_waypointsprite_normdistance");
- waypointsprite_minscale = cvar("g_waypointsprite_minscale");
- waypointsprite_minalpha = cvar("g_waypointsprite_minalpha");
- waypointsprite_distancealphaexponent = cvar("g_waypointsprite_distancealphaexponent");
- waypointsprite_timealphaexponent = cvar("g_waypointsprite_timealphaexponent");
- waypointsprite_scale = cvar_or("g_waypointsprite_scale", 1);
- waypointsprite_edgefadealpha = cvar_or("g_waypointsprite_edgefadealpha", 1);
- waypointsprite_edgefadescale = cvar_or("g_waypointsprite_edgefadescale", 1);
- waypointsprite_edgefadedistance = cvar("g_waypointsprite_edgefadedistance");
- waypointsprite_crosshairfadealpha = cvar_or("g_waypointsprite_crosshairfadealpha", 1);
- waypointsprite_crosshairfadescale = cvar_or("g_waypointsprite_crosshairfadescale", 1);
- waypointsprite_crosshairfadedistance = cvar("g_waypointsprite_crosshairfadedistance");
- waypointsprite_distancefadealpha = cvar_or("g_waypointsprite_distancefadealpha", 1);
- waypointsprite_distancefadescale = cvar_or("g_waypointsprite_distancefadescale", 1);
- waypointsprite_distancefadedistance = vlen(mi_max - mi_min) * cvar_or("g_waypointsprite_distancefadedistancemultiplier", 1);
- waypointsprite_alpha = cvar_or("g_waypointsprite_alpha", 1) * (1 - autocvar__menu_alpha);
+ waypointsprite_fadedistance = vlen(mi_scale);
+ waypointsprite_normdistance = autocvar_g_waypointsprite_normdistance;
+ waypointsprite_minscale = autocvar_g_waypointsprite_minscale;
+ waypointsprite_minalpha = autocvar_g_waypointsprite_minalpha;
+ waypointsprite_distancealphaexponent = autocvar_g_waypointsprite_distancealphaexponent;
+ waypointsprite_timealphaexponent = autocvar_g_waypointsprite_timealphaexponent;
+ waypointsprite_scale = autocvar_g_waypointsprite_scale;
+ waypointsprite_edgefadealpha = autocvar_g_waypointsprite_edgefadealpha;
+ waypointsprite_edgefadescale = autocvar_g_waypointsprite_edgefadescale;
+ waypointsprite_edgefadedistance = autocvar_g_waypointsprite_edgefadedistance;
+ waypointsprite_crosshairfadealpha = autocvar_g_waypointsprite_crosshairfadealpha;
+ waypointsprite_crosshairfadescale = autocvar_g_waypointsprite_crosshairfadescale;
+ waypointsprite_crosshairfadedistance = autocvar_g_waypointsprite_crosshairfadedistance;
+ waypointsprite_distancefadealpha = autocvar_g_waypointsprite_distancefadealpha;
+ waypointsprite_distancefadescale = autocvar_g_waypointsprite_distancefadescale;
+ waypointsprite_distancefadedistance = waypointsprite_fadedistance * autocvar_g_waypointsprite_distancefadedistancemultiplier;
+ waypointsprite_alpha = autocvar_g_waypointsprite_alpha;
if(!waypointsprite_initialized)
{
db_put(tempdb, sname, ftos(max(f, stof(db_get(tempdb, sname)))));
}
search_end(dh);
+ waypointsprite_initialized = true;
}
- waypointsprite_initialized = 1;
}
float HUD_MENU_ENABLE = 0;
#define SERVERFLAG_ALLOW_FULLBRIGHT 1
+#define SERVERFLAG_TEAMPLAY 2
// WEAPON PLUGIN SYSTEM
-entity weapon_info[24];
+entity weapon_info[WEP_MAXCOUNT];
entity dummy_weapon_info;
void register_weapon(float id, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname)
float i;
weaponorder_byid = "";
- for(i = 24; i >= 1; --i)
+ for(i = WEP_MAXCOUNT; i >= 1; --i)
if(weapon_info[i-1])
weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i));
weaponorder_byid = strzone(substring(weaponorder_byid, 1, strlen(weaponorder_byid) - 1));
return vercmp_recursive(v1, v2);
}
+
+float u8_strsize(string s)
+{
+ float l, i, c;
+ l = 0;
+ for(i = 0; ; ++i)
+ {
+ c = str2chr(s, i);
+ if(c <= 0)
+ break;
+ ++l;
+ if(c >= 0x80)
+ ++l;
+ if(c >= 0x800)
+ ++l;
+ if(c >= 0x10000)
+ ++l;
+ }
+ return l;
+}
#endif
float vercmp(string v1, string v2);
+
+float u8_strsize(string s);
ATTRIB(InputBox, forbiddenCharacters, string, "")
ATTRIB(InputBox, color, vector, '1 1 1')
ATTRIB(InputBox, colorF, vector, '1 1 1')
- ATTRIB(InputBox, maxLength, float, 255)
+ ATTRIB(InputBox, maxLength, float, 255) // if negative, it counts bytes, not chars
ENDCLASS(InputBox)
void InputBox_Clear_Click(entity btn, entity me);
#endif
for(i = 0; i < strlen(ch); ++i)
if(strstrofs(me.forbiddenCharacters, substring(ch, i, 1), 0) > -1)
return;
- if(strlen(ch) + strlen(me.text) > me.maxLength)
- return;
+ if(me.maxLength > 0)
+ {
+ if(strlen(ch) + strlen(me.text) > me.maxLength)
+ return;
+ }
+ else if(me.maxLength < 0)
+ {
+ if(u8_strsize(ch) + u8_strsize(me.text) > -me.maxLength)
+ return;
+ }
me.setText(me, strcat(substring(me.text, 0, me.cursorPos), ch, substring(me.text, me.cursorPos, strlen(me.text) - me.cursorPos)));
me.cursorPos += strlen(ch);
}
ATTRIB(XonoticCvarList, columnValueOrigin, float, 0)
ATTRIB(XonoticCvarList, columnValueSize, float, 0)
+ METHOD(XonoticCvarList, mouseRelease, float(entity, vector))
METHOD(XonoticCvarList, setSelected, void(entity, float))
+
ATTRIB(XonoticCvarList, controlledTextbox, entity, NULL)
ATTRIB(XonoticCvarList, cvarNameBox, entity, NULL)
ATTRIB(XonoticCvarList, cvarDescriptionBox, entity, NULL)
CvarList_Revert_Click(world, me);
return 1;
}
+ else if(scan == K_ENTER)
+ me.cvarValueBox.parent.setFocus(me.cvarValueBox.parent, me.cvarValueBox);
else if(SUPER(XonoticCvarList).keyDown(me, scan, ascii, shift))
return 1;
else if(!me.controlledTextbox)
return me.controlledTextbox.keyDown(me.controlledTextbox, scan, ascii, shift);
}
+float XonoticCvarList_mouseRelease(entity me, vector pos)
+{
+ if(me.pressed == 2)
+ me.cvarValueBox.parent.setFocus(me.cvarValueBox.parent, me.cvarValueBox);
+ return SUPER(XonoticCvarList).mouseRelease(me, pos);
+}
+
void CvarList_Value_Change(entity box, entity me)
{
cvar_set(me.cvarNameBox.text, box.text);
me.cvarValueBox.setText(me.cvarValueBox, me.cvarDefault);
me.cvarValueBox.cursorPos = strlen(me.cvarDefault);
}
+
#endif
me.TR(me);
me.TD(me, 1, 3.0, box = makeXonoticInputBox(1, "_cl_name"));
box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
- box.maxLength = 63;
+ box.maxLength = -63; // negativ means encoded length in bytes
label.textEntity = box;
me.TR(me);
me.TD(me, 5, 1, e = makeXonoticColorpicker(box));
if(!_Nex_ExtResponseSystem_Queried)
{
_Nex_ExtResponseSystem_Queried = 1;
- uri_get(sprintf("http://www.xonotic.org/dl/checkupdate.txt?version=%s", uri_escape(cvar_string("g_xonoticversion"))), URI_GET_UPDATENOTIFICATION);
- //crypto_uri_postbuf(sprintf("http://www.xonotic.org/dl/t/checkupdate2.cgi?version=%s", uri_escape(cvar_string("g_xonoticversion"))), URI_GET_UPDATENOTIFICATION, "application/x-www-urlencoded", "hello=world&foo=bar", -1, 0);
+ float startcnt;
+ string uri;
+
+ cvar_set("cl_startcount", ftos(startcnt = cvar("cl_startcount") + 1));
+
+ // for privacy, munge the start count a little
+ startcnt = floor((floor(startcnt / 10) + random()) * 10);
+ uri = sprintf("http://www.xonotic.org/dl/checkupdate.txt?version=%s&cnt=%d", uri_escape(cvar_string("g_xonoticversion")), startcnt);
+
+#ifdef CVAR_POPCON
+ float cvar_handle, popcon_handle;
+ float n, i, j;
+ string k, s;
+ cvar_handle = buf_create();
+ buf_cvarlist(cvar_handle, "", "");
+ n = buf_getsize(cvar_handle);
+ popcon_handle = buf_create();
+ for(i= 0, j = 0; i < n; ++i)
+ {
+ k = bufstr_get(cvar_handle, i);
+ if(!(cvar_type(k) & CVAR_TYPEFLAG_SAVED))
+ continue;
+ s = sprintf("%s=%d", uri_escape(k), cvar_string(k) != cvar_defstring(k));
+ bufstr_set(popcon_handle, j, s);
+ ++j;
+ }
+ buf_del(cvar_handle);
+ uri_postbuf(
+ uri, URI_GET_UPDATENOTIFICATION,
+ "application/x-www-form-urlencoded",
+ "&",
+ popcon_handle
+ );
+ buf_del(popcon_handle);
+#else
+ uri_get(uri, URI_GET_UPDATENOTIFICATION);
+#endif
}
}
.float cvar_cl_accuracy_data_share;
-var float autocvar_sv_accuracy_data_share = 1;
// init/free
void accuracy_init(entity e);
void anticheat_report()
{
- if(!cvar("sv_eventlog"))
+ if(!autocvar_sv_eventlog)
return;
GameLogEcho(strcat(":anticheat:speedhack:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_speedhack))));
GameLogEcho(strcat(":anticheat:div0_strafebot_old:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_strafebot_old))));
entity oldself;
oldself = self;
- if(g_arena && cvar("g_arena_warmup"))
- warmup = time + cvar("g_arena_warmup");
+ if(g_arena && autocvar_g_arena_warmup)
+ warmup = time + autocvar_g_arena_warmup;
else if(g_ca) {
- warmup = time + cvar("g_ca_warmup");
+ warmup = time + autocvar_g_ca_warmup;
allowed_to_spawn = 1;
}
else if(g_freezetag)
{
- warmup = time + cvar("g_freezetag_warmup");
+ warmup = time + autocvar_g_freezetag_warmup;
}
lms_lowest_lives = 999;
}
if(g_keyhunt)
- kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round")+(game_starttime - time), "", kh_StartRound);
+ kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round+(game_starttime - time), "", kh_StartRound);
if(g_arena)
if(champion && champion.classname == "player" && player_count > 1)
return;
if(g_ca) {
- required_ca_players = max(2, fabs(cvar("bot_vs_human") + 1));
+ required_ca_players = max(2, fabs(autocvar_bot_vs_human + 1));
if(ca_players < required_ca_players && (redspawned && bluespawned)) {
reset_map(TRUE);
strunzone(champion_name);
champion_name = strzone(champion.netname);
}
- else if((!redspawned && !bluespawned) || time - warmup > cvar("g_ca_round_timelimit")) {
+ else if((!redspawned && !bluespawned) || time - warmup > autocvar_g_ca_round_timelimit) {
FOR_EACH_CLIENT(self) centerprint(self, strcat("^7Round tied.", "^7\n"));
next_round = time + 5;
}
-float autocvar_sv_cheats;
+float autocvar__campaign_index;
+string autocvar__campaign_name;
+float autocvar__sv_init;
+float autocvar_bot_ai_aimskill_blendrate;
+float autocvar_bot_ai_aimskill_firetolerance_distdegrees;
+float autocvar_bot_ai_aimskill_firetolerance_maxdegrees;
+float autocvar_bot_ai_aimskill_firetolerance_mindegrees;
+float autocvar_bot_ai_aimskill_fixedrate;
+float autocvar_bot_ai_aimskill_mouse;
+float autocvar_bot_ai_aimskill_offset;
+float autocvar_bot_ai_aimskill_order_filter_1st;
+float autocvar_bot_ai_aimskill_order_filter_2nd;
+float autocvar_bot_ai_aimskill_order_filter_3th;
+float autocvar_bot_ai_aimskill_order_filter_4th;
+float autocvar_bot_ai_aimskill_order_filter_5th;
+float autocvar_bot_ai_aimskill_order_mix_1st;
+float autocvar_bot_ai_aimskill_order_mix_2nd;
+float autocvar_bot_ai_aimskill_order_mix_3th;
+float autocvar_bot_ai_aimskill_order_mix_4th;
+float autocvar_bot_ai_aimskill_order_mix_5th;
+float autocvar_bot_ai_aimskill_think;
+float autocvar_bot_ai_bunnyhop_firstjumpdelay;
+float autocvar_bot_ai_bunnyhop_skilloffset;
+float autocvar_bot_ai_bunnyhop_startdistance;
+float autocvar_bot_ai_bunnyhop_stopdistance;
+float autocvar_bot_ai_chooseweaponinterval;
+string autocvar_bot_ai_custom_weapon_priority_close;
+string autocvar_bot_ai_custom_weapon_priority_distances;
+string autocvar_bot_ai_custom_weapon_priority_far;
+string autocvar_bot_ai_custom_weapon_priority_mid;
+float autocvar_bot_ai_dangerdetectioninterval;
+float autocvar_bot_ai_dangerdetectionupdates;
+float autocvar_bot_ai_enemydetectioninterval;
+float autocvar_bot_ai_enemydetectionradius;
+float autocvar_bot_ai_friends_aware_pickup_radius;
+float autocvar_bot_ai_ignoregoal_timeout;
+float autocvar_bot_ai_keyboard_distance;
+float autocvar_bot_ai_keyboard_treshold;
+float autocvar_bot_ai_navigation_jetpack;
+float autocvar_bot_ai_navigation_jetpack_mindistance;
+float autocvar_bot_ai_strategyinterval;
+float autocvar_bot_ai_thinkinterval;
+float autocvar_bot_ai_weapon_combo;
+float autocvar_bot_ai_weapon_combo_threshold;
+string autocvar_bot_config_file;
+float autocvar_bot_god;
+float autocvar_bot_ignore_bots;
+float autocvar_bot_join_empty;
+float autocvar_bot_navigation_ignoreplayers;
+float autocvar_bot_nofire;
+#define autocvar_bot_number cvar("bot_number")
+#define autocvar_bot_prefix cvar_string("bot_prefix")
+float autocvar_bot_sound_monopoly;
+#define autocvar_bot_suffix cvar_string("bot_suffix")
+float autocvar_bot_usemodelnames;
+float autocvar_bot_vs_human;
+float autocvar_captureleadlimit_override;
+#define autocvar_capturelimit_override cvar("capturelimit_override")
+float autocvar_deathmatch_force_teamplay;
+#define autocvar_developer cvar("developer")
+float autocvar_developer_fteqccbugs;
+float autocvar_ekg;
+#define autocvar_fraglimit cvar("fraglimit")
+#define autocvar_fraglimit_override cvar("fraglimit_override")
+float autocvar_g_allow_oldnexbeam;
+float autocvar_g_antilag;
+float autocvar_g_antilag_bullets;
+float autocvar_g_antilag_nudge;
+float autocvar_g_arena_maxspawned;
+float autocvar_g_arena_point_leadlimit;
+float autocvar_g_arena_point_limit;
+float autocvar_g_arena_powerups;
+float autocvar_g_arena_roundbased;
+float autocvar_g_arena_warmup;
+float autocvar_g_assault;
+float autocvar_g_balance_armor_blockpercent;
+float autocvar_g_balance_armor_limit;
+float autocvar_g_balance_armor_regen;
+float autocvar_g_balance_armor_regenlinear;
+float autocvar_g_balance_armor_regenstable;
+float autocvar_g_balance_armor_rot;
+float autocvar_g_balance_armor_rotlinear;
+float autocvar_g_balance_armor_rotstable;
+float autocvar_g_balance_armor_start;
+float autocvar_g_balance_campingrifle_auto_reload_on_switch;
+float autocvar_g_balance_campingrifle_bursttime;
+float autocvar_g_balance_campingrifle_magazinecapacity;
+float autocvar_g_balance_campingrifle_primary_ammo;
+float autocvar_g_balance_campingrifle_primary_animtime;
+float autocvar_g_balance_campingrifle_primary_bulletconstant;
+float autocvar_g_balance_campingrifle_primary_bullethail;
+float autocvar_g_balance_campingrifle_primary_burstcost;
+float autocvar_g_balance_campingrifle_primary_damage;
+float autocvar_g_balance_campingrifle_primary_force;
+float autocvar_g_balance_campingrifle_primary_headshotaddeddamage;
+float autocvar_g_balance_campingrifle_primary_lifetime;
+float autocvar_g_balance_campingrifle_primary_refire;
+float autocvar_g_balance_campingrifle_primary_speed;
+float autocvar_g_balance_campingrifle_primary_spread;
+float autocvar_g_balance_campingrifle_primary_tracer;
+float autocvar_g_balance_campingrifle_reloadtime;
+float autocvar_g_balance_campingrifle_secondary;
+float autocvar_g_balance_campingrifle_secondary_ammo;
+float autocvar_g_balance_campingrifle_secondary_animtime;
+float autocvar_g_balance_campingrifle_secondary_bulletconstant;
+float autocvar_g_balance_campingrifle_secondary_bullethail;
+float autocvar_g_balance_campingrifle_secondary_burstcost;
+float autocvar_g_balance_campingrifle_secondary_damage;
+float autocvar_g_balance_campingrifle_secondary_force;
+float autocvar_g_balance_campingrifle_secondary_headshotaddeddamage;
+float autocvar_g_balance_campingrifle_secondary_lifetime;
+float autocvar_g_balance_campingrifle_secondary_refire;
+float autocvar_g_balance_campingrifle_secondary_speed;
+float autocvar_g_balance_campingrifle_secondary_spread;
+float autocvar_g_balance_campingrifle_secondary_tracer;
+float autocvar_g_balance_cloaked_alpha;
+float autocvar_g_balance_crylink_primary_ammo;
+float autocvar_g_balance_crylink_primary_animtime;
+float autocvar_g_balance_crylink_primary_bouncedamagefactor;
+float autocvar_g_balance_crylink_primary_bounces;
+float autocvar_g_balance_crylink_primary_damage;
+float autocvar_g_balance_crylink_primary_edgedamage;
+float autocvar_g_balance_crylink_primary_force;
+float autocvar_g_balance_crylink_primary_joinexplode;
+float autocvar_g_balance_crylink_primary_joinexplode_damage;
+float autocvar_g_balance_crylink_primary_joinexplode_edgedamage;
+float autocvar_g_balance_crylink_primary_joinexplode_force;
+float autocvar_g_balance_crylink_primary_joinexplode_radius;
+float autocvar_g_balance_crylink_primary_joinspread;
+float autocvar_g_balance_crylink_primary_jointime;
+float autocvar_g_balance_crylink_primary_linkexplode;
+float autocvar_g_balance_crylink_primary_middle_fadetime;
+float autocvar_g_balance_crylink_primary_middle_lifetime;
+float autocvar_g_balance_crylink_primary_other_fadetime;
+float autocvar_g_balance_crylink_primary_other_lifetime;
+float autocvar_g_balance_crylink_primary_radius;
+float autocvar_g_balance_crylink_primary_refire;
+float autocvar_g_balance_crylink_primary_shots;
+float autocvar_g_balance_crylink_primary_speed;
+float autocvar_g_balance_crylink_primary_spread;
+float autocvar_g_balance_crylink_secondary;
+float autocvar_g_balance_crylink_secondary_ammo;
+float autocvar_g_balance_crylink_secondary_animtime;
+float autocvar_g_balance_crylink_secondary_bouncedamagefactor;
+float autocvar_g_balance_crylink_secondary_bounces;
+float autocvar_g_balance_crylink_secondary_damage;
+float autocvar_g_balance_crylink_secondary_edgedamage;
+float autocvar_g_balance_crylink_secondary_force;
+float autocvar_g_balance_crylink_secondary_joinexplode;
+float autocvar_g_balance_crylink_secondary_joinexplode_damage;
+float autocvar_g_balance_crylink_secondary_joinexplode_edgedamage;
+float autocvar_g_balance_crylink_secondary_joinexplode_force;
+float autocvar_g_balance_crylink_secondary_joinexplode_radius;
+float autocvar_g_balance_crylink_secondary_joinspread;
+float autocvar_g_balance_crylink_secondary_jointime;
+float autocvar_g_balance_crylink_secondary_line_fadetime;
+float autocvar_g_balance_crylink_secondary_line_lifetime;
+float autocvar_g_balance_crylink_secondary_linkexplode;
+float autocvar_g_balance_crylink_secondary_middle_fadetime;
+float autocvar_g_balance_crylink_secondary_middle_lifetime;
+float autocvar_g_balance_crylink_secondary_radius;
+float autocvar_g_balance_crylink_secondary_refire;
+float autocvar_g_balance_crylink_secondary_shots;
+float autocvar_g_balance_crylink_secondary_speed;
+float autocvar_g_balance_crylink_secondary_spread;
+float autocvar_g_balance_ctf_damageforcescale;
+float autocvar_g_balance_ctf_delay_collect;
+float autocvar_g_balance_curse_empathy_minhealth;
+float autocvar_g_balance_curse_empathy_takedamage;
+float autocvar_g_balance_curse_slow_atkrate;
+float autocvar_g_balance_curse_slow_highspeed;
+float autocvar_g_balance_curse_venom_hpmod;
+float autocvar_g_balance_curse_venom_limitmod;
+float autocvar_g_balance_curse_venom_rotrate;
+float autocvar_g_balance_curse_vulner_takedamage;
+float autocvar_g_balance_curse_weak_damage;
+float autocvar_g_balance_curse_weak_force;
+float autocvar_g_balance_electro_combo_comboradius;
+float autocvar_g_balance_electro_combo_damage;
+float autocvar_g_balance_electro_combo_edgedamage;
+float autocvar_g_balance_electro_combo_force;
+float autocvar_g_balance_electro_combo_radius;
+float autocvar_g_balance_electro_combo_speed;
+float autocvar_g_balance_electro_lightning;
+float autocvar_g_balance_electro_primary_ammo;
+float autocvar_g_balance_electro_primary_animtime;
+float autocvar_g_balance_electro_primary_comboradius;
+float autocvar_g_balance_electro_primary_damage;
+float autocvar_g_balance_electro_primary_edgedamage;
+float autocvar_g_balance_electro_primary_falloff_halflifedist;
+float autocvar_g_balance_electro_primary_falloff_maxdist;
+float autocvar_g_balance_electro_primary_falloff_mindist;
+float autocvar_g_balance_electro_primary_force;
+float autocvar_g_balance_electro_primary_force_up;
+float autocvar_g_balance_electro_primary_lifetime;
+float autocvar_g_balance_electro_primary_radius;
+float autocvar_g_balance_electro_primary_range;
+float autocvar_g_balance_electro_primary_refire;
+float autocvar_g_balance_electro_primary_speed;
+float autocvar_g_balance_electro_secondary_ammo;
+float autocvar_g_balance_electro_secondary_animtime;
+float autocvar_g_balance_electro_secondary_bouncefactor;
+float autocvar_g_balance_electro_secondary_bouncestop;
+float autocvar_g_balance_electro_secondary_count;
+float autocvar_g_balance_electro_secondary_damage;
+float autocvar_g_balance_electro_secondary_damageforcescale;
+float autocvar_g_balance_electro_secondary_edgedamage;
+float autocvar_g_balance_electro_secondary_force;
+float autocvar_g_balance_electro_secondary_health;
+float autocvar_g_balance_electro_secondary_lifetime;
+float autocvar_g_balance_electro_secondary_radius;
+float autocvar_g_balance_electro_secondary_refire;
+float autocvar_g_balance_electro_secondary_refire2;
+float autocvar_g_balance_electro_secondary_speed;
+float autocvar_g_balance_falldamage_deadminspeed;
+float autocvar_g_balance_falldamage_factor;
+float autocvar_g_balance_falldamage_maxdamage;
+float autocvar_g_balance_falldamage_minspeed;
+float autocvar_g_balance_fireball_primary_ammo;
+float autocvar_g_balance_fireball_primary_animtime;
+float autocvar_g_balance_fireball_primary_bfgdamage;
+float autocvar_g_balance_fireball_primary_bfgforce;
+float autocvar_g_balance_fireball_primary_bfgradius;
+float autocvar_g_balance_fireball_primary_damage;
+float autocvar_g_balance_fireball_primary_damageforcescale;
+float autocvar_g_balance_fireball_primary_edgedamage;
+float autocvar_g_balance_fireball_primary_force;
+float autocvar_g_balance_fireball_primary_health;
+float autocvar_g_balance_fireball_primary_laserburntime;
+float autocvar_g_balance_fireball_primary_laserdamage;
+float autocvar_g_balance_fireball_primary_laseredgedamage;
+float autocvar_g_balance_fireball_primary_laserradius;
+float autocvar_g_balance_fireball_primary_lifetime;
+float autocvar_g_balance_fireball_primary_radius;
+float autocvar_g_balance_fireball_primary_refire;
+float autocvar_g_balance_fireball_primary_refire2;
+float autocvar_g_balance_fireball_primary_speed;
+float autocvar_g_balance_fireball_secondary_ammo;
+float autocvar_g_balance_fireball_secondary_animtime;
+float autocvar_g_balance_fireball_secondary_damage;
+float autocvar_g_balance_fireball_secondary_damageforcescale;
+float autocvar_g_balance_fireball_secondary_damagetime;
+float autocvar_g_balance_fireball_secondary_laserburntime;
+float autocvar_g_balance_fireball_secondary_laserdamage;
+float autocvar_g_balance_fireball_secondary_laseredgedamage;
+float autocvar_g_balance_fireball_secondary_laserradius;
+float autocvar_g_balance_fireball_secondary_lifetime;
+float autocvar_g_balance_fireball_secondary_refire;
+float autocvar_g_balance_fireball_secondary_speed;
+float autocvar_g_balance_fireball_secondary_speed_up;
+float autocvar_g_balance_firetransfer_damage;
+float autocvar_g_balance_firetransfer_time;
+float autocvar_g_balance_fuel_limit;
+float autocvar_g_balance_fuel_regen;
+float autocvar_g_balance_fuel_regenlinear;
+float autocvar_g_balance_fuel_regenstable;
+float autocvar_g_balance_fuel_rot;
+float autocvar_g_balance_fuel_rotlinear;
+float autocvar_g_balance_fuel_rotstable;
+float autocvar_g_balance_grapplehook_airfriction;
+float autocvar_g_balance_grapplehook_force_rubber;
+float autocvar_g_balance_grapplehook_force_rubber_overstretch;
+float autocvar_g_balance_grapplehook_health;
+float autocvar_g_balance_grapplehook_length_min;
+float autocvar_g_balance_grapplehook_speed_fly;
+float autocvar_g_balance_grapplehook_speed_pull;
+float autocvar_g_balance_grapplehook_stretch;
+float autocvar_g_balance_grenadelauncher_bouncefactor;
+float autocvar_g_balance_grenadelauncher_bouncestop;
+float autocvar_g_balance_grenadelauncher_primary_ammo;
+float autocvar_g_balance_grenadelauncher_primary_animtime;
+float autocvar_g_balance_grenadelauncher_primary_damage;
+float autocvar_g_balance_grenadelauncher_primary_damageforcescale;
+float autocvar_g_balance_grenadelauncher_primary_edgedamage;
+float autocvar_g_balance_grenadelauncher_primary_force;
+float autocvar_g_balance_grenadelauncher_primary_health;
+float autocvar_g_balance_grenadelauncher_primary_lifetime;
+float autocvar_g_balance_grenadelauncher_primary_lifetime2;
+float autocvar_g_balance_grenadelauncher_primary_radius;
+float autocvar_g_balance_grenadelauncher_primary_refire;
+float autocvar_g_balance_grenadelauncher_primary_remote_minbouncecnt;
+float autocvar_g_balance_grenadelauncher_primary_speed;
+float autocvar_g_balance_grenadelauncher_primary_speed_up;
+float autocvar_g_balance_grenadelauncher_primary_type;
+float autocvar_g_balance_grenadelauncher_secondary_ammo;
+float autocvar_g_balance_grenadelauncher_secondary_animtime;
+float autocvar_g_balance_grenadelauncher_secondary_damage;
+float autocvar_g_balance_grenadelauncher_secondary_damageforcescale;
+float autocvar_g_balance_grenadelauncher_secondary_edgedamage;
+float autocvar_g_balance_grenadelauncher_secondary_force;
+float autocvar_g_balance_grenadelauncher_secondary_health;
+float autocvar_g_balance_grenadelauncher_secondary_lifetime;
+float autocvar_g_balance_grenadelauncher_secondary_lifetime2;
+float autocvar_g_balance_grenadelauncher_secondary_radius;
+float autocvar_g_balance_grenadelauncher_secondary_refire;
+float autocvar_g_balance_grenadelauncher_secondary_speed;
+float autocvar_g_balance_grenadelauncher_secondary_speed_up;
+float autocvar_g_balance_grenadelauncher_secondary_type;
+float autocvar_g_balance_hagar_primary_ammo;
+float autocvar_g_balance_hagar_primary_damage;
+float autocvar_g_balance_hagar_primary_edgedamage;
+float autocvar_g_balance_hagar_primary_force;
+float autocvar_g_balance_hagar_primary_lifetime;
+float autocvar_g_balance_hagar_primary_radius;
+float autocvar_g_balance_hagar_primary_refire;
+float autocvar_g_balance_hagar_primary_speed;
+float autocvar_g_balance_hagar_secondary;
+float autocvar_g_balance_hagar_secondary_ammo;
+float autocvar_g_balance_hagar_secondary_damage;
+float autocvar_g_balance_hagar_secondary_edgedamage;
+float autocvar_g_balance_hagar_secondary_force;
+float autocvar_g_balance_hagar_secondary_lifetime_min;
+float autocvar_g_balance_hagar_secondary_lifetime_rand;
+float autocvar_g_balance_hagar_secondary_radius;
+float autocvar_g_balance_hagar_secondary_refire;
+float autocvar_g_balance_health_limit;
+float autocvar_g_balance_health_regen;
+float autocvar_g_balance_health_regenlinear;
+float autocvar_g_balance_health_regenstable;
+float autocvar_g_balance_health_rot;
+float autocvar_g_balance_health_rotlinear;
+float autocvar_g_balance_health_rotstable;
+float autocvar_g_balance_health_start;
+float autocvar_g_balance_hlac_primary_ammo;
+float autocvar_g_balance_hlac_primary_animtime;
+float autocvar_g_balance_hlac_primary_damage;
+float autocvar_g_balance_hlac_primary_edgedamage;
+float autocvar_g_balance_hlac_primary_force;
+float autocvar_g_balance_hlac_primary_lifetime;
+float autocvar_g_balance_hlac_primary_radius;
+float autocvar_g_balance_hlac_primary_refire;
+float autocvar_g_balance_hlac_primary_speed;
+float autocvar_g_balance_hlac_primary_spread_add;
+float autocvar_g_balance_hlac_primary_spread_crouchmod;
+float autocvar_g_balance_hlac_primary_spread_max;
+float autocvar_g_balance_hlac_primary_spread_min;
+float autocvar_g_balance_hlac_secondary;
+float autocvar_g_balance_hlac_secondary_ammo;
+float autocvar_g_balance_hlac_secondary_animtime;
+float autocvar_g_balance_hlac_secondary_damage;
+float autocvar_g_balance_hlac_secondary_edgedamage;
+float autocvar_g_balance_hlac_secondary_force;
+float autocvar_g_balance_hlac_secondary_lifetime;
+float autocvar_g_balance_hlac_secondary_radius;
+float autocvar_g_balance_hlac_secondary_refire;
+float autocvar_g_balance_hlac_secondary_shots;
+float autocvar_g_balance_hlac_secondary_speed;
+float autocvar_g_balance_hlac_secondary_spread;
+float autocvar_g_balance_hlac_secondary_spread_crouchmod;
+float autocvar_g_balance_hook_primary_animtime;
+float autocvar_g_balance_hook_primary_fuel;
+float autocvar_g_balance_hook_primary_hooked_fuel;
+float autocvar_g_balance_hook_primary_hooked_time_free;
+float autocvar_g_balance_hook_primary_hooked_time_max;
+float autocvar_g_balance_hook_primary_refire;
+float autocvar_g_balance_hook_secondary_ammo;
+float autocvar_g_balance_hook_secondary_animtime;
+float autocvar_g_balance_hook_secondary_damage;
+float autocvar_g_balance_hook_secondary_duration;
+float autocvar_g_balance_hook_secondary_edgedamage;
+float autocvar_g_balance_hook_secondary_force;
+float autocvar_g_balance_hook_secondary_gravity;
+float autocvar_g_balance_hook_secondary_lifetime;
+float autocvar_g_balance_hook_secondary_power;
+float autocvar_g_balance_hook_secondary_radius;
+float autocvar_g_balance_hook_secondary_refire;
+float autocvar_g_balance_hook_secondary_speed;
+float autocvar_g_balance_keyhunt_damageforcescale;
+float autocvar_g_balance_keyhunt_delay_collect;
+float autocvar_g_balance_keyhunt_delay_drop;
+float autocvar_g_balance_keyhunt_delay_return;
+float autocvar_g_balance_keyhunt_delay_round;
+float autocvar_g_balance_keyhunt_delay_tracking;
+float autocvar_g_balance_keyhunt_dropvelocity;
+float autocvar_g_balance_keyhunt_maxdist;
+float autocvar_g_balance_keyhunt_protecttime;
+float autocvar_g_balance_keyhunt_score_capture;
+float autocvar_g_balance_keyhunt_score_carrierfrag;
+float autocvar_g_balance_keyhunt_score_collect;
+float autocvar_g_balance_keyhunt_score_destroyed;
+float autocvar_g_balance_keyhunt_score_destroyed_ownfactor;
+float autocvar_g_balance_keyhunt_score_push;
+float autocvar_g_balance_keyhunt_throwvelocity;
+float autocvar_g_balance_kill_delay;
+float autocvar_g_balance_kill_antispam;
+float autocvar_g_balance_laser_primary_animtime;
+float autocvar_g_balance_laser_primary_damage;
+float autocvar_g_balance_laser_primary_delay;
+float autocvar_g_balance_laser_primary_edgedamage;
+float autocvar_g_balance_laser_primary_force;
+float autocvar_g_balance_laser_primary_force_velocitybias;
+float autocvar_g_balance_laser_primary_force_zscale;
+float autocvar_g_balance_laser_primary_lifetime;
+float autocvar_g_balance_laser_primary_radius;
+float autocvar_g_balance_laser_primary_refire;
+float autocvar_g_balance_laser_primary_shotangle;
+float autocvar_g_balance_laser_primary_speed;
+float autocvar_g_balance_laser_secondary;
+float autocvar_g_balance_laser_secondary_animtime;
+float autocvar_g_balance_laser_secondary_damage;
+float autocvar_g_balance_laser_secondary_edgedamage;
+float autocvar_g_balance_laser_secondary_force;
+float autocvar_g_balance_laser_secondary_force_velocitybias;
+float autocvar_g_balance_laser_secondary_force_zscale;
+float autocvar_g_balance_laser_secondary_lifetime;
+float autocvar_g_balance_laser_secondary_radius;
+float autocvar_g_balance_laser_secondary_speed;
+float autocvar_g_balance_minelayer_ammo;
+float autocvar_g_balance_minelayer_animtime;
+float autocvar_g_balance_minelayer_damage;
+float autocvar_g_balance_minelayer_damageforcescale;
+float autocvar_g_balance_minelayer_detonatedelay;
+float autocvar_g_balance_minelayer_edgedamage;
+float autocvar_g_balance_minelayer_force;
+float autocvar_g_balance_minelayer_health;
+float autocvar_g_balance_minelayer_lifetime;
+float autocvar_g_balance_minelayer_limit;
+float autocvar_g_balance_minelayer_protection;
+float autocvar_g_balance_minelayer_proximityradius;
+float autocvar_g_balance_minelayer_radius;
+float autocvar_g_balance_minelayer_refire;
+float autocvar_g_balance_minelayer_remote_damage;
+float autocvar_g_balance_minelayer_remote_edgedamage;
+float autocvar_g_balance_minelayer_remote_force;
+float autocvar_g_balance_minelayer_remote_radius;
+float autocvar_g_balance_minelayer_speed;
+float autocvar_g_balance_minelayer_time;
+float autocvar_g_balance_minstanex_ammo;
+float autocvar_g_balance_minstanex_animtime;
+float autocvar_g_balance_minstanex_refire;
+float autocvar_g_balance_nex_charge;
+float autocvar_g_balance_nex_charge_limit;
+float autocvar_g_balance_nex_charge_maxspeed;
+float autocvar_g_balance_nex_charge_mindmg;
+float autocvar_g_balance_nex_charge_minspeed;
+float autocvar_g_balance_nex_charge_rate;
+float autocvar_g_balance_nex_charge_rot_pause;
+float autocvar_g_balance_nex_charge_rot_rate;
+float autocvar_g_balance_nex_charge_shot_multiplier;
+float autocvar_g_balance_nex_charge_start;
+float autocvar_g_balance_nex_charge_velocity_rate;
+float autocvar_g_balance_nex_primary_ammo;
+float autocvar_g_balance_nex_primary_animtime;
+float autocvar_g_balance_nex_primary_damage;
+float autocvar_g_balance_nex_primary_damagefalloff_forcehalflife;
+float autocvar_g_balance_nex_primary_damagefalloff_halflife;
+float autocvar_g_balance_nex_primary_damagefalloff_maxdist;
+float autocvar_g_balance_nex_primary_damagefalloff_mindist;
+float autocvar_g_balance_nex_primary_force;
+float autocvar_g_balance_nex_primary_refire;
+float autocvar_g_balance_nex_secondary;
+float autocvar_g_balance_nex_secondary_ammo;
+float autocvar_g_balance_nex_secondary_animtime;
+float autocvar_g_balance_nex_secondary_charge;
+float autocvar_g_balance_nex_secondary_charge_rate;
+float autocvar_g_balance_nex_secondary_chargepool;
+float autocvar_g_balance_nex_secondary_chargepool_pause_health_regen;
+float autocvar_g_balance_nex_secondary_chargepool_pause_regen;
+float autocvar_g_balance_nex_secondary_chargepool_regen;
+float autocvar_g_balance_nex_secondary_damage;
+float autocvar_g_balance_nex_secondary_damagefalloff_forcehalflife;
+float autocvar_g_balance_nex_secondary_damagefalloff_halflife;
+float autocvar_g_balance_nex_secondary_damagefalloff_maxdist;
+float autocvar_g_balance_nex_secondary_damagefalloff_mindist;
+float autocvar_g_balance_nex_secondary_force;
+float autocvar_g_balance_nex_secondary_refire;
+float autocvar_g_balance_nexball_primary_animtime;
+float autocvar_g_balance_nexball_primary_refire;
+float autocvar_g_balance_nexball_primary_speed;
+float autocvar_g_balance_nexball_secondary_animtime;
+float autocvar_g_balance_nexball_secondary_force;
+float autocvar_g_balance_nexball_secondary_lifetime;
+float autocvar_g_balance_nexball_secondary_refire;
+float autocvar_g_balance_nexball_secondary_speed;
+float autocvar_g_balance_nix_ammo_cells;
+float autocvar_g_balance_nix_ammo_fuel;
+float autocvar_g_balance_nix_ammo_nails;
+float autocvar_g_balance_nix_ammo_rockets;
+float autocvar_g_balance_nix_ammo_shells;
+float autocvar_g_balance_nix_ammoincr_cells;
+float autocvar_g_balance_nix_ammoincr_fuel;
+float autocvar_g_balance_nix_ammoincr_nails;
+float autocvar_g_balance_nix_ammoincr_rockets;
+float autocvar_g_balance_nix_ammoincr_shells;
+float autocvar_g_balance_nix_incrtime;
+float autocvar_g_balance_nix_roundtime;
+float autocvar_g_balance_pause_armor_rot;
+float autocvar_g_balance_pause_armor_rot_spawn;
+float autocvar_g_balance_pause_fuel_regen;
+float autocvar_g_balance_pause_fuel_rot;
+float autocvar_g_balance_pause_fuel_rot_spawn;
+float autocvar_g_balance_pause_health_regen;
+float autocvar_g_balance_pause_health_regen_spawn;
+float autocvar_g_balance_pause_health_rot;
+float autocvar_g_balance_pause_health_rot_spawn;
+float autocvar_g_balance_portal_health;
+float autocvar_g_balance_portal_lifetime;
+float autocvar_g_balance_porto_primary_animtime;
+float autocvar_g_balance_porto_primary_lifetime;
+float autocvar_g_balance_porto_primary_refire;
+float autocvar_g_balance_porto_primary_speed;
+float autocvar_g_balance_powerup_invincible_takedamage;
+float autocvar_g_balance_powerup_invincible_time;
+float autocvar_g_balance_powerup_strength_damage;
+float autocvar_g_balance_powerup_strength_force;
+float autocvar_g_balance_powerup_strength_selfdamage;
+float autocvar_g_balance_powerup_strength_selfforce;
+float autocvar_g_balance_powerup_strength_time;
+float autocvar_g_balance_powerup_timer;
+float autocvar_g_balance_rocketlauncher_ammo;
+float autocvar_g_balance_rocketlauncher_animtime;
+float autocvar_g_balance_rocketlauncher_damage;
+float autocvar_g_balance_rocketlauncher_damageforcescale;
+float autocvar_g_balance_rocketlauncher_detonatedelay;
+float autocvar_g_balance_rocketlauncher_edgedamage;
+float autocvar_g_balance_rocketlauncher_force;
+float autocvar_g_balance_rocketlauncher_guidedelay;
+float autocvar_g_balance_rocketlauncher_guidegoal;
+float autocvar_g_balance_rocketlauncher_guiderate;
+float autocvar_g_balance_rocketlauncher_guideratedelay;
+float autocvar_g_balance_rocketlauncher_guidestop;
+float autocvar_g_balance_rocketlauncher_health;
+float autocvar_g_balance_rocketlauncher_lifetime;
+float autocvar_g_balance_rocketlauncher_radius;
+float autocvar_g_balance_rocketlauncher_refire;
+float autocvar_g_balance_rocketlauncher_remote_damage;
+float autocvar_g_balance_rocketlauncher_remote_edgedamage;
+float autocvar_g_balance_rocketlauncher_remote_force;
+float autocvar_g_balance_rocketlauncher_remote_radius;
+float autocvar_g_balance_rocketlauncher_speed;
+float autocvar_g_balance_rocketlauncher_speedaccel;
+float autocvar_g_balance_rocketlauncher_speedstart;
+float autocvar_g_balance_rune_defense_combo_takedamage;
+float autocvar_g_balance_rune_defense_takedamage;
+float autocvar_g_balance_rune_regen_combo_hpmod;
+float autocvar_g_balance_rune_regen_combo_limitmod;
+float autocvar_g_balance_rune_regen_combo_regenrate;
+float autocvar_g_balance_rune_regen_combo_rotrate;
+float autocvar_g_balance_rune_regen_hpmod;
+float autocvar_g_balance_rune_regen_limitmod;
+float autocvar_g_balance_rune_regen_regenrate;
+float autocvar_g_balance_rune_speed_atkrate;
+float autocvar_g_balance_rune_speed_combo_atkrate;
+float autocvar_g_balance_rune_speed_combo_highspeed;
+float autocvar_g_balance_rune_speed_highspeed;
+float autocvar_g_balance_rune_strength_combo_damage;
+float autocvar_g_balance_rune_strength_combo_force;
+float autocvar_g_balance_rune_strength_damage;
+float autocvar_g_balance_rune_strength_force;
+float autocvar_g_balance_rune_vampire_absorb;
+float autocvar_g_balance_rune_vampire_combo_absorb;
+float autocvar_g_balance_rune_vampire_maxhealth;
+float autocvar_g_balance_seeker_flac_ammo;
+float autocvar_g_balance_seeker_flac_animtime;
+float autocvar_g_balance_seeker_flac_damage;
+float autocvar_g_balance_seeker_flac_edgedamage;
+float autocvar_g_balance_seeker_flac_force;
+float autocvar_g_balance_seeker_flac_lifetime;
+float autocvar_g_balance_seeker_flac_lifetime_rand;
+float autocvar_g_balance_seeker_flac_radius;
+float autocvar_g_balance_seeker_flac_refire;
+float autocvar_g_balance_seeker_missile_accel;
+float autocvar_g_balance_seeker_missile_ammo;
+float autocvar_g_balance_seeker_missile_count;
+float autocvar_g_balance_seeker_missile_damage;
+float autocvar_g_balance_seeker_missile_damageforcescale;
+float autocvar_g_balance_seeker_missile_decel;
+float autocvar_g_balance_seeker_missile_delay;
+float autocvar_g_balance_seeker_missile_edgedamage;
+float autocvar_g_balance_seeker_missile_force;
+float autocvar_g_balance_seeker_missile_health;
+float autocvar_g_balance_seeker_missile_lifetime;
+float autocvar_g_balance_seeker_missile_proxy;
+float autocvar_g_balance_seeker_missile_proxy_delay;
+float autocvar_g_balance_seeker_missile_proxy_maxrange;
+float autocvar_g_balance_seeker_missile_radius;
+float autocvar_g_balance_seeker_missile_smart;
+float autocvar_g_balance_seeker_missile_smart_mindist;
+float autocvar_g_balance_seeker_missile_smart_trace_max;
+float autocvar_g_balance_seeker_missile_smart_trace_min;
+float autocvar_g_balance_seeker_missile_speed_max;
+float autocvar_g_balance_seeker_missile_turnrate;
+float autocvar_g_balance_seeker_tag_ammo;
+float autocvar_g_balance_seeker_tag_animtime;
+float autocvar_g_balance_seeker_tag_damageforcescale;
+float autocvar_g_balance_seeker_tag_health;
+float autocvar_g_balance_seeker_tag_lifetime;
+float autocvar_g_balance_seeker_tag_refire;
+float autocvar_g_balance_seeker_tag_speed;
+float autocvar_g_balance_selfdamagepercent;
+float autocvar_g_balance_shotgun_primary_ammo;
+float autocvar_g_balance_shotgun_primary_animtime;
+float autocvar_g_balance_shotgun_primary_bulletconstant;
+float autocvar_g_balance_shotgun_primary_bullets;
+float autocvar_g_balance_shotgun_primary_damage;
+float autocvar_g_balance_shotgun_primary_force;
+float autocvar_g_balance_shotgun_primary_refire;
+float autocvar_g_balance_shotgun_primary_speed;
+float autocvar_g_balance_shotgun_primary_spread;
+float autocvar_g_balance_shotgun_secondary;
+float autocvar_g_balance_shotgun_secondary_animtime;
+float autocvar_g_balance_shotgun_secondary_damage;
+float autocvar_g_balance_shotgun_secondary_force;
+float autocvar_g_balance_shotgun_secondary_melee_delay;
+float autocvar_g_balance_shotgun_secondary_melee_range;
+float autocvar_g_balance_shotgun_secondary_melee_swing;
+float autocvar_g_balance_shotgun_secondary_melee_time;
+float autocvar_g_balance_shotgun_secondary_refire;
+float autocvar_g_balance_teams;
+float autocvar_g_balance_teams_force;
+float autocvar_g_balance_teams_prevent_imbalance;
+float autocvar_g_balance_tuba_animtime;
+float autocvar_g_balance_tuba_attenuation;
+float autocvar_g_balance_tuba_damage;
+float autocvar_g_balance_tuba_edgedamage;
+float autocvar_g_balance_tuba_force;
+float autocvar_g_balance_tuba_radius;
+float autocvar_g_balance_tuba_refire;
+float autocvar_g_balance_uzi_bulletconstant;
+float autocvar_g_balance_uzi_burst;
+float autocvar_g_balance_uzi_burst_ammo;
+float autocvar_g_balance_uzi_burst_refire;
+float autocvar_g_balance_uzi_burst_refire2;
+float autocvar_g_balance_uzi_burst_spread;
+float autocvar_g_balance_uzi_first;
+float autocvar_g_balance_uzi_first_ammo;
+float autocvar_g_balance_uzi_first_damage;
+float autocvar_g_balance_uzi_first_force;
+float autocvar_g_balance_uzi_first_refire;
+float autocvar_g_balance_uzi_first_spread;
+float autocvar_g_balance_uzi_mode;
+float autocvar_g_balance_uzi_speed;
+float autocvar_g_balance_uzi_spread_add;
+float autocvar_g_balance_uzi_spread_max;
+float autocvar_g_balance_uzi_spread_min;
+float autocvar_g_balance_uzi_sustained_ammo;
+float autocvar_g_balance_uzi_sustained_damage;
+float autocvar_g_balance_uzi_sustained_force;
+float autocvar_g_balance_uzi_sustained_refire;
+float autocvar_g_balance_uzi_sustained_spread;
+float autocvar_g_balance_weaponswitchdelay;
+float autocvar_g_ballistics_density_corpse;
+float autocvar_g_ballistics_density_player;
+float autocvar_g_ballistics_materialconstant;
+float autocvar_g_ballistics_mindistance;
+float autocvar_g_ban_default_bantime;
+float autocvar_g_ban_default_masksize;
+float autocvar_g_ban_sync_interval;
+float autocvar_g_ban_sync_timeout;
+string autocvar_g_ban_sync_trusted_servers;
+float autocvar_g_ban_sync_trusted_servers_verify;
+string autocvar_g_ban_sync_uri;
+string autocvar_g_banned_list;
+float autocvar_g_banned_list_idmode;
float autocvar_g_bastet;
+float autocvar_g_botclip_collisions;
+float autocvar_g_bugrigs;
+float autocvar_g_ca_damage2score_multiplier;
+float autocvar_g_ca_point_leadlimit;
+float autocvar_g_ca_point_limit;
+float autocvar_g_ca_round_timelimit;
+float autocvar_g_ca_warmup;
+float autocvar_g_campaign;
+float autocvar_g_campaign_forceteam;
+float autocvar_g_campaign_skill;
+float autocvar_g_casings;
+float autocvar_g_changeteam_banned;
+float autocvar_g_chat_flood_burst;
+float autocvar_g_chat_flood_burst_team;
+float autocvar_g_chat_flood_burst_tell;
+float autocvar_g_chat_flood_lmax;
+float autocvar_g_chat_flood_lmax_team;
+float autocvar_g_chat_flood_lmax_tell;
+float autocvar_g_chat_flood_notify_flooder;
+float autocvar_g_chat_flood_spl;
+float autocvar_g_chat_flood_spl_team;
+float autocvar_g_chat_flood_spl_tell;
+float autocvar_g_chat_nospectators;
+float autocvar_g_chat_teamcolors;
+float autocvar_g_ctf_allow_drop;
+float autocvar_g_ctf_captimerecord_always;
+float autocvar_g_ctf_capture_leadlimit;
+float autocvar_g_ctf_capture_limit;
+float autocvar_g_ctf_dynamiclights;
+string autocvar_g_ctf_flag_blue_model;
+float autocvar_g_ctf_flag_blue_skin;
+float autocvar_g_ctf_flag_capture_effects;
+float autocvar_g_ctf_flag_glowtrails;
+float autocvar_g_ctf_flag_pickup_effects;
+string autocvar_g_ctf_flag_red_model;
+float autocvar_g_ctf_flag_red_skin;
+float autocvar_g_ctf_flag_returntime;
+float autocvar_g_ctf_flagcarrier_selfdamage;
+float autocvar_g_ctf_flagcarrier_selfforce;
+float autocvar_g_ctf_fullbrightflags;
+float autocvar_g_ctf_ignore_frags;
+float autocvar_g_ctf_shield_force;
+float autocvar_g_ctf_shield_max_ratio;
+float autocvar_g_ctf_shield_min_negscore;
+float autocvar_g_cts_finish_kill_delay;
+float autocvar_g_cts_selfdamage;
+float autocvar_g_deathglow;
+float autocvar_g_debug_bot_commands;
+float autocvar_g_domination_default_teams;
+float autocvar_g_domination_disable_frags;
+float autocvar_g_domination_point_amt;
+float autocvar_g_domination_point_fullbright;
+float autocvar_g_domination_point_leadlimit;
+#define autocvar_g_domination_point_limit cvar("g_domination_point_limit")
+float autocvar_g_domination_point_rate;
+float autocvar_g_domination_teams_override;
+float autocvar_g_forced_respawn;
+string autocvar_g_forced_team_blue;
+string autocvar_g_forced_team_otherwise;
+string autocvar_g_forced_team_pink;
+string autocvar_g_forced_team_red;
+string autocvar_g_forced_team_yellow;
+float autocvar_g_freezetag_frozen_force;
+float autocvar_g_freezetag_point_leadlimit;
+float autocvar_g_freezetag_point_limit;
+float autocvar_g_freezetag_revive_extra_size;
+float autocvar_g_freezetag_revive_time;
+float autocvar_g_freezetag_warmup;
+#define autocvar_g_friendlyfire cvar("g_friendlyfire")
+float autocvar_g_full_getstatus_responses;
+float autocvar_g_fullbrightitems;
+float autocvar_g_fullbrightplayers;
+string autocvar_g_ghost_items_color;
+#define autocvar_g_grappling_hook cvar("g_grappling_hook")
+float autocvar_g_grappling_hook_tarzan;
+float autocvar_g_hitplots;
+string autocvar_g_hitplots_individuals;
+float autocvar_g_jetpack_acceleration_side;
+float autocvar_g_jetpack_acceleration_up;
+float autocvar_g_jetpack_antigravity;
+float autocvar_g_jetpack_attenuation;
+float autocvar_g_jetpack_fuel;
+float autocvar_g_jetpack_maxspeed_side;
+float autocvar_g_jetpack_maxspeed_up;
+float autocvar_g_keepaway_ballcarrier_alpha;
+float autocvar_g_keepaway_ballcarrier_damage;
+float autocvar_g_keepaway_ballcarrier_force;
+float autocvar_g_keepaway_ballcarrier_highspeed;
+float autocvar_g_keepaway_ballcarrier_selfdamage;
+float autocvar_g_keepaway_ballcarrier_selfforce;
+float autocvar_g_keepaway_bckillscore;
+float autocvar_g_keepaway_noncarrier_damage;
+float autocvar_g_keepaway_noncarrier_force;
+float autocvar_g_keepaway_noncarrier_selfdamage;
+float autocvar_g_keepaway_noncarrier_selfforce;
+float autocvar_g_keepaway_noncarrier_warn;
+float autocvar_g_keepawayball_damageforcescale;
+float autocvar_g_keepawayball_respawntime;
+float autocvar_g_keepawayball_trail_color;
+float autocvar_g_keyhunt_point_leadlimit;
+#define autocvar_g_keyhunt_point_limit cvar("g_keyhunt_point_limit")
+float autocvar_g_keyhunt_teams;
+float autocvar_g_keyhunt_teams_override;
+float autocvar_g_lms_campcheck_damage;
+float autocvar_g_lms_campcheck_distance;
+float autocvar_g_lms_campcheck_interval;
+string autocvar_g_lms_campcheck_message;
+float autocvar_g_lms_join_anytime;
+float autocvar_g_lms_last_join;
+#define autocvar_g_lms_lives_override cvar("g_lms_lives_override")
+float autocvar_g_lms_regenerate;
+#define autocvar_g_maplist cvar_string("g_maplist")
+float autocvar_g_maplist_check_waypoints;
+float autocvar_g_maplist_index;
+string autocvar_g_maplist_mostrecent;
+float autocvar_g_maplist_mostrecent_count;
+float autocvar_g_maplist_selectrandom;
+float autocvar_g_maplist_shuffle;
+#define autocvar_g_maplist_votable cvar("g_maplist_votable")
+float autocvar_g_maplist_votable_abstain;
+float autocvar_g_maplist_votable_keeptwotime;
+float autocvar_g_maplist_votable_nodetail;
+string autocvar_g_maplist_votable_screenshot_dir;
+float autocvar_g_maplist_votable_suggestions;
+float autocvar_g_maplist_votable_suggestions_override_mostrecent;
+float autocvar_g_maplist_votable_timeout;
+float autocvar_g_maxplayers;
+float autocvar_g_maxplayers_spectator_blocktime;
+float autocvar_g_maxpushtime;
+float autocvar_g_maxspeed;
+#define autocvar_g_midair cvar("g_midair")
+float autocvar_g_midair_shieldtime;
+#define autocvar_g_minstagib cvar("g_minstagib")
+float autocvar_g_minstagib_ammo_drop;
+float autocvar_g_minstagib_extralives;
+float autocvar_g_minstagib_speed_highspeed;
+#define autocvar_g_mirrordamage cvar("g_mirrordamage")
+float autocvar_g_monster_zombie_attack_run_damage;
+float autocvar_g_monster_zombie_attack_run_delay;
+float autocvar_g_monster_zombie_attack_run_force;
+float autocvar_g_monster_zombie_attack_run_hitrange;
+float autocvar_g_monster_zombie_attack_run_range;
+float autocvar_g_monster_zombie_attack_stand_damage;
+float autocvar_g_monster_zombie_attack_stand_delay;
+float autocvar_g_monster_zombie_attack_stand_force;
+float autocvar_g_monster_zombie_attack_stand_range;
+float autocvar_g_monster_zombie_health;
+float autocvar_g_monster_zombie_idle_timer_max;
+float autocvar_g_monster_zombie_idle_timer_min;
+float autocvar_g_monster_zombie_movespeed;
+float autocvar_g_monster_zombie_respawntime;
+float autocvar_g_monster_zombie_stopspeed;
+float autocvar_g_monster_zombie_targetrange;
+float autocvar_g_monster_zombie_turnspeed;
+float autocvar_g_monsters;
var float autocvar_g_movement_highspeed = 1;
+float autocvar_g_multijump;
+float autocvar_g_multijump_add;
+float autocvar_g_multijump_speed;
+string autocvar_g_mutatormsg;
+float autocvar_g_nexball_basketball_bouncefactor;
+float autocvar_g_nexball_basketball_bouncestop;
+float autocvar_g_nexball_basketball_carrier_highspeed;
+float autocvar_g_nexball_basketball_meter;
+float autocvar_g_nexball_basketball_meter_maxpower;
+float autocvar_g_nexball_basketball_meter_minpower;
+float autocvar_g_nexball_delay_collect;
+float autocvar_g_nexball_delay_goal;
+float autocvar_g_nexball_delay_start;
+float autocvar_g_nexball_football_bouncefactor;
+float autocvar_g_nexball_football_bouncestop;
+float autocvar_g_nexball_goalleadlimit;
+#define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
+float autocvar_g_nexball_radar_showallplayers;
+float autocvar_g_nexball_sound_bounce;
+float autocvar_g_nexball_trail_color;
+float autocvar_g_nick_flood_penalty;
+float autocvar_g_nick_flood_penalty_red;
+float autocvar_g_nick_flood_penalty_yellow;
+float autocvar_g_nick_flood_timeout;
+float autocvar_g_nix_with_healtharmor;
+float autocvar_g_nix_with_laser;
+float autocvar_g_nix_with_powerups;
+float autocvar_g_nodepthtestitems;
+float autocvar_g_nodepthtestplayers;
+float autocvar_g_norecoil;
+float autocvar_g_onslaught_cp_buildhealth;
+float autocvar_g_onslaught_cp_buildtime;
+float autocvar_g_onslaught_cp_health;
+float autocvar_g_onslaught_cp_regen;
+float autocvar_g_onslaught_gen_health;
+float autocvar_g_pickup_cells_max;
+float autocvar_g_pickup_fuel_max;
+float autocvar_g_pickup_items;
+float autocvar_g_pickup_nails_max;
+float autocvar_g_pickup_rockets_max;
+float autocvar_g_pickup_shells_max;
+float autocvar_g_player_alpha;
+float autocvar_g_player_brightness;
+float autocvar_g_playerclip_collisions;
+string autocvar_g_playerstats_uri;
+float autocvar_g_powerup_shield;
+float autocvar_g_powerup_strength;
+float autocvar_g_powerup_superhealth;
+float autocvar_g_projectiles_newton_style;
+float autocvar_g_projectiles_newton_style_2_maxfactor;
+float autocvar_g_projectiles_newton_style_2_minfactor;
+float autocvar_g_projectiles_spread_style;
+#define autocvar_g_race_laps_limit cvar("g_race_laps_limit")
+float autocvar_g_race_qualifying_timelimit;
+float autocvar_g_race_qualifying_timelimit_override;
+float autocvar_g_race_teams;
+float autocvar_g_respawn_delay;
+float autocvar_g_respawn_ghosts;
+float autocvar_g_respawn_ghosts_maxtime;
+float autocvar_g_respawn_ghosts_speed;
+float autocvar_g_respawn_waves;
+float autocvar_g_runematch_allow_same;
+float autocvar_g_runematch_drop_runes_max;
+float autocvar_g_runematch_fixedspawns;
+float autocvar_g_runematch_frags_killed_runeholder;
+float autocvar_g_runematch_frags_killedby_runeholder;
+float autocvar_g_runematch_frags_norune;
+float autocvar_g_runematch_point_leadlimit;
+#define autocvar_g_runematch_point_limit cvar("g_runematch_point_limit")
+float autocvar_g_runematch_pointamt;
+float autocvar_g_runematch_pointrate;
+float autocvar_g_runematch_respawntime;
+float autocvar_g_runematch_rune_alpha;
+float autocvar_g_runematch_rune_color_strength;
+float autocvar_g_runematch_rune_effects;
+float autocvar_g_runematch_shuffletime;
+float autocvar_g_running_guns;
+float autocvar_g_shootfromcenter;
+float autocvar_g_shootfromclient;
+float autocvar_g_shootfromeye;
+string autocvar_g_shootfromfixedorigin;
+float autocvar_g_showweaponspawns;
+float autocvar_g_spawn_furthest;
+float autocvar_g_spawnpoints_auto_move_out_of_solid;
+#define autocvar_g_spawnshieldtime cvar("g_spawnshieldtime")
+float autocvar_g_spawnsound;
+float autocvar_g_start_delay;
+#define autocvar_g_start_weapon_laser cvar("g_start_weapon_laser")
+float autocvar_g_tdm_team_spawns;
+float autocvar_g_tdm_teams;
+float autocvar_g_tdm_teams_override;
+float autocvar_g_teamdamage_resetspeed;
+float autocvar_g_teamdamage_threshold;
+float autocvar_g_telefrags;
+float autocvar_g_telefrags_avoid;
+float autocvar_g_telefrags_teamplay;
+float autocvar_g_teleport_maxspeed;
+float autocvar_g_throughfloor_damage;
+float autocvar_g_throughfloor_force;
+float autocvar_g_triggerimpulse_accel_multiplier;
+float autocvar_g_triggerimpulse_accel_power;
+float autocvar_g_triggerimpulse_directional_multiplier;
+float autocvar_g_triggerimpulse_radial_multiplier;
+float autocvar_g_turrets;
+float autocvar_g_turrets_aimidle_delay;
+float autocvar_g_turrets_nofire;
+float autocvar_g_turrets_reloadcvars;
+float autocvar_g_turrets_targetscan_maxdelay;
+float autocvar_g_turrets_targetscan_mindelay;
+float autocvar_g_turrets_unit_ewheel_speed_fast;
+float autocvar_g_turrets_unit_ewheel_speed_slow;
+float autocvar_g_turrets_unit_ewheel_speed_slower;
+float autocvar_g_turrets_unit_ewheel_speed_stop;
+float autocvar_g_turrets_unit_ewheel_turnrate;
+float autocvar_g_turrets_unit_hellion_std_shot_speed_gain;
+float autocvar_g_turrets_unit_hellion_std_shot_speed_max;
+float autocvar_g_turrets_unit_hk_std_shot_speed;
+float autocvar_g_turrets_unit_hk_std_shot_speed_accel;
+float autocvar_g_turrets_unit_hk_std_shot_speed_accel2;
+float autocvar_g_turrets_unit_hk_std_shot_speed_decel;
+float autocvar_g_turrets_unit_hk_std_shot_speed_max;
+float autocvar_g_turrets_unit_hk_std_shot_speed_turnrate;
+float autocvar_g_turrets_unit_walker_speed_jump;
+float autocvar_g_turrets_unit_walker_speed_roam;
+float autocvar_g_turrets_unit_walker_speed_run;
+float autocvar_g_turrets_unit_walker_speed_stop;
+float autocvar_g_turrets_unit_walker_speed_swim;
+float autocvar_g_turrets_unit_walker_speed_walk;
+float autocvar_g_turrets_unit_walker_std_meele_dmg;
+float autocvar_g_turrets_unit_walker_std_meele_force;
+float autocvar_g_turrets_unit_walker_std_meele_range;
+float autocvar_g_turrets_unit_walker_std_rocket_dmg;
+float autocvar_g_turrets_unit_walker_std_rocket_force;
+float autocvar_g_turrets_unit_walker_std_rocket_radius;
+float autocvar_g_turrets_unit_walker_std_rocket_refire;
+float autocvar_g_turrets_unit_walker_std_rocket_speed;
+float autocvar_g_turrets_unit_walker_std_rocket_turnrate;
+float autocvar_g_turrets_unit_walker_std_rockets_range;
+float autocvar_g_turrets_unit_walker_std_rockets_range_min;
+float autocvar_g_use_ammunition;
+float autocvar_g_vehicle_racer_afterburn_cost;
+float autocvar_g_vehicle_racer_anglestabilizer;
+float autocvar_g_vehicle_racer_downforce;
+float autocvar_g_vehicle_racer_energy;
+float autocvar_g_vehicle_racer_energy_usepause;
+float autocvar_g_vehicle_racer_health;
+float autocvar_g_vehicle_racer_laser_cost;
+float autocvar_g_vehicle_racer_laser_damage;
+float autocvar_g_vehicle_racer_laser_radius;
+float autocvar_g_vehicle_racer_laser_refire;
+float autocvar_g_vehicle_racer_laser_speed;
+float autocvar_g_vehicle_racer_pitchspeed;
+float autocvar_g_vehicle_racer_power_air;
+float autocvar_g_vehicle_racer_power_min;
+float autocvar_g_vehicle_racer_power_solid;
+float autocvar_g_vehicle_racer_reload;
+float autocvar_g_vehicle_racer_respawntime;
+float autocvar_g_vehicle_racer_rocket_accel;
+float autocvar_g_vehicle_racer_rocket_damage;
+float autocvar_g_vehicle_racer_rocket_radius;
+float autocvar_g_vehicle_racer_rocket_refire;
+float autocvar_g_vehicle_racer_rocket_speed;
+float autocvar_g_vehicle_racer_rocket_turnrate;
+float autocvar_g_vehicle_racer_shield;
+float autocvar_g_vehicle_racer_speed_afterburn;
+float autocvar_g_vehicle_racer_speed_forward;
+float autocvar_g_vehicle_racer_speed_strafe;
+float autocvar_g_vehicle_racer_springlength;
+float autocvar_g_vehicle_racer_turnroll;
+float autocvar_g_vehicle_racer_turnspeed;
+float autocvar_g_vehicle_raptor_reload;
+float autocvar_g_vehicle_spiderbot_crush_dmg;
+float autocvar_g_vehicle_spiderbot_crush_force;
+float autocvar_g_vehicle_spiderbot_head_pitchlimit_down;
+float autocvar_g_vehicle_spiderbot_head_pitchlimit_up;
+float autocvar_g_vehicle_spiderbot_head_pitchspeed;
+float autocvar_g_vehicle_spiderbot_head_turnlimit;
+float autocvar_g_vehicle_spiderbot_head_turnspeed;
+float autocvar_g_vehicle_spiderbot_health;
+float autocvar_g_vehicle_spiderbot_minigun_cooldown;
+float autocvar_g_vehicle_spiderbot_minigun_damage;
+float autocvar_g_vehicle_spiderbot_minigun_heat;
+float autocvar_g_vehicle_spiderbot_minigun_refire;
+float autocvar_g_vehicle_spiderbot_minigun_spread;
+float autocvar_g_vehicle_spiderbot_movement_inertia;
+float autocvar_g_vehicle_spiderbot_respawntime;
+float autocvar_g_vehicle_spiderbot_rocket_damage;
+float autocvar_g_vehicle_spiderbot_rocket_edgedamage;
+float autocvar_g_vehicle_spiderbot_rocket_force;
+float autocvar_g_vehicle_spiderbot_rocket_health;
+float autocvar_g_vehicle_spiderbot_rocket_lifetime;
+float autocvar_g_vehicle_spiderbot_rocket_noise;
+float autocvar_g_vehicle_spiderbot_rocket_radius;
+float autocvar_g_vehicle_spiderbot_rocket_refire;
+float autocvar_g_vehicle_spiderbot_rocket_reload;
+float autocvar_g_vehicle_spiderbot_rocket_speed;
+float autocvar_g_vehicle_spiderbot_rocket_turnrate;
+float autocvar_g_vehicle_spiderbot_shield;
+float autocvar_g_vehicle_spiderbot_speed_stop;
+float autocvar_g_vehicle_spiderbot_speed_strafe;
+float autocvar_g_vehicle_spiderbot_speed_walk;
+float autocvar_g_vehicle_spiderbot_turnspeed;
+float autocvar_g_waypointeditor;
+float autocvar_g_waypoints_for_items;
+float autocvar_g_waypointsprite_deadlifetime;
+float autocvar_g_waypointsprite_deployed_lifetime;
+float autocvar_g_waypointsprite_limitedrange;
+float autocvar_g_weapon_charge_colormod_blue_full;
+float autocvar_g_weapon_charge_colormod_blue_half;
+float autocvar_g_weapon_charge_colormod_green_full;
+float autocvar_g_weapon_charge_colormod_green_half;
+float autocvar_g_weapon_charge_colormod_hdrmultiplier;
+float autocvar_g_weapon_charge_colormod_red_full;
+float autocvar_g_weapon_charge_colormod_red_half;
+#define autocvar_g_weapon_stay cvar("g_weapon_stay")
+float autocvar_g_weapon_throwable;
+#define autocvar_g_weaponarena cvar_string("g_weaponarena")
+string autocvar_g_xonoticversion;
+float autocvar_gamecfg;
+float autocvar_gameversion;
+float autocvar_gameversion_min;
+float autocvar_gameversion_max;
+string autocvar_hostname;
+float autocvar_lastlevel;
+float autocvar_leadlimit;
+float autocvar_leadlimit_and_fraglimit;
+float autocvar_leadlimit_override;
+float autocvar_loddebug;
+float autocvar_minplayers;
+string autocvar_nextmap;
+float autocvar_prvm_backtraceforwarnings;
+string autocvar_quit_and_redirect;
+float autocvar_quit_when_empty;
+float autocvar_r_showbboxes;
+float autocvar_rescan_pending;
+float autocvar_samelevel;
+#define autocvar_skill cvar("skill")
+float autocvar_skill_auto;
+#define autocvar_slowmo cvar("slowmo")
+float autocvar_snd_soundradius;
+float autocvar_spawn_debug;
+float autocvar_spawn_debugview;
+float autocvar_speedmeter;
+float autocvar_sv_accelerate;
+var float autocvar_sv_accuracy_data_share = 1;
+string autocvar_sv_adminnick;
+float autocvar_sv_airaccel_qw;
+float autocvar_sv_airaccel_sideways_friction;
+float autocvar_sv_airaccelerate;
+float autocvar_sv_aircontrol;
+float autocvar_sv_aircontrol_penalty;
+float autocvar_sv_aircontrol_power;
+float autocvar_sv_airspeedlimit_nonqw;
+float autocvar_sv_airstopaccelerate;
+float autocvar_sv_airstrafeaccel_qw;
+float autocvar_sv_airstrafeaccelerate;
+float autocvar_sv_allow_shownames;
+float autocvar_sv_autoscreenshot;
+float autocvar_sv_cheats;
+float autocvar_sv_curl_serverpackages_auto;
+float autocvar_sv_db_saveasdump;
+float autocvar_sv_defaultcharacter;
+string autocvar_sv_defaultplayercolors;
+string autocvar_sv_defaultplayermodel;
+string autocvar_sv_defaultplayermodel_blue;
+string autocvar_sv_defaultplayermodel_pink;
+string autocvar_sv_defaultplayermodel_red;
+string autocvar_sv_defaultplayermodel_yellow;
+float autocvar_sv_defaultplayerskin;
+float autocvar_sv_dodging_delay;
+float autocvar_sv_dodging_height_threshold;
+float autocvar_sv_dodging_horiz_speed;
+float autocvar_sv_dodging_ramp_time;
+float autocvar_sv_dodging_sound;
+float autocvar_sv_dodging_up_speed;
+float autocvar_sv_dodging_wall_distance_threshold;
+float autocvar_sv_dodging_wall_dodging;
+float autocvar_sv_doublejump;
+float autocvar_sv_eventlog;
+float autocvar_sv_eventlog_console;
+float autocvar_sv_eventlog_files;
+float autocvar_sv_eventlog_files_counter;
+string autocvar_sv_eventlog_files_nameprefix;
+string autocvar_sv_eventlog_files_namesuffix;
+float autocvar_sv_eventlog_files_timestamps;
+float autocvar_sv_fragmessage_information_handicap;
+float autocvar_sv_fragmessage_information_ping;
+float autocvar_sv_fragmessage_information_stats;
+float autocvar_sv_fragmessage_information_typefrag;
+float autocvar_sv_friction;
+float autocvar_sv_friction_on_land;
+float autocvar_sv_gameplayfix_q2airaccelerate;
+#define autocvar_sv_gravity cvar("sv_gravity")
+float autocvar_sv_hitsound_antispam_time;
+string autocvar_sv_intermission_cdtrack;
+string autocvar_sv_jumpspeedcap_max;
+float autocvar_sv_jumpspeedcap_max_disable_on_ramps;
+string autocvar_sv_jumpspeedcap_min;
+float autocvar_sv_jumpvelocity;
+float autocvar_sv_logscores_bots;
+float autocvar_sv_logscores_console;
+float autocvar_sv_logscores_file;
+string autocvar_sv_logscores_filename;
+float autocvar_sv_mapchange_delay;
+float autocvar_sv_maxairspeed;
+float autocvar_sv_maxairstrafespeed;
+float autocvar_sv_maxspeed;
+string autocvar_sv_motd;
+string autocvar_sv_player_crouch_maxs;
+string autocvar_sv_player_crouch_mins;
+string autocvar_sv_player_crouch_viewoffset;
+string autocvar_sv_player_headsize;
+string autocvar_sv_player_maxs;
+string autocvar_sv_player_mins;
+string autocvar_sv_player_viewoffset;
+float autocvar_sv_precacheplayermodels;
+float autocvar_sv_precacheweapons;
+float autocvar_sv_q3acompat_machineshotgunswap;
+float autocvar_sv_qcweaponanimation;
+float autocvar_sv_ready_restart;
+float autocvar_sv_ready_restart_after_countdown;
+float autocvar_sv_ready_restart_repeatable;
+float autocvar_sv_servermodelsonly;
+float autocvar_sv_spectate;
+float autocvar_sv_spectator_speed_multiplier;
+float autocvar_sv_stepheight;
+float autocvar_sv_stopspeed;
+float autocvar_sv_strengthsound_antispam_refire_threshold;
+float autocvar_sv_strengthsound_antispam_time;
+float autocvar_sv_teamnagger;
+float autocvar_sv_timeout;
+float autocvar_sv_timeout_leadtime;
+float autocvar_sv_timeout_length;
+float autocvar_sv_timeout_number;
+float autocvar_sv_timeout_resumetime;
+float autocvar_sv_vote_call;
+float autocvar_sv_vote_change;
+string autocvar_sv_vote_commands;
+float autocvar_sv_vote_majority_factor;
+float autocvar_sv_vote_master;
+string autocvar_sv_vote_master_commands;
+string autocvar_sv_vote_master_password;
+float autocvar_sv_vote_nospectators;
+string autocvar_sv_vote_only_commands;
+float autocvar_sv_vote_override_mostrecent;
+float autocvar_sv_vote_simple_majority_factor;
+float autocvar_sv_vote_singlecount;
+float autocvar_sv_vote_stop;
+float autocvar_sv_vote_timeout;
+float autocvar_sv_vote_wait;
+float autocvar_sv_warsowbunny_accel;
+float autocvar_sv_warsowbunny_airforwardaccel;
+float autocvar_sv_warsowbunny_backtosideratio;
+float autocvar_sv_warsowbunny_topspeed;
+float autocvar_sv_warsowbunny_turnaccel;
+string autocvar_sv_weaponstats_damagefile;
+string autocvar_sv_weaponstats_killfile;
+float autocvar_sys_ticrate;
+float autocvar_teamplay_lockonrestart;
+float autocvar_teamplay_mode;
+#define autocvar_timelimit cvar("timelimit")
+#define autocvar_timelimit_override cvar("timelimit_override")
+float autocvar_timelimit_overtime;
+float autocvar_timelimit_overtimes;
+float autocvar_timelimit_suddendeath;
+#define autocvar_utf8_enable cvar("utf8_enable")
+float autocvar_waypoint_benchmark;
+float autocvar_welcome_message_time;
if (time >= self.bot_badaimtime)
{
self.bot_badaimtime = max(self.bot_badaimtime + 0.3, time);
- self.bot_badaimoffset = randomvec() * bound(0, 5 - 0.5 * (skill+self.bot_offsetskill), 5) * cvar("bot_ai_aimskill_offset");
+ self.bot_badaimoffset = randomvec() * bound(0, 5 - 0.5 * (skill+self.bot_offsetskill), 5) * autocvar_bot_ai_aimskill_offset;
}
desiredang = vectoangles(v) + self.bot_badaimoffset;
//dprint(" desired:", vtos(desiredang));
self.bot_prevaimtime = time;
// Here we will try to anticipate the comming aiming direction
self.bot_1st_order_aimfilter= self.bot_1st_order_aimfilter
- + (diffang * (1 / delta_t) - self.bot_1st_order_aimfilter) * bound(0, cvar("bot_ai_aimskill_order_filter_1st"),1);
+ + (diffang * (1 / delta_t) - self.bot_1st_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_1st,1);
self.bot_2nd_order_aimfilter= self.bot_2nd_order_aimfilter
- + (self.bot_1st_order_aimfilter - self.bot_2nd_order_aimfilter) * bound(0, cvar("bot_ai_aimskill_order_filter_2nd"),1);
+ + (self.bot_1st_order_aimfilter - self.bot_2nd_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_2nd,1);
self.bot_3th_order_aimfilter= self.bot_3th_order_aimfilter
- + (self.bot_2nd_order_aimfilter - self.bot_3th_order_aimfilter) * bound(0, cvar("bot_ai_aimskill_order_filter_3th"),1);
+ + (self.bot_2nd_order_aimfilter - self.bot_3th_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_3th,1);
self.bot_4th_order_aimfilter= self.bot_4th_order_aimfilter
- + (self.bot_3th_order_aimfilter - self.bot_4th_order_aimfilter) * bound(0, cvar("bot_ai_aimskill_order_filter_4th"),1);
+ + (self.bot_3th_order_aimfilter - self.bot_4th_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_4th,1);
self.bot_5th_order_aimfilter= self.bot_5th_order_aimfilter
- + (self.bot_4th_order_aimfilter - self.bot_5th_order_aimfilter) * bound(0, cvar("bot_ai_aimskill_order_filter_5th"),1);
+ + (self.bot_4th_order_aimfilter - self.bot_5th_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_5th,1);
//blend = (bound(0,skill,10)*0.1)*pow(1-bound(0,skill,10)*0.05,2.5)*5.656854249; //Plot formule before changing !
blend = bound(0,skill+self.bot_aimskill,10)*0.1;
desiredang = desiredang + blend *
(
- self.bot_1st_order_aimfilter * cvar("bot_ai_aimskill_order_mix_1st")
- + self.bot_2nd_order_aimfilter * cvar("bot_ai_aimskill_order_mix_2nd")
- + self.bot_3th_order_aimfilter * cvar("bot_ai_aimskill_order_mix_3th")
- + self.bot_4th_order_aimfilter * cvar("bot_ai_aimskill_order_mix_4th")
- + self.bot_5th_order_aimfilter * cvar("bot_ai_aimskill_order_mix_5th")
+ self.bot_1st_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_1st
+ + self.bot_2nd_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_2nd
+ + self.bot_3th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_3th
+ + self.bot_4th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_4th
+ + self.bot_5th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_5th
);
// calculate turn angles
diffang_y = diffang_y - floor(diffang_y / 360) * 360;
if (diffang_y >= 180)
diffang_y = diffang_y - 360;
- desiredang = desiredang + diffang * bound(0,cvar("bot_ai_aimskill_think"),1);
+ desiredang = desiredang + diffang * bound(0,autocvar_bot_ai_aimskill_think,1);
// calculate turn angles
diffang = desiredang - self.v_angle;
// turn
local float r, fixedrate, blendrate;
- fixedrate = cvar("bot_ai_aimskill_fixedrate") / bound(1,dist,1000);
- blendrate = cvar("bot_ai_aimskill_blendrate");
+ fixedrate = autocvar_bot_ai_aimskill_fixedrate / bound(1,dist,1000);
+ blendrate = autocvar_bot_ai_aimskill_blendrate;
r = max(fixedrate, blendrate);
//self.v_angle = self.v_angle + diffang * bound(frametime, r * frametime * (2+skill*skill*0.05-random()*0.05*(10-skill)), 1);
self.v_angle = self.v_angle + diffang * bound(delta_t, r * delta_t * (2+pow(skill+self.bot_mouseskill,3)*0.005-random()), 1);
- self.v_angle = self.v_angle * bound(0,cvar("bot_ai_aimskill_mouse"),1) + desiredang * bound(0,(1-cvar("bot_ai_aimskill_mouse")),1);
+ self.v_angle = self.v_angle * bound(0,autocvar_bot_ai_aimskill_mouse,1) + desiredang * bound(0,(1-autocvar_bot_ai_aimskill_mouse),1);
//self.v_angle = self.v_angle + diffang * bound(0, r * frametime * (skill * 0.5 + 2), 1);
//self.v_angle = self.v_angle + diffang * (1/ blendrate);
self.v_angle_z = 0;
shotdir = v_forward;
v = bot_shotlead(self.bot_aimtargorigin, self.bot_aimtargvelocity, shotspeed, self.bot_aimlatency);
local float distanceratio;
- distanceratio =sqrt(bound(0,skill,10000))*0.3*(vlen(v-shotorg)-100)/cvar("bot_ai_aimskill_firetolerance_distdegrees");
+ distanceratio =sqrt(bound(0,skill,10000))*0.3*(vlen(v-shotorg)-100)/autocvar_bot_ai_aimskill_firetolerance_distdegrees;
distanceratio = bound(0,distanceratio,1);
- r = (cvar("bot_ai_aimskill_firetolerance_maxdegrees")-cvar("bot_ai_aimskill_firetolerance_mindegrees"))
- * (1-distanceratio) + cvar("bot_ai_aimskill_firetolerance_mindegrees");
+ r = (autocvar_bot_ai_aimskill_firetolerance_maxdegrees-autocvar_bot_ai_aimskill_firetolerance_mindegrees)
+ * (1-distanceratio) + autocvar_bot_ai_aimskill_firetolerance_mindegrees;
if (applygravity && self.bot_aimtarg)
{
if (!findtrajectorywithleading(shotorg, '0 0 0', '0 0 0', self.bot_aimtarg, shotspeed, shotspeedupward, maxshottime, 0, self))
return;
self.flags &~= FL_GODMODE;
- if(cvar("bot_god"))
+ if(autocvar_bot_god)
self.flags |= FL_GODMODE;
- self.bot_nextthink = self.bot_nextthink + cvar("bot_ai_thinkinterval") * pow(0.5, self.bot_aiskill);
+ self.bot_nextthink = self.bot_nextthink + autocvar_bot_ai_thinkinterval * pow(0.5, self.bot_aiskill);
//if (self.bot_painintensity > 0)
// self.bot_painintensity = self.bot_painintensity - (skill + 1) * 40 * frametime;
//self.bot_painintensity = self.bot_painintensity + self.bot_oldhealth - self.health;
//self.bot_painintensity = bound(0, self.bot_painintensity, 100);
- if (cvar("g_campaign") && !campaign_bots_may_start)
+ if (autocvar_g_campaign && !campaign_bots_may_start)
{
self.nextthink = time + 0.5;
return;
string bot_name, bot_model, bot_skin, bot_shirt, bot_pants;
string name, prefix, suffix;
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
{
prefix = "";
suffix = "";
}
else
{
- prefix = cvar_string("bot_prefix");
- suffix = cvar_string("bot_suffix");
+ prefix = autocvar_bot_prefix;
+ suffix = autocvar_bot_suffix;
}
- file = fopen(cvar_string("bot_config_file"), FILE_READ);
+ file = fopen(autocvar_bot_config_file, FILE_READ);
if(file < 0)
- print(strcat("Error: Can not open the bot configuration file '",cvar_string("bot_config_file"),"'\n"));
+ print(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
else
{
RandomSelection_Init();
prio = 6;
- #define READSKILL(f,w,r) if(argv(prio) != "") self.f = stof(argv(prio)) * (w); else self.f = (!cvar("g_campaign")) * (2 * random() - 1) * (r) * (w); ++prio
+ #define READSKILL(f,w,r) if(argv(prio) != "") self.f = stof(argv(prio)) * (w); else self.f = (!autocvar_g_campaign) * (2 * random() - 1) * (r) * (w); ++prio
//print(bot_name, ": ping=", argv(9), "\n");
READSKILL(havocbot_keyboardskill, 0.5, 0.5); // keyboard skill
self.bot_preferredcolors = self.clientcolors;
// pick the name
- if (cvar("bot_usemodelnames"))
+ if (autocvar_bot_usemodelnames)
name = bot_model;
else
name = bot_name;
bot_custom_weapon = FALSE;
- if( cvar_string("bot_ai_custom_weapon_priority_far") == "" ||
- cvar_string("bot_ai_custom_weapon_priority_mid") == "" ||
- cvar_string("bot_ai_custom_weapon_priority_close") == "" ||
- cvar_string("bot_ai_custom_weapon_priority_distances") == ""
+ if( autocvar_bot_ai_custom_weapon_priority_far == "" ||
+ autocvar_bot_ai_custom_weapon_priority_mid == "" ||
+ autocvar_bot_ai_custom_weapon_priority_close == "" ||
+ autocvar_bot_ai_custom_weapon_priority_distances == ""
)
return;
// Parse distances
- tokens = tokenizebyseparator(cvar_string("bot_ai_custom_weapon_priority_distances")," ");
+ tokens = tokenizebyseparator(autocvar_bot_ai_custom_weapon_priority_distances," ");
if (tokens!=2)
return;
bot_weapons_close[0] = -1;
// Parse far distance weapon priorities
- tokens = tokenizebyseparator(W_NumberWeaponOrder(cvar_string("bot_ai_custom_weapon_priority_far"))," ");
+ tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_far)," ");
c = 0;
for(i=0; i < tokens && c < WEP_COUNT; ++i){
bot_weapons_far[c] = -1;
// Parse mid distance weapon priorities
- tokens = tokenizebyseparator(W_NumberWeaponOrder(cvar_string("bot_ai_custom_weapon_priority_mid"))," ");
+ tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_mid)," ");
c = 0;
for(i=0; i < tokens && c < WEP_COUNT; ++i){
bot_weapons_mid[c] = -1;
// Parse close distance weapon priorities
- tokens = tokenizebyseparator(W_NumberWeaponOrder(cvar_string("bot_ai_custom_weapon_priority_close"))," ");
+ tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_close)," ");
c = 0;
for(i=0; i < tokens && i < WEP_COUNT; ++i){
}
else if(bestbot <= bestplayer * factor - 2)
{
- if(cvar("skill") < 17)
+ if(autocvar_skill < 17)
{
dprint("2 frags difference, increasing skill\n");
- cvar_set("skill", ftos(cvar("skill") + 1));
- bprint("^2SKILL UP!^7 Now at level ", ftos(cvar("skill")), "\n");
+ cvar_set("skill", ftos(autocvar_skill + 1));
+ bprint("^2SKILL UP!^7 Now at level ", ftos(autocvar_skill), "\n");
}
}
else if(bestbot >= bestplayer * factor + 2)
{
- if(cvar("skill") > 0)
+ if(autocvar_skill > 0)
{
dprint("2 frags difference, decreasing skill\n");
- cvar_set("skill", ftos(cvar("skill") - 1));
- bprint("^1SKILL DOWN!^7 Now at level ", ftos(cvar("skill")), "\n");
+ cvar_set("skill", ftos(autocvar_skill - 1));
+ bprint("^1SKILL DOWN!^7 Now at level ", ftos(autocvar_skill), "\n");
}
}
else
if (time < 2)
return;
- stepheightvec = cvar("sv_stepheight") * '0 0 1';
- bot_navigation_movemode = ((cvar("bot_navigation_ignoreplayers")) ? MOVE_NOMONSTERS : MOVE_NORMAL);
+ stepheightvec = autocvar_sv_stepheight * '0 0 1';
+ bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
if(time > autoskill_nextthink)
{
float a;
- a = cvar("skill_auto");
+ a = autocvar_skill_auto;
if(a)
autoskill(a);
autoskill_nextthink = time + 5;
// But don't remove bots immediately on level change, as the real players
// usually haven't rejoined yet
bots_would_leave = FALSE;
- if (teamplay && cvar("bot_vs_human") && (c3==-1 && c4==-1))
- bots = min(ceil(fabs(cvar("bot_vs_human")) * activerealplayers), maxclients - realplayers);
- else if ((realplayers || cvar("bot_join_empty") || (currentbots > 0 && time < 5)))
+ if (teams_matter && autocvar_bot_vs_human && (c3==-1 && c4==-1))
+ bots = min(ceil(fabs(autocvar_bot_vs_human) * activerealplayers), maxclients - realplayers);
+ else if ((realplayers || autocvar_bot_join_empty || (currentbots > 0 && time < 5)))
{
float realminplayers, minplayers;
- realminplayers = cvar("minplayers");
+ realminplayers = autocvar_minplayers;
minplayers = max(0, floor(realminplayers));
float realminbots, minbots;
- realminbots = cvar("bot_number");
+ realminbots = autocvar_bot_number;
minbots = max(0, floor(realminbots));
bots = min(max(minbots, minplayers - activerealplayers), maxclients - realplayers);
bots = 0;
}
- bot_ignore_bots = cvar("bot_ignore_bots");
+ bot_ignore_bots = autocvar_bot_ignore_bots;
// only add one bot per frame to avoid utter chaos
if(time > botframe_nextthink)
if(botframe_spawnedwaypoints)
{
- if(cvar("waypoint_benchmark"))
+ if(autocvar_waypoint_benchmark)
localcmd("quit\n");
}
- if (currentbots > 0 || cvar("g_waypointeditor"))
+ if (currentbots > 0 || autocvar_g_waypointeditor)
if (botframe_spawnedwaypoints)
{
if(botframe_cachedwaypointlinks)
if (botframe_nextdangertime < time)
{
local float interval;
- interval = cvar("bot_ai_dangerdetectioninterval");
+ interval = autocvar_bot_ai_dangerdetectioninterval;
if (botframe_nextdangertime < time - interval * 1.5)
botframe_nextdangertime = time;
botframe_nextdangertime = botframe_nextdangertime + interval;
- botframe_updatedangerousobjects(cvar("bot_ai_dangerdetectionupdates"));
+ botframe_updatedangerousobjects(autocvar_bot_ai_dangerdetectionupdates);
}
}
- if (cvar("g_waypointeditor"))
+ if (autocvar_g_waypointeditor)
botframe_showwaypointlinks();
if(time > bot_cvar_nextthink)
* Imports
*/
-float sv_maxspeed;
-
void() havocbot_setupbot;
float c1, c2, c3, c4;
havocbot_chooseenemy();
if (self.bot_chooseweapontime < time )
{
- self.bot_chooseweapontime = time + cvar("bot_ai_chooseweaponinterval");
+ self.bot_chooseweapontime = time + autocvar_bot_ai_chooseweaponinterval;
havocbot_chooseweapon();
}
havocbot_aim();
if(self.weapons)
{
weapon_action(self.weapon, WR_AIM);
- if (cvar("bot_nofire") || IS_INDEPENDENT_PLAYER(self))
+ if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
{
self.BUTTON_ATCK = FALSE;
self.BUTTON_ATCK2 = FALSE;
next = self.goalstack01.origin - (self.origin + self.view_ofs);
skillblend=bound(0,(skill+self.bot_moveskill-2.5)*0.5,1); //lower skill player can't preturn
- distanceblend=bound(0,aimdistance/cvar("bot_ai_keyboard_distance"),1);
+ distanceblend=bound(0,aimdistance/autocvar_bot_ai_keyboard_distance,1);
blend = skillblend * (1-distanceblend);
//v = (now * (distanceblend) + next * (1-distanceblend)) * (skillblend) + now * (1-skillblend);
//v = now * (distanceblend) * (skillblend) + next * (1-distanceblend) * (skillblend) + now * (1-skillblend);
sk = skill + self.bot_moveskill;
- maxspeed = cvar("sv_maxspeed");
+ maxspeed = autocvar_sv_maxspeed;
if (time < self.havocbot_keyboardtime)
return;
local float trigger, trigger1;
blend = bound(0,sk*0.1,1);
- trigger = cvar("bot_ai_keyboard_treshold");
+ trigger = autocvar_bot_ai_keyboard_treshold;
trigger1 = 0 - trigger;
// categorize forward movement
if (self.havocbot_ducktime>time) self.BUTTON_CROUCH=TRUE;
keyboard = self.havocbot_keyboard;
- blend = bound(0,vlen(destorg-self.origin)/cvar("bot_ai_keyboard_distance"),1); // When getting close move with 360 degree
+ blend = bound(0,vlen(destorg-self.origin)/autocvar_bot_ai_keyboard_distance,1); // When getting close move with 360 degree
//dprint("movement ", vtos(self.movement), " keyboard ", vtos(keyboard), " blend ", ftos(blend), "\n");
self.movement = self.movement + (keyboard - self.movement) * blend;
};
local vector deviation;
local float maxspeed;
- if(cvar("g_midair"))
+ if(autocvar_g_midair)
return;
// Don't jump when using some weapons
if(self.goalcurrent.classname == "player")
return;
- maxspeed = cvar("sv_maxspeed");
+ maxspeed = autocvar_sv_maxspeed;
if(self.aistatus & AI_STATUS_DANGER_AHEAD)
{
if(self.bot_timelastseengoal)
{
// for a period of time
- if(time - self.bot_timelastseengoal > cvar("bot_ai_bunnyhop_firstjumpdelay"))
+ if(time - self.bot_timelastseengoal > autocvar_bot_ai_bunnyhop_firstjumpdelay)
{
local float checkdistance;
checkdistance = TRUE;
// don't run if it is too close
if(self.bot_canruntogoal==0)
{
- if(bunnyhopdistance > cvar("bot_ai_bunnyhop_startdistance"))
+ if(bunnyhopdistance > autocvar_bot_ai_bunnyhop_startdistance)
self.bot_canruntogoal = 1;
else
self.bot_canruntogoal = -1;
if(bunnyhopdistance < vlen(self.origin - self.goalstack01.origin))
if(fabs(self.goalstack01.origin_z - self.goalcurrent.origin_z) < self.maxs_z - self.mins_z)
{
- if(vlen(self.goalcurrent.origin - self.goalstack01.origin) > cvar("bot_ai_bunnyhop_startdistance"))
+ if(vlen(self.goalcurrent.origin - self.goalstack01.origin) > autocvar_bot_ai_bunnyhop_startdistance)
if(checkpvs(self.origin + self.view_ofs, self.goalstack01))
{
checkdistance = FALSE;
if(checkdistance)
{
self.aistatus &~= AI_STATUS_RUNNING;
- if(bunnyhopdistance > cvar("bot_ai_bunnyhop_stopdistance"))
+ if(bunnyhopdistance > autocvar_bot_ai_bunnyhop_stopdistance)
self.BUTTON_JUMP = TRUE;
}
else
//if (self.goalentity)
// te_lightning2(self, self.origin, (self.goalentity.absmin + self.goalentity.absmax) * 0.5);
self.movement = '0 0 0';
- maxspeed = cvar("sv_maxspeed");
+ maxspeed = autocvar_sv_maxspeed;
// Jetpack navigation
if(self.goalcurrent)
dxy = self.origin - self.goalcurrent.origin; dxy_z = 0;
d = vlen(dxy);
v = vlen(self.velocity - self.velocity_z * '0 0 1');
- db = (pow(v,2) / (cvar("g_jetpack_acceleration_side") * 2)) + 100;
+ db = (pow(v,2) / (autocvar_g_jetpack_acceleration_side * 2)) + 100;
// dprint("distance ", ftos(ceil(d)), " velocity ", ftos(ceil(v)), " brake at ", ftos(ceil(db)), "\n");
if(d < db || d < 500)
{
if(newgoal)
{
self.ignoregoal = self.goalcurrent;
- self.ignoregoaltime = time + cvar("bot_ai_ignoregoal_timeout");
+ self.ignoregoaltime = time + autocvar_bot_ai_ignoregoal_timeout;
navigation_clearroute();
navigation_routetogoal(newgoal, self.origin);
self.aistatus &~= AI_STATUS_OUT_JUMPPAD;
return;
}
- else if(self.health>cvar("g_balance_rocketlauncher_damage")*0.5)
+ else if(self.health>autocvar_g_balance_rocketlauncher_damage*0.5)
{
if(self.velocity_z < 0)
if(client_hasweapon(self, WEP_ROCKET_LAUNCHER, TRUE, FALSE))
self.switchweapon = WEP_ROCKET_LAUNCHER;
self.v_angle_x = 90;
self.BUTTON_ATCK = TRUE;
- self.rocketjumptime = time + cvar("g_balance_rocketlauncher_detonatedelay");
+ self.rocketjumptime = time + autocvar_g_balance_rocketlauncher_detonatedelay;
return;
}
}
if(self.facingwalltime && time > self.facingwalltime)
{
self.ignoregoal = self.goalcurrent;
- self.ignoregoaltime = time + cvar("bot_ai_ignoregoal_timeout");
+ self.ignoregoaltime = time + autocvar_bot_ai_ignoregoal_timeout;
self.bot_strategytime = 0;
return;
}
// Bunnyhop!
// if(self.aistatus & AI_STATUS_ROAMING)
if(self.goalcurrent)
- if(skill+self.bot_moveskill >= cvar("bot_ai_bunnyhop_skilloffset"))
+ if(skill+self.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset)
havocbot_bunnyhop(dir);
- if ((dir * v_up) >= cvar("sv_jumpvelocity")*0.5 && (self.flags & FL_ONGROUND)) self.BUTTON_JUMP=1;
+ if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (self.flags & FL_ONGROUND)) self.BUTTON_JUMP=1;
if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.BUTTON_JUMP=TRUE;
if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.havocbot_ducktime=time+0.3/bound(0.1,skill+self.bot_dodgeskill,10);
};
local entity head, best, head2;
local float rating, bestrating, i, f;
local vector eye, v;
- if (cvar("bot_nofire") || IS_INDEPENDENT_PLAYER(self))
+ if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
{
self.enemy = world;
return;
if (self.health > 30)
{
// remain tracking him for a shot while (case he went after a small corner or pilar
- self.havocbot_chooseenemy_finished = time + cvar("bot_ai_enemydetectioninterval");
+ self.havocbot_chooseenemy_finished = time + autocvar_bot_ai_enemydetectioninterval;
return;
}
// enemy isn't visible, or is far away, or we're injured severely
}
if (time < self.havocbot_chooseenemy_finished)
return;
- self.havocbot_chooseenemy_finished = time + cvar("bot_ai_enemydetectioninterval");
+ self.havocbot_chooseenemy_finished = time + autocvar_bot_ai_enemydetectioninterval;
eye = self.origin + self.view_ofs;
best = world;
bestrating = 100000000;
{
v = (head.absmin + head.absmax) * 0.5;
rating = vlen(v - eye);
- if (rating<cvar("bot_ai_enemydetectionradius"))
+ if (rating<autocvar_bot_ai_enemydetectionradius)
if (bestrating > rating)
if (bot_shouldattack(head))
{
// Workaround for rifle reloading (..)
if(self.weapon == WEP_CAMPINGRIFLE)
- if(i < cvar("g_balance_campingrifle_reloadtime") + 1)
+ if(i < autocvar_g_balance_campingrifle_reloadtime + 1)
return;
local float w;
local float af, ct, combo_time, combo;
af = ATTACK_FINISHED(self);
- ct = cvar("bot_ai_weapon_combo_threshold");
+ ct = autocvar_bot_ai_weapon_combo_threshold;
// Bots with no skill will be 4 times more slower than "godlike" bots when doing weapon combos
// Ideally this 4 should be calculated as longest_weapon_refire / bot_ai_weapon_combo_threshold
combo = FALSE;
- if(cvar("bot_ai_weapon_combo"))
+ if(autocvar_bot_ai_weapon_combo)
if(self.weapon == self.lastfiredweapon)
if(af > combo_time)
{
}
}
}
-
-#ifdef 0
- // TODO: This disabled code is not working well and got replaced by custom weapon priorities.
- // However, this logic should be refactored and moved to weapons code so each new weapon can be
- // evaluated dynamically by bots without updating the "ai" or config files. --mand1nga
- float s, distancefromfloor, currentscore;
-
-
- // Formula:
- // (Damage/Sec * Weapon spefic change to get that damage)
- // *(Time to get to target * weapon specfic hitchange bonus) / (in a time of maxdelaytime)
- // *(Spread change of hit) // if it applies
- // *(Penality for target beeing in air)
- // %weaponaddpoint
-
- traceline(self.enemy.origin,self.enemy.origin-'0 0 1000',TRUE,world);
- distancefromfloor = self.enemy.origin_z - trace_endpos_z;
-
- if (client_hasweapon(self, WEP_MINSTANEX, TRUE, FALSE))
- minstanex = (1000/cvar("g_balance_minstanex_refire")*1.0)
- * (0.5);
-
- if (client_hasweapon(self, WEP_ROCKET_LAUNCHER, TRUE, FALSE) &&
- !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_ROCKET_LAUNCHER &&
- af > combo_time
- )
- )
- rocket = (cvar("g_balance_rocketlauncher_damage")/cvar("g_balance_rocketlauncher_refire")*0.75)
- * bound(0,(cvar("g_balance_rocketlauncher_speed")/distance*maxdelaytime),1)*1.5;
-
- if (client_hasweapon(self, WEP_NEX, TRUE, FALSE) &&
- !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_NEX &&
- af > combo_time
- )
- )
- nex = (cvar("g_balance_nex_damage")/cvar("g_balance_nex_refire")*1.0)
- * (0.5);
-
- if (client_hasweapon(self, WEP_HAGAR, TRUE, FALSE) ) // &&
- // !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_HAGAR && time < self.bot_lastshot + cvar("g_balance_hagar_primary_refire") ))
- hagar = (cvar("g_balance_hagar_primary_damage")/cvar("g_balance_hagar_primary_refire")*1.0)
- * bound(0,(cvar("g_balance_hagar_primary_speed")/distance*maxdelaytime),1)*0.2;
-
- if (client_hasweapon(self, WEP_GRENADE_LAUNCHER, TRUE, FALSE) &&
- !(
- cvar("bot_ai_weapon_combo") && self.weapon == WEP_GRENADE_LAUNCHER &&
- af > combo_time
- )
- )
- grenade = (cvar("g_balance_grenadelauncher_primary_damage")/cvar("g_balance_grenadelauncher_primary_refire")*1.0)
- * bound(0,(cvar("g_balance_grenadelauncher_primary_speed")/distance*maxdelaytime),1)*1.1;
-
- if (client_hasweapon(self, WEP_MINE_LAYER, TRUE, FALSE) &&
- !(
- cvar("bot_ai_weapon_combo") && self.weapon == WEP_MINE_LAYER &&
- af > combo_time
- )
- )
- mine = (cvar("g_balance_minelayer_damage")/cvar("g_balance_minelayer_refire")*1.0)
- * bound(0,(cvar("g_balance_minelayer_speed")/distance*maxdelaytime),1)*1.1;
-
- if (client_hasweapon(self, WEP_ELECTRO, TRUE, FALSE) &&
- !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_ELECTRO &&
- af > combo_time
- )
- )
- electro = (cvar("g_balance_electro_primary_damage")/cvar("g_balance_electro_primary_refire")*0.75)
- * bound(0,(cvar("g_balance_electro_primary_speed")/distance*maxdelaytime),1)*1.0;
-
- if (client_hasweapon(self, WEP_CRYLINK, TRUE, FALSE) ) // &&
- // !( self.weapon == WEP_CRYLINK && time < self.bot_lastshot + cvar("g_balance_crylink_primary_refire") ))
- crylink = (cvar("g_balance_crylink_primary_damage")/cvar("g_balance_crylink_primary_refire")*1.0)
- * bound(0,(cvar("g_balance_crylink_primary_speed")/distance*maxdelaytime),1)*(64/(32+cvar("g_balance_crylink_primary_spread")*distance))*1.0;
-
- if (client_hasweapon(self, WEP_UZI, TRUE, FALSE) ) // &&
- // !( self.weapon == WEP_UZI && time < self.bot_lastshot + cvar("g_balance_uzi_sustained_refire") ))
- uzi = (cvar("g_balance_uzi_sustained_damage")/cvar("g_balance_uzi_sustained_refire")*1.0)
- * bound(0,32/(32+cvar("g_balance_uzi_sustained_spread")*distance),1);
-
- if (client_hasweapon(self, WEP_SHOTGUN, TRUE, FALSE) &&
- !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_SHOTGUN &&
- af > combo_time
- )
- )
- shotgun = (cvar("g_balance_shotgun_primary_damage")*cvar("g_balance_shotgun_primary_bullets")/cvar("g_balance_shotgun_primary_refire")*1.0)
- * bound(0,32/(32+cvar("g_balance_shotgun_primary_spread")*distance),1);
-
- if (client_hasweapon(self, WEP_LASER, FALSE, FALSE) &&
- !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_LASER &&
- af > combo_time
- )
- )
- laser = (cvar("g_balance_laser_primary_damage")/cvar("g_balance_laser_primary_refire")*1.0)
- * bound(0,cvar("g_balance_laser_primary_speed")/distance*maxdelaytime,1);
-
- if((self.enemy.flags & FL_ONGROUND)==FALSE){
- rocket = rocket * (1.5-bound(0, distancefromfloor/cvar("g_balance_rocketlauncher_radius" ),0.9)); //slight bigger change
- grenade = grenade * (1.5-bound(0,distancefromfloor/cvar("g_balance_grenadelauncher_primary_radius"),0.95));
- electro = electro * (1.5-bound(0,distancefromfloor/cvar("g_balance_electro_primary_radius" ),0.95));
- laser = laser * (1.5-bound(0,distancefromfloor/cvar("g_balance_laser_primary_radius" ),0.95));
- }
- /*
- dprint("Floor distance: ",ftos(distancefromfloor),"\n");
- dprint("Rocket: " , ftos(rocket ), "\n");
- dprint("Nex: " , ftos(nex ), "\n");
- dprint("Hagar: " , ftos(hagar ), "\n");
- dprint("Grenade: ", ftos(grenade ), "\n");
- dprint("Mine: " , ftos(mine ), "\n");
- dprint("Electro: ", ftos(electro ), "\n");
- dprint("Crylink: ", ftos(crylink ), "\n");
- dprint("Uzi: " , ftos(uzi ), "\n");
- dprint("Shotgun :", ftos(shotgun ), "\n");
- dprint("Laser :", ftos(laser ), "\n\n");
- */
- currentscore = -1;
- w = WEP_MINSTANEX ;s = minstanex;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_ROCKET_LAUNCHER ;s = rocket ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_NEX ;s = nex ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_HAGAR ;s = hagar ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_GRENADE_LAUNCHER ;s = grenade ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_MINE_LAYER ;s = mine ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_ELECTRO ;s = electro ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_CRYLINK ;s = crylink ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_UZI ;s = uzi ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_SHOTGUN ;s = shotgun ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_LASER ;s = laser ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-
- // switch if the best weapon would provide a significant damage increase
- if (bestscore > currentscore*1.5){
- self.switchweapon = bestweapon;
-
- // buys time for detonating the rocket. not tested yet
- if ( cvar("bot_ai_weapon_combo") && bestweapon == WEP_ROCKET_LAUNCHER )
- self.bot_chooseweapontime += (distance / cvar("g_balance_rocketlauncher_speed"));
- }
-#endif
};
void havocbot_aim()
if (head.owner != self)
{
vl = vlen(head.velocity);
- if (vl > sv_maxspeed * 0.3)
+ if (vl > autocvar_sv_maxspeed * 0.3)
{
n = normalize(head.velocity);
v = self.origin - head.origin;
if (self.bot_strategytime < time)
{
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
havocbot_goalrating_ctf_ourbase(50000);
// Chase the flag carrier
if (self.bot_strategytime < time)
{
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
havocbot_goalrating_ctf_enemyflag(30000);
havocbot_goalrating_ctf_ourstolenflag(40000);
if (self.bot_strategytime < time)
{
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
havocbot_goalrating_ctf_ourstolenflag(50000);
havocbot_goalrating_ctf_enemybase(20000);
local float radius;
radius = 10000;
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
havocbot_goalrating_ctf_ourstolenflag(50000);
havocbot_goalrating_ctf_droppedflags(40000, self.origin, radius);
org = havocbot_ctf_middlepoint;
org_z = self.origin_z;
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
havocbot_goalrating_ctf_ourstolenflag(50000);
havocbot_goalrating_ctf_droppedflags(30000, self.origin, 10000);
org = mf.dropped_origin;
radius = havocbot_ctf_middlepoint_radius;
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
// if enemies are closer to our base, go there
if (self.bot_strategytime < time)
{
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
if(kh_Key_AllOwnedByWhichTeam() == self.team)
if (self.bot_strategytime < time)
{
float key_owner_team;
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
key_owner_team = kh_Key_AllOwnedByWhichTeam();
{
float key_owner_team;
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
key_owner_team = kh_Key_AllOwnedByWhichTeam();
{
float key_owner_team;
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
key_owner_team = kh_Key_AllOwnedByWhichTeam();
needarmor = TRUE;
// Needs weapons?
- for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+ for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
{
// Find weapon
if(power2of(i-1) & self.weapons)
havocbot_goalrating_ons_offenseitems(10000, self.origin, 10000);
navigation_goalrating_end();
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
}
};
// Rate the item only if no one needs it, or if an enemy is closer to it
if ( (enemy_distance < friend_distance && distance < enemy_distance) ||
- (friend_distance > cvar("bot_ai_friends_aware_pickup_radius") ) || !discard )
+ (friend_distance > autocvar_bot_ai_friends_aware_pickup_radius ) || !discard )
rating = head.bot_pickupevalfunc(self, head);
}
local float t, noteam, distance;
noteam = ((self.team == 0) || !teams_matter); // fteqcc sucks
- if (cvar("bot_nofire"))
+ if (autocvar_bot_nofire)
return;
// don't chase players if we're under water
if (self.bot_strategytime < time)
{
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
havocbot_goalrating_controlpoints(10000, self.origin, 15000);
havocbot_goalrating_items(8000, self.origin, 8000);
if (self.bot_strategytime < time)
{
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
havocbot_goalrating_items(10000, self.origin, 10000);
havocbot_goalrating_enemyplayers(20000, self.origin, 10000);
entity e;
if (self.bot_strategytime < time)
{
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
/*
havocbot_goalrating_items(100, self.origin, 10000);
if (self.bot_strategytime < time)
{
- self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start();
havocbot_goalrating_items(10000, self.origin, 10000);
havocbot_goalrating_enemyplayers(20000, self.origin, 10000);
// Evaluate path using jetpack
if(g_jetpack)
if(self.items & IT_JETPACK)
- if(cvar("bot_ai_navigation_jetpack"))
- if(vlen(self.origin - e.origin) > cvar("bot_ai_navigation_jetpack_mindistance"))
+ if(autocvar_bot_ai_navigation_jetpack)
+ if(vlen(self.origin - e.origin) > autocvar_bot_ai_navigation_jetpack_mindistance)
{
vector pointa, pointb;
xydistance = vlen(pointa - pointb);
zdistance = fabs(pointa_z - self.origin_z);
- t = zdistance / cvar("g_jetpack_maxspeed_up");
- t += xydistance / cvar("g_jetpack_maxspeed_side");
- fuel = t * cvar("g_jetpack_fuel") * 0.8;
+ t = zdistance / autocvar_g_jetpack_maxspeed_up;
+ t += xydistance / autocvar_g_jetpack_maxspeed_side;
+ fuel = t * autocvar_g_jetpack_fuel * 0.8;
// dprint("jetpack ai: required fuel ", ftos(fuel), " self.ammo_fuel ", ftos(self.ammo_fuel),"\n");
// (as onground costs calculation is mostly based on distances, here we do the same establishing some relationship
// - between air and ground speeds)
- cost = xydistance / (cvar("g_jetpack_maxspeed_side")/cvar("sv_maxspeed"));
- cost += zdistance / (cvar("g_jetpack_maxspeed_up")/cvar("sv_maxspeed"));
+ cost = xydistance / (autocvar_g_jetpack_maxspeed_side/autocvar_sv_maxspeed);
+ cost += zdistance / (autocvar_g_jetpack_maxspeed_up/autocvar_sv_maxspeed);
cost *= 1.5;
// Compare against other goals
return FALSE;
if(self.bot_cmd_keys & BOT_CMD_KEY_FORWARD)
- self.movement_x = cvar("sv_maxspeed");
+ self.movement_x = autocvar_sv_maxspeed;
else if(self.bot_cmd_keys & BOT_CMD_KEY_BACKWARD)
- self.movement_x = -cvar("sv_maxspeed");
+ self.movement_x = -autocvar_sv_maxspeed;
if(self.bot_cmd_keys & BOT_CMD_KEY_RIGHT)
- self.movement_y = cvar("sv_maxspeed");
+ self.movement_y = autocvar_sv_maxspeed;
else if(self.bot_cmd_keys & BOT_CMD_KEY_LEFT)
- self.movement_y = -cvar("sv_maxspeed");
+ self.movement_y = -autocvar_sv_maxspeed;
if(self.bot_cmd_keys & BOT_CMD_KEY_JUMP)
self.BUTTON_JUMP = TRUE;
}
else
{
- if(cvar("g_debug_bot_commands"))
+ if(autocvar_g_debug_bot_commands)
{
local string parms;
}
else
{
- if(cvar("developer"))
+ if(autocvar_developer)
{
print("A generated waypoint is stuck in solid at ", vtos(w.origin), "\n");
backtrace("Waypoint stuck");
waypoint_clearlinks(w);
//waypoint_schedulerelink(w);
- if (cvar("g_waypointeditor"))
+ if (autocvar_g_waypointeditor)
{
m1 = w.mins;
m2 = w.maxs;
local entity e;
local vector sv, sm1, sm2, ev, em1, em2, dv;
- stepheightvec = cvar("sv_stepheight") * '0 0 1';
- bot_navigation_movemode = ((cvar("bot_navigation_ignoreplayers")) ? MOVE_NOMONSTERS : MOVE_NORMAL);
+ stepheightvec = autocvar_sv_stepheight * '0 0 1';
+ bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
//dprint("waypoint_think wpisbox = ", ftos(self.wpisbox), "\n");
sm1 = self.origin + self.mins;
if (wp == world)
return;
// TODO: add some sort of visible box in edit mode for box waypoints
- if (cvar("g_waypointeditor"))
+ if (autocvar_g_waypointeditor)
{
local vector m1, m2;
m1 = wp.mins;
{
float baseskill;
string title;
- if(cvar("sv_cheats"))
+ if(autocvar_sv_cheats)
{
CampaignBailout("JOLLY CHEATS AHAHAHAHAHAHAH))");
return;
}
- campaign_level = cvar("_campaign_index");
- campaign_name = strzone(cvar_string("_campaign_name"));
+ campaign_level = autocvar__campaign_index;
+ campaign_name = strzone(autocvar__campaign_name);
campaign_index_var = strzone(strcat("g_campaign", campaign_name, "_index"));
CampaignFile_Load(campaign_level, 2);
if(campaign_entries < 1)
return;
}
- baseskill = cvar("g_campaign_skill");
+ baseskill = autocvar_g_campaign_skill;
baseskill = baseskill + campaign_botskill[0];
if(baseskill < 0)
baseskill = 0;
// copy sv_gravity cvar, as the engine needs it too (sorry, this will mess
// with the menu a little still...)
- cvar_set_normal("sv_gravity", cvar_string("sv_gravity"));
+ cvar_set_normal("sv_gravity", ftos(autocvar_sv_gravity));
if(Campaign_Invalid())
return;
if(won == 1 && lost == 0 && checkrules_equality == 0 && cheatcount_total == 0)
{
- if(cvar("timelimit") != 0 && cvar("fraglimit") != 0 && time > cvar("timelimit") * 60) // checks if the timelimit has expired.
+ if(autocvar_timelimit != 0 && autocvar_fraglimit != 0 && time > autocvar_timelimit * 60) // checks if the timelimit has expired.
{
campaign_won = 0;
bprint("Time's up! The current level has been LOST.\n");
// sound!
}
}
- else if(cvar("timelimit") != 0 && time > cvar("timelimit") * 60)
+ else if(autocvar_timelimit != 0 && time > autocvar_timelimit * 60)
{
campaign_won = 0;
bprint("Time's up! The current level has been LOST.\n");
#else
.float maycheat;
-float sv_cheats;
+float gamestart_sv_cheats;
#define CHIMPULSE_SPEEDRUN_INIT 30
#define CHIMPULSE_GIVE_ALL 99
void CheatInit()
{
- sv_cheats = cvar("sv_cheats");
+ gamestart_sv_cheats = autocvar_sv_cheats;
}
void CheatShutdown()
return 1;
// sv_cheats
- if(sv_cheats && autocvar_sv_cheats)
+ if(gamestart_sv_cheats && autocvar_sv_cheats)
return 1;
// if we get here, player is not allowed to cheat. Log it.
self.health = start_health;
self.armorvalue = start_armorvalue;
self.weapons |= weaponsInMap;
- self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
- self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
- self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");
- self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
+ self.pauserotarmor_finished = time + autocvar_g_balance_pause_armor_rot_spawn;
+ self.pauserothealth_finished = time + autocvar_g_balance_pause_health_rot_spawn;
+ self.pauserotfuel_finished = time + autocvar_g_balance_pause_fuel_rot_spawn;
+ self.pauseregen_finished = time + autocvar_g_balance_pause_health_regen_spawn;
self.strength_finished = 0;
self.invincible_finished = 0;
}
break;
case CHIMPULSE_TELEPORT:
IS_CHEAT(i, 0, 0);
- if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((sv_cheats >= 2) ? 100000 : 100), 1024, 256))
+ if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((gamestart_sv_cheats >= 2) ? 100000 : 100), 1024, 256))
{
self.angles_x = -self.angles_x;
self.fixangle = TRUE;
break;
case "warp":
IS_CHEAT(0, argc, 0);
- if(argc == 2) if(cvar("g_campaign"))
+ if(argc == 2) if(autocvar_g_campaign)
{
CampaignLevelWarp(stof(argv(1)));
DID_CHEAT();
+float autocvar_sv_cheats; // must... declare... global
+
float cheatcount_total;
.float cheatcount;
void CheatInit();
msg_entity = e;
WriteByte(MSG_ONE, SVC_TEMPENTITY);
WriteByte(MSG_ONE, TE_CSQC_CR_MAXBULLETS);
- WriteByte(MSG_ONE, cvar("g_balance_campingrifle_magazinecapacity"));
+ WriteByte(MSG_ONE, autocvar_g_balance_campingrifle_magazinecapacity);
}
void Announce(string snd) {
{
spot.spawnpoint_score = Spawn_Score(spot, playerlist, teamcheck, anypoint);
- if(cvar("spawn_debugview"))
+ if(autocvar_spawn_debugview)
{
setmodel(spot, "models/runematch/rune.mdl");
if(spot.spawnpoint_score_y < mindist)
firstspot = firstspot_new;
spot = Spawn_WeightedPoint(firstspot, 1, 1, 1);
}
- else if (random() > cvar("g_spawn_furthest"))
+ else if (random() > autocvar_g_spawn_furthest)
spot = Spawn_WeightedPoint(firstspot, 1, 1, 1);
else
spot = Spawn_WeightedPoint(firstspot, 1, 5000, 5); // chooses a far far away spawnpoint
}
- if(cvar("spawn_debugview"))
+ if(autocvar_spawn_debugview)
{
print("spot mindistance: ", vtos(spot.spawnpoint_score), "\n");
if (!spot)
{
- if(cvar("spawn_debug"))
+ if(autocvar_spawn_debug)
GotoNextMap();
else
{
return FallbackPlayerModel;
if( substring(plyermodel,0,14) != "models/player/")
return FallbackPlayerModel;
- else if(cvar("sv_servermodelsonly"))
+ else if(autocvar_sv_servermodelsonly)
{
if(substring(plyermodel,-4,4) != ".zym")
if(substring(plyermodel,-4,4) != ".dpm")
self.flags = FL_CLIENT | FL_NOTARGET;
self.armorvalue = 666;
self.effects = 0;
- self.armorvalue = cvar("g_balance_armor_start");
+ self.armorvalue = autocvar_g_balance_armor_start;
self.pauserotarmor_finished = 0;
self.pauserothealth_finished = 0;
self.pauseregen_finished = 0;
defaultmodel = "";
- if(cvar("sv_defaultcharacter") == 1) {
+ if(autocvar_sv_defaultcharacter == 1) {
defaultskin = 0;
if(teams_matter)
if(defaultmodel == "")
{
- defaultmodel = cvar_string("sv_defaultplayermodel");
- defaultskin = cvar("sv_defaultplayerskin");
+ defaultmodel = autocvar_sv_defaultplayermodel;
+ defaultskin = autocvar_sv_defaultplayerskin;
}
}
self.species = player_getspecies(); // model or skin has changed
if(!teams_matter)
- if(strlen(cvar_string("sv_defaultplayercolors")))
- if(self.clientcolors != cvar("sv_defaultplayercolors"))
- setcolor(self, cvar("sv_defaultplayercolors"));
+ if(strlen(autocvar_sv_defaultplayercolors))
+ if(self.clientcolors != stof(autocvar_sv_defaultplayercolors))
+ setcolor(self, stof(autocvar_sv_defaultplayercolors));
}
void PlayerTouchExplode(entity p1, entity p2)
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
- if(cvar("g_playerclip_collisions"))
+ if(autocvar_g_playerclip_collisions)
self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
- if(clienttype(self) == CLIENTTYPE_BOT && cvar("g_botclip_collisions"))
+ if(clienttype(self) == CLIENTTYPE_BOT && autocvar_g_botclip_collisions)
self.dphitcontentsmask |= DPCONTENTS_BOTCLIP;
self.frags = FRAGS_PLAYER;
if(independent_players)
self.effects = 0;
self.air_finished = time + 12;
self.dmg = 2;
- if(cvar("g_balance_nex_charge"))
+ if(autocvar_g_balance_nex_charge)
{
- if(cvar("g_balance_nex_secondary_charge_pool"))
- self.nex_charge_pool_ammo = 1;
- self.nex_charge = cvar("g_balance_nex_charge_start");
+ if(autocvar_g_balance_nex_secondary_chargepool)
+ self.nex_chargepool_ammo = 1;
+ self.nex_charge = autocvar_g_balance_nex_charge_start;
}
if(inWarmupStage)
self.items = start_items;
self.jump_interval = time;
- self.spawnshieldtime = time + cvar("g_spawnshieldtime");
- self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
- self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
- self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");
- self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
+ self.spawnshieldtime = time + autocvar_g_spawnshieldtime;
+ self.pauserotarmor_finished = time + autocvar_g_balance_pause_armor_rot_spawn;
+ self.pauserothealth_finished = time + autocvar_g_balance_pause_health_rot_spawn;
+ self.pauserotfuel_finished = time + autocvar_g_balance_pause_fuel_rot_spawn;
+ self.pauseregen_finished = time + autocvar_g_balance_pause_health_regen_spawn;
//extend the pause of rotting if client was reset at the beginning of the countdown
- if(!cvar("sv_ready_restart_after_countdown") && time < game_starttime) { // TODO why is this cvar NOTted?
+ if(!autocvar_sv_ready_restart_after_countdown && time < game_starttime) { // TODO why is this cvar NOTted?
self.spawnshieldtime += game_starttime - time;
self.pauserotarmor_finished += game_starttime - time;
self.pauserothealth_finished += game_starttime - time;
self.nextthink = 0;
self.hook_time = 0;
self.dmg_team = 0;
- self.ballistics_density = cvar("g_ballistics_density_player");
+ self.ballistics_density = autocvar_g_ballistics_density_player;
self.metertime = 0;
CL_SpawnWeaponentity();
self.alpha = default_player_alpha;
- self.colormod = '1 1 1' * cvar("g_player_brightness");
+ self.colormod = '1 1 1' * autocvar_g_player_brightness;
self.exteriorweaponentity.alpha = default_weapon_alpha;
- self.lms_nextcheck = time + cvar("g_lms_campcheck_interval")*2;
+ self.lms_nextcheck = time + autocvar_g_lms_campcheck_interval*2;
self.lms_traveled_distance = 0;
self.speedrunning = FALSE;
race_PostSpawn(spot);
- if(cvar("spawn_debug"))
+ if(autocvar_spawn_debug)
{
sprint(self, strcat("spawnpoint origin: ", vtos(spot.origin), "\n"));
remove(spot); // usefull for checking if there are spawnpoints, that let drop through the floor
//stuffcmd(self, "chase_active 0");
//stuffcmd(self, "set viewsize $tmpviewsize \n");
- if (cvar("g_spawnsound"))
+ if (autocvar_g_spawnsound)
sound (self, CHAN_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTN_NORM);
if(g_assault) {
WriteCoord(MSG_ENTITY, self.bouncestop); // g_balance_grenadelauncher_bouncestop
WriteCoord(MSG_ENTITY, self.ebouncefactor); // g_balance_grenadelauncher_bouncefactor
WriteCoord(MSG_ENTITY, self.ebouncestop); // g_balance_grenadelauncher_bouncestop
- WriteByte(MSG_ENTITY, cvar("g_balance_nex_secondary")); // client has to know if it should zoom or not
- WriteByte(MSG_ENTITY, cvar("g_balance_campingrifle_secondary")); // client has to know if it should zoom or not
+ WriteByte(MSG_ENTITY, autocvar_g_balance_nex_secondary); // client has to know if it should zoom or not
+ WriteByte(MSG_ENTITY, autocvar_g_balance_campingrifle_secondary); // client has to know if it should zoom or not
WriteByte(MSG_ENTITY, serverflags); // client has to know if it should zoom or not
return TRUE;
}
void ClientInit_CheckUpdate()
{
self.nextthink = time;
- if(self.count != cvar("g_balance_armor_blockpercent"))
+ if(self.count != autocvar_g_balance_armor_blockpercent)
{
- self.count = cvar("g_balance_armor_blockpercent");
+ self.count = autocvar_g_balance_armor_blockpercent;
self.SendFlags |= 1;
}
- if(self.cnt != cvar("g_balance_weaponswitchdelay"))
+ if(self.cnt != autocvar_g_balance_weaponswitchdelay)
{
- self.cnt = cvar("g_balance_weaponswitchdelay");
+ self.cnt = autocvar_g_balance_weaponswitchdelay;
self.SendFlags |= 1;
}
- if(self.bouncefactor != cvar("g_balance_grenadelauncher_bouncefactor"))
+ if(self.bouncefactor != autocvar_g_balance_grenadelauncher_bouncefactor)
{
- self.bouncefactor = cvar("g_balance_grenadelauncher_bouncefactor");
+ self.bouncefactor = autocvar_g_balance_grenadelauncher_bouncefactor;
self.SendFlags |= 1;
}
- if(self.bouncestop != cvar("g_balance_grenadelauncher_bouncestop"))
+ if(self.bouncestop != autocvar_g_balance_grenadelauncher_bouncestop)
{
- self.bouncestop = cvar("g_balance_grenadelauncher_bouncestop");
+ self.bouncestop = autocvar_g_balance_grenadelauncher_bouncestop;
self.SendFlags |= 1;
}
- if(self.ebouncefactor != cvar("g_balance_electro_secondary_bouncefactor"))
+ if(self.ebouncefactor != autocvar_g_balance_electro_secondary_bouncefactor)
{
- self.ebouncefactor = cvar("g_balance_electro_secondary_bouncefactor");
+ self.ebouncefactor = autocvar_g_balance_electro_secondary_bouncefactor;
self.SendFlags |= 1;
}
- if(self.ebouncestop != cvar("g_balance_electro_secondary_bouncestop"))
+ if(self.ebouncestop != autocvar_g_balance_electro_secondary_bouncestop)
{
- self.ebouncestop = cvar("g_balance_electro_secondary_bouncestop");
+ self.ebouncestop = autocvar_g_balance_electro_secondary_bouncestop;
self.SendFlags |= 1;
}
}
=============
*/
+.float clientkill_nexttime;
void ClientKill_Now_TeamChange()
{
if(self.killindicator_teamchange == -1)
self.team = -1;
JoinBestTeam( self, FALSE, FALSE );
}
+ else if(self.killindicator_teamchange == -2)
+ {
+ if(g_ca)
+ self.caplayer = 0;
+ if(blockSpectators)
+ sprint(self, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+ PutObserverInServer();
+ }
else
SV_ChangeTeam(self.killindicator_teamchange - 1);
}
void ClientKill_Now()
{
+ remove(self.killindicator);
+ self.killindicator = world;
+
if(self.killindicator_teamchange)
ClientKill_Now_TeamChange();
// in any case:
Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
- if(self.killindicator)
- {
- dprint("Cleaned up after a leaked kill indicator.\n");
- remove(self.killindicator);
- self.killindicator = world;
- }
+ // now I am sure the player IS dead
}
void KillIndicator_Think()
{
ClientKill_Now(); // no oldself needed
return;
}
+ else if(g_cts && self.health == 1) // health == 1 means that it's silent
+ {
+ self.nextthink = time + 1;
+ self.cnt -= 1;
+ }
else
{
if(self.cnt <= 10)
{
if(self.owner.killindicator_teamchange == -1)
centerprint(self.owner, strcat("Changing team in ", ftos(self.cnt), " seconds"));
+ else if(self.owner.killindicator_teamchange == -2)
+ centerprint(self.owner, strcat("Spectating in ", ftos(self.cnt), " seconds"));
else
centerprint(self.owner, strcat("Changing to ", ColoredTeamName(self.owner.killindicator_teamchange), " in ", ftos(self.cnt), " seconds"));
}
}
}
-void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto
+void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 = spec
{
float killtime;
entity e;
- killtime = cvar("g_balance_kill_delay");
+ killtime = autocvar_g_balance_kill_delay;
- if(g_race_qualifying)
+ if(g_race_qualifying || g_cts)
killtime = 0;
+ if(g_cts && self.killindicator && self.killindicator.health == 1) // self.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill
+ {
+ remove(self.killindicator);
+ self.killindicator = world;
+
+ ClientKill_Now(); // allow instant kill in this case
+ return;
+ }
+
self.killindicator_teamchange = targetteam;
- if(!self.killindicator)
+ if(!self.killindicator)
{
+ if(self.modelindex && self.deadflag == DEAD_NO)
+ {
+ killtime = max(killtime, self.clientkill_nexttime - time);
+ self.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
+ }
+
if(killtime <= 0 || !self.modelindex || self.deadflag != DEAD_NO)
{
ClientKill_Now();
}
if(self.killindicator)
{
- if(targetteam)
- self.killindicator.colormod = TeamColor(targetteam);
- else
+ if(targetteam == 0) // just die
self.killindicator.colormod = '0 0 0';
+ else if(targetteam == -1) // auto
+ self.killindicator.colormod = '0 1 0';
+ else if(targetteam == -2) // spectate
+ self.killindicator.colormod = '0.5 0.5 0.5';
+ else
+ self.killindicator.colormod = TeamColor(targetteam);
}
}
ClientKill_TeamChange(0);
}
-void CTS_ClientKill_Think (void)
+void CTS_ClientKill (entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed
{
- self = self.owner; // set self to the player to be killed
- sprint(self, "^1You were killed in order to prevent cheating!");
- ClientKill_Now();
-}
-
-void CTS_ClientKill (float t) // silent version of ClientKill
-{
- entity e;
- e = spawn();
- e.owner = self;
- e.think = CTS_ClientKill_Think;
- e.nextthink = t;
+ e.killindicator = spawn();
+ e.killindicator.owner = e;
+ e.killindicator.think = KillIndicator_Think;
+ e.killindicator.nextthink = time + (e.lip) * 0.05;
+ e.killindicator.cnt = ceil(autocvar_g_cts_finish_kill_delay);
+ e.killindicator.health = 1; // this is used to indicate that it should be silent
+ e.lip = 0;
}
void DoTeamChange(float destteam)
stuffcmd(e, "\nin_bindmap 0 0\n");
if(g_race || g_cts)
stuffcmd(e, "cl_cmd settemp cl_movecliptokeyboard 2\n");
- if(cvar("g_antilag") == 3) // client side hitscan
+ if(autocvar_g_antilag == 3) // client side hitscan
stuffcmd(e, "cl_cmd settemp cl_prydoncursor_notrace 0\n");
if(sv_gentle)
stuffcmd(e, "cl_cmd settemp cl_gentle 1\n");
/*
* we no longer need to stuff this. Remove this comment block if you feel
* 2.3 and higher (or was it 2.2.3?) don't need these any more
- stuffcmd(e, strcat("cl_gravity ", ftos(cvar("sv_gravity")), "\n"));
- stuffcmd(e, strcat("cl_movement_accelerate ", ftos(cvar("sv_accelerate")), "\n"));
- stuffcmd(e, strcat("cl_movement_friction ", ftos(cvar("sv_friction")), "\n"));
- stuffcmd(e, strcat("cl_movement_maxspeed ", ftos(cvar("sv_maxspeed")), "\n"));
- stuffcmd(e, strcat("cl_movement_airaccelerate ", ftos(cvar("sv_airaccelerate")), "\n"));
- stuffcmd(e, strcat("cl_movement_maxairspeed ", ftos(cvar("sv_maxairspeed")), "\n"));
- stuffcmd(e, strcat("cl_movement_stopspeed ", ftos(cvar("sv_stopspeed")), "\n"));
- stuffcmd(e, strcat("cl_movement_jumpvelocity ", ftos(cvar("sv_jumpvelocity")), "\n"));
- stuffcmd(e, strcat("cl_movement_stepheight ", ftos(cvar("sv_stepheight")), "\n"));
- stuffcmd(e, strcat("set cl_movement_friction_on_land ", ftos(cvar("sv_friction_on_land")), "\n"));
- stuffcmd(e, strcat("set cl_movement_airaccel_qw ", ftos(cvar("sv_airaccel_qw")), "\n"));
- stuffcmd(e, strcat("set cl_movement_airaccel_sideways_friction ", ftos(cvar("sv_airaccel_sideways_friction")), "\n"));
+ stuffcmd(e, strcat("cl_gravity ", ftos(autocvar_sv_gravity), "\n"));
+ stuffcmd(e, strcat("cl_movement_accelerate ", ftos(autocvar_sv_accelerate), "\n"));
+ stuffcmd(e, strcat("cl_movement_friction ", ftos(autocvar_sv_friction), "\n"));
+ stuffcmd(e, strcat("cl_movement_maxspeed ", ftos(autocvar_sv_maxspeed), "\n"));
+ stuffcmd(e, strcat("cl_movement_airaccelerate ", ftos(autocvar_sv_airaccelerate), "\n"));
+ stuffcmd(e, strcat("cl_movement_maxairspeed ", ftos(autocvar_sv_maxairspeed), "\n"));
+ stuffcmd(e, strcat("cl_movement_stopspeed ", ftos(autocvar_sv_stopspeed), "\n"));
+ stuffcmd(e, strcat("cl_movement_jumpvelocity ", ftos(autocvar_sv_jumpvelocity), "\n"));
+ stuffcmd(e, strcat("cl_movement_stepheight ", ftos(autocvar_sv_stepheight), "\n"));
+ stuffcmd(e, strcat("set cl_movement_friction_on_land ", ftos(autocvar_sv_friction_on_land), "\n"));
+ stuffcmd(e, strcat("set cl_movement_airaccel_qw ", ftos(autocvar_sv_airaccel_qw), "\n"));
+ stuffcmd(e, strcat("set cl_movement_airaccel_sideways_friction ", ftos(autocvar_sv_airaccel_sideways_friction), "\n"));
stuffcmd(e, "cl_movement_edgefriction 1\n");
*/
}
// dom_player_join_team(self);
// identify the right forced team
- if(PlayerInIDList(self, cvar_string("g_forced_team_red")))
+ if(autocvar_g_campaign)
+ {
+ if(clienttype(self) == CLIENTTYPE_REAL) // only players, not bots
+ {
+ switch(autocvar_g_campaign_forceteam)
+ {
+ case 1: self.team_forced = COLOR_TEAM1; break;
+ case 2: self.team_forced = COLOR_TEAM2; break;
+ case 3: self.team_forced = COLOR_TEAM3; break;
+ case 4: self.team_forced = COLOR_TEAM4; break;
+ default: self.team_forced = 0;
+ }
+ }
+ }
+ else if(PlayerInIDList(self, autocvar_g_forced_team_red))
self.team_forced = COLOR_TEAM1;
- else if(PlayerInIDList(self, cvar_string("g_forced_team_blue")))
+ else if(PlayerInIDList(self, autocvar_g_forced_team_blue))
self.team_forced = COLOR_TEAM2;
- else if(PlayerInIDList(self, cvar_string("g_forced_team_yellow")))
+ else if(PlayerInIDList(self, autocvar_g_forced_team_yellow))
self.team_forced = COLOR_TEAM3;
- else if(PlayerInIDList(self, cvar_string("g_forced_team_pink")))
+ else if(PlayerInIDList(self, autocvar_g_forced_team_pink))
self.team_forced = COLOR_TEAM4;
- else if(cvar_string("g_forced_team_otherwise") == "red")
+ else if(autocvar_g_forced_team_otherwise == "red")
self.team_forced = COLOR_TEAM1;
- else if(cvar_string("g_forced_team_otherwise") == "blue")
+ else if(autocvar_g_forced_team_otherwise == "blue")
self.team_forced = COLOR_TEAM2;
- else if(cvar_string("g_forced_team_otherwise") == "yellow")
+ else if(autocvar_g_forced_team_otherwise == "yellow")
self.team_forced = COLOR_TEAM3;
- else if(cvar_string("g_forced_team_otherwise") == "pink")
+ else if(autocvar_g_forced_team_otherwise == "pink")
self.team_forced = COLOR_TEAM4;
- else if(cvar_string("g_forced_team_otherwise") == "spectate")
+ else if(autocvar_g_forced_team_otherwise == "spectate")
self.team_forced = -1;
- else if(cvar_string("g_forced_team_otherwise") == "spectator")
+ else if(autocvar_g_forced_team_otherwise == "spectator")
self.team_forced = -1;
else
self.team_forced = 0;
JoinBestTeam(self, FALSE, FALSE); // if the team number is valid, keep it
- if((cvar("sv_spectate") == 1 && !g_lms) || cvar("g_campaign") || self.team_forced < 0) {
+ if((autocvar_sv_spectate == 1 && !g_lms) || autocvar_g_campaign || self.team_forced < 0) {
self.classname = "observer";
} else {
if(teams_matter)
{
- if(cvar("g_balance_teams") || cvar("g_balance_teams_force"))
+ if(autocvar_g_balance_teams || autocvar_g_balance_teams_force)
{
self.classname = "player";
campaign_bots_may_start = 1;
self.playerid = (playerid_last = playerid_last + 1);
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(strcat(":join:", ftos(self.playerid), ":", ftos(num_for_edict(self)), ":", ((clienttype(self) == CLIENTTYPE_REAL) ? self.netaddress : "bot"), ":", self.netname));
LogTeamchange(self.playerid, self.team, 1);
// get other cvars from player
GetCvars(0);
- // set cvar for team scoreboard
- stuffcmd(self, strcat("set teamplay ", ftos(teamplay), "\n"));
-
// notify about available teams
if(teams_matter)
{
self.spectatortime = time;
if(blockSpectators)
{
- sprint(self, strcat("^7You have to become a player within the next ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+ sprint(self, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
}
self.jointime = time;
- self.allowedTimeouts = cvar("sv_timeout_number");
+ self.allowedTimeouts = autocvar_sv_timeout_number;
if(clienttype(self) == CLIENTTYPE_REAL)
{
- if(cvar("g_bugrigs") || g_weaponarena == WEPBIT_TUBA)
+ if(autocvar_g_bugrigs || g_weaponarena == WEPBIT_TUBA)
stuffcmd(self, "cl_cmd settemp chase_active 1\n");
}
SoundEntity_Attach(self);
- if(cvar("g_hitplots") || strstrofs(strcat(" ", cvar_string("g_hitplots_individuals"), " "), strcat(" ", self.netaddress, " "), 0) >= 0)
+ if(autocvar_g_hitplots || strstrofs(strcat(" ", autocvar_g_hitplots_individuals, " "), strcat(" ", self.netaddress, " "), 0) >= 0)
{
self.hitplotfh = fopen(strcat("hits-", matchid, "-", self.netaddress, "-", ftos(self.playerid), ".plot"), FILE_WRITE);
fputs(self.hitplotfh, strcat("#name ", self.netname, "\n"));
race_SendRankings(i, 0, 0, MSG_ONE);
}
}
- else if(cvar("sv_teamnagger") && !(cvar("bot_vs_human") && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
+ else if(autocvar_sv_teamnagger && !(autocvar_bot_vs_human && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
send_CSQC_teamnagger();
send_CSQC_cr_maxbullets(self);
if(self.entcs)
detach_entcs();
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(strcat(":part:", ftos(self.playerid)));
bprint ("^4",self.netname);
bprint ("^4 disconnected\n");
.float oldcolormap;
void respawn(void)
{
- if(self.modelindex != 0 && cvar("g_respawn_ghosts"))
+ if(self.modelindex != 0 && autocvar_g_respawn_ghosts)
{
self.solid = SOLID_NOT;
self.takedamage = DAMAGE_NO;
self.movetype = MOVETYPE_FLY;
- self.velocity = '0 0 1' * cvar("g_respawn_ghosts_speed");
- self.avelocity = randomvec() * cvar("g_respawn_ghosts_speed") * 3 - randomvec() * cvar("g_respawn_ghosts_speed") * 3;
+ self.velocity = '0 0 1' * autocvar_g_respawn_ghosts_speed;
+ self.avelocity = randomvec() * autocvar_g_respawn_ghosts_speed * 3 - randomvec() * autocvar_g_respawn_ghosts_speed * 3;
self.effects |= EF_ADDITIVE;
self.oldcolormap = self.colormap;
self.colormap = 512;
pointparticles(particleeffectnum("respawn_ghost"), self.origin, '0 0 0', 1);
- if(cvar("g_respawn_ghosts_maxtime"))
- SUB_SetFade (self, time + cvar("g_respawn_ghosts_maxtime") / 2 + random () * (cvar("g_respawn_ghosts_maxtime") - cvar("g_respawn_ghosts_maxtime") / 2), 1.5);
+ if(autocvar_g_respawn_ghosts_maxtime)
+ SUB_SetFade (self, time + autocvar_g_respawn_ghosts_maxtime / 2 + random () * (autocvar_g_respawn_ghosts_maxtime - autocvar_g_respawn_ghosts_maxtime / 2), 1.5);
}
CopyBody(1);
* @param addOneSecond boolean, set to 1 if the welcome-message centerprint asks for the text
*/
string getTimeoutText(float addOneSecond) {
- if (!cvar("sv_timeout") || !timeoutStatus)
+ if (!autocvar_sv_timeout || !timeoutStatus)
return "";
local string retStr;
if((self.items & IT_USING_JETPACK) && !self.deadflag)
{
- SoundEntity_StartSound(self, CHAN_PLAYER, "misc/jetpack_fly.wav", VOL_BASE, cvar("g_jetpack_attenuation"));
+ SoundEntity_StartSound(self, CHAN_PLAYER, "misc/jetpack_fly.wav", VOL_BASE, autocvar_g_jetpack_attenuation);
self.modelflags |= MF_ROCKET;
}
else
if (self.items & IT_INVINCIBLE)
{
play_countdown(self.invincible_finished, "misc/poweroff.wav");
- if (time > self.invincible_finished && cvar("g_balance_powerup_timer"))
+ if (time > self.invincible_finished && autocvar_g_balance_powerup_timer)
{
self.items = self.items - (self.items & IT_INVINCIBLE);
sprint(self, "^3Speed has worn off\n");
{
play_countdown(self.strength_finished, "misc/poweroff.wav");
self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
- if (time > self.strength_finished && cvar("g_balance_powerup_timer"))
+ if (time > self.strength_finished && autocvar_g_balance_powerup_timer)
{
self.items = self.items - (self.items & IT_STRENGTH);
sprint(self, "^3Strength has worn off\n");
{
play_countdown(self.invincible_finished, "misc/poweroff.wav");
self.effects = self.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
- if (time > self.invincible_finished && cvar("g_balance_powerup_timer"))
+ if (time > self.invincible_finished && autocvar_g_balance_powerup_timer)
{
self.items = self.items - (self.items & IT_INVINCIBLE);
sprint(self, "^3Shield has worn off\n");
}
}
- if(cvar("g_nodepthtestplayers"))
+ if(autocvar_g_nodepthtestplayers)
self.effects = self.effects | EF_NODEPTHTEST;
- if(cvar("g_fullbrightplayers"))
+ if(autocvar_g_fullbrightplayers)
self.effects = self.effects | EF_FULLBRIGHT;
// midair gamemode: damage only while in the air
// remaining hits in the same frame)
if (self.flags & FL_ONGROUND)
if (g_midair)
- self.spawnshieldtime = max(self.spawnshieldtime, time + cvar("g_midair_shieldtime"));
+ self.spawnshieldtime = max(self.spawnshieldtime, time + autocvar_g_midair_shieldtime);
if (time >= game_starttime)
if (time < self.spawnshieldtime)
void player_regen (void)
{
float minh, mina, minf, maxh, maxa, maxf, limith, limita, limitf, max_mod, regen_mod, rot_mod, limit_mod;
- maxh = cvar("g_balance_health_rotstable");
- maxa = cvar("g_balance_armor_rotstable");
- maxf = cvar("g_balance_fuel_rotstable");
- minh = cvar("g_balance_health_regenstable");
- mina = cvar("g_balance_armor_regenstable");
- minf = cvar("g_balance_fuel_regenstable");
- limith = cvar("g_balance_health_limit");
- limita = cvar("g_balance_armor_limit");
- limitf = cvar("g_balance_fuel_limit");
+ maxh = autocvar_g_balance_health_rotstable;
+ maxa = autocvar_g_balance_armor_rotstable;
+ maxf = autocvar_g_balance_fuel_rotstable;
+ minh = autocvar_g_balance_health_regenstable;
+ mina = autocvar_g_balance_armor_regenstable;
+ minf = autocvar_g_balance_fuel_regenstable;
+ limith = autocvar_g_balance_health_limit;
+ limita = autocvar_g_balance_armor_limit;
+ limitf = autocvar_g_balance_fuel_limit;
max_mod = regen_mod = rot_mod = limit_mod = 1;
{
if (self.runes & CURSE_VENOM) // do we have both rune/curse?
{
- regen_mod = cvar("g_balance_rune_regen_combo_regenrate");
- max_mod = cvar("g_balance_rune_regen_combo_hpmod");
- limit_mod = cvar("g_balance_rune_regen_combo_limitmod");
+ regen_mod = autocvar_g_balance_rune_regen_combo_regenrate;
+ max_mod = autocvar_g_balance_rune_regen_combo_hpmod;
+ limit_mod = autocvar_g_balance_rune_regen_combo_limitmod;
}
else
{
- regen_mod = cvar("g_balance_rune_regen_regenrate");
- max_mod = cvar("g_balance_rune_regen_hpmod");
- limit_mod = cvar("g_balance_rune_regen_limitmod");
+ regen_mod = autocvar_g_balance_rune_regen_regenrate;
+ max_mod = autocvar_g_balance_rune_regen_hpmod;
+ limit_mod = autocvar_g_balance_rune_regen_limitmod;
}
}
else if (self.runes & CURSE_VENOM)
{
- max_mod = cvar("g_balance_curse_venom_hpmod");
+ max_mod = autocvar_g_balance_curse_venom_hpmod;
if (self.runes & RUNE_REGEN) // do we have both rune/curse?
- rot_mod = cvar("g_balance_rune_regen_combo_rotrate");
+ rot_mod = autocvar_g_balance_rune_regen_combo_rotrate;
else
- rot_mod = cvar("g_balance_curse_venom_rotrate");
- limit_mod = cvar("g_balance_curse_venom_limitmod");
+ rot_mod = autocvar_g_balance_curse_venom_rotrate;
+ limit_mod = autocvar_g_balance_curse_venom_limitmod;
//if (!self.runes & RUNE_REGEN)
- // rot_mod = cvar("g_balance_curse_venom_rotrate");
+ // rot_mod = autocvar_g_balance_curse_venom_rotrate;
}
maxh = maxh * max_mod;
//maxa = maxa * max_mod;
if(g_lms && g_ca)
rot_mod = 0;
- if (!g_minstagib && !g_ca && (!g_lms || cvar("g_lms_regenerate")))
+ if (!g_minstagib && !g_ca && (!g_lms || autocvar_g_lms_regenerate))
{
- self.armorvalue = CalcRotRegen(self.armorvalue, mina, cvar("g_balance_armor_regen"), cvar("g_balance_armor_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished), maxa, cvar("g_balance_armor_rot"), cvar("g_balance_armor_rotlinear"), rot_mod * frametime * (time > self.pauserotarmor_finished), limita);
- self.health = CalcRotRegen(self.health, minh, cvar("g_balance_health_regen"), cvar("g_balance_health_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished), maxh, cvar("g_balance_health_rot"), cvar("g_balance_health_rotlinear"), rot_mod * frametime * (time > self.pauserothealth_finished), limith);
+ self.armorvalue = CalcRotRegen(self.armorvalue, mina, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished), maxa, autocvar_g_balance_armor_rot, autocvar_g_balance_armor_rotlinear, rot_mod * frametime * (time > self.pauserotarmor_finished), limita);
+ self.health = CalcRotRegen(self.health, minh, autocvar_g_balance_health_regen, autocvar_g_balance_health_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished), maxh, autocvar_g_balance_health_rot, autocvar_g_balance_health_rotlinear, rot_mod * frametime * (time > self.pauserothealth_finished), limith);
// if player rotted to death... die!
if(self.health < 1)
}
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, cvar("g_balance_fuel_regen"), cvar("g_balance_fuel_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished) * (self.items & IT_FUEL_REGEN != 0), maxf, cvar("g_balance_fuel_rot"), cvar("g_balance_fuel_rotlinear"), rot_mod * frametime * (time > self.pauserotfuel_finished), limitf);
+ self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished) * (self.items & IT_FUEL_REGEN != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, rot_mod * frametime * (time > self.pauserotfuel_finished), limitf);
}
float zoomstate_set;
void LeaveSpectatorMode()
{
if(isJoinAllowed()) {
- if(!teams_matter || cvar("g_campaign") || cvar("g_balance_teams") || (self.wasplayer && cvar("g_changeteam_banned")) || self.team_forced > 0) {
+ if(!teams_matter || autocvar_g_campaign || autocvar_g_balance_teams || (self.wasplayer && autocvar_g_changeteam_banned) || self.team_forced > 0) {
self.classname = "player";
- if(cvar("g_campaign") || cvar("g_balance_teams") || cvar("g_balance_teams_force"))
+ if(autocvar_g_campaign || autocvar_g_balance_teams || autocvar_g_balance_teams_force)
JoinBestTeam(self, FALSE, TRUE);
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
campaign_bots_may_start = 1;
PutClientInServer();
if(self.classname == "player")
bprint ("^4", self.netname, "^4 is playing now\n");
- if(!cvar("g_campaign"))
+ if(!autocvar_g_campaign)
centerprint(self,""); // clear MOTD
return;
if(self.team_forced < 0)
return FALSE; // forced spectators can never join
- if (!cvar("g_maxplayers"))
+ if (!autocvar_g_maxplayers)
return TRUE;
local entity e;
if(e.classname == "player")
currentlyPlaying += 1;
}
- if(currentlyPlaying < cvar("g_maxplayers"))
+ if(currentlyPlaying < autocvar_g_maxplayers)
return TRUE;
return FALSE;
*/
void checkSpectatorBlock() {
if(self.classname == "spectator" || self.classname == "observer") {
- if( time > (self.spectatortime + cvar("g_maxplayers_spectator_blocktime")) ) {
+ if( time > (self.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) {
sprint(self, "^7You were kicked from the server because you are spectator and spectators aren't allowed at the moment.\n");
dropclient(self);
}
void PlayerPreThink (void)
{
self.stat_game_starttime = game_starttime;
- self.stat_allow_oldnexbeam = cvar("g_allow_oldnexbeam");
- self.stat_leadlimit = cvar("leadlimit");
+ self.stat_allow_oldnexbeam = autocvar_g_allow_oldnexbeam;
+ self.stat_leadlimit = autocvar_leadlimit;
if(frametime)
{
if(self.netname_previous != self.netname)
{
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(strcat(":name:", ftos(self.playerid), ":", self.netname));
if(self.netname_previous)
strunzone(self.netname_previous);
{
if(strstr(self.cvar_g_xonoticversion, "git", 0) < 0)
{
- if(strstr(cvar_string("g_xonoticversion"), "git", 0) >= 0)
+ if(strstr(autocvar_g_xonoticversion, "git", 0) >= 0)
{
- dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", cvar_string("g_xonoticversion"), " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
- sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", cvar_string("g_xonoticversion"), " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
+ dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
+ sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
}
else
{
float r;
- r = vercmp(self.cvar_g_xonoticversion, cvar_string("g_xonoticversion"));
+ r = vercmp(self.cvar_g_xonoticversion, autocvar_g_xonoticversion);
if(r < 0)
{
- dprint("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", cvar_string("g_xonoticversion"), "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.com/^1!\n");
- sprint(self, strcat("\{1}^1NOTE: ^3Xonotic ", cvar_string("g_xonoticversion"), "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.com/^1!\n"));
+ dprint("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.com/^1!\n");
+ sprint(self, strcat("\{1}^1NOTE: ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.com/^1!\n"));
}
else if(r > 0)
{
- dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", cvar_string("g_xonoticversion"), "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
- sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", cvar_string("g_xonoticversion"), "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
+ dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
+ sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
}
}
}
if(frametime)
{
- if(self.health <= 0 && cvar("g_deathglow"))
+ if(self.health <= 0 && autocvar_g_deathglow)
{
if(self.glowmod_x > 0)
- self.glowmod_x -= cvar("g_deathglow") * frametime;
+ self.glowmod_x -= autocvar_g_deathglow * frametime;
else
self.glowmod_x = -1;
if(self.glowmod_y > 0)
- self.glowmod_y -= cvar("g_deathglow") * frametime;
+ self.glowmod_y -= autocvar_g_deathglow * frametime;
else
self.glowmod_y = -1;
if(self.glowmod_z > 0)
- self.glowmod_z -= cvar("g_deathglow") * frametime;
+ self.glowmod_z -= autocvar_g_deathglow * frametime;
else
self.glowmod_z = -1;
}
if(frametime)
player_anim();
button_pressed = (self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USE);
- force_respawn = (g_lms || (g_ca) || cvar("g_forced_respawn"));
+ force_respawn = (g_lms || g_ca || g_cts || autocvar_g_forced_respawn);
if (self.deadflag == DEAD_DYING)
{
if(force_respawn)
}
}
- if(g_lms && !self.deadflag && cvar("g_lms_campcheck_interval"))
+ if(g_lms && !self.deadflag && autocvar_g_lms_campcheck_interval)
{
vector dist;
dist_z = 0;
self.lms_traveled_distance += fabs(vlen(dist));
- if((cvar("g_campaign") && !campaign_bots_may_start) || (time < game_starttime))
+ if((autocvar_g_campaign && !campaign_bots_may_start) || (time < game_starttime))
{
- self.lms_nextcheck = time + cvar("g_lms_campcheck_interval")*2;
+ self.lms_nextcheck = time + autocvar_g_lms_campcheck_interval*2;
self.lms_traveled_distance = 0;
}
if(time > self.lms_nextcheck)
{
//sprint(self, "distance: ", ftos(self.lms_traveled_distance), "\n");
- if(self.lms_traveled_distance < cvar("g_lms_campcheck_distance"))
+ if(self.lms_traveled_distance < autocvar_g_lms_campcheck_distance)
{
- centerprint(self, cvar_string("g_lms_campcheck_message"));
+ centerprint(self, autocvar_g_lms_campcheck_message);
// FIXME KadaverJack: gibbing player here causes playermodel to bounce around, instead of eye.md3
// I wasn't able to find out WHY that happens, so I put a workaround in place that shall prevent players from being gibbed :(
- Damage(self, self, self, bound(0, cvar("g_lms_campcheck_damage"), self.health + self.armorvalue * cvar("g_balance_armor_blockpercent") + 5), DEATH_CAMP, self.origin, '0 0 0');
+ Damage(self, self, self, bound(0, autocvar_g_lms_campcheck_damage, self.health + self.armorvalue * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP, self.origin, '0 0 0');
}
- self.lms_nextcheck = time + cvar("g_lms_campcheck_interval");
+ self.lms_nextcheck = time + autocvar_g_lms_campcheck_interval;
self.lms_traveled_distance = 0;
}
}
player_regen();
// rot nex charge to the charge limit
- if(cvar("g_balance_nex_charge_rot_rate") && self.nex_charge > cvar("g_balance_nex_charge_limit") && self.nex_charge_rottime < time)
- self.nex_charge = bound(cvar("g_balance_nex_charge_limit"), self.nex_charge - cvar("g_balance_nex_charge_rot_rate") * frametime / W_TICSPERFRAME, 1);
+ if(autocvar_g_balance_nex_charge_rot_rate && self.nex_charge > autocvar_g_balance_nex_charge_limit && self.nex_charge_rottime < time)
+ self.nex_charge = bound(autocvar_g_balance_nex_charge_limit, self.nex_charge - autocvar_g_balance_nex_charge_rot_rate * frametime / W_TICSPERFRAME, 1);
if(frametime)
player_anim();
if(g_nexball)
nexball_setstatus();
- self.dmg_team = max(0, self.dmg_team - cvar("g_teamdamage_resetspeed") * frametime);
+ self.dmg_team = max(0, self.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
//self.angles_y=self.v_angle_y + 90; // temp
} else if(gameover) {
}
if(!zoomstate_set)
- SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_CAMPINGRIFLE && cvar("g_balance_campingrifle_secondary") == 0));
+ SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_CAMPINGRIFLE && autocvar_g_balance_campingrifle_secondary == 0));
float oldspectatee_status;
oldspectatee_status = self.spectatee_status;
case 32: // space
break;
case 192: // charmap space
- if (!cvar("utf8_enable"))
+ if (!autocvar_utf8_enable)
break;
return FALSE;
case 160: // space in unicode fonts
case 0xE000 + 192: // utf8 charmap space
- if (cvar("utf8_enable"))
+ if (autocvar_utf8_enable)
break;
default:
return FALSE;
//pointparticles(particleeffectnum("machinegun_impact"), self.origin + self.view_ofs + '0 0 7', '0 0 0', 1);
if(self.waypointsprite_attachedforcarrier)
- WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, cvar("g_balance_armor_blockpercent")));
+ WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent));
- if(self.classname == "player" && self.deadflag == DEAD_NO && cvar("r_showbboxes"))
+ if(self.classname == "player" && self.deadflag == DEAD_NO && autocvar_r_showbboxes)
{
if(!self.showheadshotbbox)
{
}
else if(imp >= 103 && imp <= 107)
{
- if(cvar("g_waypointeditor"))
+ if(autocvar_g_waypointeditor)
{
switch(imp)
{
.float race_penalty;
.float restart_jump;
-float sv_accelerate;
-float sv_friction;
-float sv_maxspeed;
-float sv_airaccelerate;
-float sv_maxairspeed;
-float sv_stopspeed;
-float sv_gravity;
-float sv_airaccel_sideways_friction;
-float sv_airaccel_qw;
-float sv_airstopaccelerate;
-float sv_airstrafeaccelerate;
-float sv_maxairstrafespeed;
-float sv_airstrafeaccel_qw;
-float sv_aircontrol;
-float sv_aircontrol_power;
-float sv_aircontrol_penalty;
-float sv_warsowbunny_airforwardaccel;
-float sv_warsowbunny_accel;
-float sv_warsowbunny_topspeed;
-float sv_warsowbunny_turnaccel;
-float sv_warsowbunny_backtosideratio;
-float sv_airspeedlimit_nonqw;
-
.float ladder_time;
.entity ladder_entity;
.float gravity;
float doublejump;
doublejump = FALSE;
- if (sv_doublejump)
+ if (autocvar_sv_doublejump)
{
tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
if (trace_fraction < 1 && trace_plane_normal_z > 0.7)
doublejump = TRUE;
}
- mjumpheight = cvar("sv_jumpvelocity");
+ mjumpheight = autocvar_sv_jumpvelocity;
if (self.waterlevel >= WATERLEVEL_SWIMMING)
{
if (self.watertype == CONTENT_WATER)
return;
}
- if (cvar("g_multijump"))
+ if (autocvar_g_multijump)
{
if (self.prevjumpbutton == FALSE && !(self.flags & FL_ONGROUND)) // jump button pressed this frame and we are in midair
self.multijump_ready = TRUE; // this is necessary to check that we released the jump button and pressed it again
self.multijump_ready = FALSE;
}
- if(!doublejump && self.multijump_ready && self.multijump_count < cvar("g_multijump") && self.velocity_z > cvar("g_multijump_speed"))
+ if(!doublejump && self.multijump_ready && self.multijump_count < autocvar_g_multijump && self.velocity_z > autocvar_g_multijump_speed)
{
// doublejump = FALSE; // checked above in the if
- if (cvar("g_multijump") > 0)
+ if (autocvar_g_multijump > 0)
{
- if (cvar("g_multijump_add") == 0) // in this case we make the z velocity == jumpvelocity
+ if (autocvar_g_multijump_add == 0) // in this case we make the z velocity == jumpvelocity
{
if (self.velocity_z < mjumpheight)
{
// velocity bounds. Final velocity is bound between (jumpheight *
// min + jumpheight) and (jumpheight * max + jumpheight);
- if(cvar_string("sv_jumpspeedcap_min") != "")
+ if(autocvar_sv_jumpspeedcap_min != "")
{
float minjumpspeed;
- minjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_min");
+ minjumpspeed = mjumpheight * stof(autocvar_sv_jumpspeedcap_min);
if (self.velocity_z < minjumpspeed)
mjumpheight += minjumpspeed - self.velocity_z;
}
- if(cvar_string("sv_jumpspeedcap_max") != "")
+ if(autocvar_sv_jumpspeedcap_max != "")
{
// don't do jump speedcaps on ramps to preserve old xonotic ramjump style
tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
- if(!(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")))
+ if(!(trace_fraction < 1 && trace_plane_normal_z < 0.98 && autocvar_sv_jumpspeedcap_max_disable_on_ramps))
{
float maxjumpspeed;
- maxjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_max");
+ maxjumpspeed = mjumpheight * stof(autocvar_sv_jumpspeedcap_max);
if (self.velocity_z > maxjumpspeed)
mjumpheight -= self.velocity_z - maxjumpspeed;
if(!(self.lastflags & FL_ONGROUND))
{
- if(cvar("speedmeter"))
+ if(autocvar_speedmeter)
dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
if(self.lastground < time - 0.3)
{
- self.velocity_x *= (1 - cvar("sv_friction_on_land"));
- self.velocity_y *= (1 - cvar("sv_friction_on_land"));
+ self.velocity_x *= (1 - autocvar_sv_friction_on_land);
+ self.velocity_y *= (1 - autocvar_sv_friction_on_land);
}
if(self.jumppadcount > 1)
dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
vector rigvel_xy, neworigin, up;
float mt;
- rigvel_z -= frametime * sv_gravity; // 4x gravity plays better
+ rigvel_z -= frametime * autocvar_sv_gravity; // 4x gravity plays better
rigvel_xy = vec2(rigvel);
if(g_bugrigs_planar_movement_car_jumping && !g_touchexplode) // touchexplode is a better way to handle collisions
}
else
{
- rigvel_z -= frametime * sv_gravity; // 4x gravity plays better
+ rigvel_z -= frametime * autocvar_sv_gravity; // 4x gravity plays better
self.velocity = rigvel;
self.movetype = MOVETYPE_FLY;
}
return;
#endif
- k *= bound(0, wishspeed / sv_maxairspeed, 1);
+ k *= bound(0, wishspeed / autocvar_sv_maxairspeed, 1);
zspeed = self.velocity_z;
self.velocity_z = 0;
if(dot > 0) // we can't change direction while slowing down
{
- k *= pow(dot, sv_aircontrol_power)*frametime;
- xyspeed = max(0, xyspeed - sv_aircontrol_penalty * sqrt(max(0, 1 - dot*dot)) * k/32);
- k *= sv_aircontrol;
+ k *= pow(dot, autocvar_sv_aircontrol_power)*frametime;
+ xyspeed = max(0, xyspeed - autocvar_sv_aircontrol_penalty * sqrt(max(0, 1 - dot*dot)) * k/32);
+ k *= autocvar_sv_aircontrol;
self.velocity = normalize(self.velocity * xyspeed + wishdir * k);
}
if(speedclamp)
accelqw = -accelqw;
- if(cvar("sv_gameplayfix_q2airaccelerate"))
+ if(autocvar_sv_gameplayfix_q2airaccelerate)
wishspeed0 = wishspeed;
vel_straight = self.velocity * wishdir;
if(wishspeed > curspeed * 1.01)
{
- wishspeed = min(wishspeed, curspeed + sv_warsowbunny_airforwardaccel * self.stat_sv_maxspeed * frametime);
+ wishspeed = min(wishspeed, curspeed + autocvar_sv_warsowbunny_airforwardaccel * self.stat_sv_maxspeed * frametime);
}
else
{
- f = max(0, (sv_warsowbunny_topspeed - curspeed) / (sv_warsowbunny_topspeed - self.stat_sv_maxspeed));
- wishspeed = max(curspeed, self.stat_sv_maxspeed) + sv_warsowbunny_accel * f * self.stat_sv_maxspeed * frametime;
+ f = max(0, (autocvar_sv_warsowbunny_topspeed - curspeed) / (autocvar_sv_warsowbunny_topspeed - self.stat_sv_maxspeed));
+ wishspeed = max(curspeed, self.stat_sv_maxspeed) + autocvar_sv_warsowbunny_accel * f * self.stat_sv_maxspeed * frametime;
}
wishvel = wishdir * wishspeed;
acceldir = wishvel - curvel;
addspeed = vlen(acceldir);
acceldir = normalize(acceldir);
- accelspeed = min(addspeed, sv_warsowbunny_turnaccel * self.stat_sv_maxspeed * frametime);
+ accelspeed = min(addspeed, autocvar_sv_warsowbunny_turnaccel * self.stat_sv_maxspeed * frametime);
- if(sv_warsowbunny_backtosideratio < 1)
+ if(autocvar_sv_warsowbunny_backtosideratio < 1)
{
curdir = normalize(curvel);
dot = acceldir * curdir;
if(dot < 0)
- acceldir = acceldir - (1 - sv_warsowbunny_backtosideratio) * dot * curdir;
+ acceldir = acceldir - (1 - autocvar_sv_warsowbunny_backtosideratio) * dot * curdir;
}
self.velocity += accelspeed * acceldir;
maxspd_mod = 1;
if(g_minstagib && (self.items & IT_INVINCIBLE))
- maxspd_mod *= cvar("g_minstagib_speed_highspeed");
+ maxspd_mod *= autocvar_g_minstagib_speed_highspeed;
if(self.ballcarried)
if(g_nexball)
- maxspd_mod *= cvar("g_nexball_basketball_carrier_highspeed");
+ maxspd_mod *= autocvar_g_nexball_basketball_carrier_highspeed;
else if(g_keepaway)
- maxspd_mod *= cvar("g_keepaway_ballcarrier_highspeed");
+ maxspd_mod *= autocvar_g_keepaway_ballcarrier_highspeed;
if(g_runematch)
{
if(self.runes & RUNE_SPEED)
{
if(self.runes & CURSE_SLOW)
- maxspd_mod *= cvar("g_balance_rune_speed_combo_highspeed");
+ maxspd_mod *= autocvar_g_balance_rune_speed_combo_highspeed;
else
- maxspd_mod *= cvar("g_balance_rune_speed_highspeed");
+ maxspd_mod *= autocvar_g_balance_rune_speed_highspeed;
}
else if(self.runes & CURSE_SLOW)
{
- maxspd_mod *= cvar("g_balance_curse_slow_highspeed");
+ maxspd_mod *= autocvar_g_balance_curse_slow_highspeed;
}
}
maxspd_mod *= autocvar_g_movement_highspeed;
// fix physics stats for g_movement_highspeed
- self.stat_sv_airaccel_qw = AdjustAirAccelQW(sv_airaccel_qw, maxspd_mod);
- if(sv_airstrafeaccel_qw)
- self.stat_sv_airstrafeaccel_qw = AdjustAirAccelQW(sv_airstrafeaccel_qw, maxspd_mod);
+ self.stat_sv_airaccel_qw = AdjustAirAccelQW(autocvar_sv_airaccel_qw, maxspd_mod);
+ if(autocvar_sv_airstrafeaccel_qw)
+ self.stat_sv_airstrafeaccel_qw = AdjustAirAccelQW(autocvar_sv_airstrafeaccel_qw, maxspd_mod);
else
self.stat_sv_airstrafeaccel_qw = 0;
- self.stat_sv_airspeedlimit_nonqw = sv_airspeedlimit_nonqw * maxspd_mod;
- self.stat_sv_maxspeed = sv_maxspeed * maxspd_mod; // also slow walking
+ self.stat_sv_airspeedlimit_nonqw = autocvar_sv_airspeedlimit_nonqw * maxspd_mod;
+ self.stat_sv_maxspeed = autocvar_sv_maxspeed * maxspd_mod; // also slow walking
if(self.PlayerPhysplug)
if(self.PlayerPhysplug())
self.v_angle_old = self.v_angle;
if(time < self.nickspamtime)
- if(self.nickspamcount >= cvar("g_nick_flood_penalty_yellow"))
+ if(self.nickspamcount >= autocvar_g_nick_flood_penalty_yellow)
{
// slight annoyance for nick change scripts
self.movement = -1 * self.movement;
self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = self.BUTTON_ZOOM = self.BUTTON_CROUCH = self.BUTTON_HOOK = self.BUTTON_USE = 0;
- if(self.nickspamcount >= cvar("g_nick_flood_penalty_red")) // if you are persistent and the slight annoyance above does not stop you, I'll show you!
+ if(self.nickspamcount >= autocvar_g_nick_flood_penalty_red) // if you are persistent and the slight annoyance above does not stop you, I'll show you!
{
self.angles_x = random() * 360;
self.angles_y = random() * 360;
not_allowed_to_move = 0;
if(self.race_penalty)
not_allowed_to_move = 1;
- if(!cvar("sv_ready_restart_after_countdown"))
+ if(!autocvar_sv_ready_restart_after_countdown)
if(time < game_starttime)
not_allowed_to_move = 1;
if(self.classname != "player")
{
- maxspd_mod = cvar("sv_spectator_speed_multiplier");
+ maxspd_mod = autocvar_sv_spectator_speed_multiplier;
if(!self.spectatorspeed)
self.spectatorspeed = maxspd_mod;
if(self.impulse && self.impulse <= 19)
maxspd_mod = self.spectatorspeed;
}
- spd = max(self.stat_sv_maxspeed, sv_maxairspeed) * maxspd_mod * swampspd_mod;
+ spd = max(self.stat_sv_maxspeed, autocvar_sv_maxairspeed) * maxspd_mod * swampspd_mod;
if(self.speed != spd)
{
self.speed = spd;
{
if(self.flags & FL_ONGROUND)
{
- if (cvar("g_multijump") > 0)
+ if (autocvar_g_multijump > 0)
self.multijump_count = 0;
else
self.multijump_count = -2; // the cvar value for infinite jumps is -1, so this needs to be smaller
// noclipping or flying
self.flags &~= FL_ONGROUND;
- self.velocity = self.velocity * (1 - frametime * sv_friction);
+ self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
makevectors(self.v_angle);
//wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
if (wishspeed > self.stat_sv_maxspeed*maxspd_mod)
wishspeed = self.stat_sv_maxspeed*maxspd_mod;
if (time >= self.teleport_time)
- PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
+ PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
}
else if (self.waterlevel >= WATERLEVEL_SWIMMING)
{
wishspeed = wishspeed * 0.7;
// water friction
- self.velocity = self.velocity * (1 - frametime * sv_friction);
+ self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
// water acceleration
- PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
+ PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
}
else if (time < self.ladder_time)
{
// on a spawnfunc_func_ladder or swimming in spawnfunc_func_water
self.flags &~= FL_ONGROUND;
- self.velocity = self.velocity * (1 - frametime * sv_friction);
+ self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
makevectors(self.v_angle);
//wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
if (self.gravity)
- self.velocity_z = self.velocity_z + self.gravity * sv_gravity * frametime;
+ self.velocity_z = self.velocity_z + self.gravity * autocvar_sv_gravity * frametime;
else
- self.velocity_z = self.velocity_z + sv_gravity * frametime;
+ self.velocity_z = self.velocity_z + autocvar_sv_gravity * frametime;
if (self.ladder_entity.classname == "func_water")
{
f = vlen(wishvel);
if (time >= self.teleport_time)
{
// water acceleration
- PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
+ PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
}
}
- else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
+ else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!autocvar_g_jetpack_fuel || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
{
//makevectors(self.v_angle_y * '0 1 0');
makevectors(self.v_angle);
wishvel = v_forward * self.movement_x + v_right * self.movement_y;
// add remaining speed as Z component
- maxairspd = sv_maxairspeed*max(1, maxspd_mod);
+ maxairspd = autocvar_sv_maxairspeed*max(1, maxspd_mod);
// fix speedhacks :P
wishvel = normalize(wishvel) * min(vlen(wishvel) / maxairspd, 1);
// add the unused velocity as up component
// it is now normalized, so...
float a_side, a_up, a_add, a_diff;
- a_side = cvar("g_jetpack_acceleration_side");
- a_up = cvar("g_jetpack_acceleration_up");
- a_add = cvar("g_jetpack_antigravity") * sv_gravity;
+ a_side = autocvar_g_jetpack_acceleration_side;
+ a_up = autocvar_g_jetpack_acceleration_up;
+ a_add = autocvar_g_jetpack_antigravity * autocvar_sv_gravity;
wishvel_x *= a_side;
wishvel_y *= a_side;
//print("best possible acceleration: ", ftos(best), "\n");
float fxy, fz;
- fxy = bound(0, 1 - (self.velocity * normalize(wishvel_x * '1 0 0' + wishvel_y * '0 1 0')) / cvar("g_jetpack_maxspeed_side"), 1);
- if(wishvel_z - sv_gravity > 0)
- fz = bound(0, 1 - self.velocity_z / cvar("g_jetpack_maxspeed_up"), 1);
+ fxy = bound(0, 1 - (self.velocity * normalize(wishvel_x * '1 0 0' + wishvel_y * '0 1 0')) / autocvar_g_jetpack_maxspeed_side, 1);
+ if(wishvel_z - autocvar_sv_gravity > 0)
+ fz = bound(0, 1 - self.velocity_z / autocvar_g_jetpack_maxspeed_up, 1);
else
- fz = bound(0, 1 + self.velocity_z / cvar("g_jetpack_maxspeed_up"), 1);
+ fz = bound(0, 1 + self.velocity_z / autocvar_g_jetpack_maxspeed_up, 1);
float fvel;
fvel = vlen(wishvel);
wishvel_x *= fxy;
wishvel_y *= fxy;
- wishvel_z = (wishvel_z - sv_gravity) * fz + sv_gravity;
+ wishvel_z = (wishvel_z - autocvar_sv_gravity) * fz + autocvar_sv_gravity;
fvel = min(1, vlen(wishvel) / best);
- if(cvar("g_jetpack_fuel") && !(self.items & IT_UNLIMITED_WEAPON_AMMO))
- f = min(1, self.ammo_fuel / (cvar("g_jetpack_fuel") * frametime * fvel));
+ if(autocvar_g_jetpack_fuel && !(self.items & IT_UNLIMITED_WEAPON_AMMO))
+ f = min(1, self.ammo_fuel / (autocvar_g_jetpack_fuel * frametime * fvel));
else
f = 1;
{
self.velocity = self.velocity + wishvel * f * frametime;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_fuel -= cvar("g_jetpack_fuel") * frametime * fvel * f;
+ self.ammo_fuel -= autocvar_g_jetpack_fuel * frametime * fvel * f;
self.flags &~= FL_ONGROUND;
self.items |= IT_USING_JETPACK;
// jetpack also inhibits health regeneration, but only for 1 second
- self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen"));
+ self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
}
}
else if (self.flags & FL_ONGROUND)
if(!(self.lastflags & FL_ONGROUND))
{
- if(cvar("speedmeter"))
+ if(autocvar_speedmeter)
dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
if(self.lastground < time - 0.3)
- self.velocity = self.velocity * (1 - cvar("sv_friction_on_land"));
+ self.velocity = self.velocity * (1 - autocvar_sv_friction_on_land);
if(self.jumppadcount > 1)
dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
self.jumppadcount = 0;
f = vlen(v);
if(f > 0)
{
- if (f < sv_stopspeed)
- f = 1 - frametime * (sv_stopspeed / f) * sv_friction;
+ if (f < autocvar_sv_stopspeed)
+ f = 1 - frametime * (autocvar_sv_stopspeed / f) * autocvar_sv_friction;
else
- f = 1 - frametime * sv_friction;
+ f = 1 - frametime * autocvar_sv_friction;
if (f > 0)
self.velocity = self.velocity * f;
else
if (self.crouch)
wishspeed = wishspeed * 0.5;
if (time >= self.teleport_time)
- PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
+ PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
}
else
{
if(maxspd_mod < 1)
{
- maxairspd = sv_maxairspeed*maxspd_mod;
- airaccel = sv_airaccelerate*maxspd_mod;
+ maxairspd = autocvar_sv_maxairspeed*maxspd_mod;
+ airaccel = autocvar_sv_airaccelerate*maxspd_mod;
}
else
{
- maxairspd = sv_maxairspeed;
- airaccel = sv_airaccelerate;
+ maxairspd = autocvar_sv_maxairspeed;
+ airaccel = autocvar_sv_airaccelerate;
}
// airborn
makevectors(self.v_angle_y * '0 1 0');
wishspeed2 = wishspeed;
// CPM
- if(sv_airstopaccelerate)
+ if(autocvar_sv_airstopaccelerate)
{
vector curdir;
curdir = self.velocity;
curdir_z = 0;
curdir = normalize(curdir);
- airaccel = airaccel + (sv_airstopaccelerate*maxspd_mod - airaccel) * max(0, -(curdir * wishdir));
+ airaccel = airaccel + (autocvar_sv_airstopaccelerate*maxspd_mod - airaccel) * max(0, -(curdir * wishdir));
}
// note that for straight forward jumping:
// step = accel * frametime * wishspeed0;
// log dv/dt = logaccel + logmaxspeed (when slow)
// log dv/dt = logaccel + logmaxspeed + log(1 - accelqw) (when fast)
strafity = IsMoveInDirection(self.movement, -90) + IsMoveInDirection(self.movement, +90); // if one is nonzero, other is always zero
- if(sv_maxairstrafespeed)
- wishspeed = min(wishspeed, GeomLerp(sv_maxairspeed*maxspd_mod, strafity, sv_maxairstrafespeed*maxspd_mod));
- if(sv_airstrafeaccelerate)
- airaccel = GeomLerp(airaccel, strafity, sv_airstrafeaccelerate*maxspd_mod);
+ if(autocvar_sv_maxairstrafespeed)
+ wishspeed = min(wishspeed, GeomLerp(autocvar_sv_maxairspeed*maxspd_mod, strafity, autocvar_sv_maxairstrafespeed*maxspd_mod));
+ if(autocvar_sv_airstrafeaccelerate)
+ airaccel = GeomLerp(airaccel, strafity, autocvar_sv_airstrafeaccelerate*maxspd_mod);
if(self.stat_sv_airstrafeaccel_qw)
airaccelqw = copysign(1-GeomLerp(1-fabs(self.stat_sv_airaccel_qw), strafity, 1-fabs(self.stat_sv_airstrafeaccel_qw)), ((strafity > 0.5) ? self.stat_sv_airstrafeaccel_qw : self.stat_sv_airaccel_qw));
// !CPM
- if(sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
+ if(autocvar_sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
PM_AirAccelerate(wishdir, wishspeed);
else
- PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw);
+ PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, autocvar_sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw);
- if(sv_aircontrol)
+ if(autocvar_sv_aircontrol)
CPM_PM_Aircontrol(wishdir, wishspeed2);
}
}
float xyspeed;
xyspeed = vlen('1 0 0' * self.velocity_x + '0 1 0' * self.velocity_y);
- if(self.weapon == WEP_NEX && cvar("g_balance_nex_charge") && cvar("g_balance_nex_charge_velocity_rate") && xyspeed > cvar("g_balance_nex_charge_minspeed"))
+ if(self.weapon == WEP_NEX && autocvar_g_balance_nex_charge && autocvar_g_balance_nex_charge_velocity_rate && xyspeed > autocvar_g_balance_nex_charge_minspeed)
{
// add a maximum of charge_velocity_rate when going fast (f = 1), gradually increasing from minspeed (f = 0) to maxspeed
- xyspeed = min(xyspeed, cvar("g_balance_nex_charge_maxspeed"));
- f = (xyspeed - cvar("g_balance_nex_charge_minspeed")) / (cvar("g_balance_nex_charge_maxspeed") - cvar("g_balance_nex_charge_minspeed"));
+ xyspeed = min(xyspeed, autocvar_g_balance_nex_charge_maxspeed);
+ f = (xyspeed - autocvar_g_balance_nex_charge_minspeed) / (autocvar_g_balance_nex_charge_maxspeed - autocvar_g_balance_nex_charge_minspeed);
// add the extra charge
- self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_velocity_rate") * f * frametime);
+ self.nex_charge = min(1, self.nex_charge + autocvar_g_balance_nex_charge_velocity_rate * f * frametime);
}
:end
if(self.flags & FL_ONGROUND)
void WeaponStats_Init()
{
- if(cvar_string("sv_weaponstats_killfile") != "" || cvar_string("sv_weaponstats_damagefile") != "")
+ if(autocvar_sv_weaponstats_killfile != "" || autocvar_sv_weaponstats_damagefile != "")
weaponstats_buffer = buf_create();
else
weaponstats_buffer = -1;
string prefix;
if(weaponstats_buffer < 0)
return;
- prefix = strcat(cvar_string("hostname"), "\t", GetGametype(), "_", GetMapname(), "\t");
- if(cvar_string("sv_weaponstats_killfile") != "")
+ prefix = strcat(autocvar_hostname, "\t", GetGametype(), "_", GetMapname(), "\t");
+ if(autocvar_sv_weaponstats_killfile != "")
{
- fh = fopen(cvar_string("sv_weaponstats_killfile"), FILE_APPEND);
+ fh = fopen(autocvar_sv_weaponstats_killfile, FILE_APPEND);
if(fh >= 0)
{
fputs(fh, "#begin killfile\n");
print("Weapon kill stats written\n");
}
}
- if(cvar_string("sv_weaponstats_damagefile") != "")
+ if(autocvar_sv_weaponstats_damagefile != "")
{
- fh = fopen(cvar_string("sv_weaponstats_damagefile"), FILE_APPEND);
+ fh = fopen(autocvar_sv_weaponstats_damagefile, FILE_APPEND);
if(fh >= 0)
{
fputs(fh, "#begin damagefile\n");
// damage resistance (ignore most of the damage from a bullet or similar)
damage = max(damage - 5, 1);
- v = healtharmor_applydamage(self.armorvalue, cvar("g_balance_armor_blockpercent"), damage);
+ v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
take = v_x;
save = v_y;
self.armorvalue = self.armorvalue - save;
self.health = self.health - take;
// pause regeneration for 5 seconds
- self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen"));
+ self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_health_regen);
}
self.dmg_save = self.dmg_save + save;//max(save - 10, 0);
self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
if (!g_minstagib)
{
- v = healtharmor_applydamage(self.armorvalue, cvar("g_balance_armor_blockpercent"), damage);
+ v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
take = v_x;
save = v_y;
}
self.armorvalue = self.armorvalue - save;
self.health = self.health - take;
// pause regeneration for 5 seconds
- self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen"));
+ self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_health_regen);
if (time > self.pain_finished) //Don't switch pain sequences like crazy
{
}
if(sound_allowed(MSG_BROADCAST, attacker))
- if(!DEATH_ISWEAPON(deathtype, WEP_LASER) || attacker != self || self.health < 2 * cvar("g_balance_laser_primary_damage") * cvar("g_balance_selfdamagepercent") + 1)
+ if(!DEATH_ISWEAPON(deathtype, WEP_LASER) || attacker != self || self.health < 2 * autocvar_g_balance_laser_primary_damage * autocvar_g_balance_selfdamagepercent + 1)
if(self.health > 1)
// exclude pain sounds for laserjumps as long as you aren't REALLY low on health and would die of the next two
{
else if(attacker.classname == "player" || attacker.classname == "gib")
{
self.pusher = attacker;
- self.pushltime = time + cvar("g_maxpushtime");
+ self.pushltime = time + autocvar_g_maxpushtime;
}
else if(time < self.pushltime)
{
self.movetype = MOVETYPE_TOSS;
// shootable corpse
self.solid = SOLID_CORPSE;
- self.ballistics_density = cvar("g_ballistics_density_corpse");
+ self.ballistics_density = autocvar_g_ballistics_density_corpse;
// don't stick to the floor
self.flags &~= FL_ONGROUND;
// dying animation
waves = 0;
sdelay = cvar(strcat("g_", GetGametype(), "_respawn_delay"));
if(!sdelay)
- sdelay = cvar("g_respawn_delay");
+ {
+ if(g_cts)
+ sdelay = 0; // no respawn delay in CTS
+ else
+ sdelay = autocvar_g_respawn_delay;
+ }
waves = cvar(strcat("g_", GetGametype(), "_respawn_waves"));
if(!waves)
- waves = cvar("g_respawn_waves");
+ waves = autocvar_g_respawn_waves;
if(waves)
self.death_time = ceil((time + sdelay) / waves) * waves;
else
if(defer_ClientKill_Now_TeamChange)
ClientKill_Now_TeamChange();
- if(sv_gentle > 0 || cvar("ekg")) {
+ if(sv_gentle > 0 || autocvar_ekg) {
// remove corpse
PlayerCorpseDamage (inflictor, attacker, 100.0, deathtype, hitloc, force);
}
selected = world;
selected_score = 0.95; // 18 degrees
- if(!cvar("sv_allow_shownames"))
+ if(!autocvar_sv_allow_shownames)
return;
if(clienttype(self) != CLIENTTYPE_REAL)
}
*/
- if(cvar("g_chat_teamcolors"))
+ if(autocvar_g_chat_teamcolors)
namestr = playername(source);
else
namestr = source.netname;
privatemsgprefixlen = strlen(msgstr);
msgstr = strcat(msgstr, msgin);
cmsgstr = strcat(colorstr, "^3", namestr, "^3 tells you:\n^7", msgin);
- if(cvar("g_chat_teamcolors"))
+ if(autocvar_g_chat_teamcolors)
privatemsgprefix = strcat("\{1}\{13}* ^3You tell ", playername(privatesay), ": ^7");
else
privatemsgprefix = strcat("\{1}\{13}* ^3You tell ", privatesay.netname, ": ^7");
float lines;
if(privatesay)
{
- flood_spl = cvar("g_chat_flood_spl_tell");
- flood_burst = cvar("g_chat_flood_burst_tell");
- flood_lmax = cvar("g_chat_flood_lmax_tell");
+ flood_spl = autocvar_g_chat_flood_spl_tell;
+ flood_burst = autocvar_g_chat_flood_burst_tell;
+ flood_lmax = autocvar_g_chat_flood_lmax_tell;
flood_field = floodcontrol_chattell;
}
else if(teamsay)
{
- flood_spl = cvar("g_chat_flood_spl_team");
- flood_burst = cvar("g_chat_flood_burst_team");
- flood_lmax = cvar("g_chat_flood_lmax_team");
+ flood_spl = autocvar_g_chat_flood_spl_team;
+ flood_burst = autocvar_g_chat_flood_burst_team;
+ flood_lmax = autocvar_g_chat_flood_lmax_team;
flood_field = floodcontrol_chatteam;
}
else
{
- flood_spl = cvar("g_chat_flood_spl");
- flood_burst = cvar("g_chat_flood_burst");
- flood_lmax = cvar("g_chat_flood_lmax");
+ flood_spl = autocvar_g_chat_flood_spl;
+ flood_burst = autocvar_g_chat_flood_burst;
+ flood_lmax = autocvar_g_chat_flood_lmax;
flood_field = floodcontrol_chat;
}
flood_burst = max(0, flood_burst - 1);
if(flood == 2) // cannot happen for empty msgstr
{
- if(cvar("g_chat_flood_notify_flooder"))
+ if(autocvar_g_chat_flood_notify_flooder)
{
sourcemsgstr = strcat(msgstr, "\n^3FLOOD CONTROL: ^7message too long, trimmed\n");
sourcecmsgstr = "";
if(!privatesay)
if(source.classname != "player")
{
- if(teamsay || (cvar("g_chat_nospectators") == 1) || (cvar("g_chat_nospectators") == 2 && !inWarmupStage))
+ if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !inWarmupStage))
teamsay = -1; // spectators
}
}
else if(flood == 1)
{
- if(cvar("g_chat_flood_notify_flooder"))
+ if(autocvar_g_chat_flood_notify_flooder)
{
sprint(source, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(source.flood_field - time), "^3 seconds\n"));
ret = 0;
}
string allvoicesamples;
-float GetPlayerSoundSampleField_notFound;
-float GetPlayerSoundSampleField_fixed;
.string GetVoiceMessageSampleField(string type)
{
GetPlayerSoundSampleField_notFound = 0;
- GetPlayerSoundSampleField_fixed = 0;
switch(type)
{
#define _VOICEMSG(m) case #m: return playersound_##m;
.string GetPlayerSoundSampleField(string type)
{
GetPlayerSoundSampleField_notFound = 0;
- GetPlayerSoundSampleField_fixed = 0;
switch(type)
{
#define _VOICEMSG(m) case #m: return playersound_##m;
field = GetVoiceMessageSampleField(argv(0));
if(GetPlayerSoundSampleField_notFound)
continue;
- if(GetPlayerSoundSampleField_fixed)
- if not(first)
- continue;
if(self.field)
strunzone(self.field);
self.field = strzone(strcat(argv(1), " ", argv(2)));
return;
if (g_nexball && w == WEP_GRENADE_LAUNCHER)
return;
- if (!cvar("g_pickup_items"))
+ if (!autocvar_g_pickup_items)
return;
if (g_ca)
return;
- if(!cvar("g_weapon_throwable"))
+ if (g_cts)
+ return;
+ if(!autocvar_g_weapon_throwable)
return;
- if(cvar("g_weapon_stay") == 1)
+ if(autocvar_g_weapon_stay == 1)
return;
if(!W_IsWeaponThrowable(w))
return;
if (frametime)
self.weapon_frametime = frametime;
- if(((arena_roundbased || g_ca || g_freezetag) && time < warmup) || ((time < game_starttime) && !cvar("sv_ready_restart_after_countdown")))
+ if(((arena_roundbased || g_ca || g_freezetag) && time < warmup) || ((time < game_starttime) && !autocvar_sv_ready_restart_after_countdown))
return;
if(g_freezetag && self.freezetag_frozen == 1)
weapon_action(self.switchweapon, WR_SETUP);
// VorteX: add player model weapon select frame here
// setcustomframe(PlayerWeaponRaise);
- weapon_thinkf(WFRAME_IDLE, cvar("g_balance_weaponswitchdelay"), w_ready);
+ weapon_thinkf(WFRAME_IDLE, autocvar_g_balance_weaponswitchdelay, w_ready);
weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');
}
else if (self.weaponentity.state == WS_READY)
sound (self, CHAN_WEAPON2, "weapons/weapon_switch.wav", VOL_BASE, ATTN_NORM);
self.weaponentity.state = WS_DROP;
// set up weapon switch think in the future, and start drop anim
- weapon_thinkf(WFRAME_DONTCHANGE, cvar("g_balance_weaponswitchdelay"), w_clear);
+ weapon_thinkf(WFRAME_DONTCHANGE, autocvar_g_balance_weaponswitchdelay, w_clear);
weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);
#ifndef INDEPENDENT_ATTACK_FINISHED
}
v_forward = fo;
v_right = ri;
v_up = up;
+ self.weaponentity_glowmod = '0 0 0'; // reset glowmod, weapon think function only *might* set it
weapon_action(self.weapon, WR_THINK);
}
if (time + self.weapon_frametime * 0.5 >= self.weapon_nextthink)
if(self.runes & RUNE_SPEED)
{
if(self.runes & CURSE_SLOW)
- t = t * cvar("g_balance_rune_speed_combo_atkrate");
+ t = t * autocvar_g_balance_rune_speed_combo_atkrate;
else
- t = t * cvar("g_balance_rune_speed_atkrate");
+ t = t * autocvar_g_balance_rune_speed_atkrate;
}
else if(self.runes & CURSE_SLOW)
{
- t = t * cvar("g_balance_curse_slow_atkrate");
+ t = t * autocvar_g_balance_curse_slow_atkrate;
}
}
if (antilag)
if (!ent.cvar_cl_noantilag)
{
- if (cvar("g_antilag") == 1) // switch to "ghost" if not hitting original
+ if (autocvar_g_antilag == 1) // switch to "ghost" if not hitting original
{
traceline(w_shotorg, w_shotorg + w_shotdir * range, MOVE_NORMAL, ent);
if (!trace_ent.takedamage)
}
}
}
- else if(cvar("g_antilag") == 3) // client side hitscan
+ else if(autocvar_g_antilag == 3) // client side hitscan
{
// this part MUST use prydon cursor
if (ent.cursor_trace_ent) // client was aiming at someone
if(ent.items & IT_STRENGTH)
if(!g_minstagib)
if(
- (time > ent.prevstrengthsound + cvar("sv_strengthsound_antispam_time"))
+ (time > ent.prevstrengthsound + autocvar_sv_strengthsound_antispam_time)
||
- (time > ent.prevstrengthsoundattempt + cvar("sv_strengthsound_antispam_refire_threshold"))
+ (time > ent.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)
) // prevent insane sound spam
{
sound(ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
else
self.alpha = 1;
+ self.glowmod = self.owner.weaponentity_glowmod;
self.colormap = self.owner.colormap;
if (self.weaponentity)
{
self.weaponentity.effects = self.effects;
self.weaponentity.alpha = self.alpha;
self.weaponentity.colormap = self.colormap;
+ self.weaponentity.glowmod = self.glowmod;
}
self.angles = '0 0 0';
f = 0;
if (self.state == WS_RAISE && !intermission_running)
{
- f = (self.owner.weapon_nextthink - time) * g_weaponratefactor / cvar("g_balance_weaponswitchdelay");
+ f = (self.owner.weapon_nextthink - time) * g_weaponratefactor / autocvar_g_balance_weaponswitchdelay;
self.angles_x = -90 * f * f;
if (qcweaponanimation)
{
}
else if (self.state == WS_DROP && !intermission_running)
{
- f = 1 - (self.owner.weapon_nextthink - time) * g_weaponratefactor / cvar("g_balance_weaponswitchdelay");
+ f = 1 - (self.owner.weapon_nextthink - time) * g_weaponratefactor / autocvar_g_balance_weaponswitchdelay;
self.angles_x = -90 * f * f;
if (qcweaponanimation)
{
self.angles = ang;
}
+ self.glowmod = self.owner.weaponentity_glowmod;
self.colormap = self.owner.colormap;
};
sprint(cl, strcat("You do not have the ^2", W_Name(wpn), "\n") );
Send_WeaponComplain (cl, wpn, W_Name(wpn), 1);
- if(cvar("g_showweaponspawns"))
+ if(autocvar_g_showweaponspawns)
{
entity e;
string s;
void weapon_setup(float windex)
{
entity e;
- qcweaponanimation = cvar("sv_qcweaponanimation");
+ qcweaponanimation = autocvar_sv_qcweaponanimation;
e = get_weaponinfo(windex);
self.items &~= IT_AMMO;
self.items = self.items | e.items;
mdirection = normalize(mvelocity);
mspeed = vlen(mvelocity);
- nstyle = cvar("g_projectiles_newton_style");
+ nstyle = autocvar_g_projectiles_newton_style;
if(nstyle == 0 || forceAbsolute)
{
// absolute velocity
//dprint("impossible shot, adjusting\n");
}
- outspeed = bound(mspeed * cvar("g_projectiles_newton_style_2_minfactor"), outspeed, mspeed * cvar("g_projectiles_newton_style_2_maxfactor"));
+ outspeed = bound(mspeed * autocvar_g_projectiles_newton_style_2_minfactor, outspeed, mspeed * autocvar_g_projectiles_newton_style_2_maxfactor);
outvelocity = mdirection * outspeed;
}
else if(nstyle == 3)
spread *= g_weaponspreadfactor;
if(spread <= 0)
return forward;
- sstyle = cvar("g_projectiles_spread_style");
+ sstyle = autocvar_g_projectiles_spread_style;
if(sstyle == 0)
{
dir = normalize(dir);
#if 0
- if(cvar("g_projectiles_spread_style") != mspercallsstyle)
+ if(autocvar_g_projectiles_spread_style != mspercallsstyle)
{
mspercallsum = mspercallcount = 0;
- mspercallsstyle = cvar("g_projectiles_spread_style");
+ mspercallsstyle = autocvar_g_projectiles_spread_style;
}
mspercallsum -= gettime(GETTIME_HIRES);
#endif
} else {
self.version = stof(argv(1));
}
- if(self.version != cvar("gameversion"))
+ if(self.version < autocvar_gameversion_min || self.version > autocvar_gameversion_max)
{
- self.classname = "observer";
self.version_mismatch = 1;
- PutClientInServer();
- } else if(cvar("g_campaign") || cvar("g_balance_teams") || cvar("g_balance_teams_force")) {
+ ClientKill_TeamChange(-2); // observe
+ } else if(autocvar_g_campaign || autocvar_g_balance_teams || autocvar_g_balance_teams_force) {
//JoinBestTeam(self, FALSE, TRUE);
- } else if(teams_matter && !cvar("sv_spectate") && !(self.team_forced > 0)) {
+ } else if(teams_matter && !autocvar_sv_spectate && !(self.team_forced > 0)) {
self.classname = "observer";
stuffcmd(self,"menu_showteamselect\n");
}
return;
}
}
- if(self.classname == "player" && cvar("sv_spectate") == 1) {
- if(self.flagcarried)
- DropFlag(self.flagcarried, world, world);
- if(self.ballcarried && g_nexball)
- DropBall(self.ballcarried, self.origin, self.velocity);
- WaypointSprite_PlayerDead();
- self.classname = "observer";
- if(g_ca)
- self.caplayer = 0;
- if(blockSpectators)
- sprint(self, strcat("^7You have to become a player within the next ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
- PutClientInServer();
+ if(self.classname == "player" && autocvar_sv_spectate == 1) {
+ ClientKill_TeamChange(-2); // observe
}
} else if(cmd == "join") {
if not(self.flags & FL_CLIENT)
PlayerScore_Clear(self);
bprint ("^4", self.netname, "^4 is playing now\n");
PutClientInServer();
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
campaign_bots_may_start = 1;
}
else {
return;
if( !teams_matter ) {
sprint( self, "selectteam can only be used in teamgames\n");
- } else if(cvar("g_campaign")) {
+ } else if(autocvar_g_campaign) {
//JoinBestTeam(self, 0);
} else if(self.team_forced > 0) {
sprint( self, "selectteam can not be used as your team is forced\n");
} else if(lockteams) {
sprint( self, "^7The game has already begun, you must wait until the next map to be able to join a team.\n");
} else if( argv(1) == "red" ) {
- DoTeamChange(COLOR_TEAM1);
+ ClientKill_TeamChange(COLOR_TEAM1);
} else if( argv(1) == "blue" ) {
- DoTeamChange(COLOR_TEAM2);
+ ClientKill_TeamChange(COLOR_TEAM2);
} else if( argv(1) == "yellow" ) {
- DoTeamChange(COLOR_TEAM3);
+ ClientKill_TeamChange(COLOR_TEAM3);
} else if( argv(1) == "pink" ) {
- DoTeamChange(COLOR_TEAM4);
+ ClientKill_TeamChange(COLOR_TEAM4);
} else if( argv(1) == "auto" ) {
- DoTeamChange(-1);
+ ClientKill_TeamChange(-1);
} else {
sprint( self, strcat( "selectteam none/red/blue/yellow/pink/auto - \"", argv(1), "\" not recognised\n" ) );
}
return;
if((inWarmupStage && 0 >= g_warmup_limit) // with unlimited warmup players have to be able to restart
- || cvar("sv_ready_restart") || g_race_qualifying == 2)
+ || autocvar_sv_ready_restart || g_race_qualifying == 2)
{
- if(!readyrestart_happened || cvar("sv_ready_restart_repeatable"))
+ if(!readyrestart_happened || autocvar_sv_ready_restart_repeatable)
{
if (self.ready) // toggle
{
} else if(cmd == "timeout") {
if not(self.flags & FL_CLIENT)
return;
- if(cvar("sv_timeout")) {
+ if(autocvar_sv_timeout) {
if(self.classname == "player") {
if(votecalled)
sprint(self, "^7Error: you can not call a timeout while a vote is active!\n");
} else if(cmd == "timein") {
if not(self.flags & FL_CLIENT)
return;
- if(cvar("sv_timeout")) {
+ if(autocvar_sv_timeout) {
evaluateTimein();
}
} else if(cmd == "teamstatus") {
if(self.jointime > 0 && time > self.jointime + 10 && time > self.nickspamtime) // allow any changes in the first 10 seconds since joining
if(cmd == "name" || cmd == "playermodel") // TODO also playerskin and color?
{
- if(self.nickspamtime == 0 || time > self.nickspamtime + cvar("g_nick_flood_timeout"))
+ if(self.nickspamtime == 0 || time > self.nickspamtime + autocvar_g_nick_flood_timeout)
// good, no serious flood
self.nickspamcount = 1;
else
self.nickspamcount += 1;
- self.nickspamtime = time + cvar("g_nick_flood_penalty");
+ self.nickspamtime = time + autocvar_g_nick_flood_penalty;
if (timeoutStatus == 2) //when game is paused, no flood protection
self.nickspamcount = self.nickspamtime = 0;
if (checkrules_overtimesadded > 0 && g_race_qualifying != 2) {
//we have to decrease timelimit to its original value again!!
float newTL;
- newTL = cvar("timelimit");
- newTL -= checkrules_overtimesadded * cvar("timelimit_overtime");
+ newTL = autocvar_timelimit;
+ newTL -= checkrules_overtimesadded * autocvar_timelimit_overtime;
cvar_set("timelimit", ftos(newTL));
}
readycount = 0;
Nagger_ReadyCounted(); // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
- if(cvar("teamplay_lockonrestart") && teams_matter) {
+ if(autocvar_teamplay_lockonrestart && teams_matter) {
lockteams = 1;
bprint("^1The teams are now locked.\n");
}
//initiate the restart-countdown-announcer entity
- if(cvar("sv_ready_restart_after_countdown") && !g_ca && !g_arena)
+ if(autocvar_sv_ready_restart_after_countdown && !g_ca && !g_arena)
{
restartTimer = spawn();
restartTimer.think = restartTimer_Think;
}
//after a restart every players number of allowed timeouts gets reset, too
- if(cvar("sv_timeout"))
+ if(autocvar_sv_timeout)
{
FOR_EACH_REALPLAYER(e)
- e.allowedTimeouts = cvar("sv_timeout_number");
+ e.allowedTimeouts = autocvar_sv_timeout_number;
}
//reset map immediately if this cvar is not set
- if (!cvar("sv_ready_restart_after_countdown"))
+ if (!autocvar_sv_ready_restart_after_countdown)
reset_map(TRUE);
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(":restart");
}
// reset ALL scores, but only do that at the beginning
//of the countdown if sv_ready_restart_after_countdown is off!
//Otherwise scores could be manipulated during the countdown!
- if (!cvar("sv_ready_restart_after_countdown"))
+ if (!autocvar_sv_ready_restart_after_countdown)
Score_ClearAll();
}
return sprint(self, "^7Error: You can not call a timeout while the map is being restarted!\n");
if (timeoutStatus != 2) {
//if the map uses a timelimit make sure that timeout cannot be called right before the map ends
- if (cvar("timelimit")) {
+ if (autocvar_timelimit) {
//a timelimit was used
local float myTl;
- myTl = cvar("timelimit");
+ myTl = autocvar_timelimit;
local float lastPossibleTimeout;
- lastPossibleTimeout = (myTl*60) - cvar("sv_timeout_leadtime") - 1;
+ lastPossibleTimeout = (myTl*60) - autocvar_sv_timeout_leadtime - 1;
if (lastPossibleTimeout < time - game_starttime)
return sprint(self, "^7Error: It is too late to call a timeout now!\n");
//now all required checks are passed
self.allowedTimeouts -= 1;
bprint(self.netname, " ^7called a timeout (", ftos(self.allowedTimeouts), " timeouts left)!\n"); //write a bprint who started the timeout (and how many he has left)
- remainingTimeoutTime = cvar("sv_timeout_length");
- remainingLeadTime = cvar("sv_timeout_leadtime");
+ remainingTimeoutTime = autocvar_sv_timeout_length;
+ remainingLeadTime = autocvar_sv_timeout_leadtime;
timeoutInitiator = self;
if (timeoutStatus == 0) { //if another timeout was already active, don't change its status (which was 1 or 2) to 1, only change it to 1 if no timeout was active yet
timeoutStatus = 1;
}
else if (timeoutStatus == 2) {
//only shorten the remainingTimeoutTime if it makes sense
- if( remainingTimeoutTime > (cvar("sv_timeout_resumetime") + 1) ) {
+ if( remainingTimeoutTime > (autocvar_sv_timeout_resumetime + 1) ) {
bprint(strcat("^1Attention: ^7", self.netname, " resumed the game! Prepare for battle!\n"));
- remainingTimeoutTime = cvar("sv_timeout_resumetime");
+ remainingTimeoutTime = autocvar_sv_timeout_resumetime;
timeoutHandler.nextthink = time; //timeoutHandler has to take care of it immediately
}
else
WriteByte(MSG_ONE, 3); // svc_updatestat
WriteByte(MSG_ONE, 236); // STAT_TIMELIMIT
if(t < 0)
- WriteCoord(MSG_ONE, cvar("timelimit"));
+ WriteCoord(MSG_ONE, autocvar_timelimit);
else
WriteCoord(MSG_ONE, (t + 1) / 60);
}
void LogCTF(string mode, float flagteam, entity actor)
{
string s;
- if(!cvar("sv_eventlog"))
+ if(!autocvar_sv_eventlog)
return;
s = strcat(":ctf:", mode);
s = strcat(s, ":", ftos(flagteam));
sound (self, CHAN_TRIGGER, self.noise4, VOL_BASE, ATTN_NONE);
setattachment(e, world, "");
- e.damageforcescale = cvar("g_balance_ctf_damageforcescale");
+ e.damageforcescale = autocvar_g_balance_ctf_damageforcescale;
e.takedamage = DAMAGE_YES;
if (p.flagcarried == e)
setorigin(e, p.origin - '0 0 24' + '0 0 37');
e.cnt = FLAG_DROPPED;
e.velocity = '0 0 300';
- e.pain_finished = time + cvar("g_ctf_flag_returntime");//30;
+ e.pain_finished = time + autocvar_g_ctf_flag_returntime;//30;
trace_startsolid = FALSE;
tracebox(e.origin, e.mins, e.maxs, e.origin, TRUE, e);
return;
}
- if(cvar("g_ctf_allow_drop"))
+ if(autocvar_g_ctf_allow_drop)
if(e.BUTTON_USE)
DropFlag(self, e, world);
};
{
return;
}
- if(cvar("g_ctf_captimerecord_always") || player_count - currentbots <= 1) // at most one human
+ if(autocvar_g_ctf_captimerecord_always || player_count - currentbots <= 1) // at most one human
{
t = time - other.flagcarried.flagpickuptime;
s = ftos_decimals(t, 2);
// give credit to the individual player
UpdateFrags(other, ctf_score_value("score_capture"));
- if (cvar("g_ctf_flag_capture_effects")) {
+ if (autocvar_g_ctf_flag_capture_effects) {
if (other.team == COLOR_TEAM1) { // red team scores effect
pointparticles(particleeffectnum("red_ground_quake"), self.origin, '0 0 0', 1);
flag_cap_ring_spawn(self.origin);
if (other.next_take_time > time)
return;
- if (cvar("g_ctf_flag_pickup_effects")) // pickup effect
+ if (autocvar_g_ctf_flag_pickup_effects) // pickup effect
pointparticles(particleeffectnum("smoke_ring"), 0.5 * (self.absmin + self.absmax), '0 0 0', 1);
// pick up
sound (other, CHAN_AUTO, self.noise1, VOL_BASE, ATTN_NONE);
ReturnFlag(self);
}
- else if (!other.flagcarried && (other.playerid != self.dropperid || time > self.ctf_droptime + cvar("g_balance_ctf_delay_collect")))
+ else if (!other.flagcarried && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_balance_ctf_delay_collect))
{
if(self.waypointsprite_attachedforcarrier)
WaypointSprite_DetachCarrier(self);
- if (cvar("g_ctf_flag_pickup_effects")) // field pickup effect
+ if (autocvar_g_ctf_flag_pickup_effects) // field pickup effect
pointparticles(particleeffectnum("smoke_ring"), 0.5 * (self.absmin + self.absmax), '0 0 0', 1);
// pick up
//bprint(other.netname, "^7 picked up the ", self.netname, "\n");
float f;
- f = bound(0, (self.pain_finished - time) / cvar("g_ctf_flag_returntime"), 1);
+ f = bound(0, (self.pain_finished - time) / autocvar_g_ctf_flag_returntime, 1);
//print("factor is ", ftos(f), "\n");
f = ctf_score_value("score_pickup_dropped_late") * (1-f)
+ ctf_score_value("score_pickup_dropped_early") * f;
{ // Check CTF Item Flag Post Spawn
// Flag Glow Trail Support
- if(cvar("g_ctf_flag_glowtrails"))
+ if(autocvar_g_ctf_flag_glowtrails)
{ // Provide Flag Glow Trail
if(self.team == COLOR_TEAM1)
// Red
return;
}
- //if(!cvar("teamplay"))
- // cvar_set("teamplay", "3");
-
// link flag into ctf_worldflaglist
self.ctf_worldflagnext = ctf_worldflaglist;
ctf_worldflaglist = self;
}
self.netname = "^1RED^7 flag";
self.target = "###item###";
- self.skin = cvar("g_ctf_flag_red_skin");
+ self.skin = autocvar_g_ctf_flag_red_skin;
if(self.spawnflags & 1)
self.noalign = 1;
if (!self.model)
- self.model = cvar_string("g_ctf_flag_red_model");
+ self.model = autocvar_g_ctf_flag_red_model;
if (!self.noise)
self.noise = "ctf/red_taken.wav";
if (!self.noise1)
// self.glow_size = 50;
self.effects = self.effects | EF_LOWPRECISION;
- if(cvar("g_ctf_fullbrightflags"))
+ if(autocvar_g_ctf_fullbrightflags)
self.effects |= EF_FULLBRIGHT;
- if(cvar("g_ctf_dynamiclights"))
+ if(autocvar_g_ctf_dynamiclights)
self.effects |= EF_RED;
// From Spidflisk
remove(self);
return;
}
- //if(!cvar("teamplay"))
- // cvar_set("teamplay", "3");
// link flag into ctf_worldflaglist
self.ctf_worldflagnext = ctf_worldflaglist;
}
self.netname = "^4BLUE^7 flag";
self.target = "###item###";
- self.skin = cvar("g_ctf_flag_blue_skin");
+ self.skin = autocvar_g_ctf_flag_blue_skin;
if(self.spawnflags & 1)
self.noalign = 1;
if (!self.model)
- self.model = cvar_string("g_ctf_flag_blue_model");
+ self.model = autocvar_g_ctf_flag_blue_model;
if (!self.noise)
self.noise = "ctf/blue_taken.wav";
if (!self.noise1)
// self.glow_size = 50;
self.effects = self.effects | EF_LOWPRECISION;
- if(cvar("g_ctf_fullbrightflags"))
+ if(autocvar_g_ctf_fullbrightflags)
self.effects |= EF_FULLBRIGHT;
- if(cvar("g_ctf_dynamiclights"))
+ if(autocvar_g_ctf_dynamiclights)
self.effects |= EF_BLUE;
// From Spidflisk
InitializeEntity(world, ctf_delayedinit, INITPRIO_GAMETYPE);
flagcaptimerecord = stof(db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time")));
- captureshield_min_negscore = cvar("g_ctf_shield_min_negscore");
- captureshield_max_ratio = cvar("g_ctf_shield_max_ratio");
- captureshield_force = cvar("g_ctf_shield_force");
+ captureshield_min_negscore = autocvar_g_ctf_shield_min_negscore;
+ captureshield_max_ratio = autocvar_g_ctf_shield_max_ratio;
+ captureshield_force = autocvar_g_ctf_shield_force;
+
+
+//#NO AUTOCVARS START
+ g_ctf_win_mode = cvar("g_ctf_win_mode");
+//#NO AUTOCVARS END
};
void ctf_setstatus2(entity flag, float shift)
.entity weaponentity;
.entity exteriorweaponentity;
+.vector weaponentity_glowmod;
.float switchweapon;
.float autoswitch;
float weapon_action(float wpn, float wrequest);
//sv_timeout: pauses the game by setting the gamespeed to a really low value (see TIMEOUT_SLOWMO_VALUE)
#define TIMEOUT_SLOWMO_VALUE 0.0001
-float sys_frametime; // gets initialised in worlspawn, saves the value from cvar("sys_ticrate")
+float sys_frametime; // gets initialised in worlspawn, saves the value from autocvar_sys_ticrate
float remainingTimeoutTime; // contains the time in seconds that the active timeout has left
float remainingLeadTime; // contains the number of seconds left of the leadtime (before the timeout starts)
float timeoutStatus; // (values: 0, 1, 2) contains whether a timeout is not active (0), was called but still at leadtime (1) or is active (2)
.float allowedTimeouts; // contains the number of allowed timeouts for each player
entity timeoutInitiator; // contains the entity of the player who started the last timeout
-float orig_slowmo; // contains the value of cvar("slowmo") so that, after timeout finished, it isn't set to slowmo 1 necessarily
+float orig_slowmo; // contains the value of autocvar_slowmo so that, after timeout finished, it isn't set to slowmo 1 necessarily
.vector lastV_angle; //used when pausing the game in order to force the player to keep his old view angle fixed
entity timeoutHandler; //responsible for centerprinting the timeout countdowns and playing sounds
void timeoutHandler_Think();
float sv_maxidle_spectatorsareidle;
float sv_pogostick;
-float sv_doublejump;
float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
float next_pingtime;
void GlobalSound(string samplestring, float channel, float voicetype);
void FakeGlobalSound(string samplestring, float channel, float voicetype);
void VoiceMessage(string type, string message);
+float GetPlayerSoundSampleField_notFound;
+.string GetVoiceMessageSampleField(string type)
// autotaunt system
.float cvar_cl_autotaunt;
.float nex_charge;
.float nex_charge_rottime;
-.float nex_charge_pool_ammo;
+.float nex_chargepool_ammo;
float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
#define DOMPOINTFRAGS frags
-float g_domination_point_amt;
-float g_domination_point_rate;
-
.float enemy_playerid;
.entity sprite;
.float captime;
void LogDom(string mode, float team_before, entity actor)
{
string s;
- if(!cvar("sv_eventlog"))
+ if(!autocvar_sv_eventlog)
return;
s = strcat(":dom:", mode);
s = strcat(s, ":", ftos(team_before));
//bprint("\n");
float points, wait_time;
- if (g_domination_point_amt)
- points = g_domination_point_amt;
+ if (autocvar_g_domination_point_amt)
+ points = autocvar_g_domination_point_amt;
else
points = self.frags;
- if (g_domination_point_rate)
- wait_time = g_domination_point_rate;
+ if (autocvar_g_domination_point_rate)
+ wait_time = autocvar_g_domination_point_rate;
else
wait_time = self.wait;
if (head.noise1 != "")
play2all(head.noise1);
- //self.nextthink = time + cvar("g_domination_point_rate");
+ //self.nextthink = time + autocvar_g_domination_point_rate;
//self.think = dompointthink;
self.delay = time + wait_time;
if (gameover || self.delay > time || time < game_starttime) // game has ended, don't keep giving points
return;
- g_domination_point_rate = cvar("g_domination_point_rate");
- g_domination_point_amt = cvar("g_domination_point_amt");
-
- if(g_domination_point_rate)
- self.delay = time + g_domination_point_rate;
+ if(autocvar_g_domination_point_rate)
+ self.delay = time + autocvar_g_domination_point_rate;
else
self.delay = time + self.wait;
// NOTE: this defaults to 0
if (self.goalentity.netname != "")
{
- if(g_domination_point_amt)
- fragamt = g_domination_point_amt;
+ if(autocvar_g_domination_point_amt)
+ fragamt = autocvar_g_domination_point_amt;
else
fragamt = self.DOMPOINTFRAGS;
TeamScore_AddToTeam(self.goalentity.team, ST_SCORE, fragamt);
void spawnfunc_dom_team()
{
- if(!g_domination || cvar("g_domination_teams_override") >= 2)
+ if(!g_domination || autocvar_g_domination_teams_override >= 2)
{
remove(self);
return;
float c1, c2, c3, c4, totalteams, smallestteam, smallestteam_count, selectedteam;
float balance_teams, force_balance, balance_type;
- balance_teams = cvar("g_balance_teams");
- balance_teams = cvar("g_balance_teams_force");
+ balance_teams = autocvar_g_balance_teams;
+ balance_teams = autocvar_g_balance_teams_force;
c1 = c2 = c3 = c4 = -1;
totalteams = 0;
//if(!self.glow_size)
// self.glow_size = cvar("g_domination_point_glow");
self.effects = self.effects | EF_LOWPRECISION;
- if (cvar("g_domination_point_fullbright"))
+ if (autocvar_g_domination_point_fullbright)
self.effects |= EF_FULLBRIGHT;
};
void dom_spawnteams()
{
float numteams;
- if(cvar("g_domination_teams_override") < 2)
- numteams = cvar("g_domination_default_teams");
+ if(autocvar_g_domination_teams_override < 2)
+ numteams = autocvar_g_domination_default_teams;
else
- numteams = cvar("g_domination_teams_override");
+ numteams = autocvar_g_domination_teams_override;
// LordHavoc: edit this if you want to change defaults
dom_spawnteam("Red", COLOR_TEAM1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point");
dom_spawnteam("Blue", COLOR_TEAM2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point");
local entity head;
// if no teams are found, spawn defaults, if custom teams are set, use them
- if (find(world, classname, "dom_team") == world || cvar("g_domination_teams_override") >= 2)
+ if (find(world, classname, "dom_team") == world || autocvar_g_domination_teams_override >= 2)
dom_spawnteams();
// if no control points are found, spawn defaults
if (find(world, classname, "dom_controlpoint") == world)
precache_model("models/domination/dom_unclaimed.md3");
precache_sound("domination/claim.wav");
InitializeEntity(world, dom_delayedinit, INITPRIO_GAMETYPE);
-
- // teamplay is always on in domination, defaults to hurt self but not teammates
- //if(!teams_matter)
- // cvar_set("teamplay", "3");
};
PlayerScore_Add(targ, SP_DEATHS, 1);
if(g_arena || g_ca)
- if(cvar("g_arena_roundbased"))
+ if(autocvar_g_arena_roundbased)
return;
if(targ != attacker) // not for suicides
void LogDeath(string mode, float deathtype, entity killer, entity killed)
{
string s;
- if(!cvar("sv_eventlog"))
+ if(!autocvar_sv_eventlog)
return;
s = strcat(":kill:", mode);
s = strcat(s, ":", ftos(killer.playerid));
{
if (deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
msg = ColoredTeamName(targ.team); // TODO: check if needed?
- Send_CSQC_Centerprint(targ, msg, "", deathtype, MSG_SUICIDE);
+ if(!g_cts) // no "killed your own dumb self" message in CTS
+ Send_CSQC_Centerprint(targ, msg, "", deathtype, MSG_SUICIDE);
if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
{
Send_CSQC_Centerprint(targ, "", "", KILL_FIRST_VICTIM, MSG_KILL);
}
- if((cvar("sv_fragmessage_information_typefrag")) && (targ.BUTTON_CHAT)) {
+ if((autocvar_sv_fragmessage_information_typefrag) && (targ.BUTTON_CHAT)) {
Send_CSQC_Centerprint(attacker, s, GetAdvancedDeathReports(targ), KILL_TYPEFRAG, MSG_KILL);
Send_CSQC_Centerprint(targ, a, GetAdvancedDeathReports(attacker), KILL_TYPEFRAGGED, MSG_KILL);
} else {
damage = 0;
force = '0 0 0';
}
- else if(attacker.team == targ.team)
+ else if(teams_matter && attacker.team == targ.team)
{
- if(teamplay == 1)
+ if(autocvar_teamplay_mode == 1)
damage = 0;
else if(attacker != targ)
{
- if(teamplay == 3)
+ if(autocvar_teamplay_mode == 3)
damage = 0;
- else if(teamplay == 4)
+ else if(autocvar_teamplay_mode == 4)
{
if(targ.classname == "player" && targ.deadflag == DEAD_NO)
{
- teamdamage0 = max(attacker.dmg_team, cvar("g_teamdamage_threshold"));
+ teamdamage0 = max(attacker.dmg_team, autocvar_g_teamdamage_threshold);
attacker.dmg_team = attacker.dmg_team + damage;
if(attacker.dmg_team > teamdamage0 && !g_ca)
- mirrordamage = cvar("g_mirrordamage") * (attacker.dmg_team - teamdamage0);
- mirrorforce = cvar("g_mirrordamage") * vlen(force);
+ mirrordamage = autocvar_g_mirrordamage * (attacker.dmg_team - teamdamage0);
+ mirrorforce = autocvar_g_mirrordamage * vlen(force);
if(g_minstagib)
{
- if(cvar("g_friendlyfire") == 0)
+ if(autocvar_g_friendlyfire == 0)
damage = 0;
}
else if(g_ca)
damage = 0;
else
- damage = cvar("g_friendlyfire") * damage;
+ damage = autocvar_g_friendlyfire * damage;
// mirrordamage will be used LATER
}
else
if(attacker.classname == "player")
if(attacker != targ)
{
- targ.lms_traveled_distance = cvar("g_lms_campcheck_distance");
- attacker.lms_traveled_distance = cvar("g_lms_campcheck_distance");
+ targ.lms_traveled_distance = autocvar_g_lms_campcheck_distance;
+ attacker.lms_traveled_distance = autocvar_g_lms_campcheck_distance;
}
if(targ.classname == "player")
{
if(targ == attacker)
{
- damage = damage * cvar("g_balance_powerup_strength_selfdamage");
- force = force * cvar("g_balance_powerup_strength_selfforce");
+ damage = damage * autocvar_g_balance_powerup_strength_selfdamage;
+ force = force * autocvar_g_balance_powerup_strength_selfforce;
}
else
{
- damage = damage * cvar("g_balance_powerup_strength_damage");
- force = force * cvar("g_balance_powerup_strength_force");
+ damage = damage * autocvar_g_balance_powerup_strength_damage;
+ force = force * autocvar_g_balance_powerup_strength_force;
}
}
// apply invincibility multiplier
if (targ.items & IT_INVINCIBLE && !g_minstagib)
- damage = damage * cvar("g_balance_powerup_invincible_takedamage");
+ damage = damage * autocvar_g_balance_powerup_invincible_takedamage;
if (targ == attacker)
{
- if(g_ca || (g_cts && !cvar("g_cts_selfdamage")))
+ if(g_ca || (g_cts && !autocvar_g_cts_selfdamage))
damage = 0;
else
- damage = damage * cvar("g_balance_selfdamagepercent"); // Partial damage if the attacker hits himself
+ damage = damage * autocvar_g_balance_selfdamagepercent; // Partial damage if the attacker hits himself
}
// CTF: reduce damage/force
if(targ == attacker)
if(targ.flagcarried)
{
- damage = damage * cvar("g_ctf_flagcarrier_selfdamage");
- force = force * cvar("g_ctf_flagcarrier_selfforce");
+ damage = damage * autocvar_g_ctf_flagcarrier_selfdamage;
+ force = force * autocvar_g_ctf_flagcarrier_selfforce;
}
if(g_runematch)
{
if(attacker.runes & CURSE_WEAK) // have both curse & rune
{
- damage = damage * cvar("g_balance_rune_strength_combo_damage");
- force = force * cvar("g_balance_rune_strength_combo_force");
+ damage = damage * autocvar_g_balance_rune_strength_combo_damage;
+ force = force * autocvar_g_balance_rune_strength_combo_force;
}
else
{
- damage = damage * cvar("g_balance_rune_strength_damage");
- force = force * cvar("g_balance_rune_strength_force");
+ damage = damage * autocvar_g_balance_rune_strength_damage;
+ force = force * autocvar_g_balance_rune_strength_force;
}
}
else if (attacker.runes & CURSE_WEAK)
{
- damage = damage * cvar("g_balance_curse_weak_damage");
- force = force * cvar("g_balance_curse_weak_force");
+ damage = damage * autocvar_g_balance_curse_weak_damage;
+ force = force * autocvar_g_balance_curse_weak_force;
}
// apply defense rune
if (targ.runes & RUNE_DEFENSE)
{
if (targ.runes & CURSE_VULNER) // have both curse & rune
- damage = damage * cvar("g_balance_rune_defense_combo_takedamage");
+ damage = damage * autocvar_g_balance_rune_defense_combo_takedamage;
else
- damage = damage * cvar("g_balance_rune_defense_takedamage");
+ damage = damage * autocvar_g_balance_rune_defense_takedamage;
}
else if (targ.runes & CURSE_VULNER)
- damage = damage * cvar("g_balance_curse_vulner_takedamage");
+ damage = damage * autocvar_g_balance_curse_vulner_takedamage;
}
// count the damage
{
if(damage > 0)
{
- if(attacker.weapon != WEP_ELECTRO && attacker.weapon != WEP_LASER || ((attacker.weapon == WEP_ELECTRO && cvar("g_balance_electro_lightning") || attacker.weapon == WEP_LASER) && attacker.prevhitsound + cvar("sv_hitsound_antispam_time") < time))
+ if(attacker.weapon != WEP_ELECTRO && attacker.weapon != WEP_LASER || ((attacker.weapon == WEP_ELECTRO && autocvar_g_balance_electro_lightning || attacker.weapon == WEP_LASER) && attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time))
{
if(targ.BUTTON_CHAT)
attacker.typehitsound += 1;
headshot = 1;
}
if(g_ca)
- PlayerScore_Add(attacker, SP_SCORE, damage * cvar("g_ca_damage2score_multiplier"));
+ PlayerScore_Add(attacker, SP_SCORE, damage * autocvar_g_ca_damage2score_multiplier);
}
}
else
// apply vampire rune
if (attacker.runes & CURSE_EMPATHY) // have the curse too
{
- //attacker.health = attacker.health + damage * cvar("g_balance_rune_vampire_combo_absorb");
+ //attacker.health = attacker.health + damage * autocvar_g_balance_rune_vampire_combo_absorb;
attacker.health = bound(
- cvar("g_balance_curse_empathy_minhealth"), // LA: was 3, now 40
- attacker.health + damage * cvar("g_balance_rune_vampire_combo_absorb"),
- cvar("g_balance_rune_vampire_maxhealth")); // LA: was 1000, now 500
+ autocvar_g_balance_curse_empathy_minhealth, // LA: was 3, now 40
+ attacker.health + damage * autocvar_g_balance_rune_vampire_combo_absorb,
+ autocvar_g_balance_rune_vampire_maxhealth); // LA: was 1000, now 500
}
else
{
- //attacker.health = attacker.health + damage * cvar("g_balance_rune_vampire_absorb");
+ //attacker.health = attacker.health + damage * autocvar_g_balance_rune_vampire_absorb;
attacker.health = bound(
attacker.health, // LA: was 3, but changed so that you can't lose health
// empathy won't let you gain health in the same way...
- attacker.health + damage * cvar("g_balance_rune_vampire_absorb"),
- cvar("g_balance_rune_vampire_maxhealth")); // LA: was 1000, now 500
+ attacker.health + damage * autocvar_g_balance_rune_vampire_absorb,
+ autocvar_g_balance_rune_vampire_maxhealth); // LA: was 1000, now 500
}
}
// apply empathy curse
else if (attacker.runes & CURSE_EMPATHY)
{
attacker.health = bound(
- cvar("g_balance_curse_empathy_minhealth"), // LA: was 3, now 20
- attacker.health + damage * cvar("g_balance_curse_empathy_takedamage"),
+ autocvar_g_balance_curse_empathy_minhealth, // LA: was 3, now 20
+ attacker.health + damage * autocvar_g_balance_curse_empathy_takedamage,
attacker.health);
}
}
if(RadiusDamage_running)
{
- string save;
- print("RadiusDamage called recursively!\n");
- print("Expect stuff to go HORRIBLY wrong.\n");
- print("Causing a stack trace...\n");
- save = cvar_string("prvm_backtraceforwarnings");
- cvar_set("prvm_backtraceforwarnings", "1");
- fclose(-1); // calls VM_Warning
- cvar_set("prvm_backtraceforwarnings", save);
+ backtrace("RadiusDamage called recursively! Expect stuff to go HORRIBLY wrong.");
return 0;
}
RadiusDamage_running = 1;
- tfloordmg = cvar("g_throughfloor_damage");
- tfloorforce = cvar("g_throughfloor_force");
+ tfloordmg = autocvar_g_throughfloor_damage;
+ tfloorforce = autocvar_g_throughfloor_force;
blastorigin = (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5);
total_damage_to_creatures = 0;
float force_velocitybiasramp;
float force_velocitybias;
- force_velocitybiasramp = cvar("sv_maxspeed");
+ force_velocitybiasramp = autocvar_sv_maxspeed;
if(deathtype & HITTYPE_SECONDARY)
{
- force_zscale = cvar("g_balance_laser_secondary_force_zscale");
- force_velocitybias = cvar("g_balance_laser_secondary_force_velocitybias");
+ force_zscale = autocvar_g_balance_laser_secondary_force_zscale;
+ force_velocitybias = autocvar_g_balance_laser_secondary_force_velocitybias;
}
else
{
- force_zscale = cvar("g_balance_laser_primary_force_zscale");
- force_velocitybias = cvar("g_balance_laser_primary_force_velocitybias");
+ force_zscale = autocvar_g_balance_laser_primary_force_zscale;
+ force_velocitybias = autocvar_g_balance_laser_primary_force_velocitybias;
}
vel = targ.velocity;
if not(IS_INDEPENDENT_PLAYER(other))
if(boxesoverlap(e.absmin, e.absmax, other.absmin, other.absmax))
{
- t = cvar("g_balance_firetransfer_time") * (e.fire_endtime - time);
- d = cvar("g_balance_firetransfer_damage") * e.fire_damagepersec * t;
+ t = autocvar_g_balance_firetransfer_time * (e.fire_endtime - time);
+ d = autocvar_g_balance_firetransfer_damage * e.fire_damagepersec * t;
Fire_AddDamage(other, o, d, t, DEATH_FIRE);
}
}
if(self.state == 1)
{
- pullspeed = cvar("g_balance_grapplehook_speed_pull");//2000;
+ pullspeed = autocvar_g_balance_grapplehook_speed_pull;//2000;
// speed the rope is pulled with
- rubberforce = cvar("g_balance_grapplehook_force_rubber");//2000;
+ rubberforce = autocvar_g_balance_grapplehook_force_rubber;//2000;
// force the rope will use if it is stretched
- rubberforce_overstretch = cvar("g_balance_grapplehook_force_rubber_overstretch");//1000;
+ rubberforce_overstretch = autocvar_g_balance_grapplehook_force_rubber_overstretch;//1000;
// force the rope will use if it is stretched
- minlength = cvar("g_balance_grapplehook_length_min");//100;
+ minlength = autocvar_g_balance_grapplehook_length_min;//100;
// minimal rope length
// if the rope goes below this length, it isn't pulled any more
- ropestretch = cvar("g_balance_grapplehook_stretch");//400;
+ ropestretch = autocvar_g_balance_grapplehook_stretch;//400;
// if the rope is stretched by more than this amount, more rope is
// given to you again
- ropeairfriction = cvar("g_balance_grapplehook_airfriction");//0.2
+ ropeairfriction = autocvar_g_balance_grapplehook_airfriction;//0.2
// while hanging on the rope, this friction component will help you a
// bit to control the rope
dist = vlen(dir);
dir = normalize(dir);
- if(cvar("g_grappling_hook_tarzan"))
+ if(autocvar_g_grappling_hook_tarzan)
{
v = v0 = WarpZone_RefSys_TransformVelocity(self.owner, self, self.owner.velocity);
v = v + frametime * dir * spd * rubberforce;
dv = ((v - v0) * dir) * dir;
- if(cvar("g_grappling_hook_tarzan") >= 2)
+ if(autocvar_g_grappling_hook_tarzan >= 2)
{
if(self.aiment.movetype == MOVETYPE_WALK)
{
self.aiment.velocity = self.aiment.velocity - dv * 0.5;
self.aiment.flags &~= FL_ONGROUND;
self.aiment.pusher = self.owner;
- self.aiment.pushltime = time + cvar("g_maxpushtime");
+ self.aiment.pushltime = time + autocvar_g_maxpushtime;
}
}
if(attacker != self.owner)
{
self.owner.pusher = attacker;
- self.owner.pushltime = time + cvar("g_maxpushtime");
+ self.owner.pushltime = time + autocvar_g_maxpushtime;
}
RemoveGrapplingHook(self.owner);
}
missile.state = 0; // not latched onto anything
- W_SetupProjectileVelocityEx(missile, v_forward, v_up, cvar("g_balance_grapplehook_speed_fly"), 0, 0, 0, FALSE);
+ W_SetupProjectileVelocityEx(missile, v_forward, v_up, autocvar_g_balance_grapplehook_speed_fly, 0, 0, 0, FALSE);
missile.angles = vectoangles (missile.velocity);
//missile.glow_color = 250; // 244, 250
missile.effects = /*EF_FULLBRIGHT | EF_ADDITIVE |*/ EF_LOWPRECISION;
- missile.health = cvar("g_balance_grapplehook_health");//120
+ missile.health = autocvar_g_balance_grapplehook_health;//120
missile.event_damage = GrapplingHook_Damage;
missile.takedamage = DAMAGE_AIM;
missile.damageforcescale = 0;
}
void traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
{
- if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+ if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
lag = 0;
traceline_antilag_force(source, v1, v2, nomonst, forent, lag);
}
void tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
{
- if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+ if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
lag = 0;
tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, FALSE);
}
}
void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
{
- if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+ if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
lag = 0;
WarpZone_traceline_antilag_force(source, v1, v2, nomonst, forent, lag);
}
void WarpZone_tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
{
- if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+ if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
lag = 0;
tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, TRUE);
}
{
float d;
- if(cvar("loddebug"))
+ if(autocvar_loddebug)
{
- d = cvar("loddebug");
+ d = autocvar_loddebug;
if(d == 1)
self.modelindex = self.lodmodelindex0;
else if(d == 2 || !self.lodmodelindex2)
}
}
- if(cvar("loddebug") < 0)
+ if(autocvar_loddebug < 0)
{
self.lodmodel1 = self.lodmodel2 = ""; // don't even initialize
}
{
// trigger angles are used for one-way touches. An angle of 0 is assumed
// to mean no restrictions, so use a yaw of 360 instead.
- if (self.movedir == '0 0 0')
- if (self.angles != '0 0 0')
- SetMovedir ();
+ SetMovedir ();
self.solid = SOLID_TRIGGER;
SetBrushEntityModel();
self.movetype = MOVETYPE_NONE;
{
// trigger angles are used for one-way touches. An angle of 0 is assumed
// to mean no restrictions, so use a yaw of 360 instead.
- if (self.movedir == '0 0 0')
- if (self.angles != '0 0 0')
- SetMovedir ();
+ SetMovedir ();
self.solid = SOLID_BSP;
SetBrushEntityModel();
self.movetype = MOVETYPE_NONE; // why was this PUSH? -div0
t.message = self.message;
t.killtarget = self.killtarget;
t.target = self.target;
+ t.target2 = self.target2;
+ t.target3 = self.target3;
+ t.target4 = self.target4;
return;
}
void multi_touch()
{
if not(self.spawnflags & 2)
- {
if not(other.iscreature)
return;
- if(self.team)
- if(self.team == other.team)
+ if(self.team)
+ if((self.spawnflags & 4 == 0) == (self.team != other.team))
return;
- }
// if the trigger has an angles field, check player's facing direction
if (self.movedir != '0 0 0')
if (other.health < self.max_health)
{
other.health = min(other.health + self.health, self.max_health);
- other.pauserothealth_finished = max(other.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));
+ other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
}
}
// TODO add a way to do looped sounds with sound(); then complete this entity
.float volume, atten;
-void target_speaker_use() {sound(self, CHAN_TRIGGER, self.noise, VOL_BASE * self.volume, self.atten);}
+void target_speaker_use_off();
+void target_speaker_use_activator()
+{
+ if(clienttype(activator) != CLIENTTYPE_REAL)
+ return;
+ string snd;
+ if(substring(self.noise, 0, 1) == "*")
+ {
+ var .string sample;
+ sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
+ if(GetPlayerSoundSampleField_notFound)
+ snd = "misc/null.wav";
+ else if(activator.sample == "")
+ snd = "misc/null.wav";
+ else
+ {
+ tokenize_console(activator.sample);
+ float n;
+ n = stof(argv(1));
+ if(n > 0)
+ snd = strcat(argv(0), ftos(floor(random() * n + 1)), ".wav"); // randomization
+ else
+ snd = strcat(argv(0), ".wav"); // randomization
+ }
+ }
+ else
+ snd = self.noise;
+ msg_entity = activator;
+ soundto(MSG_ONE, self, CHAN_TRIGGER, snd, VOL_BASE * self.volume, self.atten);
+}
+void target_speaker_use_on()
+{
+ string snd;
+ if(substring(self.noise, 0, 1) == "*")
+ {
+ var .string sample;
+ sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
+ if(GetPlayerSoundSampleField_notFound)
+ snd = "misc/null.wav";
+ else if(activator.sample == "")
+ snd = "misc/null.wav";
+ else
+ {
+ tokenize_console(activator.sample);
+ float n;
+ n = stof(argv(1));
+ if(n > 0)
+ snd = strcat(argv(0), ftos(floor(random() * n + 1)), ".wav"); // randomization
+ else
+ snd = strcat(argv(0), ".wav"); // randomization
+ }
+ }
+ else
+ snd = self.noise;
+ sound(self, CHAN_TRIGGER, snd, VOL_BASE * self.volume, self.atten);
+ if(self.spawnflags & 3)
+ self.use = target_speaker_use_off;
+}
+void target_speaker_use_off()
+{
+ sound(self, CHAN_TRIGGER, "misc/null.wav", VOL_BASE * self.volume, self.atten);
+ self.use = target_speaker_use_on;
+}
+void target_speaker_reset()
+{
+ if(self.spawnflags & 1) // LOOPED_ON
+ {
+ if(self.use == target_speaker_use_on)
+ target_speaker_use_on();
+ }
+ else if(self.spawnflags & 2)
+ {
+ if(self.use == target_speaker_use_off)
+ target_speaker_use_off();
+ }
+}
void spawnfunc_target_speaker()
{
+ // TODO: "*" prefix to sound file name
+ // TODO: wait and random (just, HOW? random is not a field)
if(self.noise)
precache_sound (self.noise);
- IFTARGETED
+
+ if(!self.atten && !(self.spawnflags & 4))
{
- if(!self.atten)
+ IFTARGETED
self.atten = ATTN_NORM;
- else if(self.atten < 0)
- self.atten = 0;
- if(!self.volume)
- self.volume = 1;
- self.use = target_speaker_use;
+ else
+ self.atten = ATTN_STATIC;
+ }
+ else if(self.atten < 0)
+ self.atten = 0;
+
+ if(!self.volume)
+ self.volume = 1;
+
+ IFTARGETED
+ {
+ if(self.spawnflags & 8) // ACTIVATOR
+ self.use = target_speaker_use_activator;
+ else if(self.spawnflags & 1) // LOOPED_ON
+ {
+ target_speaker_use_on();
+ self.reset = target_speaker_reset;
+ }
+ else if(self.spawnflags & 2) // LOOPED_OFF
+ {
+ self.use = target_speaker_use_on;
+ self.reset = target_speaker_reset;
+ }
+ else
+ self.use = target_speaker_use_on;
+ }
+ else if(self.spawnflags & 1) // LOOPED_ON
+ {
+ ambientsound (self.origin, self.noise, VOL_BASE * self.volume, self.atten);
+ remove(self);
+ }
+ else if(self.spawnflags & 2) // LOOPED_OFF
+ {
+ objerror("This sound entity can never be activated");
}
else
{
- if(!self.atten)
- self.atten = ATTN_STATIC;
- else if(self.atten < 0)
- self.atten = 0;
- if(!self.volume)
- self.volume = 1;
+ // Quake/Nexuiz fallback
ambientsound (self.origin, self.noise, VOL_BASE * self.volume, self.atten);
+ remove(self);
}
};
EXACTTRIGGER_INIT;
if(self.radius)
{
- if(!self.strength) self.strength = 2000 * cvar("g_triggerimpulse_radial_multiplier");
+ if(!self.strength) self.strength = 2000 * autocvar_g_triggerimpulse_radial_multiplier;
setorigin(self, self.origin);
setsize(self, '-1 -1 -1' * self.radius,'1 1 1' * self.radius);
self.touch = trigger_impulse_touch3;
{
if(self.target)
{
- if(!self.strength) self.strength = 950 * cvar("g_triggerimpulse_directional_multiplier");
+ if(!self.strength) self.strength = 950 * autocvar_g_triggerimpulse_directional_multiplier;
self.touch = trigger_impulse_touch1;
}
else
{
if(!self.strength) self.strength = 0.9;
- self.strength = pow(self.strength, cvar("g_triggerimpulse_accel_power")) * cvar("g_triggerimpulse_accel_multiplier");
+ self.strength = pow(self.strength, autocvar_g_triggerimpulse_accel_power) * autocvar_g_triggerimpulse_accel_multiplier;
self.touch = trigger_impulse_touch2;
}
}
void SetDefaultAlpha()
{
- if(cvar("g_running_guns"))
+ if(autocvar_g_running_guns)
{
default_player_alpha = -1;
default_weapon_alpha = +1;
}
else if(g_cloaked)
{
- default_player_alpha = cvar("g_balance_cloaked_alpha");
+ default_player_alpha = autocvar_g_balance_cloaked_alpha;
default_weapon_alpha = default_player_alpha;
}
else
{
- default_player_alpha = cvar("g_player_alpha");
+ default_player_alpha = autocvar_g_player_alpha;
if(default_player_alpha == 0)
default_player_alpha = 1;
default_weapon_alpha = default_player_alpha;
{
float a, b;
- if(!cvar("developer_fteqccbugs"))
+ if(!autocvar_developer_fteqccbugs)
return;
dprint("*** fteqcc test: checking for bugs...\n");
centerprint_atprio(plr, CENTERPRIO_SPAM, timeStr);
}
}
- if(remainingTimeoutTime == cvar("sv_timeout_resumetime")) { //play a warning sound when only <sv_timeout_resumetime> seconds are left
+ if(remainingTimeoutTime == autocvar_sv_timeout_resumetime) { //play a warning sound when only <sv_timeout_resumetime> seconds are left
Announce("prepareforbattle");
}
remainingTimeoutTime -= 1;
void GotoFirstMap()
{
float n;
- if(cvar("_sv_init"))
+ if(autocvar__sv_init)
{
// cvar_set("_sv_init", "0");
// we do NOT set this to 0 any more, so someone "accidentally" changing
// to this "init" map on a dedicated server will cause no permanent
// harm
- if(cvar("g_maplist_shuffle"))
+ if(autocvar_g_maplist_shuffle)
ShuffleMaplist();
- n = tokenizebyseparator(cvar_string("g_maplist"), " ");
+ n = tokenizebyseparator(autocvar_g_maplist, " ");
cvar_set("g_maplist_index", ftos(n - 1)); // jump to map 0 in GotoNextMap
MapInfo_Enumerate();
k = bufstr_get(h, i);
#define BADPREFIX(p) if(substring(k, 0, strlen(p)) == p) continue
+#define BADPRESUFFIX(p,s) if(substring(k, 0, strlen(p)) == p && substring(k, -strlen(s), -1) == s) continue
#define BADCVAR(p) if(k == p) continue
// internal
BADPREFIX("csqc_");
BADCVAR("g_nexball_goallimit");
BADCVAR("g_runematch_point_limit");
BADCVAR("g_start_delay");
+ BADCVAR("g_weapon_stay"); BADPRESUFFIX("g_", "_weapon_stay");
BADCVAR("hostname");
BADCVAR("log_file");
BADCVAR("maxplayers");
BADCVAR("sv_vote_simple_majority_factor");
BADCVAR("timelimit_override");
- if(cvar("g_minstagib"))
+ if(autocvar_g_minstagib)
{
BADCVAR("g_grappling_hook");
BADCVAR("g_jetpack");
TemporaryDB = db_create();
- /*
- TODO sound pack system
- // initialize sound pack system
- soundpack = cvar_string("g_soundpack");
- if(soundpack != "")
- soundpack = strcat(soundpack, "/");
- soundpack = strzone(soundpack);
- */
-
// 0 normal
lightstyle(0, "m");
// 63 testing
lightstyle(63, "a");
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
CampaignPreInit();
Map_MarkAsRecent(mapname);
LaserInit();
player_count = 0;
- bot_waypoints_for_items = cvar("g_waypoints_for_items");
+ bot_waypoints_for_items = autocvar_g_waypoints_for_items;
if(bot_waypoints_for_items == 1)
if(self.spawnflags & SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS)
bot_waypoints_for_items = 0;
// for setting by mapinfo
- q3acompat_machineshotgunswap = cvar("sv_q3acompat_machineshotgunswap");
+ q3acompat_machineshotgunswap = autocvar_sv_q3acompat_machineshotgunswap;
cvar_set("sv_q3acompat_machineshotgunswap", "0");
precache();
// dom_init();
GameLogInit(); // prepare everything
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
{
- s = strcat(cvar_string("sv_eventlog_files_counter"), ".");
+ s = strcat(ftos(autocvar_sv_eventlog_files_counter), ".");
s = strcat(s, ftos(random()));
matchid = strzone(s);
s = ret_string;
// simple, probably not good in the mutator system
- if(cvar("g_grappling_hook"))
+ if(autocvar_g_grappling_hook)
s = strcat(s, ":grappling_hook");
// initialiation stuff, not good in the mutator system
- if(!cvar("g_use_ammunition"))
+ if(!autocvar_g_use_ammunition)
s = strcat(s, ":no_use_ammunition");
// initialiation stuff, not good in the mutator system
- if(!cvar("g_pickup_items"))
+ if(!autocvar_g_pickup_items)
s = strcat(s, ":no_pickup_items");
// initialiation stuff, not good in the mutator system
- if(cvar_string("g_weaponarena") != "0")
- s = strcat(s, ":", cvar_string("g_weaponarena"), " arena");
+ if(autocvar_g_weaponarena != "0")
+ s = strcat(s, ":", autocvar_g_weaponarena, " arena");
// TODO to mutator system
- if(cvar("g_norecoil"))
+ if(autocvar_g_norecoil)
s = strcat(s, ":norecoil");
// TODO to mutator system
- if(cvar("g_midair"))
+ if(autocvar_g_midair)
s = strcat(s, ":midair");
// TODO to mutator system
- if(cvar("g_minstagib"))
+ if(autocvar_g_minstagib)
s = strcat(s, ":minstagib");
GameLogEcho(s);
SetDefaultAlpha();
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
CampaignPostInit();
fteqcc_testbugs();
addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
- addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_charge_pool_ammo);
+ addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_chargepool_ammo);
if(g_ca || g_freezetag)
{
lsnewmaps_reply = strzone(strcat(lsnewmaps_reply, "\n"));
maplist_reply = "^7Maps in list: ";
- n = tokenize_console(cvar_string("g_maplist"));
+ n = tokenize_console(autocvar_g_maplist);
for(i = 0, j = 0; i < n; ++i)
{
if(MapInfo_CheckMap(argv(i)))
localcmd("\n_sv_hook_gamestart ", GetGametype(), "\n");
// fill sv_curl_serverpackages from .serverpackage files
- if(cvar("sv_curl_serverpackages_auto"))
+ if(autocvar_sv_curl_serverpackages_auto)
{
fd = search_begin("*.serverpackage", TRUE, FALSE);
s = "";
string map;
map = GetMapname();
- idx = cvar("g_maplist_index");
+ idx = autocvar_g_maplist_index;
if(idx >= 0)
if(idx < Map_Count)
float MapHasRightSize(string map)
{
float fh;
- if(currentbots || cvar("bot_number") || player_count < cvar("minplayers"))
- if(cvar("g_maplist_check_waypoints"))
+ if(currentbots || autocvar_bot_number || player_count < autocvar_minplayers)
+ if(autocvar_g_maplist_check_waypoints)
{
dprint("checkwp "); dprint(map);
fh = fopen(strcat("maps/", map, ".waypoints"), FILE_READ);
void Map_MarkAsRecent(string m)
{
- cvar_set("g_maplist_mostrecent", strwords(strcat(m, " ", cvar_string("g_maplist_mostrecent")), max(0, cvar("g_maplist_mostrecent_count"))));
+ cvar_set("g_maplist_mostrecent", strwords(strcat(m, " ", autocvar_g_maplist_mostrecent), max(0, autocvar_g_maplist_mostrecent_count)));
}
float Map_IsRecent(string m)
{
- return strhasword(cvar_string("g_maplist_mostrecent"), m);
+ return strhasword(autocvar_g_maplist_mostrecent, m);
}
float Map_Check(float position, float pass)
newlist = strcat(newlist, " ", argv(j));
newlist = substring(newlist, 1, strlen(newlist) - 1);
cvar_set("g_maplist", newlist);
- Map_Count = tokenizebyseparator(cvar_string("g_maplist"), " ");
+ Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
// NOTE: the selected map has just been inserted at (insertpos-1)th position
Map_Current = insertpos - 1; // this is not really valid, but this way the fallback has a chance of working
void Maplist_Init()
{
- Map_Count = tokenizebyseparator(cvar_string("g_maplist"), " ");
+ Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
if(Map_Count == 0)
{
bprint( "Maplist is empty! Resetting it to default map list.\n" );
cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
- if(cvar("g_maplist_shuffle"))
+ if(autocvar_g_maplist_shuffle)
ShuffleMaplist();
localcmd("\nmenu_cmd sync\n");
- Map_Count = tokenizebyseparator(cvar_string("g_maplist"), " ");
+ Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
}
if(Map_Count == 0)
error("empty maplist, cannot select a new map");
nextMap = -1;
if(nextMap == -1)
- if(cvar("g_maplist_shuffle") > 0)
- nextMap = MaplistMethod_Shuffle(cvar("g_maplist_shuffle") + 1);
+ if(autocvar_g_maplist_shuffle > 0)
+ nextMap = MaplistMethod_Shuffle(autocvar_g_maplist_shuffle + 1);
if(nextMap == -1)
- if(cvar("g_maplist_selectrandom"))
+ if(autocvar_g_maplist_selectrandom)
nextMap = MaplistMethod_Random();
if(nextMap == -1)
float DoNextMapOverride()
{
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
{
CampaignPostIntermission();
alreadychangedlevel = TRUE;
return TRUE;
}
- if(cvar("quit_when_empty"))
+ if(autocvar_quit_when_empty)
{
if(player_count <= currentbots)
{
return TRUE;
}
}
- if(cvar_string("quit_and_redirect") != "")
+ if(autocvar_quit_and_redirect != "")
{
- redirection_target = strzone(cvar_string("quit_and_redirect"));
+ redirection_target = strzone(autocvar_quit_and_redirect);
alreadychangedlevel = TRUE;
return TRUE;
}
- if (cvar("samelevel")) // if samelevel is set, stay on same level
+ if (autocvar_samelevel) // if samelevel is set, stay on same level
{
// this does not work because it tries to exec maps/nexdm01.mapcfg (which doesn't exist, it should be trying maps/dm_nexdm01.mapcfg for example)
//localcmd(strcat("exec \"maps/", mapname, ".mapcfg\"\n"));
alreadychangedlevel = TRUE;
return TRUE;
}
- if(cvar_string("nextmap") != "")
- if(MapInfo_CheckMap(cvar_string("nextmap")))
+ if(autocvar_nextmap != "")
+ if(MapInfo_CheckMap(autocvar_nextmap))
{
- Map_Goto_SetStr(cvar_string("nextmap"));
+ Map_Goto_SetStr(autocvar_nextmap);
Map_Goto();
alreadychangedlevel = TRUE;
return TRUE;
}
- if(cvar("lastlevel"))
+ if(autocvar_lastlevel)
{
GameResetCfg();
localcmd("set lastlevel 0\ntogglemenu\n");
{
bprint( "Maplist contains no single playable map! Resetting it to default map list.\n" );
cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
- if(cvar("g_maplist_shuffle"))
+ if(autocvar_g_maplist_shuffle)
ShuffleMaplist();
localcmd("\nmenu_cmd sync\n");
}
{
FixIntermissionClient(self);
- if(cvar("sv_autoscreenshot"))
+ if(autocvar_sv_autoscreenshot)
if(self.autoscreenshot > 0)
if(time > self.autoscreenshot)
{
float i;
entity e;
- to_console = cvar("sv_logscores_console");
- to_eventlog = cvar("sv_eventlog");
- to_file = cvar("sv_logscores_file");
+ to_console = autocvar_sv_logscores_console;
+ to_eventlog = autocvar_sv_eventlog;
+ to_file = autocvar_sv_logscores_file;
if(!final)
{
}
if(to_eventlog)
- if(cvar("sv_eventlog_console"))
+ if(autocvar_sv_eventlog_console)
to_console = FALSE; // otherwise we get the output twice
if(final)
GameLogEcho(s);
if(to_file)
{
- file = fopen(cvar_string("sv_logscores_filename"), FILE_APPEND);
+ file = fopen(autocvar_sv_logscores_filename, FILE_APPEND);
if(file == -1)
to_file = FALSE;
else
FOR_EACH_CLIENT(other)
{
- if ((clienttype(other) == CLIENTTYPE_REAL) || (clienttype(other) == CLIENTTYPE_BOT && cvar("sv_logscores_bots")))
+ if ((clienttype(other) == CLIENTTYPE_REAL) || (clienttype(other) == CLIENTTYPE_BOT && autocvar_sv_logscores_bots))
{
s = strcat(":player:see-labels:", GetPlayerScoreString(other, 0), ":");
s = strcat(s, ftos(rint(time - other.jointime)), ":");
if(clienttype(e) == CLIENTTYPE_REAL)
{
stuffcmd(e, "\nscr_printspeed 1000000\n");
- s = cvar_string("sv_intermission_cdtrack");
+ s = autocvar_sv_intermission_cdtrack;
if(s != "")
stuffcmd(e, strcat("\ncd loop ", s, "\n"));
msg_entity = e;
// enforce a wait time before allowing changelevel
if(player_count > 0)
- intermission_exittime = time + cvar("sv_mapchange_delay");
+ intermission_exittime = time + autocvar_sv_mapchange_delay;
else
intermission_exittime = -1;
DumpStats(TRUE);
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(":gameover");
GameLogClose();
bprint(other.netname, " ^7wins.\n");
}
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
CampaignPreIntermission();
localcmd("\nsv_hook_gameend\n");
// - for this timelimit_overtime needs to be >0 of course
// - also check the winning condition calculated in the previous frame and only add normal overtime
// again, if at the point at which timelimit would be extended again, still no winner was found
- if ((checkrules_overtimesadded >= 0) && (checkrules_overtimesadded < cvar("timelimit_overtimes")) && cvar("timelimit_overtime") && !(g_race && !g_race_qualifying))
+ if ((checkrules_overtimesadded >= 0) && (checkrules_overtimesadded < autocvar_timelimit_overtimes) && autocvar_timelimit_overtime && !(g_race && !g_race_qualifying))
{
return 1; // need to call InitiateOvertime later
}
{
if(!checkrules_suddendeathend)
{
- checkrules_suddendeathend = time + 60 * cvar("timelimit_suddendeath");
+ checkrules_suddendeathend = time + 60 * autocvar_timelimit_suddendeath;
if(g_race && !g_race_qualifying)
race_StartCompleting();
}
++checkrules_overtimesadded;
//add one more overtime by simply extending the timelimit
float tl;
- tl = cvar("timelimit");
- tl += cvar("timelimit_overtime");
+ tl = autocvar_timelimit;
+ tl += autocvar_timelimit_overtime;
cvar_set("timelimit", ftos(tl));
string minutesPlural;
- if (cvar("timelimit_overtime") == 1)
+ if (autocvar_timelimit_overtime == 1)
minutesPlural = " ^3minute";
else
minutesPlural = " ^3minutes";
bcenterprint(
strcat(
"^3Now playing ^1OVERTIME^3!\n\n^3Added ^1",
- ftos(cvar("timelimit_overtime")),
+ ftos(autocvar_timelimit_overtime),
minutesPlural,
" to the game!"
)
float GetWinningCode(float fraglimitreached, float equality)
{
- if(cvar("g_campaign") == 1)
+ if(autocvar_g_campaign == 1)
if(fraglimitreached)
return WINNING_YES;
else
float LMS_NewPlayerLives()
{
float fl;
- fl = cvar("fraglimit");
+ fl = autocvar_fraglimit;
if(fl == 0)
fl = 999;
if(lms_lowest_lives < 1)
return 0;
- if(!cvar("g_lms_join_anytime"))
- if(lms_lowest_lives < fl - cvar("g_lms_last_join"))
+ if(!autocvar_g_lms_join_anytime)
+ if(lms_lowest_lives < fl - autocvar_g_lms_last_join)
return 0;
return bound(1, lms_lowest_lives, fl);
TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 666 - TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 0));
- if(ent.cnt == 1 || cvar("g_campaign")) // this was the second round
+ if(ent.cnt == 1 || autocvar_g_campaign) // this was the second round
{
status = WINNING_YES;
}
void ShuffleMaplist()
{
- cvar_set("g_maplist", shufflewords(cvar_string("g_maplist")));
+ cvar_set("g_maplist", shufflewords(autocvar_g_maplist));
}
float leaderfrags;
{
float leadlimitreached;
leadlimitreached = (WinningConditionHelper_topscore - WinningConditionHelper_secondscore >= leadlimit);
- if(cvar("leadlimit_and_fraglimit"))
+ if(autocvar_leadlimit_and_fraglimit)
limitreached = (limitreached && leadlimitreached);
else
limitreached = (limitreached || leadlimitreached);
return;
}
- timelimit = cvar("timelimit") * 60;
- fraglimit = cvar("fraglimit");
- leadlimit = cvar("leadlimit");
+ timelimit = autocvar_timelimit * 60;
+ fraglimit = autocvar_fraglimit;
+ leadlimit = autocvar_leadlimit;
if(inWarmupStage || time <= game_starttime) // NOTE: this is <= to prevent problems in the very tic where the game starts
{
float i;
if(m == "")
return "That's not how to use this command.";
- if(!cvar("g_maplist_votable_suggestions"))
+ if(!autocvar_g_maplist_votable_suggestions)
return "Suggestions are not accepted on this server.";
if(mapvote_initialized)
return "Can't suggest - voting is already in progress!";
m = MapInfo_FixName(m);
if(!m)
return "The map you suggested is not available on this server.";
- if(!cvar("g_maplist_votable_suggestions_override_mostrecent"))
+ if(!autocvar_g_maplist_votable_suggestions_override_mostrecent)
if(Map_IsRecent(m))
return "This server does not allow for recent maps to be played again. Please be patient for some rounds.";
if(mapvote_suggestions[i] != "")
strunzone(mapvote_suggestions[i]);
mapvote_suggestions[i] = strzone(m);
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(strcat(":vote:suggested:", m, ":", ftos(self.playerid)));
return strcat("Suggestion of ", m, " accepted.");
}
MapVote_ClearAllVotes();
mapvote_count = 0;
- mapvote_detail = !cvar("g_maplist_votable_nodetail");
- mapvote_abstain = cvar("g_maplist_votable_abstain");
+ mapvote_detail = !autocvar_g_maplist_votable_nodetail;
+ mapvote_abstain = autocvar_g_maplist_votable_abstain;
if(mapvote_abstain)
- nmax = min(MAPVOTE_COUNT - 1, cvar("g_maplist_votable"));
+ nmax = min(MAPVOTE_COUNT - 1, autocvar_g_maplist_votable);
else
- nmax = min(MAPVOTE_COUNT, cvar("g_maplist_votable"));
- smax = min3(nmax, cvar("g_maplist_votable_suggestions"), mapvote_suggestion_ptr);
+ nmax = min(MAPVOTE_COUNT, autocvar_g_maplist_votable);
+ smax = min3(nmax, autocvar_g_maplist_votable_suggestions, mapvote_suggestion_ptr);
// we need this for AddVotable, as that cycles through the screenshot dirs
- mapvote_screenshot_dirs_count = tokenize_console(cvar_string("g_maplist_votable_screenshot_dir"));
+ mapvote_screenshot_dirs_count = tokenize_console(autocvar_g_maplist_votable_screenshot_dir);
if(mapvote_screenshot_dirs_count == 0)
mapvote_screenshot_dirs_count = tokenize_console("maps levelshots");
mapvote_screenshot_dirs_count = min(mapvote_screenshot_dirs_count, MAPVOTE_SCREENSHOT_DIRS_COUNT);
{
bprint( "Maplist contains no single playable map! Resetting it to default map list.\n" );
cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
- if(cvar("g_maplist_shuffle"))
+ if(autocvar_g_maplist_shuffle)
ShuffleMaplist();
localcmd("\nmenu_cmd sync\n");
for(i = 0; i < 100 && mapvote_count < nmax; ++i)
//dprint("mapvote count is ", ftos(mapvote_count), "\n");
- mapvote_keeptwotime = time + cvar("g_maplist_votable_keeptwotime");
- mapvote_timeout = time + cvar("g_maplist_votable_timeout");
+ mapvote_keeptwotime = time + autocvar_g_maplist_votable_keeptwotime;
+ mapvote_timeout = time + autocvar_g_maplist_votable_timeout;
if(mapvote_count_real < 3 || mapvote_keeptwotime <= time)
mapvote_keeptwotime = 0;
mapvote_message = "Choose a map and press its key!";
float i;
float didntvote;
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
{
result = strcat(":vote:finished:", mapvote_maps[mappos]);
result = strcat(result, ":", ftos(mapvote_votes[mappos]), "::");
}
}
result = strcat(result, ":didn't vote:", ftos(didntvote));
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(result);
}
if(!mapvote_initialized)
{
- if(cvar("rescan_pending") == 1)
+ if(autocvar_rescan_pending == 1)
{
cvar_set("rescan_pending", "2");
localcmd("fs_rescan\nrescan_pending 3\n");
return;
}
- else if(cvar("rescan_pending") == 2)
+ else if(autocvar_rescan_pending == 2)
{
return;
}
- else if(cvar("rescan_pending") == 3)
+ else if(autocvar_rescan_pending == 3)
{
// now build missing mapinfo files
if(!MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1))
mapvote_initialized = TRUE;
if(DoNextMapOverride())
return;
- if(!cvar("g_maplist_votable") || player_count <= 0)
+ if(!autocvar_g_maplist_votable || player_count <= 0)
{
GotoNextMap();
return;
play2(self, "misc/hit.wav");
}
}
- altime = time + frametime * (1 + cvar("g_antilag_nudge"));
+ altime = time + frametime * (1 + autocvar_g_antilag_nudge);
// add 1 frametime because after this, engine SV_Physics
// increases time by a frametime and then networks the frame
// add another frametime because client shows everything with
if(!cheatcount_total)
{
- if(cvar("sv_db_saveasdump"))
+ if(autocvar_sv_db_saveasdump)
db_dump(ServerProgsDB, "server.db");
else
db_save(ServerProgsDB, "server.db");
}
- if(cvar("developer"))
+ if(autocvar_developer)
{
- if(cvar("sv_db_saveasdump"))
+ if(autocvar_sv_db_saveasdump)
db_dump(TemporaryDB, "server-temp.db");
else
db_save(TemporaryDB, "server-temp.db");
if(plr.classname == "spectator" || plr.classname == "observer")
{
plr.spectatortime = time;
- sprint(plr, strcat("^7You have to become a player within the next ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+ sprint(plr, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
}
}
- bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds!\n"));
+ bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds!\n"));
return;
}
string uri;
float i, n;
- uri = strcat( "action=ban&hostname=", uri_escape(cvar_string("hostname")));
+ uri = strcat( "action=ban&hostname=", uri_escape(autocvar_hostname));
uri = strcat(uri, "&ip=", uri_escape(ip));
uri = strcat(uri, "&duration=", ftos(bantime));
uri = strcat(uri, "&reason=", uri_escape(reason));
- n = tokenize_console(cvar_string("g_ban_sync_uri"));
+ n = tokenize_console(autocvar_g_ban_sync_uri);
if(n >= MAX_IPBAN_URIS)
n = MAX_IPBAN_URIS;
for(i = 0; i < n; ++i)
string uri;
float i, n;
- uri = strcat( "action=unban&hostname=", uri_escape(cvar_string("hostname")));
+ uri = strcat( "action=unban&hostname=", uri_escape(autocvar_hostname));
uri = strcat(uri, "&ip=", uri_escape(ip));
- n = tokenize_console(cvar_string("g_ban_sync_uri"));
+ n = tokenize_console(autocvar_g_ban_sync_uri);
if(n >= MAX_IPBAN_URIS)
n = MAX_IPBAN_URIS;
for(i = 0; i < n; ++i)
return;
}
- tokenize_console(cvar_string("g_ban_sync_uri"));
+ tokenize_console(autocvar_g_ban_sync_uri);
uri = argv(id);
print("Received ban list from ", uri, ": ");
return;
}
- syncinterval = cvar("g_ban_sync_interval");
+ syncinterval = autocvar_g_ban_sync_interval;
if(syncinterval == 0)
{
print("rejected (syncing disabled)\n");
dprint(" timeleft=", ftos(timeleft), " reason=", reason);
dprint(" serverip=", serverip, "\n");
- timeleft -= 1.5 * cvar("g_ban_sync_timeout");
+ timeleft -= 1.5 * autocvar_g_ban_sync_timeout;
if(timeleft < 0)
continue;
}
}
- if(cvar("g_ban_sync_trusted_servers_verify"))
+ if(autocvar_g_ban_sync_trusted_servers_verify)
if((strstrofs(strcat(";", OnlineBanList_Servers, ";"), strcat(";", serverip, ";"), 0) == -1))
continue;
string uri;
float i, n;
- if(cvar_string("g_ban_sync_uri") == "")
+ if(autocvar_g_ban_sync_uri == "")
goto killme;
- if(cvar("g_ban_sync_interval") == 0) // < 0 is okay, it means "sync on level start only"
+ if(autocvar_g_ban_sync_interval == 0) // < 0 is okay, it means "sync on level start only"
goto killme;
- argc = tokenize_console(cvar_string("g_ban_sync_trusted_servers"));
+ argc = tokenize_console(autocvar_g_ban_sync_trusted_servers);
if(argc == 0)
goto killme;
OnlineBanList_Servers = strcat(OnlineBanList_Servers, ";", argv(i));
OnlineBanList_Servers = strzone(OnlineBanList_Servers);
- uri = strcat( "action=list&hostname=", uri_escape(cvar_string("hostname")));
+ uri = strcat( "action=list&hostname=", uri_escape(autocvar_hostname));
uri = strcat(uri, "&servers=", uri_escape(OnlineBanList_Servers));
- OnlineBanList_Timeout = time + cvar("g_ban_sync_timeout");
+ OnlineBanList_Timeout = time + autocvar_g_ban_sync_timeout;
- n = tokenize_console(cvar_string("g_ban_sync_uri"));
+ n = tokenize_console(autocvar_g_ban_sync_uri);
if(n >= MAX_IPBAN_URIS)
n = MAX_IPBAN_URIS;
for(i = 0; i < n; ++i)
uri_get(strcat(argv(i), "?", uri), URI_GET_IPBAN + i); // 1000 = "banlist" callback target
}
- if(cvar("g_ban_sync_interval") > 0)
- self.nextthink = time + max(60, cvar("g_ban_sync_interval") * 60);
+ if(autocvar_g_ban_sync_interval > 0)
+ self.nextthink = time + max(60, autocvar_g_ban_sync_interval * 60);
else
goto killme;
return;
Ban_Delete(i);
ban_count = 0;
ban_loaded = TRUE;
- n = tokenize_console(cvar_string("g_banned_list"));
+ n = tokenize_console(autocvar_g_banned_list);
if(stof(argv(0)) == 1)
{
ban_count = (n - 1) / 2;
if(ban_idfp == s) return TRUE;
}
if(ipbanned)
- if(!cvar("g_banned_list_idmode") || !ban_idfp)
+ if(!autocvar_g_banned_list_idmode || !ban_idfp)
return TRUE;
return FALSE;
}
client = edict_num(entno);
INITARG(3);
- GETARG(bantime, cvar("g_ban_default_bantime"));
- GETARG(masksize, cvar("g_ban_default_masksize"));
+ GETARG(bantime, autocvar_g_ban_default_bantime);
+ GETARG(masksize, autocvar_g_ban_default_masksize);
RESTARG(reason);
Ban_KickBanClient(client, bantime, masksize, reason);
ip = argv(1);
INITARG(2);
- GETARG(bantime, cvar("g_ban_default_bantime"));
+ GETARG(bantime, autocvar_g_ban_default_bantime);
RESTARG(reason);
Ban_Insert(ip, bantime, reason, 1);
string admin_name(void)
{
- if(cvar_string("sv_adminnick") != "")
- return cvar_string("sv_adminnick");
+ if(autocvar_sv_adminnick != "")
+ return autocvar_sv_adminnick;
else
return "SERVER ADMIN";
}
else
strPlayerPingColor = "^2";
- if((cvar("sv_fragmessage_information_stats")) && (enPlayer.health >= 1))
+ if((autocvar_sv_fragmessage_information_stats) && (enPlayer.health >= 1))
strMessage = strcat(strMessage, "\n^7(Health ^1", ftos(nPlayerHealth), "^7 / Armor ^2", ftos(nPlayerArmor), "^7)");
- if(cvar("sv_fragmessage_information_ping")) {
+ if(autocvar_sv_fragmessage_information_ping) {
if(clienttype(enPlayer) == CLIENTTYPE_BOT) // Bots have no ping
strMessage = strcat(strMessage, " ^7(^2Bot");
else
strMessage = strcat(strMessage, " ^7(Ping ", strPlayerPingColor, ftos(nPlayerPing), "ms");
- if(cvar("sv_fragmessage_information_handicap"))
- if(cvar("sv_fragmessage_information_handicap") == 2)
+ if(autocvar_sv_fragmessage_information_handicap)
+ if(autocvar_sv_fragmessage_information_handicap == 2)
if(nPlayerHandicap <= 1)
strMessage = strcat(strMessage, "^7 / Handicap ^2Off^7)");
else
strMessage = strcat(strMessage, "^7 / Handicap ^2", ftos(nPlayerHandicap), "^7)");
else
strMessage = strcat(strMessage, "^7)");
- } else if(cvar("sv_fragmessage_information_handicap")) {
- if(cvar("sv_fragmessage_information_handicap") == 2)
+ } else if(autocvar_sv_fragmessage_information_handicap) {
+ if(autocvar_sv_fragmessage_information_handicap == 2)
if(nPlayerHandicap <= 1)
strMessage = strcat(strMessage, "\n^7(Handicap ^2Off^7)");
else
string fn;
float matches;
- if (cvar("sv_eventlog_files"))
+ if (autocvar_sv_eventlog_files)
{
if (!logfile_open)
{
logfile_open = TRUE;
- matches = cvar("sv_eventlog_files_counter") + 1;
+ matches = autocvar_sv_eventlog_files_counter + 1;
cvar_set("sv_eventlog_files_counter", ftos(matches));
fn = ftos(matches);
if (strlen(fn) < 8)
fn = strcat(substring("00000000", 0, 8 - strlen(fn)), fn);
- fn = strcat(cvar_string("sv_eventlog_files_nameprefix"), fn, cvar_string("sv_eventlog_files_namesuffix"));
+ fn = strcat(autocvar_sv_eventlog_files_nameprefix, fn, autocvar_sv_eventlog_files_namesuffix);
logfile = fopen(fn, FILE_APPEND);
fputs(logfile, ":logversion:3\n");
}
if (logfile >= 0)
{
- if (cvar("sv_eventlog_files_timestamps"))
+ if (autocvar_sv_eventlog_files_timestamps)
fputs(logfile, strcat(":time:", strftime(TRUE, "%Y-%m-%d %H:%M:%S", "\n", s, "\n")));
else
fputs(logfile, strcat(s, "\n"));
}
}
- if (cvar("sv_eventlog_console"))
+ if (autocvar_sv_eventlog_console)
{
print(s, "\n");
}
float spawnpoint_nag;
void relocate_spawnpoint()
{
- PL_VIEW_OFS = stov(cvar_string("sv_player_viewoffset"));
- PL_MIN = stov(cvar_string("sv_player_mins"));
- PL_MAX = stov(cvar_string("sv_player_maxs"));
- PL_HEAD = stov(cvar_string("sv_player_headsize"));
- PL_CROUCH_VIEW_OFS = stov(cvar_string("sv_player_crouch_viewoffset"));
- PL_CROUCH_MIN = stov(cvar_string("sv_player_crouch_mins"));
- PL_CROUCH_MAX = stov(cvar_string("sv_player_crouch_maxs"));
+ PL_VIEW_OFS = stov(autocvar_sv_player_viewoffset);
+ PL_MIN = stov(autocvar_sv_player_mins);
+ PL_MAX = stov(autocvar_sv_player_maxs);
+ PL_HEAD = stov(autocvar_sv_player_headsize);
+ PL_CROUCH_VIEW_OFS = stov(autocvar_sv_player_crouch_viewoffset);
+ PL_CROUCH_MIN = stov(autocvar_sv_player_crouch_mins);
+ PL_CROUCH_MAX = stov(autocvar_sv_player_crouch_maxs);
// nudge off the floor
setorigin(self, self.origin + '0 0 1');
print(" needs to be moved out of solid, e.g. by '", ftos(self.origin_x - o_x));
print(" ", ftos(self.origin_y - o_y));
print(" ", ftos(self.origin_z - o_z), "'\n");
- if (cvar("g_spawnpoints_auto_move_out_of_solid"))
+ if (autocvar_g_spawnpoints_auto_move_out_of_solid)
{
if (!spawnpoint_nag)
print("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)\n");
if (self.team)
have_team_spawns = 1;
- if (cvar("r_showbboxes"))
+ if (autocvar_r_showbboxes)
{
// show where spawnpoints point at too
makevectors(self.angles);
void backtrace(string msg)
{
float dev, war;
- dev = cvar("developer");
- war = cvar("prvm_backtraceforwarnings");
+ dev = autocvar_developer;
+ war = autocvar_prvm_backtraceforwarnings;
cvar_set("developer", "1");
cvar_set("prvm_backtraceforwarnings", "1");
print("\n");
return v;
};
+//#NO AUTOCVARS START
+
float g_pickup_shells;
float g_pickup_shells_max;
float g_pickup_nails;
t = (weaponinfo.spawnflags & WEP_FLAG_NORMAL);
else if(t < -1)
t = 0;
- else if (g_race || g_cts)
- t = (i == WEP_LASER);
+ else if (g_cts)
+ t = (i == WEP_SHOTGUN);
else if (g_nexball)
t = 0; // weapon is set a few lines later
else
if (g_weaponarena)
{
start_weapons = g_weaponarena;
- if (g_weaponarena & (WEPBIT_GRENADE_LAUNCHER | WEPBIT_MINE_LAYER | WEPBIT_HAGAR | WEPBIT_ROCKET_LAUNCHER))
- start_ammo_rockets = 999;
- if (g_weaponarena & WEPBIT_SHOTGUN)
- start_ammo_shells = 999;
- if (g_weaponarena & (WEPBIT_ELECTRO | WEPBIT_CRYLINK | WEPBIT_NEX | WEPBIT_MINSTANEX | WEPBIT_HLAC | WEPBIT_HOOK))
- start_ammo_cells = 999;
- if (g_weaponarena & (WEPBIT_UZI | WEPBIT_CAMPINGRIFLE))
- start_ammo_nails = 999;
- if (g_weaponarena & WEPBIT_HOOK)
- start_ammo_fuel = 999;
+ for (j = WEP_FIRST; j <= WEP_LAST; ++j)
+ {
+ e = get_weaponinfo(j);
+ if(start_weapons & e.weapons)
+ {
+ if(e.items & IT_ROCKETS)
+ start_ammo_rockets = 999;
+ if(e.items & IT_SHELLS)
+ start_ammo_shells = 999;
+ if(e.items & IT_CELLS)
+ start_ammo_cells = 999;
+ if(e.items & IT_NAILS)
+ start_ammo_nails = 999;
+ if(e.items & IT_FUEL)
+ start_ammo_fuel = 999;
+ }
+ }
start_items |= IT_UNLIMITED_AMMO;
}
else if (g_minstagib)
float sv_pitch_max;
float sv_pitch_fixyaw;
-float sv_accuracy_data_share;
-
+string GetGametype(); // g_world.qc
void readlevelcvars(void)
{
// first load all the mutators
if(cvar("g_vampire"))
MUTATOR_ADD(mutator_vampire);
- serverflags = 0;
if(cvar("sv_allow_fullbright"))
serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
sv_gentle = cvar("sv_gentle");
sv_foginterval = cvar("sv_foginterval");
g_cloaked = cvar("g_cloaked");
+ if(g_cts)
+ g_cloaked = 1; // always enable cloak in CTS
g_jump_grunt = cvar("g_jump_grunt");
g_footsteps = cvar("g_footsteps");
g_grappling_hook = cvar("g_grappling_hook");
g_pinata = cvar("g_pinata");
- g_weapon_stay = cvar("g_weapon_stay");
+ g_weapon_stay = cvar(strcat("g_", GetGametype(), "_weapon_stay"));
+ if(!g_weapon_stay)
+ g_weapon_stay = cvar("g_weapon_stay");
if (!g_weapon_stay && (cvar("deathmatch") == 2))
g_weapon_stay = 1;
sv_pitch_max = cvar("sv_pitch_max");
sv_pitch_fixyaw = cvar("sv_pitch_fixyaw");
- sv_accuracy_data_share = boolean(cvar("sv_accuracy_data_share"));
-
readplayerstartcvars();
}
-/*
-// TODO sound pack system
-string soundpack;
-
-string precache_sound_builtin (string s) = #19;
-void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8;
-string precache_sound(string s)
-{
- return precache_sound_builtin(strcat(soundpack, s));
-}
-void play2(entity e, string filename)
-{
- stuffcmd(e, strcat("play2 ", soundpack, filename, "\n"));
-}
-void sound(entity e, float chan, string samp, float vol, float atten)
-{
- sound_builtin(e, chan, strcat(soundpack, samp), vol, atten);
-}
-*/
+//#NO AUTOCVARS END
// Sound functions
string precache_sound (string s) = #19;
if (e == msg_entity)
return TRUE;
// sounds by players can be removed
- if (cvar("bot_sound_monopoly"))
+ if (autocvar_bot_sound_monopoly)
if (clienttype(e) == CLIENTTYPE_REAL)
return FALSE;
// anything else may pass
{
local entity head;
- if (cvar("bot_sound_monopoly"))
+ if (autocvar_bot_sound_monopoly)
return;
FOR_EACH_REALPLAYER(head)
void play2all(string samp)
{
- if (cvar("bot_sound_monopoly"))
+ if (autocvar_bot_sound_monopoly)
return;
sound(world, CHAN_AUTO, samp, VOL_BASE, ATTN_NONE);
precache_model(m);
if(sv_loddistance1)
{
- precache_model(strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1)));
- precache_model(strcat(substring(m, 0, -5), "_lod2", substring(m, -4, -1)));
+ f = strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1));
+ if(fexists(f))
+ precache_model(f);
+ f = strcat(substring(m, 0, -5), "_lod2", substring(m, -4, -1));
+ if(fexists(f))
+ precache_model(f);
}
globhandle = search_begin(strcat(m, "_*.sounds"), TRUE, FALSE);
}
#ifdef TTURRETS_ENABLED
- if (cvar("g_turrets"))
+ if (autocvar_g_turrets)
turrets_precash();
#endif
// Precache all player models if desired
- if (cvar("sv_precacheplayermodels"))
+ if (autocvar_sv_precacheplayermodels)
{
PrecachePlayerSounds("sound/player/default.sounds");
precache_all_playermodels("models/player/*.zym");
precache_all_playermodels("models/player/*.iqm");
}
- if (cvar("sv_defaultcharacter"))
+ if (autocvar_sv_defaultcharacter)
{
string s;
- s = cvar_string("sv_defaultplayermodel_red");
+ s = autocvar_sv_defaultplayermodel_red;
if (s != "")
precache_playermodel(s);
- s = cvar_string("sv_defaultplayermodel_blue");
+ s = autocvar_sv_defaultplayermodel_blue;
if (s != "")
precache_playermodel(s);
- s = cvar_string("sv_defaultplayermodel_yellow");
+ s = autocvar_sv_defaultplayermodel_yellow;
if (s != "")
precache_playermodel(s);
- s = cvar_string("sv_defaultplayermodel_pink");
+ s = autocvar_sv_defaultplayermodel_pink;
if (s != "")
precache_playermodel(s);
- s = cvar_string("sv_defaultplayermodel");
+ s = autocvar_sv_defaultplayermodel;
if (s != "")
precache_playermodel(s);
}
precache_sound ("weapons/hook_impact.wav"); // hook
}
- if(cvar("sv_precacheweapons"))
+ if(autocvar_sv_precacheweapons)
{
//precache weapon models/sounds
local float wep;
objerror_builtin(s);
}
+.float remove_except_protected_forbidden;
+void remove_except_protected(entity e)
+{
+ if(e.remove_except_protected_forbidden)
+ error("not allowed to remove this at this point");
+ remove_builtin(e);
+}
+
void remove_unsafely(entity e)
{
remove_builtin(e);
entity startoflist;
startoflist = initialize_entity_first;
initialize_entity_first = world;
+ remove = remove_except_protected;
+ for (self = startoflist; self; self = self.initialize_entity_next)
+ {
+ self.remove_except_protected_forbidden = 1;
+ }
for (self = startoflist; self; )
{
entity e;
self.initialize_entity_order = 0;
self.initialize_entity = func_null;
self.initialize_entity_next = world;
+ self.remove_except_protected_forbidden = 0;
if (self.classname == "initialize_entity")
{
entity e_old;
self = e_old;
}
//dprint("Delayed initialization: ", self.classname, "\n");
- func();
+ if(func != func_null)
+ func();
+ else
+ {
+ eprint(self);
+ backtrace(strcat("Null function in: ", self.classname, "\n"));
+ }
self = e;
}
+ remove = remove_unsafely;
}
.float uncustomizeentityforclient_set;
zcurveparticles(effectno, start, end, end_dz, vlen(vel));
}
-string GetGametype(); // g_world.qc
void write_recordmarker(entity pl, float tstart, float dt)
{
GameLogEcho(strcat(":recordset:", ftos(pl.playerid), ":", ftos(dt)));
string s;
vector v;
- if (cvar("g_shootfromeye"))
+ if (autocvar_g_shootfromeye)
{
if (visual)
{
vecs_z = 0;
}
}
- else if (cvar("g_shootfromcenter"))
+ else if (autocvar_g_shootfromcenter)
{
if (visual)
{
vecs_z -= 2;
}
}
- else if ((s = cvar_string("g_shootfromfixedorigin")) != "")
+ else if ((s = autocvar_g_shootfromfixedorigin) != "")
{
v = stov(s);
if (y_is_right)
vecs_y = v_y;
vecs_z = v_z;
}
- else if (cvar("g_shootfromclient"))
+ else if (autocvar_g_shootfromclient)
{
- vecs = shotorg_adjustfromclient(vecs, y_is_right, (cvar("g_shootfromclient") >= 2), algn);
+ vecs = shotorg_adjustfromclient(vecs, y_is_right, (autocvar_g_shootfromclient >= 2), algn);
}
return vecs;
}
self.nextthink = ceil(time + 1);
if (!gameover)
{
- if (cvar("timelimit"))
- if (time > game_starttime + cvar("timelimit") * 60)
+ if (autocvar_timelimit)
+ if (time > game_starttime + autocvar_timelimit * 60)
{
// self.max_health / 300 gives 5 minutes of overtime.
// control points reduce the overtime duration.
void onslaught_generator_reset()
{
self.team = self.team_saved;
- self.lasthealth = self.max_health = self.health = cvar("g_onslaught_gen_health");
+ self.lasthealth = self.max_health = self.health = autocvar_g_onslaught_gen_health;
self.takedamage = DAMAGE_AIM;
self.bot_attack = TRUE;
self.iscaptured = TRUE;
self.colormap = 1024 + (self.team - 1) * 17;
self.solid = SOLID_BBOX;
self.movetype = MOVETYPE_NONE;
- self.lasthealth = self.max_health = self.health = cvar("g_onslaught_gen_health");
+ self.lasthealth = self.max_health = self.health = autocvar_g_onslaught_gen_health;
setmodel(self, "models/onslaught/generator.md3");
setsize(self, '-52 -52 -14', '52 52 75');
setorigin(self, self.origin);
if (self.health >= self.max_health)
{
self.health = self.max_health;
- self.count = cvar("g_onslaught_cp_regen") * sys_frametime; // slow repair rate from now on
+ self.count = autocvar_g_onslaught_cp_regen * sys_frametime; // slow repair rate from now on
self.think = onslaught_controlpoint_icon_think;
sound(self, CHAN_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTN_NORM);
bprint(ColoredTeamName(self.team), " captured ", self.owner.message, " control point\n");
self.goalentity = e = spawn();
e.classname = "onslaught_controlpoint_icon";
e.owner = self;
- e.max_health = cvar("g_onslaught_cp_health");
- e.health = cvar("g_onslaught_cp_buildhealth");
+ e.max_health = autocvar_g_onslaught_cp_health;
+ e.health = autocvar_g_onslaught_cp_buildhealth;
e.solid = SOLID_BBOX;
e.movetype = MOVETYPE_NONE;
setmodel(e, "models/onslaught/controlpoint_icon.md3");
e.colormap = 1024 + (e.team - 1) * 17;
e.think = onslaught_controlpoint_icon_buildthink;
e.nextthink = time + sys_frametime;
- e.count = (e.max_health - e.health) * sys_frametime / cvar("g_onslaught_cp_buildtime"); // how long it takes to build
+ e.count = (e.max_health - e.health) * sys_frametime / autocvar_g_onslaught_cp_buildtime; // how long it takes to build
sound(e, CHAN_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTN_NORM);
self.team = e.team;
self.colormap = e.colormap;
void() monster_checkbossflag =
{
+//#NO AUTOCVARS START
#if 0
local float healthboost;
local float r;
while (self.colormod_x > 0.6 && self.colormod_y > 0.6 && self.colormod_z > 0.6);
}
#endif
+//#NO AUTOCVARS END
};
float SKILL4_MINALPHA = 0.4;
float monsterwander;
+//#NO AUTOCVARS START
/*
monsterwander = cvar("monsterwander");
// monsterwander is always on in skill 5
if (skill >= 5)
monsterwander = TRUE;
*/
+//#NO AUTOCVARS END
.float candrown;
void() monsterinwall =
{
local entity e;
- if (!cvar("developer"))
+ if (!autocvar_developer)
return;
// this is handy for level designers,
// puts a spikey ball where the error is...
+++ /dev/null
-
-string(float c) colorname =
-{
- // yikes, the quake color set is HARD to describe
- // many are easy, but, uh, 2 browns???
- // 2 purples???
- // that 'pink' is hard to classify
- // I think 'biege' is a fairly good name for color 10
- // oh well, gotta do all the color names...
- if (c == 0) return "white";
- else if (c == 1) return "brown";
- else if (c == 2) return "lightblue";
- else if (c == 3) return "green";
- else if (c == 4) return "red";
- else if (c == 5) return "lighterbrown";
- else if (c == 6) return "orange";
- else if (c == 7) return "pink";
- else if (c == 8) return "purple";
- else if (c == 9) return "redishpurple";
- else if (c == 10) return "biege";
- else if (c == 11) return "aqua";
- else if (c == 12) return "yellow";
- else if (c == 13) return "blue";
- else if (c == 14) return "flamingorange";
- else if (c == 15) return "psychadelic";
- else return "INVALID COLOR";
-};
-
-float mode_shirtmustmatchpants;
-float mode_numteams;
-float mode_allowedteams[17];
-float mode_teamcount[17];
-float mode_teamscore[17];
-
-void() mode_initallowedteams =
-{
- local float c;
- c = 0;
- while(c < 17)
- {
- mode_allowedteams[c] = FALSE;
- c = c + 1;
- }
- mode_allowedteams[5] = TRUE; // red
- mode_allowedteams[14] = TRUE; // blue
- if (deathmatch == DM_ELIM
- || deathmatch == DM_ONEVSALL
- || deathmatch == DM_CTF_2TEAM
- || deathmatch == DM_DOMINATION
- || deathmatch == DM_SUPERDOMINATION)
- mode_numteams = 2;
- else if (deathmatch == DM_CTF_3TEAM)
- {
- mode_numteams = 3;
- mode_allowedteams[13] = TRUE; // yellow
- }
- else
- {
- mode_numteams = 16;
- c = 1;
- while(c < 17)
- {
- mode_allowedteams[c] = TRUE;
- c = c + 1;
- }
- }
-};
-
-float(float t) validteam =
-{
- return mode_allowedteams[t];
-};
-
-float() weakestteam =
-{
- local float bestteam;
- local float bestteamcount;
- local float headcount;
- local float c;
- bestteam = -1;
- bestteamcount = 0;
- c = 1;
- while (c < 17)
- {
- if (mode_allowedteams[c])
- {
- headcount = mode_teamcount[c];
- if (bestteamcount > headcount || bestteam == -1)
- {
- bestteamcount = headcount;
- bestteam = c;
- }
- }
- c = c + 1;
- }
- return bestteam;
-};
-
-void() updateteams =
-{
- local entity head;
- local float c;
- c = 1;
- while (c < 17)
- {
- mode_teamcount[c] = 0;
- mode_teamscore[c] = 0;
- c = c + 1;
- }
- c = 0;
- head = nextent(world);
- while (c < maxclients)
- {
- mode_teamcount[head.team] = mode_teamcount[head.team] + 1;
- mode_teamscore[head.team] = mode_teamscore[head.team] + head.frags;
- c = c + 1;
- head = nextent(head);
- }
-};
-
-float(float p) checkteamcolor =
-{
- if (!validteam(p + 1))
- p = weakestteam() - 1;
- return p;
-};
-
-void(float c) SV_ChangeTeam =
-{
- local float pants, shirt, old;
- old = self.clientcolors & 15;
- if (c >= 0)
- {
- pants = c & 15;
- shirt = (c / 16) & 15;
- }
- else
- {
- pants = -1;
- shirt = -1;
- }
- pants = checkteamcolor(pants);
- if (mode_shirtmustmatchpants || shirt < 0)
- shirt = pants;
- setcolor(self, pants + shirt * 16);
- if (pants != old && old >= 0 && teamplay && deathmatch)
- {
- T_Damage(self, self, self, 0, 0, " changed teams", DT_TELEFRAG, self.origin, '0 0 0', Obituary_Generic);
- self.frags = 0;
- PutClientInServer ();
- }
-};
-
-void() checkinvalidteam =
-{
- // call SV_ChangeTeam to trigger the weakestteam change
- if (!validteam(self.team))
- SV_ChangeTeam(self.team - 1);
-};
-
-
-string dmmessage;
-
-void(string m) setdm =
-{
- dmmessage = m;
- if (cvar_string("deathmatch") != m)
- cvar_set("deathmatch", m);
-}
-
-void(string m) setteamplay =
-{
- dmmessage = m;
- if (cvar_string("teamplay") != m)
- cvar_set("teamplay", m);
-}
-
-void() mode_updatecvars =
-{
- local float dm, tp;
- dm = cvar("deathmatch");
- tp = cvar("teamplay");
- // now set deathmatch cvar
- if (dm == 0) setdm("0?Dark Places - Coop");
- else if (dm == 1) setdm("1?Dark Places - Deathmatch");
- else if (dm == 2) setdm("2?Dark Places - Deathmatch 2 (can only pickup gun once)");
- else if (dm == 3) setdm("3?Dark Places - Deathmatch 3 (quick ammo respawn)");
- else if (dm == 5) setdm("5?Dark Places - Frag Fest (spawn with full pack)");
-// else if (dm == 6) setdm("6?Dark Places - Random Weapons (spawn with 2 random weapons)"); // removed
- else if (dm == 7) setdm("7?Dark Places - Monsters");
-// else if (dm == 8) setdm("8?Dark Places - Elimination");
-// else if (dm == 9) setdm("9?Dark Places - Kill The Leader Mode");
- else if (dm == 10) setdm("10?Dark Places - Capture The Flag - 2 Team");
- else if (dm == 11) setdm("11?Dark Places - Capture The Flag - 3 Team");
- else if (dm == 12) setdm("12?Dark Places - Domination");
- else if (dm == 13) setdm("13?Dark Places - Monster Capture The Flag - 2 Team");
- else if (dm == 14) setdm("14?Dark Places - Super Domination");
- else if (dm == 30) setdm("30?Dark Places - Role Playing Game");
- else setdm("1?Dark Places - Deathmatch");
-
- // now set teamplay cvar
- if (dm == 0) setteamplay("4?Dark Places - Coop (Can't hurt other players)");
- //else if (dm == 8) setteamplay("3?Dark Places - Elimination");
- //else if (dm == 9) setteamplay("3?Dark Places - Kill The Leader");
- else if (dm == 10) setteamplay("3?Dark Places - Capture The Flag - 2 Team");
- else if (dm == 11) setteamplay("3?Dark Places - Capture The Flag - 3 Team");
- else if (dm == 12) setteamplay("3?Dark Places - Domination");
- else if (dm == 13) setteamplay("3?Dark Places - Monster Capture The Flag - 2 Team");
- else
- {
- if (tp == 0) setteamplay("0?Dark Places - No Teamplay");
- else if (tp == 1) setteamplay("1?Dark Places - No team damage");
- else if (tp == 2) setteamplay("2?Dark Places - Can hurt anyone");
- else if (tp == 3) setteamplay("3?Dark Places - No team damage, but can hurt self");
- else setteamplay("0?Dark Places - No Teamplay");
- }
-};
-
-float nextcvarupdate;
-void() deathmatch7update;
-void() modeupdate =
-{
- if (time > nextcvarupdate)
- {
- nextcvarupdate = time + 1;
- mode_updatecvars();
- }
- deathmatch7update();
-};
-
-// true if items should respawn
-float itemrespawn;
-// when the next monster spawning check will occur in deathmatch 7 mode
-float spawnchecktime;
-
-void() precachemonsters;
-void() superdomination_precache;
-void() modesetup =
-{
- mode_shirtmustmatchpants = deathmatch >= DM_TEAM_MODS_START && deathmatch < DM_TEAM_MODS_END;
- mode_initallowedteams();
-
- itemrespawn = cvar("deathmatch") + cvar("coop");
-
- // don't spawn any monsters until 15 seconds
- spawnchecktime = 15;
- if (deathmatch == 7 || cvar("spawnmonsters") >= 1)
- precachemonsters();
-
- superdomination_precache();
-};
-
-float monsterspawn;
-void() spawnmonster_think =
-{
- //local float c;
- local void() sfunc;
- self.nextthink = time;
- if (time > self.cnt)
- {
- remove(self);
- return;
- }
- if (vlen(self.velocity) > 5)
- return; // try again later
-
- //if (!(self.flags & FL_FLY))
- // droptofloor();
- // don't spawn if something is in the way
- /*
- // walk around a lot
- if (walkmove(0,0))
- {
- if (self.lefty > 0)
- {
- c = 100;
- self.lefty = self.lefty - 1;
- self.angles = '0 0 0';
- while(c > 0)
- {
- c = c - 1;
- if (!walkmove(self.angles_y, 16))
- self.angles_y = random() * 360;
- }
- self.angles = '0 0 0';
- return;
- }
- }
- */
- // don't spawn if something is in the way
- if (!walkmove(0,0))
- {
- self.lefty = 10;
- setorigin(self, self.dest);
- self.flags = self.flags - (self.flags & FL_ONGROUND);
- self.velocity = randomvec() * 700 + '0 0 1000';
- return;
- }
- newmis = findchain(classname, "player");
- while (newmis)
- {
- if (vlen(newmis.origin - self.origin) < 300)
- return;
- newmis = newmis.chain;
- }
-
- if (self.netname == "monster_fish")
- {
- if (pointcontents(self.origin) != CONTENT_WATER)
- {
- remove(self);
- return;
- }
- }
-
- // spawn in
- self.movetype = MOVETYPE_NONE;
- self.solid = SOLID_NOT;
- self.velocity = '0 0 0';
- self.flags = 0;
- self.model = "";
- self.modelindex = 0;
- setorigin(self, self.origin);
- self.angles = '0 360 0' * random();
- self.classname = self.netname;
- self.netname = "";
- self.cnt = 0;
- self.think = SUB_Remove;
- sfunc = self.th_run;
- self.th_run = SUB_Null;
- te_teleport(self.origin);
- monsterspawn = TRUE;
- sfunc();
- monsterspawn = FALSE;
-};
-
-void(vector org, float c1, float c2, string cname, void() spawnfunc, vector m1, vector m2) spawnmonster =
-{
- local float c;
- c = (c2 - c1) * random() + c1;
- c = rint(c);
- while (c > 0)
- {
- c = c - 1;
-
- newmis = spawn();
- newmis.cnt = time + 10;
- if (cname == "monster_wizard")
- newmis.cnt = time + 2;
- newmis.lefty = 10;
- newmis.dest = org;
- newmis.classname = "spawningmonster";
- newmis.netname = cname;
- newmis.solid = SOLID_TRIGGER;
- newmis.movetype = MOVETYPE_TOSS;
- newmis.flags = FL_MONSTER; // make this count as a monster even though it hasn't spawned in yet
- newmis.velocity = randomvec() * 700 + '0 0 1000';
- newmis.th_run = spawnfunc;
- newmis.think = spawnmonster_think;
- newmis.nextthink = time + random() * 0.5 + 0.3;
- setorigin(newmis, org);
- setmodel(newmis, "progs/s_explod.spr");
- setsize(newmis, m1, m2);
- }
-};
-
-void() monster_army;
-void() monster_demon1;
-void() monster_dog;
-void() monster_enforcer;
-void() monster_hell_knight;
-void() monster_knight;
-void() monster_ogre;
-void() monster_shalrath;
-void() monster_shambler;
-void() monster_tarbaby;
-void() monster_wizard;
-void() monster_zombie;
-void() monster_fish;
-void() monster_hellfish;
-
-void() spawnmonsters =
-{
- local float r;
- local vector org;
- local entity head, e;
- head = findchain(classname, "info_player_deathmatch");
- if (head == world)
- {
- head = findchain(classname, "info_player_coop");
- if (head == world)
- {
- head = findchain(classname, "info_player_start");
- if (head == world)
- return;
- }
- }
-
- // count the spawn points
- r = 0;
- e = head;
- while (e)
- {
- r = r + 1;
- e = e.chain;
- }
-
- // pick a random one
- r = random() * r;
- e = head;
- while (r > 0)
- {
- r = r - 1;
- org = e.origin;
- e = e.chain;
- }
-
- // pick a type of monster
- if (cvar("registered"))
- {
- r = floor(random() * 13);
- if (r > 12)
- r = 12;
- }
- else
- {
- r = floor(random() * 8);
- if (r > 7)
- r = 7;
- }
- if (r == 0) spawnmonster(org, 5, 10, "monster_army" , monster_army , '-16 -16 -24', '16 16 32');
- else if (r == 1) spawnmonster(org, 3, 6, "monster_demon1" , monster_demon1 , '-32 -32 -24', '32 32 64');
- else if (r == 2) spawnmonster(org, 6, 12, "monster_dog" , monster_dog , '-16 -16 -24', '16 16 32');
- else if (r == 3) spawnmonster(org, 6, 12, "monster_knight" , monster_knight , '-16 -16 -24', '16 16 32');
- else if (r == 4) spawnmonster(org, 3, 6, "monster_ogre" , monster_ogre , '-32 -32 -24', '32 32 64');
- else if (r == 5) spawnmonster(org, 1, 1, "monster_shambler" , monster_shambler , '-32 -32 -24', '32 32 64');
- else if (r == 6) spawnmonster(org, 6, 10, "monster_wizard" , monster_wizard , '-16 -16 -24', '16 16 32');
- else if (r == 7) spawnmonster(org, 8, 16, "monster_zombie" , monster_zombie , '-16 -16 -24', '16 16 32');
- else if (r == 8) spawnmonster(org, 4, 8, "monster_enforcer" , monster_enforcer , '-16 -16 -24', '16 16 32');
- else if (r == 9) spawnmonster(org, 4, 8, "monster_hell_knight", monster_hell_knight, '-16 -16 -24', '16 16 32');
- else if (r == 10) spawnmonster(org, 1, 3, "monster_shalrath" , monster_shalrath , '-32 -32 -24', '32 32 64');
- else if (r == 11) spawnmonster(org, 10, 15, "monster_tarbaby" , monster_tarbaby , '-16 -16 -24', '16 16 32');
- else if (r == 12) spawnmonster(org, 4, 8, "monster_fish" , monster_fish , '-16 -16 -24', '16 16 32');
-};
-
-float monstersprecached;
-void() precachemonster_army;
-void() precachemonster_demon1;
-void() precachemonster_dog;
-void() precachemonster_enforcer;
-void() precachemonster_hell_knight;
-void() precachemonster_knight;
-void() precachemonster_ogre;
-void() precachemonster_shalrath;
-void() precachemonster_shambler;
-void() precachemonster_tarbaby;
-void() precachemonster_wizard;
-void() precachemonster_zombie;
-void() precachemonster_fish;
-
-void() precachemonsters =
-{
- precachemonster_army();
- precachemonster_demon1();
- precachemonster_dog();
- precachemonster_knight();
- precachemonster_ogre();
- precachemonster_shambler();
- precachemonster_wizard();
- precachemonster_zombie();
- if (cvar("registered"))
- {
- precachemonster_enforcer();
- precachemonster_hell_knight();
- precachemonster_shalrath();
- precachemonster_tarbaby();
- precachemonster_fish();
- }
- monstersprecached = TRUE;
-};
-
-float spawnedexitmonsters;
-void() deathmatch7update =
-{
- local entity e;
- local float f, monster_count, monsters;
- if (skill >= 5)
- if (!deathmatch)
- {
- if (!spawnedexitmonsters)
- if (time >= 2)
- {
- spawnedexitmonsters = TRUE;
- e = find(world, classname, "target_changelevel");
- while (e)
- {
- spawnmonster(e.origin + (e.mins + e.maxs) * 0.5, 8, 8, "monster_hellfish", monster_hellfish, '-16 -16 -24', '16 16 32');
- e = find(e, classname, "target_changelevel");
- }
- }
- return;
- }
- if (time < spawnchecktime)
- return;
- if (!monstersprecached)
- return;
- spawnchecktime = time + 0.2;
- monsters = 0;
- if (deathmatch == 7)
- monsters = 50;
- f = cvar("spawnmonsters");
- if (f >= 1)
- monsters = f;
- if (monsters < 1)
- return;
- monster_count = 0;
- e = findchainflags(flags, FL_MONSTER);
- while (e)
- {
- monster_count = monster_count + 1;
- e = e.chain;
- }
- if (monster_count >= monsters)
- return;
- spawnmonsters();
-}
if(trace_ent != trg)
return 0;
- return (cvar("g_monster_zombie_targetrange") - vlen(self.origin - trg.origin)) * tmp;
+ return (autocvar_g_monster_zombie_targetrange - vlen(self.origin - trg.origin)) * tmp;
}
else if(self.enemy == trg)
- return (cvar("g_monster_zombie_targetrange") - vlen(self.origin - trg.origin)) * tmp;
+ return (autocvar_g_monster_zombie_targetrange - vlen(self.origin - trg.origin)) * tmp;
}
}
self.event_damage = SUB_Null;
self.enemy = world;
self.think = zombie_spawn;
- self.nextthink = time + cvar("g_monster_zombie_respawntime");
+ self.nextthink = time + autocvar_g_monster_zombie_respawntime;
self.pain_finished = self.nextthink;
}
float vz, tdiff, tspeed;
tdiff = time - self.zoomstate;
- tspeed = tdiff * cvar("g_monster_zombie_turnspeed");
+ tspeed = tdiff * autocvar_g_monster_zombie_turnspeed;
vz = self.velocity_z;
self.zoomstate = time;
if(vlen(self.origin - self.moveto) > 64)
{
- movelib_move_simple(v_forward ,cvar("g_monster_zombie_movespeed"),0.6);
+ movelib_move_simple(v_forward ,autocvar_g_monster_zombie_movespeed,0.6);
if(time > self.pain_finished)
if(self.attack_finished_single < time)
self.frame = zombie_anim_runforward;
}
else
{
- movelib_beak_simple(cvar("g_monster_zombie_stopspeed"));
+ movelib_beak_simple(autocvar_g_monster_zombie_stopspeed);
if(time > self.pain_finished)
if(self.attack_finished_single < time)
self.frame = zombie_anim_idle;
case VCM_DO:
float t;
- t = cvar("g_monster_zombie_idle_timer_max") - cvar("g_monster_zombie_idle_timer_min");
- t = cvar("g_monster_zombie_idle_timer_min") + (random() * t);
+ t = autocvar_g_monster_zombie_idle_timer_max - autocvar_g_monster_zombie_idle_timer_min;
+ t = autocvar_g_monster_zombie_idle_timer_min + (random() * t);
if(random() < 0.5)
verbstack_push(self.verbs_idle, zombie_verb_idle_roam, ZV_IDLE + 1, t, self);
entity trg, best_trg;
float trg_score, best_trg_score;
- trg = findradius(self.origin,cvar("g_monster_zombie_targetrange"));
+ trg = findradius(self.origin,autocvar_g_monster_zombie_targetrange);
while(trg)
{
trg_score = zombie_scoretarget(trg);
oldself = self;
self = self.owner;
- if(vlen(self.origin - self.enemy.origin) > cvar("g_monster_zombie_attack_run_hitrange"))
+ if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_run_hitrange)
return;
if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.6)
return;
- Damage(self.enemy, self, self, cvar("g_monster_zombie_attack_run_damage"), DEATH_TURRET, self.enemy.origin, normalize(self.enemy.origin - self.origin) * cvar("g_monster_zombie_attack_run_force"));
+ Damage(self.enemy, self, self, autocvar_g_monster_zombie_attack_run_damage, DEATH_TURRET, self.enemy.origin, normalize(self.enemy.origin - self.origin) * autocvar_g_monster_zombie_attack_run_force);
self = oldself;
self.think = SUB_Remove;
if(self.attack_finished_single > time)
return VS_CALL_NO;
- if(vlen(self.origin - self.enemy.origin) > cvar("g_monster_zombie_attack_run_range"))
+ if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_run_range)
return VS_CALL_NO;
if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.6)
pain = spawn();
pain.owner = self;
pain.think = zombie_runattack_damage;
- pain.nextthink = time + cvar("g_monster_zombie_attack_run_delay");
+ pain.nextthink = time + autocvar_g_monster_zombie_attack_run_delay;
self.attack_finished_single = time + 0.7;
self.frame = zombie_anim_attackrun1 + rint(random() * 2);
//self = self.owner;
setorigin(self,self.owner.origin + v_forward * 32);
- RadiusDamage(self, self.owner, cvar("g_monster_zombie_attack_stand_damage"),cvar("g_monster_zombie_attack_stand_damage"),16,self, cvar("g_monster_zombie_attack_stand_force"),DEATH_TURRET,world);
+ RadiusDamage(self, self.owner, autocvar_g_monster_zombie_attack_stand_damage,autocvar_g_monster_zombie_attack_stand_damage,16,self, autocvar_g_monster_zombie_attack_stand_force,DEATH_TURRET,world);
//float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity ignore, float forceintensity, float deathtype, entity directhitentity)
if(self.attack_finished_single > time)
return VS_CALL_NO;
- if(vlen(self.origin - self.enemy.origin) > cvar("g_monster_zombie_attack_stand_range"))
+ if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_stand_range)
return VS_CALL_NO;
if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.8)
pain = spawn();
pain.owner = self;
pain.think = zombie_runattack_damage;
- pain.nextthink = time + cvar("g_monster_zombie_attack_stand_delay");
+ pain.nextthink = time + autocvar_g_monster_zombie_attack_stand_delay;
self.attack_finished_single = time + 0.7;
self.frame = zombie_anim_attackstanding1 + rint(random() * 1);
self.nextthink = time + 2.1;
self.pain_finished = self.nextthink;
self.movetype = MOVETYPE_WALK;
- self.health = cvar("g_monster_zombie_health");
+ self.health = autocvar_g_monster_zombie_health;
self.velocity = '0 0 0';
self.angles = self.pos2;
self.moveto = self.origin;
void spawnfunc_monster_zombie()
{
- if not(cvar("g_monsters"))
+ if not(autocvar_g_monsters)
{
remove(self);
return;
if (self.waterlevel > 1)
{
self.velocity = self.velocity + force * (acceleration * deltatime);
- self.velocity = self.velocity + '0 0 0.05' * sv_gravity * deltatime;
+ self.velocity = self.velocity + '0 0 0.05' * autocvar_sv_gravity * deltatime;
}
else
- self.velocity = self.velocity + '0 0 -1' * sv_gravity * deltatime;
+ self.velocity = self.velocity + '0 0 -1' * autocvar_sv_gravity * deltatime;
mspeed = vlen(self.velocity);
old_speed = vlen(self.velocity);
old_dir = normalize(self.velocity);
- //ggravity = (sv_gravity / self.mass) * '0 0 100';
+ //ggravity = (autocvar_sv_gravity / self.mass) * '0 0 100';
acceleration = (force / self.mass) * dir;
//acceleration -= old_dir * (old_speed / self.mass);
acceleration -= ggravity;
void freezetag_Initialize()
{
precache_model("models/ice/ice.md3");
- warmup = time + cvar("g_start_delay") + cvar("g_freezetag_warmup");
+ warmup = time + autocvar_g_start_delay + autocvar_g_freezetag_warmup;
}
void freezetag_CheckWinner()
if(time <= game_starttime) // game didn't even start yet! nobody can win in that case.
return;
- if(next_round || (time > warmup - cvar("g_freezetag_warmup") && time < warmup))
+ if(next_round || (time > warmup - autocvar_g_freezetag_warmup && time < warmup))
return; // already waiting for next round to start
if((redalive >= 1 && bluealive >= 1) // counted in arena.qc
bprint("^7", frag_target.netname, "^1 was frozen by ^7", frag_attacker.netname, ".\n");
}
- frag_target.health = cvar("g_balance_health_start"); // "respawn" the player :P
+ frag_target.health = autocvar_g_balance_health_start; // "respawn" the player :P
freezetag_CheckWinner();
freezetag_Unfreeze(); // start by making sure that all ice blocks are removed
if(totalspawned == 1 && time > game_starttime) // only one player active on server, start a new match immediately
- if(!next_round && warmup && (time < warmup - cvar("g_freezetag_warmup") || time > warmup)) // not awaiting next round
+ if(!next_round && warmup && (time < warmup - autocvar_g_freezetag_warmup || time > warmup)) // not awaiting next round
{
next_round = time;
return 1;
MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
{
vector revive_extra_size;
- revive_extra_size = '1 1 1' * cvar("g_freezetag_revive_extra_size");
+ revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
float teammate_nearby;
FOR_EACH_PLAYER(other) if(self != other)
}
else
{
- self.freezetag_revive_progress = (time - self.freezetag_beginrevive_time) / cvar("g_freezetag_revive_time");
- if(time - self.freezetag_beginrevive_time >= cvar("g_freezetag_revive_time"))
+ self.freezetag_revive_progress = (time - self.freezetag_beginrevive_time) / autocvar_g_freezetag_revive_time;
+ if(time - self.freezetag_beginrevive_time >= autocvar_g_freezetag_revive_time)
{
freezetag_Unfreeze();
if(frag_target.freezetag_frozen == 1 && frag_deathtype != DEATH_HURTTRIGGER)
{
frag_damage = 0;
- frag_force = frag_force * cvar("g_freezetag_frozen_force");
+ frag_force = frag_force * autocvar_g_freezetag_frozen_force;
}
}
return 1;
setmodel(e, e.model);
setsize(e, '-16 -16 -20', '16 16 20'); // 20 20 20 was too big, player is only 16 16 24... gotta cheat with the Z (20) axis so that the particle isn't cut off
e.classname = "keepawayball";
- e.damageforcescale = cvar("g_keepawayball_damageforcescale");
+ e.damageforcescale = autocvar_g_keepawayball_damageforcescale;
e.takedamage = DAMAGE_YES;
- e.glow_color = cvar("g_keepawayball_trail_color");
+ e.glow_color = autocvar_g_keepawayball_trail_color;
e.glow_trail = TRUE;
e.movetype = MOVETYPE_BOUNCE;
e.touch = ka_TouchEvent;
self.angles = '0 0 0';
self.solid = SOLID_TRIGGER;
self.think = ka_RespawnBall;
- self.nextthink = time + cvar("g_keepawayball_respawntime");
+ self.nextthink = time + autocvar_g_keepawayball_respawntime;
pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1);
pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1);
self.takedamage = DAMAGE_NO;
// apply effects to player
- other.glow_color = cvar("g_keepawayball_trail_color");
+ other.glow_color = autocvar_g_keepawayball_trail_color;
other.glow_trail = TRUE;
other.effects |= EF_DIMLIGHT;
- other.alpha = cvar("g_keepaway_ballcarrier_alpha");
- other.exteriorweaponentity.alpha = cvar("g_keepaway_ballcarrier_alpha");
+ other.alpha = autocvar_g_keepaway_ballcarrier_alpha;
+ other.exteriorweaponentity.alpha = autocvar_g_keepaway_ballcarrier_alpha;
// messages and sounds
Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
ball.solid = SOLID_TRIGGER; // is this needed?
ball.wait = time + 1;
ball.think = ka_RespawnBall;
- ball.nextthink = time + cvar("g_keepawayball_respawntime");
+ ball.nextthink = time + autocvar_g_keepawayball_respawntime;
ball.touch = ka_TouchEvent;
ball.takedamage = DAMAGE_YES;
ball.effects &~= EF_NODRAW;
{
if(frag_target.ballcarried) { // add to amount of times killing carrier
PlayerScore_Add(frag_attacker, SP_KEEPAWAY_CARRIERKILLS, 1);
- if(cvar("g_keepaway_bckillscore")) // add bckills to the score
+ if(autocvar_g_keepaway_bckillscore) // add bckills to the score
PlayerScore_Add(frag_attacker, SP_KEEPAWAY_SCORE, 1);
}
else if(!frag_attacker.ballcarried)
- if(cvar("g_keepaway_noncarrier_warn"))
+ if(autocvar_g_keepaway_noncarrier_warn)
centerprint_atprio(frag_attacker, (CENTERPRIO_SPAM + 5), "Killing people while you don't have the ball gives no points!");
if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
{
if(frag_target == frag_attacker) // damage done to yourself
{
- frag_damage *= cvar("g_keepaway_ballcarrier_selfdamage");
- frag_force *= cvar("g_keepaway_ballcarrier_selfforce");
+ frag_damage *= autocvar_g_keepaway_ballcarrier_selfdamage;
+ frag_force *= autocvar_g_keepaway_ballcarrier_selfforce;
}
else // damage done to noncarriers
{
- frag_damage *= cvar("g_keepaway_ballcarrier_damage");
- frag_force *= cvar("g_keepaway_ballcarrier_force");
+ frag_damage *= autocvar_g_keepaway_ballcarrier_damage;
+ frag_force *= autocvar_g_keepaway_ballcarrier_force;
}
}
else if not(frag_target.ballcarried) // if the target is a noncarrier
{
if(frag_target == frag_attacker) // damage done to yourself
{
- frag_damage *= cvar("g_keepaway_noncarrier_selfdamage");
- frag_force *= cvar("g_keepaway_noncarrier_selfforce");
+ frag_damage *= autocvar_g_keepaway_noncarrier_selfdamage;
+ frag_force *= autocvar_g_keepaway_noncarrier_selfforce;
}
else // damage done to other noncarriers
{
- frag_damage *= cvar("g_keepaway_noncarrier_damage");
- frag_force *= cvar("g_keepaway_noncarrier_force");
+ frag_damage *= autocvar_g_keepaway_noncarrier_damage;
+ frag_force *= autocvar_g_keepaway_noncarrier_force;
}
}
return 0;
if(self.ballcarried)
{
// force the default ballcarrier alpha on the player if they have the ball
- self.alpha = cvar("g_keepaway_ballcarrier_alpha");
- self.exteriorweaponentity.alpha = cvar("g_keepaway_ballcarrier_alpha");
+ self.alpha = autocvar_g_keepaway_ballcarrier_alpha;
+ self.exteriorweaponentity.alpha = autocvar_g_keepaway_ballcarrier_alpha;
if(g_minstagib)
{
}
return 0;
-}
\ No newline at end of file
+}
// #define KH_PLAYER_USE_ATTACHMENT
// #define KH_PLAYER_USE_CARRIEDMODEL
-// #define KH_KEY_ATTACHMENT_DEBUG
#ifdef KH_PLAYER_USE_ATTACHMENT
vector KH_PLAYER_ATTACHMENT_DIST_ROTATED = '0 -4 0';
if(key && key.owner && frags_owner)
UpdateFrags(key.owner, frags_owner);
- if(!cvar("sv_eventlog")) //output extra info to the console or text file
+ if(!autocvar_sv_eventlog) //output extra info to the console or text file
return;
s = strcat(":keyhunt:", what, ":", ftos(player.playerid), ":", ftos(frags_player));
key.flags = FL_ITEM;
key.solid = SOLID_TRIGGER;
key.movetype = MOVETYPE_TOSS;
- key.pain_finished = time + cvar("g_balance_keyhunt_delay_return");
- key.damageforcescale = cvar("g_balance_keyhunt_damageforcescale");
+ key.pain_finished = time + autocvar_g_balance_keyhunt_delay_return;
+ key.damageforcescale = autocvar_g_balance_keyhunt_damageforcescale;
key.takedamage = DAMAGE_YES;
// let key.team stay
key.modelindex = kh_key_dropped;
if(key.kh_dropperteam != player.team)
{
- kh_Scores_Event(player, key, "collect", cvar("g_balance_keyhunt_score_collect"), 0);
+ kh_Scores_Event(player, key, "collect", autocvar_g_balance_keyhunt_score_collect, 0);
PlayerScore_Add(player, SP_KH_PICKUPS, 1);
}
key.kh_dropperteam = 0;
if(other.deadflag != DEAD_NO)
return;
if(other == self.enemy)
- if(time < self.kh_droptime + cvar("g_balance_keyhunt_delay_collect"))
+ if(time < self.kh_droptime + autocvar_g_balance_keyhunt_delay_collect)
return; // you just dropped it!
kh_Key_Collect(self, other);
}
kh_Key_Remove(key);
kh_no_radar_circles = FALSE;
- kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round"), "Round starts in ", kh_StartRound);
+ kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, "Round starts in ", kh_StartRound);
}
void kh_WinnerTeam(float teem) // runs when a team wins
float first;
entity key;
float score;
- score = (kh_teams - 1) * cvar("g_balance_keyhunt_score_capture");
+ score = (kh_teams - 1) * autocvar_g_balance_keyhunt_score_capture;
DistributeEvenly_Init(score, kh_teams);
// twice the score for 3 team games, three times the score for 4 team games!
// note: for a win by destroying the key, this should NOT be applied
if(attacker)
{
if(lostkey.kh_previous_owner)
- kh_Scores_Event(lostkey.kh_previous_owner, world, "pushed", 0, -cvar("g_balance_keyhunt_score_push"));
+ kh_Scores_Event(lostkey.kh_previous_owner, world, "pushed", 0, -autocvar_g_balance_keyhunt_score_push);
// don't actually GIVE him the -nn points, just log
- kh_Scores_Event(attacker, world, "push", cvar("g_balance_keyhunt_score_push"), 0);
+ kh_Scores_Event(attacker, world, "push", autocvar_g_balance_keyhunt_score_push, 0);
PlayerScore_Add(attacker, SP_KH_PUSHES, 1);
centerprint(attacker, "Your push is the best!");
bprint("The ", ColoredTeamName(teem), "^7 could not take care of the ", lostkey.netname, "^7 when ", attacker.netname, "^7 came\n");
else
{
float of, fragsleft, i, j, thisteam;
- of = cvar("g_balance_keyhunt_score_destroyed_ownfactor");
+ of = autocvar_g_balance_keyhunt_score_destroyed_ownfactor;
FOR_EACH_PLAYER(player)
if(player.team != teem)
++keys;
if(lostkey.kh_previous_owner)
- kh_Scores_Event(lostkey.kh_previous_owner, world, "destroyed", 0, -cvar("g_balance_keyhunt_score_destroyed"));
+ kh_Scores_Event(lostkey.kh_previous_owner, world, "destroyed", 0, -autocvar_g_balance_keyhunt_score_destroyed);
// don't actually GIVE him the -nn points, just log
if(lostkey.kh_previous_owner.playerid == lostkey.kh_previous_owner_playerid)
PlayerScore_Add(lostkey.kh_previous_owner, SP_KH_DESTROYS, 1);
- DistributeEvenly_Init(cvar("g_balance_keyhunt_score_destroyed"), keys * of + players);
+ DistributeEvenly_Init(autocvar_g_balance_keyhunt_score_destroyed, keys * of + players);
FOR_EACH_KH_KEY(key)
if(key.owner && key.team != teem)
if(intermission_running)
return;
-#ifdef KH_KEY_ATTACHMENT_DEBUG
- if(self.kh_prev == self.owner)
- {
- if(cvar_string("_angles") != "")
- {
- self.angles = stov(cvar_string("_angles"));
- setorigin(self, stov(cvar_string("_origin")));
- }
- }
-#endif
-
if(self.owner)
{
#ifndef KH_PLAYER_USE_ATTACHMENT
#endif
if(self.owner.BUTTON_USE)
- if(time >= self.owner.kh_droptime + cvar("g_balance_keyhunt_delay_drop"))
+ if(time >= self.owner.kh_droptime + autocvar_g_balance_keyhunt_delay_drop)
{
self.owner.kh_droptime = time;
self.kh_droptime = time; // prevent collecting this one for some time
bprint(self.owner.netname, "^7 dropped the ", self.netname, "\n");
sound(self.owner, CHAN_AUTO, kh_sound_drop, VOL_BASE, ATTN_NORM);
makevectors(self.owner.v_angle);
- self.velocity = W_CalculateProjectileVelocity(self.owner.velocity, cvar("g_balance_keyhunt_throwvelocity") * v_forward, FALSE);
+ self.velocity = W_CalculateProjectileVelocity(self.owner.velocity, autocvar_g_balance_keyhunt_throwvelocity * v_forward, FALSE);
kh_Key_AssignTo(self, world);
- self.pushltime = time + cvar("g_balance_keyhunt_protecttime");
+ self.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
self.kh_dropperteam = self.team;
}
}
vector p;
p = self.owner.origin;
FOR_EACH_KH_KEY(key)
- if(vlen(key.owner.origin - p) > cvar("g_balance_keyhunt_maxdist"))
+ if(vlen(key.owner.origin - p) > autocvar_g_balance_keyhunt_maxdist)
goto not_winning;
kh_WinnerTeam(self.team);
:not_winning
bprint(player.netname, "^7 died and lost the ", key.netname, "\n");
kh_Key_AssignTo(key, world);
makevectors('-1 0 0' * (45 + 45 * random()) + '0 360 0' * random());
- key.velocity = W_CalculateProjectileVelocity(player.velocity, cvar("g_balance_keyhunt_dropvelocity") * v_forward, FALSE);
+ key.velocity = W_CalculateProjectileVelocity(player.velocity, autocvar_g_balance_keyhunt_dropvelocity * v_forward, FALSE);
key.pusher = mypusher;
- key.pushltime = time + cvar("g_balance_keyhunt_protecttime");
+ key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
if(suicide)
key.kh_dropperteam = player.team;
}
teams_missing = kh_CheckEnoughPlayers();
if(teams_missing == "")
- kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round"), "Round starts in ", kh_StartRound);
+ kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, "Round starts in ", kh_StartRound);
else
kh_Controller_SetThink(1, strcat("Waiting for players to join...\n\nNeed active players for: ", teams_missing), kh_WaitForPlayers);
}
}
kh_tracking_enabled = FALSE;
- kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_tracking"), "Scanning frequency range...", kh_EnableTrackingDevice);
+ kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_tracking, "Scanning frequency range...", kh_EnableTrackingDevice);
}
float kh_HandleFrags(entity attacker, entity targ, float f) // adds to the player score
nk = 0;
for(k = targ.kh_next; k != world; k = k.kh_next)
++nk;
- kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", -nk * cvar("g_balance_keyhunt_score_collect"), 0);
+ kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", -nk * autocvar_g_balance_keyhunt_score_collect, 0);
}
else
{
- kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", cvar("g_balance_keyhunt_score_carrierfrag")-1, 0);
+ kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", autocvar_g_balance_keyhunt_score_carrierfrag-1, 0);
PlayerScore_Add(attacker, SP_KH_KCKILLS, 1);
// the frag gets added later
}
precache_model("models/keyhunt/key.md3");
// setup variables
- kh_teams = cvar("g_keyhunt_teams_override");
+ kh_teams = autocvar_g_keyhunt_teams_override;
if(kh_teams < 2)
- kh_teams = cvar("g_keyhunt_teams");
+ kh_teams = autocvar_g_keyhunt_teams;
kh_teams = bound(2, kh_teams, 4);
// make a KH entity for controlling the game
// if we have e.g. 0.5 sec ramptime and a frametime of 0.25, then the ramp code
// will be called ramp_time/frametime times = 2 times. so, we need to
// add 0.5 * the total speed each frame until the dodge action is done..
- common_factor = sys_frametime / cvar("sv_dodging_ramp_time");
+ common_factor = sys_frametime / autocvar_sv_dodging_ramp_time;
// if ramp time is smaller than frametime we get problems ;D
if (common_factor > 1)
common_factor = 1;
- new_velocity_gain = self.dodging_velocity_gain - (common_factor * cvar("sv_dodging_horiz_speed"));
+ new_velocity_gain = self.dodging_velocity_gain - (common_factor * autocvar_sv_dodging_horiz_speed);
if (new_velocity_gain < 0)
new_velocity_gain = 0;
self.velocity =
self.velocity
- + (cvar("sv_dodging_up_speed") * v_up);
+ + (autocvar_sv_dodging_up_speed * v_up);
- if (cvar("sv_dodging_sound") == 1)
+ if (autocvar_sv_dodging_sound == 1)
PlayerSound(playersound_jump, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);
setanim(self, self.anim_jump, TRUE, FALSE, TRUE);
}
// are we done with the dodging ramp yet?
- if((self.dodging_action == 1) && ((time - self.last_dodging_time) > cvar("sv_dodging_ramp_time")))
+ if((self.dodging_action == 1) && ((time - self.last_dodging_time) > autocvar_sv_dodging_ramp_time))
{
// reset state so next dodge can be done correctly
self.dodging_action = 0;
// returns 1 if the player is close to a wall
float check_close_to_wall(float threshold) {
- if (cvar("sv_dodging_wall_dodging") == 0)
+ if (autocvar_sv_dodging_wall_dodging == 0)
return 0;
vector trace_start;
dodge_detected = 0;
// first check if the last dodge is far enough back in time so we can dodge again
- if ((time - self.last_dodging_time) < cvar("sv_dodging_delay"))
+ if ((time - self.last_dodging_time) < autocvar_sv_dodging_delay)
return 0;
- if (check_close_to_ground(cvar("sv_dodging_height_threshold")) != 1
- && check_close_to_wall(cvar("sv_dodging_wall_distance_threshold")) != 1)
+ if (check_close_to_ground(autocvar_sv_dodging_height_threshold) != 1
+ && check_close_to_wall(autocvar_sv_dodging_wall_distance_threshold) != 1)
return 0;
if (self.movement_x > 0) {
self.dodging_action = 1;
self.dodging_single_action = 1;
- self.dodging_velocity_gain = cvar("sv_dodging_horiz_speed");
+ self.dodging_velocity_gain = autocvar_sv_dodging_horiz_speed;
self.dodging_direction_x = tap_direction_x;
self.dodging_direction_y = tap_direction_y;
nix_weapon = nix_nextweapon;
nix_weapon_ammo = nix_nextweapon_ammo;
nix_nextweapon = 0;
- nix_nextchange = time + cvar("g_balance_nix_roundtime");
+ nix_nextchange = time + autocvar_g_balance_nix_roundtime;
//weapon_action(nix_weapon, WR_PRECACHE); // forget it, too slow
}
if (self.items & IT_UNLIMITED_WEAPON_AMMO)
{
self.ammo_shells = (nix_weapon_ammo & IT_SHELLS) ?
- cvar("g_pickup_shells_max") : 0;
+ autocvar_g_pickup_shells_max : 0;
self.ammo_nails = (nix_weapon_ammo & IT_NAILS) ?
- cvar("g_pickup_nails_max") : 0;
+ autocvar_g_pickup_nails_max : 0;
self.ammo_rockets = (nix_weapon_ammo & IT_ROCKETS) ?
- cvar("g_pickup_rockets_max") : 0;
+ autocvar_g_pickup_rockets_max : 0;
self.ammo_cells = (nix_weapon_ammo & IT_CELLS) ?
- cvar("g_pickup_cells_max") : 0;
+ autocvar_g_pickup_cells_max : 0;
self.ammo_fuel = (nix_weapon_ammo & IT_FUEL) ?
- cvar("g_pickup_fuel_max") : 0;
+ autocvar_g_pickup_fuel_max : 0;
}
else
{
self.ammo_shells = (nix_weapon_ammo & IT_SHELLS) ?
- cvar("g_balance_nix_ammo_shells") : 0;
+ autocvar_g_balance_nix_ammo_shells : 0;
self.ammo_nails = (nix_weapon_ammo & IT_NAILS) ?
- cvar("g_balance_nix_ammo_nails") : 0;
+ autocvar_g_balance_nix_ammo_nails : 0;
self.ammo_rockets = (nix_weapon_ammo & IT_ROCKETS) ?
- cvar("g_balance_nix_ammo_rockets") : 0;
+ autocvar_g_balance_nix_ammo_rockets : 0;
self.ammo_cells = (nix_weapon_ammo & IT_CELLS) ?
- cvar("g_balance_nix_ammo_cells") : 0;
+ autocvar_g_balance_nix_ammo_cells : 0;
self.ammo_fuel = (nix_weapon_ammo & IT_FUEL) ?
- cvar("g_balance_nix_ammo_fuel") : 0;
+ autocvar_g_balance_nix_ammo_fuel : 0;
}
- self.nix_nextincr = time + cvar("g_balance_nix_incrtime");
+ self.nix_nextincr = time + autocvar_g_balance_nix_incrtime;
if(dt >= 1 && dt <= 5)
self.nix_lastinfotime = -42;
else
if(!(self.items & IT_UNLIMITED_WEAPON_AMMO) && time > self.nix_nextincr)
{
if (nix_weapon_ammo & IT_SHELLS)
- self.ammo_shells = self.ammo_shells + cvar("g_balance_nix_ammoincr_shells");
+ self.ammo_shells = self.ammo_shells + autocvar_g_balance_nix_ammoincr_shells;
else if (nix_weapon_ammo & IT_NAILS)
- self.ammo_nails = self.ammo_nails + cvar("g_balance_nix_ammoincr_nails");
+ self.ammo_nails = self.ammo_nails + autocvar_g_balance_nix_ammoincr_nails;
else if (nix_weapon_ammo & IT_ROCKETS)
- self.ammo_rockets = self.ammo_rockets + cvar("g_balance_nix_ammoincr_rockets");
+ self.ammo_rockets = self.ammo_rockets + autocvar_g_balance_nix_ammoincr_rockets;
else if (nix_weapon_ammo & IT_CELLS)
- self.ammo_cells = self.ammo_cells + cvar("g_balance_nix_ammoincr_cells");
+ self.ammo_cells = self.ammo_cells + autocvar_g_balance_nix_ammoincr_cells;
if (nix_weapon_ammo & IT_FUEL) // hook uses cells and fuel
- self.ammo_fuel = self.ammo_fuel + cvar("g_balance_nix_ammoincr_fuel");
- self.nix_nextincr = time + cvar("g_balance_nix_incrtime");
+ self.ammo_fuel = self.ammo_fuel + autocvar_g_balance_nix_ammoincr_fuel;
+ self.nix_nextincr = time + autocvar_g_balance_nix_incrtime;
}
self.weapons = 0;
case IT_25HP:
case IT_ARMOR:
case IT_ARMOR_SHARD:
- if (cvar("g_nix_with_healtharmor"))
+ if (autocvar_g_nix_with_healtharmor)
return 0;
break;
case IT_STRENGTH:
case IT_INVINCIBLE:
- if (cvar("g_nix_with_powerups"))
+ if (autocvar_g_nix_with_powerups)
return 0;
break;
}
MUTATOR_ONADD
{
- g_nix_with_laser = cvar("g_nix_with_laser");
+ g_nix_with_laser = autocvar_g_nix_with_laser;
nix_nextchange = time;
nix_nextweapon = 0;
CVTOV(g_nexball_delay_idle); //10
CVTOV(g_nexball_football_physics); //0
- radar_showennemies = cvar("g_nexball_radar_showallplayers");
+ radar_showennemies = autocvar_g_nexball_radar_showallplayers;
InitializeEntity(world, nb_delayedinit, INITPRIO_GAMETYPE);
}
void LogNB(string mode, entity actor)
{
string s;
- if(!cvar("sv_eventlog"))
+ if(!autocvar_sv_eventlog)
return;
s = strcat(":nexball:", mode);
if(actor != world)
setorigin(self, self.spawnorigin); // make sure it's positioned correctly anyway
self.movetype = MOVETYPE_NONE;
self.think = InitBall;
- self.nextthink = max(time, game_starttime) + cvar("g_nexball_delay_start");
+ self.nextthink = max(time, game_starttime) + autocvar_g_nexball_delay_start;
}
}
football_touch();
return;
}
- if (!self.cnt && other.classname == "player" && (other.playerid != self.dropperid || time > self.ctf_droptime + cvar("g_nexball_delay_collect"))) {
+ if (!self.cnt && other.classname == "player" && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_nexball_delay_collect)) {
if (other.health <= 0)
return;
LogNB("caught", other);
ball.think = ResetBall;
if (ball.classname == "nexball_basketball")
ball.touch = football_touch; // better than SUB_Null: football control until the ball gets reset
- ball.nextthink = time + cvar("g_nexball_delay_goal") * (self.team != GOAL_OUT);
+ ball.nextthink = time + autocvar_g_nexball_delay_goal * (self.team != GOAL_OUT);
}
//=======================//
if (cvar(strcat("g_", self.classname, "_trail"))) //nexball_basketball :p
{
- self.glow_color = cvar("g_nexball_trail_color");
+ self.glow_color = autocvar_g_nexball_trail_color;
self.glow_trail = TRUE;
}
self.movetype = MOVETYPE_FLY;
- if (!cvar("g_nexball_sound_bounce"))
+ if (!autocvar_g_nexball_sound_bounce)
self.noise = "";
else if (!self.noise)
self.noise = "sound/nexball/bounce.wav";
self.reset = ball_restart;
self.think = InitBall;
- self.nextthink = game_starttime + cvar("g_nexball_delay_start");
+ self.nextthink = game_starttime + autocvar_g_nexball_delay_start;
}
void spawnfunc_nexball_basketball (void)
self.effects = g_nexball_basketball_effects_default;
self.solid = SOLID_TRIGGER;
balls |= BALL_BASKET;
- self.bouncefactor = cvar("g_nexball_basketball_bouncefactor");
- self.bouncestop = cvar("g_nexball_basketball_bouncestop");
+ self.bouncefactor = autocvar_g_nexball_basketball_bouncefactor;
+ self.bouncestop = autocvar_g_nexball_basketball_bouncestop;
SpawnBall();
}
self.classname = "nexball_football";
self.solid = SOLID_TRIGGER;
balls |= BALL_FOOT;
- self.bouncefactor = cvar("g_nexball_football_bouncefactor");
- self.bouncestop = cvar("g_nexball_football_bouncestop");
+ self.bouncefactor = autocvar_g_nexball_football_bouncefactor;
+ self.bouncestop = autocvar_g_nexball_football_bouncestop;
SpawnBall();
}
if(attacker.team != other.team || g_nexball_basketball_teamsteal)
if((ball = other.ballcarried) && (attacker.classname == "player" || attacker.classname == "gib"))
{
- other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * cvar("g_balance_nexball_secondary_force");
+ other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force;
other.flags &~= FL_ONGROUND;
if(!attacker.ballcarried)
{
mul = 1;
else
{
- mi = cvar("g_nexball_basketball_meter_minpower");
- ma = max(mi, cvar("g_nexball_basketball_meter_maxpower")); // avoid confusion
+ mi = autocvar_g_nexball_basketball_meter_minpower;
+ ma = max(mi, autocvar_g_nexball_basketball_meter_maxpower); // avoid confusion
//One triangle wave period with 1 as max
mul = 2 * mod(t, g_nexball_meter_period) / g_nexball_meter_period;
if (mul > 1)
mul = 2 - mul;
mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power
}
- DropBall (ball, w_shotorg, W_CalculateProjectileVelocity(self.velocity, w_shotdir * cvar("g_balance_nexball_primary_speed") * mul, FALSE));
+ DropBall (ball, w_shotorg, W_CalculateProjectileVelocity(self.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, FALSE));
//TODO: use the speed_up cvar too ??
}
setsize (missile, '0 0 0', '0 0 0');
setorigin (missile, w_shotorg);
- W_SetupProjectileVelocity(missile, cvar("g_balance_nexball_secondary_speed"), 0);
+ W_SetupProjectileVelocity(missile, autocvar_g_balance_nexball_secondary_speed, 0);
missile.angles = vectoangles (missile.velocity);
missile.touch = W_Nexball_Touch;
missile.think = SUB_Remove;
- missile.nextthink = time + cvar("g_balance_nexball_secondary_lifetime"); //FIXME: use a distance instead?
+ missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
missile.flags = FL_PROJECTILE;
if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, cvar("g_balance_nexball_primary_refire")))
- if (cvar("g_nexball_basketball_meter"))
+ if (weapon_prepareattack(0, autocvar_g_balance_nexball_primary_refire))
+ if (autocvar_g_nexball_basketball_meter)
{
if (self.ballcarried && !self.metertime)
self.metertime = time;
else
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nexball_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
else
{
W_Nexball_Attack(-1);
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nexball_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
if (self.BUTTON_ATCK2)
- if (weapon_prepareattack(1, cvar("g_balance_nexball_secondary_refire")))
+ if (weapon_prepareattack(1, autocvar_g_balance_nexball_secondary_refire))
{
W_Nexball_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_nexball_secondary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_nexball_secondary_animtime, w_ready);
}
if (!self.BUTTON_ATCK && self.metertime && self.ballcarried)
{
W_Nexball_Attack(time - self.metertime);
// DropBall or stealing will set metertime back to 0
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nexball_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
}
else if (req == WR_PRECACHE)
string uri;
playerstats_db = -1;
playerstats_waitforme = TRUE;
- uri = cvar_string("g_playerstats_uri");
+ uri = autocvar_g_playerstats_uri;
if(uri == "")
return;
playerstats_db = db_create();
if(playerstats_db < 0)
return;
- uri = cvar_string("g_playerstats_uri");
+ uri = autocvar_g_playerstats_uri;
if(uri != "")
{
b = buf_create();
// reset fade counter
teleporter.portal_wants_to_vanish = 0;
- teleporter.fade_time = time + cvar("g_balance_portal_lifetime");
- teleporter.health = cvar("g_balance_portal_health");
- teleporter.enemy.health = cvar("g_balance_portal_health");
+ teleporter.fade_time = time + autocvar_g_balance_portal_lifetime;
+ teleporter.health = autocvar_g_balance_portal_health;
+ teleporter.enemy.health = autocvar_g_balance_portal_health;
return 1;
}
if(IS_INDEPENDENT_PLAYER(other.aiment) || IS_INDEPENDENT_PLAYER(self.aiment))
return; // cannot go through someone else's portal
fixedmakevectors(self.mangle);
- g = frametime * '0 0 -1' * cvar("sv_gravity");
+ g = frametime * '0 0 -1' * autocvar_sv_gravity;
if(!Portal_WillHitPlane(other.origin, other.mins, other.maxs, other.velocity + g, self.origin, v_forward, self.maxs_x))
return;
destination.enemy = teleporter;
Portal_MakeInPortal(teleporter);
Portal_MakeOutPortal(destination);
- teleporter.fade_time = time + cvar("g_balance_portal_lifetime");
+ teleporter.fade_time = time + autocvar_g_balance_portal_lifetime;
destination.fade_time = teleporter.fade_time;
teleporter.portal_wants_to_vanish = 0;
destination.portal_wants_to_vanish = 0;
self.solid = SOLID_BBOX;
self.aiment = world;
- g = frametime * '0 0 -1' * cvar("sv_gravity");
+ g = frametime * '0 0 -1' * autocvar_sv_gravity;
fixedmakevectors(self.mangle);
portal.portal_activatetime = time + 0.1;
portal.takedamage = DAMAGE_AIM;
portal.event_damage = Portal_Damage;
- portal.fade_time = time + cvar("g_balance_portal_lifetime");
- portal.health = cvar("g_balance_portal_health");
+ portal.fade_time = time + autocvar_g_balance_portal_lifetime;
+ portal.health = autocvar_g_balance_portal_health;
setmodel(portal, "models/portal.md3");
portal.modelindex_lod0 = portal.modelindex;
portal.customizeentityforclient = Portal_Customize;
PlayerScore_Add(e, SP_RACE_TIME, snew - s);
l = PlayerTeamScore_Add(e, SP_RACE_LAPS, ST_RACE_LAPS, 1);
- if(cvar("fraglimit"))
- if(l >= cvar("fraglimit"))
+ if(autocvar_fraglimit)
+ if(l >= autocvar_fraglimit)
race_StartCompleting();
if(race_completing)
if(cp == race_timed_checkpoint)
{
race_setTime(GetMapname(), t, e.crypto_idfp, e.netname, e);
- if(g_cts && cvar("g_cts_finish_kill_delay"))
+ if(g_cts && autocvar_g_cts_finish_kill_delay)
{
- CTS_ClientKill(cvar("g_cts_finish_kill_delay"));
+ CTS_ClientKill(e);
}
}
if(t < recordtime || recordtime == 0)
for(trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); )
for(targ = world; (targ = find(targ, targetname, trigger.target)); )
if (targ.classname == "target_checkpoint" || targ.classname == "target_startTimer" || targ.classname == "target_stopTimer") {
- targ.wait = -2;
+ trigger.wait = 0;
+ trigger.delay = 0;
+ targ.wait = 0;
targ.delay = 0;
- setsize(targ, trigger.mins, trigger.maxs);
- setorigin(targ, trigger.origin);
+ // These just make the game crash on some maps with oddly shaped triggers.
+ // (on the other hand they used to fix the case when two players ran through a checkpoint at once,
+ // and often one of them just passed through without being registered. Hope it's fixed in a better way now.
+ // (happened on item triggers too)
+ //
+ //targ.wait = -2;
+ //targ.delay = 0;
+
+ //setsize(targ, trigger.mins, trigger.maxs);
+ //setorigin(targ, trigger.origin);
//remove(trigger);
}
}
void spawnfunc_runematch_spawn_point()
{
- if(!g_runematch || !cvar("g_runematch_fixedspawns"))
+ if(!g_runematch || !autocvar_g_runematch_fixedspawns)
{
remove(self);
return;
if(r == CURSE_EMPATHY)
_color = '179 0 204';//'128 0 255';
- return _color * (1 / 255) * cvar("g_runematch_rune_color_strength");
+ return _color * (1 / 255) * autocvar_g_runematch_rune_color_strength;
}
void rune_respawn();
self.solid = SOLID_TRIGGER;
self.touch = rune_touch;
self.think = rune_respawn;
- self.nextthink = time + cvar("g_runematch_shuffletime");//30 + random()*5; // fixme: cvar
+ self.nextthink = time + autocvar_g_runematch_shuffletime;//30 + random()*5; // fixme: cvar
}
else
{
e.solid = SOLID_TRIGGER;
// reposition itself if not picked up soon
e.think = rune_respawn;
- e.nextthink = time + cvar("g_runematch_respawntime");//15 + random()*5; // fixme: cvar
+ e.nextthink = time + autocvar_g_runematch_respawntime;//15 + random()*5; // fixme: cvar
e.touch = rune_touch;
pl.runes = pl.runes - (pl.runes & (e.runes | e.enemy.runes));
curse = find(curse, classname, "curse");
}
- numtodrop = cvar("g_runematch_drop_runes_max");
- prevent_same = !cvar("g_runematch_allow_same");
+ numtodrop = autocvar_g_runematch_drop_runes_max;
+ prevent_same = !autocvar_g_runematch_allow_same;
rune = curse = world;
do
runes_used = 0;
curses_used = 0;
- prevent_same = !cvar("g_runematch_allow_same");
+ prevent_same = !autocvar_g_runematch_allow_same;
numrunes = RUNE_COUNT;
while(numrunes > 0)
e.colormod = RuneColormod(rn);
e.enemy.colormod = RuneColormod(cs);
- e.alpha = e.enemy.alpha = cvar("g_runematch_rune_alpha");//0.78;
- e.effects = e.enemy.effects = cvar("g_runematch_rune_effects") | EF_LOWPRECISION;//EF_ADDITIVE;// | EF_FULLBRIGHT;
+ e.alpha = e.enemy.alpha = autocvar_g_runematch_rune_alpha;//0.78;
+ e.effects = e.enemy.effects = autocvar_g_runematch_rune_effects | EF_LOWPRECISION;//EF_ADDITIVE;// | EF_FULLBRIGHT;
//e.glow_size = e.enemy.glow_size = cvar("g_runematch_rune_glow_size");
//e.glow_color = e.enemy.glow_color = cvar("g_runematch_rune_glow_color");
{
entity rune;
- if(!g_runematch || !cvar("g_runematch_pointamt"))
+ if(!g_runematch || !autocvar_g_runematch_pointamt)
return;
if(gameover)
if(runematch_point_time > time)
return;
- runematch_point_time = time + cvar("g_runematch_pointrate");
+ runematch_point_time = time + autocvar_g_runematch_pointrate;
rune = world;
do
if(rune.owner.classname == "player")
{
- UpdateFrags(rune.owner, cvar("g_runematch_pointamt"));
+ UpdateFrags(rune.owner, autocvar_g_runematch_pointamt);
}
}while(rune);
}
}
if(!arunes && !trunes)
- return f - 1 + cvar("g_runematch_frags_norune"); // don't give points to players when no runes are involved.
+ return f - 1 + autocvar_g_runematch_frags_norune; // don't give points to players when no runes are involved.
if(arunes)
{ // got a kill while holding runes
- newfrags = newfrags + cvar("g_runematch_frags_killedby_runeholder");//5;
+ newfrags = newfrags + autocvar_g_runematch_frags_killedby_runeholder;//5;
}
if(trunes)
{ // killed an enemy holding runes
- newfrags = newfrags + cvar("g_runematch_frags_killed_runeholder");//5;
+ newfrags = newfrags + autocvar_g_runematch_frags_killed_runeholder;//5;
}
if(newfrags)
f = f - 1 + newfrags;
entity sk;
s = GetGametype();
- s = strcat(s, ":", cvar_string("g_xonoticversion"));
+ s = strcat(s, ":", autocvar_g_xonoticversion);
s = strcat(s, ":P", ftos(cvar_purechanges_count));
s = strcat(s, "::", GetPlayerScoreString(world, 1)); // make this 1 once we can, note: this doesn't contain any :<letter>
- fullstatus = cvar("g_full_getstatus_responses");
+ fullstatus = autocvar_g_full_getstatus_responses;
if(teamscores_entities_count)
{
{
float sp_domticks, sp_score;
sp_score = sp_domticks = 0;
- if(cvar("g_domination_disable_frags"))
+ if(autocvar_g_domination_disable_frags)
sp_domticks = SFL_SORT_PRIO_PRIMARY;
else
sp_score = SFL_SORT_PRIO_PRIMARY;
self.dmg = 2;
}
// check for falling damage
- if(!self.hook.state && !g_ca && !(g_cts && !cvar("g_cts_selfdamage")))
+ if(!self.hook.state && !g_ca && !(g_cts && !autocvar_g_cts_selfdamage))
{
dm = vlen(self.oldvelocity) - vlen(self.velocity); // dm is now the velocity DECREASE. Velocity INCREASE should never cause a sound or any damage.
if (self.deadflag)
- dm = (dm - cvar("g_balance_falldamage_deadminspeed")) * cvar("g_balance_falldamage_factor");
+ dm = (dm - autocvar_g_balance_falldamage_deadminspeed) * autocvar_g_balance_falldamage_factor;
else
- dm = min((dm - cvar("g_balance_falldamage_minspeed")) * cvar("g_balance_falldamage_factor"), cvar("g_balance_falldamage_maxdamage"));
+ dm = min((dm - autocvar_g_balance_falldamage_minspeed) * autocvar_g_balance_falldamage_factor, autocvar_g_balance_falldamage_maxdamage);
if (dm > 0)
Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');
}
- maxspeed = cvar("g_maxspeed");
+ maxspeed = autocvar_g_maxspeed;
if(maxspeed > 0 && vlen(self.velocity) > maxspeed)
Damage (self, world, world, 100000, DEATH_SHOOTING_STAR, self.origin, '0 0 0');
if (g_footsteps)
if (!gameover)
if (self.flags & FL_ONGROUND)
- if (vlen(self.velocity) > sv_maxspeed * 0.6)
+ if (vlen(self.velocity) > autocvar_sv_maxspeed * 0.6)
if (!self.deadflag)
if (time < self.lastground + 0.2)
{
WarpZone_StartFrame();
- sv_gravity = cvar("sv_gravity");
- sv_maxairspeed = cvar("sv_maxairspeed");
- sv_maxspeed = cvar ("sv_maxspeed");
- sv_friction = cvar ("sv_friction");
- sv_accelerate = cvar ("sv_accelerate");
- sv_airaccelerate = cvar("sv_airaccelerate");
- sv_airaccel_sideways_friction = cvar("sv_airaccel_sideways_friction");
- sv_airaccel_qw = cvar("sv_airaccel_qw");
- sv_stopspeed = cvar ("sv_stopspeed");
- sv_airstopaccelerate = cvar("sv_airstopaccelerate");
- sv_airstrafeaccelerate = cvar("sv_airstrafeaccelerate");
- sv_maxairstrafespeed = cvar("sv_maxairstrafespeed");
- sv_airstrafeaccel_qw = cvar("sv_airstrafeaccel_qw");
- sv_aircontrol = cvar("sv_aircontrol");
- sv_aircontrol_penalty = cvar("sv_aircontrol_penalty");
- sv_aircontrol_power = cvar("sv_aircontrol_power");
- sv_warsowbunny_airforwardaccel = cvar("sv_warsowbunny_airforwardaccel");
- sv_warsowbunny_accel = cvar("sv_warsowbunny_accel");
- sv_warsowbunny_topspeed = cvar("sv_warsowbunny_topspeed");
- sv_warsowbunny_turnaccel = cvar("sv_warsowbunny_turnaccel");
- sv_warsowbunny_backtosideratio = cvar("sv_warsowbunny_backtosideratio");
- sv_airspeedlimit_nonqw = cvar("sv_airspeedlimit_nonqw");
- teamplay = cvar ("teamplay");
- sys_frametime = cvar("sys_ticrate") * cvar("slowmo");
+ sys_frametime = autocvar_sys_ticrate * autocvar_slowmo;
if(sys_frametime <= 0)
sys_frametime = 1.0 / 60.0; // somewhat safe fallback
- sv_doublejump = cvar("sv_doublejump");
if (timeoutStatus == 1) // just before the timeout (when timeoutStatus will be 2)
- orig_slowmo = cvar("slowmo"); // slowmo will be restored after the timeout
+ orig_slowmo = autocvar_slowmo; // slowmo will be restored after the timeout
- if(teams_matter && !teamplay)
- teamplay = 3;
- if(!teams_matter && teamplay)
- teamplay = 0;
-
- skill = cvar("skill");
+ skill = autocvar_skill;
Spawnqueue_Check();
if(game_delay_last == TRUE)
if(game_delay == FALSE)
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(":startdelay_ended");
game_delay_last = game_delay;
// if in warmup stage and limit for warmup is hit start match
if (inWarmupStage)
if ((g_warmup_limit > 0 && time >= g_warmup_limit)
- || (g_warmup_limit == 0 && cvar("timelimit") != 0 && time >= cvar("timelimit") * 60))
+ || (g_warmup_limit == 0 && autocvar_timelimit != 0 && time >= autocvar_timelimit * 60))
{
ReadyRestart();
return;
RuneMatchGivePoints();
bot_serverframe();
- if(cvar("spawn_debugview"))
+ if(autocvar_spawn_debugview)
{
RandomSelection_Init();
for(self = world; (self = find(self, classname, "player")); )
{
if(g_ghost_items)
{
- self.colormod = stov(cvar_string("g_ghost_items_color"));
+ self.colormod = stov(autocvar_g_ghost_items_color);
self.glowmod = self.colormod;
self.alpha = g_ghost_items;
return TRUE;
// make the item translucent green and not touchable
e.model = e.mdl;
e.solid = SOLID_NOT;
- e.colormod = stov(cvar_string("g_ghost_items_color"));
+ e.colormod = stov(autocvar_g_ghost_items_color);
e.glowmod = e.colormod;
e.alpha = g_ghost_items;
e.customizeentityforclient = func_null;
// hide the item completely
e.model = string_null;
e.solid = SOLID_NOT;
- e.colormod = stov(cvar_string("g_ghost_items_color"));
+ e.colormod = stov(autocvar_g_ghost_items_color);
e.glowmod = e.colormod;
e.alpha = 0;
e.customizeentityforclient = func_null;
if (e.strength_finished || e.invincible_finished)
e.effects |= EF_ADDITIVE | EF_FULLBRIGHT;
- if (cvar("g_nodepthtestitems"))
+ if (autocvar_g_nodepthtestitems)
e.effects |= EF_NODEPTHTEST;
- if (cvar("g_fullbrightitems"))
+ if (autocvar_g_fullbrightitems)
e.effects |= EF_FULLBRIGHT;
// relink entity (because solid may have changed)
{
pickedup = TRUE;
player.ammo_fuel = bound(player.ammo_fuel, g_pickup_fuel_max, player.ammo_fuel + item.ammo_fuel);
- player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + cvar("g_balance_pause_fuel_rot"));
+ player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + autocvar_g_balance_pause_fuel_rot);
}
if((it = (item.items - (item.items & player.items)) & IT_PICKUPMASK))
{
if (item.weapons & WEPBIT_MINSTANEX)
W_GiveWeapon (player, WEP_MINSTANEX, item.netname);
if (item.ammo_cells)
- player.ammo_cells = bound(player.ammo_cells, 999, player.ammo_cells + cvar("g_minstagib_ammo_drop"));
+ player.ammo_cells = bound(player.ammo_cells, 999, player.ammo_cells + autocvar_g_minstagib_ammo_drop);
player.health = 100;
}
pickedup = TRUE;
// sound not available
// AnnounceTo(player, "_lives");
- player.armorvalue = bound(player.armorvalue, 999, player.armorvalue + cvar("g_minstagib_extralives"));
+ player.armorvalue = bound(player.armorvalue, 999, player.armorvalue + autocvar_g_minstagib_extralives);
sprint(player, "^3You picked up some extra lives\n");
}
pickedup = TRUE;
// sound not available
// AnnounceTo(player, "invisible");
- player.strength_finished = max(player.strength_finished, time) + cvar("g_balance_powerup_strength_time");
+ player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
}
// speed powerup
pickedup = TRUE;
// sound not available
// AnnounceTo(player, "speed");
- player.invincible_finished = max(player.invincible_finished, time) + cvar("g_balance_powerup_strength_time");
+ player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_strength_time;
}
}
}
{
pickedup = TRUE;
player.ammo_fuel = bound(player.ammo_fuel, g_pickup_fuel_max, player.ammo_fuel + item.ammo_fuel);
- player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + cvar("g_balance_pause_fuel_rot"));
+ player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + autocvar_g_balance_pause_fuel_rot);
}
}
if (item.strength_finished)
{
pickedup = TRUE;
- player.strength_finished = max(player.strength_finished, time) + cvar("g_balance_powerup_strength_time");
+ player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
}
if (item.invincible_finished)
{
pickedup = TRUE;
- player.invincible_finished = max(player.invincible_finished, time) + cvar("g_balance_powerup_invincible_time");
+ player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_invincible_time;
}
if (item.health)
{
pickedup = TRUE;
player.health = bound(player.health, item.max_health, player.health + item.health);
- player.pauserothealth_finished = max(player.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));
+ player.pauserothealth_finished = max(player.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
}
if (item.armorvalue)
if ((player.armorvalue < item.max_armorvalue) || item.pickup_anyway)
{
pickedup = TRUE;
player.armorvalue = bound(player.armorvalue, item.max_armorvalue, player.armorvalue + item.armorvalue);
- player.pauserotarmor_finished = max(player.pauserotarmor_finished, time + cvar("g_balance_pause_armor_rot"));
+ player.pauserotarmor_finished = max(player.pauserotarmor_finished, time + autocvar_g_balance_pause_armor_rot);
}
}
}
// If custom weapon priorities for bots is enabled rate most wanted weapons higher
if( bot_custom_weapon && c )
{
- for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+ for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
{
// Find weapon
if( (get_weaponinfo(i)).weapons & item.weapons != item.weapons )
c = 0;
// Detect needed ammo
- for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+ for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
{
wi = get_weaponinfo(i);
}
*/
- if(cvar("spawn_debug") >= 2)
+ if(autocvar_spawn_debug >= 2)
{
entity otheritem;
for(otheritem = findradius(self.origin, 3); otheritem; otheritem = otheritem.chain)
return;
}
}
- else if (!cvar("g_pickup_items") && itemid != IT_STRENGTH && itemid != IT_INVINCIBLE && itemid != IT_HEALTH)
+ else if (!autocvar_g_pickup_items && itemid != IT_STRENGTH && itemid != IT_INVINCIBLE && itemid != IT_HEALTH)
{
startitem_failed = TRUE;
remove (self);
}
void spawnfunc_item_health_mega (void) {
- if(!cvar("g_powerup_superhealth"))
+ if(!autocvar_g_powerup_superhealth)
return;
- if((g_arena || g_ca) && !cvar("g_arena_powerups"))
+ if((g_arena || g_ca) && !autocvar_g_arena_powerups)
return;
if(g_minstagib) {
void spawnfunc_item_health100() { spawnfunc_item_health_mega(); }
void spawnfunc_item_strength (void) {
- if(!cvar("g_powerup_strength"))
+ if(!autocvar_g_powerup_strength)
return;
- if((g_arena || g_ca) && !cvar("g_arena_powerups"))
+ if((g_arena || g_ca) && !autocvar_g_arena_powerups)
return;
if(g_minstagib) {
}
void spawnfunc_item_invincible (void) {
- if(!cvar("g_powerup_shield"))
+ if(!autocvar_g_powerup_shield)
return;
- if((g_arena || g_ca) && !cvar("g_arena_powerups"))
+ if((g_arena || g_ca) && !autocvar_g_arena_powerups)
return;
if(g_minstagib) {
self.use = target_items_use;
if(!self.strength_finished)
- self.strength_finished = cvar("g_balance_powerup_strength_time");
+ self.strength_finished = autocvar_g_balance_powerup_strength_time;
if(!self.invincible_finished)
- self.invincible_finished = cvar("g_balance_powerup_invincible_time");
+ self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
precache_sound("misc/itempickup.wav");
precache_sound("misc/megahealth.wav");
POSTGIVE_VALUE(e, ammo_cells, 0, "misc/itempickup.wav", string_null);
POSTGIVE_VALUE(e, ammo_shells, 0, "misc/itempickup.wav", string_null);
POSTGIVE_VALUE(e, ammo_rockets, 0, "misc/itempickup.wav", string_null);
- POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, cvar("g_balance_pause_fuel_rot"), pauseregen_finished, cvar("g_balance_pause_fuel_regen"), "misc/itempickup.wav", string_null);
- POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, cvar("g_balance_pause_armor_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/armor25.wav", string_null);
- POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, cvar("g_balance_pause_health_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/megahealth.wav", string_null);
+ POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, autocvar_g_balance_pause_fuel_rot, pauseregen_finished, autocvar_g_balance_pause_fuel_regen, "misc/itempickup.wav", string_null);
+ POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/armor25.wav", string_null);
+ POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/megahealth.wav", string_null);
if (g_minstagib)
{
torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5;
- grav = cvar("sv_gravity");
+ grav = autocvar_sv_gravity;
zdist = torg_z - org_z;
sdist = vlen(torg - org - zdist * '0 0 1');
*/
void spawnfunc_trigger_push()
{
- if (self.angles != '0 0 0')
- SetMovedir ();
+ SetMovedir ();
EXACTTRIGGER_INIT;
if(!self.freq)
{
// find pendulum length (same formula as Q3A)
- self.freq = 1 / (M_PI * 2) * sqrt(cvar("sv_gravity") / (3 * max(8, fabs(self.mins_z))));
+ self.freq = 1 / (M_PI * 2) * sqrt(autocvar_sv_gravity / (3 * max(8, fabs(self.mins_z))));
}
// copy initial angle
for(targ = world; (targ = find(targ, targetname, trigger.target)); )
if (targ.classname == "target_init" || targ.classname == "target_give" || targ.classname == "target_items")
{
- targ.wait = -2;
+ trigger.wait = 0;
+ trigger.delay = 0;
+ targ.wait = 0;
targ.delay = 0;
- setsize(targ, trigger.mins, trigger.maxs);
- setorigin(targ, trigger.origin);
+ //setsize(targ, trigger.mins, trigger.maxs);
+ //setorigin(targ, trigger.origin);
//remove(trigger);
}
}
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
+ self.netname = "shotgun"; // keep these weapons through the remove trigger
spawnfunc_target_items();
InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET);
}
entity targ;
for (targ = world; (targ = find(targ, targetname, self.target)); ) {
if (targ.classname == "weapon_rocketlauncher") {
- self.ammo_rockets += targ.count * cvar("g_balance_rocketlauncher_ammo");
+ self.ammo_rockets += targ.count * autocvar_g_balance_rocketlauncher_ammo;
self.netname = "rocketlauncher";
}
else if (targ.classname == "weapon_plasmagun") {
- self.ammo_rockets += targ.count * cvar("g_balance_hagar_primary_ammo");
+ self.ammo_rockets += targ.count * autocvar_g_balance_hagar_primary_ammo;
if(self.netname == "")
self.netname = "hagar";
else
self.netname = strcat(self.netname, " hagar");
}
else if (targ.classname == "weapon_bfg") {
- self.ammo_cells += targ.count * cvar("g_balance_crylink_primary_ammo");
+ self.ammo_cells += targ.count * autocvar_g_balance_crylink_primary_ammo;
if(self.netname == "")
self.netname = "crylink";
else
self.netname = strcat(self.netname, " crylink");
}
else if (targ.classname == "weapon_grenadelauncher") {
- self.ammo_rockets += targ.count * cvar("g_balance_grenadelauncher_primary_ammo");
+ self.ammo_rockets += targ.count * autocvar_g_balance_grenadelauncher_primary_ammo;
if(self.netname == "")
self.netname = "grenadelauncher";
else
self.armorvalue = 100;
else if (targ.classname == "item_health_mega")
self.health = 200;
- remove(targ);
+ //remove(targ); // removing ents in init functions causes havoc, workaround:
+ targ.think = SUB_Remove;
+ targ.nextthink = time;
}
self.spawnflags = 2;
spawnfunc_target_items();
{
TDEATHLOOP(org)
{
- if not(teamplay && cvar("g_telefrags_teamplay") && head.team == player.team)
+ if not(teams_matter && autocvar_g_telefrags_teamplay && head.team == player.team)
if(head.classname == "player")
if(head.health >= 1)
return 1;
{
if (player.classname == "player" && player.health >= 1)
{
- if not(teamplay && cvar("g_telefrags_teamplay") && head.team == player.team)
+ if not(teams_matter && autocvar_g_telefrags_teamplay && head.team == player.team)
{
if(head.classname == "player")
if(head.health >= 1)
if(player.classname == "player")
{
if(tflags & TELEPORT_FLAG_TDEATH)
- if(player.takedamage && player.deadflag == DEAD_NO && !g_race && !g_cts && (cvar("g_telefrags") || (tflags & TELEPORT_FLAG_FORCE_TDEATH)))
+ if(player.takedamage && player.deadflag == DEAD_NO && !g_race && !g_cts && (autocvar_g_telefrags || (tflags & TELEPORT_FLAG_FORCE_TDEATH)))
tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
// player no longer is on ground
if(teleporter.owner)
{
player.pusher = teleporter.owner;
- player.pushltime = time + cvar("g_maxpushtime");
+ player.pushltime = time + autocvar_g_maxpushtime;
}
else
{
for(e = world; (e = find(e, targetname, self.target)); )
{
p = 1;
- if(cvar("g_telefrags_avoid"))
+ if(autocvar_g_telefrags_avoid)
{
o = e.origin + '0 0 1' * (1 - other.mins_z - 24);
if(check_tdeath(other, o, '0 0 0', '0 0 0'))
if(e.speed)
if(vlen(other.velocity) > e.speed)
other.velocity = normalize(other.velocity) * max(0, e.speed);
- if(cvar("g_teleport_maxspeed"))
- if(vlen(other.velocity) > cvar("g_teleport_maxspeed"))
- other.velocity = normalize(other.velocity) * max(0, cvar("g_teleport_maxspeed"));
+ if(autocvar_g_teleport_maxspeed)
+ if(vlen(other.velocity) > autocvar_g_teleport_maxspeed)
+ other.velocity = normalize(other.velocity) * max(0, autocvar_g_teleport_maxspeed);
o = e.origin + '0 0 1' * (1 - other.mins_z - 24);
TeleportPlayer(self, other, o, e.mangle, v_forward * vlen(other.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
return 0; // no rebalancing whatsoever please
if(!teams_matter)
return 0;
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
return 0;
- if(cvar("bot_vs_human") && (c3==-1 && c4==-1))
+ if(autocvar_bot_vs_human && (c3==-1 && c4==-1))
return 0;
- if(!cvar("g_balance_teams_force"))
+ if(!autocvar_g_balance_teams_force)
return -1;
return 1;
}
void LogTeamchange(float player_id, float team_number, float type)
{
- if(!cvar("sv_eventlog"))
+ if(!autocvar_sv_eventlog)
return;
if(player_id < 1)
float i;
found = 0;
- prev = cvar("gamecfg");
+ prev = autocvar_gamecfg;
for(i = 0; i < 2; ++i)
{
+//#NO AUTOCVARS START
found += (g_dm = (!found && (prev != GAME_DEATHMATCH) && cvar("g_dm")));
found += (g_tdm = (!found && (prev != GAME_TEAM_DEATHMATCH) && cvar("g_tdm")));
found += (g_domination = (!found && (prev != GAME_DOMINATION) && cvar("g_domination")));
found += (g_cts = (!found && (prev != GAME_CTS) && cvar("g_cts")));
found += (g_freezetag = (!found && (prev != GAME_FREEZETAG) && cvar("g_freezetag")));
found += (g_keepaway = (!found && (prev != GAME_KEEPAWAY) && cvar("g_keepaway")));
+//#NO AUTOCVARS END
if(found)
break;
if(!found)
g_dm = 1;
- if(g_dm && cvar("deathmatch_force_teamplay"))
+ if(g_dm && autocvar_deathmatch_force_teamplay)
{
g_dm = 0;
g_tdm = 1;
}
teams_matter = 0;
+ serverflags &~= SERVERFLAG_TEAMPLAY;
}
void default_delayedinit()
void ActivateTeamplay()
{
- float teamplay_default;
- teamplay_default = cvar("teamplay_default");
-
- if(teamplay_default)
- teamplay = teamplay_default;
- else
- teamplay = 3;
- cvar_set("teamplay", ftos(teamplay));
-
+ serverflags |= SERVERFLAG_TEAMPLAY;
teams_matter = 1;
}
VoteReset();
- teams_matter = 0;
- cvar_set("teamplay", "0");
-
// make sure only ONE type is selected
ReadGameCvars();
WriteGameCvars();
ReadGameCvars();
// set both here, gamemode can override it later
- timelimit_override = cvar("timelimit_override");
- fraglimit_override = cvar("fraglimit_override");
- leadlimit_override = cvar("leadlimit_override");
+ timelimit_override = autocvar_timelimit_override;
+ fraglimit_override = autocvar_fraglimit_override;
+ leadlimit_override = autocvar_leadlimit_override;
if(g_dm)
{
gamemode_name = "Team Deathmatch";
ActivateTeamplay();
tdm_init();
- if(cvar("g_tdm_team_spawns"))
+ if(autocvar_g_tdm_team_spawns)
have_team_spawns = -1; // request team spawns
}
game = GAME_DOMINATION;
gamemode_name = "Domination";
ActivateTeamplay();
- fraglimit_override = cvar("g_domination_point_limit");
- leadlimit_override = cvar("g_domination_point_leadlimit");
+ fraglimit_override = autocvar_g_domination_point_limit;
+ leadlimit_override = autocvar_g_domination_point_leadlimit;
dom_init();
have_team_spawns = -1; // request team spawns
}
game = GAME_CTF;
gamemode_name = "Capture the Flag";
ActivateTeamplay();
- if(cvar("g_campaign"))
- g_ctf_win_mode = 2;
- else
- g_ctf_win_mode = cvar("g_ctf_win_mode");
- g_ctf_ignore_frags = cvar("g_ctf_ignore_frags");
+ g_ctf_ignore_frags = autocvar_g_ctf_ignore_frags;
if(g_ctf_win_mode == 2)
{
- fraglimit_override = cvar("g_ctf_capture_limit");
- leadlimit_override = cvar("g_ctf_capture_leadlimit");
+ fraglimit_override = autocvar_g_ctf_capture_limit;
+ leadlimit_override = autocvar_g_ctf_capture_leadlimit;
}
else
{
- fraglimit_override = cvar("capturelimit_override");
- leadlimit_override = cvar("captureleadlimit_override");
+ fraglimit_override = autocvar_capturelimit_override;
+ leadlimit_override = autocvar_captureleadlimit_override;
}
ctf_init();
have_team_spawns = -1; // request team spawns
{
game = GAME_RUNEMATCH;
gamemode_name = "Rune Match";
- if(cvar("deathmatch_force_teamplay"))
+ if(autocvar_deathmatch_force_teamplay)
ActivateTeamplay();
- fraglimit_override = cvar("g_runematch_point_limit");
- leadlimit_override = cvar("g_runematch_point_leadlimit");
+ fraglimit_override = autocvar_g_runematch_point_limit;
+ leadlimit_override = autocvar_g_runematch_point_leadlimit;
runematch_init();
}
{
game = GAME_LMS;
gamemode_name = "Last Man Standing";
- fraglimit_override = cvar("g_lms_lives_override");
+ fraglimit_override = autocvar_g_lms_lives_override;
leadlimit_override = 0; // not supported by LMS
if(fraglimit_override == 0)
fraglimit_override = -1;
{
game = GAME_ARENA;
gamemode_name = "Arena";
- fraglimit_override = cvar("g_arena_point_limit");
- leadlimit_override = cvar("g_arena_point_leadlimit");
- maxspawned = cvar("g_arena_maxspawned");
+ fraglimit_override = autocvar_g_arena_point_limit;
+ leadlimit_override = autocvar_g_arena_point_leadlimit;
+ maxspawned = autocvar_g_arena_maxspawned;
if(maxspawned < 2)
maxspawned = 2;
- arena_roundbased = cvar("g_arena_roundbased");
+ arena_roundbased = autocvar_g_arena_roundbased;
}
if(g_ca)
game = GAME_CA;
gamemode_name = "Clan Arena";
ActivateTeamplay();
- fraglimit_override = cvar("g_ca_point_limit");
- leadlimit_override = cvar("g_ca_point_leadlimit");
+ fraglimit_override = autocvar_g_ca_point_limit;
+ leadlimit_override = autocvar_g_ca_point_leadlimit;
precache_sound("ctf/red_capture.wav");
precache_sound("ctf/blue_capture.wav");
}
game = GAME_KEYHUNT;
gamemode_name = "Key Hunt";
ActivateTeamplay();
- fraglimit_override = cvar("g_keyhunt_point_limit");
- leadlimit_override = cvar("g_keyhunt_point_leadlimit");
+ fraglimit_override = autocvar_g_keyhunt_point_limit;
+ leadlimit_override = autocvar_g_keyhunt_point_leadlimit;
MUTATOR_ADD(gamemode_keyhunt);
}
game = GAME_FREEZETAG;
gamemode_name = "Freeze Tag";
ActivateTeamplay();
- fraglimit_override = cvar("g_freezetag_point_limit");
- leadlimit_override = cvar("g_freezetag_point_leadlimit");
+ fraglimit_override = autocvar_g_freezetag_point_limit;
+ leadlimit_override = autocvar_g_freezetag_point_leadlimit;
MUTATOR_ADD(gamemode_freezetag);
}
game = GAME_RACE;
gamemode_name = "Race";
- if(cvar("g_race_teams"))
+ if(autocvar_g_race_teams)
{
ActivateTeamplay();
- race_teams = bound(2, cvar("g_race_teams"), 4);
+ race_teams = bound(2, autocvar_g_race_teams, 4);
have_team_spawns = -1; // request team spawns
}
else
race_teams = 0;
- qualifying_override = cvar("g_race_qualifying_timelimit_override");
- fraglimit_override = cvar("g_race_laps_limit");
+ qualifying_override = autocvar_g_race_qualifying_timelimit_override;
+ fraglimit_override = autocvar_g_race_laps_limit;
leadlimit_override = 0; // currently not supported by race
}
{
game = GAME_NEXBALL;
gamemode_name = "Nexball";
- fraglimit_override = cvar("g_nexball_goallimit");
- leadlimit_override = cvar("g_nexball_goalleadlimit");
+ fraglimit_override = autocvar_g_nexball_goallimit;
+ leadlimit_override = autocvar_g_nexball_goalleadlimit;
ActivateTeamplay();
nb_init();
have_team_spawns = -1; // request team spawns
cache_lastmutatormsg = strzone("");
// enforce the server's universal frag/time limits
- if(!cvar("g_campaign"))
+ if(!autocvar_g_campaign)
{
if(fraglimit_override >= 0)
cvar_set("fraglimit", ftos(fraglimit_override));
if(g_race)
{
// we need to find out the correct value for g_race_qualifying
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
{
g_race_qualifying = 1;
}
- else if(!cvar("g_campaign") && cvar("g_race_qualifying_timelimit") > 0)
+ else if(!autocvar_g_campaign && autocvar_g_race_qualifying_timelimit > 0)
{
g_race_qualifying = 2;
- race_fraglimit = cvar("fraglimit");
- race_leadlimit = cvar("leadlimit");
- race_timelimit = cvar("timelimit");
+ race_fraglimit = autocvar_fraglimit;
+ race_leadlimit = autocvar_leadlimit;
+ race_timelimit = autocvar_timelimit;
cvar_set("fraglimit", "0");
cvar_set("leadlimit", "0");
- cvar_set("timelimit", cvar_string("g_race_qualifying_timelimit"));
+ cvar_set("timelimit", ftos(autocvar_g_race_qualifying_timelimit));
}
else
g_race_qualifying = 0;
string GetClientVersionMessage() {
local string versionmsg;
if (self.version_mismatch) {
- if(self.version < cvar("gameversion")) {
+ if(self.version < autocvar_gameversion) {
versionmsg = "^3Your client version is outdated.\n\n\n### YOU WON'T BE ABLE TO PLAY ON THIS SERVER ###\n\n\nPlease update!!!^8";
} else {
versionmsg = "^3This server is using an outdated Xonotic version.\n\n\n ### THIS SERVER IS INCOMPATIBLE AND THUS YOU CANNOT JOIN ###.^8";
if(self.cvar_scr_centertime == 0) return;
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
{
if(self.classname == "player" && !self.BUTTON_INFO)
return;
}
else
{
- if((time - self.jointime) > cvar("welcome_message_time") && !self.BUTTON_INFO)
+ if((time - self.jointime) > autocvar_welcome_message_time && !self.BUTTON_INFO)
return;
}
self.welcomemessage_time = time + max(0.5, self.cvar_scr_centertime * 0.6);
}
- if(cvar("g_campaign"))
+ if(autocvar_g_campaign)
{
centerprint(pl, campaign_message);
return;
else
modifications = strcat(modifications, ", ", g_weaponarena_list, " Arena");
}
- if(cvar("g_start_weapon_laser") == 0)
+ if(autocvar_g_start_weapon_laser == 0)
modifications = strcat(modifications, ", No start weapons");
- if(cvar("sv_gravity") < 800)
+ if(autocvar_sv_gravity < 800)
modifications = strcat(modifications, ", Low gravity");
- if(g_cloaked)
+ if(g_cloaked && !g_cts)
modifications = strcat(modifications, ", Cloaked");
if(g_grappling_hook)
modifications = strcat(modifications, ", Hook");
modifications = strcat(modifications, ", Midair");
if(g_pinata)
modifications = strcat(modifications, ", Pinata");
- if(g_weapon_stay)
+ if(g_weapon_stay && !g_cts)
modifications = strcat(modifications, ", Weapons stay");
if(g_bloodloss > 0)
modifications = strcat(modifications, ", Bloodloss");
local string versionmessage;
versionmessage = GetClientVersionMessage();
- s = strcat(s, NEWLINES, "This is Xonotic ", cvar_string("g_xonoticversion"), "\n", versionmessage);
+ s = strcat(s, NEWLINES, "This is Xonotic ", autocvar_g_xonoticversion, "\n", versionmessage);
s = strcat(s, "^8\n\nmatch type is ^1", gamemode_name, "^8\n");
if(modifications != "")
if (g_grappling_hook)
s = strcat(s, "\n\n^3grappling hook^8 is enabled, press 'e' to use it\n");
- if(cache_lastmutatormsg != cvar_string("g_mutatormsg"))
+ if(cache_lastmutatormsg != autocvar_g_mutatormsg)
{
if(cache_lastmutatormsg)
strunzone(cache_lastmutatormsg);
if(cache_mutatormsg)
strunzone(cache_mutatormsg);
- cache_lastmutatormsg = strzone(cvar_string("g_mutatormsg"));
+ cache_lastmutatormsg = strzone(autocvar_g_mutatormsg);
cache_mutatormsg = strzone(cache_lastmutatormsg);
}
s = strcat(s, "\n\n^8special gameplay tips: ^7", cache_mutatormsg);
}
- motd = cvar_string("sv_motd");
+ motd = autocvar_sv_motd;
if (motd != "") {
s = strcat(s, "\n\n^8MOTD: ^7", strreplace("\\n", "\n", motd));
}
c1 = c2 = c3 = c4 = -1;
cb1 = cb2 = cb3 = cb4 = 0;
- if(cvar("g_campaign") && for_whom && clienttype(for_whom) == CLIENTTYPE_REAL)
- {
- c1 = 0; // only allow RED team for player joining
- }
- else if(g_onslaught)
+ if(g_onslaught)
{
// onslaught is special
head = findchain(classname, "onslaught_generator");
// TODO: Balance quantity of bots across > 2 teams when bot_vs_human is set (and remove next line)
if(c3==-1 && c4==-1)
- if(cvar("bot_vs_human") && for_whom)
+ if(autocvar_bot_vs_human && for_whom)
{
- if(cvar("bot_vs_human") > 0)
+ if(autocvar_bot_vs_human > 0)
{
// bots are all blue
if(clienttype(for_whom) == CLIENTTYPE_BOT)
// FIXME: also find and memorize the lowest-scoring bot on each team (in case players must be shuffled around)
// also remember the lowest-scoring player
- FOR_EACH_PLAYER(head)
+ FOR_EACH_CLIENT(head)
{
+ float t;
+ if(head.classname == "player")
+ t = head.team;
+ else if(head.team_forced > 0)
+ t = head.team_forced; // reserve the spot
+ else
+ continue;
if(head != ignore)// && head.netname != "")
{
value = PlayerValue(head);
bvalue = value;
else
bvalue = 0;
- if(head.team == COLOR_TEAM1)
+ if(t == COLOR_TEAM1)
{
if(c1 >= 0)
{
cb1 = cb1 + bvalue;
}
}
- if(head.team == COLOR_TEAM2)
+ if(t == COLOR_TEAM2)
{
if(c2 >= 0)
{
cb2 = cb2 + bvalue;
}
}
- if(head.team == COLOR_TEAM3)
+ if(t == COLOR_TEAM3)
{
if(c3 >= 0)
{
cb3 = cb3 + bvalue;
}
}
- if(head.team == COLOR_TEAM4)
+ if(t == COLOR_TEAM4)
{
if(c4 >= 0)
{
}
}
}
+
+ // if the player who has a forced team has not joined yet, reserve the spot
+ if(autocvar_g_campaign)
+ {
+ switch(autocvar_g_campaign_forceteam)
+ {
+ case 1: if(c1 == cb1) ++c1; break;
+ case 2: if(c2 == cb2) ++c2; break;
+ case 3: if(c3 == cb3) ++c3; break;
+ case 4: if(c4 == cb4) ++c4; break;
+ }
+ }
}
// returns # of smallest team (1, 2, 3, 4)
if(c4 >= 0)
totalteams = totalteams + 1;
- if((cvar("bot_vs_human") || pl.team_forced > 0) && totalteams == 1)
+ if((autocvar_bot_vs_human || pl.team_forced > 0) && totalteams == 1)
totalteams += 1;
if(totalteams <= 1)
{
- if(cvar("g_campaign") && pl && clienttype(pl) == CLIENTTYPE_REAL)
+ if(autocvar_g_campaign && pl && clienttype(pl) == CLIENTTYPE_REAL)
return 1; // special case for campaign and player joining
else if(g_domination)
error("Too few teams available for domination\n");
// find out what teams are available
CheckAllowedTeams(pl);
- // if we want the player in a certain team for campaign, force him there
- if(cvar("g_campaign"))
- if(clienttype(pl) == CLIENTTYPE_REAL) // only players, not bots
- {
- switch(cvar("g_campaign_forceteam"))
- {
- case 1:
- SetPlayerColors(pl, COLOR_TEAM1 - 1);
- LogTeamchange(pl.playerid, pl.team, 2);
- return COLOR_TEAM1;
- case 2:
- SetPlayerColors(pl, COLOR_TEAM2 - 1);
- LogTeamchange(pl.playerid, pl.team, 2);
- return COLOR_TEAM2;
- case 3:
- SetPlayerColors(pl, COLOR_TEAM3 - 1);
- LogTeamchange(pl.playerid, pl.team, 2);
- return COLOR_TEAM3;
- case 4:
- SetPlayerColors(pl, COLOR_TEAM4 - 1);
- LogTeamchange(pl.playerid, pl.team, 2);
- return COLOR_TEAM4;
- default:
- break;
- }
- }
-
// if we don't care what team he ends up on, put him on whatever team he entered as.
// if he's not on a valid team, then let other code put him on the smallest team
if(!forcebestteam)
return;
}
- if((cvar("g_campaign")) || (cvar("g_changeteam_banned") && self.wasplayer)) {
+ if((autocvar_g_campaign) || (autocvar_g_changeteam_banned && self.wasplayer)) {
sprint(self, "Team changes not allowed\n");
return; // changing teams is not allowed
}
- if(cvar("g_balance_teams_prevent_imbalance"))
+ if(autocvar_g_balance_teams_prevent_imbalance)
{
// only allow changing to a smaller or equal size team
{
float numteams;
- numteams = cvar("g_tdm_teams_override");
+ numteams = autocvar_g_tdm_teams_override;
if(numteams < 2)
- numteams = cvar("g_tdm_teams");
+ numteams = autocvar_g_tdm_teams;
numteams = bound(2, numteams, 4);
tdm_spawnteam("Red", COLOR_TEAM1-1);
vz = self.enemy.velocity_z;
for(i = 0; i < impact_time; i += sys_frametime)
{
- vz = vz - (sv_gravity * sys_frametime);
+ vz = vz - (autocvar_sv_gravity * sys_frametime);
prep_z = prep_z + vz * sys_frametime;
}
}
if not (self.tur_active)
return;
- if (teamplay != 0)
+ if (teams_matter)
if (self.team == attacker.team)
{
// This does not happen anymore. Re-enable if you fix that.
if(clienttype(attacker) == CLIENTTYPE_REAL)
sprint(attacker, "\{1}Turret tells you: I'm on your team!\n");
- if(cvar("g_friendlyfire"))
- damage = damage * cvar("g_friendlyfire");
+ if(autocvar_g_friendlyfire)
+ damage = damage * autocvar_g_friendlyfire;
else
return;
}
self.nextthink = time + self.ticrate;
// ONS uses somewhat backwards linking.
- if (teamplay)
+ if (teams_matter)
{
if not (g_onslaught)
if (self.target)
// g_turrets_targetscan_maxdelay forces a target re-scan at least this often
float do_target_scan;
- if((self.target_select_time + cvar("g_turrets_targetscan_maxdelay")) < time)
+ if((self.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time)
do_target_scan = 1;
// Old target (if any) invalid?
}
// But never more often then g_turrets_targetscan_mindelay!
- if (self.target_select_time + cvar("g_turrets_targetscan_mindelay") > time)
+ if (self.target_select_time + autocvar_g_turrets_targetscan_mindelay > time)
do_target_scan = 0;
if(do_target_scan)
return;
}
else
- self.lip = time + cvar("g_turrets_aimidle_delay"); // Keep track of the last time we had a target.
+ self.lip = time + autocvar_g_turrets_aimidle_delay; // Keep track of the last time we had a target.
// Predict?
if not(self.aim_flags & TFL_AIM_NO)
void turret_fire()
{
- if (cvar("g_turrets_nofire") != 0)
+ if (autocvar_g_turrets_nofire != 0)
return;
self.turret_firefunc();
self.nextthink = time + 1;
entity e;
- if (cvar("g_turrets_reloadcvars") == 1)
+ if (autocvar_g_turrets_reloadcvars == 1)
{
e = nextent(world);
while (e)
entity e, ee;
// Are turrets allowed?
- if (cvar("g_turrets") == 0)
+ if (autocvar_g_turrets == 0)
return 0;
load_unit_settings(self,self.cvar_basename, 0);
// Handle turret teams.
- if (cvar("g_assault") != 0)
+ if (autocvar_g_assault != 0)
{
if not (self.team)
self.team = 14; // Assume turrets are on the defending side if not explicitly set otehrwize
}
- else if not (teamplay)
+ else if not (teams_matter)
self.team = MAX_SHOT_DISTANCE; // Group all turrets into the same team, so they dont kill eachother.
else if(g_onslaught && self.targetname)
{
void turret_ewheel_loadcvars()
{
- ewheel_speed_fast = cvar("g_turrets_unit_ewheel_speed_fast");
- ewheel_speed_slow = cvar("g_turrets_unit_ewheel_speed_slow");
- ewheel_speed_slower = cvar("g_turrets_unit_ewheel_speed_slower");
- ewheel_speed_stop = cvar("g_turrets_unit_ewheel_speed_stop");
+ ewheel_speed_fast = autocvar_g_turrets_unit_ewheel_speed_fast;
+ ewheel_speed_slow = autocvar_g_turrets_unit_ewheel_speed_slow;
+ ewheel_speed_slower = autocvar_g_turrets_unit_ewheel_speed_slower;
+ ewheel_speed_stop = autocvar_g_turrets_unit_ewheel_speed_stop;
}
void turret_ewheel_projectile_explode()
self.tur_head.frame = 1;
// Convert from dgr / sec to dgr / tic
- self.tur_head.aim_speed = cvar("g_turrets_unit_ewheel_turnrate");
+ self.tur_head.aim_speed = autocvar_g_turrets_unit_ewheel_turnrate;
self.tur_head.aim_speed = self.tur_head.aim_speed / (1 / self.ticrate);
if (!turret_tag_fire_update())
void turret_hellion_postthink()
{
- if (cvar("g_turrets_reloadcvars"))
+ if (autocvar_g_turrets_reloadcvars)
{
- if (!self.shot_speed_max) self.shot_speed_max = cvar("g_turrets_unit_hellion_std_shot_speed_max");
- if (!self.shot_speed_gain) self.shot_speed_gain = cvar("g_turrets_unit_hellion_std_shot_speed_gain");
+ if (!self.shot_speed_max) self.shot_speed_max = autocvar_g_turrets_unit_hellion_std_shot_speed_max;
+ if (!self.shot_speed_gain) self.shot_speed_gain = autocvar_g_turrets_unit_hellion_std_shot_speed_gain;
}
if (self.tur_head.frame != 0)
if (self.netname == "") self.netname = "Hellion Missile Turret";
if not (self.shot_speed_max)
- self.shot_speed_max = cvar("g_turrets_unit_hellion_std_shot_speed_max");
+ self.shot_speed_max = autocvar_g_turrets_unit_hellion_std_shot_speed_max;
if not (self.shot_speed_gain)
- self.shot_speed_gain = cvar("g_turrets_unit_hellion_std_shot_speed_gain");
+ self.shot_speed_gain = autocvar_g_turrets_unit_hellion_std_shot_speed_gain;
self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_FASTPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
self.aim_flags = TFL_AIM_SIMPLE;
missile.enemy = self.enemy;
missile.team = self.team;
missile.cnt = time + 30;
- missile.ticrate = max(cvar("sys_ticrate"),0.05);
+ missile.ticrate = max(autocvar_sys_ticrate,0.05);
CSQCProjectile(missile, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, fly sound
// Calculate new heading
olddir = normalize(self.velocity);
- newdir = normalize(olddir + wishdir * cvar("g_turrets_unit_hk_std_shot_speed_turnrate"));
+ newdir = normalize(olddir + wishdir * autocvar_g_turrets_unit_hk_std_shot_speed_turnrate);
// Set heading & speed
self.velocity = newdir * myspeed;
void turret_hk_postthink()
{
- if (cvar("g_turrets_reloadcvars"))
+ if (autocvar_g_turrets_reloadcvars)
{
- hk_maxspeed = cvar("g_turrets_unit_hk_std_shot_speed_max");
- hk_minspeed = cvar("g_turrets_unit_hk_std_shot_speed");
- hk_accel = cvar("g_turrets_unit_hk_std_shot_speed_accel");
- hk_accel2 = cvar("g_turrets_unit_hk_std_shot_speed_accel2");
- hk_decel = cvar("g_turrets_unit_hk_std_shot_speed_decel");
+ hk_maxspeed = autocvar_g_turrets_unit_hk_std_shot_speed_max;
+ hk_minspeed = autocvar_g_turrets_unit_hk_std_shot_speed;
+ hk_accel = autocvar_g_turrets_unit_hk_std_shot_speed_accel;
+ hk_accel2 = autocvar_g_turrets_unit_hk_std_shot_speed_accel2;
+ hk_decel = autocvar_g_turrets_unit_hk_std_shot_speed_decel;
}
if (self.tur_head.frame != 0)
{
if (self.netname == "") self.netname = "Hunter-killer turret";
- hk_maxspeed = cvar("g_turrets_unit_hk_std_shot_speed_max");
- hk_minspeed = cvar("g_turrets_unit_hk_std_shot_speed");
- hk_accel = cvar("g_turrets_unit_hk_std_shot_speed_accel");
- hk_accel2 = cvar("g_turrets_unit_hk_std_shot_speed_accel2");
- hk_decel = cvar("g_turrets_unit_hk_std_shot_speed_decel");
+ hk_maxspeed = autocvar_g_turrets_unit_hk_std_shot_speed_max;
+ hk_minspeed = autocvar_g_turrets_unit_hk_std_shot_speed;
+ hk_accel = autocvar_g_turrets_unit_hk_std_shot_speed_accel;
+ hk_accel2 = autocvar_g_turrets_unit_hk_std_shot_speed_accel2;
+ hk_decel = autocvar_g_turrets_unit_hk_std_shot_speed_decel;
self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_RECIVETARGETS;
void turret_machinegun_attack()
{
sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
- fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+ fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
//w_deathtypestring = "had an alergic reaction due to 10 kilos of led";
self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL;
self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
- if not (cvar("g_antilag_bullets"))
+ if not (autocvar_g_antilag_bullets)
self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
if (turret_stdproc_init("machinegun_std",0,"models/turrets/base.md3","models/turrets/machinegun.md3") == 0)
entity beam;
beam = spawn();
- beam.ticrate = 0.1; //cvar("sys_ticrate");
+ beam.ticrate = 0.1; //autocvar_sys_ticrate;
setmodel(beam,"models/turrets/phaser_beam.md3");
beam.effects = EF_LOWPRECISION;
beam.solid = SOLID_NOT;
self.fireflag = 1;
beam.attack_finished_single = self.attack_finished_single;
- self.attack_finished_single = time; // + cvar("sys_ticrate");
+ self.attack_finished_single = time; // + autocvar_sys_ticrate;
setattachment(beam,self.tur_head,"tag_fire");
*/
void spawnfunc_turret_targettrigger()
{
- if (!cvar("g_turrets"))
+ if (!autocvar_g_turrets)
{
remove(self);
return;
void walker_loadcvars()
{
- walker_meele_dmg = cvar("g_turrets_unit_walker_std_meele_dmg");
- walker_meele_force = cvar("g_turrets_unit_walker_std_meele_force");
-
- walker_speed_stop = cvar("g_turrets_unit_walker_speed_stop");
- walker_speed_walk = cvar("g_turrets_unit_walker_speed_walk");
- walker_speed_run = cvar("g_turrets_unit_walker_speed_run");
- walker_speed_jump = cvar("g_turrets_unit_walker_speed_jump");
- walker_speed_roam = cvar("g_turrets_unit_walker_speed_roam");
- walker_speed_swim = cvar("g_turrets_unit_walker_speed_swim");
-
- walker_std_rocket_dmg = cvar("g_turrets_unit_walker_std_rocket_dmg");
- walker_std_rocket_radius = cvar("g_turrets_unit_walker_std_rocket_radius");
- walker_std_rocket_force = cvar("g_turrets_unit_walker_std_rocket_force");
- walker_std_rocket_speed = cvar("g_turrets_unit_walker_std_rocket_speed");
- walker_std_rocket_turnrate = cvar("g_turrets_unit_walker_std_rocket_turnrate");
+ walker_meele_dmg = autocvar_g_turrets_unit_walker_std_meele_dmg;
+ walker_meele_force = autocvar_g_turrets_unit_walker_std_meele_force;
+
+ walker_speed_stop = autocvar_g_turrets_unit_walker_speed_stop;
+ walker_speed_walk = autocvar_g_turrets_unit_walker_speed_walk;
+ walker_speed_run = autocvar_g_turrets_unit_walker_speed_run;
+ walker_speed_jump = autocvar_g_turrets_unit_walker_speed_jump;
+ walker_speed_roam = autocvar_g_turrets_unit_walker_speed_roam;
+ walker_speed_swim = autocvar_g_turrets_unit_walker_speed_swim;
+
+ walker_std_rocket_dmg = autocvar_g_turrets_unit_walker_std_rocket_dmg;
+ walker_std_rocket_radius = autocvar_g_turrets_unit_walker_std_rocket_radius;
+ walker_std_rocket_force = autocvar_g_turrets_unit_walker_std_rocket_force;
+ walker_std_rocket_speed = autocvar_g_turrets_unit_walker_std_rocket_speed;
+ walker_std_rocket_turnrate = autocvar_g_turrets_unit_walker_std_rocket_turnrate;
}
wish_angle = angleofs(self,self.enemy);
- if (self.tur_dist_enemy > cvar("g_turrets_unit_walker_std_meele_range"))
+ if (self.tur_dist_enemy > autocvar_g_turrets_unit_walker_std_meele_range)
return 0;
else
if (fabs(wish_angle_y) > 15)
if (self.tur_head.attack_finished_single > time)
return 0;
- if (self.tur_dist_enemy < cvar("g_turrets_unit_walker_std_rockets_range_min"))
+ if (self.tur_dist_enemy < autocvar_g_turrets_unit_walker_std_rockets_range_min)
return 0;
- if (self.tur_dist_enemy > cvar("g_turrets_unit_walker_std_rockets_range"))
+ if (self.tur_dist_enemy > autocvar_g_turrets_unit_walker_std_rockets_range)
return 0;
entity rv;
rv.cnt = 4;
rv.owner = self;
- self.tur_head.attack_finished_single = time + cvar("g_turrets_unit_walker_std_rocket_refire");
+ self.tur_head.attack_finished_single = time + autocvar_g_turrets_unit_walker_std_rocket_refire;
return 1;
}
void walker_attack()
{
sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
- fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+ fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
if (self.uzi_bulletcounter == 2)
{
self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MOVE ;
self.aim_flags = TFL_AIM_LEAD;
- if (cvar("g_antilag_bullets"))
+ if (autocvar_g_antilag_bullets)
self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
else
self.aim_flags |= TFL_AIM_SHOTTIMECOMPENSATE;
void racer_loadsettings()
{
- racer_power_min = cvar("g_vehicle_racer_power_min") * 0.25;
- racer_power_air = cvar("g_vehicle_racer_power_air") * 0.25;
- racer_power_solid = cvar("g_vehicle_racer_power_solid") * 0.25;
+ racer_power_min = autocvar_g_vehicle_racer_power_min * 0.25;
+ racer_power_air = autocvar_g_vehicle_racer_power_air * 0.25;
+ racer_power_solid = autocvar_g_vehicle_racer_power_solid * 0.25;
- racer_springlength = cvar("g_vehicle_racer_springlength");
- racer_anglestabilizer = cvar("g_vehicle_racer_anglestabilizer");
- racer_pitchspeed = cvar("g_vehicle_racer_pitchspeed");
- racer_turnspeed = cvar("g_vehicle_racer_turnspeed");
- racer_turnroll = cvar("g_vehicle_racer_turnroll");
- racer_speed_forward = cvar("g_vehicle_racer_speed_forward");
- racer_speed_strafe = cvar("g_vehicle_racer_speed_strafe");
+ racer_springlength = autocvar_g_vehicle_racer_springlength;
+ racer_anglestabilizer = autocvar_g_vehicle_racer_anglestabilizer;
+ racer_pitchspeed = autocvar_g_vehicle_racer_pitchspeed;
+ racer_turnspeed = autocvar_g_vehicle_racer_turnspeed;
+ racer_turnroll = autocvar_g_vehicle_racer_turnroll;
+ racer_speed_forward = autocvar_g_vehicle_racer_speed_forward;
+ racer_speed_strafe = autocvar_g_vehicle_racer_speed_strafe;
- racer_afterburn_cost = cvar("g_vehicle_racer_afterburn_cost");
+ racer_afterburn_cost = autocvar_g_vehicle_racer_afterburn_cost;
- racer_healthmax = cvar("g_vehicle_racer_health");
- racer_shieldmax = cvar("g_vehicle_racer_shield");
- racer_energymax = cvar("g_vehicle_racer_energy");
+ racer_healthmax = autocvar_g_vehicle_racer_health;
+ racer_shieldmax = autocvar_g_vehicle_racer_shield;
+ racer_energymax = autocvar_g_vehicle_racer_energy;
}
self.velocity += normalize(self.origin - trace_endpos) * (vlen(self.velocity) * 1.25);
self.velocity = self.velocity + (push_vector * frametime);
- self.velocity_z -= sv_gravity * frametime;
+ self.velocity_z -= autocvar_sv_gravity * frametime;
push_vector_x = (fl_push - bl_push);
push_vector_x += (fr_push - br_push);
org2 = findbetterlocation (self.origin, 8);
pointparticles(particleeffectnum("laser_impact"), org2, trace_plane_normal * 1000, 1);
- RadiusDamage (self, self.realowner, cvar("g_vehicle_racer_laser_damage"), 0, cvar("g_vehicle_racer_laser_radius"), world, 150, DEATH_WAKIGUN, world);
+ RadiusDamage (self, self.realowner, autocvar_g_vehicle_racer_laser_damage, 0, autocvar_g_vehicle_racer_laser_radius, world, 150, DEATH_WAKIGUN, world);
sound (self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
remove (self);
sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
org2 = findbetterlocation (self.origin, 16);
pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
- RadiusDamage (self, self.realowner ,cvar("g_vehicle_racer_rocket_damage"), 0, cvar("g_vehicle_racer_rocket_radius"), world, 150, DEATH_WAKIROCKET, world);
+ RadiusDamage (self, self.realowner ,autocvar_g_vehicle_racer_rocket_damage, 0, autocvar_g_vehicle_racer_rocket_radius, world, 150, DEATH_WAKIROCKET, world);
remove (self);
}
bolt.think = racer_bolt_explode;
bolt.nextthink = time + 9;
bolt.bot_dodge = TRUE;
- bolt.bot_dodgerating = cvar("g_vehicle_racer_laser_damage");
+ bolt.bot_dodgerating = autocvar_g_vehicle_racer_laser_damage;
setorigin(bolt, gettaginfo(self,gettagindex(self,tagname)));
vector v;
v = normalize(self.owner.cursor_trace_endpos - bolt.origin);
v_forward_z = v_z * 0.5;
- bolt.velocity = v_forward * cvar("g_vehicle_racer_laser_speed");
+ bolt.velocity = v_forward * autocvar_g_vehicle_racer_laser_speed;
CSQCProjectile(bolt, TRUE, PROJECTILE_LASER, TRUE);
}
rocket = spawn();
setsize (rocket, '-1 -1 -1', '1 1 1');
- rocket.lip = cvar("g_vehicle_racer_rocket_accel") * sys_frametime;
- rocket.wait = cvar("g_vehicle_racer_rocket_turnrate");
+ rocket.lip = autocvar_g_vehicle_racer_rocket_accel * sys_frametime;
+ rocket.wait = autocvar_g_vehicle_racer_rocket_turnrate;
rocket.solid = SOLID_BBOX;
rocket.movetype = MOVETYPE_FLYMISSILE;
rocket.flags = FL_PROJECTILE;
rocket.realowner = self.owner;
rocket.touch = racer_rocket_touch;
rocket.bot_dodge = TRUE;
- rocket.bot_dodgerating = cvar("g_vehicle_racer_rocket_damage");
+ rocket.bot_dodgerating = autocvar_g_vehicle_racer_rocket_damage;
setorigin(rocket, gettaginfo(self,gettagindex(self,tagname)));
/*
{
rocket.delay = vlen(rocket.enemy.origin - rocket.origin);
rocket.cnt = time + 9;
- rocket.velocity = v_forward * cvar("g_vehicle_racer_rocket_speed");
+ rocket.velocity = v_forward * autocvar_g_vehicle_racer_rocket_speed;
rocket.think = racer_rocket_think;
rocket.nextthink = time;
CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
{
*/
rocket.cnt = time + 9;
- rocket.velocity = v_forward * cvar("g_vehicle_racer_rocket_speed");
+ rocket.velocity = v_forward * autocvar_g_vehicle_racer_rocket_speed;
rocket.think = racer_rocket_groundhugger;
rocket.nextthink = time;
CSQCProjectile(rocket, TRUE, PROJECTILE_ROCKET, TRUE);
float ftmp, ftmp2;
vector df;
- if(cvar("g_vehicle_racer_reload"))
+ if(autocvar_g_vehicle_racer_reload)
{
racer_loadsettings();
cvar_set("g_vehicle_racer_reload","0");
if (player.BUTTON_JUMP)
if(racer.vehicle_energy >= (racer_afterburn_cost * frametime))
{
- racer.wait = time + cvar("g_vehicle_racer_energy_usepause");
+ racer.wait = time + autocvar_g_vehicle_racer_energy_usepause;
racer.vehicle_energy -= racer_afterburn_cost * frametime;
- df += (v_forward * cvar("g_vehicle_racer_speed_afterburn"));
+ df += (v_forward * autocvar_g_vehicle_racer_speed_afterburn);
}
racer.velocity += df * frametime;
- df = (vlen(racer.velocity) * cvar("g_vehicle_racer_downforce") * v_up) * frametime;
+ df = (vlen(racer.velocity) * autocvar_g_vehicle_racer_downforce * v_up) * frametime;
racer.velocity = racer.velocity - df;
player.movement = racer.velocity;
if(player.BUTTON_ATCK)
if(time > racer.attack_finished_single)
- if(racer.vehicle_energy >= cvar("g_vehicle_racer_laser_cost"))
+ if(racer.vehicle_energy >= autocvar_g_vehicle_racer_laser_cost)
{
- racer.vehicle_energy -= cvar("g_vehicle_racer_laser_cost");
- racer.wait = time + cvar("g_vehicle_racer_energy_usepause");
+ racer.vehicle_energy -= autocvar_g_vehicle_racer_laser_cost;
+ racer.wait = time + autocvar_g_vehicle_racer_energy_usepause;
if(racer.cnt)
{
racer_fire_cannon("tag_fire2");
racer.cnt = 1;
}
- racer.attack_finished_single = time + cvar("g_vehicle_racer_laser_refire");
+ racer.attack_finished_single = time + autocvar_g_vehicle_racer_laser_refire;
}
if(player.BUTTON_ATCK2)
{
racer_fire_rocket("tag_rocket_r");
racer_fire_rocket("tag_rocket_l");
- racer.delay = time + cvar("g_vehicle_racer_rocket_refire");
+ racer.delay = time + autocvar_g_vehicle_racer_rocket_refire;
racer.lip = time;
}
self.owner.effects |= EF_NODRAW;
self.owner.view_ofs = '0 0 0';
- self.owner.vehicle_health = (self.vehicle_health / cvar("g_vehicle_racer_health"));
- self.owner.vehicle_shield = (self.vehicle_shield / cvar("g_vehicle_racer_shield"));
+ self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_racer_health);
+ self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_racer_shield);
setorigin(other,self.origin + '0 0 32');
other.velocity = self.velocity;
ret = spawn();
ret.enemy = self;
ret.think = racer_return;
- ret.nextthink = time + cvar("g_vehicle_racer_respawntime");
+ ret.nextthink = time + autocvar_g_vehicle_racer_respawntime;
}
}
RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_WAKIBLOWUP, world);
self.alpha = -1;
- self.nextthink = time + cvar("g_vehicle_racer_respawntime");
+ self.nextthink = time + autocvar_g_vehicle_racer_respawntime;
self.think = racer_spawn;
self.movetype = MOVETYPE_NONE;
self.effects = EF_NODRAW;
if (clienttype(other) != CLIENTTYPE_REAL)
return;
- if(teamplay)
+ if(teams_matter)
if(self.team)
if(self.team != other.team)
return;
ret = spawn();
ret.enemy = self;
ret.think = raptor_return;
- ret.nextthink = time + cvar("g_vehicle_racer_respawntime");
+ ret.nextthink = time + autocvar_g_vehicle_racer_respawntime;
}
}
vector df;
- if(cvar("g_vehicle_raptor_reload"))
+ if(autocvar_g_vehicle_raptor_reload)
{
raptor_loadsettings();
cvar_set("g_vehicle_raptor_reload","0");
self.owner = self.realowner;
RadiusDamage (self, self.owner,
- cvar("g_vehicle_spiderbot_rocket_damage"),
- cvar("g_vehicle_spiderbot_rocket_edgedamage"),
- cvar("g_vehicle_spiderbot_rocket_radius"), world,
- cvar("g_vehicle_spiderbot_rocket_force"), DEATH_SBROCKET, world);
+ autocvar_g_vehicle_spiderbot_rocket_damage,
+ autocvar_g_vehicle_spiderbot_rocket_edgedamage,
+ autocvar_g_vehicle_spiderbot_rocket_radius, world,
+ autocvar_g_vehicle_spiderbot_rocket_force, DEATH_SBROCKET, world);
remove (self);
}
olddir = normalize(self.velocity);
- newdir = normalize(self.pos1 - self.origin) + randomvec() * cvar("g_vehicle_spiderbot_rocket_noise");
- self.velocity = normalize(olddir + newdir * cvar("g_vehicle_spiderbot_rocket_turnrate")) * cvar("g_vehicle_spiderbot_rocket_speed");
+ newdir = normalize(self.pos1 - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
+ self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
UpdateCSQCProjectile(self);
crosshair_trace(self.owner);
olddir = normalize(self.velocity);
- newdir = normalize(trace_endpos - self.origin) + randomvec() * cvar("g_vehicle_spiderbot_rocket_noise");
- self.velocity = normalize(olddir + newdir * cvar("g_vehicle_spiderbot_rocket_turnrate")) * cvar("g_vehicle_spiderbot_rocket_speed");
+ newdir = normalize(trace_endpos - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
+ self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
UpdateCSQCProjectile(self);
rocket.classname = "spiderbot_rocket";
rocket.bot_dodge = TRUE;
- rocket.bot_dodgerating = cvar("g_vehicle_spiderbot_rocket_damage");
- rocket.cnt = time + cvar("g_vehicle_spiderbot_rocket_lifetime");
- rocket.health = cvar("g_vehicle_spiderbot_rocket_health");
+ rocket.bot_dodgerating = autocvar_g_vehicle_spiderbot_rocket_damage;
+ rocket.cnt = time + autocvar_g_vehicle_spiderbot_rocket_lifetime;
+ rocket.health = autocvar_g_vehicle_spiderbot_rocket_health;
rocket.takedamage = DAMAGE_AIM;
rocket.event_damage = spiderbot_rocket_damage;
rocket.owner = self.owner;
rocket.nextthink = time;
rocket.movetype = MOVETYPE_FLYMISSILE;
- rocket.velocity = normalize(v_forward + (v_up * 0.5) + randomvec() * 0.25) * cvar("g_vehicle_spiderbot_rocket_speed");
+ rocket.velocity = normalize(v_forward + (v_up * 0.5) + randomvec() * 0.25) * autocvar_g_vehicle_spiderbot_rocket_speed;
rocket.angles = vectoangles(rocket.velocity);
rocket.think = spiderbot_rocket_guided;
rocket.touch = spiderbot_rocket_touch;
self.tur_head.frame += 1;
if (self.tur_head.frame == 9)
- self.attack_finished_single = cvar("g_vehicle_spiderbot_rocket_reload");
+ self.attack_finished_single = autocvar_g_vehicle_spiderbot_rocket_reload;
else
- self.attack_finished_single = cvar("g_vehicle_spiderbot_rocket_refire");
+ self.attack_finished_single = autocvar_g_vehicle_spiderbot_rocket_refire;
self.gun2.cnt = time + self.attack_finished_single;
}
sound (gun, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
- fireBullet (v, v_forward, cvar("g_vehicle_spiderbot_minigun_spread"), cvar("g_vehicle_spiderbot_minigun_damage"),
- cvar("g_vehicle_spiderbot_minigun_spread"), DEATH_SBMINIGUN, 0);
+ fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
+ autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_SBMINIGUN, 0);
UziFlash();
if((self.vehicle_reload1 == 1) || (!self.owner.BUTTON_ATCK))
{
- ftmp = 1 / cvar("g_vehicle_spiderbot_minigun_cooldown") * sys_frametime;
+ ftmp = 1 / autocvar_g_vehicle_spiderbot_minigun_cooldown * sys_frametime;
self.owner.vehicle_reload1 = max(self.owner.vehicle_reload1 - ftmp, 0);
if(self.owner.vehicle_reload1 <= 0)
self.vehicle_reload1 = 0;
self = self.vehicle;
- ftmp = cvar("g_vehicle_spiderbot_minigun_refire") / cvar("g_vehicle_spiderbot_minigun_heat");
+ ftmp = autocvar_g_vehicle_spiderbot_minigun_refire / autocvar_g_vehicle_spiderbot_minigun_heat;
self.owner.vehicle_reload1 += ftmp;
if(self.owner.vehicle_reload1 >= 1)
{
self.vehicle_reload1 = 1;
self.owner.vehicle_reload1 = 1;
- self.tur_head.attack_finished_single = cvar("g_vehicle_spiderbot_minigun_cooldown") + time;
+ self.tur_head.attack_finished_single = autocvar_g_vehicle_spiderbot_minigun_cooldown + time;
}
else
- self.tur_head.attack_finished_single = cvar("g_vehicle_spiderbot_minigun_refire") + time;
+ self.tur_head.attack_finished_single = autocvar_g_vehicle_spiderbot_minigun_refire + time;
}
self = self.owner;
if(ad_y < -180) ad_y += 360;
// Rotate head
- ftmp = cvar("g_vehicle_spiderbot_head_turnspeed") * sys_frametime;
+ ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime;
ad_y = bound(-ftmp, ad_y, ftmp);
- spider.tur_head.angles_y = bound(cvar("g_vehicle_spiderbot_head_turnlimit") * -1, spider.tur_head.angles_y + ad_y, cvar("g_vehicle_spiderbot_head_turnlimit"));
+ spider.tur_head.angles_y = bound(autocvar_g_vehicle_spiderbot_head_turnlimit * -1, spider.tur_head.angles_y + ad_y, autocvar_g_vehicle_spiderbot_head_turnlimit);
// Pitch head
- ftmp = cvar("g_vehicle_spiderbot_head_pitchspeed") * sys_frametime;
+ ftmp = autocvar_g_vehicle_spiderbot_head_pitchspeed * sys_frametime;
ad_x = bound(-ftmp, ad_x, ftmp);
- spider.tur_head.angles_x = bound(cvar("g_vehicle_spiderbot_head_pitchlimit_down"), spider.tur_head.angles_x + ad_x, cvar("g_vehicle_spiderbot_head_pitchlimit_up"));
+ spider.tur_head.angles_x = bound(autocvar_g_vehicle_spiderbot_head_pitchlimit_down, spider.tur_head.angles_x + ad_x, autocvar_g_vehicle_spiderbot_head_pitchlimit_up);
// Turn Body
- ftmp = cvar("g_vehicle_spiderbot_turnspeed") * sys_frametime;
+ ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime;
ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
self = spider;
{
if(vlen(player.movement) == 0)
{
- movelib_beak_simple(cvar("g_vehicle_spiderbot_speed_stop"));
+ movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
spider.frame = 5;
}
else
spider.frame = 1;
}
player.movement_y = 0;
- movelib_move_simple(normalize(v_forward * player.movement_x),cvar("g_vehicle_spiderbot_speed_walk"),cvar("g_vehicle_spiderbot_movement_inertia"));
+ movelib_move_simple(normalize(v_forward * player.movement_x),autocvar_g_vehicle_spiderbot_speed_walk,autocvar_g_vehicle_spiderbot_movement_inertia);
}
else if(player.movement_y != 0)
{
player.movement_y = 1;
spider.frame = 3;
}
- movelib_move_simple(normalize(v_right * player.movement_y),cvar("g_vehicle_spiderbot_speed_strafe"),cvar("g_vehicle_spiderbot_movement_inertia"));
+ movelib_move_simple(normalize(v_right * player.movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia);
}
}
void spiderbot_think()
{
if(self.flags & FL_ONGROUND)
- movelib_beak_simple(cvar("g_vehicle_spiderbot_speed_stop"));
+ movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
self.nextthink = time;
}
self.colormod = self.tur_head.colormod = '0 0 0';
- if(teamplay)
+ if(teams_matter)
if(self.team)
if(self.team != other.team)
return;
self.owner.vehicle = self;
self.owner.event_damage = SUB_Null;
self.owner.hud = HUD_SPIDERBOT;
- self.owner.vehicle_health = (self.vehicle_health / cvar("g_vehicle_spiderbot_health"));
- self.owner.vehicle_shield = (self.vehicle_shield / cvar("g_vehicle_spiderbot_shield"));
+ self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_spiderbot_health);
+ self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_spiderbot_shield);
self.owner.view_ofs = '0 0 0';
self.owner.vehicle_ammo1 = self.vehicle_ammo1;
self.owner.vehicle_ammo2 = self.vehicle_ammo2;
self.colormap = 1024;
self.tur_head.colormap = 1024;
- if not (teamplay)
+ if not (teams_matter)
self.team = 0;
else
{
//todo: add check for velocity/angle here (so we dont cush players runing into us from behind)
- Damage(other,self,self.owner,cvar("g_vehicle_spiderbot_crush_dmg"),DEATH_SBCRUSH,'0 0 0', normalize(other.origin - self.origin) * cvar("g_vehicle_spiderbot_crush_force") );
+ Damage(other,self,self.owner,autocvar_g_vehicle_spiderbot_crush_dmg,DEATH_SBCRUSH,'0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicle_spiderbot_crush_force );
return;
}
RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_SBBLOWUP, world);
self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
- self.nextthink = time + cvar("g_vehicle_spiderbot_respawntime");
+ self.nextthink = time + autocvar_g_vehicle_spiderbot_respawntime;
self.think = spiderbot_spawn;
self.movetype = MOVETYPE_NONE;
tracebox(self.origin + '0 0 100', spiderbot_MIN, spiderbot_MAX, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
setorigin(self.spiderbot_spawnpnt,trace_endpos);
- if(self.team && !teamplay)
+ if(self.team && !teams_matter)
self.team = 0;
else
self.spiderbot_spawnpnt.team = self.team;
GetKickVoteVictim_newcommand = strcat(argv(0), " # ", ftos(num_for_edict(e)));
if(argv(0) == "kickban")
{
- GetKickVoteVictim_newcommand = strcat(GetKickVoteVictim_newcommand, " ", cvar_string("g_ban_default_bantime"), " ", cvar_string("g_ban_default_masksize"), " ", reason);
+ GetKickVoteVictim_newcommand = strcat(GetKickVoteVictim_newcommand, " ", ftos(autocvar_g_ban_default_bantime), " ", ftos(autocvar_g_ban_default_masksize), " ", reason);
}
else if(argv(0) == "kick")
{
print_to(e, "^1No vote called.");
}
} else if(argv(1) == "call") {
- if(!e || cvar("sv_vote_call")) {
- if(cvar("sv_vote_nospectators") && e && e.classname != "player") {
+ if(!e || autocvar_sv_vote_call) {
+ if(autocvar_sv_vote_nospectators && e && e.classname != "player") {
print_to(e, "^1Error: Only players can call a vote."); // TODO invent a cvar name for allowing votes by spectators during warmup anyway
}
else if(timeoutStatus) { //don't allow a vote call during a timeout
votecalledvote_display = strzone(RemapVote_display);
votecalled = TRUE;
votecalledmaster = FALSE;
- votefinished = time + cvar("sv_vote_timeout");
+ votefinished = time + autocvar_sv_vote_timeout;
votecaller = e; // remember who called the vote
if(e) {
e.vote_vote = 1; // of course you vote yes
- e.vote_next = time + cvar("sv_vote_wait");
+ e.vote_next = time + autocvar_sv_vote_wait;
}
bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2 calls a vote for ", votecalledvote_display, "\n");
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(strcat(":vote:vcall:", ftos(votecaller.playerid), ":", votecalledvote_display));
VoteCount(); // needed if you are the only one
Nagger_VoteChanged();
print_to(e, "^1You are not allowed to stop that Vote.");
}
} else if(argv(1) == "master") {
- if(cvar("sv_vote_master")) {
+ if(autocvar_sv_vote_master) {
if(votecalled) {
print_to(e, "^1There is already a vote called.");
} else {
votecalledmaster = TRUE;
votecalledvote = strzone("XXX");
votecalledvote_display = strzone("^3master");
- votefinished = time + cvar("sv_vote_timeout");
+ votefinished = time + autocvar_sv_vote_timeout;
votecaller = e; // remember who called the vote
if(e) {
e.vote_vote = 1; // of course you vote yes
- e.vote_next = time + cvar("sv_vote_wait");
+ e.vote_next = time + autocvar_sv_vote_wait;
}
bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2 calls a vote to become ^3master^2.\n");
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(strcat(":vote:vcall:", ftos(votecaller.playerid), ":", votecalledvote_display));
VoteCount(); // needed if you are the only one
Nagger_VoteChanged();
print_to(e, "Syntax error in command. See 'vhelp' for more info.");
} else if(RemapVote(dovote, "vdo", e)) { // strcat seems to be necessary
bprint("\{1}^2* ^3", VoteNetname(e), "^2 used their ^3master^2 status to do \"^2", RemapVote_display, "^2\".\n");
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(strcat(":vote:vdo:", ftos(e.playerid), ":", RemapVote_display));
localcmd(strcat(RemapVote_vote, "\n"));
} else {
}
} else if(argv(1) == "login") {
local string masterpwd;
- masterpwd = cvar_string("sv_vote_master_password");
+ masterpwd = autocvar_sv_vote_master_password;
if(masterpwd != "") {
local float granted;
granted = (masterpwd == argv(2));
if(granted) {
print("Accepted master login from ", VoteNetname(e), "\n");
bprint("\{1}^2* ^3", VoteNetname(e), "^2 logged in as ^3master^2\n");
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(strcat(":vote:vlogin:", ftos(e.playerid)));
}
else
} else if (!e) {
print_to(e, "^1You can't vote from the server console.");
} else if(e.vote_vote == 0
- || cvar("sv_vote_change")) {
+ || autocvar_sv_vote_change) {
msg_entity = e;
VoteDialog_UpdateHighlight(1);
print_to(e, "^1You accepted the vote.");
e.vote_vote = 1;
centerprint_expire(e, CENTERPRIO_VOTE);
- if(!cvar("sv_vote_singlecount")) {
+ if(!autocvar_sv_vote_singlecount) {
VoteCount();
}
} else {
} else if (!e) {
print_to(e, "^1You can't vote from the server console.");
} else if(e.vote_vote == 0
- || cvar("sv_vote_change")) {
+ || autocvar_sv_vote_change) {
msg_entity = e;
VoteDialog_UpdateHighlight(2);
print_to(e, "^1You rejected the vote.");
e.vote_vote = -1;
centerprint_expire(e, CENTERPRIO_VOTE);
- if(!cvar("sv_vote_singlecount")) {
+ if(!autocvar_sv_vote_singlecount) {
VoteCount();
}
} else {
} else if (!e) {
print_to(e, "^1You can't vote from the server console.");
} else if(e.vote_vote == 0
- || cvar("sv_vote_change")) {
+ || autocvar_sv_vote_change) {
msg_entity = e;
VoteDialog_UpdateHighlight(3);
print_to(e, "^1You abstained from your vote.");
e.vote_vote = -2;
centerprint_expire(e, CENTERPRIO_VOTE);
- if(!cvar("sv_vote_singlecount")) {
+ if(!autocvar_sv_vote_singlecount) {
VoteCount();
}
} else {
void VoteHelp(entity e) {
local string vmasterdis;
- if(!cvar("sv_vote_master")) {
+ if(!autocvar_sv_vote_master) {
vmasterdis = " ^1(disabled)";
}
local string vlogindis;
- if("" == cvar_string("sv_vote_master_password")) {
+ if("" == autocvar_sv_vote_master_password) {
vlogindis = " ^1(disabled)";
}
local string vcalldis;
- if(!cvar("sv_vote_call")) {
+ if(!autocvar_sv_vote_call) {
vcalldis = " ^1(disabled)";
}
print_to(e, "^7\"^2yes^7\", \"^2no^7\", \"^2abstain^7\" and \"^2dontcare^7\" to make your vote.");
print_to(e, "^7If enough of the players vote yes the vote is accepted.");
print_to(e, "^7If enough of the players vote no the vote is rejected.");
- print_to(e, strcat("^7If neither the vote will timeout after ", cvar_string("sv_vote_timeout"), "^7 seconds."));
+ print_to(e, strcat("^7If neither the vote will timeout after ", ftos(autocvar_sv_vote_timeout), "^7 seconds."));
print_to(e, "^7You can call a vote for or execute these commands:");
- print_to(e, strcat("^3", cvar_string("sv_vote_commands"), "^7 and maybe further ^3arguments^7"));
+ print_to(e, strcat("^3", autocvar_sv_vote_commands, "^7 and maybe further ^3arguments^7"));
}
string VoteNetname(entity e)
if(e) {
return e.netname;
} else {
- if(cvar_string("sv_adminnick") != "") {
- return cvar_string("sv_adminnick");
+ if(autocvar_sv_adminnick != "") {
+ return autocvar_sv_adminnick;
} else {
- return cvar_string("hostname");
+ return autocvar_hostname;
}
}
}
print_to(e, "This map is not available on this server.");
return string_null;
}
- if(!cvar("sv_vote_override_mostrecent"))
+ if(!autocvar_sv_vote_override_mostrecent)
if(Map_IsRecent(m))
{
print_to(e, "This server does not allow for recent maps to be played again. Please be patient for some rounds.");
}
float VoteAllowed(string votecommand, string cmd) {
- if(VoteCommandInList(votecommand, cvar_string("sv_vote_commands")))
+ if(VoteCommandInList(votecommand, autocvar_sv_vote_commands))
return TRUE;
if(cmd == "vdo")
{
- if(VoteCommandInList(votecommand, cvar_string("sv_vote_master_commands")))
+ if(VoteCommandInList(votecommand, autocvar_sv_vote_master_commands))
return TRUE;
}
else
{
- if(VoteCommandInList(votecommand, cvar_string("sv_vote_only_commands")))
+ if(VoteCommandInList(votecommand, autocvar_sv_vote_only_commands))
return TRUE;
}
void VoteStop(entity stopper) {
bprint("\{1}^2* ^3", VoteNetname(stopper), "^2 stopped ^3", VoteNetname(votecaller), "^2's vote\n");
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
GameLogEcho(strcat(":vote:vstop:", ftos(stopper.playerid)));
if(stopper == votecaller) {
// no wait for next vote so you can correct your vote
if(votecaller) {
- votecaller.vote_next = time + cvar("sv_vote_stop");
+ votecaller.vote_next = time + autocvar_sv_vote_stop;
}
}
VoteReset();
s = strcat(s, ftos(notvoters), "^2 didn't have to vote\n");
}
bprint(s);
- if(cvar("sv_eventlog"))
+ if(autocvar_sv_eventlog)
{
s = strcat(":vote:v", result, ":", ftos(yescount));
s = strcat(s, ":", ftos(nocount));
}
//in tournament mode, if we have at least one player then don't make the vote dependent on spectators (so specs don't have to press F1)
- if(cvar("sv_vote_nospectators"))
+ if(autocvar_sv_vote_nospectators)
if(realplayercount > 0) {
yescount = realplayeryescount;
nocount = realplayernocount;
}
float votefactor, simplevotefactor;
- votefactor = bound(0.5, cvar("sv_vote_majority_factor"), 0.999);
- simplevotefactor = cvar("sv_vote_simple_majority_factor");
+ votefactor = bound(0.5, autocvar_sv_vote_majority_factor, 0.999);
+ simplevotefactor = autocvar_sv_vote_simple_majority_factor;
float needed;
needed = floor((playercount - abstaincount) * max(votefactor, simplevotefactor)) + 1;
VoteDialog_Update(MSG_ALL, yescount, nocount, needed);
float W_CampingRifle_CheckMaxBullets(float checkammo)
{
float maxbulls;
- maxbulls = cvar("g_balance_campingrifle_magazinecapacity");
+ maxbulls = autocvar_g_balance_campingrifle_magazinecapacity;
if(!maxbulls)
maxbulls = 8; // match HUD
if(checkammo)
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- maxbulls = min(maxbulls, floor(self.ammo_nails / min(cvar("g_balance_campingrifle_primary_ammo"), cvar("g_balance_campingrifle_secondary_ammo"))));
- if(self.campingrifle_bulletcounter > maxbulls || !cvar("g_balance_campingrifle_magazinecapacity"))
+ maxbulls = min(maxbulls, floor(self.ammo_nails / min(autocvar_g_balance_campingrifle_primary_ammo, autocvar_g_balance_campingrifle_secondary_ammo)));
+ if(self.campingrifle_bulletcounter > maxbulls || !autocvar_g_balance_campingrifle_magazinecapacity)
self.campingrifle_bulletcounter = maxbulls;
return (self.campingrifle_bulletcounter == maxbulls);
}
void W_CampingRifle_ReloadedAndReady()
{
float t;
- self.campingrifle_bulletcounter = cvar("g_balance_campingrifle_magazinecapacity");
+ self.campingrifle_bulletcounter = autocvar_g_balance_campingrifle_magazinecapacity;
W_CampingRifle_CheckMaxBullets(TRUE);
- t = ATTACK_FINISHED(self) - cvar("g_balance_campingrifle_reloadtime") - 1;
+ t = ATTACK_FINISHED(self) - autocvar_g_balance_campingrifle_reloadtime - 1;
ATTACK_FINISHED(self) = t;
w_ready();
}
W_CampingRifle_CheckMaxBullets(TRUE);
- if(self.ammo_nails < min(cvar("g_balance_campingrifle_primary_ammo"), cvar("g_balance_campingrifle_secondary_ammo"))) // when we get here, bulletcounter must be 0 or -1
+ if(self.ammo_nails < min(autocvar_g_balance_campingrifle_primary_ammo, autocvar_g_balance_campingrifle_secondary_ammo)) // when we get here, bulletcounter must be 0 or -1
{
print("cannot reload... not enough bullets\n");
self.campingrifle_bulletcounter = -1; // reload later
return 0;
}
- if (self.campingrifle_bulletcounter >= cvar("g_balance_campingrifle_magazinecapacity"))
+ if (self.campingrifle_bulletcounter >= autocvar_g_balance_campingrifle_magazinecapacity)
return 0;
if (self.weaponentity)
sound (self, CHAN_WEAPON2, "weapons/campingrifle_reload.wav", VOL_BASE, ATTN_NORM);
- t = max(time, ATTACK_FINISHED(self)) + cvar("g_balance_campingrifle_reloadtime") + 1;
+ t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_campingrifle_reloadtime + 1;
ATTACK_FINISHED(self) = t;
- weapon_thinkf(WFRAME_RELOAD, cvar("g_balance_campingrifle_reloadtime"), W_CampingRifle_ReloadedAndReady);
+ weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_campingrifle_reloadtime, W_CampingRifle_ReloadedAndReady);
self.campingrifle_bulletcounter = -1;
self.ammo_nails -= pAmmo;
if(deathtype & HITTYPE_SECONDARY)
- W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, cvar("g_balance_campingrifle_secondary_damage") + cvar("g_balance_campingrifle_secondary_headshotaddeddamage"));
+ W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, autocvar_g_balance_campingrifle_secondary_damage + autocvar_g_balance_campingrifle_secondary_headshotaddeddamage);
else
- W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire.wav", CHAN_WEAPON, cvar("g_balance_campingrifle_primary_damage") + cvar("g_balance_campingrifle_primary_headshotaddeddamage"));
+ W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire.wav", CHAN_WEAPON, autocvar_g_balance_campingrifle_primary_damage + autocvar_g_balance_campingrifle_primary_headshotaddeddamage);
pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
}
if(deathtype & HITTYPE_SECONDARY)
- fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (cvar("g_balance_campingrifle_secondary_tracer") ? EF_RED : EF_BLUE), 1, pBulletConstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_campingrifle_secondary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
else
- fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (cvar("g_balance_campingrifle_primary_tracer") ? EF_RED : EF_BLUE), 1, pBulletConstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_campingrifle_primary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
endFireBallisticBullet();
- if (cvar("g_casings") >= 2)
+ if (autocvar_g_casings >= 2)
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
self.campingrifle_bulletcounter = self.campingrifle_bulletcounter - 1;
void W_CampingRifle_Attack()
{
- W_CampingRifle_FireBullet(cvar("g_balance_campingrifle_primary_spread"), cvar("g_balance_campingrifle_primary_damage"), cvar("g_balance_campingrifle_primary_headshotaddeddamage"), cvar("g_balance_campingrifle_primary_force"), cvar("g_balance_campingrifle_primary_speed"), cvar("g_balance_campingrifle_primary_lifetime"), cvar("g_balance_campingrifle_primary_ammo"), WEP_CAMPINGRIFLE, cvar("g_balance_campingrifle_primary_bulletconstant"));
+ W_CampingRifle_FireBullet(autocvar_g_balance_campingrifle_primary_spread, autocvar_g_balance_campingrifle_primary_damage, autocvar_g_balance_campingrifle_primary_headshotaddeddamage, autocvar_g_balance_campingrifle_primary_force, autocvar_g_balance_campingrifle_primary_speed, autocvar_g_balance_campingrifle_primary_lifetime, autocvar_g_balance_campingrifle_primary_ammo, WEP_CAMPINGRIFLE, autocvar_g_balance_campingrifle_primary_bulletconstant);
}
void W_CampingRifle_Attack2()
{
- W_CampingRifle_FireBullet(cvar("g_balance_campingrifle_secondary_spread"), cvar("g_balance_campingrifle_secondary_damage"), cvar("g_balance_campingrifle_secondary_headshotaddeddamage"), cvar("g_balance_campingrifle_secondary_force"), cvar("g_balance_campingrifle_secondary_speed"), cvar("g_balance_campingrifle_secondary_lifetime"), cvar("g_balance_campingrifle_secondary_ammo"), WEP_CAMPINGRIFLE | HITTYPE_SECONDARY, cvar("g_balance_campingrifle_secondary_bulletconstant"));
+ W_CampingRifle_FireBullet(autocvar_g_balance_campingrifle_secondary_spread, autocvar_g_balance_campingrifle_secondary_damage, autocvar_g_balance_campingrifle_secondary_headshotaddeddamage, autocvar_g_balance_campingrifle_secondary_force, autocvar_g_balance_campingrifle_secondary_speed, autocvar_g_balance_campingrifle_secondary_lifetime, autocvar_g_balance_campingrifle_secondary_ammo, WEP_CAMPINGRIFLE | HITTYPE_SECONDARY, autocvar_g_balance_campingrifle_secondary_bulletconstant);
}
void spawnfunc_weapon_campingrifle (void)
self.bot_secondary_campingriflemooth = 0;
if(self.bot_secondary_campingriflemooth == 0)
{
- if(bot_aim(cvar("g_balance_campingrifle_primary_speed"), 0, cvar("g_balance_campingrifle_primary_lifetime"), TRUE))
+ if(bot_aim(autocvar_g_balance_campingrifle_primary_speed, 0, autocvar_g_balance_campingrifle_primary_lifetime, TRUE))
{
self.BUTTON_ATCK = TRUE;
if(random() < 0.01) self.bot_secondary_campingriflemooth = 1;
}
else
{
- if(bot_aim(cvar("g_balance_campingrifle_secondary_speed"), 0, cvar("g_balance_campingrifle_secondary_lifetime"), TRUE))
+ if(bot_aim(autocvar_g_balance_campingrifle_secondary_speed, 0, autocvar_g_balance_campingrifle_secondary_lifetime, TRUE))
{
self.BUTTON_ATCK2 = TRUE;
if(random() < 0.03) self.bot_secondary_campingriflemooth = 0;
}
else
{
- self.campingrifle_accumulator = bound(time - cvar("g_balance_campingrifle_bursttime"), self.campingrifle_accumulator, time);
+ self.campingrifle_accumulator = bound(time - autocvar_g_balance_campingrifle_bursttime, self.campingrifle_accumulator, time);
if (self.BUTTON_ATCK)
- if (weapon_prepareattack_check(0, cvar("g_balance_campingrifle_primary_refire")))
- if (time >= self.campingrifle_accumulator + cvar("g_balance_campingrifle_primary_burstcost"))
+ if (weapon_prepareattack_check(0, autocvar_g_balance_campingrifle_primary_refire))
+ if (time >= self.campingrifle_accumulator + autocvar_g_balance_campingrifle_primary_burstcost)
{
- weapon_prepareattack_do(0, cvar("g_balance_campingrifle_primary_refire"));
- W_CampingRifle_BulletHail(cvar("g_balance_campingrifle_primary_bullethail"), W_CampingRifle_Attack, WFRAME_FIRE1, cvar("g_balance_campingrifle_primary_animtime"), cvar("g_balance_campingrifle_primary_refire"));
- self.campingrifle_accumulator += cvar("g_balance_campingrifle_primary_burstcost");
+ weapon_prepareattack_do(0, autocvar_g_balance_campingrifle_primary_refire);
+ W_CampingRifle_BulletHail(autocvar_g_balance_campingrifle_primary_bullethail, W_CampingRifle_Attack, WFRAME_FIRE1, autocvar_g_balance_campingrifle_primary_animtime, autocvar_g_balance_campingrifle_primary_refire);
+ self.campingrifle_accumulator += autocvar_g_balance_campingrifle_primary_burstcost;
}
if (self.BUTTON_ATCK2)
{
- if (cvar("g_balance_campingrifle_secondary"))
+ if (autocvar_g_balance_campingrifle_secondary)
{
- if (weapon_prepareattack_check(1, cvar("g_balance_campingrifle_secondary_refire")))
- if (time >= self.campingrifle_accumulator + cvar("g_balance_campingrifle_secondary_burstcost"))
+ if (weapon_prepareattack_check(1, autocvar_g_balance_campingrifle_secondary_refire))
+ if (time >= self.campingrifle_accumulator + autocvar_g_balance_campingrifle_secondary_burstcost)
{
- weapon_prepareattack_do(1, cvar("g_balance_campingrifle_secondary_refire"));
- W_CampingRifle_BulletHail(cvar("g_balance_campingrifle_secondary_bullethail"), W_CampingRifle_Attack2, WFRAME_FIRE2, cvar("g_balance_campingrifle_secondary_animtime"), cvar("g_balance_campingrifle_primary_refire"));
- self.campingrifle_accumulator += cvar("g_balance_campingrifle_secondary_burstcost");
+ weapon_prepareattack_do(1, autocvar_g_balance_campingrifle_secondary_refire);
+ W_CampingRifle_BulletHail(autocvar_g_balance_campingrifle_secondary_bullethail, W_CampingRifle_Attack2, WFRAME_FIRE2, autocvar_g_balance_campingrifle_secondary_animtime, autocvar_g_balance_campingrifle_primary_refire);
+ self.campingrifle_accumulator += autocvar_g_balance_campingrifle_secondary_burstcost;
}
}
}
weapon_setup(WEP_CAMPINGRIFLE);
full = W_CampingRifle_CheckMaxBullets(TRUE);
- if(cvar("g_balance_campingrifle_auto_reload_after_changing_weapons"))
+ if(autocvar_g_balance_campingrifle_auto_reload_on_switch)
if(!full)
self.campingrifle_bulletcounter = -1;
}
else if (req == WR_CHECKAMMO1)
- return self.ammo_nails >= cvar("g_balance_campingrifle_primary_ammo");
+ return self.ammo_nails >= autocvar_g_balance_campingrifle_primary_ammo;
else if (req == WR_CHECKAMMO2)
- return self.ammo_nails >= cvar("g_balance_campingrifle_secondary_ammo");
+ return self.ammo_nails >= autocvar_g_balance_campingrifle_secondary_ammo;
else if (req == WR_RELOAD)
{
W_CampingRifle_Reload();
}
else if (req == WR_RESETPLAYER)
{
- self.campingrifle_accumulator = time - cvar("g_balance_campingrifle_bursttime");
- self.campingrifle_bulletcounter = cvar("g_balance_campingrifle_magazinecapacity");
+ self.campingrifle_accumulator = time - autocvar_g_balance_campingrifle_bursttime;
+ self.campingrifle_bulletcounter = autocvar_g_balance_campingrifle_magazinecapacity;
W_CampingRifle_CheckMaxBullets(FALSE);
}
return TRUE;
// maxdist = 0.5 * v0 * v0 / constant
// dprint("max dist = ", ftos(maxdist), "\n");
- if(maxdist <= cvar("g_ballistics_mindistance"))
+ if(maxdist <= autocvar_g_ballistics_mindistance)
return 0;
traceline_inverted (self.origin, self.origin + normalize(vel) * maxdist, MOVE_NORMAL, self);
self.W_BallisticBullet_LeaveSolid_origin = trace_endpos;
- dst = max(cvar("g_ballistics_mindistance"), vlen(trace_endpos - self.origin));
+ dst = max(autocvar_g_ballistics_mindistance, vlen(trace_endpos - self.origin));
// E(s) = E0 - constant * s, constant = area of bullet circle * material constant / mass
Es_m = E0_m - constant * dst;
if(Es_m <= 0)
entity pl, oldself;
float antilagging;
- antilagging = (cvar("g_antilag_bullets") && (pSpeed >= cvar("g_antilag_bullets")));
+ antilagging = (autocvar_g_antilag_bullets && (pSpeed >= autocvar_g_antilag_bullets));
entity proj;
proj = spawn();
proj.nextthink = time + lifetime; // min(pLifetime, vlen(world.maxs - world.mins) / pSpeed);
W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, antilagging);
proj.angles = vectoangles(proj.velocity);
- proj.dmg_radius = cvar("g_ballistics_materialconstant") / bulletconstant;
+ proj.dmg_radius = autocvar_g_ballistics_materialconstant / bulletconstant;
// so: bulletconstant = bullet mass / area of bullet circle
setorigin(proj, start);
proj.flags = FL_PROJECTILE;
lag = 0;
if(clienttype(self) != CLIENTTYPE_REAL)
lag = 0;
- if(cvar("g_antilag") == 0 || self.cvar_cl_noantilag)
+ if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
lag = 0; // only do hitscan, but no antilag
if(lag)
W_BallisticBullet_Hit();
}
+ // if we hit "weapclip", bail out
+ //
+ // rationale of this check:
+ //
+ // any shader that is solid, nodraw AND trans is meant to clip weapon
+ // shots and players, but has no other effect!
+ //
+ // if it is not trans, it is caulk and should not have this side effect
+ //
+ // matching shaders:
+ // common/weapclip (intended)
+ // common/noimpact (is supposed to eat projectiles, but is erased farther above)
+ if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
+ if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)
+ if not(trace_dphitcontents & DPCONTENTS_OPAQUE)
+ break;
+
density = other.ballistics_density;
if(density == 0)
density = 1;
if(e == e.realowner.crylink_lastgroup)
e.realowner.crylink_lastgroup = world;
- RadiusDamage (e, e.realowner, cvar("g_balance_crylink_primary_damage") * a, cvar("g_balance_crylink_primary_edgedamage") * a, cvar("g_balance_crylink_primary_radius"), world, cvar("g_balance_crylink_primary_force") * a, e.projectiledeathtype, other);
+ RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_damage * a, autocvar_g_balance_crylink_primary_edgedamage * a, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * a, e.projectiledeathtype, other);
if(e.queuenext != e2)
W_Crylink_LinkExplode(e.queuenext, e2);
{
if(e.projectiledeathtype & HITTYPE_SECONDARY)
{
- if(cvar("g_balance_crylink_secondary_joinexplode"))
+ if(autocvar_g_balance_crylink_secondary_joinexplode)
{
- n = n / cvar("g_balance_crylink_secondary_shots");
- RadiusDamage (e, e.realowner, cvar("g_balance_crylink_secondary_joinexplode_damage") * n,
- cvar("g_balance_crylink_secondary_joinexplode_edgedamage") * n,
- cvar("g_balance_crylink_secondary_joinexplode_radius") * n, e.realowner,
- cvar("g_balance_crylink_secondary_joinexplode_force") * n, e.projectiledeathtype, other);
+ n = n / autocvar_g_balance_crylink_secondary_shots;
+ RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_joinexplode_damage * n,
+ autocvar_g_balance_crylink_secondary_joinexplode_edgedamage * n,
+ autocvar_g_balance_crylink_secondary_joinexplode_radius * n, e.realowner,
+ autocvar_g_balance_crylink_secondary_joinexplode_force * n, e.projectiledeathtype, other);
pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
- }
+ }
}
else
{
- if(cvar("g_balance_crylink_primary_joinexplode"))
+ if(autocvar_g_balance_crylink_primary_joinexplode)
{
- n = n / cvar("g_balance_crylink_primary_shots");
- RadiusDamage (e, e.realowner, cvar("g_balance_crylink_primary_joinexplode_damage") * n,
- cvar("g_balance_crylink_primary_joinexplode_edgedamage") * n,
- cvar("g_balance_crylink_primary_joinexplode_radius") * n, e.realowner,
- cvar("g_balance_crylink_primary_joinexplode_force") * n, e.projectiledeathtype, other);
+ n = n / autocvar_g_balance_crylink_primary_shots;
+ RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_joinexplode_damage * n,
+ autocvar_g_balance_crylink_primary_joinexplode_edgedamage * n,
+ autocvar_g_balance_crylink_primary_joinexplode_radius * n, e.realowner,
+ autocvar_g_balance_crylink_primary_joinexplode_force * n, e.projectiledeathtype, other);
pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
- }
- }
+ }
+ }
}
}
remove(self);
if(finalhit)
f = 1;
else
- f = cvar("g_balance_crylink_primary_bouncedamagefactor");
+ f = autocvar_g_balance_crylink_primary_bouncedamagefactor;
if(a)
f *= a;
- if (RadiusDamage (self, self.realowner, cvar("g_balance_crylink_primary_damage") * f, cvar("g_balance_crylink_primary_edgedamage") * f, cvar("g_balance_crylink_primary_radius"), world, cvar("g_balance_crylink_primary_force") * f, self.projectiledeathtype, other) && cvar("g_balance_crylink_primary_linkexplode"))
+ if (RadiusDamage (self, self.realowner, autocvar_g_balance_crylink_primary_damage * f, autocvar_g_balance_crylink_primary_edgedamage * f, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * f, self.projectiledeathtype, other) && autocvar_g_balance_crylink_primary_linkexplode)
{
if(self == self.realowner.crylink_lastgroup)
self.realowner.crylink_lastgroup = world;
if(finalhit)
f = 1;
else
- f = cvar("g_balance_crylink_secondary_bouncedamagefactor");
+ f = autocvar_g_balance_crylink_secondary_bouncedamagefactor;
if(a)
f *= a;
- if (RadiusDamage (self, self.realowner, cvar("g_balance_crylink_secondary_damage") * f, cvar("g_balance_crylink_secondary_edgedamage") * f, cvar("g_balance_crylink_secondary_radius"), world, cvar("g_balance_crylink_secondary_force") * f, self.projectiledeathtype, other) && cvar("g_balance_crylink_secondary_linkexplode"))
+ if (RadiusDamage (self, self.realowner, autocvar_g_balance_crylink_secondary_damage * f, autocvar_g_balance_crylink_secondary_edgedamage * f, autocvar_g_balance_crylink_secondary_radius, world, autocvar_g_balance_crylink_secondary_force * f, self.projectiledeathtype, other) && autocvar_g_balance_crylink_secondary_linkexplode)
{
if(self == self.realowner.crylink_lastgroup)
self.realowner.crylink_lastgroup = world;
float maxdmg;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo");
+ self.ammo_cells = self.ammo_cells - autocvar_g_balance_crylink_primary_ammo;
- maxdmg = cvar("g_balance_crylink_primary_damage")*cvar("g_balance_crylink_primary_shots");
- maxdmg *= 1 + cvar("g_balance_crylink_primary_bouncedamagefactor") * cvar("g_balance_crylink_primary_bounces");
- if(cvar("g_balance_crylink_primary_joinexplode"))
- maxdmg += cvar("g_balance_crylink_primary_joinexplode_damage");
+ maxdmg = autocvar_g_balance_crylink_primary_damage*autocvar_g_balance_crylink_primary_shots;
+ maxdmg *= 1 + autocvar_g_balance_crylink_primary_bouncedamagefactor * autocvar_g_balance_crylink_primary_bounces;
+ if(autocvar_g_balance_crylink_primary_joinexplode)
+ maxdmg += autocvar_g_balance_crylink_primary_joinexplode_damage;
W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav", CHAN_WEAPON, maxdmg);
forward = v_forward;
right = v_right;
up = v_up;
- shots = cvar("g_balance_crylink_primary_shots");
+ shots = autocvar_g_balance_crylink_primary_shots;
pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
proj = world;
while (counter < shots)
proj.realowner = proj.owner = self;
proj.classname = "spike";
proj.bot_dodge = TRUE;
- proj.bot_dodgerating = cvar("g_balance_crylink_primary_damage");
+ proj.bot_dodgerating = autocvar_g_balance_crylink_primary_damage;
if(shots == 1) {
proj.queuenext = proj;
proj.queueprev = proj;
s_y = v_forward_x;
s_z = v_forward_y;
}
- s = s * cvar("g_balance_crylink_primary_spread") * g_weaponspreadfactor;
- W_SetupProjectileVelocityEx(proj, w_shotdir + right * s_y + up * s_z, v_up, cvar("g_balance_crylink_primary_speed"), 0, 0, 0, FALSE);
+ s = s * autocvar_g_balance_crylink_primary_spread * g_weaponspreadfactor;
+ W_SetupProjectileVelocityEx(proj, w_shotdir + right * s_y + up * s_z, v_up, autocvar_g_balance_crylink_primary_speed, 0, 0, 0, FALSE);
proj.touch = W_Crylink_Touch;
proj.think = W_Crylink_Fadethink;
if(counter == 0)
{
- proj.fade_time = time + cvar("g_balance_crylink_primary_middle_lifetime");
- proj.fade_rate = 1 / cvar("g_balance_crylink_primary_middle_fadetime");
- proj.nextthink = time + cvar("g_balance_crylink_primary_middle_lifetime") + cvar("g_balance_crylink_primary_middle_fadetime");
+ proj.fade_time = time + autocvar_g_balance_crylink_primary_middle_lifetime;
+ proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_middle_fadetime;
+ proj.nextthink = time + autocvar_g_balance_crylink_primary_middle_lifetime + autocvar_g_balance_crylink_primary_middle_fadetime;
}
else
{
- proj.fade_time = time + cvar("g_balance_crylink_primary_other_lifetime");
- proj.fade_rate = 1 / cvar("g_balance_crylink_primary_other_fadetime");
- proj.nextthink = time + cvar("g_balance_crylink_primary_other_lifetime") + cvar("g_balance_crylink_primary_other_fadetime");
+ proj.fade_time = time + autocvar_g_balance_crylink_primary_other_lifetime;
+ proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_other_fadetime;
+ proj.nextthink = time + autocvar_g_balance_crylink_primary_other_lifetime + autocvar_g_balance_crylink_primary_other_fadetime;
}
- proj.cnt = cvar("g_balance_crylink_primary_bounces");
+ proj.cnt = autocvar_g_balance_crylink_primary_bounces;
//proj.scale = 1 + 1 * proj.cnt;
proj.angles = vectoangles (proj.velocity);
float maxdmg;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_secondary_ammo");
+ self.ammo_cells = self.ammo_cells - autocvar_g_balance_crylink_secondary_ammo;
- maxdmg = cvar("g_balance_crylink_secondary_damage")*cvar("g_balance_crylink_secondary_shots");
- maxdmg *= 1 + cvar("g_balance_crylink_secondary_bouncedamagefactor") * cvar("g_balance_crylink_secondary_bounces");
- if(cvar("g_balance_crylink_secondary_joinexplode"))
- maxdmg += cvar("g_balance_crylink_secondary_joinexplode_damage");
+ maxdmg = autocvar_g_balance_crylink_secondary_damage*autocvar_g_balance_crylink_secondary_shots;
+ maxdmg *= 1 + autocvar_g_balance_crylink_secondary_bouncedamagefactor * autocvar_g_balance_crylink_secondary_bounces;
+ if(autocvar_g_balance_crylink_secondary_joinexplode)
+ maxdmg += autocvar_g_balance_crylink_secondary_joinexplode_damage;
W_SetupShot (self, FALSE, 2, "weapons/crylink_fire2.wav", CHAN_WEAPON, maxdmg);
- shots = cvar("g_balance_crylink_secondary_shots");
+ shots = autocvar_g_balance_crylink_secondary_shots;
pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
proj = world;
while (counter < shots)
proj.realowner = proj.owner = self;
proj.classname = "spike";
proj.bot_dodge = TRUE;
- proj.bot_dodgerating = cvar("g_balance_crylink_secondary_damage");
+ proj.bot_dodgerating = autocvar_g_balance_crylink_secondary_damage;
if(shots == 1) {
proj.queuenext = proj;
proj.queueprev = proj;
setorigin (proj, w_shotorg);
setsize(proj, '0 0 0', '0 0 0');
- W_SetupProjectileVelocityEx(proj, (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * cvar("g_balance_crylink_secondary_spread") * g_weaponspreadfactor), v_up, cvar("g_balance_crylink_secondary_speed"), 0, 0, 0, FALSE);
+ W_SetupProjectileVelocityEx(proj, (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * autocvar_g_balance_crylink_secondary_spread * g_weaponspreadfactor), v_up, autocvar_g_balance_crylink_secondary_speed, 0, 0, 0, FALSE);
proj.touch = W_Crylink_Touch2;
proj.think = W_Crylink_Fadethink;
if(counter == (shots - 1) / 2)
{
- proj.fade_time = time + cvar("g_balance_crylink_secondary_middle_lifetime");
- proj.fade_rate = 1 / cvar("g_balance_crylink_secondary_middle_fadetime");
- proj.nextthink = time + cvar("g_balance_crylink_secondary_middle_lifetime") + cvar("g_balance_crylink_secondary_middle_fadetime");
+ proj.fade_time = time + autocvar_g_balance_crylink_secondary_middle_lifetime;
+ proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_middle_fadetime;
+ proj.nextthink = time + autocvar_g_balance_crylink_secondary_middle_lifetime + autocvar_g_balance_crylink_secondary_middle_fadetime;
}
else
{
- proj.fade_time = time + cvar("g_balance_crylink_secondary_line_lifetime");
- proj.fade_rate = 1 / cvar("g_balance_crylink_secondary_line_fadetime");
- proj.nextthink = time + cvar("g_balance_crylink_secondary_line_lifetime") + cvar("g_balance_crylink_secondary_line_fadetime");
+ proj.fade_time = time + autocvar_g_balance_crylink_secondary_line_lifetime;
+ proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_line_fadetime;
+ proj.nextthink = time + autocvar_g_balance_crylink_secondary_line_lifetime + autocvar_g_balance_crylink_secondary_line_fadetime;
}
- proj.cnt = cvar("g_balance_crylink_secondary_bounces");
+ proj.cnt = autocvar_g_balance_crylink_secondary_bounces;
//proj.scale = 1 + 1 * proj.cnt;
proj.angles = vectoangles (proj.velocity);
{
if (req == WR_AIM)
{
- if (random() > 0.15)
- self.BUTTON_ATCK = bot_aim(cvar("g_balance_crylink_primary_speed"), 0, cvar("g_balance_crylink_primary_middle_lifetime"), FALSE);
+ if (random() < 0.10)
+ self.BUTTON_ATCK = bot_aim(autocvar_g_balance_crylink_primary_speed, 0, autocvar_g_balance_crylink_primary_middle_lifetime, FALSE);
else
- self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_crylink_secondary_speed"), 0, cvar("g_balance_crylink_secondary_middle_lifetime"), FALSE);
+ self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_crylink_secondary_speed, 0, autocvar_g_balance_crylink_secondary_middle_lifetime, FALSE);
}
else if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
{
if (!self.crylink_waitrelease)
- if (weapon_prepareattack(0, cvar("g_balance_crylink_primary_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_crylink_primary_refire))
{
W_Crylink_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_crylink_primary_animtime"), w_ready);
- if(cvar("g_balance_crylink_primary_joinspread") != 0 || cvar("g_balance_crylink_primary_jointime") != 0)
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_crylink_primary_animtime, w_ready);
+ if(autocvar_g_balance_crylink_primary_joinspread != 0 || autocvar_g_balance_crylink_primary_jointime != 0)
self.crylink_waitrelease = 1;
}
}
- else if(self.BUTTON_ATCK2 && cvar("g_balance_crylink_secondary"))
+ else if(self.BUTTON_ATCK2 && autocvar_g_balance_crylink_secondary)
{
if (!self.crylink_waitrelease)
- if (weapon_prepareattack(1, cvar("g_balance_crylink_secondary_refire")))
+ if (weapon_prepareattack(1, autocvar_g_balance_crylink_secondary_refire))
{
W_Crylink_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_crylink_secondary_animtime"), w_ready);
- if(cvar("g_balance_crylink_secondary_joinspread") != 0 || cvar("g_balance_crylink_secondary_jointime") != 0)
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_crylink_secondary_animtime, w_ready);
+ if(autocvar_g_balance_crylink_secondary_joinspread != 0 || autocvar_g_balance_crylink_secondary_jointime != 0)
self.crylink_waitrelease = 2;
}
}
{
vector pos;
entity linkjoineffect;
-
-
+
+
if(self.crylink_waitrelease == 1)
{
- pos = W_Crylink_LinkJoin(self.crylink_lastgroup, cvar("g_balance_crylink_primary_joinspread") * cvar("g_balance_crylink_primary_speed"), cvar("g_balance_crylink_primary_jointime"));
-
+ pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_primary_joinspread * autocvar_g_balance_crylink_primary_speed, autocvar_g_balance_crylink_primary_jointime);
+
}
else
{
- pos = W_Crylink_LinkJoin(self.crylink_lastgroup, cvar("g_balance_crylink_secondary_joinspread") * cvar("g_balance_crylink_secondary_speed"), cvar("g_balance_crylink_secondary_jointime"));
+ pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_secondary_joinspread * autocvar_g_balance_crylink_secondary_speed, autocvar_g_balance_crylink_secondary_jointime);
}
-
+
linkjoineffect = spawn();
linkjoineffect.think = W_Crylink_LinkJoinEffect_Think;
- linkjoineffect.classname = "linkjoineffect";
+ linkjoineffect.classname = "linkjoineffect";
linkjoineffect.nextthink = time + w_crylink_linkjoin_time;
linkjoineffect.owner = self;
setorigin(linkjoineffect, pos);
// don't "run out of ammo" and switch weapons while waiting for release
if(self.crylink_lastgroup && self.crylink_waitrelease)
return TRUE;
- return self.ammo_cells >= cvar("g_balance_crylink_primary_ammo");
+ return self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
}
else if (req == WR_CHECKAMMO2)
{
// don't "run out of ammo" and switch weapons while waiting for release
if(self.crylink_lastgroup && self.crylink_waitrelease)
return TRUE;
- return self.ammo_cells >= cvar("g_balance_crylink_secondary_ammo");
+ return self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
}
return TRUE;
};
e.takedamage = DAMAGE_NO;
e.classname = "plasma_chain";
e.think = W_Plasma_Explode_Combo;
- e.nextthink = time + vlen(e.WarpZone_findradius_dist) / cvar("g_balance_electro_combo_speed"); // delay combo chains, looks cooler
+ e.nextthink = time + vlen(e.WarpZone_findradius_dist) / autocvar_g_balance_electro_combo_speed; // delay combo chains, looks cooler
}
e = e.chain;
}
self.takedamage = DAMAGE_NO;
if (self.movetype == MOVETYPE_BOUNCE)
{
- RadiusDamage (self, self.owner, cvar("g_balance_electro_secondary_damage"), cvar("g_balance_electro_secondary_edgedamage"), cvar("g_balance_electro_secondary_radius"), world, cvar("g_balance_electro_secondary_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.owner, autocvar_g_balance_electro_secondary_damage, autocvar_g_balance_electro_secondary_edgedamage, autocvar_g_balance_electro_secondary_radius, world, autocvar_g_balance_electro_secondary_force, self.projectiledeathtype, other);
}
else
{
- W_Plasma_TriggerCombo(self.origin, cvar("g_balance_electro_primary_comboradius"), self.owner);
- RadiusDamage (self, self.owner, cvar("g_balance_electro_primary_damage"), cvar("g_balance_electro_primary_edgedamage"), cvar("g_balance_electro_primary_radius"), world, cvar("g_balance_electro_primary_force"), self.projectiledeathtype, other);
+ W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_primary_comboradius, self.owner);
+ RadiusDamage (self, self.owner, autocvar_g_balance_electro_primary_damage, autocvar_g_balance_electro_primary_edgedamage, autocvar_g_balance_electro_primary_radius, world, autocvar_g_balance_electro_primary_force, self.projectiledeathtype, other);
}
remove (self);
void W_Plasma_Explode_Combo (void)
{
- W_Plasma_TriggerCombo(self.origin, cvar("g_balance_electro_combo_comboradius"), self.owner);
+ W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_combo_comboradius, self.owner);
self.event_damage = SUB_Null;
- RadiusDamage (self, self.owner, cvar("g_balance_electro_combo_damage"), cvar("g_balance_electro_combo_edgedamage"), cvar("g_balance_electro_combo_radius"), world, cvar("g_balance_electro_combo_force"), WEP_ELECTRO | HITTYPE_BOUNCE, world); // use THIS type for a combo because primary can't bounce
+ RadiusDamage (self, self.owner, autocvar_g_balance_electro_combo_damage, autocvar_g_balance_electro_combo_edgedamage, autocvar_g_balance_electro_combo_radius, world, autocvar_g_balance_electro_combo_force, WEP_ELECTRO | HITTYPE_BOUNCE, world); // use THIS type for a combo because primary can't bounce
remove (self);
}
void W_Plasma_Touch (void)
{
//self.velocity = self.velocity * 0.1;
-
+
PROJECTILE_TOUCH;
if (other.takedamage == DAMAGE_AIM) {
W_Plasma_Explode ();
self.owner = inflictor.owner;
self.classname = "plasma_chain";
self.think = W_Plasma_Explode_Combo;
- self.nextthink = time + min(cvar("g_balance_electro_combo_radius"), vlen(self.origin - inflictor.origin)) / cvar("g_balance_electro_combo_speed"); // delay combo chains, looks cooler
+ self.nextthink = time + min(autocvar_g_balance_electro_combo_radius, vlen(self.origin - inflictor.origin)) / autocvar_g_balance_electro_combo_speed; // delay combo chains, looks cooler
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bounding the length, because inflictor may be in a galaxy far far away (warpzones)
}
else
{
local entity proj;
- W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', FALSE, 2, "weapons/electro_fire.wav", CHAN_WEAPON, cvar("g_balance_electro_primary_damage"));
+ W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', FALSE, 2, "weapons/electro_fire.wav", CHAN_WEAPON, autocvar_g_balance_electro_primary_damage);
pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
proj.classname = "plasma_prim";
proj.owner = self;
proj.bot_dodge = TRUE;
- proj.bot_dodgerating = cvar("g_balance_electro_primary_damage");
+ proj.bot_dodgerating = autocvar_g_balance_electro_primary_damage;
proj.use = W_Plasma_Explode;
proj.think = adaptor_think2use_hittype_splash;
- proj.nextthink = time + cvar("g_balance_electro_primary_lifetime");
+ proj.nextthink = time + autocvar_g_balance_electro_primary_lifetime;
PROJECTILE_MAKETRIGGER(proj);
proj.projectiledeathtype = WEP_ELECTRO;
setorigin(proj, w_shotorg);
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_cells = self.ammo_cells - cvar("g_balance_electro_primary_ammo");
+ self.ammo_cells = self.ammo_cells - autocvar_g_balance_electro_primary_ammo;
proj.movetype = MOVETYPE_FLY;
W_SETUPPROJECTILEVELOCITY(proj, g_balance_electro_primary);
proj.angles = vectoangles(proj.velocity);
{
local entity proj;
- W_SetupShot_ProjectileSize (self, '0 0 -4', '0 0 -4', FALSE, 2, "weapons/electro_fire2.wav", CHAN_WEAPON, cvar("g_balance_electro_secondary_damage"));
+ W_SetupShot_ProjectileSize (self, '0 0 -4', '0 0 -4', FALSE, 2, "weapons/electro_fire2.wav", CHAN_WEAPON, autocvar_g_balance_electro_secondary_damage);
w_shotdir = v_forward; // no TrueAim for grenades please
proj.use = W_Plasma_Explode;
proj.think = adaptor_think2use_hittype_splash;
proj.bot_dodge = TRUE;
- proj.bot_dodgerating = cvar("g_balance_electro_secondary_damage");
- proj.nextthink = time + cvar("g_balance_electro_secondary_lifetime");
+ proj.bot_dodgerating = autocvar_g_balance_electro_secondary_damage;
+ proj.nextthink = time + autocvar_g_balance_electro_secondary_lifetime;
PROJECTILE_MAKETRIGGER(proj);
proj.projectiledeathtype = WEP_ELECTRO | HITTYPE_SECONDARY;
setorigin(proj, w_shotorg);
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_cells = self.ammo_cells - cvar("g_balance_electro_secondary_ammo");
+ self.ammo_cells = self.ammo_cells - autocvar_g_balance_electro_secondary_ammo;
//proj.glow_size = 50;
//proj.glow_color = 45;
proj.movetype = MOVETYPE_BOUNCE;
proj.touch = W_Plasma_Touch;
setsize(proj, '0 0 -4', '0 0 -4');
proj.takedamage = DAMAGE_YES;
- proj.damageforcescale = cvar("g_balance_electro_secondary_damageforcescale");
- proj.health = cvar("g_balance_electro_secondary_health");
+ proj.damageforcescale = autocvar_g_balance_electro_secondary_damageforcescale;
+ proj.health = autocvar_g_balance_electro_secondary_health;
proj.event_damage = W_Plasma_Damage;
proj.flags = FL_PROJECTILE;
-
- proj.bouncefactor = cvar("g_balance_electro_secondary_bouncefactor");
- proj.bouncestop = cvar("g_balance_electro_secondary_bouncestop");
-
+
+ proj.bouncefactor = autocvar_g_balance_electro_secondary_bouncefactor;
+ proj.bouncestop = autocvar_g_balance_electro_secondary_bouncestop;
+
#if 0
entity p2;
p2 = spawn();
if(sf & 1)
{
WriteByte(MSG_ENTITY, num_for_edict(self.owner));
- WriteCoord(MSG_ENTITY, cvar("g_balance_electro_primary_range"));
+ WriteCoord(MSG_ENTITY, autocvar_g_balance_electro_primary_range);
}
if(sf & 2)
{
dt = frametime;
if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
{
- if(cvar("g_balance_electro_primary_ammo"))
+ if(autocvar_g_balance_electro_primary_ammo)
{
- dt = min(dt, self.owner.ammo_cells / cvar("g_balance_electro_primary_ammo"));
- self.owner.ammo_cells = max(0, self.owner.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime);
+ dt = min(dt, self.owner.ammo_cells / autocvar_g_balance_electro_primary_ammo);
+ self.owner.ammo_cells = max(0, self.owner.ammo_cells - autocvar_g_balance_electro_primary_ammo * frametime);
}
}
- W_SetupShot_Range(self.owner, TRUE, 0, "", 0, cvar("g_balance_electro_primary_damage") * dt, cvar("g_balance_electro_primary_range"));
+ W_SetupShot_Range(self.owner, TRUE, 0, "", 0, autocvar_g_balance_electro_primary_damage * dt, autocvar_g_balance_electro_primary_range);
WarpZone_traceline_antilag(self.owner, w_shotorg, w_shotend, MOVE_NORMAL, self.owner, ANTILAG_LATENCY(self.owner));
// apply the damage
if(trace_ent)
{
vector force;
- force = w_shotdir * cvar("g_balance_electro_primary_force") + '0 0 1' * cvar("g_balance_electro_primary_force_up");
+ force = w_shotdir * autocvar_g_balance_electro_primary_force + '0 0 1' * autocvar_g_balance_electro_primary_force_up;
- f = ExponentialFalloff(cvar("g_balance_electro_primary_falloff_mindist"), cvar("g_balance_electro_primary_falloff_maxdist"), cvar("g_balance_electro_primary_falloff_halflifedist"), vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos) - w_shotorg));
+ f = ExponentialFalloff(autocvar_g_balance_electro_primary_falloff_mindist, autocvar_g_balance_electro_primary_falloff_maxdist, autocvar_g_balance_electro_primary_falloff_halflifedist, vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos) - w_shotorg));
if(accuracy_isgooddamage(self.owner, trace_ent))
- accuracy_add(self.owner, WEP_ELECTRO, 0, cvar("g_balance_electro_primary_damage") * dt * f);
- Damage (trace_ent, self.owner, self.owner, cvar("g_balance_electro_primary_damage") * dt * f, WEP_ELECTRO, trace_endpos, force * dt);
+ accuracy_add(self.owner, WEP_ELECTRO, 0, autocvar_g_balance_electro_primary_damage * dt * f);
+ Damage (trace_ent, self.owner, self.owner, autocvar_g_balance_electro_primary_damage * dt * f, WEP_ELECTRO, trace_endpos, force * dt);
}
- W_Plasma_TriggerCombo(trace_endpos, cvar("g_balance_electro_primary_comboradius"), self.owner);
+ W_Plasma_TriggerCombo(trace_endpos, autocvar_g_balance_electro_primary_comboradius, self.owner);
// draw effect
if(w_shotorg != self.hook_start)
beam.movetype = MOVETYPE_NONE;
beam.shot_spread = 0;
beam.bot_dodge = TRUE;
- beam.bot_dodgerating = cvar("g_balance_electro_primary_damage");
+ beam.bot_dodgerating = autocvar_g_balance_electro_primary_damage;
Net_LinkEntity(beam, FALSE, 0, lgbeam_send);
oldself = self;
{
W_Electro_Attack2();
self.electro_count -= 1;
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_electro_secondary_animtime"), w_electro_checkattack);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_electro_secondary_animtime, w_electro_checkattack);
return;
}
self.bot_secondary_electromooth = 0;
if(self.bot_secondary_electromooth == 0)
{
- if(bot_aim(cvar("g_balance_electro_primary_speed"), 0, cvar("g_balance_electro_primary_lifetime"), FALSE))
+ float shoot;
+
+ if(autocvar_g_balance_electro_primary_speed)
+ shoot = bot_aim(autocvar_g_balance_electro_primary_speed, 0, autocvar_g_balance_electro_primary_lifetime, FALSE);
+ else
+ shoot = bot_aim(1000000, 0, 0.001, FALSE);
+
+ if(shoot)
{
self.BUTTON_ATCK = TRUE;
if(random() < 0.01) self.bot_secondary_electromooth = 1;
}
else
{
- if(bot_aim(cvar("g_balance_electro_secondary_speed"), cvar("g_balance_grenadelauncher_secondary_speed_up"), cvar("g_balance_electro_secondary_lifetime"), TRUE))
+ if(bot_aim(autocvar_g_balance_electro_secondary_speed, autocvar_g_balance_grenadelauncher_secondary_speed_up, autocvar_g_balance_electro_secondary_lifetime, TRUE))
{
self.BUTTON_ATCK2 = TRUE;
if(random() < 0.03) self.bot_secondary_electromooth = 0;
{
if (self.BUTTON_ATCK)
{
- if (weapon_prepareattack(0, (cvar("g_balance_electro_lightning") ? 0 : cvar("g_balance_electro_primary_refire"))))
+ if (weapon_prepareattack(0, (autocvar_g_balance_electro_lightning ? 0 : autocvar_g_balance_electro_primary_refire)))
{
- if(cvar("g_balance_electro_lightning"))
+ if(autocvar_g_balance_electro_lightning)
{
if ((!self.lgbeam) || wasfreed(self.lgbeam))
{
{
W_Electro_Attack();
}
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_electro_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
}
} else {
- if(cvar("g_balance_electro_lightning"))
+ if(autocvar_g_balance_electro_lightning)
{
if (self.BUTTON_ATCK_prev != 0)
{
- ATTACK_FINISHED(self) = time + cvar("g_balance_electro_primary_refire") * W_WeaponRateFactor();
+ ATTACK_FINISHED(self) = time + autocvar_g_balance_electro_primary_refire * W_WeaponRateFactor();
}
self.BUTTON_ATCK_prev = 0;
}
if (self.BUTTON_ATCK2)
if (time >= self.electro_secondarytime)
- if (weapon_prepareattack(1, cvar("g_balance_electro_secondary_refire")))
+ if (weapon_prepareattack(1, autocvar_g_balance_electro_secondary_refire))
{
W_Electro_Attack2();
- self.electro_count = cvar("g_balance_electro_secondary_count");
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_electro_secondary_animtime"), w_electro_checkattack);
- self.electro_secondarytime = time + cvar("g_balance_electro_secondary_refire2");
+ self.electro_count = autocvar_g_balance_electro_secondary_count;
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_electro_secondary_animtime, w_electro_checkattack);
+ self.electro_secondarytime = time + autocvar_g_balance_electro_secondary_refire2;
}
}
else if (req == WR_PRECACHE)
precache_sound ("weapons/electro_fire2.wav");
precache_sound ("weapons/electro_impact.wav");
precache_sound ("weapons/electro_impact_combo.wav");
- if(cvar("g_balance_electro_lightning"))
+ if(autocvar_g_balance_electro_lightning)
{
precache_sound ("weapons/lgbeam_fire.wav");
}
weapon_setup(WEP_ELECTRO);
else if (req == WR_CHECKAMMO1)
{
- if(cvar("g_balance_electro_lightning"))
- return !cvar("g_balance_electro_primary_ammo") || (self.ammo_cells > 0);
+ if(autocvar_g_balance_electro_lightning)
+ return !autocvar_g_balance_electro_primary_ammo || (self.ammo_cells > 0);
else
- return self.ammo_cells >= cvar("g_balance_electro_primary_ammo");
+ return self.ammo_cells >= autocvar_g_balance_electro_primary_ammo;
}
else if (req == WR_CHECKAMMO2)
- return self.ammo_cells >= cvar("g_balance_electro_secondary_ammo");
+ return self.ammo_cells >= autocvar_g_balance_electro_secondary_ammo;
else if (req == WR_RESETPLAYER)
{
self.electro_secondarytime = time;
// 1. dist damage
d = (self.owner.health + self.owner.armorvalue);
- RadiusDamage (self, self.realowner, cvar("g_balance_fireball_primary_damage"), cvar("g_balance_fireball_primary_edgedamage"), cvar("g_balance_fireball_primary_radius"), world, cvar("g_balance_fireball_primary_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.realowner, autocvar_g_balance_fireball_primary_damage, autocvar_g_balance_fireball_primary_edgedamage, autocvar_g_balance_fireball_primary_radius, world, autocvar_g_balance_fireball_primary_force, self.projectiledeathtype, other);
if(self.realowner.health + self.realowner.armorvalue >= d)
if(!self.cnt)
{
- modeleffect_spawn("models/sphere/sphere.md3", 0, 0, self.origin, '0 0 0', '0 0 0', '0 0 0', 0, cvar("g_balance_fireball_primary_bfgradius"), 0.2, 0.05, 0.25);
+ modeleffect_spawn("models/sphere/sphere.md3", 0, 0, self.origin, '0 0 0', '0 0 0', '0 0 0', 0, autocvar_g_balance_fireball_primary_bfgradius, 0.2, 0.05, 0.25);
// 2. bfg effect
// NOTE: this cannot be made warpzone aware by design. So, better intentionally ignore warpzones here.
- for(e = findradius(self.origin, cvar("g_balance_fireball_primary_bfgradius")); e; e = e.chain)
+ for(e = findradius(self.origin, autocvar_g_balance_fireball_primary_bfgradius); e; e = e.chain)
if(e != self.owner) if(e.takedamage == DAMAGE_AIM) if(e.classname != "player" || !self.owner || IsDifferentTeam(e, self))
{
// can we see fireball?
if(/* trace_startsolid || */ trace_fraction != 1)
continue;
dist = vlen(self.origin - e.origin - e.view_ofs);
- points = (1 - sqrt(dist / cvar("g_balance_fireball_primary_bfgradius")));
+ points = (1 - sqrt(dist / autocvar_g_balance_fireball_primary_bfgradius));
if(points <= 0)
continue;
dir = normalize(e.origin + e.view_ofs - self.origin);
if(accuracy_isgooddamage(self.realowner, e))
- accuracy_add(self.realowner, WEP_FIREBALL, 0, cvar("g_balance_fireball_primary_bfgdamage") * points);
+ accuracy_add(self.realowner, WEP_FIREBALL, 0, autocvar_g_balance_fireball_primary_bfgdamage * points);
- Damage(e, self, self.realowner, cvar("g_balance_fireball_primary_bfgdamage") * points, self.projectiledeathtype | HITTYPE_BOUNCE | HITTYPE_SPLASH, e.origin + e.view_ofs, cvar("g_balance_fireball_primary_bfgforce") * dir);
+ Damage(e, self, self.realowner, autocvar_g_balance_fireball_primary_bfgdamage * points, self.projectiledeathtype | HITTYPE_BOUNCE | HITTYPE_SPLASH, e.origin + e.view_ofs, autocvar_g_balance_fireball_primary_bfgforce * dir);
pointparticles(particleeffectnum("fireball_bfgdamage"), e.origin, -1 * dir, 1);
}
}
return;
}
- W_Fireball_LaserPlay(0.1, cvar("g_balance_fireball_primary_laserradius"), cvar("g_balance_fireball_primary_laserdamage"), cvar("g_balance_fireball_primary_laseredgedamage"), cvar("g_balance_fireball_primary_laserburntime"));
+ W_Fireball_LaserPlay(0.1, autocvar_g_balance_fireball_primary_laserradius, autocvar_g_balance_fireball_primary_laserdamage, autocvar_g_balance_fireball_primary_laseredgedamage, autocvar_g_balance_fireball_primary_laserburntime);
self.nextthink = time + 0.1;
}
{
local entity proj;
- W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 2, "weapons/fireball_fire2.wav", CHAN_WEAPON, cvar("g_balance_fireball_primary_damage") + cvar("g_balance_fireball_primary_bfgdamage"));
+ W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 2, "weapons/fireball_fire2.wav", CHAN_WEAPON, autocvar_g_balance_fireball_primary_damage + autocvar_g_balance_fireball_primary_bfgdamage);
pointparticles(particleeffectnum("fireball_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
proj.classname = "plasma_prim";
proj.owner = proj.realowner = self;
proj.bot_dodge = TRUE;
- proj.bot_dodgerating = cvar("g_balance_fireball_primary_damage");
- proj.pushltime = time + cvar("g_balance_fireball_primary_lifetime");
+ proj.bot_dodgerating = autocvar_g_balance_fireball_primary_damage;
+ proj.pushltime = time + autocvar_g_balance_fireball_primary_lifetime;
proj.use = W_Fireball_Explode;
proj.think = W_Fireball_Think;
proj.nextthink = time;
- proj.health = cvar("g_balance_fireball_primary_health");
+ proj.health = autocvar_g_balance_fireball_primary_health;
proj.team = self.team;
proj.event_damage = W_Fireball_Damage;
proj.takedamage = DAMAGE_YES;
- proj.damageforcescale = cvar("g_balance_fireball_primary_damageforcescale");
+ proj.damageforcescale = autocvar_g_balance_fireball_primary_damageforcescale;
PROJECTILE_MAKETRIGGER(proj);
proj.projectiledeathtype = WEP_FIREBALL;
setorigin(proj, w_shotorg);
void W_Fireball_Attack1_Frame4()
{
W_Fireball_Attack1();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_fireball_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, w_ready);
}
void W_Fireball_Attack1_Frame3()
{
W_Fireball_AttackEffect(0, '+1.25 +3.75 0');
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_fireball_primary_animtime"), W_Fireball_Attack1_Frame4);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame4);
}
void W_Fireball_Attack1_Frame2()
{
W_Fireball_AttackEffect(0, '-1.25 +3.75 0');
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_fireball_primary_animtime"), W_Fireball_Attack1_Frame3);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame3);
}
void W_Fireball_Attack1_Frame1()
{
W_Fireball_AttackEffect(1, '+1.25 -3.75 0');
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_fireball_primary_animtime"), W_Fireball_Attack1_Frame2);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame2);
}
void W_Fireball_Attack1_Frame0()
{
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_fuel = self.ammo_fuel - cvar("g_balance_fireball_primary_ammo");
+ self.ammo_fuel = self.ammo_fuel - autocvar_g_balance_fireball_primary_ammo;
W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
sound (self, CHAN_WEAPON, "weapons/fireball_prefire2.wav", VOL_BASE, ATTN_NORM);
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_fireball_primary_animtime"), W_Fireball_Attack1_Frame1);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame1);
}
void W_Firemine_Think()
// make it "hot" once it leaves its owner
if(self.owner)
{
- if(vlen(self.origin - self.owner.origin - self.owner.view_ofs) > cvar("g_balance_fireball_secondary_laserradius"))
+ if(vlen(self.origin - self.owner.origin - self.owner.view_ofs) > autocvar_g_balance_fireball_secondary_laserradius)
{
self.cnt += 1;
if(self.cnt == 3)
self.cnt = 0;
}
- W_Fireball_LaserPlay(0.1, cvar("g_balance_fireball_secondary_laserradius"), cvar("g_balance_fireball_secondary_laserdamage"), cvar("g_balance_fireball_secondary_laseredgedamage"), cvar("g_balance_fireball_secondary_laserburntime"));
+ W_Fireball_LaserPlay(0.1, autocvar_g_balance_fireball_secondary_laserradius, autocvar_g_balance_fireball_secondary_laserdamage, autocvar_g_balance_fireball_secondary_laseredgedamage, autocvar_g_balance_fireball_secondary_laserburntime);
self.nextthink = time + 0.1;
}
{
PROJECTILE_TOUCH;
if (other.takedamage == DAMAGE_AIM)
- if(Fire_AddDamage(other, self.realowner, cvar("g_balance_fireball_secondary_damage"), cvar("g_balance_fireball_secondary_damagetime"), self.projectiledeathtype | HITTYPE_HEADSHOT) >= 0)
+ if(Fire_AddDamage(other, self.realowner, autocvar_g_balance_fireball_secondary_damage, autocvar_g_balance_fireball_secondary_damagetime, self.projectiledeathtype | HITTYPE_HEADSHOT) >= 0)
{
remove(self);
return;
float c;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_fuel = self.ammo_fuel - cvar("g_balance_fireball_secondary_ammo");
+ self.ammo_fuel = self.ammo_fuel - autocvar_g_balance_fireball_secondary_ammo;
c = mod(self.bulletcounter, 4);
switch(c)
f_diff = '+1.25 +3.75 0';
break;
}
- W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', FALSE, 2, "weapons/fireball_fire.wav", CHAN_WEAPON, cvar("g_balance_fireball_secondary_damage"));
+ W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', FALSE, 2, "weapons/fireball_fire.wav", CHAN_WEAPON, autocvar_g_balance_fireball_secondary_damage);
traceline(w_shotorg, w_shotorg + f_diff_x * v_up + f_diff_y * v_right, MOVE_NORMAL, self);
w_shotorg = trace_endpos;
proj.owner = proj.realowner = self;
proj.classname = "grenade";
proj.bot_dodge = TRUE;
- proj.bot_dodgerating = cvar("g_balance_fireball_secondary_damage");
+ proj.bot_dodgerating = autocvar_g_balance_fireball_secondary_damage;
proj.movetype = MOVETYPE_BOUNCE;
proj.projectiledeathtype = WEP_FIREBALL | HITTYPE_SECONDARY;
proj.touch = W_Firemine_Touch;
setorigin(proj, w_shotorg);
proj.think = W_Firemine_Think;
proj.nextthink = time;
- proj.damageforcescale = cvar("g_balance_fireball_secondary_damageforcescale");
- proj.pushltime = time + cvar("g_balance_fireball_secondary_lifetime");
+ proj.damageforcescale = autocvar_g_balance_fireball_secondary_damageforcescale;
+ proj.pushltime = time + autocvar_g_balance_fireball_secondary_lifetime;
W_SETUPPROJECTILEVELOCITY_UP(proj, g_balance_fireball_secondary);
proj.angles = vectoangles(proj.velocity);
self.BUTTON_ATCK2 = FALSE;
if (self.bot_primary_fireballmooth == 0)
{
- if(bot_aim(cvar("g_balance_fireball_primary_speed"), 0, cvar("g_balance_fireball_primary_lifetime"), FALSE))
+ if(bot_aim(autocvar_g_balance_fireball_primary_speed, 0, autocvar_g_balance_fireball_primary_lifetime, FALSE))
{
self.BUTTON_ATCK = TRUE;
if(random() < 0.02) self.bot_primary_fireballmooth = 0;
}
else
{
- if(bot_aim(cvar("g_balance_fireball_secondary_speed"), cvar("g_balance_fireball_secondary_speed_up"), cvar("g_balance_fireball_secondary_lifetime"), TRUE))
+ if(bot_aim(autocvar_g_balance_fireball_secondary_speed, autocvar_g_balance_fireball_secondary_speed_up, autocvar_g_balance_fireball_secondary_lifetime, TRUE))
{
self.BUTTON_ATCK2 = TRUE;
if(random() < 0.01) self.bot_primary_fireballmooth = 1;
{
if (self.BUTTON_ATCK)
if (time >= self.fireball_primarytime)
- if (weapon_prepareattack(0, cvar("g_balance_fireball_primary_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_fireball_primary_refire))
{
W_Fireball_Attack1_Frame0();
- self.fireball_primarytime = time + cvar("g_balance_fireball_primary_refire2");
+ self.fireball_primarytime = time + autocvar_g_balance_fireball_primary_refire2;
}
if (self.BUTTON_ATCK2)
- if (weapon_prepareattack(1, cvar("g_balance_fireball_secondary_refire")))
+ if (weapon_prepareattack(1, autocvar_g_balance_fireball_secondary_refire))
{
W_Fireball_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_fireball_secondary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_fireball_secondary_animtime, w_ready);
}
}
else if (req == WR_PRECACHE)
else if (req == WR_SETUP)
weapon_setup(WEP_FIREBALL);
else if (req == WR_CHECKAMMO1)
- return self.ammo_fuel >= cvar("g_balance_fireball_primary_ammo");
+ return self.ammo_fuel >= autocvar_g_balance_fireball_primary_ammo;
else if (req == WR_CHECKAMMO2)
- return self.ammo_fuel >= cvar("g_balance_fireball_secondary_ammo");
+ return self.ammo_fuel >= autocvar_g_balance_fireball_secondary_ammo;
else if (req == WR_RESETPLAYER)
{
self.fireball_primarytime = time;
if(self.movetype == MOVETYPE_NONE)
self.velocity = self.oldvelocity;
- RadiusDamage (self, self.owner, cvar("g_balance_grenadelauncher_primary_damage"), cvar("g_balance_grenadelauncher_primary_edgedamage"), cvar("g_balance_grenadelauncher_primary_radius"), world, cvar("g_balance_grenadelauncher_primary_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.owner, autocvar_g_balance_grenadelauncher_primary_damage, autocvar_g_balance_grenadelauncher_primary_edgedamage, autocvar_g_balance_grenadelauncher_primary_radius, world, autocvar_g_balance_grenadelauncher_primary_force, self.projectiledeathtype, other);
remove (self);
}
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);
+ RadiusDamage (self, self.owner, autocvar_g_balance_grenadelauncher_secondary_damage, autocvar_g_balance_grenadelauncher_secondary_edgedamage, autocvar_g_balance_grenadelauncher_secondary_radius, world, autocvar_g_balance_grenadelauncher_secondary_force, self.projectiledeathtype, other);
remove (self);
}
W_Grenade_Explode ();
return;
}
- if(self.gl_detonate_later && self.gl_bouncecnt >= cvar("g_balance_grenadelauncher_primary_remote_minbouncecnt"))
+ if(self.gl_detonate_later && self.gl_bouncecnt >= autocvar_g_balance_grenadelauncher_primary_remote_minbouncecnt)
W_Grenade_Explode();
}
void W_Grenade_Touch1 (void)
{
PROJECTILE_TOUCH;
- if (other.takedamage == DAMAGE_AIM || cvar("g_balance_grenadelauncher_primary_type") == 0) // always explode when hitting a player, or if normal mortar projectile
+ if (other.takedamage == DAMAGE_AIM || autocvar_g_balance_grenadelauncher_primary_type == 0) // always explode when hitting a player, or if normal mortar projectile
{
self.use ();
}
- else if (cvar("g_balance_grenadelauncher_primary_type") == 1) // bounce
+ else if (autocvar_g_balance_grenadelauncher_primary_type == 1) // bounce
{
float r;
r = random() * 6;
self.projectiledeathtype |= HITTYPE_BOUNCE;
self.gl_bouncecnt += 1;
}
- else if(cvar("g_balance_grenadelauncher_primary_type") == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
+ else if(autocvar_g_balance_grenadelauncher_primary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
{
spamsound (self, CHAN_PROJECTILE, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
// do not respond to any more touches
self.solid = SOLID_NOT;
- self.nextthink = min(self.nextthink, time + cvar("g_balance_grenadelauncher_primary_lifetime2"));
+ self.nextthink = min(self.nextthink, time + autocvar_g_balance_grenadelauncher_primary_lifetime2);
}
}
void W_Grenade_Touch2 (void)
{
PROJECTILE_TOUCH;
- if (other.takedamage == DAMAGE_AIM || cvar("g_balance_grenadelauncher_secondary_type") == 0) // always explode when hitting a player, or if normal mortar projectile
+ if (other.takedamage == DAMAGE_AIM || autocvar_g_balance_grenadelauncher_secondary_type == 0) // always explode when hitting a player, or if normal mortar projectile
{
self.use ();
}
- else if (cvar("g_balance_grenadelauncher_secondary_type") == 1) // bounce
+ else if (autocvar_g_balance_grenadelauncher_secondary_type == 1) // bounce
{
float r;
r = random() * 6;
self.projectiledeathtype |= HITTYPE_BOUNCE;
self.gl_bouncecnt += 1;
}
- else if(cvar("g_balance_grenadelauncher_secondary_type") == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
+ else if(autocvar_g_balance_grenadelauncher_secondary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
{
spamsound (self, CHAN_PROJECTILE, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
// do not respond to any more touches
self.solid = SOLID_NOT;
- self.nextthink = min(self.nextthink, time + cvar("g_balance_grenadelauncher_secondary_lifetime2"));
+ self.nextthink = min(self.nextthink, time + autocvar_g_balance_grenadelauncher_secondary_lifetime2);
}
}
local entity gren;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_primary_ammo");
- W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, cvar("g_balance_grenadelauncher_primary_damage"));
+ self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_grenadelauncher_primary_ammo;
+ W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, autocvar_g_balance_grenadelauncher_primary_damage);
w_shotdir = v_forward; // no TrueAim for grenades please
pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
gren.owner = self;
gren.classname = "grenade";
gren.bot_dodge = TRUE;
- gren.bot_dodgerating = cvar("g_balance_grenadelauncher_primary_damage");
+ gren.bot_dodgerating = autocvar_g_balance_grenadelauncher_primary_damage;
gren.movetype = MOVETYPE_BOUNCE;
- gren.bouncefactor = cvar("g_balance_grenadelauncher_bouncefactor");
- gren.bouncestop = cvar("g_balance_grenadelauncher_bouncestop");
+ gren.bouncefactor = autocvar_g_balance_grenadelauncher_bouncefactor;
+ gren.bouncestop = autocvar_g_balance_grenadelauncher_bouncestop;
PROJECTILE_MAKETRIGGER(gren);
gren.projectiledeathtype = WEP_GRENADE_LAUNCHER;
setorigin(gren, w_shotorg);
setsize(gren, '-3 -3 -3', '3 3 3');
- gren.cnt = time + cvar("g_balance_grenadelauncher_primary_lifetime");
+ gren.cnt = time + autocvar_g_balance_grenadelauncher_primary_lifetime;
gren.nextthink = time;
gren.think = W_Grenade_Think1;
gren.use = W_Grenade_Explode;
gren.touch = W_Grenade_Touch1;
gren.takedamage = DAMAGE_YES;
- gren.health = cvar("g_balance_grenadelauncher_primary_health");
- gren.damageforcescale = cvar("g_balance_grenadelauncher_primary_damageforcescale");
+ gren.health = autocvar_g_balance_grenadelauncher_primary_health;
+ gren.damageforcescale = autocvar_g_balance_grenadelauncher_primary_damageforcescale;
gren.event_damage = W_Grenade_Damage;
W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_primary);
gren.angles = vectoangles (gren.velocity);
gren.flags = FL_PROJECTILE;
- if(cvar("g_balance_grenadelauncher_primary_type") == 0 || cvar("g_balance_grenadelauncher_primary_type") == 2)
+ if(autocvar_g_balance_grenadelauncher_primary_type == 0 || autocvar_g_balance_grenadelauncher_primary_type == 2)
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
else
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
local entity gren;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_secondary_ammo");
- W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, cvar("g_balance_grenadelauncher_secondary_damage"));
+ self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_grenadelauncher_secondary_ammo;
+ W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, autocvar_g_balance_grenadelauncher_secondary_damage);
w_shotdir = v_forward; // no TrueAim for grenades please
pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
gren.owner = self;
gren.classname = "grenade";
gren.bot_dodge = TRUE;
- gren.bot_dodgerating = cvar("g_balance_grenadelauncher_secondary_damage");
+ gren.bot_dodgerating = autocvar_g_balance_grenadelauncher_secondary_damage;
gren.movetype = MOVETYPE_BOUNCE;
- gren.bouncefactor = cvar("g_balance_grenadelauncher_bouncefactor");
- gren.bouncestop = cvar("g_balance_grenadelauncher_bouncestop");
+ gren.bouncefactor = autocvar_g_balance_grenadelauncher_bouncefactor;
+ gren.bouncestop = autocvar_g_balance_grenadelauncher_bouncestop;
PROJECTILE_MAKETRIGGER(gren);
gren.projectiledeathtype = WEP_GRENADE_LAUNCHER | HITTYPE_SECONDARY;
setorigin(gren, w_shotorg);
setsize(gren, '-3 -3 -3', '3 3 3');
- gren.nextthink = time + cvar("g_balance_grenadelauncher_secondary_lifetime");
+ gren.nextthink = time + autocvar_g_balance_grenadelauncher_secondary_lifetime;
gren.think = adaptor_think2use_hittype_splash;
gren.use = W_Grenade_Explode2;
gren.touch = W_Grenade_Touch2;
gren.takedamage = DAMAGE_YES;
- gren.health = cvar("g_balance_grenadelauncher_secondary_health");
- gren.damageforcescale = cvar("g_balance_grenadelauncher_secondary_damageforcescale");
+ gren.health = autocvar_g_balance_grenadelauncher_secondary_health;
+ gren.damageforcescale = autocvar_g_balance_grenadelauncher_secondary_damageforcescale;
gren.event_damage = W_Grenade_Damage;
W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_secondary);
gren.angles = vectoangles (gren.velocity);
gren.flags = FL_PROJECTILE;
- if(cvar("g_balance_grenadelauncher_secondary_type") == 0 || cvar("g_balance_grenadelauncher_secondary_type") == 2)
+ if(autocvar_g_balance_grenadelauncher_secondary_type == 0 || autocvar_g_balance_grenadelauncher_secondary_type == 2)
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
else
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
self.BUTTON_ATCK2 = FALSE;
if (self.bot_secondary_grenademooth == 0)
{
- if(bot_aim(cvar("g_balance_grenadelauncher_primary_speed"), cvar("g_balance_grenadelauncher_primary_speed_up"), cvar("g_balance_grenadelauncher_primary_lifetime"), TRUE))
+ if(bot_aim(autocvar_g_balance_grenadelauncher_primary_speed, autocvar_g_balance_grenadelauncher_primary_speed_up, autocvar_g_balance_grenadelauncher_primary_lifetime, TRUE))
{
self.BUTTON_ATCK = TRUE;
if(random() < 0.01) self.bot_secondary_grenademooth = 1;
}
else
{
- if(bot_aim(cvar("g_balance_grenadelauncher_secondary_speed"), cvar("g_balance_grenadelauncher_secondary_speed_up"), cvar("g_balance_grenadelauncher_secondary_lifetime"), TRUE))
+ if(bot_aim(autocvar_g_balance_grenadelauncher_secondary_speed, autocvar_g_balance_grenadelauncher_secondary_speed_up, autocvar_g_balance_grenadelauncher_secondary_lifetime, TRUE))
{
self.BUTTON_ATCK2 = TRUE;
if(random() < 0.02) self.bot_secondary_grenademooth = 0;
else if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, cvar("g_balance_grenadelauncher_primary_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_grenadelauncher_primary_refire))
{
W_Grenade_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_grenadelauncher_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_grenadelauncher_primary_animtime, w_ready);
}
if (self.BUTTON_ATCK2)
{
if(nadefound)
sound (self, CHAN_WEAPON2, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
}
- else if (weapon_prepareattack(1, cvar("g_balance_grenadelauncher_secondary_refire")))
+ else if (weapon_prepareattack(1, autocvar_g_balance_grenadelauncher_secondary_refire))
{
W_Grenade_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_grenadelauncher_secondary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_grenadelauncher_secondary_animtime, w_ready);
}
}
}
else if (req == WR_SETUP)
weapon_setup(WEP_GRENADE_LAUNCHER);
else if (req == WR_CHECKAMMO1)
- return self.ammo_rockets >= cvar("g_balance_grenadelauncher_primary_ammo");
+ return self.ammo_rockets >= autocvar_g_balance_grenadelauncher_primary_ammo;
else if (req == WR_CHECKAMMO2)
- return self.ammo_rockets >= cvar("g_balance_grenadelauncher_secondary_ammo");
+ return self.ammo_rockets >= autocvar_g_balance_grenadelauncher_secondary_ammo;
return TRUE;
};
#endif
void W_Hagar_Explode (void)
{
self.event_damage = SUB_Null;
- RadiusDamage (self, self.realowner, cvar("g_balance_hagar_primary_damage"), cvar("g_balance_hagar_primary_edgedamage"), cvar("g_balance_hagar_primary_radius"), world, cvar("g_balance_hagar_primary_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.realowner, autocvar_g_balance_hagar_primary_damage, autocvar_g_balance_hagar_primary_edgedamage, autocvar_g_balance_hagar_primary_radius, world, autocvar_g_balance_hagar_primary_force, self.projectiledeathtype, other);
remove (self);
}
void W_Hagar_Explode2 (void)
{
self.event_damage = SUB_Null;
- RadiusDamage (self, self.realowner, cvar("g_balance_hagar_secondary_damage"), cvar("g_balance_hagar_secondary_edgedamage"), cvar("g_balance_hagar_secondary_radius"), world, cvar("g_balance_hagar_secondary_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.realowner, autocvar_g_balance_hagar_secondary_damage, autocvar_g_balance_hagar_secondary_edgedamage, autocvar_g_balance_hagar_secondary_radius, world, autocvar_g_balance_hagar_secondary_force, self.projectiledeathtype, other);
remove (self);
}
local entity missile;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_primary_ammo");
- W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, cvar("g_balance_hagar_primary_damage"));
+ self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_hagar_primary_ammo;
+ W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, autocvar_g_balance_hagar_primary_damage);
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile.owner = missile.realowner = self;
missile.classname = "missile";
missile.bot_dodge = TRUE;
- missile.bot_dodgerating = cvar("g_balance_hagar_primary_damage");
+ missile.bot_dodgerating = autocvar_g_balance_hagar_primary_damage;
missile.touch = W_Hagar_Touch;
missile.use = W_Hagar_Explode;
missile.think = adaptor_think2use_hittype_splash;
- missile.nextthink = time + cvar("g_balance_hagar_primary_lifetime");
+ missile.nextthink = time + autocvar_g_balance_hagar_primary_lifetime;
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_HAGAR;
setorigin (missile, w_shotorg);
local entity missile;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_secondary_ammo");
- W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, cvar("g_balance_hagar_secondary_damage"));
+ self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_hagar_secondary_ammo;
+ W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, autocvar_g_balance_hagar_secondary_damage);
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile.owner = missile.realowner = self;
missile.classname = "missile";
missile.bot_dodge = TRUE;
- missile.bot_dodgerating = cvar("g_balance_hagar_secondary_damage");
+ missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
missile.touch = W_Hagar_Touch2;
missile.cnt = 0;
missile.use = W_Hagar_Explode2;
missile.think = adaptor_think2use_hittype_splash;
- missile.nextthink = time + cvar("g_balance_hagar_secondary_lifetime_min") + random() * cvar("g_balance_hagar_secondary_lifetime_rand");
+ missile.nextthink = time + autocvar_g_balance_hagar_secondary_lifetime_min + random() * autocvar_g_balance_hagar_secondary_lifetime_rand;
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
setorigin (missile, w_shotorg);
{
if (req == WR_AIM)
if (random()>0.15)
- self.BUTTON_ATCK = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE);
+ self.BUTTON_ATCK = bot_aim(autocvar_g_balance_hagar_primary_speed, 0, autocvar_g_balance_hagar_primary_lifetime, FALSE);
else
{
// not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
- self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE);
+ self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_hagar_primary_speed, 0, autocvar_g_balance_hagar_primary_lifetime, FALSE);
}
else if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, cvar("g_balance_hagar_primary_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_hagar_primary_refire))
{
W_Hagar_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hagar_primary_refire"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hagar_primary_refire, w_ready);
}
- if (self.BUTTON_ATCK2 && cvar("g_balance_hagar_secondary"))
- if (weapon_prepareattack(1, cvar("g_balance_hagar_secondary_refire")))
+ if (self.BUTTON_ATCK2 && autocvar_g_balance_hagar_secondary)
+ if (weapon_prepareattack(1, autocvar_g_balance_hagar_secondary_refire))
{
W_Hagar_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hagar_secondary_refire"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hagar_secondary_refire, w_ready);
}
}
else if (req == WR_PRECACHE)
else if (req == WR_SETUP)
weapon_setup(WEP_HAGAR);
else if (req == WR_CHECKAMMO1)
- return self.ammo_rockets >= cvar("g_balance_hagar_primary_ammo");
+ return self.ammo_rockets >= autocvar_g_balance_hagar_primary_ammo;
else if (req == WR_CHECKAMMO2)
- return self.ammo_rockets >= cvar("g_balance_hagar_secondary_ammo");
+ return self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
return TRUE;
};
#endif
self.event_damage = SUB_Null;
- RadiusDamage (self, self.owner, cvar("g_balance_hlac_primary_damage"), cvar("g_balance_hlac_primary_edgedamage"), cvar("g_balance_hlac_primary_radius"), world, cvar("g_balance_hlac_primary_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.owner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
remove (self);
}
self.event_damage = SUB_Null;
- RadiusDamage (self, self.owner, cvar("g_balance_hlac_secondary_damage"), cvar("g_balance_hlac_secondary_edgedamage"), cvar("g_balance_hlac_secondary_radius"), world, cvar("g_balance_hlac_secondary_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.owner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
remove (self);
}
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
- self.ammo_cells = self.ammo_cells - cvar("g_balance_hlac_primary_ammo");
+ self.ammo_cells = self.ammo_cells - autocvar_g_balance_hlac_primary_ammo;
}
- spread = cvar("g_balance_hlac_primary_spread_min") + (cvar("g_balance_hlac_primary_spread_add") * self.HLAC_bulletcounter);
- spread = min(spread,cvar("g_balance_hlac_primary_spread_max"));
+ spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.HLAC_bulletcounter);
+ spread = min(spread,autocvar_g_balance_hlac_primary_spread_max);
if(self.crouch)
- spread = spread * cvar("g_balance_hlac_primary_spread_crouchmod");
+ spread = spread * autocvar_g_balance_hlac_primary_spread_crouchmod;
- W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON, cvar("g_balance_hlac_primary_damage"));
+ W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON, autocvar_g_balance_hlac_primary_damage);
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if (!g_norecoil)
{
// missile.dmg = issecondary;
missile.bot_dodge = TRUE;
- missile.bot_dodgerating = cvar("g_balance_hlac_primary_damage");
+ missile.bot_dodgerating = autocvar_g_balance_hlac_primary_damage;
missile.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(missile);
setorigin (missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
- W_SetupProjectileVelocity(missile, cvar("g_balance_hlac_primary_speed"), spread);
+ W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_primary_speed, spread);
missile.angles = vectoangles (missile.velocity);
missile.touch = W_HLAC_Touch;
missile.think = SUB_Remove;
- missile.nextthink = time + cvar("g_balance_hlac_primary_lifetime");
+ missile.nextthink = time + autocvar_g_balance_hlac_primary_lifetime;
missile.flags = FL_PROJECTILE;
missile.projectiledeathtype = WEP_HLAC;
local entity missile;
float spread;
- spread = cvar("g_balance_hlac_secondary_spread");
+ spread = autocvar_g_balance_hlac_secondary_spread;
if(self.crouch)
- spread = spread * cvar("g_balance_hlac_secondary_spread_crouchmod");
+ spread = spread * autocvar_g_balance_hlac_secondary_spread_crouchmod;
- W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON, cvar("g_balance_hlac_secondary_damage"));
+ W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON, autocvar_g_balance_hlac_secondary_damage);
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn ();
// missile.dmg = issecondary;
missile.bot_dodge = TRUE;
- missile.bot_dodgerating = cvar("g_balance_hlac_secondary_damage");
+ missile.bot_dodgerating = autocvar_g_balance_hlac_secondary_damage;
missile.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(missile);
setorigin (missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
- W_SetupProjectileVelocity(missile, cvar("g_balance_hlac_secondary_speed"), spread);
+ W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_secondary_speed, spread);
missile.angles = vectoangles (missile.velocity);
missile.touch = W_HLAC_Touch2;
missile.think = SUB_Remove;
- missile.nextthink = time + cvar("g_balance_hlac_secondary_lifetime");
+ missile.nextthink = time + autocvar_g_balance_hlac_secondary_lifetime;
missile.flags = FL_PROJECTILE;
missile.projectiledeathtype = WEP_HLAC | HITTYPE_SECONDARY;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
- self.ammo_cells = self.ammo_cells - cvar("g_balance_hlac_secondary_ammo");
+ self.ammo_cells = self.ammo_cells - autocvar_g_balance_hlac_secondary_ammo;
}
- for(i=cvar("g_balance_hlac_secondary_shots");i>0;--i)
+ for(i=autocvar_g_balance_hlac_secondary_shots;i>0;--i)
W_HLAC_Attack2f();
if (!g_norecoil)
return;
}
- ATTACK_FINISHED(self) = time + cvar("g_balance_hlac_primary_refire") * W_WeaponRateFactor();
+ ATTACK_FINISHED(self) = time + autocvar_g_balance_hlac_primary_refire * W_WeaponRateFactor();
W_HLAC_Attack();
self.HLAC_bulletcounter = self.HLAC_bulletcounter + 1;
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hlac_primary_refire"), HLAC_fire1_02);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
}
else
{
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hlac_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_animtime, w_ready);
}
};
float w_hlac(float req)
{
if (req == WR_AIM)
- self.BUTTON_ATCK = bot_aim(cvar("g_balance_hlac_primary_speed"), 0, cvar("g_balance_hlac_primary_lifetime"), FALSE);
+ self.BUTTON_ATCK = bot_aim(autocvar_g_balance_hlac_primary_speed, 0, autocvar_g_balance_hlac_primary_lifetime, FALSE);
else if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, cvar("g_balance_hlac_primary_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_hlac_primary_refire))
{
self.HLAC_bulletcounter = 0;
W_HLAC_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hlac_primary_refire"), HLAC_fire1_02);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
}
- if (self.BUTTON_ATCK2 && cvar("g_balance_hlac_secondary"))
- if (weapon_prepareattack(1, cvar("g_balance_hlac_secondary_refire")))
+ if (self.BUTTON_ATCK2 && autocvar_g_balance_hlac_secondary)
+ if (weapon_prepareattack(1, autocvar_g_balance_hlac_secondary_refire))
{
W_HLAC_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hlac_secondary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hlac_secondary_animtime, w_ready);
}
}
else if (req == WR_SETUP)
weapon_setup(WEP_HLAC);
else if (req == WR_CHECKAMMO1)
- return self.ammo_cells >= cvar("g_balance_hlac_primary_ammo");
+ return self.ammo_cells >= autocvar_g_balance_hlac_primary_ammo;
else if (req == WR_CHECKAMMO2)
- return self.ammo_cells >= cvar("g_balance_hlac_secondary_ammo");
+ return self.ammo_cells >= autocvar_g_balance_hlac_secondary_ammo;
return TRUE;
};
#endif
self.think = W_Hook_ExplodeThink;
self.nextthink = time;
- self.dmg = cvar("g_balance_hook_secondary_damage");
- self.dmg_edge = cvar("g_balance_hook_secondary_edgedamage");
- self.dmg_radius = cvar("g_balance_hook_secondary_radius");
- self.dmg_force = cvar("g_balance_hook_secondary_force");
- self.dmg_power = cvar("g_balance_hook_secondary_power");
- self.dmg_duration = cvar("g_balance_hook_secondary_duration");
+ self.dmg = autocvar_g_balance_hook_secondary_damage;
+ self.dmg_edge = autocvar_g_balance_hook_secondary_edgedamage;
+ self.dmg_radius = autocvar_g_balance_hook_secondary_radius;
+ self.dmg_force = autocvar_g_balance_hook_secondary_force;
+ self.dmg_power = autocvar_g_balance_hook_secondary_power;
+ self.dmg_duration = autocvar_g_balance_hook_secondary_duration;
self.teleport_time = time;
self.dmg_last = 1;
self.movetype = MOVETYPE_NONE;
local entity gren;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_secondary_ammo");
- W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CHAN_WEAPON, cvar("g_balance_hook_secondary_damage"));
+ self.ammo_cells = self.ammo_cells - autocvar_g_balance_hook_secondary_ammo;
+ W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CHAN_WEAPON, autocvar_g_balance_hook_secondary_damage);
gren = spawn ();
gren.owner = self;
gren.classname = "hookbomb";
gren.bot_dodge = TRUE;
- gren.bot_dodgerating = cvar("g_balance_hook_secondary_damage");
+ gren.bot_dodgerating = autocvar_g_balance_hook_secondary_damage;
gren.movetype = MOVETYPE_TOSS;
PROJECTILE_MAKETRIGGER(gren);
gren.projectiledeathtype = WEP_HOOK | HITTYPE_SECONDARY;
setorigin(gren, w_shotorg);
setsize(gren, '0 0 0', '0 0 0');
- gren.nextthink = time + cvar("g_balance_hook_secondary_lifetime");
+ gren.nextthink = time + autocvar_g_balance_hook_secondary_lifetime;
gren.think = adaptor_think2use_hittype_splash;
gren.use = W_Hook_Explode2;
gren.touch = W_Hook_Touch2;
- gren.velocity = '0 0 1' * cvar("g_balance_hook_secondary_speed");
- if(cvar("g_projectiles_newton_style"))
+ gren.velocity = '0 0 1' * autocvar_g_balance_hook_secondary_speed;
+ if(autocvar_g_projectiles_newton_style)
gren.velocity = gren.velocity + self.velocity;
- gren.gravity = cvar("g_balance_hook_secondary_gravity");
+ gren.gravity = autocvar_g_balance_hook_secondary_gravity;
//W_SetupProjectileVelocity(gren); // just falling down!
gren.angles = '0 0 0';
if (weapon_prepareattack(0, -1))
{
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_fuel = self.ammo_fuel - cvar("g_balance_hook_primary_fuel");
+ self.ammo_fuel = self.ammo_fuel - autocvar_g_balance_hook_primary_fuel;
self.hook_state |= HOOK_FIRING;
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hook_primary_animtime, w_ready);
}
}
if (self.BUTTON_ATCK2)
{
- if (weapon_prepareattack(1, cvar("g_balance_hook_secondary_refire")))
+ if (weapon_prepareattack(1, autocvar_g_balance_hook_secondary_refire))
{
W_Hook_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hook_secondary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hook_secondary_animtime, w_ready);
}
}
if(self.hook)
{
// if hooked, no bombs, and increase the timer
- self.hook_refire = max(self.hook_refire, time + cvar("g_balance_hook_primary_refire"));
+ self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire);
// hook also inhibits health regeneration, but only for 1 second
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen"));
+ self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
}
if(self.hook && self.hook.state == 1)
{
- hooked_time_max = cvar("g_balance_hook_primary_hooked_time_max");
+ hooked_time_max = autocvar_g_balance_hook_primary_hooked_time_max;
if (hooked_time_max > 0)
{
if ( time > self.hook_time_hooked + hooked_time_max )
self.hook_state |= HOOK_REMOVING;
}
- hooked_fuel = cvar("g_balance_hook_primary_hooked_fuel");
+ hooked_fuel = autocvar_g_balance_hook_primary_hooked_fuel;
if (hooked_fuel > 0)
{
if ( time > self.hook_time_fueldecrease )
else
{
self.hook_time_hooked = time;
- self.hook_time_fueldecrease = time + cvar("g_balance_hook_primary_hooked_time_free");
+ self.hook_time_fueldecrease = time + autocvar_g_balance_hook_primary_hooked_time_free;
}
if (self.BUTTON_CROUCH)
if(self.hook)
return self.ammo_fuel > 0;
else
- return self.ammo_fuel >= cvar("g_balance_hook_primary_fuel");
+ return self.ammo_fuel >= autocvar_g_balance_hook_primary_fuel;
}
else if (req == WR_CHECKAMMO2)
{
- return self.ammo_cells >= cvar("g_balance_hook_secondary_ammo");
+ return self.ammo_cells >= autocvar_g_balance_hook_secondary_ammo;
}
else if (req == WR_RESETPLAYER)
{
self.event_damage = SUB_Null;
if (self.dmg)
- RadiusDamage (self, self.owner, cvar("g_balance_laser_secondary_damage"), cvar("g_balance_laser_secondary_edgedamage"), cvar("g_balance_laser_secondary_radius"), world, cvar("g_balance_laser_secondary_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.owner, autocvar_g_balance_laser_secondary_damage, autocvar_g_balance_laser_secondary_edgedamage, autocvar_g_balance_laser_secondary_radius, world, autocvar_g_balance_laser_secondary_force, self.projectiledeathtype, other);
else
- RadiusDamage (self, self.owner, cvar("g_balance_laser_primary_damage"), cvar("g_balance_laser_primary_edgedamage"), cvar("g_balance_laser_primary_radius"), world, cvar("g_balance_laser_primary_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.owner, autocvar_g_balance_laser_primary_damage, autocvar_g_balance_laser_primary_edgedamage, autocvar_g_balance_laser_primary_radius, world, autocvar_g_balance_laser_primary_force, self.projectiledeathtype, other);
remove (self);
}
self.movetype = MOVETYPE_FLY;
self.think = SUB_Remove;
if (self.dmg)
- self.nextthink = time + cvar("g_balance_laser_secondary_lifetime");
+ self.nextthink = time + autocvar_g_balance_laser_secondary_lifetime;
else
- self.nextthink = time + cvar("g_balance_laser_primary_lifetime");
+ self.nextthink = time + autocvar_g_balance_laser_primary_lifetime;
CSQCProjectile(self, TRUE, PROJECTILE_LASER, TRUE);
}
else
nodamage = FALSE;
- a = cvar("g_balance_laser_primary_shotangle");
+ a = autocvar_g_balance_laser_primary_shotangle;
s_forward = v_forward * cos(a * DEG2RAD) + v_up * sin(a * DEG2RAD);
if(nodamage)
W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, 0);
else if(issecondary == 1)
- W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, cvar("g_balance_laser_secondary_damage"));
+ W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, autocvar_g_balance_laser_secondary_damage);
else
- W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, cvar("g_balance_laser_primary_damage"));
+ W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, autocvar_g_balance_laser_primary_damage);
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn ();
if(!nodamage)
{
missile.bot_dodge = TRUE;
- missile.bot_dodgerating = cvar("g_balance_laser_primary_damage");
+ missile.bot_dodgerating = autocvar_g_balance_laser_primary_damage;
}
PROJECTILE_MAKETRIGGER(missile);
missile.flags = FL_PROJECTILE;
missile.think = W_Laser_Think;
- missile.nextthink = time + cvar("g_balance_laser_primary_delay");
+ missile.nextthink = time + autocvar_g_balance_laser_primary_delay;
other = missile; MUTATOR_CALLHOOK(EditProjectile);
void gauntletbeam_think()
{
float damage, myforce, myradius;
- damage = cvar("g_balance_laser_secondary_damage");
- myforce = cvar("g_balance_laser_secondary_force");
- myradius = cvar("g_balance_laser_secondary_radius");
+ damage = autocvar_g_balance_laser_secondary_damage;
+ myforce = autocvar_g_balance_laser_secondary_force;
+ myradius = autocvar_g_balance_laser_secondary_radius;
self.owner.prevgauntletfire = time;
if (self.owner.weaponentity.state != WS_INUSE || self != self.owner.gauntletbeam || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK2)
beam.movetype = MOVETYPE_NONE;
beam.shot_spread = 0;
beam.bot_dodge = TRUE;
- beam.bot_dodgerating = cvar("g_balance_laser_primary_damage");
+ beam.bot_dodgerating = autocvar_g_balance_laser_primary_damage;
Net_LinkEntity(beam, FALSE, 0, gauntletbeam_send);
oldself = self;
local float r2;
if (req == WR_AIM)
{
- if(cvar("g_balance_laser_secondary"))
+ if(autocvar_g_balance_laser_secondary)
{
- r1 = cvar("g_balance_laser_primary_damage");
- r2 = cvar("g_balance_laser_secondary_damage");
+ r1 = autocvar_g_balance_laser_primary_damage;
+ r2 = autocvar_g_balance_laser_secondary_damage;
if (random() * (r2 + r1) > r1)
- self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_laser_secondary_speed"), 0, cvar("g_balance_laser_secondary_lifetime"), FALSE);
+ self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_laser_secondary_speed, 0, autocvar_g_balance_laser_secondary_lifetime, FALSE);
else
- self.BUTTON_ATCK = bot_aim(cvar("g_balance_laser_primary_speed"), 0, cvar("g_balance_laser_primary_lifetime"), FALSE);
+ self.BUTTON_ATCK = bot_aim(autocvar_g_balance_laser_primary_speed, 0, autocvar_g_balance_laser_primary_lifetime, FALSE);
}
else
- self.BUTTON_ATCK = bot_aim(cvar("g_balance_laser_primary_speed"), 0, cvar("g_balance_laser_primary_lifetime"), FALSE);
+ self.BUTTON_ATCK = bot_aim(autocvar_g_balance_laser_primary_speed, 0, autocvar_g_balance_laser_primary_lifetime, FALSE);
}
else if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, cvar("g_balance_laser_primary_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_laser_primary_refire))
{
W_Laser_Attack(0);
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_laser_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_laser_primary_animtime, w_ready);
}
if (self.BUTTON_ATCK2)
{
- if(cvar("g_balance_laser_secondary"))
+ if(autocvar_g_balance_laser_secondary)
{
if (weapon_prepareattack(0, 0))
{
W_Laser_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_laser_secondary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_laser_secondary_animtime, w_ready);
}
}
else
self.event_damage = SUB_Null;
self.takedamage = DAMAGE_NO;
- RadiusDamage (self, self.owner, cvar("g_balance_minelayer_damage"), cvar("g_balance_minelayer_edgedamage"), cvar("g_balance_minelayer_radius"), world, cvar("g_balance_minelayer_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.owner, autocvar_g_balance_minelayer_damage, autocvar_g_balance_minelayer_edgedamage, autocvar_g_balance_minelayer_radius, world, autocvar_g_balance_minelayer_force, self.projectiledeathtype, other);
if (self.owner.weapon == WEP_MINE_LAYER)
{
- if(self.owner.ammo_rockets < cvar("g_balance_minelayer_ammo"))
+ if(self.owner.ammo_rockets < autocvar_g_balance_minelayer_ammo)
{
self.owner.cnt = WEP_MINE_LAYER;
ATTACK_FINISHED(self.owner) = time;
self.event_damage = SUB_Null;
self.takedamage = DAMAGE_NO;
- RadiusDamage (self, self.owner, cvar("g_balance_minelayer_remote_damage"), cvar("g_balance_minelayer_remote_edgedamage"), cvar("g_balance_minelayer_remote_radius"), world, cvar("g_balance_minelayer_remote_force"), self.projectiledeathtype | HITTYPE_BOUNCE, world);
+ RadiusDamage (self, self.owner, autocvar_g_balance_minelayer_remote_damage, autocvar_g_balance_minelayer_remote_edgedamage, autocvar_g_balance_minelayer_remote_radius, world, autocvar_g_balance_minelayer_remote_force, self.projectiledeathtype | HITTYPE_BOUNCE, world);
if (self.owner.weapon == WEP_MINE_LAYER)
{
- if(self.owner.ammo_rockets < cvar("g_balance_minelayer_ammo"))
+ if(self.owner.ammo_rockets < autocvar_g_balance_minelayer_ammo)
{
self.owner.cnt = WEP_MINE_LAYER;
ATTACK_FINISHED(self.owner) = time;
if(self.owner.deadflag == DEAD_NO)
if((self.spawnshieldtime >= 0)
? (time >= self.spawnshieldtime) // timer
- : (vlen(NearestPointOnBox(self.owner, self.origin) - self.origin) > cvar("g_balance_minelayer_remote_radius")) // safety device
+ : (vlen(NearestPointOnBox(self.owner, self.origin) - self.origin) > autocvar_g_balance_minelayer_remote_radius) // safety device
)
{
W_Mine_DoRemoteExplode();
void W_Mine_ProximityExplode ()
{
// make sure no friend is in the mine's radius. If there is any, explosion is delayed until he's at a safe distance
- if(cvar("g_balance_minelayer_protection"))
+ if(autocvar_g_balance_minelayer_protection)
{
entity head;
- head = findradius(self.origin, cvar("g_balance_minelayer_radius"));
+ head = findradius(self.origin, autocvar_g_balance_minelayer_radius);
while(head)
{
if(head == self.owner || !IsDifferentTeam(head, self.owner))
}
// set the mine for detonation when a foe gets close enough
- head = findradius(self.origin, cvar("g_balance_minelayer_proximityradius"));
+ head = findradius(self.origin, autocvar_g_balance_minelayer_proximityradius);
while(head)
{
if(head.classname == "player" && head.deadflag == DEAD_NO)
if(!self.mine_time)
{
spamsound (self, CHAN_PROJECTILE, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
- self.mine_time = time + cvar("g_balance_minelayer_time");
+ self.mine_time = time + autocvar_g_balance_minelayer_time;
}
head = head.chain;
}
entity flash;
// scan how many mines we placed, and return if we reached our limit
- if(cvar("g_balance_minelayer_limit"))
+ if(autocvar_g_balance_minelayer_limit)
{
self.minelayer_mines = 0;
for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
self.minelayer_mines += 1;
- if(self.minelayer_mines >= cvar("g_balance_minelayer_limit"))
+ if(self.minelayer_mines >= autocvar_g_balance_minelayer_limit)
{
// the refire delay keeps this message from being spammed
- sprint(self, strcat("You cannot place more than ^2", cvar_string("g_balance_minelayer_limit"), " ^7mines at a time\n") );
+ sprint(self, strcat("You cannot place more than ^2", ftos(autocvar_g_balance_minelayer_limit), " ^7mines at a time\n") );
play2(self, "weapons/unavailable.wav");
return;
}
}
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_rockets = self.ammo_rockets - cvar("g_balance_minelayer_ammo");
+ self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_minelayer_ammo;
- W_SetupShot_ProjectileSize (self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", CHAN_WEAPON, cvar("g_balance_minelayer_damage"));
+ W_SetupShot_ProjectileSize (self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", CHAN_WEAPON, autocvar_g_balance_minelayer_damage);
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
mine = WarpZone_RefSys_SpawnSameRefSys(self);
mine.owner = self;
- if(cvar("g_balance_minelayer_detonatedelay") >= 0)
- mine.spawnshieldtime = time + cvar("g_balance_minelayer_detonatedelay");
+ if(autocvar_g_balance_minelayer_detonatedelay >= 0)
+ mine.spawnshieldtime = time + autocvar_g_balance_minelayer_detonatedelay;
else
mine.spawnshieldtime = -1;
mine.classname = "mine";
mine.bot_dodge = TRUE;
- mine.bot_dodgerating = cvar("g_balance_minelayer_damage") * 2; // * 2 because it can detonate inflight which makes it even more dangerous
+ mine.bot_dodgerating = autocvar_g_balance_minelayer_damage * 2; // * 2 because it can detonate inflight which makes it even more dangerous
mine.takedamage = DAMAGE_YES;
- mine.damageforcescale = cvar("g_balance_minelayer_damageforcescale");
- mine.health = cvar("g_balance_minelayer_health");
+ mine.damageforcescale = autocvar_g_balance_minelayer_damageforcescale;
+ mine.health = autocvar_g_balance_minelayer_health;
mine.event_damage = W_Mine_Damage;
mine.movetype = MOVETYPE_TOSS;
setsize (mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
setorigin (mine, w_shotorg - v_forward * 4); // move it back so it hits the wall at the right point
- W_SetupProjectileVelocity(mine, cvar("g_balance_minelayer_speed"), 0);
+ W_SetupProjectileVelocity(mine, autocvar_g_balance_minelayer_speed, 0);
mine.angles = vectoangles (mine.velocity);
mine.touch = W_Mine_Touch;
mine.think = W_Mine_Think;
mine.nextthink = time;
- mine.cnt = time + cvar("g_balance_minelayer_lifetime");
+ mine.cnt = time + autocvar_g_balance_minelayer_lifetime;
mine.flags = FL_PROJECTILE;
CSQCProjectile(mine, TRUE, PROJECTILE_MINE, TRUE);
if (req == WR_AIM)
{
// aim and decide to fire if appropriate
- self.BUTTON_ATCK = bot_aim(cvar("g_balance_minelayer_speed"), 0, cvar("g_balance_minelayer_lifetime"), FALSE);
+ self.BUTTON_ATCK = bot_aim(autocvar_g_balance_minelayer_speed, 0, autocvar_g_balance_minelayer_lifetime, FALSE);
if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
{
// decide whether to detonate mines
entity targetlist, targ;
float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
float selfdamage, teamdamage, enemydamage;
- edgedamage = cvar("g_balance_minelayer_edgedamage");
- coredamage = cvar("g_balance_minelayer_damage");
- edgeradius = cvar("g_balance_minelayer_radius");
+ edgedamage = autocvar_g_balance_minelayer_edgedamage;
+ coredamage = autocvar_g_balance_minelayer_damage;
+ edgeradius = autocvar_g_balance_minelayer_radius;
recipricoledgeradius = 1 / edgeradius;
selfdamage = 0;
teamdamage = 0;
}
float desirabledamage;
desirabledamage = enemydamage;
- if (teamplay != 1 && time > self.invincible_finished && time > self.spawnshieldtime)
- desirabledamage = desirabledamage - selfdamage * cvar("g_balance_selfdamagepercent");
- if (self.team && teamplay != 1)
+ if (time > self.invincible_finished && time > self.spawnshieldtime)
+ desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
+ if (teams_matter && self.team)
desirabledamage = desirabledamage - teamdamage;
mine = find(world, classname, "mine");
{
if (self.BUTTON_ATCK)
{
- if(weapon_prepareattack(0, cvar("g_balance_minelayer_refire")))
+ if(weapon_prepareattack(0, autocvar_g_balance_minelayer_refire))
{
W_Mine_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minelayer_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_minelayer_animtime, w_ready);
}
}
{
// don't switch while placing a mine
if ((ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
- && self.ammo_rockets < cvar("g_balance_minelayer_ammo"))
+ && self.ammo_rockets < autocvar_g_balance_minelayer_ammo)
return FALSE;
}
else if (req == WR_CHECKAMMO2)
// teamcolor / hit beam effect
vector v;
v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
- if(teamplay)
+ if(teams_matter)
{
switch(self.team)
{
if (g_minstagib)
self.ammo_cells = self.ammo_cells - 1;
else
- self.ammo_cells = self.ammo_cells - cvar("g_balance_minstanex_ammo");
+ self.ammo_cells = self.ammo_cells - autocvar_g_balance_minstanex_ammo;
}
}
if(self.ammo_cells>0)
self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
else
- self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_laser_primary_speed"), 0, cvar("g_balance_laser_primary_lifetime"), FALSE);
+ self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_laser_primary_speed, 0, autocvar_g_balance_laser_primary_lifetime, FALSE);
}
else if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
{
- if (weapon_prepareattack(0, cvar("g_balance_minstanex_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_minstanex_refire))
{
W_MinstaNex_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstanex_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_minstanex_animtime, w_ready);
}
}
else if (self.BUTTON_ATCK2)
{
if (self.jump_interval <= time)
{
- self.jump_interval = time + cvar("g_balance_laser_primary_refire") * W_WeaponRateFactor();
+ self.jump_interval = time + autocvar_g_balance_laser_primary_refire * W_WeaponRateFactor();
// ugly minstagib hack to reuse the fire mode of the laser
float w;
if (g_minstagib)
return self.ammo_cells >= 1;
else
- return self.ammo_cells >= cvar("g_balance_minstanex_ammo");
+ return self.ammo_cells >= autocvar_g_balance_minstanex_ammo;
}
else if (req == WR_CHECKAMMO2)
return TRUE;
float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, charge;
if(issecondary)
{
- mydmg = cvar("g_balance_nex_secondary_damage");
- myforce = cvar("g_balance_nex_secondary_force");
- mymindist = cvar("g_balance_nex_secondary_damagefalloff_mindist");
- mymaxdist = cvar("g_balance_nex_secondary_damagefalloff_maxdist");
- myhalflife = cvar("g_balance_nex_secondary_damagefalloff_halflife");
- myforcehalflife = cvar("g_balance_nex_secondary_damagefalloff_forcehalflife");
- myammo = cvar("g_balance_nex_secondary_ammo");
+ mydmg = autocvar_g_balance_nex_secondary_damage;
+ myforce = autocvar_g_balance_nex_secondary_force;
+ mymindist = autocvar_g_balance_nex_secondary_damagefalloff_mindist;
+ mymaxdist = autocvar_g_balance_nex_secondary_damagefalloff_maxdist;
+ myhalflife = autocvar_g_balance_nex_secondary_damagefalloff_halflife;
+ myforcehalflife = autocvar_g_balance_nex_secondary_damagefalloff_forcehalflife;
+ myammo = autocvar_g_balance_nex_secondary_ammo;
}
else
{
- mydmg = cvar("g_balance_nex_primary_damage");
- myforce = cvar("g_balance_nex_primary_force");
- mymindist = cvar("g_balance_nex_primary_damagefalloff_mindist");
- mymaxdist = cvar("g_balance_nex_primary_damagefalloff_maxdist");
- myhalflife = cvar("g_balance_nex_primary_damagefalloff_halflife");
- myforcehalflife = cvar("g_balance_nex_primary_damagefalloff_forcehalflife");
- myammo = cvar("g_balance_nex_primary_ammo");
+ mydmg = autocvar_g_balance_nex_primary_damage;
+ myforce = autocvar_g_balance_nex_primary_force;
+ mymindist = autocvar_g_balance_nex_primary_damagefalloff_mindist;
+ mymaxdist = autocvar_g_balance_nex_primary_damagefalloff_maxdist;
+ myhalflife = autocvar_g_balance_nex_primary_damagefalloff_halflife;
+ myforcehalflife = autocvar_g_balance_nex_primary_damagefalloff_forcehalflife;
+ myammo = autocvar_g_balance_nex_primary_ammo;
}
float flying;
flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
- if(cvar("g_balance_nex_charge"))
+ if(autocvar_g_balance_nex_charge)
{
- charge = cvar("g_balance_nex_charge_mindmg") / mydmg + (1 - cvar("g_balance_nex_charge_mindmg") / mydmg) * self.nex_charge;
- self.nex_charge *= cvar("g_balance_nex_charge_shot_multiplier"); // do this AFTER setting mydmg/myforce
+ charge = autocvar_g_balance_nex_charge_mindmg / mydmg + (1 - autocvar_g_balance_nex_charge_mindmg / mydmg) * self.nex_charge;
+ self.nex_charge *= autocvar_g_balance_nex_charge_shot_multiplier; // do this AFTER setting mydmg/myforce
// O RLY? -- divVerent
// YA RLY -- FruitieX
}
myforce *= charge;
W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CHAN_WEAPON, mydmg);
- if(charge > cvar("g_balance_nex_charge_limit") && cvar("g_balance_nex_charge_limit")) // if the Nex is overcharged, we play an extra sound
+ if(charge > autocvar_g_balance_nex_charge_limit && autocvar_g_balance_nex_charge_limit) // if the Nex is overcharged, we play an extra sound
{
- sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * cvar("g_balance_nex_charge_limit")) / (1 - 0.5 * cvar("g_balance_nex_charge_limit")), ATTN_NORM);
+ sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_limit) / (1 - 0.5 * autocvar_g_balance_nex_charge_limit), ATTN_NORM);
}
yoda = 0;
void spawnfunc_weapon_nex (void); // defined in t_items.qc
-.float nex_charge_pool_pauseregen_finished;
+.float nex_chargepool_pauseregen_finished;
float w_nex(float req)
{
float dt;
}
else if (req == WR_THINK)
{
- if(cvar("g_balance_nex_charge") && self.nex_charge < cvar("g_balance_nex_charge_limit"))
- self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_rate") * frametime / W_TICSPERFRAME);
+ if(autocvar_g_balance_nex_charge && self.nex_charge < autocvar_g_balance_nex_charge_limit)
+ self.nex_charge = min(1, self.nex_charge + autocvar_g_balance_nex_charge_rate * frametime / W_TICSPERFRAME);
- if(cvar("g_balance_nex_charge"))
+ if(autocvar_g_balance_nex_charge)
{
- self.weaponentity.weaponentity.glowmod = '0 0 0'; // reset
+ self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
+ self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
+ self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
- self.weaponentity.weaponentity.glowmod_x = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_red_half") * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1);
- self.weaponentity.weaponentity.glowmod_y = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_green_half") * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1);
- self.weaponentity.weaponentity.glowmod_z = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_blue_half") * bound(0, self.weaponentity.weaponentity.glowmod_z + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1);
-
- if(self.nex_charge > cvar("g_balance_nex_charge_limit"))
+ if(self.nex_charge > autocvar_g_balance_nex_charge_limit)
{
- self.weaponentity.weaponentity.glowmod_x = self.weaponentity.weaponentity.glowmod_x + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_red_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
- self.weaponentity.weaponentity.glowmod_y = self.weaponentity.weaponentity.glowmod_y + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_green_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
- self.weaponentity.weaponentity.glowmod_z = self.weaponentity.weaponentity.glowmod_z + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_blue_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
+ self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
+ self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
+ self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
}
- self.exteriorweaponentity.glowmod = self.weaponentity.weaponentity.glowmod;
}
- if(cvar("g_balance_nex_secondary_charge_pool"))
- if(self.nex_charge_pool_ammo < 1)
+ if(autocvar_g_balance_nex_secondary_chargepool)
+ if(self.nex_chargepool_ammo < 1)
{
- if(self.nex_charge_pool_pauseregen_finished < time)
- self.nex_charge_pool_ammo = min(1, self.nex_charge_pool_ammo + cvar("g_balance_nex_secondary_charge_pool_regen") * frametime / W_TICSPERFRAME);
- self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_nex_secondary_charge_pool_pause_health_regen"));
+ if(self.nex_chargepool_pauseregen_finished < time)
+ self.nex_chargepool_ammo = min(1, self.nex_chargepool_ammo + autocvar_g_balance_nex_secondary_chargepool_regen * frametime / W_TICSPERFRAME);
+ self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_nex_secondary_chargepool_pause_health_regen);
}
if (self.BUTTON_ATCK)
{
- if (weapon_prepareattack(0, cvar("g_balance_nex_primary_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_nex_primary_refire))
{
W_Nex_Attack(0);
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nex_primary_animtime, w_ready);
}
}
if (self.BUTTON_ATCK2)
{
- if(cvar("g_balance_nex_secondary_charge"))
+ if(autocvar_g_balance_nex_secondary_charge)
{
- self.nex_charge_rottime = time + cvar("g_balance_nex_charge_rot_pause");
+ self.nex_charge_rottime = time + autocvar_g_balance_nex_charge_rot_pause;
dt = frametime / W_TICSPERFRAME;
- if(cvar("g_balance_nex_secondary_charge_pool"))
+ if(autocvar_g_balance_nex_secondary_chargepool)
{
- if(cvar("g_balance_nex_secondary_ammo"))
+ if(autocvar_g_balance_nex_secondary_ammo)
{
// always deplete if secondary is held
- self.nex_charge_pool_ammo = max(0, self.nex_charge_pool_ammo - cvar("g_balance_nex_secondary_ammo") * dt);
+ self.nex_chargepool_ammo = max(0, self.nex_chargepool_ammo - autocvar_g_balance_nex_secondary_ammo * dt);
- dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
- self.nex_charge_pool_pauseregen_finished = time + cvar("g_balance_nex_secondary_charge_pool_pause_regen");
- dt = min(dt, self.nex_charge_pool_ammo);
+ dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
+ self.nex_chargepool_pauseregen_finished = time + autocvar_g_balance_nex_secondary_chargepool_pause_regen;
+ dt = min(dt, self.nex_chargepool_ammo);
dt = max(0, dt);
- self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
+ self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
}
}
- else if(cvar("g_balance_nex_secondary_ammo"))
+ else if(autocvar_g_balance_nex_secondary_ammo)
{
if(self.nex_charge < 1)
{
- dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
+ dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
- dt = min(dt, (self.ammo_cells - cvar("g_balance_nex_primary_ammo")) / cvar("g_balance_nex_secondary_ammo"));
+ dt = min(dt, (self.ammo_cells - autocvar_g_balance_nex_primary_ammo) / autocvar_g_balance_nex_secondary_ammo);
dt = max(0, dt);
if(dt > 0)
{
- self.ammo_cells = max(cvar("g_balance_nex_secondary_ammo"), self.ammo_cells - cvar("g_balance_nex_secondary_ammo") * dt);
+ self.ammo_cells = max(autocvar_g_balance_nex_secondary_ammo, self.ammo_cells - autocvar_g_balance_nex_secondary_ammo * dt);
}
}
- self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
+ self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
}
}
}
- else if(cvar("g_balance_nex_secondary"))
+ else if(autocvar_g_balance_nex_secondary)
{
- if (weapon_prepareattack(0, cvar("g_balance_nex_secondary_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_nex_secondary_refire))
{
W_Nex_Attack(1);
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_secondary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nex_secondary_animtime, w_ready);
}
}
}
else if (req == WR_SETUP)
weapon_setup(WEP_NEX);
else if (req == WR_CHECKAMMO1)
- return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
+ return self.ammo_cells >= autocvar_g_balance_nex_primary_ammo;
else if (req == WR_CHECKAMMO2)
- return self.ammo_cells >= cvar("g_balance_nex_primary_ammo"); // don't allow charging if we don't have enough ammo
+ return self.ammo_cells >= autocvar_g_balance_nex_primary_ammo; // don't allow charging if we don't have enough ammo
return TRUE;
};
#endif
setorigin(gren, w_shotorg);
setsize(gren, '0 0 0', '0 0 0');
- gren.nextthink = time + cvar("g_balance_porto_primary_lifetime");
+ gren.nextthink = time + autocvar_g_balance_porto_primary_lifetime;
gren.think = W_Porto_Think;
gren.touch = W_Porto_Touch;
if(self.items & IT_STRENGTH)
- W_SetupProjectileVelocity(gren, cvar("g_balance_porto_primary_speed") * cvar("g_balance_powerup_strength_force"), 0);
+ W_SetupProjectileVelocity(gren, autocvar_g_balance_porto_primary_speed * autocvar_g_balance_powerup_strength_force, 0);
else
- W_SetupProjectileVelocity(gren, cvar("g_balance_porto_primary_speed"), 0);
+ W_SetupProjectileVelocity(gren, autocvar_g_balance_porto_primary_speed, 0);
gren.angles = vectoangles (gren.velocity);
gren.flags = FL_PROJECTILE;
{
self.BUTTON_ATCK = FALSE;
self.BUTTON_ATCK2 = FALSE;
- if(bot_aim(cvar("g_balance_porto_primary_speed"), 0, cvar("g_balance_grenadelauncher_primary_lifetime"), FALSE))
+ if(bot_aim(autocvar_g_balance_porto_primary_speed, 0, autocvar_g_balance_grenadelauncher_primary_lifetime, FALSE))
self.BUTTON_ATCK = TRUE;
}
else if (req == WR_THINK)
if (self.BUTTON_ATCK)
if (!self.porto_current)
if (!self.porto_forbidden)
- if (weapon_prepareattack(0, cvar("g_balance_porto_primary_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_porto_primary_refire))
{
W_Porto_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_porto_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_porto_primary_animtime, w_ready);
}
}
else if (req == WR_PRECACHE)
self.event_damage = SUB_Null;
self.takedamage = DAMAGE_NO;
- RadiusDamage (self, self.owner, cvar("g_balance_rocketlauncher_damage"), cvar("g_balance_rocketlauncher_edgedamage"), cvar("g_balance_rocketlauncher_radius"), world, cvar("g_balance_rocketlauncher_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.owner, autocvar_g_balance_rocketlauncher_damage, autocvar_g_balance_rocketlauncher_edgedamage, autocvar_g_balance_rocketlauncher_radius, world, autocvar_g_balance_rocketlauncher_force, self.projectiledeathtype, other);
if (self.owner.weapon == WEP_ROCKET_LAUNCHER)
{
- if(self.owner.ammo_rockets < cvar("g_balance_rocketlauncher_ammo"))
+ if(self.owner.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo)
{
self.owner.cnt = WEP_ROCKET_LAUNCHER;
ATTACK_FINISHED(self.owner) = time;
self.event_damage = SUB_Null;
self.takedamage = DAMAGE_NO;
- RadiusDamage (self, self.owner, cvar("g_balance_rocketlauncher_remote_damage"), cvar("g_balance_rocketlauncher_remote_edgedamage"), cvar("g_balance_rocketlauncher_remote_radius"), world, cvar("g_balance_rocketlauncher_remote_force"), self.projectiledeathtype | HITTYPE_BOUNCE, world);
+ RadiusDamage (self, self.owner, autocvar_g_balance_rocketlauncher_remote_damage, autocvar_g_balance_rocketlauncher_remote_edgedamage, autocvar_g_balance_rocketlauncher_remote_radius, world, autocvar_g_balance_rocketlauncher_remote_force, self.projectiledeathtype | HITTYPE_BOUNCE, world);
if (self.owner.weapon == WEP_ROCKET_LAUNCHER)
{
- if(self.owner.ammo_rockets < cvar("g_balance_rocketlauncher_ammo"))
+ if(self.owner.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo)
{
self.owner.cnt = WEP_ROCKET_LAUNCHER;
ATTACK_FINISHED(self.owner) = time;
{
if((self.spawnshieldtime >= 0)
? (time >= self.spawnshieldtime) // timer
- : (vlen(NearestPointOnBox(self.owner, self.origin) - self.origin) > cvar("g_balance_rocketlauncher_remote_radius")) // safety device
+ : (vlen(NearestPointOnBox(self.owner, self.origin) - self.origin) > autocvar_g_balance_rocketlauncher_remote_radius) // safety device
)
{
W_Rocket_DoRemoteExplode();
// accelerate
makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0');
- velspeed = cvar("g_balance_rocketlauncher_speed") * g_weaponspeedfactor - (self.velocity * v_forward);
+ velspeed = autocvar_g_balance_rocketlauncher_speed * g_weaponspeedfactor - (self.velocity * v_forward);
if (velspeed > 0)
- self.velocity = self.velocity + v_forward * min(cvar("g_balance_rocketlauncher_speedaccel") * g_weaponspeedfactor * frametime, velspeed);
+ self.velocity = self.velocity + v_forward * min(autocvar_g_balance_rocketlauncher_speedaccel * g_weaponspeedfactor * frametime, velspeed);
// laser guided, or remote detonation
if (self.owner.weapon == WEP_ROCKET_LAUNCHER)
if(self == self.owner.lastrocket)
if not(self.owner.rl_release)
if not(self.BUTTON_ATCK2)
- if(cvar("g_balance_rocketlauncher_guiderate"))
+ if(autocvar_g_balance_rocketlauncher_guiderate)
if(time > self.pushltime)
if(self.owner.deadflag == DEAD_NO)
{
- f = cvar("g_balance_rocketlauncher_guideratedelay");
+ f = autocvar_g_balance_rocketlauncher_guideratedelay;
if(f)
f = bound(0, (time - self.pushltime) / f, 1);
else
desiredorigin = WarpZone_RefSys_TransformOrigin(self.owner, self, self.owner.origin + self.owner.view_ofs);
olddir = normalize(self.velocity);
-#if 0
- // disabled this code because it doesn't do what I want it to do :P
- cosminang = cos(cvar("g_balance_rocketlauncher_guidefadeangle") * DEG2RAD);
- cosmaxang = cos(cvar("g_balance_rocketlauncher_guidemaxangle") * DEG2RAD);
- cosang = desireddir * normalize(self.origin - desiredorigin);
- if(cosminang == cosmaxang)
- f *= (cosang >= cosminang);
- else
- f *= bound(0, (cosang - cosmaxang) / (cosminang - cosmaxang), 1);
-#endif
-
// now it gets tricky... we want to move like some curve to approximate the target direction
// but we are limiting the rate at which we can turn!
- goal = desiredorigin + ((self.origin - desiredorigin) * desireddir + cvar("g_balance_rocketlauncher_guidegoal")) * desireddir;
- newdir = rocket_steerto(olddir, normalize(goal - self.origin), cos(cvar("g_balance_rocketlauncher_guiderate") * f * frametime * DEG2RAD));
+ goal = desiredorigin + ((self.origin - desiredorigin) * desireddir + autocvar_g_balance_rocketlauncher_guidegoal) * desireddir;
+ newdir = rocket_steerto(olddir, normalize(goal - self.origin), cos(autocvar_g_balance_rocketlauncher_guiderate * f * frametime * DEG2RAD));
self.velocity = newdir * velspeed;
self.angles = vectoangles(self.velocity);
local entity flash;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_rockets = self.ammo_rockets - cvar("g_balance_rocketlauncher_ammo");
+ self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_rocketlauncher_ammo;
- W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CHAN_WEAPON, cvar("g_balance_rocketlauncher_damage"));
+ W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CHAN_WEAPON, autocvar_g_balance_rocketlauncher_damage);
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = WarpZone_RefSys_SpawnSameRefSys(self);
missile.owner = self;
self.lastrocket = missile;
- if(cvar("g_balance_rocketlauncher_detonatedelay") >= 0)
- missile.spawnshieldtime = time + cvar("g_balance_rocketlauncher_detonatedelay");
+ if(autocvar_g_balance_rocketlauncher_detonatedelay >= 0)
+ missile.spawnshieldtime = time + autocvar_g_balance_rocketlauncher_detonatedelay;
else
missile.spawnshieldtime = -1;
- missile.pushltime = time + cvar("g_balance_rocketlauncher_guidedelay");
+ missile.pushltime = time + autocvar_g_balance_rocketlauncher_guidedelay;
missile.classname = "rocket";
missile.bot_dodge = TRUE;
- missile.bot_dodgerating = cvar("g_balance_rocketlauncher_damage") * 2; // * 2 because it can be detonated inflight which makes it even more dangerous
+ missile.bot_dodgerating = autocvar_g_balance_rocketlauncher_damage * 2; // * 2 because it can be detonated inflight which makes it even more dangerous
missile.takedamage = DAMAGE_YES;
- missile.damageforcescale = cvar("g_balance_rocketlauncher_damageforcescale");
- missile.health = cvar("g_balance_rocketlauncher_health");
+ missile.damageforcescale = autocvar_g_balance_rocketlauncher_damageforcescale;
+ missile.health = autocvar_g_balance_rocketlauncher_health;
missile.event_damage = W_Rocket_Damage;
missile.movetype = MOVETYPE_FLY;
setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
setorigin (missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
- W_SetupProjectileVelocity(missile, cvar("g_balance_rocketlauncher_speedstart"), 0);
+ W_SetupProjectileVelocity(missile, autocvar_g_balance_rocketlauncher_speedstart, 0);
missile.angles = vectoangles (missile.velocity);
missile.touch = W_Rocket_Touch;
missile.think = W_Rocket_Think;
missile.nextthink = time;
- missile.cnt = time + cvar("g_balance_rocketlauncher_lifetime");
+ missile.cnt = time + autocvar_g_balance_rocketlauncher_lifetime;
missile.flags = FL_PROJECTILE;
- CSQCProjectile(missile, cvar("g_balance_rocketlauncher_guiderate") == 0 && cvar("g_balance_rocketlauncher_speedaccel") == 0, PROJECTILE_ROCKET, FALSE); // because of fly sound
+ CSQCProjectile(missile, autocvar_g_balance_rocketlauncher_guiderate == 0 && autocvar_g_balance_rocketlauncher_speedaccel == 0, PROJECTILE_ROCKET, FALSE); // because of fly sound
// muzzle flash for 1st person view
flash = spawn ();
if (req == WR_AIM)
{
// aim and decide to fire if appropriate
- self.BUTTON_ATCK = bot_aim(cvar("g_balance_rocketlauncher_speed"), 0, cvar("g_balance_rocketlauncher_lifetime"), FALSE);
+ self.BUTTON_ATCK = bot_aim(autocvar_g_balance_rocketlauncher_speed, 0, autocvar_g_balance_rocketlauncher_lifetime, FALSE);
if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
{
// decide whether to detonate rockets
local entity missile, targetlist, targ;
local float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
local float selfdamage, teamdamage, enemydamage;
- edgedamage = cvar("g_balance_rocketlauncher_edgedamage");
- coredamage = cvar("g_balance_rocketlauncher_damage");
- edgeradius = cvar("g_balance_rocketlauncher_radius");
+ edgedamage = autocvar_g_balance_rocketlauncher_edgedamage;
+ coredamage = autocvar_g_balance_rocketlauncher_damage;
+ edgeradius = autocvar_g_balance_rocketlauncher_radius;
recipricoledgeradius = 1 / edgeradius;
selfdamage = 0;
teamdamage = 0;
}
local float desirabledamage;
desirabledamage = enemydamage;
- if (teamplay != 1 && time > self.invincible_finished && time > self.spawnshieldtime)
- desirabledamage = desirabledamage - selfdamage * cvar("g_balance_selfdamagepercent");
- if (self.team && teamplay != 1)
+ if (time > self.invincible_finished && time > self.spawnshieldtime)
+ desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
+ if (teams_matter && self.team)
desirabledamage = desirabledamage - teamdamage;
missile = find(world, classname, "rocket");
{
if (self.BUTTON_ATCK)
{
- if(self.rl_release || cvar("g_balance_rocketlauncher_guidestop"))
- if(weapon_prepareattack(0, cvar("g_balance_rocketlauncher_refire")))
+ if(self.rl_release || autocvar_g_balance_rocketlauncher_guidestop)
+ if(weapon_prepareattack(0, autocvar_g_balance_rocketlauncher_refire))
{
W_Rocket_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_rocketlauncher_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_rocketlauncher_animtime, w_ready);
self.rl_release = 0;
}
}
{
// don't switch while guiding a missile
if ((ATTACK_FINISHED(self) <= time || self.weapon != WEP_ROCKET_LAUNCHER)
- && self.ammo_rockets < cvar("g_balance_rocketlauncher_ammo"))
+ && self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo)
return FALSE;
}
else if (req == WR_CHECKAMMO2)
REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 9, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "seeker", "seeker", "T.A.G. Seeker");
#else
#ifdef SVQC
-//.float speed; = switchweapon
//.float proxytime; = autoswitch
//.float tl; = wait
void Seeker_Missile_Explode ()
{
self.event_damage = SUB_Null;
- RadiusDamage (self, self.owner, cvar("g_balance_seeker_missile_damage"), cvar("g_balance_seeker_missile_edgedamage"), cvar("g_balance_seeker_missile_radius"), world, cvar("g_balance_seeker_missile_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.owner, autocvar_g_balance_seeker_missile_damage, autocvar_g_balance_seeker_missile_edgedamage, autocvar_g_balance_seeker_missile_radius, world, autocvar_g_balance_seeker_missile_force, self.projectiledeathtype, other);
remove (self);
}
vector desireddir, olddir, newdir, eorg;
float turnrate;
float dist;
+ float spd;
if (time > self.cnt)
{
Seeker_Missile_Explode();
}
- if (!self.switchweapon)
- self.switchweapon = cvar("g_balance_seeker_missile_speed");
-
- if ((self.switchweapon < cvar("g_balance_seeker_missile_speed_max")) && cvar("g_balance_seeker_missile_speed_accel"))
- self.switchweapon = self.switchweapon * cvar("g_balance_seeker_missile_accel");
-
- if (self.switchweapon > cvar("g_balance_seeker_missile_speed_max"))
- self.switchweapon = self.switchweapon * cvar("g_balance_seeker_missile_decel");
+ spd = vlen(self.velocity);
+ spd = bound(
+ spd - autocvar_g_balance_seeker_missile_decel * frametime,
+ autocvar_g_balance_seeker_missile_speed_max,
+ spd + autocvar_g_balance_seeker_missile_accel * frametime
+ );
if (self.enemy != world)
if (self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
{
e = self.enemy;
eorg = 0.5 * (e.absmin + e.absmax);
- turnrate = cvar("g_balance_seeker_missile_turnrate"); // how fast to turn
+ turnrate = autocvar_g_balance_seeker_missile_turnrate; // how fast to turn
desireddir = normalize(eorg - self.origin);
olddir = normalize(self.velocity); // get my current direction
dist = vlen(eorg - self.origin);
// Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
- if (cvar("g_balance_seeker_missile_smart") && (dist > cvar("g_balance_seeker_missile_smart_mindist")))
+ if (autocvar_g_balance_seeker_missile_smart && (dist > autocvar_g_balance_seeker_missile_smart_mindist))
{
// Is it a better idea (shorter distance) to trace to the target itself?
if ( vlen(self.origin + olddir * self.wait) < dist)
traceline(self.origin, eorg, FALSE, self);
// Setup adaptive tracelength
- self.wait = bound(cvar("g_balance_seeker_missile_smart_trace_min"), vlen(self.origin - trace_endpos), self.wait = cvar("g_balance_seeker_missile_smart_trace_max"));
+ self.wait = bound(autocvar_g_balance_seeker_missile_smart_trace_min, vlen(self.origin - trace_endpos), self.wait = autocvar_g_balance_seeker_missile_smart_trace_max);
// Calc how important it is that we turn and add this to the desierd (enemy) dir.
desireddir = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
}
newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
- self.velocity = newdir * self.switchweapon; // make me fly in the new direction at my flight speed
+ self.velocity = newdir * spd; // make me fly in the new direction at my flight speed
}
// Proxy
- if (cvar("g_balance_seeker_missile_proxy"))
+ if (autocvar_g_balance_seeker_missile_proxy)
{
- if ( dist <= cvar("g_balance_seeker_missile_proxy_maxrange"))
+ if ( dist <= autocvar_g_balance_seeker_missile_proxy_maxrange)
{
if (self.autoswitch == 0)
{
- self.autoswitch = time + cvar("g_balance_seeker_missile_proxy_delay");
+ self.autoswitch = time + autocvar_g_balance_seeker_missile_proxy_delay;
}
else
{
self.think = Seeker_Missile_Think;
self.nextthink = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
- if (cvar("g_balance_seeker_missile_proxy"))
+ if (autocvar_g_balance_seeker_missile_proxy)
self.movetype = MOVETYPE_BOUNCEMISSILE;
else
self.movetype = MOVETYPE_FLYMISSILE;
{
local entity missile;
- if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_missile_ammo");
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_seeker_missile_ammo;
makevectors(self.v_angle);
W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", CHAN_WEAPON, 0);
missile.owner = self;
missile.classname = "seeker_missile";
missile.bot_dodge = TRUE;
- missile.bot_dodgerating = cvar("g_balance_seeker_missile_damage");
+ missile.bot_dodgerating = autocvar_g_balance_seeker_missile_damage;
missile.think = Seeker_Missile_Think;
missile.touch = Seeker_Missile_Touch;
missile.event_damage = Seeker_Missile_Damage;
missile.nextthink = time;// + 0.2;// + cvar("g_balance_seeker_missile_activate_delay");
- missile.cnt = time + cvar("g_balance_seeker_missile_lifetime");
+ missile.cnt = time + autocvar_g_balance_seeker_missile_lifetime;
missile.enemy = self.enemy;
missile.solid = SOLID_BBOX;
missile.scale = 2;
missile.takedamage = DAMAGE_YES;
- missile.health = cvar("g_balance_seeker_missile_health");
- missile.damageforcescale = cvar("g_balance_seeker_missile_damageforcescale");
+ missile.health = autocvar_g_balance_seeker_missile_health;
+ missile.damageforcescale = autocvar_g_balance_seeker_missile_damageforcescale;
missile.projectiledeathtype = WEP_SEEKER;
//missile.think = Seeker_Missile_Animate; // csqc projectiles.
missile.flags = FL_PROJECTILE;
W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_missile);
- missile.switchweapon = vlen(missile.velocity);
missile.angles = vectoangles (missile.velocity);
CSQCProjectile(missile, FALSE, PROJECTILE_SEEKER, TRUE);
entity oldself,oldenemy;
self.cnt = self.cnt - 1;
- if((!(self.owner.items & IT_UNLIMITED_AMMO) && self.owner.ammo_rockets < cvar("g_balance_seeker_missile_ammo")) || (self.cnt <= -1) || (self.owner.deadflag != DEAD_NO))
+ if((!(self.owner.items & IT_UNLIMITED_AMMO) && self.owner.ammo_rockets < autocvar_g_balance_seeker_missile_ammo) || (self.cnt <= -1) || (self.owner.deadflag != DEAD_NO) || (self.owner.switchweapon != WEP_SEEKER))
{
remove(self);
return;
}
- self.nextthink = time + cvar("g_balance_seeker_missile_delay");
+ self.nextthink = time + autocvar_g_balance_seeker_missile_delay;
oldself = self;
self = self.owner;
if (other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
{
e = spawn();
- e.cnt = cvar("g_balance_seeker_missile_count");
+ e.cnt = autocvar_g_balance_seeker_missile_count;
e.owner = self.owner;
e.enemy = other;
e.think = Seeker_Vollycontroler_Think;
{
local entity missile;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_tag_ammo");
+ self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_seeker_tag_ammo;
- W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CHAN_WEAPON, cvar("g_balance_seeker_missile_damage") * cvar("g_balance_seeker_missile_count"));
+ W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CHAN_WEAPON, autocvar_g_balance_seeker_missile_damage * autocvar_g_balance_seeker_missile_count);
missile = spawn();
missile.owner = self;
missile.bot_dodgerating = 50;
missile.touch = Seeker_Tag_Touch;
missile.think = SUB_Remove;
- missile.nextthink = time + cvar("g_balance_seeker_tag_lifetime");
+ missile.nextthink = time + autocvar_g_balance_seeker_tag_lifetime;
missile.movetype = MOVETYPE_FLY;
missile.solid = SOLID_BBOX;
missile.owner = self;
missile.takedamage = DAMAGE_YES;
missile.event_damage = Seeker_Tag_Explode;
- missile.health = cvar("g_balance_seeker_tag_health");
- missile.damageforcescale = cvar("g_balance_seeker_tag_damageforcescale");
+ missile.health = autocvar_g_balance_seeker_tag_health;
+ missile.damageforcescale = autocvar_g_balance_seeker_tag_damageforcescale;
setorigin (missile, w_shotorg);
setsize (missile, '-2 -2 -2', '2 2 2');
{
self.event_damage = SUB_Null;
- RadiusDamage (self, self.owner, cvar("g_balance_seeker_flac_damage"), cvar("g_balance_seeker_flac_edgedamage"), cvar("g_balance_seeker_flac_radius"), world, cvar("g_balance_seeker_flac_force"), self.projectiledeathtype, other);
+ RadiusDamage (self, self.owner, autocvar_g_balance_seeker_flac_damage, autocvar_g_balance_seeker_flac_edgedamage, autocvar_g_balance_seeker_flac_radius, world, autocvar_g_balance_seeker_flac_force, self.projectiledeathtype, other);
remove (self);
}
float c;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_flac_ammo");
+ self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_seeker_flac_ammo;
c = mod(self.bulletcounter, 4);
switch(c)
f_diff = '+1.25 +3.75 0';
break;
}
- W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CHAN_WEAPON, cvar("g_balance_seeker_flac_damage"));
+ W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CHAN_WEAPON, autocvar_g_balance_seeker_flac_damage);
w_shotorg += f_diff;
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile.owner = missile.realowner = self;
missile.classname = "missile";
missile.bot_dodge = TRUE;
- missile.bot_dodgerating = cvar("g_balance_seeker_flac_damage");
+ missile.bot_dodgerating = autocvar_g_balance_seeker_flac_damage;
missile.touch = Seeker_Flac_Explode;
missile.use = Seeker_Flac_Explode;
missile.think = adaptor_think2use_hittype_splash;
- missile.nextthink = time + cvar("g_balance_seeker_flac_lifetime") + cvar("g_balance_seeker_flac_lifetime_rand");
+ missile.nextthink = time + autocvar_g_balance_seeker_flac_lifetime + autocvar_g_balance_seeker_flac_lifetime_rand;
missile.solid = SOLID_BBOX;
missile.movetype = MOVETYPE_FLY;
missile.projectiledeathtype = WEP_SEEKER;
float w_seeker(float req)
{
if (req == WR_AIM)
- self.BUTTON_ATCK = bot_aim(cvar("g_balance_seeker_tag_speed"), 0, 20, FALSE);
+ self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_tag_speed, 0, 20, FALSE);
else if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, cvar("g_balance_seeker_tag_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire))
{
Seeker_Fire_Tag();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_seeker_tag_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_seeker_tag_animtime, w_ready);
}
if (self.BUTTON_ATCK2)
- if (weapon_prepareattack(1, cvar("g_balance_seeker_flac_refire")))
+ if (weapon_prepareattack(1, autocvar_g_balance_seeker_flac_refire))
{
Seeker_Fire_Flac();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_seeker_flac_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_flac_animtime, w_ready);
}
}
else if (req == WR_SETUP)
weapon_setup(WEP_SEEKER);
else if (req == WR_CHECKAMMO1)
- return self.ammo_rockets >= cvar("g_balance_seeker_tag_ammo") + cvar("g_balance_seeker_missile_ammo");
+ return self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo + autocvar_g_balance_seeker_missile_ammo;
else if (req == WR_CHECKAMMO2)
- return self.ammo_rockets >= cvar("g_balance_seeker_flac_ammo");
+ return self.ammo_rockets >= autocvar_g_balance_seeker_flac_ammo;
return TRUE;
};
#endif
float bulletconstant;
local entity flash;
- ammoamount = cvar("g_balance_shotgun_primary_ammo");
- bullets = cvar("g_balance_shotgun_primary_bullets");
- d = cvar("g_balance_shotgun_primary_damage");
- f = cvar("g_balance_shotgun_primary_force");
- spread = cvar("g_balance_shotgun_primary_spread");
- bulletspeed = cvar("g_balance_shotgun_primary_speed");
- bulletconstant = cvar("g_balance_shotgun_primary_bulletconstant");
-
- W_SetupShot (self, cvar("g_antilag_bullets") && bulletspeed >= cvar("g_antilag_bullets"), 5, "weapons/shotgun_fire.wav", CHAN_WEAPON, d * bullets);
+ ammoamount = autocvar_g_balance_shotgun_primary_ammo;
+ bullets = autocvar_g_balance_shotgun_primary_bullets;
+ d = autocvar_g_balance_shotgun_primary_damage;
+ f = autocvar_g_balance_shotgun_primary_force;
+ spread = autocvar_g_balance_shotgun_primary_spread;
+ bulletspeed = autocvar_g_balance_shotgun_primary_speed;
+ bulletconstant = autocvar_g_balance_shotgun_primary_bulletconstant;
+
+ W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CHAN_WEAPON, d * bullets);
for (sc = 0;sc < bullets;sc = sc + 1)
fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN, 0, 1, bulletconstant);
endFireBallisticBullet();
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_shells = self.ammo_shells - ammoamount;
- pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, cvar("g_balance_shotgun_primary_ammo"));
+ pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, autocvar_g_balance_shotgun_primary_ammo);
// casing code
- if (cvar("g_casings") >= 1)
+ if (autocvar_g_casings >= 1)
for (sc = 0;sc < ammoamount;sc = sc + 1)
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1, self);
// perform trace
float f;
- f = (self.cnt + cvar("g_balance_shotgun_secondary_melee_time") - time) / cvar("g_balance_shotgun_secondary_melee_time") * 2 - 1;
+ f = (self.cnt + autocvar_g_balance_shotgun_secondary_melee_time - time) / autocvar_g_balance_shotgun_secondary_melee_time * 2 - 1;
vector targpos;
- targpos = self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_shotgun_secondary_melee_range") + v_right * f * cvar("g_balance_shotgun_secondary_melee_swing") + v_up * f * cvar("g_balance_shotgun_secondary_melee_swing");
+ targpos = self.owner.origin + self.owner.view_ofs + angle * autocvar_g_balance_shotgun_secondary_melee_range + v_right * f * autocvar_g_balance_shotgun_secondary_melee_swing + v_up * f * autocvar_g_balance_shotgun_secondary_melee_swing;
WarpZone_traceline_antilag(self.owner, self.owner.origin + self.owner.view_ofs, targpos, FALSE, self.owner, ANTILAG_LATENCY(self.owner));
if(trace_fraction < 1 && trace_ent.takedamage == DAMAGE_AIM && (trace_ent.classname == "player" || trace_ent.classname == "body"))
{
vector force;
- force = angle * cvar("g_balance_shotgun_secondary_force");
+ force = angle * autocvar_g_balance_shotgun_secondary_force;
if(accuracy_isgooddamage(self.owner, trace_ent))
- accuracy_add(self.owner, WEP_SHOTGUN, 0, cvar("g_balance_shotgun_secondary_damage") * min(1, f + 1));
- 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);
+ accuracy_add(self.owner, WEP_SHOTGUN, 0, autocvar_g_balance_shotgun_secondary_damage * min(1, f + 1));
+ Damage (trace_ent, self.owner, self.owner, autocvar_g_balance_shotgun_secondary_damage * min(1, f + 1), WEP_SHOTGUN | HITTYPE_SECONDARY , self.owner.origin + self.owner.view_ofs, force);
remove(self);
}
- else if(time >= self.cnt + cvar("g_balance_shotgun_secondary_melee_time")) // missed, remove ent
+ else if(time >= self.cnt + autocvar_g_balance_shotgun_secondary_melee_time) // missed, remove ent
remove(self);
else // continue swinging the weapon in hope of hitting someone :)
self.nextthink = time;
void W_Shotgun_Attack2 (void)
{
sound (self, CHAN_PROJECTILE, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_shotgun_secondary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_shotgun_secondary_animtime, w_ready);
entity meleetemp;
meleetemp = spawn();
meleetemp.owner = self;
meleetemp.think = shotgun_meleethink;
- meleetemp.nextthink = time + cvar("g_balance_shotgun_secondary_melee_delay");
- W_SetupShot_Range(self, TRUE, 0, "", 0, cvar("g_balance_shotgun_secondary_damage"), cvar("g_balance_shotgun_secondary_melee_range"));
+ meleetemp.nextthink = time + autocvar_g_balance_shotgun_secondary_melee_delay;
+ W_SetupShot_Range(self, TRUE, 0, "", 0, autocvar_g_balance_shotgun_secondary_damage, autocvar_g_balance_shotgun_secondary_melee_range);
}
void spawnfunc_weapon_shotgun(); // defined in t_items.qc
float w_shotgun(float req)
{
if (req == WR_AIM)
- if(vlen(self.origin-self.enemy.origin)>200)
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
- else
+ if(vlen(self.origin-self.enemy.origin) <= autocvar_g_balance_shotgun_secondary_melee_range)
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
+ else
+ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
else if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
{
if (time >= self.shotgun_primarytime) // handle refire separately so the secondary can be fired straight after a primary
{
- if(weapon_prepareattack(0, cvar("g_balance_shotgun_primary_animtime")))
+ if(weapon_prepareattack(0, autocvar_g_balance_shotgun_primary_animtime))
{
W_Shotgun_Attack();
- self.shotgun_primarytime = time + cvar("g_balance_shotgun_primary_refire");
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_primary_animtime"), w_ready);
+ self.shotgun_primarytime = time + autocvar_g_balance_shotgun_primary_refire;
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_shotgun_primary_animtime, w_ready);
}
}
}
- if (self.BUTTON_ATCK2 && cvar("g_balance_shotgun_secondary"))
- if (weapon_prepareattack(1, cvar("g_balance_shotgun_secondary_refire")))
+ if (self.BUTTON_ATCK2 && autocvar_g_balance_shotgun_secondary)
+ if (weapon_prepareattack(1, autocvar_g_balance_shotgun_secondary_refire))
{
// attempt forcing playback of the anim by switching to another anim (that we never play) here...
weapon_thinkf(WFRAME_FIRE1, 0, W_Shotgun_Attack2);
else if (req == WR_SETUP)
weapon_setup(WEP_SHOTGUN);
else if (req == WR_CHECKAMMO1)
- return self.ammo_shells >= cvar("g_balance_shotgun_primary_ammo");
+ return self.ammo_shells >= autocvar_g_balance_shotgun_primary_ammo;
else if (req == WR_CHECKAMMO2)
{
return TRUE;
return;
}
self.nextthink = time;
- dist_mult = cvar("g_balance_tuba_attenuation") / cvar("snd_soundradius");
+ dist_mult = autocvar_g_balance_tuba_attenuation / autocvar_snd_soundradius;
FOR_EACH_REALCLIENT(e)
if(e != self.owner)
{
{
vector o;
float c, n;
- W_SetupShot(self, FALSE, 2, "", 0, cvar("g_balance_tuba_damage"));
+ W_SetupShot(self, FALSE, 2, "", 0, autocvar_g_balance_tuba_damage);
if(self.tuba_notecount)
{
self.tuba_notecount = FALSE;
Net_LinkEntity(self.tuba_note, FALSE, 0, W_Tuba_NoteSendEntity);
}
- self.tuba_note.teleport_time = time + cvar("g_balance_tuba_refire") * 2; // so it can get prolonged safely
+ self.tuba_note.teleport_time = time + autocvar_g_balance_tuba_refire * 2; // so it can get prolonged safely
- //sound(self, c, TUBA_NOTE(n), bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1), cvar("g_balance_tuba_attenuation"));
- RadiusDamage(self, self, cvar("g_balance_tuba_damage"), cvar("g_balance_tuba_edgedamage"), cvar("g_balance_tuba_radius"), world, cvar("g_balance_tuba_force"), hittype | WEP_TUBA, world);
+ //sound(self, c, TUBA_NOTE(n), bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1), autocvar_g_balance_tuba_attenuation);
+ RadiusDamage(self, self, autocvar_g_balance_tuba_damage, autocvar_g_balance_tuba_edgedamage, autocvar_g_balance_tuba_radius, world, autocvar_g_balance_tuba_force, hittype | WEP_TUBA, world);
o = gettaginfo(self.exteriorweaponentity, 0);
if(time > self.tuba_smoketime)
{
// bots cannot play the Tuba well yet
// I think they should start with the recorder first
- if(vlen(self.origin - self.enemy.origin) < cvar("g_balance_tuba_radius"))
+ if(vlen(self.origin - self.enemy.origin) < autocvar_g_balance_tuba_radius)
{
if(random() > 0.5)
self.BUTTON_ATCK = 1;
else if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, cvar("g_balance_tuba_refire")))
+ if (weapon_prepareattack(0, autocvar_g_balance_tuba_refire))
{
W_Tuba_Attack(0);
- //weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_tuba_animtime"), w_ready);
- weapon_thinkf(WFRAME_IDLE, cvar("g_balance_tuba_animtime"), w_ready);
+ //weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_tuba_animtime, w_ready);
+ weapon_thinkf(WFRAME_IDLE, autocvar_g_balance_tuba_animtime, w_ready);
}
if (self.BUTTON_ATCK2)
- if (weapon_prepareattack(1, cvar("g_balance_tuba_refire")))
+ if (weapon_prepareattack(1, autocvar_g_balance_tuba_refire))
{
W_Tuba_Attack(HITTYPE_SECONDARY);
- //weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_tuba_animtime"), w_ready);
- weapon_thinkf(WFRAME_IDLE, cvar("g_balance_tuba_animtime"), w_ready);
+ //weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_tuba_animtime, w_ready);
+ weapon_thinkf(WFRAME_IDLE, autocvar_g_balance_tuba_animtime, w_ready);
}
if(self.tuba_note)
{
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
if (self.uzi_bulletcounter == 1)
- self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_first_ammo");
+ self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_first_ammo;
else
- self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_sustained_ammo");
+ self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_sustained_ammo;
}
- W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.uzi_bulletcounter == 1) ? cvar("g_balance_uzi_first_damage") : cvar("g_balance_uzi_sustained_damage")));
+ W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.uzi_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;
}
// this attack_finished just enforces a cooldown at the end of a burst
- ATTACK_FINISHED(self) = time + cvar("g_balance_uzi_first_refire") * W_WeaponRateFactor();
+ ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
if (self.uzi_bulletcounter == 1)
- fireBallisticBullet(w_shotorg, w_shotdir, cvar("g_balance_uzi_first_spread"), cvar("g_balance_uzi_speed"), 5, cvar("g_balance_uzi_first_damage"), 0, cvar("g_balance_uzi_first_force"), deathtype, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, 0, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
else
- fireBallisticBullet(w_shotorg, w_shotdir, cvar("g_balance_uzi_sustained_spread"), cvar("g_balance_uzi_speed"), 5, cvar("g_balance_uzi_sustained_damage"), 0, cvar("g_balance_uzi_sustained_force"), deathtype, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
W_AttachToShotorg(self.muzzle_flash, '5 0 0');
// casing code
- if (cvar("g_casings") >= 2)
+ if (autocvar_g_casings >= 2)
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
}
}
self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
W_Uzi_Attack(WEP_UZI);
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_sustained_refire"), uzi_fire1_02);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
}
else
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_sustained_refire"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, w_ready);
}
float uzi_spread;
if (self.BUTTON_ATCK)
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_sustained_refire"), uzi_mode1_fire_auto);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_mode1_fire_auto);
else
{
- ATTACK_FINISHED(self) = time + cvar("g_balance_uzi_first_refire") * W_WeaponRateFactor();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_sustained_refire"), w_ready);
+ ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, w_ready);
return;
}
return;
}
- W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", CHAN_WEAPON, cvar("g_balance_uzi_sustained_damage"));
+ W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, autocvar_g_balance_uzi_sustained_damage);
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;
self.punchangle_y = random () - 0.5;
}
- uzi_spread = bound(cvar("g_balance_uzi_spread_min"), cvar("g_balance_uzi_spread_min") + (cvar("g_balance_uzi_spread_add") * self.uzi_bulletcounter), cvar("g_balance_uzi_spread_max"));
- fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, cvar("g_balance_uzi_speed"), 5, cvar("g_balance_uzi_sustained_damage"), 0, cvar("g_balance_uzi_sustained_force"), WEP_UZI, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+ uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.uzi_bulletcounter), autocvar_g_balance_uzi_spread_max);
+ fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
UziFlash();
W_AttachToShotorg(self.muzzle_flash, '5 0 0');
- if (cvar("g_casings") >= 2) // casing code
+ if (autocvar_g_casings >= 2) // casing code
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_sustained_ammo");
+ self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_sustained_ammo;
}
void uzi_mode1_fire_burst()
{
- W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", CHAN_WEAPON, cvar("g_balance_uzi_sustained_damage"));
+ W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, autocvar_g_balance_uzi_sustained_damage);
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;
self.punchangle_y = random () - 0.5;
}
- fireBallisticBullet(w_shotorg, w_shotdir, cvar("g_balance_uzi_burst_spread"), cvar("g_balance_uzi_speed"), 5, cvar("g_balance_uzi_sustained_damage"), 0, cvar("g_balance_uzi_sustained_force"), WEP_UZI, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
UziFlash();
W_AttachToShotorg(self.muzzle_flash, '5 0 0');
- if (cvar("g_casings") >= 2) // casing code
+ if (autocvar_g_casings >= 2) // casing code
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
if (self.uzi_bulletcounter == 0)
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_uzi_burst_refire2"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire2, w_ready);
else
{
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_uzi_burst_refire"), uzi_mode1_fire_burst);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire, uzi_mode1_fire_burst);
dprint("bullets:", ftos(self.uzi_bulletcounter),"\n");
}
}
else if (req == WR_THINK)
{
- if(cvar("g_balance_uzi_mode") == 1)
+ if(autocvar_g_balance_uzi_mode == 1)
{
if (self.BUTTON_ATCK)
if (weapon_prepareattack(0, 0))
}
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_burst_ammo");
+ self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_burst_ammo;
- self.uzi_bulletcounter = cvar("g_balance_uzi_burst") * -1;
+ self.uzi_bulletcounter = autocvar_g_balance_uzi_burst * -1;
uzi_mode1_fire_burst();
}
}
{
self.uzi_bulletcounter = 1;
W_Uzi_Attack(WEP_UZI); // sets attack_finished
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_sustained_refire"), uzi_fire1_02);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
}
- if (self.BUTTON_ATCK2 && cvar("g_balance_uzi_first"))
+ if (self.BUTTON_ATCK2 && autocvar_g_balance_uzi_first)
if (weapon_prepareattack(1, 0))
{
self.uzi_bulletcounter = 1;
W_Uzi_Attack(WEP_UZI | HITTYPE_SECONDARY); // sets attack_finished
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_uzi_first_refire"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_first_refire, w_ready);
}
}
}
else if (req == WR_SETUP)
weapon_setup(WEP_UZI);
else if (req == WR_CHECKAMMO1)
- if(cvar("g_balance_uzi_mode") == 1)
- return self.ammo_nails >= cvar("g_balance_uzi_sustained_ammo");
+ if(autocvar_g_balance_uzi_mode == 1)
+ return self.ammo_nails >= autocvar_g_balance_uzi_sustained_ammo;
else
- return self.ammo_nails >= cvar("g_balance_uzi_first_ammo");
+ return self.ammo_nails >= autocvar_g_balance_uzi_first_ammo;
else if (req == WR_CHECKAMMO2)
- if(cvar("g_balance_uzi_mode") == 1)
- return self.ammo_nails >= cvar("g_balance_uzi_burst_ammo");
+ if(autocvar_g_balance_uzi_mode == 1)
+ return self.ammo_nails >= autocvar_g_balance_uzi_burst_ammo;
else
- return self.ammo_nails >= cvar("g_balance_uzi_first_ammo");
+ return self.ammo_nails >= autocvar_g_balance_uzi_first_ammo;
return TRUE;
};
#endif
float waypointsprite_limitedrange, waypointsprite_deployed_lifetime, waypointsprite_deadlifetime;
void WaypointSprite_Init()
{
- waypointsprite_limitedrange = cvar("g_waypointsprite_limitedrange");
- waypointsprite_deployed_lifetime = cvar("g_waypointsprite_deployed_lifetime");
- waypointsprite_deadlifetime = cvar("g_waypointsprite_deadlifetime");
+ waypointsprite_limitedrange = autocvar_g_waypointsprite_limitedrange;
+ waypointsprite_deployed_lifetime = autocvar_g_waypointsprite_deployed_lifetime;
+ waypointsprite_deadlifetime = autocvar_g_waypointsprite_deadlifetime;
}
void WaypointSprite_InitClient(entity e)
{
e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, FALSE);
if(e)
{
- WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, cvar("g_balance_armor_blockpercent")) * 2);
- WaypointSprite_UpdateHealth(e, '1 0 0' * healtharmor_maxdamage(carrier.health, carrier.armorvalue, cvar("g_balance_armor_blockpercent")));
+ WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent) * 2);
+ WaypointSprite_UpdateHealth(e, '1 0 0' * healtharmor_maxdamage(carrier.health, carrier.armorvalue, autocvar_g_balance_armor_blockpercent));
}
return e;
}
entity wz;
vector vf, vr, vu;
+ WarpZone_trace_firstzone = world;
+ WarpZone_trace_lastzone = world;
WarpZone_Trace_InitTransform();
if(!warpzone_warpzones_exist)
{
wz = WarpZone_Find(org + mi, org + ma);
if(wz)
{
+ WarpZone_trace_firstzone = wz;
+ WarpZone_trace_lastzone = wz;
if(zone && wz != zone)
{
// we are in ANOTHER warpzone. This is bad. Make a zero length trace and return.
}
if(trace_ent == wz)
{
+ // FIXME can this check be removed? Do we really need it?
dprint("I transformed into the same zone again, wtf, aborting the trace\n");
trace_ent = world;
break;
}
wz = trace_ent;
+ if(!WarpZone_trace_firstzone)
+ WarpZone_trace_firstzone = wz;
+ WarpZone_trace_lastzone = wz;
if(zone && wz != zone)
break;
WarpZone_Trace_AddTransform(wz);
o0 = e.origin;
v0 = e.velocity;
+ WarpZone_trace_firstzone = world;
+ WarpZone_trace_lastzone = world;
WarpZone_Trace_InitTransform();
WarpZone_tracetoss_time = 0;
if(!warpzone_warpzones_exist)
wz = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
if(wz)
{
+ WarpZone_trace_firstzone = wz;
+ WarpZone_trace_lastzone = wz;
if(zone && wz != zone)
{
// we are in ANOTHER warpzone. This is bad. Make a zero length trace and return.
break;
if(trace_ent == wz)
{
+ // FIXME can this check be removed? Do we really need it?
dprint("I transformed into the same zone again, wtf, aborting the trace\n");
trace_ent = world;
break;
}
wz = trace_ent;
+ if(!WarpZone_trace_firstzone)
+ WarpZone_trace_firstzone = wz;
+ WarpZone_trace_lastzone = wz;
if(zone && wz != zone)
break;
WarpZone_Trace_AddTransform(wz);
typedef void(vector start, vector hit, vector end) WarpZone_trace_callback_t; // called on every elementary trace
const var WarpZone_trace_callback_t WarpZone_trace_callback_t_null;
entity WarpZone_trace_transform; // transform accumulator during a trace
+entity WarpZone_trace_firstzone; // first warpzone hit by a trace (can differ from the requested zone in case of _ThroughZone, the trace is aborted then)
+entity WarpZone_trace_lastzone; // first warpzone hit by a trace (can differ from the requested zone in case of _ThroughZone, the trace is aborted then)
vector WarpZone_tracetoss_velocity; // ending velocity of a tracetoss (post-transform)
float WarpZone_tracetoss_time; // duration of toss (approximate)
void WarpZone_TraceBox(vector org, vector min, vector max, vector end, float nomonsters, entity forent);
exec data/campaign.cfg
exec config_update.cfg
exec autoexec.cfg
-exec font-nimbussansl.cfg
stuffcmds
//startdemos demos/demo1 demos/demo2 demos/demo3
//startdemos
fraglimit_override 0
timelimit_override 3
sv_eventlog 1
-g_nix 1
-g_nix_with_laser 1
-g_balance_nix_roundtime 3
-map downer
+g_weaponarena all
+g_weaponarena_random 2
+map g-23
-// time darkplaces/xonotic-dedicated +exec serverbench.cfg | grep ^: > serverbench.log
+// time ./all run +exec serverbench.cfg | grep ^: > serverbench.log
// on Linux/Ubuntu, this should always yield a file with the md5sum
// OMG! Its the Evil Wheel! :O
exec unit_ewheel.cfg
-//
-exec unit_repulsor.cfg
+// It is so repulsive, it doesn't even exist!
+// exec unit_repulsor.cfg
set g_turrets_reloadcvars 0 // reload when this cfg has been exec'd
alias g_turrets_reload "set g_turrets_reloadcvars 1"
*3D Art
morphed
+*Concept Art
+LJFHutch
+theShadow
+
*Level Design
FruitieX
MirceaKitsune