- wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
- wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
- make
- - EXPECT=6535600492e1cb63af8e449570bffe4a
+ - EXPECT=a98e5e5ee0cc3d2e80ee0ad812786703
- HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
| tee /dev/stderr
| grep '^:'
-Fri Mar 6 07:24:27 CET 2020
+Wed Apr 8 07:24:18 CEST 2020
seta hud_progressbar_health_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_armor_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_fuel_color "" "R G B vector of the progress bar background color"
+seta hud_progressbar_oxygen_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_nexball_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_speed_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_acceleration_color "" "R G B vector of the progress bar background color"
seta hud_panel_centerprint_align "" "text alignment: 0 left, 0.5 center, 1 right"
seta hud_panel_centerprint_flip "" "invert messages order"
seta hud_panel_centerprint_fontscale "" "scale the text font by this amount"
+seta hud_panel_centerprint_fontscale_bold "" "scale the bold text font by this amount"
seta hud_panel_centerprint_time "" "message duration (NOTE: certain messages have a fixed duration)"
seta hud_panel_centerprint_fade_in "" "how long a message takes to fade in"
seta hud_panel_centerprint_fade_out "" "how long a message takes to fade out (this time is included in the message duration and can't be > 5)"
+++ /dev/null
-// {{{ #1: Blaster
-set g_balance_blaster_primary_animtime 0.1
-set g_balance_blaster_primary_damage 20
-set g_balance_blaster_primary_delay 0
-set g_balance_blaster_primary_edgedamage 10
-set g_balance_blaster_primary_force 375
-set g_balance_blaster_primary_force_zscale 1
-set g_balance_blaster_primary_lifetime 5
-set g_balance_blaster_primary_radius 60
-set g_balance_blaster_primary_refire 0.7
-set g_balance_blaster_primary_shotangle 0
-set g_balance_blaster_primary_speed 6000
-set g_balance_blaster_primary_spread 0
-set g_balance_blaster_secondary 0
-set g_balance_blaster_secondary_animtime 0.2
-set g_balance_blaster_secondary_damage 25
-set g_balance_blaster_secondary_delay 0
-set g_balance_blaster_secondary_edgedamage 12.5
-set g_balance_blaster_secondary_force 360
-set g_balance_blaster_secondary_force_zscale 1
-set g_balance_blaster_secondary_lifetime 5
-set g_balance_blaster_secondary_radius 70
-set g_balance_blaster_secondary_refire 0.7
-set g_balance_blaster_secondary_shotangle 0
-set g_balance_blaster_secondary_speed 6000
-set g_balance_blaster_secondary_spread 0
-set g_balance_blaster_switchdelay_drop 0.1
-set g_balance_blaster_switchdelay_raise 0.1
-set g_balance_blaster_weaponreplace ""
-set g_balance_blaster_weaponstart 1
-set g_balance_blaster_weaponstartoverride -1
-set g_balance_blaster_weaponthrowable 0
-// }}}
-// {{{ #2: Shotgun
-set g_balance_shotgun_primary_ammo 1
-set g_balance_shotgun_primary_animtime 0.2
-set g_balance_shotgun_primary_bullets 12
-set g_balance_shotgun_primary_damage 4
-set g_balance_shotgun_primary_force 15
-set g_balance_shotgun_primary_refire 0.75
-set g_balance_shotgun_primary_solidpenetration 3.8
-set g_balance_shotgun_primary_spread 0.12
-set g_balance_shotgun_reload_ammo 0
-set g_balance_shotgun_reload_time 2
-set g_balance_shotgun_secondary 1
-set g_balance_shotgun_secondary_alt_animtime 0.2
-set g_balance_shotgun_secondary_alt_refire 1.2
-set g_balance_shotgun_secondary_animtime 1.15
-set g_balance_shotgun_secondary_damage 70
-set g_balance_shotgun_secondary_force 200
-set g_balance_shotgun_secondary_melee_delay 0.25
-set g_balance_shotgun_secondary_melee_multihit 1
-set g_balance_shotgun_secondary_melee_no_doubleslap 1
-set g_balance_shotgun_secondary_melee_nonplayerdamage 40
-set g_balance_shotgun_secondary_melee_range 120
-set g_balance_shotgun_secondary_melee_swing_side 120
-set g_balance_shotgun_secondary_melee_swing_up 30
-set g_balance_shotgun_secondary_melee_time 0.15
-set g_balance_shotgun_secondary_melee_traces 10
-set g_balance_shotgun_secondary_refire 1.25
-set g_balance_shotgun_switchdelay_drop 0.2
-set g_balance_shotgun_switchdelay_raise 0.2
-set g_balance_shotgun_weaponreplace ""
-set g_balance_shotgun_weaponstart 1
-set g_balance_shotgun_weaponstartoverride -1
-set g_balance_shotgun_weaponthrowable 1
-// }}}
-// {{{ #3: MachineGun
-set g_balance_machinegun_burst 3
-set g_balance_machinegun_burst_ammo 3
-set g_balance_machinegun_burst_animtime 0.3
-set g_balance_machinegun_burst_refire 0.06
-set g_balance_machinegun_burst_refire2 0.45
-set g_balance_machinegun_burst_spread 0
-set g_balance_machinegun_first 1
-set g_balance_machinegun_first_ammo 1
-set g_balance_machinegun_first_damage 14
-set g_balance_machinegun_first_force 3
-set g_balance_machinegun_first_refire 0.125
-set g_balance_machinegun_first_spread 0.03
-set g_balance_machinegun_mode 1
-set g_balance_machinegun_reload_ammo 60
-set g_balance_machinegun_reload_time 2
-set g_balance_machinegun_solidpenetration 13.1
-set g_balance_machinegun_spread_add 0.012
-set g_balance_machinegun_spread_max 0.05
-set g_balance_machinegun_spread_min 0.02
-set g_balance_machinegun_sustained_ammo 1
-set g_balance_machinegun_sustained_damage 10
-set g_balance_machinegun_sustained_force 3
-set g_balance_machinegun_sustained_refire 0.1
-set g_balance_machinegun_sustained_spread 0.03
-set g_balance_machinegun_switchdelay_drop 0.2
-set g_balance_machinegun_switchdelay_raise 0.2
-set g_balance_machinegun_weaponreplace ""
-set g_balance_machinegun_weaponstart 0
-set g_balance_machinegun_weaponstartoverride -1
-set g_balance_machinegun_weaponthrowable 1
-// }}}
-// {{{ #4: Mortar
-set g_balance_mortar_bouncefactor 0.5
-set g_balance_mortar_bouncestop 0.075
-set g_balance_mortar_primary_ammo 2
-set g_balance_mortar_primary_animtime 0.3
-set g_balance_mortar_primary_damage 55
-set g_balance_mortar_primary_damageforcescale 0
-set g_balance_mortar_primary_edgedamage 25
-set g_balance_mortar_primary_force 250
-set g_balance_mortar_primary_health 15
-set g_balance_mortar_primary_lifetime 5
-set g_balance_mortar_primary_lifetime_stick 0
-set g_balance_mortar_primary_radius 120
-set g_balance_mortar_primary_refire 0.8
-set g_balance_mortar_primary_remote_minbouncecnt 0
-set g_balance_mortar_primary_speed 1900
-set g_balance_mortar_primary_speed_up 225
-set g_balance_mortar_primary_speed_z 0
-set g_balance_mortar_primary_spread 0
-set g_balance_mortar_primary_type 0
-set g_balance_mortar_reload_ammo 0
-set g_balance_mortar_reload_time 2
-set g_balance_mortar_secondary_ammo 2
-set g_balance_mortar_secondary_animtime 0.3
-set g_balance_mortar_secondary_damage 55
-set g_balance_mortar_secondary_damageforcescale 4
-set g_balance_mortar_secondary_edgedamage 30
-set g_balance_mortar_secondary_force 250
-set g_balance_mortar_secondary_health 30
-set g_balance_mortar_secondary_lifetime 5
-set g_balance_mortar_secondary_lifetime_bounce 0.5
-set g_balance_mortar_secondary_lifetime_stick 0
-set g_balance_mortar_secondary_radius 120
-set g_balance_mortar_secondary_refire 0.7
-set g_balance_mortar_secondary_remote_detonateprimary 0
-set g_balance_mortar_secondary_speed 1400
-set g_balance_mortar_secondary_speed_up 150
-set g_balance_mortar_secondary_speed_z 0
-set g_balance_mortar_secondary_spread 0
-set g_balance_mortar_secondary_type 1
-set g_balance_mortar_switchdelay_drop 0.2
-set g_balance_mortar_switchdelay_raise 0.2
-set g_balance_mortar_weaponreplace ""
-set g_balance_mortar_weaponstart 0
-set g_balance_mortar_weaponstartoverride -1
-set g_balance_mortar_weaponthrowable 1
-// }}}
-// {{{ #5: Mine Layer (MUTATOR WEAPON)
-set g_balance_minelayer_ammo 4
-set g_balance_minelayer_animtime 0.4
-set g_balance_minelayer_damage 40
-set g_balance_minelayer_damageforcescale 0
-set g_balance_minelayer_detonatedelay -1
-set g_balance_minelayer_edgedamage 20
-set g_balance_minelayer_force 250
-set g_balance_minelayer_health 15
-set g_balance_minelayer_lifetime 10
-set g_balance_minelayer_lifetime_countdown 0.5
-set g_balance_minelayer_limit 3
-set g_balance_minelayer_protection 0
-set g_balance_minelayer_proximityradius 150
-set g_balance_minelayer_radius 175
-set g_balance_minelayer_refire 1.5
-set g_balance_minelayer_reload_ammo 0
-set g_balance_minelayer_reload_time 2
-set g_balance_minelayer_remote_damage 45
-set g_balance_minelayer_remote_edgedamage 40
-set g_balance_minelayer_remote_force 300
-set g_balance_minelayer_remote_radius 200
-set g_balance_minelayer_speed 1000
-set g_balance_minelayer_switchdelay_drop 0.2
-set g_balance_minelayer_switchdelay_raise 0.2
-set g_balance_minelayer_time 0.5
-set g_balance_minelayer_weaponreplace ""
-set g_balance_minelayer_weaponstart 0
-set g_balance_minelayer_weaponstartoverride -1
-set g_balance_minelayer_weaponthrowable 1
-// }}}
-// {{{ #6: Electro
-set g_balance_electro_combo_comboradius 300
-set g_balance_electro_combo_comboradius_thruwall 200
-set g_balance_electro_combo_damage 50
-set g_balance_electro_combo_edgedamage 25
-set g_balance_electro_combo_force 120
-set g_balance_electro_combo_radius 150
-set g_balance_electro_combo_safeammocheck 1
-set g_balance_electro_combo_speed 2000
-set g_balance_electro_primary_ammo 4
-set g_balance_electro_primary_animtime 0.3
-set g_balance_electro_primary_comboradius 300
-set g_balance_electro_primary_damage 40
-set g_balance_electro_primary_edgedamage 20
-set g_balance_electro_primary_force 200
-set g_balance_electro_primary_lifetime 5
-set g_balance_electro_primary_midaircombo_enemy 1
-set g_balance_electro_primary_midaircombo_explode 1
-set g_balance_electro_primary_midaircombo_interval 0.1
-set g_balance_electro_primary_midaircombo_own 1
-set g_balance_electro_primary_midaircombo_radius 0
-set g_balance_electro_primary_midaircombo_speed 2000
-set g_balance_electro_primary_midaircombo_teammate 1
-set g_balance_electro_primary_radius 100
-set g_balance_electro_primary_refire 0.6
-set g_balance_electro_primary_speed 2500
-set g_balance_electro_primary_spread 0
-set g_balance_electro_reload_ammo 0
-set g_balance_electro_reload_time 2
-set g_balance_electro_secondary_ammo 2
-set g_balance_electro_secondary_animtime 0.2
-set g_balance_electro_secondary_bouncefactor 0.3
-set g_balance_electro_secondary_bouncestop 0.05
-set g_balance_electro_secondary_count 3
-set g_balance_electro_secondary_damage 30
-set g_balance_electro_secondary_damagedbycontents 1
-set g_balance_electro_secondary_damageforcescale 4
-set g_balance_electro_secondary_edgedamage 15
-set g_balance_electro_secondary_force 50
-set g_balance_electro_secondary_health 5
-set g_balance_electro_secondary_lifetime 4
-set g_balance_electro_secondary_radius 150
-set g_balance_electro_secondary_refire 0.2
-set g_balance_electro_secondary_refire2 1.6
-set g_balance_electro_secondary_speed 1000
-set g_balance_electro_secondary_speed_up 200
-set g_balance_electro_secondary_speed_z 0
-set g_balance_electro_secondary_spread 0
-set g_balance_electro_secondary_stick 0
-set g_balance_electro_secondary_touchexplode 1
-set g_balance_electro_switchdelay_drop 0.2
-set g_balance_electro_switchdelay_raise 0.2
-set g_balance_electro_weaponreplace ""
-set g_balance_electro_weaponstart 0
-set g_balance_electro_weaponstartoverride -1
-set g_balance_electro_weaponthrowable 1
-// }}}
-// {{{ #7: Crylink
-set g_balance_crylink_primary_ammo 3
-set g_balance_crylink_primary_animtime 0.3
-set g_balance_crylink_primary_bouncedamagefactor 0.5
-set g_balance_crylink_primary_bounces 1
-set g_balance_crylink_primary_damage 10
-set g_balance_crylink_primary_edgedamage 5
-set g_balance_crylink_primary_force -50
-set g_balance_crylink_primary_joindelay 0.1
-set g_balance_crylink_primary_joinexplode 1
-set g_balance_crylink_primary_joinexplode_damage 0
-set g_balance_crylink_primary_joinexplode_edgedamage 0
-set g_balance_crylink_primary_joinexplode_force 0
-set g_balance_crylink_primary_joinexplode_radius 0
-set g_balance_crylink_primary_joinspread 0.2
-set g_balance_crylink_primary_linkexplode 1
-set g_balance_crylink_primary_middle_fadetime 5
-set g_balance_crylink_primary_middle_lifetime 5
-set g_balance_crylink_primary_other_fadetime 5
-set g_balance_crylink_primary_other_lifetime 5
-set g_balance_crylink_primary_radius 80
-set g_balance_crylink_primary_refire 0.7
-set g_balance_crylink_primary_shots 6
-set g_balance_crylink_primary_speed 2000
-set g_balance_crylink_primary_spread 0.08
-set g_balance_crylink_reload_ammo 0
-set g_balance_crylink_reload_time 2
-set g_balance_crylink_secondary 1
-set g_balance_crylink_secondary_ammo 3
-set g_balance_crylink_secondary_animtime 0.2
-set g_balance_crylink_secondary_bouncedamagefactor 0.5
-set g_balance_crylink_secondary_bounces 0
-set g_balance_crylink_secondary_damage 8
-set g_balance_crylink_secondary_edgedamage 4
-set g_balance_crylink_secondary_force -200
-set g_balance_crylink_secondary_joindelay 0
-set g_balance_crylink_secondary_joinexplode 0
-set g_balance_crylink_secondary_joinexplode_damage 0
-set g_balance_crylink_secondary_joinexplode_edgedamage 0
-set g_balance_crylink_secondary_joinexplode_force 0
-set g_balance_crylink_secondary_joinexplode_radius 0
-set g_balance_crylink_secondary_joinspread 0
-set g_balance_crylink_secondary_linkexplode 0
-set g_balance_crylink_secondary_middle_fadetime 5
-set g_balance_crylink_secondary_middle_lifetime 5
-set g_balance_crylink_secondary_other_fadetime 2
-set g_balance_crylink_secondary_other_lifetime 2
-set g_balance_crylink_secondary_radius 100
-set g_balance_crylink_secondary_refire 0.7
-set g_balance_crylink_secondary_shots 5
-set g_balance_crylink_secondary_speed 4000
-set g_balance_crylink_secondary_spread 0.08
-set g_balance_crylink_secondary_spreadtype 0
-set g_balance_crylink_switchdelay_drop 0.2
-set g_balance_crylink_switchdelay_raise 0.2
-set g_balance_crylink_weaponreplace ""
-set g_balance_crylink_weaponstart 0
-set g_balance_crylink_weaponstartoverride -1
-set g_balance_crylink_weaponthrowable 1
-// }}}
-// {{{ #8: Vortex
-set g_balance_vortex_charge 1
-set g_balance_vortex_charge_always 0
-set g_balance_vortex_charge_animlimit 0.5
-set g_balance_vortex_charge_limit 1
-set g_balance_vortex_charge_maxspeed 800
-set g_balance_vortex_charge_mindmg 40
-set g_balance_vortex_charge_minspeed 400
-set g_balance_vortex_charge_rate 0.6
-set g_balance_vortex_charge_rot_pause 0
-set g_balance_vortex_charge_rot_rate 0
-set g_balance_vortex_charge_shot_multiplier 0
-set g_balance_vortex_charge_start 0.5
-set g_balance_vortex_charge_velocity_rate 0
-set g_balance_vortex_primary_ammo 6
-set g_balance_vortex_primary_animtime 0.4
-set g_balance_vortex_primary_armorpierce 0
-set g_balance_vortex_primary_damage 80
-set g_balance_vortex_primary_damagefalloff_forcehalflife 0
-set g_balance_vortex_primary_damagefalloff_halflife 0
-set g_balance_vortex_primary_damagefalloff_maxdist 0
-set g_balance_vortex_primary_damagefalloff_mindist 0
-set g_balance_vortex_primary_force 400
-set g_balance_vortex_primary_refire 1.5
-set g_balance_vortex_reload_ammo 0
-set g_balance_vortex_reload_time 2
-set g_balance_vortex_secondary 0
-set g_balance_vortex_secondary_ammo 2
-set g_balance_vortex_secondary_animtime 0
-set g_balance_vortex_secondary_armorpierce 0
-set g_balance_vortex_secondary_chargepool 0
-set g_balance_vortex_secondary_chargepool_pause_regen 1
-set g_balance_vortex_secondary_chargepool_regen 0.15
-set g_balance_vortex_secondary_damage 0
-set g_balance_vortex_secondary_damagefalloff_forcehalflife 0
-set g_balance_vortex_secondary_damagefalloff_halflife 0
-set g_balance_vortex_secondary_damagefalloff_maxdist 0
-set g_balance_vortex_secondary_damagefalloff_mindist 0
-set g_balance_vortex_secondary_force 0
-set g_balance_vortex_secondary_refire 0
-set g_balance_vortex_switchdelay_drop 0.2
-set g_balance_vortex_switchdelay_raise 0.2
-set g_balance_vortex_weaponreplace ""
-set g_balance_vortex_weaponstart 0
-set g_balance_vortex_weaponstartoverride -1
-set g_balance_vortex_weaponthrowable 1
-// }}}
-// {{{ #9: Hagar
-set g_balance_hagar_primary_ammo 1
-set g_balance_hagar_primary_damage 25
-set g_balance_hagar_primary_damageforcescale 0
-set g_balance_hagar_primary_edgedamage 12.5
-set g_balance_hagar_primary_force 100
-set g_balance_hagar_primary_health 15
-set g_balance_hagar_primary_lifetime 5
-set g_balance_hagar_primary_radius 65
-set g_balance_hagar_primary_refire 0.16667
-set g_balance_hagar_primary_speed 2200
-set g_balance_hagar_primary_spread 0
-set g_balance_hagar_reload_ammo 0
-set g_balance_hagar_reload_time 2
-set g_balance_hagar_secondary 1
-set g_balance_hagar_secondary_ammo 1
-set g_balance_hagar_secondary_damage 35
-set g_balance_hagar_secondary_damageforcescale 0
-set g_balance_hagar_secondary_edgedamage 17.5
-set g_balance_hagar_secondary_force 75
-set g_balance_hagar_secondary_health 15
-set g_balance_hagar_secondary_lifetime_min 10
-set g_balance_hagar_secondary_lifetime_rand 0
-set g_balance_hagar_secondary_load 1
-set g_balance_hagar_secondary_load_abort 1
-set g_balance_hagar_secondary_load_animtime 0.2
-set g_balance_hagar_secondary_load_hold 4
-set g_balance_hagar_secondary_load_linkexplode 0
-set g_balance_hagar_secondary_load_max 4
-set g_balance_hagar_secondary_load_releasedeath 0
-set g_balance_hagar_secondary_load_speed 0.5
-set g_balance_hagar_secondary_load_spread 0.075
-set g_balance_hagar_secondary_load_spread_bias 0.5
-set g_balance_hagar_secondary_radius 80
-set g_balance_hagar_secondary_refire 0.5
-set g_balance_hagar_secondary_speed 2000
-set g_balance_hagar_secondary_spread 0
-set g_balance_hagar_switchdelay_drop 0.2
-set g_balance_hagar_switchdelay_raise 0.2
-set g_balance_hagar_weaponreplace ""
-set g_balance_hagar_weaponstart 0
-set g_balance_hagar_weaponstartoverride -1
-set g_balance_hagar_weaponthrowable 1
-// }}}
-// {{{ #10: Devastator
-set g_balance_devastator_ammo 4
-set g_balance_devastator_animtime 0.4
-set g_balance_devastator_damage 80
-set g_balance_devastator_damageforcescale 1
-set g_balance_devastator_detonatedelay 0.02
-set g_balance_devastator_edgedamage 40
-set g_balance_devastator_force 400
-set g_balance_devastator_guidedelay 0.2
-set g_balance_devastator_guidegoal 512
-set g_balance_devastator_guiderate 90
-set g_balance_devastator_guideratedelay 0.01
-set g_balance_devastator_guidestop 0
-set g_balance_devastator_health 30
-set g_balance_devastator_lifetime 10
-set g_balance_devastator_radius 110
-set g_balance_devastator_refire 1.1
-set g_balance_devastator_reload_ammo 0
-set g_balance_devastator_reload_time 2
-set g_balance_devastator_remote_damage 70
-set g_balance_devastator_remote_edgedamage 35
-set g_balance_devastator_remote_force 300
-set g_balance_devastator_remote_jump 1
-set g_balance_devastator_remote_jump_damage 70
-set g_balance_devastator_remote_jump_force 450
-set g_balance_devastator_remote_jump_radius 100
-set g_balance_devastator_remote_jump_velocity_z_add 0
-set g_balance_devastator_remote_jump_velocity_z_max 1500
-set g_balance_devastator_remote_jump_velocity_z_min 400
-set g_balance_devastator_remote_radius 110
-set g_balance_devastator_speed 1300
-set g_balance_devastator_speedaccel 1300
-set g_balance_devastator_speedstart 1000
-set g_balance_devastator_switchdelay_drop 0.2
-set g_balance_devastator_switchdelay_raise 0.2
-set g_balance_devastator_weaponreplace ""
-set g_balance_devastator_weaponstart 0
-set g_balance_devastator_weaponstartoverride -1
-set g_balance_devastator_weaponthrowable 1
-// }}}
-// {{{ #11: Port-O-Launch
-set g_balance_porto_primary_animtime 0.3
-set g_balance_porto_primary_lifetime 5
-set g_balance_porto_primary_refire 1.5
-set g_balance_porto_primary_speed 1000
-set g_balance_porto_secondary 1
-set g_balance_porto_secondary_animtime 0.3
-set g_balance_porto_secondary_lifetime 5
-set g_balance_porto_secondary_refire 1.5
-set g_balance_porto_secondary_speed 1000
-set g_balance_porto_switchdelay_drop 0.2
-set g_balance_porto_switchdelay_raise 0.2
-set g_balance_porto_weaponreplace ""
-set g_balance_porto_weaponstart 0
-set g_balance_porto_weaponstartoverride -1
-set g_balance_porto_weaponthrowable 1
-// }}}
-// {{{ #12: Vaporizer
-set g_balance_vaporizer_primary_ammo 10
-set g_balance_vaporizer_primary_animtime 0.3
-set g_balance_vaporizer_primary_damage 150
-set g_balance_vaporizer_primary_force 800
-set g_balance_vaporizer_primary_refire 1
-set g_balance_vaporizer_reload_ammo 0
-set g_balance_vaporizer_reload_time 0
-set g_balance_vaporizer_secondary_ammo 0
-set g_balance_vaporizer_secondary_animtime 0.2
-set g_balance_vaporizer_secondary_damage 25
-set g_balance_vaporizer_secondary_delay 0
-set g_balance_vaporizer_secondary_edgedamage 12.5
-set g_balance_vaporizer_secondary_force 480
-set g_balance_vaporizer_secondary_force_zscale 1
-set g_balance_vaporizer_secondary_lifetime 5
-set g_balance_vaporizer_secondary_radius 70
-set g_balance_vaporizer_secondary_refire 0.7
-set g_balance_vaporizer_secondary_shotangle 0
-set g_balance_vaporizer_secondary_speed 6000
-set g_balance_vaporizer_secondary_spread 0
-set g_balance_vaporizer_switchdelay_drop 0.2
-set g_balance_vaporizer_switchdelay_raise 0.2
-set g_balance_vaporizer_weaponreplace ""
-set g_balance_vaporizer_weaponstart 0
-set g_balance_vaporizer_weaponstartoverride -1
-set g_balance_vaporizer_weaponthrowable 1
-// }}}
-// {{{ #13: Grappling Hook
-set g_balance_hook_primary_ammo 5
-set g_balance_hook_primary_animtime 0.3
-set g_balance_hook_primary_hooked_ammo 5
-set g_balance_hook_primary_hooked_time_free 2
-set g_balance_hook_primary_hooked_time_max 0
-set g_balance_hook_primary_refire 0.2
-set g_balance_hook_secondary_animtime 0.3
-set g_balance_hook_secondary_damage 25
-set g_balance_hook_secondary_damageforcescale 0
-set g_balance_hook_secondary_duration 1.5
-set g_balance_hook_secondary_edgedamage 5
-set g_balance_hook_secondary_force -2000
-set g_balance_hook_secondary_gravity 5
-set g_balance_hook_secondary_health 15
-set g_balance_hook_secondary_lifetime 5
-set g_balance_hook_secondary_power 3
-set g_balance_hook_secondary_radius 500
-set g_balance_hook_secondary_refire 3
-set g_balance_hook_secondary_speed 0
-set g_balance_hook_switchdelay_drop 0.2
-set g_balance_hook_switchdelay_raise 0.2
-set g_balance_hook_weaponreplace ""
-set g_balance_hook_weaponstart 0
-set g_balance_hook_weaponstartoverride -1
-set g_balance_hook_weaponthrowable 1
-// }}}
-// {{{ #14: Heavy Laser Assault Cannon (MUTATOR WEAPON)
-set g_balance_hlac_primary_ammo 1
-set g_balance_hlac_primary_animtime 0.4
-set g_balance_hlac_primary_damage 18
-set g_balance_hlac_primary_edgedamage 9
-set g_balance_hlac_primary_force 90
-set g_balance_hlac_primary_lifetime 5
-set g_balance_hlac_primary_radius 70
-set g_balance_hlac_primary_refire 0.15
-set g_balance_hlac_primary_speed 9000
-set g_balance_hlac_primary_spread_add 0.0045
-set g_balance_hlac_primary_spread_crouchmod 0.25
-set g_balance_hlac_primary_spread_max 0.25
-set g_balance_hlac_primary_spread_min 0.01
-set g_balance_hlac_reload_ammo 0
-set g_balance_hlac_reload_time 2
-set g_balance_hlac_secondary 1
-set g_balance_hlac_secondary_ammo 10
-set g_balance_hlac_secondary_animtime 0.3
-set g_balance_hlac_secondary_damage 15
-set g_balance_hlac_secondary_edgedamage 7.5
-set g_balance_hlac_secondary_force 90
-set g_balance_hlac_secondary_lifetime 5
-set g_balance_hlac_secondary_radius 70
-set g_balance_hlac_secondary_refire 1
-set g_balance_hlac_secondary_shots 6
-set g_balance_hlac_secondary_speed 9000
-set g_balance_hlac_secondary_spread 0.15
-set g_balance_hlac_secondary_spread_crouchmod 0.5
-set g_balance_hlac_switchdelay_drop 0.2
-set g_balance_hlac_switchdelay_raise 0.2
-set g_balance_hlac_weaponreplace ""
-set g_balance_hlac_weaponstart 0
-set g_balance_hlac_weaponstartoverride -1
-set g_balance_hlac_weaponthrowable 1
-// }}}
-// {{{ #15: @!#%'n Tuba
-set g_balance_tuba_animtime 0.05
-set g_balance_tuba_attenuation 0.5
-set g_balance_tuba_damage 5
-set g_balance_tuba_edgedamage 0
-set g_balance_tuba_fadetime 0.25
-set g_balance_tuba_force 40
-set g_balance_tuba_pitchstep 6
-set g_balance_tuba_radius 200
-set g_balance_tuba_refire 0.05
-set g_balance_tuba_switchdelay_drop 0.2
-set g_balance_tuba_switchdelay_raise 0.2
-set g_balance_tuba_volume 1
-set g_balance_tuba_weaponreplace ""
-set g_balance_tuba_weaponstart 0
-set g_balance_tuba_weaponstartoverride -1
-set g_balance_tuba_weaponthrowable 1
-// }}}
-// {{{ #16: Rifle (MUTATOR WEAPON)
-set g_balance_rifle_bursttime 0
-set g_balance_rifle_primary_ammo 10
-set g_balance_rifle_primary_animtime 0.4
-set g_balance_rifle_primary_bullethail 0
-set g_balance_rifle_primary_burstcost 0
-set g_balance_rifle_primary_damage 80
-set g_balance_rifle_primary_force 100
-set g_balance_rifle_primary_refire 1.2
-set g_balance_rifle_primary_shots 1
-set g_balance_rifle_primary_solidpenetration 62.2
-set g_balance_rifle_primary_spread 0
-set g_balance_rifle_primary_tracer 1
-set g_balance_rifle_reload_ammo 80
-set g_balance_rifle_reload_time 2
-set g_balance_rifle_secondary 1
-set g_balance_rifle_secondary_ammo 10
-set g_balance_rifle_secondary_animtime 0.3
-set g_balance_rifle_secondary_bullethail 0
-set g_balance_rifle_secondary_burstcost 0
-set g_balance_rifle_secondary_damage 20
-set g_balance_rifle_secondary_force 50
-set g_balance_rifle_secondary_refire 0.9
-set g_balance_rifle_secondary_reload 0
-set g_balance_rifle_secondary_shots 4
-set g_balance_rifle_secondary_solidpenetration 15.5
-set g_balance_rifle_secondary_spread 0.04
-set g_balance_rifle_secondary_tracer 0
-set g_balance_rifle_switchdelay_drop 0.2
-set g_balance_rifle_switchdelay_raise 0.2
-set g_balance_rifle_weaponreplace ""
-set g_balance_rifle_weaponstart 0
-set g_balance_rifle_weaponstartoverride -1
-set g_balance_rifle_weaponthrowable 1
-// }}}
-// {{{ #17: Fireball
-set g_balance_fireball_primary_animtime 0.4
-set g_balance_fireball_primary_bfgdamage 100
-set g_balance_fireball_primary_bfgforce 0
-set g_balance_fireball_primary_bfgradius 1000
-set g_balance_fireball_primary_damage 200
-set g_balance_fireball_primary_damageforcescale 0
-set g_balance_fireball_primary_edgedamage 50
-set g_balance_fireball_primary_force 600
-set g_balance_fireball_primary_health 0
-set g_balance_fireball_primary_laserburntime 0.5
-set g_balance_fireball_primary_laserdamage 80
-set g_balance_fireball_primary_laseredgedamage 20
-set g_balance_fireball_primary_laserradius 256
-set g_balance_fireball_primary_lifetime 15
-set g_balance_fireball_primary_radius 200
-set g_balance_fireball_primary_refire 2
-set g_balance_fireball_primary_refire2 0
-set g_balance_fireball_primary_speed 1200
-set g_balance_fireball_primary_spread 0
-set g_balance_fireball_secondary_animtime 0.3
-set g_balance_fireball_secondary_damage 40
-set g_balance_fireball_secondary_damageforcescale 4
-set g_balance_fireball_secondary_damagetime 5
-set g_balance_fireball_secondary_laserburntime 0.5
-set g_balance_fireball_secondary_laserdamage 50
-set g_balance_fireball_secondary_laseredgedamage 20
-set g_balance_fireball_secondary_laserradius 110
-set g_balance_fireball_secondary_lifetime 7
-set g_balance_fireball_secondary_refire 1.5
-set g_balance_fireball_secondary_speed 900
-set g_balance_fireball_secondary_speed_up 100
-set g_balance_fireball_secondary_speed_z 0
-set g_balance_fireball_secondary_spread 0
-set g_balance_fireball_switchdelay_drop 0.2
-set g_balance_fireball_switchdelay_raise 0.2
-set g_balance_fireball_weaponreplace ""
-set g_balance_fireball_weaponstart 0
-set g_balance_fireball_weaponstartoverride -1
-set g_balance_fireball_weaponthrowable 0
-// }}}
-// {{{ #18: T.A.G. Seeker (MUTATOR WEAPON)
-set g_balance_seeker_flac_ammo 1
-set g_balance_seeker_flac_animtime 0.1
-set g_balance_seeker_flac_damage 15
-set g_balance_seeker_flac_edgedamage 10
-set g_balance_seeker_flac_force 50
-set g_balance_seeker_flac_lifetime 0.1
-set g_balance_seeker_flac_lifetime_rand 0.05
-set g_balance_seeker_flac_radius 100
-set g_balance_seeker_flac_refire 0.1
-set g_balance_seeker_flac_speed 3000
-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 1400
-set g_balance_seeker_missile_ammo 2
-set g_balance_seeker_missile_animtime 0.2
-set g_balance_seeker_missile_count 3
-set g_balance_seeker_missile_damage 30
-set g_balance_seeker_missile_damageforcescale 4
-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 150
-set g_balance_seeker_missile_health 5
-set g_balance_seeker_missile_lifetime 15
-set g_balance_seeker_missile_proxy 0
-set g_balance_seeker_missile_proxy_delay 0.2
-set g_balance_seeker_missile_proxy_maxrange 45
-set g_balance_seeker_missile_radius 80
-set g_balance_seeker_missile_refire 0.5
-set g_balance_seeker_missile_smart 1
-set g_balance_seeker_missile_smart_mindist 800
-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_max 1300
-set g_balance_seeker_missile_speed_up 300
-set g_balance_seeker_missile_speed_z 0
-set g_balance_seeker_missile_spread 0
-set g_balance_seeker_missile_turnrate 0.65
-set g_balance_seeker_reload_ammo 0
-set g_balance_seeker_reload_time 2
-set g_balance_seeker_switchdelay_drop 0.2
-set g_balance_seeker_switchdelay_raise 0.2
-set g_balance_seeker_tag_ammo 1
-set g_balance_seeker_tag_animtime 0.2
-set g_balance_seeker_tag_damageforcescale 4
-set g_balance_seeker_tag_health 5
-set g_balance_seeker_tag_lifetime 15
-set g_balance_seeker_tag_refire 0.75
-set g_balance_seeker_tag_speed 5000
-set g_balance_seeker_tag_spread 0
-set g_balance_seeker_tag_tracker_lifetime 10
-set g_balance_seeker_type 0
-set g_balance_seeker_weaponreplace ""
-set g_balance_seeker_weaponstart 0
-set g_balance_seeker_weaponstartoverride -1
-set g_balance_seeker_weaponthrowable 1
-// }}}
-// {{{ #19: Shockwave
-set g_balance_shockwave_blast_animtime 0.3
-set g_balance_shockwave_blast_damage 40
-set g_balance_shockwave_blast_distance 1000
-set g_balance_shockwave_blast_edgedamage 0
-set g_balance_shockwave_blast_force 15
-set g_balance_shockwave_blast_force_forwardbias 50
-set g_balance_shockwave_blast_force_zscale 1
-set g_balance_shockwave_blast_jump_damage 20
-set g_balance_shockwave_blast_jump_edgedamage 0
-set g_balance_shockwave_blast_jump_force 100
-set g_balance_shockwave_blast_jump_force_velocitybias 1
-set g_balance_shockwave_blast_jump_force_zscale 1
-set g_balance_shockwave_blast_jump_multiplier_accuracy 0.5
-set g_balance_shockwave_blast_jump_multiplier_distance 0.5
-set g_balance_shockwave_blast_jump_multiplier_min 0
-set g_balance_shockwave_blast_jump_radius 150
-set g_balance_shockwave_blast_multiplier_accuracy 0.45
-set g_balance_shockwave_blast_multiplier_distance 0.2
-set g_balance_shockwave_blast_multiplier_min 0
-set g_balance_shockwave_blast_refire 0.75
-set g_balance_shockwave_blast_splash_damage 15
-set g_balance_shockwave_blast_splash_edgedamage 0
-set g_balance_shockwave_blast_splash_force 100
-set g_balance_shockwave_blast_splash_force_forwardbias 50
-set g_balance_shockwave_blast_splash_multiplier_accuracy 0.5
-set g_balance_shockwave_blast_splash_multiplier_distance 0.5
-set g_balance_shockwave_blast_splash_multiplier_min 0
-set g_balance_shockwave_blast_splash_radius 70
-set g_balance_shockwave_blast_spread_max 120
-set g_balance_shockwave_blast_spread_min 25
-set g_balance_shockwave_melee_animtime 1.3
-set g_balance_shockwave_melee_damage 80
-set g_balance_shockwave_melee_delay 0.25
-set g_balance_shockwave_melee_force 200
-set g_balance_shockwave_melee_multihit 1
-set g_balance_shockwave_melee_no_doubleslap 1
-set g_balance_shockwave_melee_nonplayerdamage 40
-set g_balance_shockwave_melee_range 120
-set g_balance_shockwave_melee_refire 1.25
-set g_balance_shockwave_melee_swing_side 120
-set g_balance_shockwave_melee_swing_up 30
-set g_balance_shockwave_melee_time 0.15
-set g_balance_shockwave_melee_traces 10
-set g_balance_shockwave_switchdelay_drop 0.2
-set g_balance_shockwave_switchdelay_raise 0.2
-set g_balance_shockwave_weaponreplace ""
-set g_balance_shockwave_weaponstart 0
-set g_balance_shockwave_weaponstartoverride -1
-set g_balance_shockwave_weaponthrowable 0
-// }}}
-// {{{ #20: Arc
-set g_balance_arc_beam_ammo 6
-set g_balance_arc_beam_animtime 0.1
-set g_balance_arc_beam_botaimlifetime 0
-set g_balance_arc_beam_botaimspeed 0
-set g_balance_arc_beam_damage 100
-set g_balance_arc_beam_degreespersegment 1
-set g_balance_arc_beam_distancepersegment 0
-set g_balance_arc_beam_falloff_halflifedist 0
-set g_balance_arc_beam_falloff_maxdist 0
-set g_balance_arc_beam_falloff_mindist 0
-set g_balance_arc_beam_force 600
-set g_balance_arc_beam_healing_amax 0
-set g_balance_arc_beam_healing_aps 50
-set g_balance_arc_beam_healing_hmax 150
-set g_balance_arc_beam_healing_hps 50
-set g_balance_arc_beam_heat 0
-set g_balance_arc_beam_maxangle 10
-set g_balance_arc_beam_nonplayerdamage 80
-set g_balance_arc_beam_range 1500
-set g_balance_arc_beam_refire 0.25
-set g_balance_arc_beam_returnspeed 8
-set g_balance_arc_beam_tightness 0.6
-set g_balance_arc_bolt 1
-set g_balance_arc_bolt_ammo 1
-set g_balance_arc_bolt_damage 25
-set g_balance_arc_bolt_damageforcescale 0
-set g_balance_arc_bolt_edgedamage 12.5
-set g_balance_arc_bolt_force 120
-set g_balance_arc_bolt_health 15
-set g_balance_arc_bolt_lifetime 5
-set g_balance_arc_bolt_radius 65
-set g_balance_arc_bolt_refire 0.16667
-set g_balance_arc_bolt_speed 2300
-set g_balance_arc_bolt_spread 0
-set g_balance_arc_burst_ammo 15
-set g_balance_arc_burst_damage 250
-set g_balance_arc_burst_healing_aps 100
-set g_balance_arc_burst_healing_hps 100
-set g_balance_arc_burst_heat 5
-set g_balance_arc_cooldown 2.5
-set g_balance_arc_cooldown_release 0
-set g_balance_arc_overheat_max 5
-set g_balance_arc_overheat_min 3
-set g_balance_arc_switchdelay_drop 0.2
-set g_balance_arc_switchdelay_raise 0.2
-set g_balance_arc_weaponreplace ""
-set g_balance_arc_weaponstart 0
-set g_balance_arc_weaponstartoverride -1
-set g_balance_arc_weaponthrowable 1
-// }}}
-// {{{ #21: Overkill Heavy Machine Gun (MUTATOR WEAPON)
-set g_balance_okhmg_primary_ammo 1
-set g_balance_okhmg_primary_damage 30
-set g_balance_okhmg_primary_force 10
-set g_balance_okhmg_primary_refire 0.05
-set g_balance_okhmg_primary_solidpenetration 127
-set g_balance_okhmg_primary_spread_add 0.005
-set g_balance_okhmg_primary_spread_max 0.06
-set g_balance_okhmg_primary_spread_min 0.01
-set g_balance_okhmg_reload_ammo 120
-set g_balance_okhmg_reload_time 1
-set g_balance_okhmg_secondary_ammo 0
-set g_balance_okhmg_secondary_animtime 0.2
-set g_balance_okhmg_secondary_damage 25
-set g_balance_okhmg_secondary_delay 0
-set g_balance_okhmg_secondary_edgedamage 12.5
-set g_balance_okhmg_secondary_force 360
-set g_balance_okhmg_secondary_force_zscale 1
-set g_balance_okhmg_secondary_lifetime 5
-set g_balance_okhmg_secondary_radius 70
-set g_balance_okhmg_secondary_refire 0.7
-set g_balance_okhmg_secondary_refire_type 1
-set g_balance_okhmg_secondary_shotangle 0
-set g_balance_okhmg_secondary_speed 6000
-set g_balance_okhmg_secondary_spread 0
-set g_balance_okhmg_switchdelay_drop 0.2
-set g_balance_okhmg_switchdelay_raise 0.2
-set g_balance_okhmg_weaponreplace ""
-set g_balance_okhmg_weaponstart 0
-set g_balance_okhmg_weaponstartoverride 0
-set g_balance_okhmg_weaponthrowable 0
-// }}}
-// {{{ #22: Overkill MachineGun (MUTATOR WEAPON)
-set g_balance_okmachinegun_primary_ammo 1
-set g_balance_okmachinegun_primary_damage 25
-set g_balance_okmachinegun_primary_force 5
-set g_balance_okmachinegun_primary_refire 0.1
-set g_balance_okmachinegun_primary_solidpenetration 100
-set g_balance_okmachinegun_primary_spread_add 0.012
-set g_balance_okmachinegun_primary_spread_max 0.05
-set g_balance_okmachinegun_primary_spread_min 0
-set g_balance_okmachinegun_reload_ammo 30
-set g_balance_okmachinegun_reload_time 1.5
-set g_balance_okmachinegun_secondary_animtime 0.2
-set g_balance_okmachinegun_secondary_damage 25
-set g_balance_okmachinegun_secondary_delay 0
-set g_balance_okmachinegun_secondary_edgedamage 12.5
-set g_balance_okmachinegun_secondary_force 360
-set g_balance_okmachinegun_secondary_force_zscale 1
-set g_balance_okmachinegun_secondary_lifetime 5
-set g_balance_okmachinegun_secondary_radius 70
-set g_balance_okmachinegun_secondary_refire 0.7
-set g_balance_okmachinegun_secondary_refire_type 1
-set g_balance_okmachinegun_secondary_shotangle 0
-set g_balance_okmachinegun_secondary_speed 6000
-set g_balance_okmachinegun_secondary_spread 0
-set g_balance_okmachinegun_switchdelay_drop 0.2
-set g_balance_okmachinegun_switchdelay_raise 0.2
-set g_balance_okmachinegun_weaponreplace ""
-set g_balance_okmachinegun_weaponstart 0
-set g_balance_okmachinegun_weaponstartoverride -1
-set g_balance_okmachinegun_weaponthrowable 1
-// }}}
-// {{{ #23: Overkill Nex (MUTATOR WEAPON)
-set g_balance_oknex_charge 0
-set g_balance_oknex_charge_animlimit 0.5
-set g_balance_oknex_charge_limit 1
-set g_balance_oknex_charge_maxspeed 800
-set g_balance_oknex_charge_mindmg 40
-set g_balance_oknex_charge_minspeed 400
-set g_balance_oknex_charge_rate 0.6
-set g_balance_oknex_charge_rot_pause 0
-set g_balance_oknex_charge_rot_rate 0
-set g_balance_oknex_charge_shot_multiplier 0
-set g_balance_oknex_charge_start 0.5
-set g_balance_oknex_charge_velocity_rate 0
-set g_balance_oknex_primary_ammo 10
-set g_balance_oknex_primary_animtime 0.65
-set g_balance_oknex_primary_damage 100
-set g_balance_oknex_primary_damagefalloff_forcehalflife 0
-set g_balance_oknex_primary_damagefalloff_halflife 0
-set g_balance_oknex_primary_damagefalloff_maxdist 0
-set g_balance_oknex_primary_damagefalloff_mindist 0
-set g_balance_oknex_primary_force 500
-set g_balance_oknex_primary_refire 1
-set g_balance_oknex_reload_ammo 50
-set g_balance_oknex_reload_time 2
-set g_balance_oknex_secondary 2
-set g_balance_oknex_secondary_ammo 0
-set g_balance_oknex_secondary_animtime 0.2
-set g_balance_oknex_secondary_chargepool 0
-set g_balance_oknex_secondary_chargepool_pause_regen 1
-set g_balance_oknex_secondary_chargepool_regen 0.15
-set g_balance_oknex_secondary_damage 25
-set g_balance_oknex_secondary_damagefalloff_forcehalflife 0
-set g_balance_oknex_secondary_damagefalloff_halflife 0
-set g_balance_oknex_secondary_damagefalloff_maxdist 0
-set g_balance_oknex_secondary_damagefalloff_mindist 0
-set g_balance_oknex_secondary_delay 0
-set g_balance_oknex_secondary_edgedamage 12.5
-set g_balance_oknex_secondary_force 360
-set g_balance_oknex_secondary_force_zscale 1
-set g_balance_oknex_secondary_lifetime 5
-set g_balance_oknex_secondary_radius 70
-set g_balance_oknex_secondary_refire 0.7
-set g_balance_oknex_secondary_refire_type 1
-set g_balance_oknex_secondary_shotangle 0
-set g_balance_oknex_secondary_speed 6000
-set g_balance_oknex_secondary_spread 0
-set g_balance_oknex_switchdelay_drop 0.2
-set g_balance_oknex_switchdelay_raise 0.2
-set g_balance_oknex_weaponreplace ""
-set g_balance_oknex_weaponstart 0
-set g_balance_oknex_weaponstartoverride -1
-set g_balance_oknex_weaponthrowable 1
-// }}}
-// {{{ #24: Overkill Rocket Propelled Chainsaw (MUTATOR WEAPON)
-set g_balance_okrpc_primary_ammo 10
-set g_balance_okrpc_primary_animtime 1
-set g_balance_okrpc_primary_damage 150
-set g_balance_okrpc_primary_damage2 500
-set g_balance_okrpc_primary_damageforcescale 2
-set g_balance_okrpc_primary_edgedamage 50
-set g_balance_okrpc_primary_force 400
-set g_balance_okrpc_primary_health 25
-set g_balance_okrpc_primary_lifetime 30
-set g_balance_okrpc_primary_radius 300
-set g_balance_okrpc_primary_refire 1
-set g_balance_okrpc_primary_speed 2500
-set g_balance_okrpc_primary_speedaccel 5000
-set g_balance_okrpc_reload_ammo 10
-set g_balance_okrpc_reload_time 1
-set g_balance_okrpc_secondary_ammo 0
-set g_balance_okrpc_secondary_animtime 0.2
-set g_balance_okrpc_secondary_damage 25
-set g_balance_okrpc_secondary_delay 0
-set g_balance_okrpc_secondary_edgedamage 12.5
-set g_balance_okrpc_secondary_force 360
-set g_balance_okrpc_secondary_force_zscale 1
-set g_balance_okrpc_secondary_lifetime 5
-set g_balance_okrpc_secondary_radius 70
-set g_balance_okrpc_secondary_refire 0.7
-set g_balance_okrpc_secondary_refire_type 1
-set g_balance_okrpc_secondary_shotangle 0
-set g_balance_okrpc_secondary_speed 6000
-set g_balance_okrpc_secondary_spread 0
-set g_balance_okrpc_switchdelay_drop 0.2
-set g_balance_okrpc_switchdelay_raise 0.2
-set g_balance_okrpc_weaponreplace ""
-set g_balance_okrpc_weaponstart 0
-set g_balance_okrpc_weaponstartoverride 0
-set g_balance_okrpc_weaponthrowable 0
-// }}}
-// {{{ #25: Overkill Shotgun (MUTATOR WEAPON)
-set g_balance_okshotgun_primary_ammo 3
-set g_balance_okshotgun_primary_animtime 0.65
-set g_balance_okshotgun_primary_bot_range 512
-set g_balance_okshotgun_primary_bullets 10
-set g_balance_okshotgun_primary_damage 17
-set g_balance_okshotgun_primary_force 80
-set g_balance_okshotgun_primary_refire 0.75
-set g_balance_okshotgun_primary_solidpenetration 3.8
-set g_balance_okshotgun_primary_spread 0.07
-set g_balance_okshotgun_reload_ammo 24
-set g_balance_okshotgun_reload_time 2
-set g_balance_okshotgun_secondary_animtime 0.2
-set g_balance_okshotgun_secondary_damage 25
-set g_balance_okshotgun_secondary_delay 0
-set g_balance_okshotgun_secondary_edgedamage 12.5
-set g_balance_okshotgun_secondary_force 360
-set g_balance_okshotgun_secondary_force_zscale 1
-set g_balance_okshotgun_secondary_lifetime 5
-set g_balance_okshotgun_secondary_radius 70
-set g_balance_okshotgun_secondary_refire 0.7
-set g_balance_okshotgun_secondary_refire_type 1
-set g_balance_okshotgun_secondary_shotangle 0
-set g_balance_okshotgun_secondary_speed 6000
-set g_balance_okshotgun_secondary_spread 0
-set g_balance_okshotgun_switchdelay_drop 0.2
-set g_balance_okshotgun_switchdelay_raise 0.2
-set g_balance_okshotgun_weaponreplace ""
-set g_balance_okshotgun_weaponstart 0
-set g_balance_okshotgun_weaponstartoverride -1
-set g_balance_okshotgun_weaponthrowable 1
-// }}}
g_mod_balance Mario
+testing_disable
// {{{ starting gear
set g_balance_health_start 100
g_mod_balance Nexuiz25
+testing_disable
// {{{ starting gear
set g_balance_health_start 150
g_mod_balance Overkill
+testing_disable
// {{{ starting gear
set g_balance_health_start 100
g_mod_balance Samual
+testing_disable
// {{{ starting gear
set g_balance_health_start 100
+exec balance-xonotic.cfg
g_mod_balance Testing
-
-// {{{ starting gear
-set g_balance_health_start 100
-set g_balance_armor_start 0
-set g_start_ammo_shells 15
-set g_start_ammo_nails 0
-set g_start_ammo_rockets 0
-set g_start_ammo_cells 0
-set g_start_ammo_plasma 0
-set g_start_ammo_fuel 0
-set g_random_start_weapons_count 0
-set g_random_start_weapons "machinegun mortar electro crylink vortex hagar devastator"
-set g_random_start_shells 15
-set g_random_start_bullets 80
-set g_random_start_rockets 40
-set g_random_start_cells 30
-set g_random_start_plasma 30
-set g_warmup_start_health 100 "starting values when being in warmup-stage"
-set g_warmup_start_armor 100 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_shells 30 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_nails 160 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_rockets 80 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_cells 90 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_plasma 90 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_fuel 0 "starting values when being in warmup-stage"
-set g_lms_start_health 200
-set g_lms_start_armor 200
-set g_lms_start_ammo_shells 60
-set g_lms_start_ammo_nails 320
-set g_lms_start_ammo_rockets 160
-set g_lms_start_ammo_cells 180
-set g_lms_start_ammo_plasma 180
-set g_lms_start_ammo_fuel 0
-set g_balance_nix_roundtime 25
-set g_balance_nix_incrtime 1.6
-set g_balance_nix_ammo_shells 60
-set g_balance_nix_ammo_nails 320
-set g_balance_nix_ammo_rockets 160
-set g_balance_nix_ammo_cells 180
-set g_balance_nix_ammo_plasma 180
-set g_balance_nix_ammo_fuel 100
-set g_balance_nix_ammoincr_shells 2 // eh this will need figured out later I assume
-set g_balance_nix_ammoincr_nails 6
-set g_balance_nix_ammoincr_rockets 2
-set g_balance_nix_ammoincr_cells 2
-set g_balance_nix_ammoincr_plasma 2
-set g_balance_nix_ammoincr_fuel 2
-// }}}
-
-// {{{ pickup items
-set g_pickup_ammo_anyway 1
-set g_pickup_weapons_anyway 1
-set g_pickup_shells 15
-set g_pickup_shells_weapon 15
-set g_pickup_shells_max 60
-set g_pickup_nails 80
-set g_pickup_nails_weapon 80
-set g_pickup_nails_max 320
-set g_pickup_rockets 40
-set g_pickup_rockets_weapon 40
-set g_pickup_rockets_max 160
-set g_pickup_cells 30
-set g_pickup_cells_weapon 30
-set g_pickup_cells_max 180
-set g_pickup_plasma 30
-set g_pickup_plasma_weapon 30
-set g_pickup_plasma_max 180
-set g_pickup_fuel 50
-set g_pickup_fuel_weapon 50
-set g_pickup_fuel_jetpack 100
-set g_pickup_fuel_max 100
-set g_pickup_armorsmall 5
-set g_pickup_armorsmall_max 200
-set g_pickup_armorsmall_anyway 1
-set g_pickup_armormedium 25
-set g_pickup_armormedium_max 200
-set g_pickup_armormedium_anyway 1
-set g_pickup_armorbig 50
-set g_pickup_armorbig_max 200
-set g_pickup_armorbig_anyway 1
-set g_pickup_armormega 100
-set g_pickup_armormega_max 200
-set g_pickup_armormega_anyway 1
-set g_pickup_healthsmall 5
-set g_pickup_healthsmall_max 200
-set g_pickup_healthsmall_anyway 1
-set g_pickup_healthmedium 25
-set g_pickup_healthmedium_max 200
-set g_pickup_healthmedium_anyway 1
-set g_pickup_healthbig 50
-set g_pickup_healthbig_max 200
-set g_pickup_healthbig_anyway 1
-set g_pickup_healthmega 100
-set g_pickup_healthmega_max 200
-set g_pickup_healthmega_anyway 1
-set g_pickup_respawntime_short 15
-set g_pickup_respawntime_medium 20
-set g_pickup_respawntime_long 30
-set g_pickup_respawntime_powerup 120
-set g_pickup_respawntime_weapon 10
-set g_pickup_respawntime_superweapon 120
-set g_pickup_respawntime_ammo 10
-set g_pickup_respawntime_initial_random 1
-set g_pickup_respawntimejitter_short 0
-set g_pickup_respawntimejitter_medium 0
-set g_pickup_respawntimejitter_long 0
-set g_pickup_respawntimejitter_powerup 0
-set g_pickup_respawntimejitter_weapon 0
-set g_pickup_respawntimejitter_superweapon 10
-set g_pickup_respawntimejitter_ammo 0
-// }}}
-
-// {{{ regen/rot
-set g_balance_health_regen 0.08
-set g_balance_health_regenlinear 0.5
-set g_balance_pause_health_regen 5
-set g_balance_pause_health_regen_spawn 0
-set g_balance_health_rot 0.02
-set g_balance_health_rotlinear 1
-set g_balance_pause_health_rot 1
-set g_balance_pause_health_rot_spawn 5
-set g_balance_health_regenstable 100
-set g_balance_health_rotstable 100
-set g_balance_health_limit 200
-set g_balance_armor_regen 0
-set g_balance_armor_regenlinear 0
-set g_balance_armor_rot 0.02
-set g_balance_armor_rotlinear 1
-set g_balance_pause_armor_rot 1
-set g_balance_pause_armor_rot_spawn 5
-set g_balance_armor_regenstable 100
-set g_balance_armor_rotstable 100
-set g_balance_armor_limit 200
-set g_balance_armor_blockpercent 0.7
-set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
-set g_balance_fuel_regenlinear 0
-set g_balance_pause_fuel_regen 2 // other than this, fuel uses the health regen counter
-set g_balance_fuel_rot 0.05
-set g_balance_fuel_rotlinear 0
-set g_balance_pause_fuel_rot 5
-set g_balance_pause_fuel_rot_spawn 10
-set g_balance_fuel_regenstable 50
-set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 100
-// }}}
-
-// {{{ misc
-set g_balance_selfdamagepercent 0.65
-set g_weaponspeedfactor 1 "weapon projectile speed multiplier"
-set g_weaponratefactor 1 "weapon fire rate multiplier"
-set g_weapondamagefactor 1 "weapon damage multiplier"
-set g_weaponforcefactor 1 "weapon force multiplier"
-set g_weaponspreadfactor 1 "weapon spread multiplier"
-set g_balance_firetransfer_time 0.9
-set g_balance_firetransfer_damage 0.8
-set g_throughfloor_damage 0.75
-set g_throughfloor_force 0.75
-set g_projectiles_damage -2
-// possible values:
-// -2: absolutely no damage to projectiles (no exceptions)
-// -1: no damage other than the exceptions (electro combo, hagar join explode, ML mines)
-// 0: only damage from contents (lava/slime) or exceptions
-// 1: only self damage or damage from contents or exceptions
-// 2: allow all damage to projectiles normally
-set g_projectiles_keep_owner 1
-set g_projectiles_newton_style 0
-// possible values:
-// 0: absolute velocity projectiles (like Quake)
-// 1: relative velocity projectiles, "Newtonian" (like Tribes 2)
-// 2: relative velocity projectiles, but aim is precorrected so projectiles hit the crosshair (note: strafe rockets then are SLOWER than ones shot while standing, happens in 1 too when aiming correctly which is hard)
-set g_projectiles_newton_style_2_minfactor 0.8
-set g_projectiles_newton_style_2_maxfactor 1.5
-set g_projectiles_spread_style 7
-// possible values:
-// 0: forward + solid sphere (like Quake) - varies velocity
-// 1: forward + flattened solid sphere
-// 2: forward + solid circle
-// 3: forward + normal distribution 3D - varies velocity
-// 4: forward + normal distribution on a plane
-// 5: forward + circle with 1-r falloff
-// 6: forward + circle with 1-r^2 falloff
-// 7: forward + circle with (1-r)(2-r) falloff
-set g_balance_falldamage_deadminspeed 250
-set g_balance_falldamage_minspeed 900
-set g_balance_falldamage_factor 0.20
-set g_balance_falldamage_maxdamage 40
-set g_balance_falldamage_onlyvertical 0
-set g_balance_damagepush_speedfactor 2.5
-set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
-set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
-set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
-set g_balance_contents_playerdamage_lava 50 // damage per second for while player is inside lava
-set g_balance_contents_playerdamage_lava_burn 0 // extra burning damage after leaving lava
-set g_balance_contents_playerdamage_lava_burn_time 2.5 // time across which the damage is applied (note: not dps!)
-set g_balance_contents_playerdamage_slime 30 // damage per second for while player is inside slime
-set g_balance_contents_projectiledamage 10000 // instantly kill projectiles upon touching lava/slime
-set g_maxpushtime 8.0 "timeout for kill credit when your damage knocks someone into a death trap"
-// }}}
-
-// {{{ powerups
-set g_balance_powerup_invincible_takedamage 0.33 // only 1/3rd damage is taken
-set g_balance_powerup_invincible_takeforce 0.33
-set g_balance_powerup_invincible_time 30
-set g_balance_powerup_strength_damage 3
-set g_balance_powerup_strength_force 3
-set g_balance_powerup_strength_time 30
-set g_balance_powerup_strength_selfdamage 1.5
-set g_balance_powerup_strength_selfforce 1.5
-set g_balance_superweapons_time 30
-// }}}
-
-// {{{ jetpack/hook
-set g_jetpack_antigravity 0.8 "factor of gravity compensation of the jetpack"
-set g_jetpack_acceleration_side 1200 "acceleration of the jetpack in xy direction"
-set g_jetpack_acceleration_up 600 "acceleration of the jetpack in z direction (note: you have to factor in gravity here, if antigravity is not 1)"
-set g_jetpack_maxspeed_side 1200 "max speed of the jetpack in xy direction"
-set g_jetpack_maxspeed_up 600 "max speed of the jetpack in z direction"
-set g_jetpack_fuel 8 "fuel per second for jetpack"
-set g_jetpack_reverse_thrust 0 "if not 0, downward acceleration when crouching with the jetpack"
-
-set g_grappling_hook_tarzan 2 // 2: can also pull players
-set g_balance_grapplehook_speed_fly 1800
-set g_balance_grapplehook_speed_pull 2000
-set g_balance_grapplehook_force_rubber 2000
-set g_balance_grapplehook_force_rubber_overstretch 1000
-set g_balance_grapplehook_length_min 50
-set g_balance_grapplehook_stretch 50
-set g_balance_grapplehook_airfriction 0.2
-set g_balance_grapplehook_health 50
-set g_balance_grapplehook_damagedbycontents 1
-set g_balance_grapplehook_refire 0.2
-set g_balance_grapplehook_nade_time 0.7
-set g_balance_grapplehook_crouchslide 0
-set g_balance_grapplehook_gravity 0
-set g_balance_grapplehook_pull_frozen 0
-// }}}
-
-// {{{ port-o-launch
-set g_balance_portal_health 200 // these get recharged whenever the portal is used
-set g_balance_portal_lifetime 15 // these get recharged whenever the portal is used
-// }}}
-
-exec bal-wep-testing.cfg
+testing_enable
-g_mod_balance XPM
-
-// {{{ starting gear
-set g_balance_health_start 100
-set g_balance_armor_start 0
-set g_start_ammo_shells 15
-set g_start_ammo_nails 0
-set g_start_ammo_rockets 0
-set g_start_ammo_cells 0
-set g_start_ammo_plasma 0
-set g_start_ammo_fuel 0
-set g_random_start_weapons_count 0
-set g_random_start_weapons "machinegun mortar electro crylink vortex hagar devastator"
-set g_random_start_shells 15
-set g_random_start_bullets 80
-set g_random_start_rockets 40
-set g_random_start_cells 30
-set g_random_start_plasma 30
-set g_warmup_start_health 100 "starting values when being in warmup-stage"
-set g_warmup_start_armor 100 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_shells 30 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_nails 160 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_rockets 80 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_cells 90 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_plasma 90 "starting values when being in warmup-stage"
-set g_warmup_start_ammo_fuel 0 "starting values when being in warmup-stage"
-set g_lms_start_health 200
-set g_lms_start_armor 200
-set g_lms_start_ammo_shells 60
-set g_lms_start_ammo_nails 320
-set g_lms_start_ammo_rockets 160
-set g_lms_start_ammo_cells 180
-set g_lms_start_ammo_plasma 180
-set g_lms_start_ammo_fuel 0
-set g_balance_nix_roundtime 25
-set g_balance_nix_incrtime 1.6
-set g_balance_nix_ammo_shells 60
-set g_balance_nix_ammo_nails 320
-set g_balance_nix_ammo_rockets 160
-set g_balance_nix_ammo_cells 180
-set g_balance_nix_ammo_plasma 180
-set g_balance_nix_ammo_fuel 100
-set g_balance_nix_ammoincr_shells 2 // eh this will need figured out later I assume
-set g_balance_nix_ammoincr_nails 6
-set g_balance_nix_ammoincr_rockets 2
-set g_balance_nix_ammoincr_cells 2
-set g_balance_nix_ammoincr_plasma 2
-set g_balance_nix_ammoincr_fuel 2
-// }}}
-
-// {{{ pickup items
-set g_pickup_ammo_anyway 1
-set g_pickup_weapons_anyway 1
-set g_pickup_shells 15
-set g_pickup_shells_weapon 15
-set g_pickup_shells_max 60
-set g_pickup_nails 80
-set g_pickup_nails_weapon 80
-set g_pickup_nails_max 320
-set g_pickup_rockets 40
-set g_pickup_rockets_weapon 40
-set g_pickup_rockets_max 160
-set g_pickup_cells 30
-set g_pickup_cells_weapon 30
-set g_pickup_cells_max 180
-set g_pickup_plasma 30
-set g_pickup_plasma_weapon 30
-set g_pickup_plasma_max 180
-set g_pickup_fuel 50
-set g_pickup_fuel_weapon 50
-set g_pickup_fuel_jetpack 100
-set g_pickup_fuel_max 100
-set g_pickup_armorsmall 5
-set g_pickup_armorsmall_max 200
-set g_pickup_armorsmall_anyway 0
-set g_pickup_armormedium 25
-set g_pickup_armormedium_max 100
-set g_pickup_armormedium_anyway 0
-set g_pickup_armorbig 50
-set g_pickup_armorbig_max 100
-set g_pickup_armorbig_anyway 0
-set g_pickup_armormega 100
-set g_pickup_armormega_max 200
-set g_pickup_armormega_anyway 0
-set g_pickup_healthsmall 5
-set g_pickup_healthsmall_max 200
-set g_pickup_healthsmall_anyway 0
-set g_pickup_healthmedium 25
-set g_pickup_healthmedium_max 100
-set g_pickup_healthmedium_anyway 0
-set g_pickup_healthbig 50
-set g_pickup_healthbig_max 100
-set g_pickup_healthbig_anyway 0
-set g_pickup_healthmega 100
-set g_pickup_healthmega_max 200
-set g_pickup_healthmega_anyway 0
-set g_pickup_respawntime_short 15
-set g_pickup_respawntime_medium 20
-set g_pickup_respawntime_long 30
-set g_pickup_respawntime_powerup 120
-set g_pickup_respawntime_weapon 10
-set g_pickup_respawntime_superweapon 120
-set g_pickup_respawntime_ammo 10
-set g_pickup_respawntime_initial_random 1
-set g_pickup_respawntimejitter_short 0
-set g_pickup_respawntimejitter_medium 0
-set g_pickup_respawntimejitter_long 0
-set g_pickup_respawntimejitter_powerup 0
-set g_pickup_respawntimejitter_weapon 0
-set g_pickup_respawntimejitter_superweapon 10
-set g_pickup_respawntimejitter_ammo 0
-// }}}
-
-// {{{ regen/rot
-set g_balance_health_regen 0.08
-set g_balance_health_regenlinear 0.5
-set g_balance_pause_health_regen 5
-set g_balance_pause_health_regen_spawn 0
-set g_balance_health_rot 0.02
-set g_balance_health_rotlinear 1
-set g_balance_pause_health_rot 1
-set g_balance_pause_health_rot_spawn 5
-set g_balance_health_regenstable 100
-set g_balance_health_rotstable 100
-set g_balance_health_limit 200
-set g_balance_armor_regen 0
-set g_balance_armor_regenlinear 0
-set g_balance_armor_rot 0.02
-set g_balance_armor_rotlinear 1
-set g_balance_pause_armor_rot 1
-set g_balance_pause_armor_rot_spawn 5
-set g_balance_armor_regenstable 100
-set g_balance_armor_rotstable 100
-set g_balance_armor_limit 200
-set g_balance_armor_blockpercent 0.7
-set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
-set g_balance_fuel_regenlinear 0
-set g_balance_pause_fuel_regen 2 // other than this, fuel uses the health regen counter
-set g_balance_fuel_rot 0.05
-set g_balance_fuel_rotlinear 0
-set g_balance_pause_fuel_rot 5
-set g_balance_pause_fuel_rot_spawn 10
-set g_balance_fuel_regenstable 50
-set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 100
-// }}}
-
-// {{{ misc
-set g_balance_selfdamagepercent 0.65
-set g_weaponspeedfactor 1 "weapon projectile speed multiplier"
-set g_weaponratefactor 1 "weapon fire rate multiplier"
-set g_weapondamagefactor 1 "weapon damage multiplier"
-set g_weaponforcefactor 1 "weapon force multiplier"
-set g_weaponspreadfactor 1 "weapon spread multiplier"
-set g_balance_firetransfer_time 0.9
-set g_balance_firetransfer_damage 0.8
-set g_throughfloor_damage 0.75
-set g_throughfloor_force 0.75
-set g_projectiles_damage -2
-// possible values:
-// -2: absolutely no damage to projectiles (no exceptions)
-// -1: no damage other than the exceptions (electro combo, hagar join explode, ML mines)
-// 0: only damage from contents (lava/slime) or exceptions
-// 1: only self damage or damage from contents or exceptions
-// 2: allow all damage to projectiles normally
-set g_projectiles_keep_owner 1
-set g_projectiles_newton_style 0
-// possible values:
-// 0: absolute velocity projectiles (like Quake)
-// 1: relative velocity projectiles, "Newtonian" (like Tribes 2)
-// 2: relative velocity projectiles, but aim is precorrected so projectiles hit the crosshair (note: strafe rockets then are SLOWER than ones shot while standing, happens in 1 too when aiming correctly which is hard)
-set g_projectiles_newton_style_2_minfactor 0.8
-set g_projectiles_newton_style_2_maxfactor 1.5
-set g_projectiles_spread_style 7
-// possible values:
-// 0: forward + solid sphere (like Quake) - varies velocity
-// 1: forward + flattened solid sphere
-// 2: forward + solid circle
-// 3: forward + normal distribution 3D - varies velocity
-// 4: forward + normal distribution on a plane
-// 5: forward + circle with 1-r falloff
-// 6: forward + circle with 1-r^2 falloff
-// 7: forward + circle with (1-r)(2-r) falloff
-set g_balance_falldamage_deadminspeed 250
-set g_balance_falldamage_minspeed 900
-set g_balance_falldamage_factor 0.20
-set g_balance_falldamage_maxdamage 40
-set g_balance_falldamage_onlyvertical 0
-set g_balance_damagepush_speedfactor 2.5
-set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
-set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
-set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
-set g_balance_contents_playerdamage_lava 50 // damage per second for while player is inside lava
-set g_balance_contents_playerdamage_lava_burn 0 // extra burning damage after leaving lava
-set g_balance_contents_playerdamage_lava_burn_time 2.5 // time across which the damage is applied (note: not dps!)
-set g_balance_contents_playerdamage_slime 30 // damage per second for while player is inside slime
-set g_balance_contents_projectiledamage 10000 // instantly kill projectiles upon touching lava/slime
-set g_maxpushtime 8.0 "timeout for kill credit when your damage knocks someone into a death trap"
-// }}}
-
-// {{{ powerups
-set g_balance_powerup_invincible_takedamage 0.33 // only 1/3rd damage is taken
-set g_balance_powerup_invincible_takeforce 0.33
-set g_balance_powerup_invincible_time 30
-set g_balance_powerup_strength_damage 3
-set g_balance_powerup_strength_force 3
-set g_balance_powerup_strength_time 30
-set g_balance_powerup_strength_selfdamage 1.5
-set g_balance_powerup_strength_selfforce 1.5
-set g_balance_superweapons_time 30
-// }}}
-
-// {{{ jetpack/hook
-set g_jetpack_antigravity 0.8 "factor of gravity compensation of the jetpack"
-set g_jetpack_acceleration_side 1200 "acceleration of the jetpack in xy direction"
-set g_jetpack_acceleration_up 600 "acceleration of the jetpack in z direction (note: you have to factor in gravity here, if antigravity is not 1)"
-set g_jetpack_maxspeed_side 1200 "max speed of the jetpack in xy direction"
-set g_jetpack_maxspeed_up 600 "max speed of the jetpack in z direction"
-set g_jetpack_fuel 8 "fuel per second for jetpack"
-set g_jetpack_reverse_thrust 0 "if not 0, downward acceleration when crouching with the jetpack"
-
-set g_grappling_hook_tarzan 2 // 2: can also pull players
-set g_balance_grapplehook_speed_fly 1800
-set g_balance_grapplehook_speed_pull 2000
-set g_balance_grapplehook_force_rubber 2000
-set g_balance_grapplehook_force_rubber_overstretch 1000
-set g_balance_grapplehook_length_min 50
-set g_balance_grapplehook_stretch 50
-set g_balance_grapplehook_airfriction 0.2
-set g_balance_grapplehook_health 50
-set g_balance_grapplehook_damagedbycontents 1
-set g_balance_grapplehook_refire 0.2
-set g_balance_grapplehook_nade_time 0.7
-set g_balance_grapplehook_crouchslide 0
-set g_balance_grapplehook_gravity 0
-set g_balance_grapplehook_pull_frozen 0
-// }}}
-
-// {{{ port-o-launch
-set g_balance_portal_health 200 // these get recharged whenever the portal is used
-set g_balance_portal_lifetime 15 // these get recharged whenever the portal is used
-// }}}
-
-exec bal-wep-testing.cfg
+exec balance-xpm.cfg
+g_mod_balance XPM // XPM is technically modified anyway, this way it'll stay in the right category
+testing_enable
g_mod_balance XDF
+testing_disable
// {{{ starting gear
set g_balance_health_start 100
g_mod_balance Xonotic
+testing_disable
// {{{ starting gear
set g_balance_health_start 100
g_mod_balance XPM
+testing_disable
// {{{ starting gear
set g_balance_health_start 100
{
countw=`awk ''"$3"' { print $2; }' "$1" | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32`
for b in $2; do
+ if [ "$b" = "balance-testing.cfg" ] || [ "$b" = "balance-testingxpm.cfg" ]; then
+ continue
+ fi
+
countb=`awk ''"$3"' { print $2; }' "$b" | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32`
if [ "$countw" != "$countb" ]; then
- echo "Mismatch between "$1" and $b. Aborting."
+ echo "Mismatch between $1 and $b. Aborting."
echo "Differences are:"
echo "< missing in $b"
echo "> must get removed from $b"
A=`mktemp || echo a.tmp`
B=`mktemp || echo b.tmp`
- awk ''"$3"' { print $2; }' "$1" | sort -u | tr -d '\r' > "$A"
- awk ''"$3"' { print $2; }' "$b" | sort -u | tr -d '\r' > "$B"
+ awk ''"$3"' { print $2; }' "$1" | sort -u | tr -d '\r' > "$A"
+ awk ''"$3"' { print $2; }' "$b" | sort -u | tr -d '\r' > "$B"
diff "$A" "$B" | grep '^[<>]' | sort
rm -f "$A" "$B"
errord=true
alias g_maplist_cleanup "qc_cmd_svmenu maplist cleanup" // removes maps that don't exist from the map list
alias addfav "qc_cmd_svmenu addtolist net_slist_favorites ${* ?}"
+alias delfav "qc_cmd_svmenu removefromlist net_slist_favorites ${* ?}"
alias addvote "qc_cmd_svmenu addtolist sv_vote_commands ${* ?}"
+alias delvote "qc_cmd_svmenu removefromlist sv_vote_commands ${* ?}"
// ========================
// =================================
set sv_vote_call 1 "Allow users to call a vote for the commands in sv_vote_commands"
set sv_vote_change 1 "Allow voters to change their mind after already voting"
-set sv_vote_commands "restart fraglimit chmap gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoauto shuffleteams bots nobots" "these commands can be voted by players or used directly by masters (vdo) in addition to sv_vote_master_commands"
+set sv_vote_commands "restart fraglimit gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoauto shuffleteams bots nobots" "these commands can be voted by players or used directly by masters (vdo) in addition to sv_vote_master_commands"
set sv_vote_only_commands ""
set sv_vote_limit 160 "Maximum allowed length of a vote command"
set sv_vote_master_commands "movetored movetoblue movetoyellow movetopink movetospec" "Extra commands which vote masters can execute by themselves, along with the normal sv_vote_commands." // maybe add kickban here (but then sv_vote_master 0)
#
# Translators:
# Ximielga <dorian@openmailbox.org>, 2014-2015
-# Ḷḷumex03 <tornes@opmbx.org>, 2014
-# Ḷḷumex03 <tornes@opmbx.org>, 2014-2015
+# Ḷḷumex03, 2014
+# Ḷḷumex03, 2014
+# Ḷḷumex03, 2014-2015
# Tornes Ḷḷume <tornes.llume@openmailbox.org>, 2015-2017
# Ximielga <dorian@openmailbox.org>, 2014
msgid ""
# Jakub P. <pedziszewski@gmail.com>, 2015
# Jakub P. <pedziszewski@gmail.com>, 2015
# John Smith <myrangd@gmail.com>, 2016
-# karol kosek <transifex@krkk.ct8.pl>, 2020
-# karol kosek <transifex@krkk.ct8.pl>, 2020
-# karol kosek <transifex@krkk.ct8.pl>, 2020
-# karol kosek <transifex@krkk.ct8.pl>, 2020
+# Karol Kosek, 2020
+# Karol Kosek, 2020
+# Karol Kosek, 2020
+# Karol Kosek, 2020
+# Karol Kosek, 2020
# Kriss Chr <kriss7475@gmail.com>, 2017
# Piotr Kozica <koza91@gmail.com>, 2016
# Rafał Szymański <okavasly@gmail.com>, 2017
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-19 07:23+0200\n"
"PO-Revision-Date: 2020-02-08 12:09+0000\n"
-"Last-Translator: karol kosek <transifex@krkk.ct8.pl>\n"
+"Last-Translator: Karol Kosek\n"
"Language-Team: Polish (http://www.transifex.com/team-xonotic/xonotic/"
"language/pl/)\n"
"Language: pl\n"
trailspacing 32
underwater
velocityjitter 16 16 16
+effect TE_TEI_G3_HIT
+ type beam
+ alpha 128 128 256
+ color 0xFFFFFF 0xFFFFFF
+ countabsolute 1
+ size 8 8
+ tex 200 200
+effect TE_TEI_G3_HIT
+ type smoke
+ airfriction -4
+ alpha 256 256 512
+ color 0xFFFFFF 0xFFFFFF
+ sizeincrease -2
+ size 2 2
+ trailspacing 20
+ velocityjitter 2 2 2
+effect TE_TEI_G3_HIT
+ type smoke
+ airfriction -4
+ alpha 256 256 512
+ color 0xFFFFFF 0xFFFFFF
+ sizeincrease -6
+ size 10 10
+ trailspacing 40
// ===========
// this means that timelimit can be overidden globally and fraglimit can be overidden for each game mode: DM/TDM, Domination, CTF, and Runematch.
set leadlimit 0
-set leadlimit_and_fraglimit 0 "if set, leadlimit is ANDed with fraglimit (otherwise ORed)"
+set leadlimit_and_fraglimit 0 "both leadlimit AND fraglimit must be reached"
set timelimit_override -1 "Time limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
set fraglimit_override -1 "Frag limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
set leadlimit_override -1 "Lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
seta hud_progressbar_health_color "0.83 0.12 0"
seta hud_progressbar_armor_color "0.28 0.8 0"
seta hud_progressbar_fuel_color "0.77 0.67 0"
+seta hud_progressbar_oxygen_color "0.1 1 1"
seta hud_progressbar_nexball_color "0.2 0.65 0.93"
seta hud_progressbar_speed_color "0.77 0.67 0"
seta hud_progressbar_acceleration_color "0.2 0.65 0.93"
seta hud_panel_centerprint_align "0.5"
seta hud_panel_centerprint_flip "0"
seta hud_panel_centerprint_fontscale "1"
+seta hud_panel_centerprint_fontscale_bold "1.8"
seta hud_panel_centerprint_time "3"
seta hud_panel_centerprint_fade_in "0.2"
seta hud_panel_centerprint_fade_out "0.5"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_panel_centerprint_align "0.5"
seta hud_panel_centerprint_flip "0"
seta hud_panel_centerprint_fontscale "1"
+seta hud_panel_centerprint_fontscale_bold "1.8"
seta hud_panel_centerprint_time "3"
seta hud_panel_centerprint_fade_in "0.2"
seta hud_panel_centerprint_fade_out "0.5"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_panel_centerprint_align "0.5"
seta hud_panel_centerprint_flip "0"
seta hud_panel_centerprint_fontscale "1"
+seta hud_panel_centerprint_fontscale_bold "1.8"
seta hud_panel_centerprint_time "3"
seta hud_panel_centerprint_fade_in "0.2"
seta hud_panel_centerprint_fade_out "0.5"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_panel_centerprint_align "0.5"
seta hud_panel_centerprint_flip "0"
seta hud_panel_centerprint_fontscale "1"
+seta hud_panel_centerprint_fontscale_bold "1.8"
seta hud_panel_centerprint_time "3"
seta hud_panel_centerprint_fade_in "0.2"
seta hud_panel_centerprint_fade_out "0.5"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_panel_centerprint_align "0.5"
seta hud_panel_centerprint_flip "0"
seta hud_panel_centerprint_fontscale "1"
+seta hud_panel_centerprint_fontscale_bold "1.8"
seta hud_panel_centerprint_time "3"
seta hud_panel_centerprint_fade_in "0.2"
seta hud_panel_centerprint_fade_out "0.5"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_panel_centerprint_align "0.5"
seta hud_panel_centerprint_flip "0"
seta hud_panel_centerprint_fontscale "1"
+seta hud_panel_centerprint_fontscale_bold "1.8"
seta hud_panel_centerprint_time "3"
seta hud_panel_centerprint_fade_in "0.2"
seta hud_panel_centerprint_fade_out "0.5"
set g_dodging 0 "set to 1 to enable dodging (quick acceleration in a given direction)"
seta cl_dodging_timeout 0.2 "determines how long apart (in seconds) two taps on the same direction key are considered a dodge. use 0 to disable"
+seta cl_dodging 0 "enable dodging, requires sv_dodging_clientselect to be enabled on the server"
set sv_dodging_air_dodging 0
set sv_dodging_wall_dodging 0 "allow dodging off walls"
set sv_dodging_frozen_doubletap 0
set sv_dodging_maxspeed 350 "maximum speed a player can be moving at to use the standard dodging from an (almost) standstill"
set sv_dodging_air_maxspeed 450 "maximum speed a player can be moving at before they dodge again when air dodging is enabled"
+set sv_dodging_clientselect 0 "allow clients to opt-in to dodging movement with the cl_dodging cvar, dodging will be off for clients by default with this enabled"
// ===========
set g_campcheck_interval 10
set g_campcheck_damage 100
set g_campcheck_distance 1800
+set g_campcheck_typecheck 0 "damage campers who are typing"
// ==========
// ===========
// multijump
// ===========
-seta cl_multijump 1 "allow multijump mutator"
+seta cl_multijump -1 "allow multijump mutator, set to -1 for the server to decide whether it's enabled"
set g_multijump 0 "Number of multiple jumps to allow (jumping again in the air), -1 allows for infinite jumps"
+set g_multijump_client 1 "If the client sets cl_multijump to -1, this setting is used for them as a default"
set g_multijump_add 0 "0 = make the current z velocity equal to jumpvelocity, 1 = add jumpvelocity to the current z velocity"
set g_multijump_speed -999999 "Minimum vertical speed a player must have in order to jump again"
set g_multijump_maxspeed 0
set g_random_items 0 "Whether to enable random items."
set g_random_loot 0 "Whether to enable random loot."
exec randomitems-xonotic.cfg
+
+// ===============
+// pinata
+// ===============
+set g_pinata 0 "if set to 1 you will not only drop your current weapon when you are killed, but you will drop all weapons that you possessed"
+set g_pinata_offhand 0 "if enabled, the second weapon will drop as well while dual wielding"
seta notification_INFO_WEAPON_VAPORIZER_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_WEAPON_VORTEX_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
-// MSG_CENTER notifications (count = 239):
+// MSG_CENTER notifications (count = 240):
seta notification_CENTER_ALONE "1" "0 = off, 1 = centerprint"
seta notification_CENTER_ASSAULT_ATTACKING "1" "0 = off, 1 = centerprint"
seta notification_CENTER_ASSAULT_DEFENDING "1" "0 = off, 1 = centerprint"
seta notification_CENTER_ASSAULT_OBJ_DESTROYED "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_CAMPAIGN_MESSAGE "1" "0 = off, 1 = centerprint"
seta notification_CENTER_CAMPCHECK "1" "0 = off, 1 = centerprint"
seta notification_CENTER_COINTOSS "1" "0 = off, 1 = centerprint"
seta notification_CENTER_COUNTDOWN_BEGIN "1" "0 = off, 1 = centerprint"
seta notification_show_sprees_info_newline "1" "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself"
seta notification_show_sprees_info_specialonly "1" "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement"
-// Notification counts (total = 846): MSG_ANNCE = 89, MSG_INFO = 334, MSG_CENTER = 239, MSG_MULTI = 156, MSG_CHOICE = 28
+// Notification counts (total = 847): MSG_ANNCE = 89, MSG_INFO = 334, MSG_CENTER = 240, MSG_MULTI = 156, MSG_CHOICE = 28
float autocvar_hud_panel_centerprint_fade_minfontsize = 0;
bool autocvar_hud_panel_centerprint_flip;
float autocvar_hud_panel_centerprint_fontscale;
+float autocvar_hud_panel_centerprint_fontscale_bold = 1.8;
float autocvar_hud_panel_centerprint_time;
bool autocvar_hud_panel_chat;
bool autocvar_hud_panel_engineinfo;
float autocvar_hud_progressbar_alpha;
vector autocvar_hud_progressbar_armor_color;
vector autocvar_hud_progressbar_fuel_color;
+vector autocvar_hud_progressbar_oxygen_color = '0.1 1 1';
vector autocvar_hud_progressbar_health_color;
vector autocvar_hud_progressbar_nexball_color;
vector autocvar_hud_progressbar_shield_color;
float autocvar_cl_hitsound_antispam_time;
bool autocvar_cl_eventchase_spectated_change = false;
float autocvar_cl_eventchase_spectated_change_time = 1;
-int autocvar_cl_eventchase_death = 1;
+int autocvar_cl_eventchase_death = 2;
float autocvar_cl_eventchase_distance = 140;
bool autocvar_cl_eventchase_frozen = false;
float autocvar_cl_eventchase_speed = 1.3;
HUD_Write_Cvar("hud_progressbar_health_color");
HUD_Write_Cvar("hud_progressbar_armor_color");
HUD_Write_Cvar("hud_progressbar_fuel_color");
+ HUD_Write_Cvar("hud_progressbar_oxygen_color");
HUD_Write_Cvar("hud_progressbar_nexball_color");
HUD_Write_Cvar("hud_progressbar_speed_color");
HUD_Write_Cvar("hud_progressbar_acceleration_color");
HUD_Write_Cvar("hud_panel_centerprint_align");
HUD_Write_Cvar("hud_panel_centerprint_flip");
HUD_Write_Cvar("hud_panel_centerprint_fontscale");
+ HUD_Write_Cvar("hud_panel_centerprint_fontscale_bold");
HUD_Write_Cvar("hud_panel_centerprint_time");
HUD_Write_Cvar("hud_panel_centerprint_fade_in");
HUD_Write_Cvar("hud_panel_centerprint_fade_out");
#include <client/miscfunctions.qh>
// CenterPrint (#16)
+// These are the functions that draw the text at the center of the screen (e.g. frag messages and server MOTDs).
+// Usually local_notification_centerprint_generic() is called, which in turn calls centerprint_generic(), which
+// uses some kind of macro magic to call HUD_CenterPrint, which draws them on screen using drawcolorcodedstring().
const int CENTERPRINT_MAX_MSGS = 10;
const int CENTERPRINT_MAX_ENTRIES = 50;
strfree(centerprint_messages[i]);
}
}
+
float hud_configure_cp_generation_time;
void HUD_CenterPrint ()
{
panel_size -= '2 2 0' * panel_bg_padding;
}
+ bool is_bold;
+ string centerprint_message;
int entries;
float height;
vector fontsize;
- // entries = bound(1, floor(CENTERPRINT_MAX_ENTRIES * 4 * panel_size_y/panel_size_x), CENTERPRINT_MAX_ENTRIES);
- // height = panel_size_y/entries;
- // fontsize = '1 1 0' * height;
- height = vid_conheight/50 * autocvar_hud_panel_centerprint_fontscale;
- fontsize = '1 1 0' * height;
- entries = bound(1, floor(panel_size.y/height), CENTERPRINT_MAX_ENTRIES);
int i, j, k, n, g;
float a, sz, align, current_msg_posY = 0, msg_size;
align = bound(0, autocvar_hud_panel_centerprint_align, 1);
for (g=0, i=0, j=cpm_index; i<CENTERPRINT_MAX_MSGS; ++i, ++j)
{
+ // if the notification starts with ^BOLD make it bold (e.g. frag messages);
+ is_bold = (substring(centerprint_messages[j], 0, 5) == BOLD_OPERATOR);
+ // remove ^BOLD so it doesn't get printed onscreen
+ centerprint_message = is_bold ? strzone(substring(centerprint_messages[j], 5, -1)) : strzone(centerprint_messages[j]);
+
+ // entries = bound(1, floor(CENTERPRINT_MAX_ENTRIES * 4 * panel_size_y/panel_size_x), CENTERPRINT_MAX_ENTRIES);
+ // height = panel_size_y/entries;
+ // fontsize = '1 1 0' * height;
+ height = (is_bold) ? vid_conheight/50 * autocvar_hud_panel_centerprint_fontscale_bold : vid_conheight/50 * autocvar_hud_panel_centerprint_fontscale;
+ fontsize = '1 1 0' * height;
+ entries = bound(1, floor(panel_size.y/height), CENTERPRINT_MAX_ENTRIES);
+
if (j == CENTERPRINT_MAX_MSGS)
j = 0;
if (centerprint_expire_time[j] == -1)
drawfontscale = hud_scale * sz;
if (centerprint_countdown_num[j])
- n = tokenizebyseparator(strreplace("^COUNT", count_seconds(centerprint_countdown_num[j]), centerprint_messages[j]), "\n");
+ n = tokenizebyseparator(strreplace("^COUNT", count_seconds(centerprint_countdown_num[j]), centerprint_message), "\n");
else
- n = tokenizebyseparator(centerprint_messages[j], "\n");
+ n = tokenizebyseparator(centerprint_message, "\n");
if (autocvar_hud_panel_centerprint_flip)
{
if (align)
pos.x = panel_pos.x + (panel_size.x - stringwidth(ts, true, fontsize) * sz) * align;
if (a > 0.5/255.0) // Otherwise guaranteed invisible - don't show. This is checked a second time after some multiplications with other factors were done so temporary changes of these cannot cause flicker.
+ if (is_bold) draw_beginBoldFont();
drawcolorcodedstring(pos + eY * 0.5 * (1 - sz * hud_scale.x) * fontsize.y, ts, fontsize, a, DRAWFLAG_NORMAL);
+ if (is_bold) draw_endBoldFont();
pos.y += fontsize.y;
}
else
return;
}
}
+
+ // free up memory
+ strunzone(centerprint_message);
}
drawfontscale = hud_scale;
if (all_messages_expired)
void HUD_HealthArmor()
{
- int armor, health, fuel;
+ int armor, health, fuel, air_time;
if(!autocvar__hud_configure)
{
if((!autocvar_hud_panel_healtharmor) || (spectatee_status == -1))
prev_armor = 0;
}
fuel = STAT(FUEL);
+ air_time = bound(0, STAT(AIR_FINISHED) - time, 10);
}
else
{
health = 150;
armor = 75;
fuel = 20;
+ air_time = 6;
}
HUD_Panel_LoadCvars();
mySize -= '2 2 0' * panel_bg_padding;
}
+ float air_alpha = 1;
+ if (STAT(AIR_FINISHED) && time > STAT(AIR_FINISHED))
+ {
+ air_alpha = blink_synced(0.5, 0.5, 7, STAT(AIR_FINISHED), -1);
+ air_time = 10;
+ }
+
int baralign = autocvar_hud_panel_healtharmor_baralign;
int iconalign = autocvar_hud_panel_healtharmor_iconalign;
if(fuel)
HUD_Panel_DrawProgressBar(pos, vec2(mySize.x, 0.2 * mySize.y), "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ if(air_time)
+ HUD_Panel_DrawProgressBar(pos + eY * 0.8 * mySize.y, vec2(mySize.x, 0.2 * mySize.y), "progressbar", air_time / 10, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_oxygen_color, air_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
else
{
armor_offset.y = mySize.y;
}
- bool health_baralign, armor_baralign, fuel_baralign;
+ bool health_baralign, armor_baralign, fuel_baralign, air_align;
bool health_iconalign, armor_iconalign;
if (autocvar_hud_panel_healtharmor_flip)
{
armor_baralign = (autocvar_hud_panel_healtharmor_baralign == 2 || autocvar_hud_panel_healtharmor_baralign == 1);
health_baralign = (autocvar_hud_panel_healtharmor_baralign == 3 || autocvar_hud_panel_healtharmor_baralign == 1);
- fuel_baralign = health_baralign;
+ air_align = fuel_baralign = health_baralign;
armor_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 2 || autocvar_hud_panel_healtharmor_iconalign == 1);
health_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 3 || autocvar_hud_panel_healtharmor_iconalign == 1);
}
{
health_baralign = (autocvar_hud_panel_healtharmor_baralign == 2 || autocvar_hud_panel_healtharmor_baralign == 1);
armor_baralign = (autocvar_hud_panel_healtharmor_baralign == 3 || autocvar_hud_panel_healtharmor_baralign == 1);
- fuel_baralign = armor_baralign;
+ air_align = fuel_baralign = armor_baralign;
health_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 2 || autocvar_hud_panel_healtharmor_iconalign == 1);
armor_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 3 || autocvar_hud_panel_healtharmor_iconalign == 1);
}
if (health <= autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth)
{
- float BLINK_FACTOR = 0.15;
- float BLINK_BASE = 0.85;
- float BLINK_FREQ = 9;
- pain_health_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
+ pain_health_alpha = blink(0.85, 0.15, 9);
}
}
HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, p_health/maxhealth, is_vertical, health_baralign, autocvar_hud_progressbar_health_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * pain_health_alpha, DRAWFLAG_NORMAL);
DrawNumIcon(pos + armor_offset, mySize, armor, "armor", is_vertical, armor_iconalign, HUD_Get_Num_Color(armor, maxarmor), 1);
}
- if(fuel)
+ vector cell_size = mySize;
+ if (fuel || air_time)
{
if (is_vertical)
mySize.x *= 0.2 / 2; //if vertical always halve x to not cover too much numbers with 3 digits
mySize.x *= 2; //restore full panel size
else if (panel_ar < 1/4)
mySize.y *= 2; //restore full panel size
- HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, fuel_baralign, autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ if (fuel)
+ HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, fuel_baralign, autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ if (air_time)
+ {
+ if (panel_ar > 1 && panel_ar < 4)
+ pos.y += cell_size.y;
+ else if (panel_ar > 1/4 && panel_ar <= 1)
+ pos.x += cell_size.x;
+ if (is_vertical)
+ pos.x += cell_size.x - mySize.x;
+ else
+ pos.y += cell_size.y - mySize.y;
+ HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", air_time / 10, is_vertical, air_align, autocvar_hud_progressbar_oxygen_color, air_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ }
}
}
draw_endBoldFont();
// Game Info: Game Detail
- float tl, fl, ll;
- str = ""; // optionally "^7Limits: "
- tl = STAT(TIMELIMIT);
- fl = STAT(FRAGLIMIT);
- ll = STAT(LEADLIMIT);
+ float tl = STAT(TIMELIMIT);
+ float fl = STAT(FRAGLIMIT);
+ float ll = STAT(LEADLIMIT);
+ float ll_and_fl = STAT(LEADLIMIT_AND_FRAGLIMIT);
+ str = "";
if(tl > 0)
str = strcat(str, sprintf(_("^3%1.0f minutes"), tl));
if(!ISGAMETYPE(LMS))
if(ll > 0)
{
if(tl > 0 || fl > 0)
- str = strcat(str, "^7 / "); // delimiter
+ {
+ // delimiter
+ if (ll_and_fl && fl > 0)
+ str = strcat(str, "^7 & ");
+ else
+ str = strcat(str, "^7 / ");
+ }
+
if(teamplay)
{
str = strcat(str, sprintf(_("^2+%s %s"), ScoreString(teamscores_flags(ts_primary), ll),
registercvar("cl_shootfromfixedorigin", "");
- registercvar("cl_multijump", "1");
+ registercvar("cl_multijump", "-1");
registercvar("cl_spawn_near_teammate", "1");
return boxsize * (0.5 * (1 - sz));
}
+// NOTE base is the central value
+// freq: circle frequency, = 2*pi*frequency in hertz
+// start_pos:
+// -1 start from the lower value
+// 0 start from the base value
+// 1 start from the higher value
+float blink_synced(float base, float range, float freq, float start_time, int start_pos)
+{
+ // note:
+ // RMS = sqrt(base^2 + 0.5 * range^2)
+ // thus
+ // base = sqrt(RMS^2 - 0.5 * range^2)
+ // ensure RMS == 1
+
+ return base + range * sin((time - start_time - (M_PI / 2) * start_pos) * freq);
+}
+
+float blink(float base, float range, float freq)
+{
+ return blink_synced(base, range, freq, 0, 0);
+}
+
void drawborderlines(float thickness, vector pos, vector dim, vector color, float theAlpha, float drawflag)
{
vector line_dim = '0 0 0';
void DrawCircleClippedPic(vector centre, float radi, string pic, float f, vector rgb, float a, float drawflag)
{
- float d;
vector ringsize, v, t;
ringsize = radi * '1 1 0';
centre = HUD_Shift(centre);
ringsize = HUD_Scale(ringsize);
- float co = cos(f * 2 * M_PI);
- float si = sin(f * 2 * M_PI);
- float q = fabs(co) + fabs(si);
- co /= q;
- si /= q;
-
if(f >= 1)
{
// draw full rectangle
v.y -= 0.5 * ringsize.y; t -= '0.5 -0.5 0';
R_PolygonVertex(v, t, rgb, a);
R_EndPolygon();
+ return; // Complete rectangle, nothing more needed.
+ }
- d = q - 1;
- if(d > 0)
- {
- R_BeginPolygon(pic, drawflag, true);
- v = centre; t = '0.5 0.5 0';
- R_PolygonVertex(v, t, rgb, a);
+ float co = cos(f * 2 * M_PI);
+ float si = sin(f * 2 * M_PI);
+ float q = fabs(co) + fabs(si);
+ co /= q;
+ si /= q;
- v = centre; t = '0.5 0.5 0';
- v.x += 0.5 * ringsize.x; t += '0.5 0.5 0';
- R_PolygonVertex(v, t, rgb, a);
- }
- }
- else if(f > 0.75)
+ if(f > 0.75)
{
- // draw upper and first triangle
+ // draw upper half in full
R_BeginPolygon(pic, drawflag, true);
v = centre; t = '0.5 0.5 0';
v.x += 0.5 * ringsize.x; t += '0.5 0.5 0';
v.x -= 0.5 * ringsize.x; t -= '0.5 0.5 0';
R_PolygonVertex(v, t, rgb, a);
R_EndPolygon();
+ // draw clipped lower half as a quad
R_BeginPolygon(pic, drawflag, true);
v = centre; t = '0.5 0.5 0';
R_PolygonVertex(v, t, rgb, a);
v = centre; t = '0.5 0.5 0';
v.y -= 0.5 * ringsize.y; t -= '0.5 -0.5 0';
R_PolygonVertex(v, t, rgb, a);
-
- d = q - 0.75;
- if(d <= 0)
- R_EndPolygon();
}
else if(f > 0.5)
{
- // draw upper triangle
+ // draw upper half in full
R_BeginPolygon(pic, drawflag, true);
v = centre; t = '0.5 0.5 0';
v.x += 0.5 * ringsize.x; t += '0.5 0.5 0';
v.x -= 0.5 * ringsize.x; t -= '0.5 0.5 0';
R_PolygonVertex(v, t, rgb, a);
R_EndPolygon();
+ // draw clipped lower half as a triangle
+ R_BeginPolygon(pic, drawflag, true);
+ v = centre; t = '0.5 0.5 0';
+ R_PolygonVertex(v, t, rgb, a);
- d = q - 0.5;
- if(d > 0)
- {
- R_BeginPolygon(pic, drawflag, true);
- v = centre; t = '0.5 0.5 0';
- R_PolygonVertex(v, t, rgb, a);
-
- v = centre; t = '0.5 0.5 0';
- v.x -= 0.5 * ringsize.x; t -= '0.5 0.5 0';
- R_PolygonVertex(v, t, rgb, a);
- }
+ v = centre; t = '0.5 0.5 0';
+ v.x -= 0.5 * ringsize.x; t -= '0.5 0.5 0';
+ R_PolygonVertex(v, t, rgb, a);
}
else if(f > 0.25)
{
- // draw first triangle
+ // draw clipped lower half as a quad
R_BeginPolygon(pic, drawflag, true);
v = centre; t = '0.5 0.5 0';
R_PolygonVertex(v, t, rgb, a);
v = centre; t = '0.5 0.5 0';
v.y += 0.5 * ringsize.y; t += '0.5 -0.5 0';
R_PolygonVertex(v, t, rgb, a);
-
- d = q - 0.25;
- if(d <= 0)
- R_EndPolygon();
}
- else
+ else if (f > 0)
{
- d = q;
- if(d > 0)
- {
- R_BeginPolygon(pic, drawflag, true);
- v = centre; t = '0.5 0.5 0';
- R_PolygonVertex(v, t, rgb, a);
-
- v = centre; t = '0.5 0.5 0';
- v.x += 0.5 * ringsize.x; t += '0.5 0.5 0';
- R_PolygonVertex(v, t, rgb, a);
- }
- }
+ // draw clipped lower half as a triangle
+ R_BeginPolygon(pic, drawflag, true);
+ v = centre; t = '0.5 0.5 0';
+ R_PolygonVertex(v, t, rgb, a);
- if(d > 0)
- {
v = centre; t = '0.5 0.5 0';
- v.x += co * 0.5 * ringsize.x; t += co * '0.5 0.5 0';
- v.y += si * 0.5 * ringsize.y; t += si * '0.5 -0.5 0';
+ v.x += 0.5 * ringsize.x; t += '0.5 0.5 0';
R_PolygonVertex(v, t, rgb, a);
- R_EndPolygon();
}
+ else
+ {
+ // Nothing to draw.
+ return;
+ }
+
+ // The last, moving vertex.
+ v = centre; t = '0.5 0.5 0';
+ v.x += co * 0.5 * ringsize.x; t += co * '0.5 0.5 0';
+ v.y += si * 0.5 * ringsize.y; t += si * '0.5 -0.5 0';
+ R_PolygonVertex(v, t, rgb, a);
+ R_EndPolygon();
}
/** engine callback */
vector expandingbox_resize_centered_box_offset(float sz, vector boxsize, float boxxsizefactor);
+float blink_synced(float base, float range, float freq, float start_time, int start_blink);
+float blink(float base, float range, float freq);
+
void drawborderlines(float thickness, vector pos, vector dim, vector color, float theAlpha, float drawflag);
void drawpic_tiled(vector pos, string pic, vector sz, vector area, vector color, float theAlpha, float drawflag);
}
if (autocvar_crosshair_ring_inner && ring_inner_value) // lets draw a ring inside a ring so you can ring while you ring
- DrawCircleClippedPic(wcross_origin, wcross_size.x * ring_scale, ring_inner_image, ring_inner_value, ring_inner_rgb, wcross_alpha * ring_inner_alpha, DRAWFLAG_ADDITIVE);
+ DrawCircleClippedPic(wcross_origin, wcross_size.x * wcross_resolution * ring_scale, ring_inner_image, ring_inner_value, ring_inner_rgb, wcross_alpha * ring_inner_alpha, DRAWFLAG_ADDITIVE);
if (ring_value)
- DrawCircleClippedPic(wcross_origin, wcross_size.x * ring_scale, ring_image, ring_value, ring_rgb, wcross_alpha * ring_alpha, DRAWFLAG_ADDITIVE);
+ DrawCircleClippedPic(wcross_origin, wcross_size.x * wcross_resolution * ring_scale, ring_image, ring_value, ring_rgb, wcross_alpha * ring_alpha, DRAWFLAG_ADDITIVE);
}
#define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \
MY(underwater) = true;
MY(velocityjitter) = '16.0 16.0 16.0';
}
+
+// Vaporizer hit effect
+DEF(TE_TEI_G3_HIT);
+SUB(TE_TEI_G3_HIT) {
+ MY(alpha_min) = 128;
+ MY(alpha_max) = 128;
+ MY(alpha_fade) = 256;
+ MY(color_min) = "0xFFFFFF";
+ MY(color_max) = "0xFFFFFF";
+ MY(countabsolute) = 1;
+ MY(size_min) = 8;
+ MY(size_max) = 8;
+ MY(tex_min) = 200;
+ MY(tex_max) = 200;
+ MY(type) = "beam";
+}
+SUB(TE_TEI_G3_HIT) /* rings */ {
+ MY(airfriction) = -4;
+ MY(alpha_min) = 256;
+ MY(alpha_max) = 256;
+ MY(alpha_fade) = 512;
+ MY(color_min) = "0xFFFFFF";
+ MY(color_max) = "0xFFFFFF";
+ MY(sizeincrease) = -2;
+ MY(size_min) = 2;
+ MY(size_max) = 2;
+ MY(trailspacing) = 20;
+ MY(type) = "smoke";
+ MY(velocityjitter) = '2.0 2.0 2.0';
+}
+SUB(TE_TEI_G3_HIT) {
+ MY(airfriction) = -4;
+ MY(alpha_min) = 256;
+ MY(alpha_max) = 256;
+ MY(alpha_fade) = 512;
+ MY(color_min) = "0xFFFFFF";
+ MY(color_max) = "0xFFFFFF";
+ MY(sizeincrease) = -6;
+ MY(size_min) = 10;
+ MY(size_max) = 10;
+ MY(trailspacing) = 40;
+ MY(type) = "smoke";
+}
X(neutral);
#undef X
- const float BLINK_FACTOR = 0.15;
- const float BLINK_BASE = 0.85;
- // note:
- // RMS = sqrt(BLINK_BASE^2 + 0.5 * BLINK_FACTOR^2)
- // thus
- // BLINK_BASE = sqrt(RMS^2 - 0.5 * BLINK_FACTOR^2)
- // ensure RMS == 1
- const float BLINK_FREQ = 5; // circle frequency, = 2*pi*frequency in hertz
-
#define X(team, cond) \
string team##_icon = string_null, team##_icon_prevstatus = string_null; \
int team##_alpha, team##_alpha_prevstatus; \
switch (team##flag) { \
case 1: team##_icon = "flag_" #team "_taken"; break; \
case 2: team##_icon = "flag_" #team "_lost"; break; \
- case 3: team##_icon = "flag_" #team "_carrying"; team##_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; \
+ case 3: team##_icon = "flag_" #team "_carrying"; team##_alpha = blink(0.85, 0.15, 5); break; \
default: \
if ((stat_items & CTF_SHIELDED) && (cond)) { \
team##_icon = "flag_" #team "_shielded"; \
switch (team##flag_prevstatus) { \
case 1: team##_icon_prevstatus = "flag_" #team "_taken"; break; \
case 2: team##_icon_prevstatus = "flag_" #team "_lost"; break; \
- case 3: team##_icon_prevstatus = "flag_" #team "_carrying"; team##_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; \
+ case 3: team##_icon_prevstatus = "flag_" #team "_carrying"; team##_alpha_prevstatus = blink(0.85, 0.15, 5); break; \
default: \
if (team##flag == 3) { \
team##_icon_prevstatus = "flag_" #team "_carrying"; /* make it more visible */\
if(!flag) { return; }
if((droptype == DROP_PASS) && !receiver) { return; }
- if(flag.speedrunning) { ctf_RespawnFlag(flag); return; }
+ if(flag.speedrunning)
+ {
+ // ensure old waypoints are removed before resetting the flag
+ WaypointSprite_Kill(player.wps_flagcarrier);
+
+ if(player.wps_enemyflagcarrier)
+ WaypointSprite_Kill(player.wps_enemyflagcarrier);
+
+ if(player.wps_flagreturn)
+ WaypointSprite_Kill(player.wps_flagreturn);
+ ctf_RespawnFlag(flag);
+ return;
+ }
// reset the flag
setattachment(flag, NULL, "");
.float last_respawn;
void ctf_RespawnFlag(entity flag)
{
+ flag.watertype = CONTENT_EMPTY; // TODO: it is unclear why this workaround is needed, likely many other potential breakage points!!
// check for flag respawn being called twice in a row
if(flag.last_respawn > time - 0.5)
{ backtrace("flag respawn called twice quickly! please notify Samual about this..."); }
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
- TeamScore_AddToTeam(winner_team, ST_SCORE, +1);
+ TeamScore_AddToTeam(winner_team, ST_FT_ROUNDS, +1);
}
else if(winner_team == -1)
{
return false;
}
+MUTATOR_HOOKFUNCTION(ft, Scores_CountFragsRemaining)
+{
+ // announce remaining frags
+ return true;
+}
+
void freezetag_Initialize()
{
freezetag_teams = autocvar_g_freezetag_teams_override;
freezetag_teams = BITS(bound(2, freezetag_teams, 4));
GameRules_scoring(freezetag_teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
+ field_team(ST_FT_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
field(SP_FREEZETAG_REVIVALS, "revivals", 0);
});
bool autocvar_g_freezetag_team_spawns;
string autocvar_g_freezetag_weaponarena = "most_available";
+const int ST_FT_ROUNDS = 1;
+
void freezetag_Initialize();
REGISTER_MUTATOR(ft, false)
{
mod_active = 1; // keepaway should always show the mod HUD
- float BLINK_FACTOR = 0.15;
- float BLINK_BASE = 0.85;
- float BLINK_FREQ = 5;
- float kaball_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
+ float kaball_alpha = blink(0.85, 0.15, 5);
int stat_items = STAT(ITEMS);
int kaball = (stat_items/IT_KEY1) & 1;
midpoint += thisorigin;
if(!first)
- te_lightning2(NULL, lastorigin, thisorigin);
+ {
+ // TODO: this effect has been replaced due to a possible crash it causes
+ // see https://gitlab.com/xonotic/darkplaces/issues/123
+ //te_lightning2(NULL, lastorigin, thisorigin);
+ Send_Effect(EFFECT_TR_NEXUIZPLASMA, lastorigin, thisorigin, 1);
+ }
lastorigin = thisorigin;
if(first)
firstorigin = thisorigin;
}
if(NumTeams(kh_teams) > 2)
{
- te_lightning2(NULL, lastorigin, firstorigin);
+ //te_lightning2(NULL, lastorigin, firstorigin); // TODO see above
+ Send_Effect(EFFECT_TR_NEXUIZPLASMA, lastorigin, firstorigin, 1);
}
midpoint = midpoint * (1 / NumTeams(kh_teams));
te_customflash(midpoint, 1000, 1, Team_ColorRGB(winner_team) * 0.5 + '0.5 0.5 0.5'); // make the color >=0.5 in each component
#ifdef CSQC
MUTATOR_HOOKFUNCTION(bloodloss, PlayerCanCrouch)
{
- if(STAT(HEALTH) <= STAT(BLOODLOSS))
+ if(STAT(HEALTH) > 0 && STAT(HEALTH) <= STAT(BLOODLOSS))
M_ARGV(1, bool) = true; // do_crouch
}
MUTATOR_HOOKFUNCTION(bloodloss, PlayerJump)
{
- if(STAT(HEALTH) <= STAT(BLOODLOSS))
+ if(STAT(HEALTH) > 0 && STAT(HEALTH) <= STAT(BLOODLOSS))
return true;
}
#endif
REGISTER_MUTATOR(cl_buffs, true);
MUTATOR_HOOKFUNCTION(cl_buffs, HUD_Powerups_add)
{
- int allBuffs = STAT(BUFFS);
- FOREACH(Buffs, it.m_itemid & allBuffs, {
- addPowerupItem(it.m_name, strcat("buff_", it.netname), it.m_color, bound(0, STAT(BUFF_TIME) - time, 99), 60);
- });
+ int allBuffs = STAT(BUFFS);
+ if (allBuffs)
+ FOREACH(Buffs, it.m_itemid & allBuffs, {
+ addPowerupItem(it.m_name, strcat("buff_", it.netname), it.m_color, bound(0, STAT(BUFF_TIME) - time, 99), 60);
+ });
}
MUTATOR_HOOKFUNCTION(cl_buffs, WP_Format)
{
Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
sound(toucher, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTN_NORM);
STAT(BUFFS, toucher) |= (STAT(BUFFS, this));
+ STAT(LAST_PICKUP, toucher) = time;
float bufftime = ((this.count) ? this.count : thebuff.m_time(thebuff));
if(bufftime)
STAT(BUFF_TIME, toucher) = min(time + bufftime, max(STAT(BUFF_TIME, toucher), time) + bufftime);
#ifdef SVQC
entity player = M_ARGV(0, entity);
player.bugrigs_prevangles = player.angles;
+
+ player.disableclientprediction = 2;
#endif
}
float autocvar_g_campcheck_damage;
float autocvar_g_campcheck_distance;
float autocvar_g_campcheck_interval;
+bool autocvar_g_campcheck_typecheck;
REGISTER_MUTATOR(campcheck, expr_evaluate(autocvar_g_campcheck));
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
- if(IS_PLAYER(frag_target))
- if(IS_PLAYER(frag_attacker))
- if(frag_attacker != frag_target)
+ if(frag_attacker != frag_target && IS_PLAYER(frag_target) && IS_PLAYER(frag_attacker))
{
frag_target.campcheck_traveled_distance = autocvar_g_campcheck_distance;
frag_attacker.campcheck_traveled_distance = autocvar_g_campcheck_distance;
if(autocvar_g_campcheck_interval)
if(!game_stopped && !warmup_stage && time >= game_starttime)
- if(IS_PLAYER(player))
- if(!IS_DEAD(player))
- if(!STAT(FROZEN, player))
- if(!PHYS_INPUT_BUTTON_CHAT(player))
- if(IS_REAL_CLIENT(player)) // bots may camp, but that's no reason to constantly kill them
+ if(IS_PLAYER(player) && !IS_DEAD(player) && !STAT(FROZEN, player))
+ if(autocvar_g_campcheck_typecheck || !PHYS_INPUT_BUTTON_CHAT(player))
+ if(IS_REAL_CLIENT(player)) // only apply to real clients (bots may "camp" due to missing waypoints in the map, but that's no reason to constantly kill them, clones can't move)
if(!weaponLocked(player))
{
// calculate player movement (in 2 dimensions only, so jumping on one spot doesn't count as movement)
float cvar_cl_dodging_timeout;
REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout");
+
+float cvar_cl_dodging;
+REPLICATE(cvar_cl_dodging, float, "cl_dodging");
#define PHYS_DODGING_AIR autocvar_sv_dodging_air_dodging
#define PHYS_DODGING_MAXSPEED autocvar_sv_dodging_maxspeed
#define PHYS_DODGING_AIR_MAXSPEED autocvar_sv_dodging_air_maxspeed
+#define PHYS_DODGING_CLIENTSELECT autocvar_sv_dodging_clientselect
// we ran out of stats slots! TODO: re-enable this when prediction is available for dodging
#if 0
#define PHYS_DODGING_AIR STAT(DODGING_AIR, this)
#define PHYS_DODGING_MAXSPEED STAT(DODGING_MAXSPEED, this)
#define PHYS_DODGING_AIR_MAXSPEED STAT(DODGING_AIR_MAXSPEED, this)
+#define PHYS_DODGING_CLIENTSELECT STAT(DODGING_CLIENTSELECT, this)
#endif
#ifdef CSQC
float cvar_cl_dodging_timeout;
+ bool cvar_cl_dodging;
+ bool autocvar_cl_dodging;
#define PHYS_DODGING_FRAMETIME (1 / (frametime <= 0 ? 60 : frametime))
#define PHYS_DODGING_TIMEOUT(s) STAT(DODGING_TIMEOUT)
#define PHYS_DODGING_PRESSED_KEYS(s) (s).pressedkeys
+ #define PHYS_DODGING_ENABLED(s) autocvar_cl_dodging
#elif defined(SVQC)
.float cvar_cl_dodging_timeout;
+ .bool cvar_cl_dodging;
#define PHYS_DODGING_FRAMETIME sys_frametime
#define PHYS_DODGING_TIMEOUT(s) CS(s).cvar_cl_dodging_timeout
#define PHYS_DODGING_PRESSED_KEYS(s) CS(s).pressedkeys
+ #define PHYS_DODGING_ENABLED(s) CS(s).cvar_cl_dodging
#endif
#ifdef SVQC
if (!this.dodging_action) return;
// when swimming or dead, no dodging allowed..
- if (this.waterlevel >= WATERLEVEL_SWIMMING || IS_DEAD(this))
+ if (this.waterlevel >= WATERLEVEL_SWIMMING || IS_DEAD(this) || (PHYS_DODGING_CLIENTSELECT && !PHYS_DODGING_ENABLED(this)))
{
this.dodging_action = 0;
this.dodging_direction.x = 0;
#ifdef SVQC
REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout");
+REPLICATE(cvar_cl_dodging, bool, "cl_dodging");
MUTATOR_HOOKFUNCTION(dodging, GetPressedKeys)
{
if (autocvar_hud_panel_itemstime_hidespawned == 2)
picalpha = 1;
else if (item_available)
- {
- float BLINK_FACTOR = 0.15;
- float BLINK_BASE = 0.85;
- float BLINK_FREQ = 5;
- picalpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
- }
+ picalpha = blink(0.85, 0.15, 5);
else
picalpha = 0.5;
t = floor(item_time - time + 0.999);
#define PHYS_MULTIJUMP_MAXSPEED(s) STAT(MULTIJUMP_MAXSPEED, s)
#define PHYS_MULTIJUMP_DODGING(s) STAT(MULTIJUMP_DODGING, s)
#define PHYS_MULTIJUMP_COUNT(s) STAT(MULTIJUMP_COUNT, s)
+#define PHYS_MULTIJUMP_CLIENTDEFAULT(s) STAT(MULTIJUMP_CLIENT, s)
.bool multijump_ready;
#ifdef CSQC
-bool cvar_cl_multijump;
-bool autocvar_cl_multijump = true;
+int cvar_cl_multijump;
+int autocvar_cl_multijump = -1;
#define PHYS_MULTIJUMP_CLIENT(s) autocvar_cl_multijump
#elif defined(SVQC)
-.bool cvar_cl_multijump;
+.int cvar_cl_multijump;
#define PHYS_MULTIJUMP_CLIENT(s) CS(s).cvar_cl_multijump
#endif
if(!PHYS_MULTIJUMP(player)) { return; }
int client_multijump = PHYS_MULTIJUMP_CLIENT(player);
+ if(client_multijump == -1)
+ client_multijump = PHYS_MULTIJUMP_CLIENTDEFAULT(player);
if(client_multijump > 1)
return; // nope
}
}
-REPLICATE(cvar_cl_multijump, bool, "cl_multijump");
+REPLICATE(cvar_cl_multijump, int, "cl_multijump");
#ifdef SVQC
METHOD(OverkillHeavyMachineGun, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
{
- if(vdist(actor.origin - actor.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
- PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false);
- else
- PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false);
+ if(vdist(actor.origin - actor.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
+ PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false);
}
METHOD(OverkillHeavyMachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
if(vdist(actor.origin - actor.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false);
- else
- PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false);
}
METHOD(OverkillMachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
#include "sv_pinata.qh"
string autocvar_g_pinata;
+bool autocvar_g_pinata_offhand;
REGISTER_MUTATOR(pinata, expr_evaluate(autocvar_g_pinata) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok));
MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
if(frag_target.(weaponentity).m_weapon == WEP_Null)
continue;
+ if(slot > 0 && !autocvar_g_pinata_offhand)
+ break;
+
FOREACH(Weapons, it != WEP_Null, {
if(STAT(WEAPONS, frag_target) & WepSet_FromWeapon(it))
if(frag_target.(weaponentity).m_weapon != it)
}
}
- if((it.autospec_flags & ASF_SHIELD && item.invincible_finished) ||
- (it.autospec_flags & ASF_STRENGTH && item.strength_finished) ||
- (it.autospec_flags & ASF_MEGA_AR && item.itemdef == ITEM_ArmorMega) ||
- (it.autospec_flags & ASF_MEGA_HP && item.itemdef == ITEM_HealthMega) ||
- (it.autospec_flags & ASF_FLAG_GRAB && item.classname == "item_flag_team"))
+ if(((it.autospec_flags & ASF_SHIELD) && item.invincible_finished) ||
+ ((it.autospec_flags & ASF_STRENGTH) && item.strength_finished) ||
+ ((it.autospec_flags & ASF_MEGA_AR) && item.itemdef == ITEM_ArmorMega) ||
+ ((it.autospec_flags & ASF_MEGA_HP) && item.itemdef == ITEM_HealthMega) ||
+ ((it.autospec_flags & ASF_FLAG_GRAB) && item.classname == "item_flag_team"))
{
if((it.enemy != toucher) || IS_OBSERVER(it))
{
- if(it.autospec_flags & ASF_OBSERVER_ONLY && !IS_OBSERVER(it))
+ if((it.autospec_flags & ASF_OBSERVER_ONLY) && !IS_OBSERVER(it))
{
if(it.superspec_flags & SSF_VERBOSE)
superspec_msg("", "", it, sprintf("^8Ignored that ^7%s^8 grabbed %s^8 since the observer_only option is ON\n", toucher.netname, item.netname), 2);
if(cmd_name == "followpowerup")
{
- FOREACH_CLIENT(IS_PLAYER(it) && (it.strength_finished > time || it.invincible_finished > time), { return superspec_Spectate(player, it); });
+ FOREACH_CLIENT(IS_PLAYER(it) && (STAT(STRENGTH_FINISHED, it) > time || it.invincible_finished > time), { return superspec_Spectate(player, it); });
superspec_msg("", "", player, "No active powerup\n", 1);
return true;
if(cmd_name == "followstrength")
{
- FOREACH_CLIENT(IS_PLAYER(it) && it.strength_finished > time, { return superspec_Spectate(player, it); });
+ FOREACH_CLIENT(IS_PLAYER(it) && STAT(STRENGTH_FINISHED, it) > time, { return superspec_Spectate(player, it); });
superspec_msg("", "", player, "No active Strength\n", 1);
return true;
entity frag_target = M_ARGV(2, entity);
FOREACH_CLIENT(IS_SPEC(it), {
- if(it.autospec_flags & ASF_FOLLOWKILLER && IS_PLAYER(frag_attacker) && it.enemy == frag_target)
+ if((it.autospec_flags & ASF_FOLLOWKILLER) && IS_PLAYER(frag_attacker) && it.enemy == frag_target)
{
if(it.autospec_flags & ASF_SHOWWHAT)
superspec_msg("", "", it, sprintf("^7Following %s^7 due to followkiller\n", frag_attacker.netname), 2);
#define VERBOSE_MURDER(type) strcat(MURDER_##type, "^BG%s")
- #define MURDER_FRAG _("^K3%sYou fragged ^BG%s")
- #define MURDER_FRAG2 _("^K3%sYou scored against ^BG%s")
+ #define MURDER_FRAG strcat(BOLD_OPERATOR, _("^K3%sYou fragged ^BG%s"))
+ #define MURDER_FRAG2 strcat(BOLD_OPERATOR, _("^K3%sYou scored against ^BG%s"))
#define MURDER_FRAGGED _("^K1%sYou were fragged by ^BG%s")
#define MURDER_FRAGGED2 _("^K1%sYou were scored against by ^BG%s")
MSG_CENTER_NOTIF(DEATH_MURDER_FRAG, N_ENABLE, 1, 1, "spree_cen s1", CPID_Null, "0 0", MURDER_FRAG, MURDER_FRAG2 )
MSG_CENTER_NOTIF(DEATH_MURDER_FRAGGED_VERBOSE, N_ENABLE, 1, 4, "spree_cen s1 frag_stats", CPID_Null, "0 0", VERBOSE_MURDER(FRAGGED), VERBOSE_MURDER(FRAGGED2) )
MSG_CENTER_NOTIF(DEATH_MURDER_FRAG_VERBOSE, N_ENABLE, 1, 2, "spree_cen s1 frag_ping", CPID_Null, "0 0", VERBOSE_MURDER(FRAG), VERBOSE_MURDER(FRAG2) )
- #define MURDER_FRAG_FIRE _("^K3%sYou burned ^BG%s")
- #define MURDER_FRAG_FIRE2 _("^K3%sYou scored against ^BG%s")
+ #define MURDER_FRAG_FIRE strcat(BOLD_OPERATOR, _("^K3%sYou burned ^BG%s"))
+ #define MURDER_FRAG_FIRE2 strcat(BOLD_OPERATOR, _("^K3%sYou scored against ^BG%s"))
#define MURDER_FRAGGED_FIRE _("^K1%sYou were burned by ^BG%s")
#define MURDER_FRAGGED_FIRE2 _("^K1%sYou were scored against by ^BG%s")
MSG_CENTER_NOTIF(DEATH_MURDER_FRAG_FIRE, N_ENABLE, 1, 1, "spree_cen s1", CPID_Null, "0 0", MURDER_FRAG_FIRE, MURDER_FRAG_FIRE2 )
MSG_CENTER_NOTIF(DEATH_MURDER_FRAGGED_FIRE_VERBOSE, N_ENABLE, 1, 4, "spree_cen s1 frag_stats", CPID_Null, "0 0", VERBOSE_MURDER(FRAGGED_FIRE), VERBOSE_MURDER(FRAGGED_FIRE2) )
MSG_CENTER_NOTIF(DEATH_MURDER_FRAG_FIRE_VERBOSE, N_ENABLE, 1, 2, "spree_cen s1 frag_ping", CPID_Null, "0 0", VERBOSE_MURDER(FRAG_FIRE), VERBOSE_MURDER(FRAG_FIRE2) )
- #define MURDER_FRAG_FREEZE _("^K3%sYou froze ^BG%s")
- #define MURDER_FRAG_FREEZE2 _("^K3%sYou scored against ^BG%s")
+ #define MURDER_FRAG_FREEZE strcat(BOLD_OPERATOR, _("^K3%sYou froze ^BG%s"))
+ #define MURDER_FRAG_FREEZE2 strcat(BOLD_OPERATOR, _("^K3%sYou scored against ^BG%s"))
#define MURDER_FRAGGED_FREEZE _("^K1%sYou were frozen by ^BG%s")
#define MURDER_FRAGGED_FREEZE2 _("^K1%sYou were scored against by ^BG%s")
MSG_CENTER_NOTIF(DEATH_MURDER_FRAG_FREEZE, N_ENABLE, 1, 1, "spree_cen s1", CPID_Null, "0 0", MURDER_FRAG_FREEZE, MURDER_FRAG_FREEZE2 )
MSG_CENTER_NOTIF(DEATH_MURDER_FRAGGED_FREEZE_VERBOSE, N_ENABLE, 1, 4, "spree_cen s1 frag_stats", CPID_Null, "0 0", VERBOSE_MURDER(FRAGGED_FREEZE), VERBOSE_MURDER(FRAGGED_FREEZE2))
MSG_CENTER_NOTIF(DEATH_MURDER_FRAG_FREEZE_VERBOSE, N_ENABLE, 1, 2, "spree_cen s1 frag_ping", CPID_Null, "0 0", VERBOSE_MURDER(FRAG_FREEZE), VERBOSE_MURDER(FRAG_FREEZE2) )
- #define MURDER_TYPEFRAG _("^K1%sYou typefragged ^BG%s")
- #define MURDER_TYPEFRAG2 _("^K1%sYou scored against ^BG%s^K1 while they were typing")
+ #define MURDER_TYPEFRAG strcat(BOLD_OPERATOR, _("^K1%sYou typefragged ^BG%s"))
+ #define MURDER_TYPEFRAG2 strcat(BOLD_OPERATOR, _("^K1%sYou scored against ^BG%s^K1 while they were typing"))
#define MURDER_TYPEFRAGGED _("^K1%sYou were typefragged by ^BG%s")
#define MURDER_TYPEFRAGGED2 _("^K1%sYou were scored against by ^BG%s^K1 while typing")
MSG_CENTER_NOTIF(DEATH_MURDER_TYPEFRAG, N_ENABLE, 1, 1, "spree_cen s1", CPID_Null, "0 0", MURDER_TYPEFRAG, MURDER_TYPEFRAG2 )
MSG_CENTER_NOTIF(INSTAGIB_FINDAMMO_FIRST, N_ENABLE, 0, 0, "", CPID_INSTAGIB_FINDAMMO, "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("^BGGet some ammo! ^F4^COUNT^BG left!"))
MSG_CENTER_NOTIF(INSTAGIB_LIVES_REMAINING, N_ENABLE, 0, 1, "f1", CPID_Null, "0 0", _("^F2Extra lives remaining: ^K1%s"), "")
+ MSG_CENTER_NOTIF(CAMPAIGN_MESSAGE, N_ENABLE, 1, 1, "f1 s1 join_key", CPID_CAMPAIGN_MESSAGE, "-1 0", strcat(_("Level %s: "), "^BG%s\n^3\n", _("^BGPress ^F2%s^BG to enter the game")), "")
MSG_CENTER_NOTIF(MOTD, N_ENABLE, 1, 0, "s1", CPID_MOTD, "-1 0", "^BG%s", "")
MSG_CENTER_NOTIF(NIX_COUNTDOWN, N_ENABLE, 0, 2, "item_wepname", CPID_NIX, "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "")
#include <client/autocvars.qh>
#endif
+// Operator for bold notifications
+#define BOLD_OPERATOR "^BOLD"
+
/** main types/groups of notifications */
ENUMCLASS(MSG)
/** "Global" AND "personal" announcer messages */
CASE(CPID, MISSING_TEAMS)
CASE(CPID, MISSING_PLAYERS)
CASE(CPID, INSTAGIB_FINDAMMO)
+ CASE(CPID, CAMPAIGN_MESSAGE)
CASE(CPID, MOTD)
CASE(CPID, NIX)
CASE(CPID, ONSLAUGHT)
ARG_CASE(ARG_CS, "missing_teams", notif_arg_missing_teams(f1)) \
ARG_CASE(ARG_CS, "pass_key", getcommandkey(_("drop flag"), "+use")) \
ARG_CASE(ARG_CS, "nade_key", getcommandkey(_("throw nade"), "dropweapon")) \
+ ARG_CASE(ARG_CS, "join_key", getcommandkey(_("jump"), "+jump")) \
ARG_CASE(ARG_CS, "frag_ping", notif_arg_frag_ping(true, f2)) \
ARG_CASE(ARG_CS, "frag_stats", notif_arg_frag_stats(f2, f3, f4)) \
/*ARG_CASE(ARG_CS, "frag_pos", ((Should_Print_Score_Pos(f1)) ? sprintf("\n^BG%s", Read_Score_Pos(f1)) : ""))*/ \
_Movetype_LinkEdict_TouchAreaGrid(this);
}
+int _Movetype_ContentsMask(entity this) // SV_GenericHitSuperContentsMask
+{
+ if(this)
+ {
+ if(this.dphitcontentsmask)
+ return this.dphitcontentsmask;
+ else if(this.solid == SOLID_SLIDEBOX)
+ {
+ if(this.flags & 32) // TODO: FL_MONSTER
+ return DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_MONSTERCLIP;
+ else
+ return DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
+ }
+ else if(this.solid == SOLID_CORPSE)
+ return DPCONTENTS_SOLID | DPCONTENTS_BODY;
+ else if(this.solid == SOLID_TRIGGER)
+ return DPCONTENTS_SOLID | DPCONTENTS_BODY;
+ else
+ return DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+ }
+ else
+ return DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+}
+
entity _Movetype_TestEntityPosition_ent;
bool _Movetype_TestEntityPosition(vector ofs) // SV_TestEntityPosition
{
//int cont = this.dphitcontentsmask;
//this.dphitcontentsmask = DPCONTENTS_SOLID;
- tracebox(org, this.mins, this.maxs, org, ((this.move_movetype == MOVETYPE_FLY_WORLDONLY) ? MOVE_WORLDONLY : MOVE_NOMONSTERS), this);
+ tracebox(org, this.mins, this.maxs, this.origin, ((this.move_movetype == MOVETYPE_FLY_WORLDONLY) ? MOVE_WORLDONLY : MOVE_NOMONSTERS), this);
//this.dphitcontentsmask = cont;
-
- if(trace_startsolid)
+ if(trace_dpstartcontents & _Movetype_ContentsMask(this))
return true;
- if(vdist(trace_endpos - this.origin, >, 0.0001))
+ if(vlen2(trace_endpos - this.origin) >= 0.0001)
{
tracebox(trace_endpos, this.mins, this.maxs, trace_endpos, MOVE_NOMONSTERS, this);
if(!trace_startsolid)
return false;
}
+bool _Movetype_TestEntityPosition_Offset(int offset)
+{
+ // NOTE: expects _Movetype_TestEntityPosition_ent to be set to the correct entity
+ // returns true if stuck
+
+ // start at 2, since the first position has already been checked
+ for(int j = 2; j <= offset; ++j)
+ {
+ if(!_Movetype_TestEntityPosition('0 0 -1' * j))
+ return false;
+ if(!_Movetype_TestEntityPosition('0 0 1' * j))
+ return false;
+ }
+
+ return true;
+}
+
int _Movetype_UnstickEntity(entity this) // SV_UnstickEntity
{
_Movetype_TestEntityPosition_ent = this;
X('-1 1 0') X(' 1 1 0')
#undef X
{
- #define X(i) \
- if (_Movetype_TestEntityPosition('0 0 -1' * i)) \
- if (_Movetype_TestEntityPosition('0 0 1' * i))
- X(2) X(3) X(4) X(5) X(6) X(7) X(8)
- X(9) X(10) X(11) X(12) X(13) X(14) X(15) X(16)
- X(17)
- #undef X
+ if(_Movetype_TestEntityPosition_Offset(rint((this.maxs.z - this.mins.z) * 0.36)))
{
LOG_DEBUGF("Can't unstick an entity (edict: %d, classname: %s, origin: %s)",
etof(this), this.classname, vtos(this.origin));
}
if (!doublejump)
- if (!IS_ONGROUND(this) && !IS_ONSLICK(this))
+ if (!IS_ONGROUND(this))
return IS_JUMP_HELD(this);
if(PHYS_TRACK_CANJUMP(this))
trace_dphitq3surfaceflags = 0;
tracebox(this.origin, this.mins, this.maxs, this.origin - '0 0 1', MOVE_NOMONSTERS, this);
if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK)
- {
- if(PHYS_SLICK_APPLYGRAVITY(this))
- UNSET_ONGROUND(this);
SET_ONSLICK(this);
- }
else
UNSET_ONSLICK(this);
}
void PlayerState_attach(entity this)
{
- if (PS(this))
+ if (PS(this) && PS(this).m_client == this)
return;
this._ps = NEW(PlayerState, this);
// const int STAT_NAILS = 7;
// const int STAT_ROCKETS = 8;
// const int STAT_CELLS = 9;
-// const int STAT_ACTIVEWEAPON = 10;
// const int STAT_ITEMS = 15; // .items | .items2 << 23 | serverflags << 28
// const int STAT_VIEWHEIGHT = 16;
#if defined(CSQC)
#define g_stat_HEALTH getstati(STAT_HEALTH)
- #define g_stat_ARMOR getstat_int(STAT_ARMOR)
- #define g_stat_SHELLS getstat_int(STAT_SHELLS)
- #define g_stat_NAILS getstat_int(STAT_NAILS)
- #define g_stat_ROCKETS getstat_int(STAT_ROCKETS)
- #define g_stat_CELLS getstat_int(STAT_CELLS)
- #define g_stat_ACTIVEWEAPON getstat_int(STAT_ACTIVEWEAPON)
+ #define g_stat_ARMOR getstati(STAT_ARMOR)
+ #define g_stat_SHELLS getstati(STAT_SHELLS)
+ #define g_stat_NAILS getstati(STAT_NAILS)
+ #define g_stat_ROCKETS getstati(STAT_ROCKETS)
+ #define g_stat_CELLS getstati(STAT_CELLS)
#define g_stat_ITEMS getstat_int(STAT_ITEMS)
#define g_stat_VIEWHEIGHT getstati(STAT_VIEWHEIGHT)
#elif defined(SVQC)
#define stat_NAILS ammo_nails
#define stat_ROCKETS ammo_rockets
#define stat_CELLS ammo_cells
- #define stat_ACTIVEWEAPON weapon
#define stat_ITEMS items
#define stat_VIEWHEIGHT view_ofs_z
#endif
/** compressShotOrigin */
REGISTER_STAT(SHOTORG, int)
REGISTER_STAT(LEADLIMIT, float, autocvar_leadlimit)
+REGISTER_STAT(LEADLIMIT_AND_FRAGLIMIT, float, autocvar_leadlimit_and_fraglimit)
REGISTER_STAT(LAST_PICKUP, float)
REGISTER_STAT(HUD, int)
REGISTER_STAT(DAMAGE_DEALT_TOTAL, int)
REGISTER_STAT(TYPEHIT_TIME, float)
REGISTER_STAT(SUPERWEAPONS_FINISHED, float)
+REGISTER_STAT(AIR_FINISHED, float)
REGISTER_STAT(VEHICLESTAT_HEALTH, int)
REGISTER_STAT(VEHICLESTAT_SHIELD, int)
REGISTER_STAT(VEHICLESTAT_ENERGY, int)
float autocvar_g_multijump_speed;
float autocvar_g_multijump_maxspeed;
float autocvar_g_multijump_dodging = 1;
+bool autocvar_g_multijump_client = true;
#endif
REGISTER_STAT(MULTIJUMP_DODGING, int, autocvar_g_multijump_dodging)
REGISTER_STAT(MULTIJUMP_MAXSPEED, float, autocvar_g_multijump_maxspeed)
REGISTER_STAT(MULTIJUMP_ADD, int, autocvar_g_multijump_add)
REGISTER_STAT(MULTIJUMP_SPEED, float, autocvar_g_multijump_speed)
+REGISTER_STAT(MULTIJUMP_CLIENT, bool, autocvar_g_multijump_client)
.int multijump_count;
REGISTER_STAT(MULTIJUMP_COUNT, int, this.multijump_count)
REGISTER_STAT(MULTIJUMP, int, autocvar_g_multijump)
bool autocvar_sv_dodging_air_dodging;
float autocvar_sv_dodging_maxspeed;
float autocvar_sv_dodging_air_maxspeed;
+bool autocvar_sv_dodging_clientselect;
#endif
#if 0
REGISTER_STAT(DODGING_AIR, bool, autocvar_sv_dodging_air_dodging)
REGISTER_STAT(DODGING_MAXSPEED, float, autocvar_sv_dodging_maxspeed)
REGISTER_STAT(DODGING_AIR_MAXSPEED, float, autocvar_sv_dodging_air_maxspeed)
+REGISTER_STAT(DODGING_CLIENTSELECT, bool, autocvar_sv_dodging_clientselect)
#endif
/** cvar loopback */
REGISTER_STAT(DODGING_FROZEN, int, autocvar_sv_dodging_frozen)
return false;
}
else if (g_weapon_stay == 2)
+ {
ammomax = min(amount, ammomax);
+ if(player_amount >= ammomax)
+ return false;
+ }
else
return false;
if (amount < 0)
if(!this.superweapons_finished)
this.superweapons_finished = autocvar_g_balance_superweapons_time;
+ string str;
int n = tokenize_console(this.netname);
if(argv(0) == "give")
{
- this.netname = substring(this.netname, argv_start_index(1), argv_end_index(-1) - argv_start_index(1));
+ str = substring(this.netname, argv_start_index(1), argv_end_index(-1) - argv_start_index(1));
}
else
{
itemprefix = valueprefix = string_null;
}
- this.netname = "";
- this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & IT_UNLIMITED_AMMO), "unlimited_weapon_ammo");
- this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & IT_UNLIMITED_SUPERWEAPONS), "unlimited_superweapons");
- this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, this.strength_finished * boolean(this.items & ITEM_Strength.m_itemid), "strength");
- this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, this.invincible_finished * boolean(this.items & ITEM_Shield.m_itemid), "invincible");
- this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, this.superweapons_finished * boolean(this.items & IT_SUPERWEAPON), "superweapons");
- this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & ITEM_Jetpack.m_itemid), "jetpack");
- this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & ITEM_JetpackRegen.m_itemid), "fuel_regen");
- if(GetResource(this, RES_SHELLS) != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, GetResource(this, RES_SHELLS)), "shells");
- if(GetResource(this, RES_BULLETS) != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, GetResource(this, RES_BULLETS)), "nails");
- if(GetResource(this, RES_ROCKETS) != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, GetResource(this, RES_ROCKETS)), "rockets");
- if(GetResource(this, RES_CELLS) != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, GetResource(this, RES_CELLS)), "cells");
- if(GetResource(this, RES_PLASMA) != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, GetResource(this, RES_PLASMA)), "plasma");
- if(GetResource(this, RES_FUEL) != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, GetResource(this, RES_FUEL)), "fuel");
- if(GetResource(this, RES_HEALTH) != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, GetResource(this, RES_HEALTH)), "health");
- if(GetResource(this, RES_ARMOR) != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, GetResource(this, RES_ARMOR)), "armor");
- FOREACH(Buffs, it != BUFF_Null && (STAT(BUFFS, this) & it.m_itemid), this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, STAT(BUFF_TIME, this)), it.netname));
- FOREACH(Weapons, it != WEP_Null, this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, !!(STAT(WEAPONS, this) & (it.m_wepset)), it.netname));
- }
- this.netname = strzone(this.netname);
- //print(this.netname, "\n");
+ str = "";
+ str = sprintf("%s %s%d %s", str, itemprefix, boolean(this.items & IT_UNLIMITED_AMMO), "unlimited_weapon_ammo");
+ str = sprintf("%s %s%d %s", str, itemprefix, boolean(this.items & IT_UNLIMITED_SUPERWEAPONS), "unlimited_superweapons");
+ str = sprintf("%s %s%d %s", str, valueprefix, this.strength_finished * boolean(this.items & ITEM_Strength.m_itemid), "strength");
+ str = sprintf("%s %s%d %s", str, valueprefix, this.invincible_finished * boolean(this.items & ITEM_Shield.m_itemid), "invincible");
+ str = sprintf("%s %s%d %s", str, valueprefix, this.superweapons_finished * boolean(this.items & IT_SUPERWEAPON), "superweapons");
+ str = sprintf("%s %s%d %s", str, itemprefix, boolean(this.items & ITEM_Jetpack.m_itemid), "jetpack");
+ str = sprintf("%s %s%d %s", str, itemprefix, boolean(this.items & ITEM_JetpackRegen.m_itemid), "fuel_regen");
+ float res;
+ res = GetResource(this, RES_SHELLS); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "shells");
+ res = GetResource(this, RES_BULLETS); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "nails");
+ res = GetResource(this, RES_ROCKETS); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "rockets");
+ res = GetResource(this, RES_CELLS); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "cells");
+ res = GetResource(this, RES_PLASMA); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "plasma");
+ res = GetResource(this, RES_FUEL); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "fuel");
+ res = GetResource(this, RES_HEALTH); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "health");
+ res = GetResource(this, RES_ARMOR); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "armor");
+ // HACK: buffs share a single timer, so we need to include enabled buffs AFTER disabled ones to avoid loss
+ FOREACH(Buffs, it != BUFF_Null && !(STAT(BUFFS, this) & it.m_itemid), str = sprintf("%s %s%d %s", str, valueprefix, max(0, STAT(BUFF_TIME, this)), it.netname));
+ FOREACH(Buffs, it != BUFF_Null && (STAT(BUFFS, this) & it.m_itemid), str = sprintf("%s %s%d %s", str, valueprefix, max(0, STAT(BUFF_TIME, this)), it.netname));
+ FOREACH(Weapons, it != WEP_Null, str = sprintf("%s %s%d %s", str, itemprefix, !!(STAT(WEAPONS, this) & (it.m_wepset)), it.netname));
+ }
+ this.netname = strzone(str);
n = tokenize_console(this.netname);
for(int j = 0; j < n; ++j)
bool GiveResourceValue(entity e, int res_type, int op, int val)
{
int v0 = GetResource(e, res_type);
+ float new_val = 0;
switch (op)
{
// min 100 cells = at least 100 cells
- case OP_SET: SetResource(e, res_type, val); break;
- case OP_MIN: SetResource(e, res_type, max(v0, val)); break;
- case OP_MAX: SetResource(e, res_type, min(v0, val)); break;
- case OP_PLUS: SetResource(e, res_type, v0 + val); break;
- case OP_MINUS: SetResource(e, res_type, v0 - val); break;
- }
- int v1 = GetResource(e, res_type);
- return v0 != v1;
+ case OP_SET: new_val = val; break;
+ case OP_MIN: new_val = max(v0, val); break;
+ case OP_MAX: new_val = min(v0, val); break;
+ case OP_PLUS: new_val = v0 + val; break;
+ case OP_MINUS: new_val = v0 - val; break;
+ default: return false;
+ }
+
+ return SetResourceExplicit(e, res_type, new_val);
}
float GiveItems(entity e, float beginarg, float endarg)
int cont = Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(vehic.origin));
if(!(cont & DPCONTENTS_WATER))
+ vehic.air_finished = 0;
+ else if (!vehic.air_finished)
vehic.air_finished = time + autocvar_g_vehicle_racer_water_time;
if(IS_DEAD(vehic))
vector a = '0 0 0';
switch(fr)
{
+ default:
case WFRAME_IDLE: a = wepent.anim_idle; break;
case WFRAME_FIRE1: a = wepent.anim_fire1; break;
case WFRAME_FIRE2: a = wepent.anim_fire2; break;
- default:
case WFRAME_RELOAD: a = wepent.anim_reload; break;
}
a.z *= t;
}
.vector vorg1, vorg2;
-.float spawn_time;
void VaporizerBeam_Draw(entity this)
{
//draw either the old v2.3 beam or the new beam
METHOD(Vaporizer, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
{
- if(GetResource(actor, thiswep.ammo_type) > 0)
+ if((actor.items & IT_UNLIMITED_AMMO) || GetResource(actor, thiswep.ammo_type) > 0)
PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 1, false);
else
PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
#undef STAT_MOVEVARS_TIMESCALE
#undef STAT_MOVEVARS_GRAVITY
-#pragma noref 0
-
#define use use1
.void(entity this, entity actor, entity trigger) use;
#define touch move_touch
-// deglobalization:
-
void(vector ang) _makevectors_hidden = #1;
-//#define makevectors DO_NOT_USE_GLOBALS_PREFER_MAKE_VECTORS_MACRO_INSTEAD
-
-#define makestatic DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
-
-#define skel_get_bonerel DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
-
vector(float skel, float bonenum) _skel_get_boneabs_hidden = #270;
-//#define skel_get_boneabs DO_NOT_USE_GLOBALS_PREFER_SKEL_GET_BONE_ABS_MACRO_INSTEAD
-
void(float skel, float bonenum, vector org) _skel_set_bone_hidden = #271;
-//#define skel_set_bone DO_NOT_USE_GLOBALS_PREFER_SKEL_SET_BONE_MACRO_INSTEAD
-
-#define skel_mul_bone DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
-
-#define skel_mul_bones DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
-
void(vector org, float radius, vector lightcolours) _adddynamiclight_hidden = #305;
-//#define adddynamiclight DO_NOT_USE_GLOBALS_PREFER_ADD_DYNAMIC_LIGHT_MACRO_INSTEAD
-#define adddynamiclight2 DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
-
void(vector dir) _vectorvectors_hidden = #432;
-#define vectorvectors DO_NOT_USE_GLOBALS_PREFER_VECTOR_VECTORS_MACRO_INSTEAD
-
vector(entity ent, float tagindex) _gettaginfo_hidden = #452;
-//#define gettaginfo DO_NOT_USE_GLOBALS_PREFER_GET_TAG_INFO_MACRO_INSTEAD
-#define getentity DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
-#define getentityvec DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
+#pragma noref 0
int() _buf_create = #460;
#define buf_create _buf_create
-#pragma noref 0
-
-// deglobalization:
-
-#define skel_get_bonerel DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
-
vector(float skel, float bonenum) _skel_get_boneabs_hidden = #270;
-//#define skel_get_boneabs DO_NOT_USE_GLOBALS_PREFER_SKEL_GET_BONE_ABS_MACRO_INSTEAD
-
void(float skel, float bonenum, vector org) _skel_set_bone_hidden = #271;
-//#define skel_set_bone DO_NOT_USE_GLOBALS_PREFER_SKEL_SET_BONE_MACRO_INSTEAD
-
-#define skel_mul_bone DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
-
-#define skel_mul_bones DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
-
vector(entity ent, float tagindex) _gettaginfo_hidden = #452;
-//#define gettaginfo DO_NOT_USE_GLOBALS_PREFER_GET_TAG_INFO_MACRO_INSTEAD
+
+#pragma noref 0
#else
#define NULL (RVALUE, world)
#endif
+
+// Shadow functions which use globals - see deglobalization.qh for details.
+#define makevectors DO_NOT_USE_GLOBALS_PREFER_MAKE_VECTORS_MACRO_INSTEAD
+#define aim DO_NOT_USE_GLOBALS
+#define makestatic DO_NOT_USE_GLOBALS
+#define skel_get_bonerel DO_NOT_USE_GLOBALS
+#define skel_get_boneabs DO_NOT_USE_GLOBALS_PREFER_SKEL_GET_BONE_ABS_MACRO_INSTEAD
+#define skel_set_bone DO_NOT_USE_GLOBALS_PREFER_SKEL_SET_BONE_MACRO_INSTEAD
+#define skel_mul_bone DO_NOT_USE_GLOBALS
+#define skel_mul_bones DO_NOT_USE_GLOBALS
+#define adddynamiclight DO_NOT_USE_GLOBALS_PREFER_ADD_DYNAMIC_LIGHT_MACRO_INSTEAD
+#define adddynamiclight2 DO_NOT_USE_GLOBALS
+#define vectorvectors DO_NOT_USE_GLOBALS_PREFER_VECTOR_VECTORS_MACRO_INSTEAD
+#define gettaginfo DO_NOT_USE_GLOBALS_PREFER_GET_TAG_INFO_MACRO_INSTEAD
+#define getentity DO_NOT_USE_GLOBALS
+#define getentityvec DO_NOT_USE_GLOBALS
if (IS_REAL_CLIENT(_cl)) stuffcmd(_cl, __VA_ARGS__); \
MACRO_END
-#pragma noref 0
-
#define use use1
.void(entity this, entity actor, entity trigger) use;
-// deglobalization:
-
void(vector ang) _makevectors_hidden = #1;
-//#define makevectors DO_NOT_USE_GLOBALS_PREFER_MAKE_VECTORS_MACRO_INSTEAD
-#define aim DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
-
-#define makestatic DO_NOT_USE_GLOBALS // not used anywhere so not wrapped
+#pragma noref 0
if (IS_SVQC) {
if (this.move_movetype == MOVETYPE_NONE) { return; }
// when we get here, disableclientprediction cannot be 2
- this.disableclientprediction = (this.move_qcphysics) ? -1 : 0;
+ if(this.move_movetype == MOVETYPE_FOLLOW) // not compatible with prediction
+ this.disableclientprediction = 1;
+ else if(this.move_qcphysics)
+ this.disableclientprediction = -1;
+ else
+ this.disableclientprediction = 0;
}
viewloc_PlayerPhysics(this);
this.com_phys_gravity = '0 0 0';
} else if (ITEMS_STAT(this) & IT_USING_JETPACK) {
PM_jetpack(this, maxspeed_mod, dt);
- } else if (IS_ONGROUND(this)) {
+ } else if (IS_ONGROUND(this) && (!IS_ONSLICK(this) || !PHYS_SLICK_APPLYGRAVITY(this))) {
if (!WAS_ONGROUND(this)) {
emit(phys_land, this);
if (this.lastground < time - 0.3) {
#include "warpzone/mathlib.qc"
+// needs to be included before any of the functions which use globals are called
+#include "deglobalization.qh"
+
#include "accumulate.qh"
#include "angle.qc"
#include "arraylist.qh"
#include "counting.qh"
#include "cvar.qh"
#include "defer.qh"
-#include "deglobalization.qh"
#include "draw.qh"
#include "enumclass.qh"
#include "file.qh"
{
this.mins = PHYS_PL_MIN(this);
this.maxs = PHYS_PL_MAX(this);
+ if (IS_DEAD(this))
+ this.maxs.z = 5;
this.view_ofs = PHYS_PL_VIEWOFS(this);
}
}
#endif
CSQCPlayer_SetMinsMaxs(e);
- e.angles_y = input_angles.y;
+ if (!IS_DEAD(e))
+ e.angles.y = input_angles.y;
}
// relink
{
CSQCPlayer_CalcRefdef(view);
}
-
}
else
{
//const int PMF_DUCKED = 4;
//const int PMF_ONGROUND = 8;
-const int FL_DUCKED = 524288;
+const int FL_DUCKED = BIT(19);
void CSQCPlayer_SetCamera();
float CSQCPlayer_PreUpdate(entity this);
+#include "lib/accumulate.qh"
#include "lib/float.qh"
+#include "lib/log.qh"
#include "lib/misc.qh"
#include "lib/static.qh"
#include "lib/vector.qh"
-// These macros wrap functions which use globals so mutation only occurs inside them and is not visible from outside.
-// Functions for which all usages are replaced with these macros can be hidden by #defines inside our `*defs.qh` files
-// to prevent anyone from using them accidentally in the future
+// These macros wrap functions which use globals so mutation of global state only occurs inside them and is not visible from outside.
+// This helps prevent bugs where refactoring accidentally breaks implicit assumptions about global state ("pls call makevectors before calling this").
+// Currently only functions that use v_forward/v_right/v_up are wrapped since those are most common.
+// Some functions don't have wrappers because they're not used anywhere.
-// TODO stuff in the engine that uses the v_forward/v_right/v_up globals and is not wrapped yet:
-// - RF_USEAXIS, addentities, predraw,
-// - CL_GetEntityMatrix (in engine but is called from other functions so transitively any of them can use the globals - e.g. V_CalcRefdef, maybe others)
-// - however RF_USEAXIS is only used if MF_ROTATE is used which is only set in one place
-// - e.camera_transform / CL_VM_TransformView (in engine)
-// - this is the only used function that both sets and gets the globals (aim does too but isn't used in our code)
+// Steps (slightly inspired by steps in self.qh):
+// 1) (done) Create alternative names for the builtins (e.g. _makevectors_hidden) to be used inside wrappers.
+// Shadow the originals with macros that tell the user to use the wrappers instead. These are in the *defs.qh files.
+// 2) Create wrapper macros with the same name (e.g. makevectors) that still use globals but log their usage.
+// - Would be nice to also log reads and writes to the globals themselves. Probably possible with macros, comma expressions and [[alias]].
+// 3) Create wrapper macros that use locals (e.g. MAKE_VECTORS).
+// TODO stuff in the engine that uses the v_forward/v_right/v_up globals and is not wrapped yet:
+// - RF_USEAXIS, addentities, predraw,
+// - CL_GetEntityMatrix (in engine but is called from other functions so transitively any of them can use the globals - e.g. V_CalcRefdef, maybe others)
+// - however RF_USEAXIS is only used if MF_ROTATE is used which is only set in one place
+// - e.camera_transform / CL_VM_TransformView (in engine)
+// - this is the only used function that both sets and gets the globals (aim does too but isn't used in our code)
+// 4) Gradually replace uses of each function with its wrapper.
+// 5) When a function is no longer used, remove the wrapper with the same name to cause compile errors that will prevent accidental use in the future.
-// convenience for deglobalization code - don't use these just to hide that globals are still used
-#define CLEAR_V_GLOBALS() v_forward = VEC_NAN; v_right = VEC_NAN; v_up = VEC_NAN
-#define GET_V_GLOBALS(forward, right, up) forward = v_forward; right = v_right; up = v_up
-#define SET_V_GLOBALS(forward, right, up) v_forward = forward; v_right = right; v_up = up
+// Final checking:
+// When all functions which use a global have been replaced with the wrappers,
+// the wrappers can check that the global contains NaN before its use and set it to NaN after its use.
+// This should detect if there is any remaining global mutation (even in the engine).
+// NaN is the most likely value to expose remaining usages - e.g. functions like traceline crash on it.
+
+#ifdef GAMEQC // menu doesn't use any globals
+
+// compile time switches in case perf is an issue
+#define DEGLOB_LOGGING 1
+#define DEGLOB_CLEAR 1
+
+const int DEGLOB_ORIGINAL = 1;
+const int DEGLOB_WRAPPED = 2;
+#if DEGLOB_LOGGING
+int autocvar_debug_deglobalization_logging = 0;
+// Varargs to this should already be stringized, otherwise they're expanded first which makes them less readable.
+// The downside is redundant quotes, fortunately none of these functions take strings.
+#define DEGLOB_LOG(kind, name, ...) deglob_log(kind, name, __FILE__, __LINE__, __FUNC__, #__VA_ARGS__)
+// This needs to be a function, not a macro,
+// because some wrappers of the old functions need to use comma expressions
+// because they return values.
+void deglob_log(int kind, string name, string file, int line, string func, string more_text) {
+ if (autocvar_debug_deglobalization_logging & kind) {
+ LOG_INFOF("%s %f %s %s:%d:%s args: %s", PROGNAME, time, name, file, line, func, more_text);
+ }
+}
+#else
+#define DEGLOB_LOG(kind, name, ...)
+void deglob_log(int kind, string name, string file, int line, string func, string more_text) {}
+#endif
-#ifdef GAMEQC
+// convenience for deglobalization code - don't use these just to hide that globals are still used
+#define GET_V_GLOBALS(forward, right, up) MACRO_BEGIN forward = v_forward; right = v_right; up = v_up; MACRO_END
+#define SET_V_GLOBALS(forward, right, up) MACRO_BEGIN v_forward = forward; v_right = right; v_up = up; MACRO_END
+#if DEGLOB_CLEAR
+bool autocvar_debug_deglobalization_clear = true;
+#define CLEAR_V_GLOBALS() MACRO_BEGIN \
+ if (autocvar_debug_deglobalization_clear) { \
+ v_forward = VEC_NAN; v_right = VEC_NAN; v_up = VEC_NAN \
+ } \
+MACRO_END
STATIC_INIT(globals) {
// set to NaN to more easily detect uninitialized use
- // TODO when all functions are wrapped and the raw functions are not used anymore,
- // uncomment the defines in *progs.qh files that hide the raw functions
- // and assert that the global vectors are NaN before calling the raw functions here
- // to make sure nobody (even builtins) is accidentally using them - NaN is the most likely value to expose remaining usages
-
CLEAR_V_GLOBALS();
}
+#else
+#define CLEAR_V_GLOBALS()
#endif
/// Same as the `makevectors` builtin but uses the provided locals instead of the `v_*` globals.
/// Always use this instead of raw `makevectors` to make the data flow clear.
/// Note that you might prefer `FIXED_MAKE_VECTORS` for new code.
#define MAKE_VECTORS(angles, forward, right, up) MACRO_BEGIN \
+ DEGLOB_LOG(DEGLOB_WRAPPED, "MAKE_VECTORS", #angles); \
_makevectors_hidden(angles); \
GET_V_GLOBALS(forward, right, up); \
CLEAR_V_GLOBALS(); \
/// Returns all 4 vectors by assigning to them (instead of returning a value) for consistency (and sanity)
#define SKEL_GET_BONE_ABS(skel, bonenum, forward, right, up, origin) MACRO_BEGIN \
+ DEGLOB_LOG(DEGLOB_WRAPPED, "SKEL_GET_BONE_ABS", #skel, #bonenum); \
origin = _skel_get_boneabs_hidden(skel, bonenum) \
GET_V_GLOBALS(forward, right, up); \
CLEAR_V_GLOBALS(); \
MACRO_END
#define SKEL_SET_BONE(skel, bonenum, org, forward, right, up) MACRO_BEGIN \
+ DEGLOB_LOG(DEGLOB_WRAPPED, "SKEL_SET_BONE", #skel, #bonenum, #org); \
SET_V_GLOBALS(forward, right, up); \
_skel_set_bone_hidden(skel, bonenum, org); \
CLEAR_V_GLOBALS(); \
MACRO_END
#define ADD_DYNAMIC_LIGHT(org, radius, lightcolours, forward, right, up) MACRO_BEGIN \
+ DEGLOB_LOG(DEGLOB_WRAPPED, "ADD_DYNAMIC_LIGHT", #org, #radius, #lightcolours); \
SET_V_GLOBALS(forward, right, up); \
_adddynamiclight_hidden(org, radius, lightcolours); \
CLEAR_V_GLOBALS(); \
MACRO_END
#define VECTOR_VECTORS(forward_in, forward, right, up) MACRO_BEGIN \
+ DEGLOB_LOG(DEGLOB_WRAPPED, "VECTOR_VECTORS", #forward_in); \
_vectorvectors_hidden(forward_in); \
GET_V_GLOBALS(forward, right, up); \
CLEAR_V_GLOBALS(); \
/// Note that this only avoids the v_* globals, not the gettaginfo_* ones
#define GET_TAG_INFO(ent, tagindex, forward, right, up, origin) MACRO_BEGIN \
+ DEGLOB_LOG(DEGLOB_WRAPPED, "GET_TAG_INFO", #ent, #tagindex); \
origin = _gettaginfo_hidden(ent, tagindex); \
GET_V_GLOBALS(forward, right, up); \
CLEAR_V_GLOBALS(); \
MACRO_END
+
+#undef makevectors
+#define makevectors(angles) MACRO_BEGIN \
+ DEGLOB_LOG(DEGLOB_ORIGINAL, "makevectors", #angles); \
+ _makevectors_hidden(angles); \
+MACRO_END
+
+#undef skel_get_boneabs
+#define skel_get_boneabs(skel, bonenum) ( \
+ deglob_log(DEGLOB_ORIGINAL, "skel_get_boneabs", __FILE__, __LINE__, __FUNC__, #skel ", " #bonenum), \
+ _skel_get_boneabs_hidden(skel, bonenum) \
+)
+
+#undef skel_set_bone
+#define skel_set_bone(skel, bonenum, org) MACRO_BEGIN \
+ DEGLOB_LOG(DEGLOB_ORIGINAL, "skel_set_bone", #skel, #bonenum, #org); \
+ _skel_set_bone_hidden(skel, bonenum, org); \
+MACRO_END
+
+#undef adddynamiclight
+#define adddynamiclight(org, radius, lightcolours) MACRO_BEGIN \
+ DEGLOB_LOG(DEGLOB_ORIGINAL, "adddynamiclight", #org, #radius, #lightcolours); \
+ _adddynamiclight_hidden(org, radius, lightcolours); \
+MACRO_END
+
+#undef gettaginfo
+#define gettaginfo(ent, tagindex) ( \
+ deglob_log(DEGLOB_ORIGINAL, "gettaginfo", __FILE__, __LINE__, __FUNC__, #ent ", " #tagindex), \
+ _gettaginfo_hidden(ent, tagindex) \
+)
+
+#endif // GAMEQC
string prvm_language;
/**
- * @deprecated prefer _("translated") - GMQCC's -ftranslatable-strings feature
+ * @deprecated prefer _("translatable text") - GMQCC's -ftranslatable-strings feature
*/
ERASEABLE
string language_filename(string s)
/** color code replace, place inside of sprintf and parse the string */
string CCR(string input)
{
- // See the autocvar declarations in util.qh for default values
-
// foreground/normal colors
input = strreplace("^F1", strcat("^", autocvar_hud_colorset_foreground_1), input);
input = strreplace("^F2", strcat("^", autocvar_hud_colorset_foreground_2), input);
return min(max(v.x, -v.x), max(v.y, -v.y));
}
-ERASEABLE
-float dist_point_line(vector p, vector l0, vector ldir)
-{
- ldir = normalize(ldir);
-
- // remove the component in line direction
- p = p - (p * ldir) * ldir;
-
- // vlen of the remaining vector
- return vlen(p);
-}
-
/** requires that m2>m1 in all coordinates, and that m4>m3 */
ERASEABLE
float boxesoverlap(vector m1, vector m2, vector m3, vector m4) { return m2_x >= m3_x && m1_x <= m4_x && m2_y >= m3_y && m1_y <= m4_y && m2_z >= m3_z && m1_z <= m4_z; }
noref vector _yinvert;
#define yinvert(v) (_yinvert = (v), _yinvert.y = 1 - _yinvert.y, _yinvert)
+/// \param[in] p point
+/// \param[in] l0 starting point of ldir
+/// \param[in] ldir line
+/// \return Vector starting from p perpendicular to ldir
+ERASEABLE
+vector point_line_vec(vector p, vector l0, vector ldir)
+{
+ ldir = normalize(ldir);
+ p = l0 - p;
+ // remove the component in line direction from p
+ return p - ((p * ldir) * ldir);
+}
+
/**
* @param dir the directional vector
* @param norm the normalized normal
}
bool isnan(float e)
{
- // the sane way to detect NaN is broken because of a compiler bug
- // (works with constants but breaks when assigned to variables)
- // use conversion to string instead
- //float f = e;
- //return (e != f);
+ // The sane way to detect NaN is this:
+ // float f = e;
+ // return (e != f);
+ // but darkplaces used to be compiled with -ffinite-math-only which broke it.
+ // DP is fixed now but until all clients update (so after 0.8.3) we have to use the following workaround
+ // or they'd have issues when connecting to newer servers.
// Negative NaN ("-nan") is much more common but plain "nan" can be created by negating *some* -nans so we need to check both.
// DP's QCVM and GMQCC's QCVM behave differently - one needs ftos(-(0.0 / 0.0)), the other ftos(-sqrt(-1)).
{
return fabs(e) * ((f>0) ? 1 : -1);
}
-/// Always use `isnan` function to compare because `float x = nan(); x == x;` gives true
+
float nan(string tag)
{
return sqrt(-1);
s = campaign_shortdesc[i]; // fteqcc sucks
else
s = "???";
- s = draw_TextShortenToWidth(sprintf(_("Level %d: %s"), i+1, s), me.columnNameSize, 0, me.realFontSize);
+ // NOTE the following string is equal to the one used in the campaign level notification
+ // (CAMPAIGN_MESSAGE) to avoid adding another duplicate string to translate
+ s = draw_TextShortenToWidth(strcat(sprintf(_("Level %s: "), itos(i+1)), s), me.columnNameSize, 0, me.realFontSize);
draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, theColor, theAlpha, 0);
if(i <= me.campaignIndex)
me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "chase_active", "0", _("1st person perspective")));
me.TR(me);
me.TDempty(me, 0.2);
- me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_eventchase_death", _("Slide to third person upon death")));
+ me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(2, 0, "cl_eventchase_death", _("Slide to third person upon death")));
setDependent(e, "chase_active", -1, 0);
me.TR(me);
me.TDempty(me, 0.2);
_("Brightness of white")));
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gamma:")));
- setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
+ setDependent(e, "vid_gl20", 1, 1);
me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "v_gamma",
_("Inverse gamma correction value, a brightness effect that does not affect white or black")));
- setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
+ setDependent(e, "vid_gl20", 1, 1);
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast boost:")));
- setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
+ setDependent(e, "vid_gl20", 1, 1);
me.TD(me, 1, 2, e = makeXonoticSlider_T(1.0, 5.0, 0.1, "v_contrastboost",
_("By how much to multiply the contrast in dark areas")));
- setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
+ setDependent(e, "vid_gl20", 1, 1);
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Saturation:")));
setDependent(e, "vid_gl20", 1, 1);
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
e.applyButton = videoApplyButton;
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "v_glslgamma", _("Use GLSL to handle color control"),
- _("Enable use of GLSL to apply gamma correction, note that it might decrease performance by a lot")));
- setDependent(e, "vid_gl20", 1, 1);
if(cvar("developer") > 0)
{
me.TR(me);
string KeyBinds_Descriptions[MAX_KEYBINDS];
int KeyBinds_Count = -1;
-void KeyBinds_Read()
+void KeyBinds_BuildList()
{
KeyBinds_Count = 0;
#define KEYBIND_HEADER(str) KEYBIND_DEF("", str)
#define KEYBIND_IS_SPECIAL(func) (substring(func, 0 ,1) == "*")
- #define KEYBIND_SPECIAL_DEF(key) KEYBIND_DEF(strcat("*", key), "")
+ #define KEYBIND_SPECIAL_DEF(key, desc) KEYBIND_DEF(strcat("*", key), desc)
KEYBIND_HEADER(_("Moving"));
KEYBIND_DEF("+forward" , _("forward"));
KEYBIND_DEF("reload" , _("reload"));
KEYBIND_DEF("dropweapon" , _("drop weapon / throw nade"));
- int i;
-
#define ADD_TO_W_LIST(pred) \
FOREACH(Weapons, it != WEP_Null, { \
if (it.impulse != imp) continue; \
KEYBIND_DEF("spec" , _("enter spectator mode"));
KEYBIND_EMPTY_LINE();
- KEYBIND_HEADER(_("Communicate"));
+ KEYBIND_HEADER(_("Communication"));
KEYBIND_DEF("messagemode" , _("public chat"));
KEYBIND_DEF("messagemode2" , _("team chat"));
KEYBIND_DEF("+con_chat_maximize" , _("show chat history"));
// display the hardcoded shortcut to open the console as it works for all
// non-English keyboard layouts, unlike default keys (` and ~)
KEYBIND_DEF("toggleconsole" , _("enter console"));
- KEYBIND_SPECIAL_DEF(strcat(translate_key("SHIFT"), "+", translate_key("ESCAPE")));
+ string console_shortcut = strcat(translate_key("SHIFT"), "+", translate_key("ESCAPE"));
+ KEYBIND_SPECIAL_DEF(console_shortcut, _("enter console"));
KEYBIND_DEF("disconnect" , _("disconnect"));
KEYBIND_DEF("menu_showquitdialog" , _("quit"));
KEYBIND_EMPTY_LINE();
KEYBIND_HEADER(_("Teamplay"));
- KEYBIND_DEF("messagemode2" , _("team chat"));
KEYBIND_DEF("team_auto" , _("auto-join team"));
KEYBIND_DEF("menu_showteamselect" , _("team menu"));
- KEYBIND_DEF("+use" , _("drop key / drop flag"));
+ KEYBIND_DEF("spec" , _("spectate"));
KEYBIND_EMPTY_LINE();
KEYBIND_HEADER(_("Misc"));
- KEYBIND_DEF("kill" , _("respawn"));
+ KEYBIND_DEF("+use" , _("drop key/flag, exit vehicle"));
+ KEYBIND_DEF("kill" , _("suicide / respawn"));
KEYBIND_DEF("quickmenu" , _("quick menu"));
- KEYBIND_DEF("menu_showsandboxtools" , _("sandbox menu"));
- KEYBIND_DEF("wpeditor_menu" , _("waypoint editor menu"));
- KEYBIND_DEF("+button8" , _("drag object"));
KEYBIND_EMPTY_LINE();
KEYBIND_HEADER(_("User defined"));
- for(i = 1; i <= 32; ++i)
+ for(int i = 1; i <= 32; ++i)
KEYBIND_DEF(strcat("+userbind ", itos(i)), strcat("$userbind", itos(i)));
+ KEYBIND_EMPTY_LINE();
+
+ KEYBIND_HEADER(_("Development"));
+ KEYBIND_DEF("menu_showsandboxtools" , _("sandbox menu"));
+ KEYBIND_DEF("+button8" , _("drag object (sandbox)"));
+ KEYBIND_DEF("wpeditor_menu" , _("waypoint editor menu"));
+
#undef KEYBIND_DEF
}
bool force_initial_selection = false;
if(KeyBinds_Count < 0) // me.handle not loaded yet?
force_initial_selection = true;
- KeyBinds_Read();
+ KeyBinds_BuildList();
me.nItems = KeyBinds_Count;
if(force_initial_selection)
me.setSelected(me, 0);
{
k = stof(argv(j));
if(k != -1)
- //localcmd("\nunbind \"", keynumtostring(k), "\"\n");
+ {
+ // bind to empty cmd instead of using unbind so it gets saved in config and overrides any default binds
localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n");
+ }
}
}
m_play_click_sound(MENU_SOUND_SELECT);
{
k = stof(argv(j));
if(k != -1)
- //localcmd("\nunbind \"", keynumtostring(k), "\"\n");
+ {
+ // bind to empty cmd instead of using unbind so it gets saved in config and overrides any default binds
localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n");
+ }
}
m_play_click_sound(MENU_SOUND_CLEAR);
localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
void XonoticKeyBinder_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
{
- string s;
- int j, n;
- float k;
vector theColor;
float theAlpha;
float extraMargin;
if(func == "")
{
- theAlpha = 1;
theColor = SKINCOLOR_KEYGRABBER_TITLES;
theAlpha = SKINALPHA_KEYGRABBER_TITLES;
extraMargin = 0;
if(substring(descr, 0, 1) == "$")
{
- s = substring(descr, 1, strlen(descr) - 1);
+ string s = substring(descr, 1, strlen(descr) - 1);
descr = cvar_string(strcat(s, "_description"));
if(descr == "")
descr = s;
theAlpha *= SKINALPHA_DISABLED;
}
- s = draw_TextShortenToWidth(descr, me.columnFunctionSize, 0, me.realFontSize);
+ string s = draw_TextShortenToWidth(descr, me.columnFunctionSize, 0, me.realFontSize);
draw_Text(me.realUpperMargin * eY + extraMargin * eX, s, me.realFontSize, theColor, theAlpha, 0);
if (func == "")
s = substring(func, 1, -1);
else
{
- n = tokenize(findkeysforcommand(func, 0)); // uses '...' strings
- for(j = 0; j < n; ++j)
+ bool joy_active = cvar("joy_active");
+ int n = tokenize(findkeysforcommand(func, 0)); // uses '...' strings
+ for(int j = 0; j < n; ++j)
{
- k = stof(argv(j));
+ float k = stof(argv(j));
if(k != -1)
{
+ string key = keynumtostring(k);
+ if (!joy_active && startsWith(key, "JOY"))
+ continue;
if(s != "")
s = strcat(s, ", ");
- s = strcat(s, translate_key(keynumtostring(k)));
+ s = strcat(s, translate_key(key));
}
}
}
void SL_ProcessCategoryOverrides(.string override_field_string, .float override_field)
{
- string s;
for (int i = 0; i < category_ent_count; ++i)
{
- s = categories[i].override_field_string;
+ string s = categories[i].override_field_string;
if (s != "" && s != categories[i].cat_name)
{
int catnum = 0;
bool IsServerInList(string list, string srv)
{
- string p;
- int i, n;
if(srv == "")
return false;
srv = netaddress_resolve(srv, 26000);
if(srv == "")
return false;
- p = crypto_getidfp(srv);
- n = tokenize_console(list);
- for(i = 0; i < n; ++i)
+ string p = crypto_getidfp(srv);
+ int n = tokenize_console(list);
+ for(int i = 0; i < n; ++i)
{
if(substring(argv(i), 0, 1) != "[" && strlen(argv(i)) == 44 && strstrofs(argv(i), ".", 0) < 0)
{
- if(p)
- if(argv(i) == p)
- return true;
+ if(p && argv(i) == p)
+ return true;
}
else
{
return false;
}
-int CheckCategoryOverride(int cat)
+int CategoryOverride(int cat)
{
entity catent = RetrieveCategoryEnt(cat);
if(catent)
}
else
{
- error(sprintf("CheckCategoryOverride(%d): Improper category number!\n", cat));
+ error(sprintf("CategoryOverride(%d): Improper category number!\n", cat));
return cat;
}
}
-int CheckCategoryForEntry(int entry)
+int CategoryForEntry(int entry)
{
string s, k, v, modtype = "";
int j, m, impure = 0, freeslots = 0, sflags = 0;
case "minstagib":
case "instagib": { return CAT_INSTAGIB; }
case "overkill": { return CAT_OVERKILL; }
- //case "nix": { return CAT_NIX; }
- //case "newtoys": { return CAT_NEWTOYS; }
// "cts" is allowed as compat, xdf is replacement
case "cts":
entity e = me.favoriteButton;
if(IsFavorite(me.ipAddressBox.text))
{
- e.setText(e, _("Remove"));
- clearTooltip(e);
+ e.setText(e, _("Remove favorite"));
+ setZonedTooltip(e, _("Remove the currently highlighted server from bookmarks"), string_null);
}
else
{
if(mode >= REFRESHSERVERLIST_REFILTER)
{
- float m;
- int i, n;
- int listflags = 0;
- string s, typestr, modstr;
-
- s = me.filterString;
+ string s = me.filterString;
- m = strstrofs(s, ":", 0);
+ string typestr;
+ int m = strstrofs(s, ":", 0);
if(m >= 0)
{
typestr = substring(s, 0, m);
else
typestr = "";
- modstr = cvar_string("menu_slist_modfilter");
+ string modstr = cvar_string("menu_slist_modfilter");
m = SLIST_MASK_AND - 1;
resethostcachemasks();
}
// server banning
- n = tokenizebyseparator(_Nex_ExtResponseSystem_BannedServers, " ");
- for(i = 0; i < n; ++i)
+ int n = tokenizebyseparator(_Nex_ExtResponseSystem_BannedServers, " ");
+ for(int i = 0; i < n; ++i)
if(argv(i) != "")
sethostcachemaskstring(++m, SLIST_FIELD_CNAME, argv(i), SLIST_TEST_NOTSTARTSWITH);
sethostcachemaskstring(++m, SLIST_FIELD_QCSTATUS, strcat(s, ":"), SLIST_TEST_STARTSWITH);
}
- // sorting flags
- //listflags |= SLSF_FAVORITES;
- listflags |= SLSF_CATEGORIES;
- if(me.currentSortOrder < 0) { listflags |= SLSF_DESCENDING; }
- sethostcachesort(me.currentSortField, listflags);
+ int sorting_flags = 0;
+ //sorting_flags |= SLSF_FAVORITES;
+ sorting_flags |= SLSF_CATEGORIES;
+ if(me.currentSortOrder < 0) { sorting_flags |= SLSF_DESCENDING; }
+ sethostcachesort(me.currentSortField, sorting_flags);
}
resorthostcache();
void XonoticServerList_draw(entity me)
{
- int i;
- bool found = false, owned;
-
if(_Nex_ExtResponseSystem_BannedServersNeedsRefresh)
{
if(!me.needsRefresh)
me.refreshServerList(me, REFRESHSERVERLIST_RESORT);
}
- owned = ((me.selectedServer == me.ipAddressBox.text) && (me.ipAddressBox.text != ""));
+ bool owned = ((me.selectedServer == me.ipAddressBox.text) && (me.ipAddressBox.text != ""));
- for(i = 0; i < category_draw_count; ++i) { category_name[i] = -1; category_item[i] = -1; }
+ for(int i = 0; i < category_draw_count; ++i) { category_name[i] = -1; category_item[i] = -1; }
category_draw_count = 0;
if(autocvar_menu_slist_categories >= 0) // if less than 0, don't even draw a category heading for favorites
me.infoButton.disabled = (me.lockedSelectedItem || me.nItems == 0 || !owned);
me.favoriteButton.disabled = (me.lockedSelectedItem || (me.nItems == 0 && me.ipAddressBox.text == ""));
+ bool found = false;
if(me.lockedSelectedItem)
{
if(me.nItems > 0)
}
else if(me.selectedServer)
{
- for(i = 0; i < me.nItems; ++i)
+ for(int i = 0; i < me.nItems; ++i)
{
if(gethostcachestring(SLIST_FIELD_CNAME, i) == me.selectedServer)
{
}
void XonoticServerList_positionSortButton(entity me, entity btn, float theOrigin, float theSize, string theTitle, void(entity, entity) theFunc)
{
- vector originInLBSpace, sizeInLBSpace;
- originInLBSpace = eY * (-me.itemHeight);
- sizeInLBSpace = eY * me.itemHeight + eX * (1 - me.controlWidth);
+ vector originInLBSpace = eY * (-me.itemHeight);
+ vector sizeInLBSpace = eY * me.itemHeight + eX * (1 - me.controlWidth);
- vector originInDialogSpace, sizeInDialogSpace;
- originInDialogSpace = boxToGlobal(originInLBSpace, me.Container_origin, me.Container_size);
- sizeInDialogSpace = boxToGlobalSize(sizeInLBSpace, me.Container_size);
+ vector originInDialogSpace = boxToGlobal(originInLBSpace, me.Container_origin, me.Container_size);
+ vector sizeInDialogSpace = boxToGlobalSize(sizeInLBSpace, me.Container_size);
btn.Container_origin_x = originInDialogSpace.x + sizeInDialogSpace.x * theOrigin;
btn.Container_size_x = sizeInDialogSpace.x * theSize;
}
void XonoticServerList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
{
- // layout: Ping, Server name, Map name, NP, TP, MP
- float p;
- int q;
- bool isv4, isv6;
- vector theColor;
- float theAlpha;
- bool pure = false, pure_available = false;
- int freeslots = -1, sflags = -1, j, m;
- string s, typestr, versionstr, k, v, modname;
-
- //printf("time: %f, i: %d, item: %d, nitems: %d\n", time, i, item, me.nItems);
-
vector oldscale = draw_scale;
vector oldshift = draw_shift;
#define SET_YRANGE(start,end) \
draw_scale = boxToGlobalSize(eX + eY * (end - start), oldscale); \
draw_shift = boxToGlobal(eY * start, oldshift, oldscale);
- for (j = 0; j < category_draw_count; ++j) {
+ int c;
+ for (c = 0; c < category_draw_count; ++c) {
// Matches exactly the headings with increased height.
- if (i == category_item[j])
+ if (i == category_item[c])
break;
}
- if (j < category_draw_count)
+ if (c < category_draw_count)
{
- entity catent = RetrieveCategoryEnt(category_name[j]);
+ entity catent = RetrieveCategoryEnt(category_name[c]);
if(catent)
{
SET_YRANGE(
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
}
- s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
- m = tokenizebyseparator(s, ":");
- typestr = "";
+ string s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
+ int m = tokenizebyseparator(s, ":");
+ string typestr = "", versionstr = "";
if(m >= 2)
{
typestr = argv(0);
versionstr = argv(1);
}
- freeslots = -1;
- modname = "";
- for(j = 2; j < m; ++j)
+ bool pure = false, pure_available = false;
+ int freeslots = -1, sflags = -1;
+ string modname = "";
+ for(int j = 2; j < m; ++j)
{
if(argv(j) == "")
break;
- k = substring(argv(j), 0, 1);
- v = substring(argv(j), 1, -1);
- if(k == "P")
+ string key = substring(argv(j), 0, 1);
+ string value = substring(argv(j), 1, -1);
+ if(key == "P")
{
- pure = (stof(v) == 0);
+ pure = (stof(value) == 0);
pure_available = true;
}
- else if(k == "S")
- freeslots = stof(v);
- else if(k == "F")
- sflags = stoi(v);
- else if(k == "M")
- modname = v;
+ else if(key == "S")
+ freeslots = stof(value);
+ else if(key == "F")
+ sflags = stoi(value);
+ else if(key == "M")
+ modname = value;
}
#ifdef COMPAT_NO_MOD_IS_XONOTIC
if(modname != "newtoys")
pure_available = false;
+ float theAlpha;
if(gethostcachenumber(SLIST_FIELD_FREESLOTS, i) <= 0)
theAlpha = SKINALPHA_SERVERLIST_FULL;
else if(freeslots == 0)
else
theAlpha = 1;
- p = gethostcachenumber(SLIST_FIELD_PING, i);
+ float ping = gethostcachenumber(SLIST_FIELD_PING, i);
const int PING_LOW = 75;
const int PING_MED = 200;
const int PING_HIGH = 500;
- if(p < PING_LOW)
- theColor = SKINCOLOR_SERVERLIST_LOWPING + (SKINCOLOR_SERVERLIST_MEDPING - SKINCOLOR_SERVERLIST_LOWPING) * (p / PING_LOW);
- else if(p < PING_MED)
- theColor = SKINCOLOR_SERVERLIST_MEDPING + (SKINCOLOR_SERVERLIST_HIGHPING - SKINCOLOR_SERVERLIST_MEDPING) * ((p - PING_LOW) / (PING_MED - PING_LOW));
- else if(p < PING_HIGH)
+ vector theColor;
+ if(ping < PING_LOW)
+ theColor = SKINCOLOR_SERVERLIST_LOWPING + (SKINCOLOR_SERVERLIST_MEDPING - SKINCOLOR_SERVERLIST_LOWPING) * (ping / PING_LOW);
+ else if(ping < PING_MED)
+ theColor = SKINCOLOR_SERVERLIST_MEDPING + (SKINCOLOR_SERVERLIST_HIGHPING - SKINCOLOR_SERVERLIST_MEDPING) * ((ping - PING_LOW) / (PING_MED - PING_LOW));
+ else if(ping < PING_HIGH)
{
theColor = SKINCOLOR_SERVERLIST_HIGHPING;
- theAlpha *= 1 + (SKINALPHA_SERVERLIST_HIGHPING - 1) * ((p - PING_MED) / (PING_HIGH - PING_MED));
+ theAlpha *= 1 + (SKINALPHA_SERVERLIST_HIGHPING - 1) * ((ping - PING_MED) / (PING_HIGH - PING_MED));
}
else
{
s = gethostcachestring(SLIST_FIELD_CNAME, i);
- isv4 = isv6 = false;
+ bool isv4 = false, isv6 = false;
if(substring(s, 0, 1) == "[")
{
isv6 = true;
me.seenIPv4 += 1;
}
- q = stof(substring(crypto_getencryptlevel(s), 0, 1));
- if((q <= 0 && cvar("crypto_aeslevel") >= 3) || (q >= 3 && cvar("crypto_aeslevel") <= 0))
+ int crypto = stof(substring(crypto_getencryptlevel(s), 0, 1));
+ if((crypto <= 0 && cvar("crypto_aeslevel") >= 3) || (crypto >= 3 && cvar("crypto_aeslevel") <= 0))
{
theColor = SKINCOLOR_SERVERLIST_IMPOSSIBLE;
theAlpha = SKINALPHA_SERVERLIST_IMPOSSIBLE;
}
- if(q == 1)
+ if(crypto == 1)
{
if(cvar("crypto_aeslevel") >= 2)
- q |= 4;
+ crypto |= 4;
}
- if(q == 2)
+ if(crypto == 2)
{
if(cvar("crypto_aeslevel") >= 1)
- q |= 4;
+ crypto |= 4;
}
- if(q == 3)
- q = 5;
- else if(q >= 3)
- q -= 2;
+ if(crypto == 3)
+ crypto = 5;
+ else if(crypto >= 3)
+ crypto -= 2;
// possible status:
// 0: crypto off
// 1: AES possible
iconPos.x += iconSize.x;
// AES
- if(q > 0)
- draw_Picture(iconPos, strcat("icon_aeslevel", ftos(q)), iconSize, '1 1 1', 1);
+ if(crypto > 0)
+ draw_Picture(iconPos, strcat("icon_aeslevel", ftos(crypto)), iconSize, '1 1 1', 1);
iconPos.x += iconSize.x;
string t = "";
if(me.seenIPv4 && me.seenIPv6)
t = strcat(t, (isv6) ? "IPv6, " : "IPv4, ");
- t = strcat(t, _("encryption:"), " ", (q ? sprintf(_("AES level %d"), q) : ZCTX(_("ENC^none"))), ", ");
+ t = strcat(t, _("encryption:"), " ", (crypto ? sprintf(_("AES level %d"), crypto) : ZCTX(_("ENC^none"))), ", ");
t = strcat(t, sprintf(_("mod: %s"), ((modname == "xonotic") ? ZCTX(_("MOD^Default")) : original_modname)));
if(pure_available)
t = strcat(t, sprintf(" (%s)", (pure) ? _("official settings") : _("modified settings")));
// --------------
// ping
- s = ftos(p);
+ s = ftos(ping);
draw_Text(me.realUpperMargin * eY + (me.columnPingOrigin + me.columnPingSize - draw_TextWidth(s, 0, me.realFontSize)) * eX, s, me.realFontSize, theColor, theAlpha, 0);
// server name
int XonoticServerList_getItemAtPos(entity me, float pos)
{
pos = pos / me.itemHeight;
- int i;
- for (i = category_draw_count - 1; i >= 0; --i) {
+ for (int i = category_draw_count - 1; i >= 0; --i) {
int itemidx = category_item[i];
float itempos = i * me.categoriesHeight + category_item[i];
if (pos >= itempos + me.categoriesHeight + 1)
}
float XonoticServerList_getItemStart(entity me, int item)
{
- int i;
- for (i = category_draw_count - 1; i >= 0; --i) {
+ for (int i = category_draw_count - 1; i >= 0; --i) {
int itemidx = category_item[i];
float itempos = i * me.categoriesHeight + category_item[i];
if (item >= itemidx + 1)
}
float XonoticServerList_getItemHeight(entity me, int item)
{
- int i;
- for (i = 0; i < category_draw_count; ++i) {
+ for (int i = 0; i < category_draw_count; ++i) {
// Matches exactly the headings with increased height.
if (item == category_item[i])
return me.itemHeight * (me.categoriesHeight + 1);
entity makeXonoticServerList();
void RegisterSLCategories();
-float CheckCategoryForEntry(float entry);
+float CategoryForEntry(float entry);
void ServerList_Filter_Change(entity box, entity me);
void ServerList_Categories_Click(entity box, entity me);
void ServerList_ShowEmpty_Click(entity box, entity me);
entity RetrieveCategoryEnt(float catnum);
-float CheckCategoryOverride(float cat);
-float m_gethostcachecategory(float entry) { return CheckCategoryOverride(CheckCategoryForEntry(entry)); }
+float CategoryOverride(float cat);
+float m_gethostcachecategory(float entry) { return CategoryOverride(CategoryForEntry(entry)); }
// fields for category entities
.bool disabled;
void setDependent_Check(entity e)
{
+ bool disabled_prev = e.disabled;
float f;
string s;
if(e.func_setDependent)
e.disabled = (e.disabled + ((f >= e.cvar3Max_setDependent) && (f <= e.cvar3Min_setDependent)) > e.op_setDependent);
}
}
+ if (disabled_prev != e.disabled && e.loadCvars)
+ e.loadCvars(e);
}
void setDependent_Draw(entity e)
{
// clear buttons
PHYS_INPUT_BUTTON_ATCK(this) = false;
- PHYS_INPUT_BUTTON_JUMP(this) = false;
+ // keep jump button pressed for a short while, useful with ramp jumps
+ PHYS_INPUT_BUTTON_JUMP(this) = (!IS_DEAD(this) && time < this.bot_jump_time + 0.2);
PHYS_INPUT_BUTTON_ATCK2(this) = false;
PHYS_INPUT_BUTTON_ZOOM(this) = false;
PHYS_INPUT_BUTTON_CROUCH(this) = false;
void bot_setnameandstuff(entity this)
{
string readfile, s;
- float file, tokens, prio;
-
- string bot_name, bot_model, bot_skin, bot_shirt, bot_pants;
- string name, prefix, suffix;
-
- if(autocvar_g_campaign)
- {
- prefix = "";
- suffix = "";
- }
- else
- {
- prefix = autocvar_bot_prefix;
- suffix = autocvar_bot_suffix;
- }
+ int file, tokens, prio;
file = fopen(autocvar_bot_config_file, FILE_READ);
fclose(file);
}
+ string bot_name, bot_model, bot_skin, bot_shirt, bot_pants;
+
tokens = tokenizebyseparator(readfile, "\t");
if(argv(0) != "") bot_name = argv(0);
else bot_name = "Bot";
setcolor(this, stof(bot_shirt) * 16 + stof(bot_pants));
this.bot_preferredcolors = this.clientcolors;
- // pick the name
- if (autocvar_bot_usemodelnames)
- name = bot_model;
- else
- name = bot_name;
+ string prefix = (autocvar_g_campaign ? "" : autocvar_bot_prefix);
+ string suffix = (autocvar_g_campaign ? "" : autocvar_bot_suffix);
+ string name = (autocvar_bot_usemodelnames ? bot_model : bot_name);
- // number bots with identical names
if (name == "")
{
name = ftos(etof(this));
}
else
{
+ // number bots with identical names
int j = 0;
FOREACH_CLIENT(IS_BOT_CLIENT(it), {
if(it.cleanname == name)
void bot_custom_weapon_priority_setup()
{
+ static string bot_priority_far_prev;
+ static string bot_priority_mid_prev;
+ static string bot_priority_close_prev;
+ static string bot_priority_distances_prev;
float tokens, i, w;
bot_custom_weapon = false;
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 == ""
+ autocvar_bot_ai_custom_weapon_priority_distances == ""
)
return;
- // Parse distances
- tokens = tokenizebyseparator(autocvar_bot_ai_custom_weapon_priority_distances," ");
-
- if (tokens!=2)
- return;
-
- bot_distance_far = stof(argv(0));
- bot_distance_close = stof(argv(1));
-
- if(bot_distance_far < bot_distance_close){
- bot_distance_far = stof(argv(1));
- bot_distance_close = stof(argv(0));
- }
+ if (bot_priority_distances_prev != autocvar_bot_ai_custom_weapon_priority_distances)
+ {
+ strcpy(bot_priority_distances_prev, autocvar_bot_ai_custom_weapon_priority_distances);
+ tokens = tokenizebyseparator(autocvar_bot_ai_custom_weapon_priority_distances," ");
- // Initialize list of weapons
- bot_weapons_far[0] = -1;
- bot_weapons_mid[0] = -1;
- bot_weapons_close[0] = -1;
+ if (tokens!=2)
+ return;
- // Parse far distance weapon priorities
- tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_far)," ");
+ bot_distance_far = stof(argv(0));
+ bot_distance_close = stof(argv(1));
- int c = 0;
- for(i=0; i < tokens && c < Weapons_COUNT; ++i){
- w = stof(argv(i));
- if ( w >= WEP_FIRST && w <= WEP_LAST) {
- bot_weapons_far[c] = w;
- ++c;
+ if(bot_distance_far < bot_distance_close){
+ bot_distance_far = stof(argv(1));
+ bot_distance_close = stof(argv(0));
}
}
- if(c < Weapons_COUNT)
- bot_weapons_far[c] = -1;
- // Parse mid distance weapon priorities
- tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_mid)," ");
-
- c = 0;
- for(i=0; i < tokens && c < Weapons_COUNT; ++i){
- w = stof(argv(i));
- if ( w >= WEP_FIRST && w <= WEP_LAST) {
- bot_weapons_mid[c] = w;
- ++c;
- }
- }
- if(c < Weapons_COUNT)
- bot_weapons_mid[c] = -1;
-
- // Parse close distance weapon priorities
- tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_close)," ");
+ int c;
+
+ #define PARSE_WEAPON_PRIORITIES(dist) MACRO_BEGIN \
+ if (bot_priority_##dist##_prev != autocvar_bot_ai_custom_weapon_priority_##dist) { \
+ strcpy(bot_priority_##dist##_prev, autocvar_bot_ai_custom_weapon_priority_##dist); \
+ tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_##dist)," "); \
+ bot_weapons_##dist[0] = -1; \
+ c = 0; \
+ for(i = 0; i < tokens && c < Weapons_COUNT; ++i) { \
+ w = stof(argv(i)); \
+ if (w >= WEP_FIRST && w <= WEP_LAST) { \
+ bot_weapons_##dist[c] = w; \
+ ++c; \
+ } \
+ } \
+ if (c < Weapons_COUNT) \
+ bot_weapons_##dist[c] = -1; \
+ } \
+ MACRO_END
- c = 0;
- for(i=0; i < tokens && i < Weapons_COUNT; ++i){
- w = stof(argv(i));
- if ( w >= WEP_FIRST && w <= WEP_LAST) {
- bot_weapons_close[c] = w;
- ++c;
- }
- }
- if(c < Weapons_COUNT)
- bot_weapons_close[c] = -1;
+ PARSE_WEAPON_PRIORITIES(far);
+ PARSE_WEAPON_PRIORITIES(mid);
+ PARSE_WEAPON_PRIORITIES(close);
bot_custom_weapon = true;
}
if (autocvar_g_waypointeditor_auto)
botframe_autowaypoints();
- if(time > bot_cvar_nextthink)
- {
- if(currentbots>0)
- bot_custom_weapon_priority_setup();
- bot_cvar_nextthink = time + 5;
- }
+ if (currentbots > 0)
+ bot_custom_weapon_priority_setup();
}
.bool bot_pickup_respawning;
.float bot_canfire;
.float bot_strategytime;
+.float bot_jump_time;
.float bot_forced_team;
.float bot_config_loaded;
float botframe_spawnedwaypoints;
float botframe_nextthink;
float botframe_nextdangertime;
-float bot_cvar_nextthink;
int _content_type;
#define IN_LAVA(pos) (_content_type = pointcontents(pos), (_content_type == CONTENT_LAVA || _content_type == CONTENT_SLIME))
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_bunnyhop_dir_deviation_max;
+float autocvar_bot_ai_bunnyhop_downward_pitch_max;
+float autocvar_bot_ai_bunnyhop_turn_angle_min;
+float autocvar_bot_ai_bunnyhop_turn_angle_max;
+float autocvar_bot_ai_bunnyhop_turn_angle_reduction;
float autocvar_bot_ai_chooseweaponinterval;
string autocvar_bot_ai_custom_weapon_priority_close;
string autocvar_bot_ai_custom_weapon_priority_distances;
float autocvar_bot_ai_dangerdetectioninterval;
float autocvar_bot_ai_dangerdetectionupdates;
float autocvar_bot_ai_enemydetectioninterval;
+float autocvar_bot_ai_enemydetectioninterval_stickingtoenemy;
float autocvar_bot_ai_enemydetectionradius;
float autocvar_bot_ai_friends_aware_pickup_radius;
float autocvar_bot_ai_ignoregoal_timeout;
}
else
{
- if (!this.jumppadcount && !STAT(FROZEN, this))
+ if (!this.jumppadcount && !STAT(FROZEN, this)
+ && !(this.goalcurrent_prev && (this.goalcurrent_prev.wpflags & WAYPOINTFLAG_JUMP)))
+ {
+ // find a new goal
this.havocbot_role(this); // little too far down the rabbit hole
+ }
}
// if we don't have a goal and we're under water look for a waypoint near the "shore" and push it
{
if (this.goalcurrent)
navigation_clearroute(this);
+ this.enemy = NULL;
+ this.bot_aimtarg = NULL;
return;
}
}
}
+void havocbot_bunnyhop(entity this, vector dir)
+{
+ bool can_run = false;
+ if (!(this.aistatus & AI_STATUS_ATTACKING) && this.goalcurrent && !IS_PLAYER(this.goalcurrent)
+ && vdist(vec2(this.velocity), >=, autocvar_sv_maxspeed) && !(this.aistatus & AI_STATUS_DANGER_AHEAD)
+ && this.waterlevel <= WATERLEVEL_WETFEET && !IS_DUCKED(this)
+ && IS_ONGROUND(this) && !(this.goalcurrent_prev && (this.goalcurrent_prev.wpflags & WAYPOINTFLAG_JUMP)))
+ {
+ vector vel_angles = vectoangles(this.velocity);
+ vector deviation = vel_angles - vectoangles(dir);
+ while (deviation.y < -180) deviation.y = deviation.y + 360;
+ while (deviation.y > 180) deviation.y = deviation.y - 360;
+ if (fabs(deviation.y) < autocvar_bot_ai_bunnyhop_dir_deviation_max)
+ {
+ vector gco = get_closer_dest(this.goalcurrent, this.origin);
+ float vel = vlen(vec2(this.velocity));
+
+ // with the current physics, jump distance grows linearly with the speed
+ float jump_distance = 52.661 + 0.606 * vel;
+ jump_distance += this.origin.z - gco.z; // roughly take into account vertical distance too
+ if (vdist(vec2(gco - this.origin), >, max(0, jump_distance)))
+ can_run = true;
+ else if (!(this.goalcurrent.wpflags & WAYPOINTFLAG_JUMP)
+ && !(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
+ && this.goalstack01 && !wasfreed(this.goalstack01) && !(this.goalstack01.wpflags & WAYPOINTFLAG_JUMP)
+ && vdist(vec2(gco - this.goalstack01.origin), >, 70))
+ {
+ vector gno = (this.goalstack01.absmin + this.goalstack01.absmax) * 0.5;
+ vector ang = vectoangles(gco - this.origin);
+ deviation = vectoangles(gno - gco) - vel_angles;
+ while (deviation.y < -180) deviation.y = deviation.y + 360;
+ while (deviation.y > 180) deviation.y = deviation.y - 360;
+
+ float max_turn_angle = autocvar_bot_ai_bunnyhop_turn_angle_max;
+ max_turn_angle -= autocvar_bot_ai_bunnyhop_turn_angle_reduction * ((vel - autocvar_sv_maxspeed) / autocvar_sv_maxspeed);
+ if ((ang.x < 90 || ang.x > 360 - autocvar_bot_ai_bunnyhop_downward_pitch_max)
+ && fabs(deviation.y) < max(autocvar_bot_ai_bunnyhop_turn_angle_min, max_turn_angle))
+ {
+ can_run = true;
+ }
+ }
+ }
+ }
+
+ if (can_run)
+ {
+ PHYS_INPUT_BUTTON_JUMP(this) = true;
+ this.bot_jump_time = time;
+ this.aistatus |= AI_STATUS_RUNNING;
+ }
+ else
+ {
+ if (IS_ONGROUND(this) || this.waterlevel > WATERLEVEL_WETFEET)
+ this.aistatus &= ~AI_STATUS_RUNNING;
+ }
+}
+
void havocbot_keyboard_movement(entity this, vector destorg)
{
if(time <= this.havocbot_keyboardtime)
CS(this).movement = CS(this).movement + (keyboard - CS(this).movement) * blend;
}
-void havocbot_bunnyhop(entity this, vector dir)
-{
- // Don't jump when attacking
- if(this.aistatus & AI_STATUS_ATTACKING)
- return;
-
- if (!this.goalcurrent || IS_PLAYER(this.goalcurrent))
- return;
-
- if((this.aistatus & AI_STATUS_RUNNING) && vdist(this.velocity, <, autocvar_sv_maxspeed * 0.75)
- || (this.aistatus & AI_STATUS_DANGER_AHEAD))
- {
- this.aistatus &= ~AI_STATUS_RUNNING;
- PHYS_INPUT_BUTTON_JUMP(this) = false;
- this.bot_canruntogoal = 0;
- this.bot_timelastseengoal = 0;
- return;
- }
-
- if(this.waterlevel > WATERLEVEL_WETFEET || IS_DUCKED(this))
- {
- this.aistatus &= ~AI_STATUS_RUNNING;
- return;
- }
-
- if(this.bot_lastseengoal != this.goalcurrent && !(this.aistatus & AI_STATUS_RUNNING))
- {
- this.bot_canruntogoal = 0;
- this.bot_timelastseengoal = 0;
- }
-
- // Run only to visible goals
- if(IS_ONGROUND(this))
- if(vdist(vec2(this.velocity), >=, autocvar_sv_maxspeed))
- if(checkpvs(this.origin + this.view_ofs, this.goalcurrent))
- {
- this.bot_lastseengoal = this.goalcurrent;
-
- // seen it before
- if(this.bot_timelastseengoal)
- {
- vector gco = get_closer_dest(this.goalcurrent, this.origin);
- // for a period of time
- if(time - this.bot_timelastseengoal > autocvar_bot_ai_bunnyhop_firstjumpdelay)
- {
- bool checkdistance = true;
-
- // don't run if it is too close
- if(this.bot_canruntogoal==0)
- {
- if(vdist(this.origin - gco, >, autocvar_bot_ai_bunnyhop_startdistance))
- this.bot_canruntogoal = 1;
- else
- this.bot_canruntogoal = -1;
- }
-
- if(this.bot_canruntogoal != 1)
- return;
-
- if(this.aistatus & AI_STATUS_ROAMING)
- if(this.goalcurrent.classname == "waypoint")
- if (!(this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL))
- if(fabs(gco.z - this.origin.z) < this.maxs.z - this.mins.z)
- if (this.goalstack01 && !wasfreed(this.goalstack01))
- if (!(this.goalstack01.wpflags & WAYPOINTFLAG_JUMP))
- {
- vector gno = (this.goalstack01.absmin + this.goalstack01.absmax) * 0.5;
- vector deviation = vectoangles(gno - this.origin) - vectoangles(gco - this.origin);
- while (deviation.y < -180) deviation.y = deviation.y + 360;
- while (deviation.y > 180) deviation.y = deviation.y - 360;
-
- if(fabs(deviation.y) < 20)
- if(vlen2(this.origin - gco) < vlen2(this.origin - gno))
- if(fabs(gno.z - gco.z) < this.maxs.z - this.mins.z)
- {
- if(vdist(gco - gno, >, autocvar_bot_ai_bunnyhop_startdistance))
- if(checkpvs(this.origin + this.view_ofs, this.goalstack01))
- {
- checkdistance = false;
- }
- }
- }
-
- if(checkdistance)
- {
- this.aistatus &= ~AI_STATUS_RUNNING;
- // increase stop distance in case the goal is on a slope or a lower platform
- if(vdist(this.origin - gco, >, autocvar_bot_ai_bunnyhop_stopdistance + (this.origin.z - gco.z)))
- PHYS_INPUT_BUTTON_JUMP(this) = true;
- }
- else
- {
- this.aistatus |= AI_STATUS_RUNNING;
- PHYS_INPUT_BUTTON_JUMP(this) = true;
- }
- }
- }
- else
- {
- this.bot_timelastseengoal = time;
- }
- }
- else
- {
- this.bot_timelastseengoal = 0;
- }
-}
-
// return true when bot isn't getting closer to the current goal
bool havocbot_checkgoaldistance(entity this, vector gco)
{
vector diff;
vector dir;
vector flatdir;
- vector evadeobstacle;
- vector evadelava;
float dodge_enemy_factor = 1;
float maxspeed;
//float dist;
* ((this.strength_finished > time) ? autocvar_g_balance_powerup_strength_selfdamage : 1) \
* ((this.invincible_finished > time) ? autocvar_g_balance_powerup_invincible_takedamage : 1)
- tracebox(this.origin, this.mins, this.maxs, this.origin + '0 0 -65536', MOVE_NOMONSTERS, this);
- if(tracebox_hits_trigger_hurt(this.origin, this.mins, this.maxs, trace_endpos ))
- if(this.items & IT_JETPACK)
+ // save some CPU cycles by checking trigger_hurt after checking
+ // that something can be done to evade it (cheaper checks)
+ int action_for_trigger_hurt = 0;
+ if (this.items & IT_JETPACK)
+ action_for_trigger_hurt = 1;
+ else if (!this.jumppadcount && !waypoint_is_hardwiredlink(this.goalcurrent_prev, this.goalcurrent)
+ && !(this.goalcurrent_prev && this.goalcurrent_prev.wpflags & WAYPOINTFLAG_JUMP)
+ && GetResource(this, RES_HEALTH) + GetResource(this, RES_ARMOR) > ROCKETJUMP_DAMAGE())
+ {
+ action_for_trigger_hurt = 2;
+ }
+ else if (!this.goalcurrent)
+ action_for_trigger_hurt = 3;
+
+ if (action_for_trigger_hurt)
+ {
+ tracebox(this.origin, this.mins, this.maxs, this.origin + '0 0 -65536', MOVE_NOMONSTERS, this);
+ if(!tracebox_hits_trigger_hurt(this.origin, this.mins, this.maxs, trace_endpos))
+ action_for_trigger_hurt = 0;
+ }
+
+ if(action_for_trigger_hurt == 1) // jetpack
{
tracebox(this.origin, this.mins, this.maxs, this.origin + '0 0 65536', MOVE_NOMONSTERS, this);
if(tracebox_hits_trigger_hurt(this.origin, this.mins, this.maxs, trace_endpos + '0 0 1' ))
return;
}
- else if(!this.jumppadcount && !waypoint_is_hardwiredlink(this.goalcurrent_prev, this.goalcurrent)
- && !(this.goalcurrent_prev && this.goalcurrent_prev.wpflags & WAYPOINTFLAG_JUMP)
- && GetResource(this, RES_HEALTH) + GetResource(this, RES_ARMOR) > ROCKETJUMP_DAMAGE())
+ else if(action_for_trigger_hurt == 2) // rocketjump
{
if(this.velocity.z < 0)
{
}
}
}
- else
+ else if(action_for_trigger_hurt == 3) // no goal
{
// If there is no goal try to move forward
- if(this.goalcurrent==NULL)
- CS(this).movement_x = maxspeed;
+ CS(this).movement_x = maxspeed;
}
}
dir.z = 1;
else if(this.velocity.z >= 0 && !(this.waterlevel == WATERLEVEL_WETFEET && this.watertype == CONTENT_WATER))
PHYS_INPUT_BUTTON_JUMP(this) = true;
- else
- PHYS_INPUT_BUTTON_JUMP(this) = false;
makevectors(this.v_angle.y * '0 1 0');
vector v = dir * maxspeed;
CS(this).movement.x = v * v_forward;
dir = normalize(diff);
flatdir = (diff.z == 0) ? dir : normalize(vec2(diff));
+ bool danger_detected = false;
+ vector do_break = '0 0 0';
+
//if (this.bot_dodgevector_time < time)
{
//this.bot_dodgevector_time = time + cvar("bot_ai_dodgeupdateinterval");
//this.bot_dodgevector_jumpbutton = 1;
- evadeobstacle = '0 0 0';
- evadelava = '0 0 0';
this.aistatus &= ~AI_STATUS_DANGER_AHEAD;
makevectors(this.v_angle.y * '0 1 0');
}
else
{
- PHYS_INPUT_BUTTON_JUMP(this) = false;
if (destorg.z > this.origin.z)
dir = flatdir;
}
)
{
PHYS_INPUT_BUTTON_JUMP(this) = true;
- // avoid changing route while bot is jumping a gap
- navigation_goalrating_timeout_extend_if_needed(this, 1.5);
+ this.bot_jump_time = time;
}
}
else if (!this.goalstack01 || (this.goalcurrent.wpflags & (WAYPOINTFLAG_TELEPORT | WAYPOINTFLAG_LADDER)))
vector jump_height = (IS_ONGROUND(this)) ? stepheightvec + jumpheight_vec : jumpstepheightvec;
tracebox(this.origin + jump_height, this.mins, this.maxs, actual_destorg + jump_height, false, this);
if (trace_fraction > s)
+ {
PHYS_INPUT_BUTTON_JUMP(this) = true;
+ this.bot_jump_time = time;
+ }
else
{
jump_height = stepheightvec + jumpheight_vec / 2;
tracebox(this.origin + jump_height, this.mins, this.maxs, actual_destorg + jump_height, false, this);
if (trace_fraction > s)
+ {
PHYS_INPUT_BUTTON_JUMP(this) = true;
+ this.bot_jump_time = time;
+ }
}
}
}
this.goalcurrent_distance_time = -time; // mark second try
}
- // Check for water/slime/lava and dangerous edges
- // (only when the bot is on the ground or jumping intentionally)
-
if (skill + this.bot_moveskill <= 3 && time > this.bot_stop_moving_timeout
&& current_speed > maxspeed * 0.9 && fabs(deviation.y) > 70)
{
this.bot_stop_moving_timeout = time + 0.4 + random() * 0.2;
}
+ // Check for water/slime/lava and dangerous edges
+ // (only when the bot is on the ground or jumping intentionally)
+
offset = (vdist(this.velocity, >, 32) ? this.velocity * 0.2 : flatdir * 32);
vector dst_ahead = this.origin + this.view_ofs + offset;
vector dst_down = dst_ahead - '0 0 3000';
//te_lightning2(NULL, dst_ahead, trace_endpos); // Draw "downwards" look
if(trace_endpos.z < this.origin.z + this.mins.z)
{
- s = pointcontents(trace_endpos + '0 0 1');
- if (s != CONTENT_SOLID)
- if (s == CONTENT_LAVA || s == CONTENT_SLIME)
- evadelava = normalize(this.velocity) * -1;
- else if (s == CONTENT_SKY)
- evadeobstacle = normalize(this.velocity) * -1;
- else if (tracebox_hits_trigger_hurt(dst_ahead, this.mins, this.maxs, trace_endpos))
+ if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)
+ danger_detected = true;
+ else if (trace_endpos.z < min(this.origin.z + this.mins.z, this.goalcurrent.origin.z) - 100)
+ danger_detected = true;
+ else
{
- // the traceline check isn't enough but is good as optimization,
- // when not true (most of the time) this tracebox call is avoided
- tracebox(dst_ahead, this.mins, this.maxs, dst_down, true, this);
- if (tracebox_hits_trigger_hurt(dst_ahead, this.mins, this.maxs, trace_endpos))
+ s = pointcontents(trace_endpos + '0 0 1');
+ if (s != CONTENT_SOLID)
{
- if (destorg.z > this.origin.z + jumpstepheightvec.z)
+ if (s == CONTENT_LAVA || s == CONTENT_SLIME)
+ danger_detected = true;
+ else if (tracebox_hits_trigger_hurt(dst_ahead, this.mins, this.maxs, trace_endpos))
{
- // the goal is probably on an upper platform, assume bot can't get there
- unreachable = true;
+ // the traceline check isn't enough but is good as optimization,
+ // when not true (most of the time) this tracebox call is avoided
+ tracebox(dst_ahead, this.mins, this.maxs, dst_down, true, this);
+ if (tracebox_hits_trigger_hurt(dst_ahead, this.mins, this.maxs, trace_endpos))
+ {
+ if (destorg.z > this.origin.z + jumpstepheightvec.z)
+ {
+ // the goal is probably on an upper platform, assume bot can't get there
+ unreachable = true;
+ }
+ else
+ danger_detected = true;
+ }
}
- else
- evadelava = normalize(this.velocity) * -1;
}
}
}
}
dir = flatdir;
- evadeobstacle.z = 0;
- evadelava.z = 0;
makevectors(this.v_angle.y * '0 1 0');
- if(evadeobstacle || evadelava || (s == CONTENT_WATER))
+ if (danger_detected || (s == CONTENT_WATER))
{
this.aistatus |= AI_STATUS_DANGER_AHEAD;
if(IS_PLAYER(this.goalcurrent))
// tracebox wouldn't work when bot is still on the ledge
traceline(this.origin, this.origin - '0 0 200', true, this);
if (this.origin.z - trace_endpos.z > 120)
- evadeobstacle = normalize(this.velocity) * -1;
+ do_break = normalize(this.velocity) * -1;
}
if(unreachable)
dodge = havocbot_dodge(this);
if (dodge)
dodge *= bound(0, 0.5 + (skill + this.bot_dodgeskill) * 0.1, 1);
- dodge += evadeobstacle + evadelava;
- evadelava = evadelava * bound(1,3-(skill+this.bot_dodgeskill),3); //Noobs fear lava a lot and take more distance from it
if (this.enemy)
{
traceline(this.origin, (this.enemy.absmin + this.enemy.absmax) * 0.5, true, NULL);
bot_aimdir(this, dir, 0);
}
+ vector evadedanger = '0 0 0';
if (!ladder_zdir)
{
dir *= dodge_enemy_factor;
- dir = normalize(dir + dodge);
+ if (danger_detected && vdist(this.velocity, >, maxspeed * 0.8) && this.goalcurrent_prev
+ && this.goalcurrent.classname == "waypoint")
+ {
+ vector p = this.origin + this.velocity * 0.2;
+ vector evadedanger = point_line_vec(p, vec2(this.goalcurrent_prev.origin) + eZ * p.z,
+ vec2(destorg - this.goalcurrent_prev.origin));
+ if (vdist(evadedanger, >, 20))
+ {
+ if (vdist(evadedanger, >, 40))
+ do_break = normalize(this.velocity) * -1;
+ evadedanger = normalize(evadedanger);
+ evadedanger *= bound(1, 3 - (skill + this.bot_dodgeskill), 3); // Noobs fear dangers a lot and take more distance from them
+ }
+ else
+ evadedanger = '0 0 0';
+ }
+ dir = normalize(dir + dodge + do_break + evadedanger);
}
makevectors(this.v_angle);
havocbot_keyboard_movement(this, destorg);
// Bunnyhop!
- if (!bunnyhop_forbidden && skill + this.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset)
+ if (!bunnyhop_forbidden && !evadedanger && !do_break && skill + this.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset)
havocbot_bunnyhop(this, dir);
if (dir * v_up >= autocvar_sv_jumpvelocity * 0.5 && IS_ONGROUND(this))
this.enemy = NULL;
return;
}
+
if (this.enemy)
{
if (!bot_shouldattack(this, this.enemy))
this.enemy = NULL;
this.havocbot_chooseenemy_finished = time;
}
- else if (this.havocbot_stickenemy)
+ else if (this.havocbot_stickenemy_time && time < this.havocbot_stickenemy_time)
{
// tracking last chosen enemy
- // if enemy is visible
- // and not really really far away
- // and we're not severely injured
- // then keep tracking for a half second into the future
- traceline(this.origin+this.view_ofs, ( this.enemy.absmin + this.enemy.absmax ) * 0.5,false,NULL);
+ vector targ_pos = (this.enemy.absmin + this.enemy.absmax) * 0.5;
+ traceline(this.origin + this.view_ofs, targ_pos, false, NULL);
if (trace_ent == this.enemy || trace_fraction == 1)
- if (vdist(((this.enemy.absmin + this.enemy.absmax) * 0.5) - this.origin, <, 1000))
- if (GetResource(this, RES_HEALTH) > 30)
+ if (vdist(targ_pos - this.origin, <, 1000))
{
// remain tracking him for a shot while (case he went after a small corner or pilar
this.havocbot_chooseenemy_finished = time + 0.5;
return;
}
- // enemy isn't visible, or is far away, or we're injured severely
- // so stop preferring this enemy
- // (it will still take a half second until a new one is chosen)
- this.havocbot_stickenemy = 0;
+
+ // stop preferring this enemy
+ this.havocbot_stickenemy_time = 0;
}
}
if (time < this.havocbot_chooseenemy_finished)
this.havocbot_chooseenemy_finished = time + autocvar_bot_ai_enemydetectioninterval;
vector eye = this.origin + this.view_ofs;
entity best = NULL;
- float bestrating = 100000000;
+ float bestrating = autocvar_bot_ai_enemydetectionradius ** 2;
// Backup hit flags
int hf = this.dphitcontentsmask;
vector v = (it.absmin + it.absmax) * 0.5;
float rating = vlen2(v - eye);
- if (vdist(v - eye, <, autocvar_bot_ai_enemydetectionradius))
- if (bestrating > rating)
- if (bot_shouldattack(this, it))
+ if (rating < bestrating && bot_shouldattack(this, it))
{
traceline(eye, v, true, this);
if (trace_ent == it || trace_fraction >= 1)
{
scan_secondary_targets = true;
// restart the loop
- bestrating = 100000000;
+ bestrating = autocvar_bot_ai_enemydetectionradius ** 2;
goto scan_targets;
}
this.dphitcontentsmask = hf;
this.enemy = best;
- this.havocbot_stickenemy = true;
+ this.havocbot_stickenemy_time = time + autocvar_bot_ai_enemydetectioninterval_stickingtoenemy;
if(best && best.classname == "misc_breakablemodel")
- this.havocbot_stickenemy = false;
+ this.havocbot_stickenemy_time = 0;
}
float havocbot_chooseweapon_checkreload(entity this, .entity weaponentity, int new_weapon)
.float havocbot_keyboardtime;
.float havocbot_ducktime;
-.float bot_timelastseengoal;
-.float bot_canruntogoal;
.float bot_chooseweapontime;
.float rocketjumptime;
.float nextaim;
.float havocbot_personal_waypoint_searchtime;
.float havocbot_personal_waypoint_failcounter;
.float havocbot_chooseenemy_finished;
-.float havocbot_stickenemy;
+.float havocbot_stickenemy_time;
.float havocbot_role_timeout;
.float bot_stop_moving_timeout;
return this.bot_strategytime < time;
}
+ERASEABLE
void navigation_goalrating_timeout_extend_if_needed(entity this, float seconds)
{
this.bot_strategytime = max(this.bot_strategytime, time + seconds);
if(boxesoverlap(pm1, pm2, it.absmin, it.absmax))
{
if(walkfromwp && !ent.navigation_dynamicgoal)
- {
waypoint_clearlinks(ent); // initialize wpXXmincost fields
- navigation_item_addlink(it, ent);
- }
return it;
}
});
org.z = ent.origin.z + ent.mins.z - PL_MIN_CONST.z; // player height
}
- if(!autocvar_g_waypointeditor && walkfromwp && !ent.navigation_dynamicgoal)
- {
- waypoint_clearlinks(ent); // initialize wpXXmincost fields
- IL_EACH(g_waypoints, it != ent,
- {
- if (walkfromwp && (it.wpflags & WPFLAGMASK_NORELINK))
- continue;
-
- set_tracewalk_dest(ent, it.origin, false);
- if (vdist(tracewalk_dest - it.origin, <, 1050)
- && tracewalk(ent, it.origin, PL_MIN_CONST, PL_MAX_CONST,
- tracewalk_dest, tracewalk_dest_height, bot_navigation_movemode))
- {
- navigation_item_addlink(it, ent);
- }
- });
- }
-
// box check failed, try walk
IL_EACH(g_waypoints, it != ent,
{
if(e == NULL)
return false;
- if(nearest_wp && nearest_wp.enemy)
+ if(nearest_wp && nearest_wp.enemy && !(nearest_wp.enemy.wpflags & WPFLAGMASK_NORELINK))
{
// often path can be optimized by not adding the nearest waypoint
if (this.goalentity.navigation_dynamicgoal || autocvar_g_waypointeditor)
}
}
}
- else if(navigation_item_islinked(nearest_wp.enemy, this.goalentity))
- e = nearest_wp.enemy;
+ else
+ {
+ // NOTE unlike waypoints, items hold incoming links
+ navigation_item_initlinks_ifneeded(this.goalentity);
+ int link_num = navigation_item_getlinknum(this.goalentity, nearest_wp.enemy);
+ if (link_num >= 0)
+ {
+ if (navigation_item_iswalkablelink(this.goalentity, link_num))
+ e = nearest_wp.enemy;
+ }
+ else // untested link
+ {
+ entity wp = nearest_wp.enemy;
+ entity goal = this.goalentity;
+ bool walkable = false;
+ if (checkpvs(wp.origin, goal))
+ {
+ set_tracewalk_dest(goal, wp.origin, false);
+ if (vdist(tracewalk_dest - wp.origin, <, 1050)
+ && tracewalk(goal, wp.origin, PL_MIN_CONST, PL_MAX_CONST,
+ tracewalk_dest, tracewalk_dest_height, bot_navigation_movemode))
+ {
+ walkable = true;
+ e = nearest_wp.enemy;
+ }
+ }
+ navigation_item_add_link(wp, goal, walkable);
+ }
+ }
}
for (;;)
}
// Loose goal touching check when running
- if(this.aistatus & AI_STATUS_RUNNING)
- if(this.goalcurrent.classname=="waypoint")
- if(vdist(vec2(this.velocity), >=, autocvar_sv_maxspeed)) // if -really- running
- {
- if(vdist(this.origin - this.goalcurrent.origin, <, 150))
+ // check goalstack01 to make sure waypoint isn't the final goal
+ if(this.aistatus & AI_STATUS_RUNNING && this.goalcurrent.classname == "waypoint" && !(this.goalcurrent.wpflags & WAYPOINTFLAG_JUMP)
+ && this.goalstack01 && !wasfreed(this.goalstack01) && vdist(vec2(this.velocity), >=, autocvar_sv_maxspeed))
+ {
+ vector gco = this.goalcurrent.origin;
+ float min_dist = BOT_BUNNYHOP_WP_DETECTION_RANGE;
+ // also detect waypoints when bot is way above them but with a narrower horizontal range
+ // so to increase chances bot ends up in the standard range (optimizes nearest waypoint finding)
+ if(vdist(this.origin - gco, <, min_dist)
+ || (vdist(vec2(this.origin - gco), <, min_dist * 0.5) && vdist(this.origin - eZ * 1.5 * min_dist - gco, <, min_dist)))
{
traceline(this.origin + this.view_ofs , this.goalcurrent.origin, true, NULL);
if(trace_fraction==1)
if(this.goalcurrent.classname == "waypoint" && !this.goalcurrent.wpisbox)
{
gc_min = this.goalcurrent.origin - '1 1 1' * 12;
- gc_max = this.goalcurrent.origin + '1 1 1' * 12;
+ gc_max = this.goalcurrent.origin + '1 1 1' * 12 + eZ * (jumpheight_vec.z + STAT(PL_MIN, this).z);
}
if (time < this.ladder_time)
{
wp = this.goalcurrent_prev;
if(!wp)
return NULL;
- if(wp != this.goalcurrent_prev && vdist(wp.origin - this.origin, >, 50))
+ float min_dist = ((this.aistatus & AI_STATUS_RUNNING) ? BOT_BUNNYHOP_WP_DETECTION_RANGE : 50);
+ if(wp != this.goalcurrent_prev && vdist(wp.origin - this.origin, >, min_dist))
{
wp = this.goalcurrent_prev;
if(!wp)
if(!wp)
return NULL;
}
- if(vdist(wp.origin - this.origin, >, 50))
+ if(vdist(wp.origin - this.origin, >, min_dist))
{
wp = NULL;
IL_EACH(g_waypoints, !(it.wpflags & (WAYPOINTFLAG_TELEPORT | WAYPOINTFLAG_JUMP)),
{
- if(vdist(it.origin - this.origin, <, 50))
+ if(vdist(it.origin - this.origin, <, min_dist))
{
wp = it;
break;
/*
// item it is linked from waypoint it.wpXX (INCOMING link)
// links are sorted by their cost (wpXXmincost)
+// one of these links is added in game every time a bot heads to an item
+// even links that are not walkable are added (marked with a high cost)
+// so that bots next time know if they can walk it or not saving a tracewalk call
.entity wp00, wp01, wp02, wp03, wp04, wp05, wp06, wp07, wp08, wp09, wp10, wp11, wp12, wp13, wp14, wp15;
.entity wp16, wp17, wp18, wp19, wp20, wp21, wp22, wp23, wp24, wp25, wp26, wp27, wp28, wp29, wp30, wp31;
.float wp24mincost, wp25mincost, wp26mincost, wp27mincost, wp28mincost, wp29mincost, wp30mincost, wp31mincost;
*/
-#define navigation_item_islinked(from_wp, to_item) waypoint_islinked(to_item, from_wp)
-#define navigation_item_addlink(from_wp, to_item) \
- waypoint_addlink_customcost(to_item, from_wp, waypoint_getlinkcost(from_wp, to_item))
+#define navigation_item_initlinks_ifneeded(e) MACRO_BEGIN if (!e.wp00) waypoint_clearlinks(e); MACRO_END // initialize wpXXmincost fields
+#define navigation_item_getlinknum(to_item, from_wp) waypoint_getlinknum(to_item, from_wp)
+#define navigation_item_iswalkablelink(to_item, from_wp) (waypoint_get_assigned_link_cost(to_item, from_wp) < 999)
+
+#define navigation_item_add_link(from_wp, to_item, walkable) \
+ waypoint_addlink_customcost(to_item, from_wp, (walkable ? waypoint_getlinkcost(from_wp, to_item) : 999))
#define TELEPORT_USED(pl, tele_wp) \
boxesoverlap(tele_wp.absmin, tele_wp.absmax, pl.lastteleport_origin + STAT(PL_MIN, pl), pl.lastteleport_origin + STAT(PL_MAX, pl))
entity bot_waypoint_queue_bestgoal;
float bot_waypoint_queue_bestgoalrating;
+const float BOT_BUNNYHOP_WP_DETECTION_RANGE = 100;
+
.entity bot_basewaypoint;
.bool navigation_dynamicgoal;
void navigation_dynamicgoal_init(entity this, bool initially_static);
LOG_TRACE("loaded ", ftos(c), " waypoint links from maps/", mapname, ".waypoints.hardwired");
}
+float waypoint_get_assigned_link_cost(entity w, float i)
+{
+ switch(i)
+ {
+ case 0: return w.wp00mincost;
+ case 1: return w.wp01mincost;
+ case 2: return w.wp02mincost;
+ case 3: return w.wp03mincost;
+ case 4: return w.wp04mincost;
+ case 5: return w.wp05mincost;
+ case 6: return w.wp06mincost;
+ case 7: return w.wp07mincost;
+ case 8: return w.wp08mincost;
+ case 9: return w.wp09mincost;
+ case 10: return w.wp10mincost;
+ case 11: return w.wp11mincost;
+ case 12: return w.wp12mincost;
+ case 13: return w.wp13mincost;
+ case 14: return w.wp14mincost;
+ case 15: return w.wp15mincost;
+ case 16: return w.wp16mincost;
+ case 17: return w.wp17mincost;
+ case 18: return w.wp18mincost;
+ case 19: return w.wp19mincost;
+ case 20: return w.wp20mincost;
+ case 21: return w.wp21mincost;
+ case 22: return w.wp22mincost;
+ case 23: return w.wp23mincost;
+ case 24: return w.wp24mincost;
+ case 25: return w.wp25mincost;
+ case 26: return w.wp26mincost;
+ case 27: return w.wp27mincost;
+ case 28: return w.wp28mincost;
+ case 29: return w.wp29mincost;
+ case 30: return w.wp30mincost;
+ case 31: return w.wp31mincost;
+ default: return -1;
+ }
+}
+
entity waypoint_get_link(entity w, float i)
{
switch(i)
void waypoint_clearlinks(entity wp);
void waypoint_schedulerelink(entity wp);
+float waypoint_get_assigned_link_cost(entity w, float i);
+
float waypoint_getlinkcost(entity from, entity to);
float waypoint_gettravelcost(vector from, vector to, entity from_ent, entity to_ent);
float waypoint_getlinearcost(float dist);
return 0;
}
+int Campaign_GetLevelNum()
+{
+ return campaign_level + 1;
+}
+
+string Campaign_GetMessage()
+{
+ return strcat(campaign_shortdesc[0], "\n^3\n", campaign_longdesc[0]);
+}
+
void CampaignPreInit()
{
float baseskill;
- string title;
campaign_level = autocvar__campaign_index;
campaign_name = strzone(autocvar__campaign_name);
campaign_index_var = strzone(strcat("g_campaign", campaign_name, "_index"));
if(Campaign_Invalid())
return;
-
- title = campaign_shortdesc[0];
- title = strzone(strcat("Level ", ftos(campaign_level + 1), ": ", title));
- campaign_message = strzone(strcat(title, "\n^3\n", campaign_longdesc[0], "\n\n^1press jump to enter the game"));
- strunzone(title);
}
void CampaignPostInit()
CampaignSetup(campaign_won);
CampaignFile_Unload();
- strunzone(campaign_message);
strunzone(campaign_index_var);
strunzone(campaign_name);
campaign_name = "";
// this must be included BEFORE campaign_common.h to make this a memory saving
#define CAMPAIGN_MAX_ENTRIES 2
-string campaign_message;
+int Campaign_GetLevelNum();
+string Campaign_GetMessage();
void CampaignPreInit();
void CampaignPostInit();
this.strength_finished = 0;
this.invincible_finished = 0;
this.superweapons_finished = 0;
+ this.air_finished = 0;
//this.dphitcontentsmask = 0;
this.dphitcontentsmask = DPCONTENTS_SOLID;
if (autocvar_g_playerclip_collisions)
STAT(BUFFS, this) = 0;
STAT(BUFF_TIME, this) = 0;
- this.air_finished = time + 12;
+ this.air_finished = 0;
this.waterlevel = WATERLEVEL_NONE;
this.watertype = CONTENT_EMPTY;
return max(stable, current + (stable - current) * rotfactor * rotframetime);
}
-float CalcRotRegen(float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit)
+void RotRegen(entity this, int res, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit_mod)
{
+ float old = GetResource(this, res);
+ float current = old;
if(current > rotstable)
{
if(rotframetime > 0)
}
}
+ float limit = GetResourceLimit(this, res) * limit_mod;
if(current > limit)
current = limit;
- return current;
+ if (current != old)
+ SetResource(this, res, current);
}
void player_regen(entity this)
if(!mutator_returnvalue)
if(!STAT(FROZEN, this))
{
- float mina, maxa, limith, limita;
- maxa = autocvar_g_balance_armor_rotstable;
- mina = autocvar_g_balance_armor_regenstable;
- limith = GetResourceLimit(this, RES_HEALTH);
- limita = GetResourceLimit(this, RES_ARMOR);
+ float maxa = autocvar_g_balance_armor_rotstable;
+ float mina = autocvar_g_balance_armor_regenstable;
- regen_health_rotstable = regen_health_rotstable * max_mod;
- regen_health_stable = regen_health_stable * max_mod;
- limith = limith * limit_mod;
- limita = limita * limit_mod;
+ RotRegen(this, RES_ARMOR, mina, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear,
+ regen_mod * frametime * (time > this.pauseregen_finished), maxa, autocvar_g_balance_armor_rot, autocvar_g_balance_armor_rotlinear,
+ rot_mod * frametime * (time > this.pauserotarmor_finished), limit_mod);
- SetResource(this, RES_ARMOR, CalcRotRegen(GetResource(this, RES_ARMOR), mina, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear,
- regen_mod * frametime * (time > this.pauseregen_finished), maxa, autocvar_g_balance_armor_rot, autocvar_g_balance_armor_rotlinear,
- rot_mod * frametime * (time > this.pauserotarmor_finished), limita));
- SetResource(this, RES_HEALTH, CalcRotRegen(GetResource(this, RES_HEALTH), regen_health_stable, regen_health, regen_health_linear,
- regen_mod * frametime * (time > this.pauseregen_finished), regen_health_rotstable, regen_health_rot, regen_health_rotlinear,
- rot_mod * frametime * (time > this.pauserothealth_finished), limith));
+ RotRegen(this, RES_HEALTH, regen_health_stable * max_mod, regen_health, regen_health_linear,
+ regen_mod * frametime * (time > this.pauseregen_finished), regen_health_rotstable * max_mod, regen_health_rot, regen_health_rotlinear,
+ rot_mod * frametime * (time > this.pauserothealth_finished), limit_mod);
}
// if player rotted to death... die!
if (!(this.items & IT_UNLIMITED_AMMO))
{
- float minf, maxf, limitf;
+ float maxf = autocvar_g_balance_fuel_rotstable;
+ float minf = autocvar_g_balance_fuel_regenstable;
- maxf = autocvar_g_balance_fuel_rotstable;
- minf = autocvar_g_balance_fuel_regenstable;
- limitf = GetResourceLimit(this, RES_FUEL);
-
- SetResource(this, RES_FUEL, CalcRotRegen(GetResource(this, RES_FUEL), minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear,
- frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0),
- maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), limitf));
+ RotRegen(this, RES_FUEL, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear,
+ frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0),
+ maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), 1);
}
}
this.strength_finished = spectatee.strength_finished;
this.invincible_finished = spectatee.invincible_finished;
this.superweapons_finished = spectatee.superweapons_finished;
+ this.air_finished = spectatee.air_finished;
STAT(PRESSED_KEYS, this) = STAT(PRESSED_KEYS, spectatee);
STAT(WEAPONS, this) = STAT(WEAPONS, spectatee);
this.punchangle = spectatee.punchangle;
if (autocvar_g_campaign) {
if ((IS_PLAYER(this) && PHYS_INPUT_BUTTON_INFO(this)) || (!IS_PLAYER(this))) {
CS(this).motd_actived_time = time;
- Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, campaign_message);
+ Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_CAMPAIGN_MESSAGE, Campaign_GetMessage(), Campaign_GetLevelNum());
}
} else {
if (PHYS_INPUT_BUTTON_INFO(this)) {
CS(this).motd_actived_time = time;
else if ((time - CS(this).motd_actived_time > 2) && IS_PLAYER(this)) { // hide it some seconds after BUTTON_INFO has been released
CS(this).motd_actived_time = 0;
- Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
+ Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_CAMPAIGN_MESSAGE);
}
} else {
if (PHYS_INPUT_BUTTON_INFO(this))
{
// instantly hide MOTD
CS(this).motd_actived_time = 0;
- Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
+ if (autocvar_g_campaign)
+ Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_CAMPAIGN_MESSAGE);
+ else
+ Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
}
else if (IS_PLAYER(this) || IS_SPEC(this))
{
if(this.flags & FL_SPAWNING)
{
this.flags &= ~FL_SPAWNING;
- Join(this);
+ if(joinAllowed(this))
+ Join(this);
return;
}
}
if (this.waterlevel != WATERLEVEL_SUBMERGED || this.vehicle)
{
- if(this.air_finished < time)
+ if(this.air_finished && this.air_finished < time)
PlayerSound(this, playersound_gasp, CH_PLAYER, VOL_BASE, VOICETYPE_PLAYERSOUND);
- this.air_finished = time + autocvar_g_balance_contents_drowndelay;
+ this.air_finished = 0;
}
- else if (this.air_finished < time)
- { // drown!
- if (this.pain_finished < time)
- {
- Damage (this, NULL, NULL, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN.m_id, DMG_NOWEP, this.origin, '0 0 0');
- this.pain_finished = time + 0.5;
+ else
+ {
+ if (!this.air_finished)
+ this.air_finished = time + autocvar_g_balance_contents_drowndelay;
+ if (this.air_finished < time)
+ { // drown!
+ if (this.pain_finished < time)
+ {
+ Damage (this, NULL, NULL, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN.m_id, DMG_NOWEP, this.origin, '0 0 0');
+ this.pain_finished = time + 0.5;
+ }
}
}
}
ATTRIB(Client, autoswitch, bool, this.autoswitch);
ATTRIB(Client, cvar_cl_casings, bool, this.cvar_cl_casings);
ATTRIB(Client, cvar_cl_dodging_timeout, float, this.cvar_cl_dodging_timeout);
+ ATTRIB(Client, cvar_cl_dodging, float, this.cvar_cl_dodging);
ATTRIB(Client, cvar_cl_multijump, bool, this.cvar_cl_multijump);
ATTRIB(Client, cvar_cl_accuracy_data_share, bool, this.cvar_cl_accuracy_data_share);
ATTRIB(Client, cvar_cl_accuracy_data_receive, bool, this.cvar_cl_accuracy_data_receive);
void play_countdown(entity this, float finished, Sound samp);
-float CalcRotRegen(float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit);
+void RotRegen(entity this, float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit_mod);
bool Spectate(entity this, entity pl);
if (teamplay)
{
// set up
- float team_id;
int save = Player_GetForcedTeamIndex(client);
Player_SetForcedTeamIndex(client, TEAM_FORCE_DEFAULT);
// find the team to move the player to
- team_id = Team_ColorToTeam(destination);
+ int team_num = Team_ColorToTeam(destination);
entity balance;
- if (team_id == client.team) // already on the destination team
+ if (team_num == client.team) // already on the destination team
{
// keep the forcing undone
LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7."));
continue;
}
- else if (team_id == 0) // auto team
+ else if (team_num == 0) // auto team
{
balance = TeamBalance_CheckAllowedTeams(client);
- team_id = Team_IndexToTeam(TeamBalance_FindBestTeam(balance, client, false));
+ team_num = Team_IndexToTeam(TeamBalance_FindBestTeam(balance, client, false));
}
else
{
Player_SetForcedTeamIndex(client, save);
// Check to see if the destination team is even available
- switch (team_id)
+ int team_id = Team_TeamToIndex(team_num);
+ if (team_id == -1)
{
- case NUM_TEAM_1:
- {
- if (!TeamBalance_IsTeamAllowed(balance, 1))
- {
- LOG_INFO("Sorry, can't move player to red team if it doesn't exist.");
- TeamBalance_Destroy(balance);
- return;
- }
- TeamBalance_Destroy(balance);
- break;
- }
- case NUM_TEAM_2:
- {
- if (!TeamBalance_IsTeamAllowed(balance, 2))
- {
- LOG_INFO("Sorry, can't move player to blue team if it doesn't exist.");
- TeamBalance_Destroy(balance);
- return;
- }
- TeamBalance_Destroy(balance);
- break;
- }
- case NUM_TEAM_3:
- {
- if (!TeamBalance_IsTeamAllowed(balance, 3))
- {
- LOG_INFO("Sorry, can't move player to yellow team if it doesn't exist.");
- TeamBalance_Destroy(balance);
- return;
- }
- TeamBalance_Destroy(balance);
- break;
- }
- case NUM_TEAM_4:
- {
- if (!TeamBalance_IsTeamAllowed(balance, 4))
- {
- LOG_INFO("Sorry, can't move player to pink team if it doesn't exist.");
- TeamBalance_Destroy(balance);
- return;
- }
- TeamBalance_Destroy(balance);
- break;
- }
- default:
- {
- LOG_INFO("Sorry, can't move player here if team ", destination, " doesn't exist.");
- return;
- }
+ LOG_INFO("Sorry, can't move player here if team ", destination, " doesn't exist.");
+ TeamBalance_Destroy(balance);
+ return;
+ }
+ if (!TeamBalance_IsTeamAllowed(balance, team_id))
+ {
+ LOG_INFOF("Sorry, can't move player to %s team if it doesn't exist.", destination);
+ TeamBalance_Destroy(balance);
+ return;
}
+ TeamBalance_Destroy(balance);
// If so, lets continue and finally move the player
Player_SetForcedTeamIndex(client, TEAM_FORCE_DEFAULT);
- if (MoveToTeam(client, Team_TeamToIndex(team_id), 6))
+ if (MoveToTeam(client, team_id, 6))
{
successful = strcat(successful, (successful ? ", " : ""), playername(client, false));
LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") has been moved to the ", Team_ColoredFullName(team_id), "^7.");
LOG_INFO(" 'clients' is a list (separated by commas) of player entity ID's or nicknames");
LOG_INFO(" 'destination' is what to send the player to, be it team or spectating");
LOG_INFO(" Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"");
- LOG_INFO("Examples: sv_cmd moveplayer 1,3,5 red 3");
- LOG_INFO(" sv_cmd moveplayer 2 spec ");
+ LOG_INFO("Examples: sv_cmd moveplayer 1,3,5 red");
+ LOG_INFO(" sv_cmd moveplayer 2 spec");
LOG_INFO("See also: ^2allspec, shuffleteams^7");
return;
}
return true;
}
+// NOTE: requires input to be surrounded by spaces
+string VoteCommand_checkreplacements(string input)
+{
+ string output = input;
+ // allow gotomap replacements
+ output = strreplace(" map ", " gotomap ", output);
+ output = strreplace(" chmap ", " gotomap ", output);
+ return output;
+}
+
float VoteCommand_checkinlist(string vote_command, string list)
{
- string l = strcat(" ", list, " ");
+ string l = VoteCommand_checkreplacements(strcat(" ", list, " "));
- if (strstrofs(l, strcat(" ", vote_command, " "), 0) >= 0) return true;
+ if (strstrofs(l, VoteCommand_checkreplacements(strcat(" ", vote_command, " ")), 0) >= 0) return true;
return false;
}
.float crouch; // Crouching or not?
const .float superweapons_finished = _STAT(SUPERWEAPONS_FINISHED);
+const .float air_finished = _STAT(AIR_FINISHED);
.float cnt; // used in too many places
.float count;
.float railgunhitsolidbackup;
.vector railgunhitloc;
-.float air_finished;
.float dmgtime;
.float killcount;
.float spectatortime; //point in time since the client is spectating or observing
void checkSpectatorBlock(entity this);
-float game_completion_ratio; // 0 at start, 1 near end
.float winning;
.float jointime; // time of connecting
.float startplaytime; // time of switching from spectator to player
// :%s,//\([^ ]*\).*,BADCVAR("\1");,
// :%!sort
// yes, this does contain some redundant stuff, don't really care
+ BADPREFIX("bot_ai_");
BADCVAR("bot_config_file");
BADCVAR("bot_number");
BADCVAR("bot_prefix");
break;
}
}
-
+
if (i == Map_Count)
{
bprint( "Maplist contains no usable maps! Resetting it to default map list.\n" );
cvar_set("g_maplist", shufflewords(autocvar_g_maplist));
}
-float leaderfrags;
+int fragsleft_last;
float WinningCondition_Scores(float limit, float leadlimit)
{
- float limitreached;
-
// TODO make everything use THIS winning condition (except LMS)
WinningConditionHelper(NULL);
leadlimit = 0; // not supported in this mode
if(MUTATOR_CALLHOOK(Scores_CountFragsRemaining))
- // these modes always score in increments of 1, thus this makes sense
{
- if(leaderfrags != WinningConditionHelper_topscore)
- {
- leaderfrags = WinningConditionHelper_topscore;
+ float fragsleft = FLOAT_MAX, leadingfragsleft = FLOAT_MAX;
+ if (limit)
+ fragsleft = limit - WinningConditionHelper_topscore;
+ if (leadlimit)
+ leadingfragsleft = WinningConditionHelper_secondscore + leadlimit - WinningConditionHelper_topscore;
- if (limit)
- {
- if (leaderfrags == limit - 1)
- Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_1);
- else if (leaderfrags == limit - 2)
- Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_2);
- else if (leaderfrags == limit - 3)
- Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_3);
- }
+ if (limit && leadlimit && autocvar_leadlimit_and_fraglimit)
+ fragsleft = max(fragsleft, leadingfragsleft);
+ else
+ fragsleft = min(fragsleft, leadingfragsleft);
+
+ if (fragsleft_last != fragsleft) // do not announce same remaining frags multiple times
+ {
+ if (fragsleft == 1)
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_1);
+ else if (fragsleft == 2)
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_2);
+ else if (fragsleft == 3)
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_3);
+
+ fragsleft_last = fragsleft;
}
}
- limitreached = false;
- if (limit && WinningConditionHelper_topscore >= limit)
- limitreached = true;
- if(leadlimit)
- {
- float leadlimitreached;
- leadlimitreached = (WinningConditionHelper_topscore - WinningConditionHelper_secondscore >= leadlimit);
- if(autocvar_leadlimit_and_fraglimit)
- limitreached = (limitreached && leadlimitreached);
- else
- limitreached = (limitreached || leadlimitreached);
- }
+ bool fraglimit_reached = (limit && WinningConditionHelper_topscore >= limit);
+ bool leadlimit_reached = (leadlimit && WinningConditionHelper_topscore - WinningConditionHelper_secondscore >= leadlimit);
- if(limit)
- game_completion_ratio = max(game_completion_ratio, bound(0, WinningConditionHelper_topscore / limit, 1));
+ bool limit_reached;
+ // only respect leadlimit_and_fraglimit when both limits are set or the game will never end
+ if (limit && leadlimit && autocvar_leadlimit_and_fraglimit)
+ limit_reached = (fraglimit_reached && leadlimit_reached);
+ else
+ limit_reached = (fraglimit_reached || leadlimit_reached);
return GetWinningCode(
- WinningConditionHelper_topscore && limitreached,
+ WinningConditionHelper_topscore && limit_reached,
WinningConditionHelper_equality
);
}
*/
void CheckRules_World()
{
- float timelimit;
- float fraglimit;
- float leadlimit;
-
VoteThink();
MapVote_Think();
return;
}
- timelimit = autocvar_timelimit * 60;
- fraglimit = autocvar_fraglimit;
- leadlimit = autocvar_leadlimit;
+ float timelimit = autocvar_timelimit * 60;
+ float fraglimit = autocvar_fraglimit;
+ float leadlimit = autocvar_leadlimit;
+ if (leadlimit < 0) leadlimit = 0;
if(warmup_stage || time <= game_starttime) // NOTE: this is <= to prevent problems in the very tic where the game starts
{
float wantovertime;
wantovertime = 0;
- if(timelimit > game_starttime)
- game_completion_ratio = (time - game_starttime) / (timelimit - game_starttime);
- else
- game_completion_ratio = 0;
-
if(checkrules_suddendeathend)
{
if(!checkrules_suddendeathwarning)
{
if (Ban_IsClientBanned(client, -1))
{
- string s = sprintf("^1NOTE:^7 banned client %s just tried to enter\n", client.netaddress);
+ if (!client.crypto_idfp)
+ LOG_INFOF("^1NOTE:^7 banned client %s just tried to enter\n",
+ client.netaddress);
+ else
+ LOG_INFOF("^1NOTE:^7 banned client %s (%s) just tried to enter\n",
+ client.netaddress, client.crypto_idfp);
+
if(autocvar_g_ban_telluser)
sprint(client, "You are banned from this server.\n");
dropclient(client);
- bprint(s);
return true;
}
return false;
reason = strcat(reason, ", ");
reason = strcat(reason, it.netname);
}
- s = strcat(s, "^1NOTE:^7 banned client ", it.netaddress, "^7 has to go\n");
+ s = strcat(s, "^1NOTE:^7 banned client ", it.netname, "^7 has to go\n");
dropclient(it);
}
});
void precache_playermodel(string m)
{
- float globhandle, i, n;
+ int globhandle, i, n;
string f;
+ // remove :<skinnumber> suffix
+ int j = strstrofs(m, ":", 0);
+ if(j >= 0)
+ m = substring(m, 0, j);
+
if(substring(m, -9, 5) == "_lod1")
return;
if(substring(m, -9, 5) == "_lod2")
float Cosine_Interpolate(float a, float b, float c)
{
- float ft = c * 3.1415927;
+ float ft = c * M_PI;
float f = (1 - cos(ft)) * 0.5;
return a*(1-f) + b*f;
}
CreatureFrame_hotliquids(this);
+ if (!this.air_finished)
+ this.air_finished = time + autocvar_g_balance_contents_drowndelay;
}
else
{
this.flags &= ~FL_INWATER;
this.dmgtime = 0;
}
- this.air_finished = time + 12;
+ this.air_finished = 0;
}
}
bool restartanim;
if (fr == WFRAME_DONTCHANGE)
{
+ // this can happen when the weapon entity is newly spawned, since it has a clear state and no previous weapon frame
+ if (this.wframe == WFRAME_DONTCHANGE)
+ this.wframe = WFRAME_IDLE;
fr = this.wframe;
restartanim = false;
}
--- /dev/null
+// https://forums.xonotic.org/showthread.php?tid=8190
+// https://gitlab.com/xonotic/xonotic-data.pk3dir/merge_requests/738
+alias test_blaster_switch "settemp g_balance_blaster_primary_animtime 0.1 ; settemp g_balance_blaster_switchdelay_drop 0.1 ; settemp g_balance_blaster_switchdelay_raise 0.1"
+
+alias test_crylink_sec_horizontal "settemp g_balance_crylink_secondary_linkexplode 0 ; settemp g_balance_crylink_secondary_other_fadetime 2 ; settemp g_balance_crylink_secondary_other_lifetime 2 ; settemp g_balance_crylink_secondary_speed 4000 ; settemp g_balance_crylink_secondary_spread 0.08 ; settemp g_balance_crylink_secondary_spreadtype 0"
+
+alias test_rocket_flying "settemp g_balance_devastator_remote_jump 1"
+
+// https://forums.xonotic.org/showthread.php?tid=8192
+// https://gitlab.com/xonotic/xonotic-data.pk3dir/merge_requests/736
+alias test_ctf_stalemate90 "settemp g_ctf_stalemate_time 90"
+alias test_ctf_stalemate120 "settemp g_ctf_stalemate_time 120"
+
+alias testing_enable "addvote test_blaster_switch ; addvote test_crylink_sec_horizontal ; addvote test_rocket_flying ; addvote test_ctf_stalemate90 ; addvote test_ctf_stalemate120"
+alias testing_disable "delvote test_blaster_switch ; delvote test_crylink_sec_horizontal ; delvote test_rocket_flying ; delvote test_ctf_stalemate90 ; delvote test_ctf_stalemate120"
seta cl_eventchase_spectated_change 0 "camera goes into 3rd person mode for a moment when changing spectated player"
seta cl_eventchase_spectated_change_time 1 "how much time the effect lasts when changing spectated player"
-seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead; set to 2 to active the effect only when the corpse doesn't move anymore"
+seta cl_eventchase_death 2 "camera goes into 3rd person mode when the player is dead; set to 2 to active the effect only when the corpse doesn't move anymore"
seta cl_eventchase_frozen 0 "camera goes into 3rd person mode when the player is frozen"
seta cl_eventchase_nexball 1 "camera goes into 3rd person mode when in nexball game-mode"
seta cl_eventchase_distance 140 "final camera distance"
snd_identicalsoundrandomization_time -0.1
snd_identicalsoundrandomization_tics 1
+set debug_deglobalization_logging 0 "bitfield: 1 logs usage of the old functions which use globals implicitly, 2 logs usage of the new wrappers; support for this can be disabled at compile time for better performance"
+set debug_deglobalization_clear 0 "make the new wrappers set globals to NaN after use, this helps find bugs but can result in crashes; support for this can be disabled at compile time for better performance"
+
// load console command aliases and settings
exec commands.cfg
set bot_ai_thinkinterval 0.05 "Frame rate at which bots update their navigation and aiming, scales by skill"
set bot_ai_strategyinterval 7 "How often a new objective is chosen"
set bot_ai_strategyinterval_movingtarget 5.5 "How often a new objective is chosen when current objective can move"
-set bot_ai_enemydetectioninterval 2 "How often bots pick a new target"
+set bot_ai_enemydetectioninterval 2 "How often bots try to pick a new target if no suitable target is found"
+set bot_ai_enemydetectioninterval_stickingtoenemy 4 "How often bots try to pick a new target while targetting an enemy"
set bot_ai_enemydetectionradius 10000 "How far bots can see enemies"
set bot_ai_dodgeupdateinterval 0.2 "How often scan for items to dodge. Currently not in use."
set bot_ai_chooseweaponinterval 0.5 "How often the best weapon according to the situation will be chosen"
set bot_ai_friends_aware_pickup_radius "500" "Bots will not pickup items if a team mate is this distance near the item"
set bot_ai_ignoregoal_timeout 3 "Ignore goals making bots to get stuck in front of a wall for N seconds"
set bot_ai_bunnyhop_skilloffset 7 "Bots with skill equal or greater than this value will perform the \"bunnyhop\" technique"
-set bot_ai_bunnyhop_startdistance 200 "Run to goals located further than this distance"
-set bot_ai_bunnyhop_stopdistance 300 "Stop jumping after reaching this distance to the goal"
-set bot_ai_bunnyhop_firstjumpdelay 0.2 "Start running to the goal only if it was seen for more than N seconds"
+set bot_ai_bunnyhop_dir_deviation_max 20 "bunnyhop if speed - direction deviation is <= this amount"
+set bot_ai_bunnyhop_downward_pitch_max 30 "bunnyhop if downard pitch towards the next waypoint is <= this amount"
+set bot_ai_bunnyhop_turn_angle_max 80 "bunnyhop if next turn angle is <= this amount at walk speed (sv_maxspeed)"
+set bot_ai_bunnyhop_turn_angle_min 4 "bunnyhop regardless of speed if next turn angle is <= this amount"
+set bot_ai_bunnyhop_turn_angle_reduction 40 "linearly reduce max turn angle by this amount when speed increases by sv_maxspeed"
set bot_god 0 "god mode for bots"
set bot_ai_navigation_jetpack 0 "Enable bots to navigate maps using the jetpack"
set bot_ai_navigation_jetpack_mindistance 3500 "Bots will try fly to objects located farther than this distance"
set g_shootfromeye 0 "shots are fired from your eye/crosshair; visual gun position can still be influenced by cl_gunalign 1 and 2"
set g_shootfromcenter 0 "weapon gets moved to the center, shots still come from the barrel of your weapon; visual gun position can still be influenced by cl_gunalign 1 and 2"
set g_shootfromfixedorigin "" "if set to a string like 0 y z, the gun is moved to the given y and z coordinates. If set to a string like x y z, the whole shot origin is used"
-set g_pinata 0 "if set to 1 you will not only drop your current weapon when you are killed, but you will drop all weapons that you possessed"
set g_weapon_stay 0 "1: ghost weapons can be picked up but give no ammo, thrown guns have ammo 2: ghost weapons can be picked up and refill ammo to one pickup size, thrown guns have no ammo (to prevent infinite ammo abuse)"
set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"
set g_mod_config "" "Current config mod name"
// other config files
-exec balance-xonotic.cfg
+exec testing.cfg
+exec balance-xonotic.cfg // depends on testing.cfg
exec physicsX.cfg
exec turrets.cfg
exec vehicles.cfg