seta hud_panel_weapons_complainbubble_color_unavailable "" "color of the complainbubble when showing weapon unavailable message"
seta hud_panel_weapons_ammo_color "" "color of status bar"
seta hud_panel_weapons_ammo_alpha "" "alpha of status bar"
+seta hud_panel_weapons_timeout "" "panel disappears if you don't switch weapon for this amount of seconds"
+seta hud_panel_weapons_timeout_effect "" "disappearance effect: 0) no effect; 1) panel moves out of screen; 2) panel fades out"
seta hud_panel_ammo "" "enable/disable this panel"
seta hud_panel_ammo_pos "" "position of this panel"
set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hlac -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_balance_uzi_spread_min 0.02
set g_balance_uzi_spread_max 0.6
set g_balance_uzi_spread_add 0.012
+
set g_balance_uzi_burst 0 // # of bullets in a burst (if set to 2 or more)
set g_balance_uzi_burst_refire 0.05 // refire between burst bullets
set g_balance_uzi_burst_refire2 0.75 // refire after burst
set g_balance_uzi_burst_damage 18
set g_balance_uzi_burst_force 50
set g_balance_uzi_burst_ammo 3
+
set g_balance_uzi_first 1
set g_balance_uzi_first_damage 30
set g_balance_uzi_first_force 50
set g_balance_uzi_first_spread 0.015
set g_balance_uzi_first_refire 0.2
set g_balance_uzi_first_ammo 1
+
set g_balance_uzi_sustained_damage 15
set g_balance_uzi_sustained_force 27
set g_balance_uzi_sustained_spread 0.05
set g_balance_uzi_sustained_refire 0.1
set g_balance_uzi_sustained_ammo 1
+
set g_balance_uzi_speed 18000
set g_balance_uzi_bulletconstant 115 // 13.1qu
// }}}
set g_balance_grenadelauncher_bouncefactor 0.5
set g_balance_grenadelauncher_bouncestop 0.075
// }}}
-// {{{ minelayer // TODO
+// {{{ minelayer
set g_balance_minelayer_damage 35
set g_balance_minelayer_edgedamage 30
set g_balance_minelayer_force 250
set g_balance_crylink_primary_animtime 0.3
set g_balance_crylink_primary_ammo 2
set g_balance_crylink_primary_bouncedamagefactor 0.5
+set g_balance_crylink_primary_joindelay 0
set g_balance_crylink_primary_joinspread 0
set g_balance_crylink_primary_jointime 0
set g_balance_crylink_primary_joinexplode 0
set g_balance_crylink_secondary_animtime 0.3
set g_balance_crylink_secondary_ammo 2
set g_balance_crylink_secondary_bouncedamagefactor 0.5
+set g_balance_crylink_secondary_joindelay 0
set g_balance_crylink_secondary_joinspread 0
set g_balance_crylink_secondary_jointime 0
set g_balance_crylink_secondary_joinexplode 0
set g_balance_hlac_secondary_ammo 10
set g_balance_hlac_secondary_shots 6
// }}}
-// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 8
-set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_on_switch 0
-set g_balance_campingrifle_bursttime 0
-set g_balance_campingrifle_primary_tracer 0
-set g_balance_campingrifle_primary_damage 60
-set g_balance_campingrifle_primary_headshotaddeddamage 100
-set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 35000
-set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 0.8
-set g_balance_campingrifle_primary_animtime 0.3
-set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
-set g_balance_campingrifle_primary_burstcost 0
-set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
-set g_balance_campingrifle_secondary 1
-set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 35
-set g_balance_campingrifle_secondary_headshotaddeddamage 15 // 50 damage only on head
-set g_balance_campingrifle_secondary_spread 0.008
-set g_balance_campingrifle_secondary_force 1
-set g_balance_campingrifle_secondary_speed 20000
-set g_balance_campingrifle_secondary_lifetime 5
-set g_balance_campingrifle_secondary_refire 0.15
-set g_balance_campingrifle_secondary_animtime 0.1
-set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
-set g_balance_campingrifle_secondary_burstcost 0
-set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
+// {{{ sniperrifle
+set g_balance_sniperrifle_magazinecapacity 8
+set g_balance_sniperrifle_reloadtime 2 // matches reload anim
+set g_balance_sniperrifle_auto_reload_on_switch 0
+set g_balance_sniperrifle_bursttime 0
+set g_balance_sniperrifle_primary_tracer 0
+set g_balance_sniperrifle_primary_damage 60
+set g_balance_sniperrifle_primary_headshotaddeddamage 100
+set g_balance_sniperrifle_primary_spread 0
+set g_balance_sniperrifle_primary_force 2
+set g_balance_sniperrifle_primary_speed 35000
+set g_balance_sniperrifle_primary_lifetime 5
+set g_balance_sniperrifle_primary_refire 0.8
+set g_balance_sniperrifle_primary_animtime 0.3
+set g_balance_sniperrifle_primary_ammo 10
+set g_balance_sniperrifle_primary_bulletconstant 130 // 56.3qu
+set g_balance_sniperrifle_primary_burstcost 0
+set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_tracer 0
+set g_balance_sniperrifle_secondary_damage 35
+set g_balance_sniperrifle_secondary_headshotaddeddamage 15 // 50 damage only on head
+set g_balance_sniperrifle_secondary_spread 0.008
+set g_balance_sniperrifle_secondary_force 1
+set g_balance_sniperrifle_secondary_speed 20000
+set g_balance_sniperrifle_secondary_lifetime 5
+set g_balance_sniperrifle_secondary_refire 0.15
+set g_balance_sniperrifle_secondary_animtime 0.1
+set g_balance_sniperrifle_secondary_ammo 10
+set g_balance_sniperrifle_secondary_bulletconstant 130 // 18.3qu
+set g_balance_sniperrifle_secondary_burstcost 0
+set g_balance_sniperrifle_secondary_bullethail 0 // empty magazine on shot
// }}}
// {{{ tuba
set g_balance_tuba_refire 0.05
set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hlac 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_fireball 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_balance_uzi_spread_min 0.02
set g_balance_uzi_spread_max 0.6
set g_balance_uzi_spread_add 0.012
+
set g_balance_uzi_burst 0 // # of bullets in a burst (if set to 2 or more)
set g_balance_uzi_burst_refire 0.05 // refire between burst bullets
set g_balance_uzi_burst_refire2 0.75 // refire after burst
set g_balance_uzi_burst_damage 18
set g_balance_uzi_burst_force 50
set g_balance_uzi_burst_ammo 3
+
set g_balance_uzi_first 1
set g_balance_uzi_first_damage 26
set g_balance_uzi_first_force -30
set g_balance_uzi_first_spread 0.01
set g_balance_uzi_first_refire 0.2
set g_balance_uzi_first_ammo 1
+
set g_balance_uzi_sustained_damage 17
set g_balance_uzi_sustained_force 27
set g_balance_uzi_sustained_spread 0.05
set g_balance_uzi_sustained_refire 0.1
set g_balance_uzi_sustained_ammo 1
+
set g_balance_uzi_speed 18000
set g_balance_uzi_bulletconstant 300 // 13.1qu
// }}}
-// {{{ mortar // TODO
+// {{{ mortar
set g_balance_grenadelauncher_primary_type 0
set g_balance_grenadelauncher_primary_damage 65
set g_balance_grenadelauncher_primary_edgedamage 35
set g_balance_grenadelauncher_bouncefactor 0.7
set g_balance_grenadelauncher_bouncestop 0.12
// }}}
-// {{{ minelayer // TODO
+// {{{ minelayer
set g_balance_minelayer_damage 65
set g_balance_minelayer_edgedamage 30
set g_balance_minelayer_force 250
set g_balance_minelayer_remote_radius 200
set g_balance_minelayer_remote_force 300
// }}}
-// {{{ electro // TODO
+// {{{ electro
set g_balance_electro_lightning 0
set g_balance_electro_primary_damage 55
set g_balance_electro_primary_edgedamage 5
set g_balance_crylink_primary_edgedamage 0
set g_balance_crylink_primary_force -55
set g_balance_crylink_primary_radius 80
-set g_balance_crylink_primary_speed 6950
+set g_balance_crylink_primary_speed 6820
set g_balance_crylink_primary_spread 0.03
set g_balance_crylink_primary_shots 4
set g_balance_crylink_primary_bounces 2
set g_balance_crylink_primary_animtime 0.30008
set g_balance_crylink_primary_ammo 3
set g_balance_crylink_primary_bouncedamagefactor 0.2
+set g_balance_crylink_primary_joindelay 0
set g_balance_crylink_primary_joinspread 0
set g_balance_crylink_primary_jointime 0
set g_balance_crylink_primary_joinexplode 0
set g_balance_crylink_secondary_animtime 0.3
set g_balance_crylink_secondary_ammo 3
set g_balance_crylink_secondary_bouncedamagefactor 0.5
+set g_balance_crylink_secondary_joindelay 0
set g_balance_crylink_secondary_joinspread 0
set g_balance_crylink_secondary_jointime 0
set g_balance_crylink_secondary_joinexplode 0
set g_balance_crylink_secondary_line_fadetime 2
// }}}
// {{{ nex
-set g_balance_nex_primary_damage 78
+set g_balance_nex_primary_damage 72
set g_balance_nex_primary_force 600
set g_balance_nex_primary_refire 1.505
set g_balance_nex_primary_animtime 0.3
-set g_balance_nex_primary_ammo 13
+set g_balance_nex_primary_ammo 5
set g_balance_nex_primary_damagefalloff_mindist 9999999
set g_balance_nex_primary_damagefalloff_maxdist 9999999
set g_balance_nex_primary_damagefalloff_halflife 9999999
set g_balance_nex_primary_damagefalloff_forcehalflife 9999999
-set g_balance_nex_secondary 0
-set g_balance_nex_secondary_charge 0
-set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary 1
+set g_balance_nex_secondary_charge 1
+set g_balance_nex_secondary_charge_rate 0.25
set g_balance_nex_secondary_chargepool 0
set g_balance_nex_secondary_chargepool_regen 0.15
set g_balance_nex_secondary_chargepool_pause_regen 1
set g_balance_nex_secondary_force -500
set g_balance_nex_secondary_refire 1.25
set g_balance_nex_secondary_animtime 0.75
-set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_ammo 2
set g_balance_nex_secondary_damagefalloff_mindist 9999999
set g_balance_nex_secondary_damagefalloff_maxdist 9999999
set g_balance_nex_secondary_damagefalloff_halflife 9999999
set g_balance_nex_secondary_damagefalloff_forcehalflife 9999999
-set g_balance_nex_charge 0
+set g_balance_nex_charge 1
set g_balance_nex_charge_mindmg 40
set g_balance_nex_charge_start 0
set g_balance_nex_charge_rate 0.1
set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_rot_rate 0
set g_balance_nex_charge_rot_pause 0 // Dont rot down untill this long after release of charge button
-set g_balance_nex_charge_shot_multiplier 0.5
+set g_balance_nex_charge_shot_multiplier 0
set g_balance_nex_charge_velocity_rate 0.2
-set g_balance_nex_charge_minspeed 400
-set g_balance_nex_charge_maxspeed 1000
+set g_balance_nex_charge_minspeed ""
+set g_balance_nex_charge_maxspeed ""
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1
set g_balance_hagar_secondary_refire 0.15
set g_balance_hagar_secondary_ammo 2
// }}}
-// {{{ rocketlauncher // TODO
+// {{{ rocketlauncher
set g_balance_rocketlauncher_damage 65
set g_balance_rocketlauncher_edgedamage 25
set g_balance_rocketlauncher_force 360
set g_balance_hlac_secondary_ammo 11
set g_balance_hlac_secondary_shots 6
// }}}
-// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 8
-set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_on_switch 0
-set g_balance_campingrifle_bursttime 0.85 // 0.35 - 0.1 + 0.35 - 0.1 + 0.35 = three secondaries
-set g_balance_campingrifle_primary_tracer 0
-set g_balance_campingrifle_primary_damage 75
-set g_balance_campingrifle_primary_headshotaddeddamage 90
-set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 35000
-set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 0.7
-set g_balance_campingrifle_primary_animtime 0.3
-set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
-set g_balance_campingrifle_primary_burstcost 0 // require same cooldown as secondary, note it's smaller than primary refire time
-set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
-set g_balance_campingrifle_secondary 1
-set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 40
-set g_balance_campingrifle_secondary_headshotaddeddamage 20
-set g_balance_campingrifle_secondary_spread 0.008
-set g_balance_campingrifle_secondary_force 1
-set g_balance_campingrifle_secondary_speed 20000
-set g_balance_campingrifle_secondary_lifetime 5
-set g_balance_campingrifle_secondary_refire 0.0006
-set g_balance_campingrifle_secondary_animtime 0.1
-set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
-set g_balance_campingrifle_secondary_burstcost 0
-set g_balance_campingrifle_secondary_bullethail 0
+// {{{ sniperrifle
+set g_balance_sniperrifle_magazinecapacity 8
+set g_balance_sniperrifle_reloadtime 2 // matches reload anim
+set g_balance_sniperrifle_auto_reload_on_switch 0
+set g_balance_sniperrifle_bursttime 0.85 // 0.35 - 0.1 + 0.35 - 0.1 + 0.35 = three secondaries
+set g_balance_sniperrifle_primary_tracer 0
+set g_balance_sniperrifle_primary_damage 75
+set g_balance_sniperrifle_primary_headshotaddeddamage 90
+set g_balance_sniperrifle_primary_spread 0
+set g_balance_sniperrifle_primary_force 2
+set g_balance_sniperrifle_primary_speed 35000
+set g_balance_sniperrifle_primary_lifetime 5
+set g_balance_sniperrifle_primary_refire 0.7
+set g_balance_sniperrifle_primary_animtime 0.3
+set g_balance_sniperrifle_primary_ammo 10
+set g_balance_sniperrifle_primary_bulletconstant 130 // 56.3qu
+set g_balance_sniperrifle_primary_burstcost 0 // require same cooldown as secondary, note it's smaller than primary refire time
+set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_tracer 0
+set g_balance_sniperrifle_secondary_damage 40
+set g_balance_sniperrifle_secondary_headshotaddeddamage 20
+set g_balance_sniperrifle_secondary_spread 0.008
+set g_balance_sniperrifle_secondary_force 1
+set g_balance_sniperrifle_secondary_speed 20000
+set g_balance_sniperrifle_secondary_lifetime 5
+set g_balance_sniperrifle_secondary_refire 0.0006
+set g_balance_sniperrifle_secondary_animtime 0.1
+set g_balance_sniperrifle_secondary_ammo 10
+set g_balance_sniperrifle_secondary_bulletconstant 130 // 18.3qu
+set g_balance_sniperrifle_secondary_burstcost 0
+set g_balance_sniperrifle_secondary_bullethail 0
// }}}
// {{{ tuba
set g_balance_tuba_refire 0.05
set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hlac -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_balance_uzi_spread_min 0.02
set g_balance_uzi_spread_max 0.6
set g_balance_uzi_spread_add 0.012
+
set g_balance_uzi_burst 0 // # of bullets in a burst (if set to 2 or more)
set g_balance_uzi_burst_refire 0.05 // refire between burst bullets
set g_balance_uzi_burst_refire2 0.75 // refire after burst
set g_balance_uzi_burst_damage 18
set g_balance_uzi_burst_force 50
set g_balance_uzi_burst_ammo 3
+
set g_balance_uzi_first 1
set g_balance_uzi_first_damage 18
set g_balance_uzi_first_force 20
set g_balance_uzi_first_spread 0.03
set g_balance_uzi_first_refire 0.2
set g_balance_uzi_first_ammo 1
+
set g_balance_uzi_sustained_damage 10
set g_balance_uzi_sustained_force 10
set g_balance_uzi_sustained_spread 0.08
set g_balance_uzi_sustained_refire 0.1
set g_balance_uzi_sustained_ammo 1
+
set g_balance_uzi_speed 18000
set g_balance_uzi_bulletconstant 115 // 13.1qu
// }}}
set g_balance_grenadelauncher_bouncefactor 0.5
set g_balance_grenadelauncher_bouncestop 0.075
// }}}
-// {{{ minelayer // TODO
+// {{{ minelayer
set g_balance_minelayer_damage 35
set g_balance_minelayer_edgedamage 30
set g_balance_minelayer_force 250
set g_balance_minelayer_remote_radius 200
set g_balance_minelayer_remote_force 300
// }}}
-// {{{ electro // TODO
+// {{{ electro
set g_balance_electro_lightning 1
set g_balance_electro_primary_damage 90
set g_balance_electro_primary_edgedamage 0
set g_balance_electro_combo_comboradius 0
set g_balance_electro_combo_speed 400
// }}}
-// {{{ crylink
+// {{{ crylink
set g_balance_crylink_primary_damage 10
set g_balance_crylink_primary_edgedamage 0
set g_balance_crylink_primary_force -55
set g_balance_crylink_primary_animtime 0.3
set g_balance_crylink_primary_ammo 2
set g_balance_crylink_primary_bouncedamagefactor 0.5
+set g_balance_crylink_primary_joindelay 0
set g_balance_crylink_primary_joinspread 0
set g_balance_crylink_primary_jointime 0
set g_balance_crylink_primary_joinexplode 0
set g_balance_crylink_secondary_animtime 0.2
set g_balance_crylink_secondary_ammo 2
set g_balance_crylink_secondary_bouncedamagefactor 0.5
+set g_balance_crylink_secondary_joindelay 0
set g_balance_crylink_secondary_joinspread 0
set g_balance_crylink_secondary_jointime 0
set g_balance_crylink_secondary_joinexplode 0
set g_balance_hlac_secondary_ammo 10
set g_balance_hlac_secondary_shots 6
// }}}
-// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
-set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_on_switch 0
-set g_balance_campingrifle_bursttime 0
-set g_balance_campingrifle_primary_tracer 1
-set g_balance_campingrifle_primary_damage 65
-set g_balance_campingrifle_primary_headshotaddeddamage 75
-set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 40000
-set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 0.75
-set g_balance_campingrifle_primary_animtime 0.3
-set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 110 // 62.2qu
-set g_balance_campingrifle_primary_burstcost 0
-set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
-set g_balance_campingrifle_secondary 1
-set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 50
-set g_balance_campingrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
-set g_balance_campingrifle_secondary_spread 0
-set g_balance_campingrifle_secondary_force 2
-set g_balance_campingrifle_secondary_speed 20000
-set g_balance_campingrifle_secondary_lifetime 5
-set g_balance_campingrifle_secondary_refire 0.1
-set g_balance_campingrifle_secondary_animtime 0.1
-set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 110 // 15.5qu
-set g_balance_campingrifle_secondary_burstcost 0
-set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
+// {{{ sniperrifle
+set g_balance_sniperrifle_magazinecapacity 8 // make it pretty much useless in close combat
+set g_balance_sniperrifle_reloadtime 2 // matches reload anim
+set g_balance_sniperrifle_auto_reload_on_switch 0
+set g_balance_sniperrifle_bursttime 0
+set g_balance_sniperrifle_primary_tracer 1
+set g_balance_sniperrifle_primary_damage 65
+set g_balance_sniperrifle_primary_headshotaddeddamage 75
+set g_balance_sniperrifle_primary_spread 0
+set g_balance_sniperrifle_primary_force 2
+set g_balance_sniperrifle_primary_speed 40000
+set g_balance_sniperrifle_primary_lifetime 5
+set g_balance_sniperrifle_primary_refire 0.75
+set g_balance_sniperrifle_primary_animtime 0.3
+set g_balance_sniperrifle_primary_ammo 10
+set g_balance_sniperrifle_primary_bulletconstant 110 // 62.2qu
+set g_balance_sniperrifle_primary_burstcost 0
+set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_tracer 0
+set g_balance_sniperrifle_secondary_damage 50
+set g_balance_sniperrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
+set g_balance_sniperrifle_secondary_spread 0
+set g_balance_sniperrifle_secondary_force 2
+set g_balance_sniperrifle_secondary_speed 20000
+set g_balance_sniperrifle_secondary_lifetime 5
+set g_balance_sniperrifle_secondary_refire 0.1
+set g_balance_sniperrifle_secondary_animtime 0.1
+set g_balance_sniperrifle_secondary_ammo 10
+set g_balance_sniperrifle_secondary_bulletconstant 110 // 15.5qu
+set g_balance_sniperrifle_secondary_burstcost 0
+set g_balance_sniperrifle_secondary_bullethail 0 // empty magazine on shot
// }}}
// {{{ tuba
set g_balance_tuba_refire 0.05
set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hlac -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
// {{{ misc
set g_balance_selfdamagepercent 0.65
-set g_balance_weaponswitchdelay 0.1
+set g_balance_weaponswitchdelay 0.15
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_balance_laser_primary_speed 5000
set g_balance_laser_primary_spread 0
set g_balance_laser_primary_refire 0.6
-set g_balance_laser_primary_animtime 0.6
+set g_balance_laser_primary_animtime 0.4
set g_balance_laser_primary_lifetime 5
set g_balance_laser_primary_shotangle 0
set g_balance_laser_primary_delay 0
set g_balance_shotgun_primary_force 20
set g_balance_shotgun_primary_spread 0.18
set g_balance_shotgun_primary_refire 1
-set g_balance_shotgun_primary_animtime 0.4
+set g_balance_shotgun_primary_animtime 0.3
set g_balance_shotgun_primary_ammo 1
set g_balance_shotgun_primary_speed 12000
set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
set g_balance_grenadelauncher_primary_lifetime 5
set g_balance_grenadelauncher_primary_lifetime2 0.65
set g_balance_grenadelauncher_primary_refire 0.8
-set g_balance_grenadelauncher_primary_animtime 0.4
+set g_balance_grenadelauncher_primary_animtime 0.3
set g_balance_grenadelauncher_primary_ammo 2
set g_balance_grenadelauncher_primary_health 80
set g_balance_grenadelauncher_primary_damageforcescale 0
set g_balance_grenadelauncher_secondary_lifetime 3
set g_balance_grenadelauncher_secondary_lifetime2 0.65
set g_balance_grenadelauncher_secondary_refire 0.8
-set g_balance_grenadelauncher_secondary_animtime 0.4
+set g_balance_grenadelauncher_secondary_animtime 0.3
set g_balance_grenadelauncher_secondary_ammo 2
set g_balance_grenadelauncher_secondary_health 40
set g_balance_grenadelauncher_secondary_damageforcescale 0
set g_balance_minelayer_speed 750
set g_balance_minelayer_lifetime 60
set g_balance_minelayer_refire 1.5
-set g_balance_minelayer_animtime 0.4
+set g_balance_minelayer_animtime 0.3
set g_balance_minelayer_ammo 5
set g_balance_minelayer_health 15
set g_balance_minelayer_limit 4 // 0 disables the limit
// }}}
// {{{ electro
set g_balance_electro_lightning 1
-set g_balance_electro_primary_damage 92
+set g_balance_electro_primary_damage 100
set g_balance_electro_primary_edgedamage 0
set g_balance_electro_primary_force 425
set g_balance_electro_primary_force_up 125
set g_balance_electro_primary_spread 0
set g_balance_electro_primary_lifetime 0
set g_balance_electro_primary_refire 0.4
-set g_balance_electro_primary_animtime 0.03333333
+set g_balance_electro_primary_animtime 0.2
set g_balance_electro_primary_ammo 5
set g_balance_electro_primary_range 800
set g_balance_electro_primary_falloff_mindist 0
set g_balance_crylink_primary_shots 7
set g_balance_crylink_primary_bounces 2
set g_balance_crylink_primary_refire 0.8
-set g_balance_crylink_primary_animtime 0.4
+set g_balance_crylink_primary_animtime 0.3
set g_balance_crylink_primary_ammo 2
set g_balance_crylink_primary_bouncedamagefactor 0.2
+set g_balance_crylink_primary_joindelay 0
set g_balance_crylink_primary_joinspread 0.2
set g_balance_crylink_primary_jointime 0.1
set g_balance_crylink_primary_joinexplode 0
set g_balance_crylink_secondary_animtime 0.15
set g_balance_crylink_secondary_ammo 1
set g_balance_crylink_secondary_bouncedamagefactor 0.5
+set g_balance_crylink_secondary_joindelay 0
set g_balance_crylink_secondary_joinspread 0
set g_balance_crylink_secondary_jointime 0
set g_balance_crylink_secondary_joinexplode 0
set g_balance_nex_primary_damage 90
set g_balance_nex_primary_force 500
set g_balance_nex_primary_refire 1
-set g_balance_nex_primary_animtime 0.4
+set g_balance_nex_primary_animtime 0.3
set g_balance_nex_primary_ammo 5
set g_balance_nex_primary_damagefalloff_mindist 0
set g_balance_nex_primary_damagefalloff_maxdist 0
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1
-set g_balance_minstanex_animtime 0.75
+set g_balance_minstanex_animtime 0.50
set g_balance_minstanex_ammo 10
// }}}
// {{{ hagar
set g_balance_rocketlauncher_speedstart 800
set g_balance_rocketlauncher_lifetime 5
set g_balance_rocketlauncher_refire 1
-set g_balance_rocketlauncher_animtime 0.4
+set g_balance_rocketlauncher_animtime 0.3
set g_balance_rocketlauncher_ammo 3
set g_balance_rocketlauncher_health 0
set g_balance_rocketlauncher_damageforcescale 0
// }}}
// {{{ porto
set g_balance_porto_primary_refire 1.5
-set g_balance_porto_primary_animtime 0.3
+set g_balance_porto_primary_animtime 0.2
set g_balance_porto_primary_speed 2000
set g_balance_porto_primary_lifetime 5
set g_balance_portal_health 200 // these get recharged whenever the portal is used
// {{{ hook
set g_balance_hook_primary_fuel 5 // hook monkeys set 0
set g_balance_hook_primary_refire 0 // hook monkeys set 0
-set g_balance_hook_primary_animtime 0.3 // good shoot anim
+set g_balance_hook_primary_animtime 0.2 // good shoot anim
set g_balance_hook_primary_hooked_time_max 0 // infinite
set g_balance_hook_primary_hooked_time_free 2 // 2s being hooked are free
set g_balance_hook_primary_hooked_fuel 5 // fuel per second hooked
set g_balance_hook_secondary_speed 0 // not much throwing
set g_balance_hook_secondary_gravity 5 // fast falling
set g_balance_hook_secondary_refire 3 // don't drop too many bombs...
-set g_balance_hook_secondary_animtime 0.3 // good shoot anim
+set g_balance_hook_secondary_animtime 0.2 // good shoot anim
set g_balance_hook_secondary_power 3 // effect behaves like a square function
set g_balance_hook_secondary_duration 1.5 // effect runs for three seconds
// }}}
set g_balance_hlac_primary_lifetime 5
set g_balance_hlac_primary_refire 0.1
-set g_balance_hlac_primary_animtime 0.3
+set g_balance_hlac_primary_animtime 0.2
set g_balance_hlac_primary_ammo 1
set g_balance_hlac_secondary 1
set g_balance_hlac_secondary_lifetime 5
set g_balance_hlac_secondary_refire 0.8
-set g_balance_hlac_secondary_animtime 0.6
+set g_balance_hlac_secondary_animtime 0.4
set g_balance_hlac_secondary_ammo 4
set g_balance_hlac_secondary_shots 6
// }}}
-// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
-set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_on_switch 0
-set g_balance_campingrifle_bursttime 0
-set g_balance_campingrifle_primary_tracer 1
-set g_balance_campingrifle_primary_damage 60
-set g_balance_campingrifle_primary_headshotaddeddamage 100
-set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 40000
-set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 1.5
-set g_balance_campingrifle_primary_animtime 1.4
-set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 110 // 62.2qu
-set g_balance_campingrifle_primary_burstcost 0
-set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
-set g_balance_campingrifle_secondary 1
-set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 42
-set g_balance_campingrifle_secondary_headshotaddeddamage 70
-set g_balance_campingrifle_secondary_spread 0
-set g_balance_campingrifle_secondary_force 2
-set g_balance_campingrifle_secondary_speed 20000
-set g_balance_campingrifle_secondary_lifetime 5
-set g_balance_campingrifle_secondary_refire 1.5
-set g_balance_campingrifle_secondary_animtime 1.4
-set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 110 // 15.5qu
-set g_balance_campingrifle_secondary_burstcost 0
-set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
+// {{{ sniperrifle
+set g_balance_sniperrifle_magazinecapacity 8 // make it pretty much useless in close combat
+set g_balance_sniperrifle_reloadtime 2 // matches reload anim
+set g_balance_sniperrifle_auto_reload_on_switch 0
+set g_balance_sniperrifle_bursttime 0
+set g_balance_sniperrifle_primary_tracer 1
+set g_balance_sniperrifle_primary_damage 60
+set g_balance_sniperrifle_primary_headshotaddeddamage 60
+set g_balance_sniperrifle_primary_spread 0
+set g_balance_sniperrifle_primary_force 2
+set g_balance_sniperrifle_primary_speed 40000
+set g_balance_sniperrifle_primary_lifetime 5
+set g_balance_sniperrifle_primary_refire 1.5
+set g_balance_sniperrifle_primary_animtime 1.4
+set g_balance_sniperrifle_primary_ammo 10
+set g_balance_sniperrifle_primary_bulletconstant 110 // 62.2qu
+set g_balance_sniperrifle_primary_burstcost 0
+set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_tracer 0
+set g_balance_sniperrifle_secondary_damage 42
+set g_balance_sniperrifle_secondary_headshotaddeddamage 42
+set g_balance_sniperrifle_secondary_spread 0
+set g_balance_sniperrifle_secondary_force 2
+set g_balance_sniperrifle_secondary_speed 20000
+set g_balance_sniperrifle_secondary_lifetime 5
+set g_balance_sniperrifle_secondary_refire 1.5
+set g_balance_sniperrifle_secondary_animtime 1.4
+set g_balance_sniperrifle_secondary_ammo 10
+set g_balance_sniperrifle_secondary_bulletconstant 110 // 15.5qu
+set g_balance_sniperrifle_secondary_burstcost 0
+set g_balance_sniperrifle_secondary_bullethail 0 // empty magazine on shot
// }}}
// {{{ tuba
set g_balance_tuba_refire 0.05
// }}}
// {{{ fireball
set g_balance_fireball_primary_ammo 40
-set g_balance_fireball_primary_animtime 0.15
+set g_balance_fireball_primary_animtime 0.2
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_speed 650
set g_balance_fireball_primary_spread 0
set g_balance_fireball_secondary_ammo 5
-set g_balance_fireball_secondary_animtime 0.3
+set g_balance_fireball_secondary_animtime 0.2
set g_balance_fireball_secondary_damage 40
set g_balance_fireball_secondary_damageforcescale 4
set g_balance_fireball_secondary_damagetime 5
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.3
+set g_balance_seeker_missile_animtime 0.2
set g_balance_seeker_missile_count 8
set g_balance_seeker_missile_damage 15
set g_balance_seeker_missile_damageforcescale 4
set g_balance_seeker_missile_spread 0
set g_balance_seeker_missile_turnrate 0.65
set g_balance_seeker_tag_ammo 1
-set g_balance_seeker_tag_animtime 0.3
+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_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_hlac -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
// {{{ pickup items
set g_pickup_ammo_anyway 1
set g_pickup_weapons_anyway 1
-
set g_pickup_shells 20
set g_pickup_shells_weapon 10
set g_pickup_shells_max 50
-
set g_pickup_nails 60
set g_pickup_nails_weapon 60
set g_pickup_nails_max 300
-
set g_pickup_rockets 25
set g_pickup_rockets_weapon 15
set g_pickup_rockets_max 150
-
set g_pickup_cells 30
set g_pickup_cells_weapon 20
set g_pickup_cells_max 300
-
set g_pickup_fuel 25
set g_pickup_fuel_weapon 15
set g_pickup_fuel_jetpack 50
set g_pickup_fuel_max 999
-
set g_pickup_armorsmall 5
set g_pickup_armorsmall_max 999
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 150
set g_pickup_armorbig_anyway 0
-
set g_pickup_armorlarge 100
set g_pickup_armorlarge_max 999
set g_pickup_armorlarge_anyway 0
-
set g_pickup_healthsmall 5
set g_pickup_healthsmall_max 999
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_healthlarge 50
set g_pickup_healthlarge_max 150
set g_pickup_healthlarge_anyway 0
-
set g_pickup_healthmega 100
set g_pickup_healthmega_max 999
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 20
set g_pickup_respawntime_ammo 15
-
set g_pickup_respawntimejitter_short 0
set g_pickup_respawntimejitter_medium 0
set g_pickup_respawntimejitter_long 0
set g_balance_shotgun_secondary_refire 1.1
set g_balance_shotgun_secondary_animtime 1
// }}}
-
// {{{ uzi
set g_balance_uzi_mode 1 // Activates varible spread for sustained & burst mode secondary
set g_balance_uzi_spread_min 0.02
set g_balance_grenadelauncher_bouncefactor 0.5
set g_balance_grenadelauncher_bouncestop 0.075
// }}}
-// {{{ minelayer // TODO
+// {{{ minelayer
set g_balance_minelayer_damage 35
set g_balance_minelayer_edgedamage 30
set g_balance_minelayer_force 250
set g_balance_electro_primary_falloff_mindist 255 // 0.3 * radius
set g_balance_electro_primary_falloff_maxdist 850
set g_balance_electro_primary_falloff_halflifedist 425
-
set g_balance_electro_secondary_damage 25
set g_balance_electro_secondary_edgedamage 0
set g_balance_electro_secondary_force 50
set g_balance_electro_secondary_count 3
set g_balance_electro_secondary_bouncefactor 0.5
set g_balance_electro_secondary_bouncestop 0.075
-
set g_balance_electro_combo_damage 80
set g_balance_electro_combo_edgedamage 10
set g_balance_electro_combo_force 150
set g_balance_crylink_primary_animtime 0.4
set g_balance_crylink_primary_ammo 2
set g_balance_crylink_primary_bouncedamagefactor 0.2
+set g_balance_crylink_primary_joindelay 0
set g_balance_crylink_primary_joinspread 0.1
set g_balance_crylink_primary_jointime 0
set g_balance_crylink_primary_joinexplode 1 //if != 0 do a extra damage pass when projectiles join
set g_balance_crylink_primary_joinexplode_radius 200
set g_balance_crylink_primary_joinexplode_force 400
set g_balance_crylink_primary_linkexplode 0
+
set g_balance_crylink_primary_middle_lifetime 5
set g_balance_crylink_primary_middle_fadetime 0.25
set g_balance_crylink_primary_other_lifetime 2 // range: 800 full, fades to 1300
set g_balance_crylink_secondary_animtime 0.15
set g_balance_crylink_secondary_ammo 1
set g_balance_crylink_secondary_bouncedamagefactor 0.5
+set g_balance_crylink_secondary_joindelay 0
set g_balance_crylink_secondary_joinspread 0
set g_balance_crylink_secondary_jointime 0
set g_balance_crylink_secondary_joinexplode 0
set g_balance_hagar_secondary_refire 0.15
set g_balance_hagar_secondary_ammo 1
// }}}
-// {{{ rocketlauncher // TODO
+// {{{ rocketlauncher
set g_balance_rocketlauncher_damage 120
set g_balance_rocketlauncher_edgedamage 25
set g_balance_rocketlauncher_force 350
set g_balance_hlac_secondary_radius 50
set g_balance_hlac_secondary_speed 15000
set g_balance_hlac_secondary_lifetime 3
+
set g_balance_hlac_secondary_refire 1
set g_balance_hlac_secondary_animtime 0.7
set g_balance_hlac_secondary_ammo 10
set g_balance_hlac_secondary_shots 6
// }}}
-// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
-set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_on_switch 0
-set g_balance_campingrifle_bursttime 0
-set g_balance_campingrifle_primary_tracer 1
-set g_balance_campingrifle_primary_damage 40
-set g_balance_campingrifle_primary_headshotaddeddamage 100
-set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 40000
-set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 0.65
-set g_balance_campingrifle_primary_animtime 0.6
-set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 110 // 62.2qu
-set g_balance_campingrifle_primary_burstcost 0
-set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
-set g_balance_campingrifle_secondary 1
-set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 50
-set g_balance_campingrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
-set g_balance_campingrifle_secondary_spread 0
-set g_balance_campingrifle_secondary_force 2
-set g_balance_campingrifle_secondary_speed 20000
-set g_balance_campingrifle_secondary_lifetime 5
-set g_balance_campingrifle_secondary_refire 1.5
-set g_balance_campingrifle_secondary_animtime 0.6
-set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 110 // 15.5qu
-set g_balance_campingrifle_secondary_burstcost 0
-set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
+// {{{ sniperrifle
+set g_balance_sniperrifle_magazinecapacity 8 // make it pretty much useless in close combat
+set g_balance_sniperrifle_reloadtime 2 // matches reload anim
+set g_balance_sniperrifle_auto_reload_on_switch 0
+set g_balance_sniperrifle_bursttime 0
+set g_balance_sniperrifle_primary_tracer 1
+set g_balance_sniperrifle_primary_damage 40
+set g_balance_sniperrifle_primary_headshotaddeddamage 100
+set g_balance_sniperrifle_primary_spread 0
+set g_balance_sniperrifle_primary_force 2
+set g_balance_sniperrifle_primary_speed 40000
+set g_balance_sniperrifle_primary_lifetime 5
+set g_balance_sniperrifle_primary_refire 0.65
+set g_balance_sniperrifle_primary_animtime 0.6
+set g_balance_sniperrifle_primary_ammo 10
+set g_balance_sniperrifle_primary_bulletconstant 110 // 62.2qu
+set g_balance_sniperrifle_primary_burstcost 0
+set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_tracer 0
+set g_balance_sniperrifle_secondary_damage 50
+set g_balance_sniperrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
+set g_balance_sniperrifle_secondary_spread 0
+set g_balance_sniperrifle_secondary_force 2
+set g_balance_sniperrifle_secondary_speed 20000
+set g_balance_sniperrifle_secondary_lifetime 5
+set g_balance_sniperrifle_secondary_refire 1.5
+set g_balance_sniperrifle_secondary_animtime 0.6
+set g_balance_sniperrifle_secondary_ammo 10
+set g_balance_sniperrifle_secondary_bulletconstant 110 // 15.5qu
+set g_balance_sniperrifle_secondary_burstcost 0
+set g_balance_sniperrifle_secondary_bullethail 0 // empty magazine on shot
// }}}
// {{{ tuba
set g_balance_tuba_refire 0.05
set g_balance_seeker_flac_speed_up 500
set g_balance_seeker_flac_speed_z 0
set g_balance_seeker_flac_spread 0.25
-
set g_balance_seeker_missile_accel 1400
set g_balance_seeker_missile_ammo 2
set g_balance_seeker_missile_animtime 0.3
set g_balance_seeker_missile_speed_max 1400
set g_balance_seeker_missile_spread 0
set g_balance_seeker_missile_turnrate 0.65
-
set g_balance_seeker_tag_ammo 1
set g_balance_seeker_tag_animtime 0.3
set g_balance_seeker_tag_damageforcescale 4
set g_weaponreplace_minstanex ""
set g_weaponreplace_hook ""
set g_weaponreplace_hlac 0 // Maybe will be enabled later after I figure out what I want to do with it
-set g_weaponreplace_campingrifle ""
+set g_weaponreplace_sniperrifle ""
set g_weaponreplace_tuba ""
set g_weaponreplace_fireball 0 // Same with this
set g_weaponreplace_seeker 0 // Same with this
// players
sv_fbskin_green // visible playermodel forced on everyone
+set teamplay_mode 2 // friendly fire and self damage
//================
// impure changes
// match rules
set timelimit_overtimes 1 // overtimes on, draw matches are less interesting! :)
set g_forced_respawn 1 // no delaying/cheating a match by not spawning
-set g_mirrordamage 0 // hurting teammates does not hurt you...
-set g_friendlyfire 1 // ...it hurts them.
// info
set sv_fragmessage_information_stats 0 // don't reveal how much health/armor the attacker had
mod_q3bsp_lightmapmergepower 4
// player defaults
-_cl_color 102
+_cl_color 112
_cl_name Player
-_cl_playermodel models/player/umbra.iqm
+_cl_playermodel models/player/erebus.iqm
_cl_playerskin 0
seta crosshair 16
seta crosshair_color "0.6 0.8 1"
-seta crosshair_alpha 0.3
-seta crosshair_size 0.5
+seta crosshair_alpha 0.300000
+seta crosshair_size 0.500000
seta crosshair_dot 1
seta crosshair_dot_alpha 1
-seta crosshair_dot_size 0.6
+seta crosshair_dot_size 0.600000
seta crosshair_dot_color "1 0 0" "when != 0, use custom color for the crosshair dot"
seta crosshair_pickup 0.25
seta crosshair_pickup_speed 4
seta crosshair_seeker_color "1 0.35 0.35" "crosshair color to display when wielding the TAG seeker"
seta crosshair_seeker_alpha 0.9 "crosshair alpha value to display when wielding the TAG seeker"
seta crosshair_seeker_size 0.8 "crosshair size when wielding the TAG seeker"
-seta crosshair_campingrifle "" "crosshair to display when wielding the campingrifle"
-seta crosshair_campingrifle_color "0.85 0.5 0.25" "crosshair color to display when wielding the campingrifle"
-seta crosshair_campingrifle_alpha 1 "crosshair alpha value to display when wielding the campingrifle"
-seta crosshair_campingrifle_size 0.65 "crosshair size when wielding the campingrifle"
+seta crosshair_sniperrifle "" "crosshair to display when wielding the sniperrifle"
+seta crosshair_sniperrifle_color "0.85 0.5 0.25" "crosshair color to display when wielding the sniperrifle"
+seta crosshair_sniperrifle_alpha 1 "crosshair alpha value to display when wielding the sniperrifle"
+seta crosshair_sniperrifle_size 0.65 "crosshair size when wielding the sniperrifle"
seta crosshair_tuba "" "crosshair to display when wielding the tuba"
seta crosshair_tuba_color "0.85 0.5 0.25" "crosshair color to display when wielding the tuba"
seta crosshair_tuba_alpha 1 "crosshair alpha value to display when wielding the tuba"
seta crosshair_ring_size 2 "bullet counter ring size for Rifle, velocity ring for Nex"
seta crosshair_ring_alpha 0.2 "ring alpha"
-seta crosshair_ring_campingrifle_alpha 0.15
+seta crosshair_ring_sniperrifle_alpha 0.15
seta crosshair_ring_nex_outer_alpha 0.15
seta crosshair_ring_nex_inner_alpha 0.15
set ekg 0 "Throw huge amounts of gibs"
cl_movement 1
+cl_movement_track_canjump 0
cl_stairsmoothspeed 200
seta cl_autoswitch 1 "automatically switch to newly picked up weapons if they are better than what you are carrying"
seta skill_auto 0 "when 1, \"skill\" gets adjusted to match the best player on the map"
// general bot AI cvars
set bot_ai_thinkinterval 0.05
-set bot_ai_strategyinterval 3 "How often a new objective is chosen"
-set bot_ai_enemydetectioninterval 0.5 "How often bots pick a new target"
+set bot_ai_strategyinterval 5 "How often a new objective is chosen"
+set bot_ai_enemydetectioninterval 3 "How often bots pick a new target"
set bot_ai_enemydetectionradius 10000 "How far bots can see enemies"
-set bot_ai_dodgeupdateinterval 0.1 "How often scan for items to dodge. Currently not in use."
-set bot_ai_chooseweaponinterval 0.3 "How often the best weapon according to the situation will be chosen"
-set bot_ai_dangerdetectioninterval 0.1 "How often scan for waypoints with dangers near"
+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_dangerdetectioninterval 0.25 "How often scan for waypoints with dangers near"
set bot_ai_dangerdetectionupdates 64 "How many waypoints will be considered for danger detection"
set bot_ai_aimskill_blendrate 2 "How much correction will be applied to the aiming angle"
set bot_ai_aimskill_fixedrate 15
-set bot_ai_aimskill_firetolerance_distdegrees 180
+set bot_ai_aimskill_firetolerance_distdegrees 100
set bot_ai_aimskill_firetolerance_mindegrees 2 "Minimum angle tolerance. Used on large distances"
set bot_ai_aimskill_firetolerance_maxdegrees 60 "Maximum firing angle. Used on close range"
set bot_ai_aimskill_mouse 1 "How much of the aiming filters are applied"
set bot_ai_aimskill_offset 0.3 "Amount of error induced to the bots aim"
set bot_ai_aimskill_think 1 "Aiming velocity. Use values below 1 for slower aiming"
set bot_ai_custom_weapon_priority_distances "300 850" "Define close and far distances in any order. Based on the distance to the enemy bots will choose different weapons"
-set bot_ai_custom_weapon_priority_far "minstanex nex campingrifle electro rocketlauncher grenadelauncher hagar hlac crylink laser uzi fireball seeker shotgun tuba minelayer" "Desired weapons for far distances ordered by priority"
-set bot_ai_custom_weapon_priority_mid "minstanex rocketlauncher nex fireball seeker grenadelauncher electro uzi campingrifle crylink hlac hagar shotgun laser tuba minelayer" "Desired weapons for middle distances ordered by priority"
-set bot_ai_custom_weapon_priority_close "minstanex shotgun nex uzi hlac tuba seeker hagar crylink grenadelauncher electro campingrifle rocketlauncher laser fireball minelayer" "Desired weapons for close distances ordered by priority"
+set bot_ai_custom_weapon_priority_far "minstanex nex sniperrifle electro rocketlauncher grenadelauncher hagar hlac crylink laser uzi fireball seeker shotgun tuba minelayer" "Desired weapons for far distances ordered by priority"
+set bot_ai_custom_weapon_priority_mid "minstanex rocketlauncher nex fireball seeker grenadelauncher electro uzi sniperrifle crylink hlac hagar shotgun laser tuba minelayer" "Desired weapons for middle distances ordered by priority"
+set bot_ai_custom_weapon_priority_close "minstanex shotgun nex uzi hlac tuba seeker hagar crylink grenadelauncher electro sniperrifle rocketlauncher laser fireball minelayer" "Desired weapons for close distances ordered by priority"
set bot_ai_weapon_combo 1 "Enable bots to do weapon combos"
-set bot_ai_weapon_combo_threshold 0.3 "Try to make a combo N seconds after the last attack"
+set bot_ai_weapon_combo_threshold 0.4 "Try to make a combo N seconds after the last attack"
set bot_ai_friends_aware_pickup_radius "500" "Bots will not pickup items if a team mate is this distance near the item"
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 250 "Run to goals located further than this distance"
-set bot_ai_bunnyhop_stopdistance 220 "Stop jumping after reaching this distance to the goal"
-set bot_ai_bunnyhop_firstjumpdelay 0.5 "Start running to the goal only if it was seen for more than N seconds"
+set bot_ai_bunnyhop_startdistance 100 "Run to goals located further than this distance"
+set bot_ai_bunnyhop_stopdistance 125 "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_god 0 "god mode for bots"
set bot_ai_navigation_jetpack 0 "Enable bots to navigat maps using the jetpack"
set bot_ai_navigation_jetpack_mindistance 3500 "Bots will try fly to objects located farther than this distance"
locs_enable 0
pausable 0
-seta g_spawnshieldtime 0.300000 "number of seconds you are invincible after you spawned, this shield is lost after you fire"
+seta g_spawnshieldtime 1.000000 "number of seconds you are invincible after you spawned, this shield is lost after you fire"
seta g_antilag 2 "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past, 3 = unverified client side hit scan)"
set g_antilag_nudge 0 "don't touch"
set g_antilag_bullets 1 "Bullets AntiLag (0 = no AntiLag, 1 = server side hit scan in the past) - DO NOT TOUCH (severely changes weapon balance)"
seta g_freezetag_warmup 5 "Time players get to run around before the round starts"
seta g_freezetag_point_limit -1 "Freeze Tag point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
seta g_freezetag_point_leadlimit -1 "Freeze Tag point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
-seta g_freezetag_revive_time 2.5 "Time it takes to revive a frozen teammate"
+seta g_freezetag_revive_speed 0.4 "Speed for reviving a frozen teammate"
+seta g_freezetag_revive_clearspeed 1.6 "Speed at which reviving progress gets lost when out of range"
seta g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him"
seta g_freezetag_frozen_force 0.6 "How much to multiply the force on a frozen player with"
set g_tdm 0 "Team Deathmatch: the team who kills their opponents most often wins"
seta teamplay_mode 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the following four cvars"
-seta g_mirrordamage 0.300000 "for teamplay 4: mirror damage factor"
-seta g_friendlyfire 0.100000 "for teamplay 4: fiendly fire factor"
-seta g_teamdamage_threshold 50 "for teamplay 4: threshold over which to apply mirror damage"
-seta g_teamdamage_resetspeed 30 "for teamplay 4: how fast player's teamdamage count decreases"
+seta g_mirrordamage 0.700000 "for teamplay 4: mirror damage factor"
+seta g_mirrordamage_virtual 1 "for teamplay 4: do not actually apply mirror damage, just show graphics effect for it"
+seta g_friendlyfire 0.500000 "for teamplay 4: fiendly fire factor"
+seta g_friendlyfire_virtual 1 "for teamplay 4: do not actually apply friendly fire, just show graphics effect for it"
+seta g_teamdamage_threshold 40 "for teamplay 4: threshold over which to apply mirror damage"
+seta g_teamdamage_resetspeed 20 "for teamplay 4: how fast player's teamdamage count decreases"
set deathmatch_force_teamplay 0 "Always play TDM instead of DM"
seta g_balance_teams 0 "automatically balance out players entering instead of asking them for their preferred team"
r_picmipworld 1
gl_picmip_world 0
gl_picmip_sprites 0
-gl_picmip_other 2 // so, picmip -2 is best possible quality
+gl_picmip_other 1 // so, picmip -1 is best possible quality
r_mipsprites 1
r_mipskins 1
r_shadow_realtime_world_lightmaps 1
alias -fire2 -button3
alias +attack2 +button3 // old alias from Nexuiz
alias -attack2 -button3 // old alias name from Nexuiz
-alias +zoom +button4
-alias -zoom -button4
alias +crouch +button5
alias -crouch -button5
alias weapnext "_weapnext_${cl_weaponpriority_useforcycling}"
alias _weapprev_2 "impulse 12"
alias weapbest "impulse 13"
+// experimental zoom toggle (can be in wrong state at start of a game, though)
+set _togglezoom +
+alias +zoom "set _togglezoom -; +button4"
+alias -zoom "set _togglezoom +; -button4"
+alias togglezoom "${_togglezoom}zoom"
+
alias reload "impulse 20"
// movement
// singleplayer campaign
set g_campaign 0
set g_campaign_forceteam 0 "Forces the player to a given team in campaign mode, 1 = red, 2 = blue, 3 = yellow, 4 = pink"
-seta g_campaign_name "xonotic25"
+seta g_campaign_name "xonoticbeta"
set g_campaign_skill 0
set g_campaignxonotic20_index 0
set g_campaignxonotic25_index 1
seta menu_skin "luminos"
set menu_slowmo 1
seta menu_sounds 0 "enables menu sound effects. 1 enables click sounds, 2 also enables hover sounds"
+set menu_picmip_bypass 0 "bypass texture quality enforcement based on system resources, not recommended and may cause crashes!"
r_textbrightness 0.2
r_textcontrast 0.8
seta hud_panel_weapons_ammo_full_cells 80 "show 100% of the status bar at this ammo count"
seta hud_panel_weapons_ammo_full_rockets 80 "show 100% of the status bar at this ammo count"
seta hud_panel_weapons_ammo_full_fuel 100 "show 100% of the status bar at this ammo count"
-seta hud_panel_weapons_timeout "3" "panel disappears if you don't switch weapon for this amount of seconds"
-seta hud_panel_weapons_timeout_effect "1" "disappearance effect: 0) no effect; 1) panel moves out of screen; 2) panel fades out"
seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status bar is full"
seta hud_colorflash_alpha 0.5 "starting alpha of the color flash"
-seta hud_damage 1 "an improved version of gl_polyblend, draw an image instead when hurt"
-seta hud_damage_gentle_alpha_multiplier 0.25 "how much to multiply alpha of flash when using the cl_gentle version, it's much more opaque than the non-gentle version"
+seta hud_damage 0.55 "an improved version of gl_polyblend, draw an image instead when hurt"
+seta hud_damage_gentle_alpha_multiplier 0.10 "how much to multiply alpha of flash when using the cl_gentle version, it's much more opaque than the non-gentle version"
seta hud_damage_gentle_color "1 0.7 1" "color of flash for cl_gentle version"
seta hud_damage_color "1 0 0" "color of flash"
seta hud_damage_factor 0.025 "(damage * factor) = how much to add to the alpha value"
-seta hud_damage_fade_rate 1 "how much to subtract from the alpha value each second"
-seta hud_damage_maxalpha 2 "how much to limit the alpha value to"
+seta hud_damage_fade_rate 0.75 "how much to subtract from the alpha value each second"
+seta hud_damage_maxalpha 1.5 "how much to limit the alpha value to"
seta hud_damage_pain_threshold 0.1 "how much alpha to ignore (must be bigger than the hud_damage_factor so that e.g. rot is ignored)"
seta hud_damage_pain_threshold_lower 1.25 "how much we lower pain_threshold with when nearing 0 health (if pain_threshold gets negative then we always draw a flash at alpha = fabs(pain_threshold)"
seta hud_damage_pain_threshold_lower_health 50 "at which health we start lowering pain_threshold"
alias allready "sv_cmd allready"
-seta cl_weaponpriority "minstanex rocketlauncher nex minelayer grenadelauncher fireball hlac hagar seeker crylink campingrifle uzi electro tuba shotgun laser hook porto" "weapon priority list"
+seta cl_weaponpriority "minstanex rocketlauncher nex minelayer grenadelauncher fireball hlac hagar seeker crylink sniperrifle uzi electro tuba shotgun laser hook porto" "weapon priority list"
seta cl_weaponpriority_useforcycling 0 "when set, weapon cycling by the mouse wheel makes use of the weapon priority list (the special value 2 uses the weapon ID list for cycling)"
seta cl_weaponpriority0 "rocketlauncher grenadelauncher hagar seeker fireball" "use impulse 200 for prev gun from this list, 210 for best gun, 220 for next gun. Default value: explosives"
seta cl_weaponpriority1 "minstanex nex crylink hlac electro laser" "use impulse 201 for prev gun from this list, 211 for best gun, 221 for next gun. Default value: energy"
-seta cl_weaponpriority2 "minstanex nex campingrifle" "use impulse 202 for prev gun from this list, 212 for best gun, 222 for next gun. Default value: hitscan exact"
-seta cl_weaponpriority3 "minstanex nex campingrifle uzi shotgun" "use impulse 203 for prev gun from this list, 213 for best gun, 223 for next gun. Default value: hitscan all"
+seta cl_weaponpriority2 "minstanex nex sniperrifle" "use impulse 202 for prev gun from this list, 212 for best gun, 222 for next gun. Default value: hitscan exact"
+seta cl_weaponpriority3 "minstanex nex sniperrifle uzi shotgun" "use impulse 203 for prev gun from this list, 213 for best gun, 223 for next gun. Default value: hitscan all"
seta cl_weaponpriority4 "minelayer grenadelauncher hlac hagar crylink seeker shotgun" "use impulse 204 for prev gun from this list, 214 for best gun, 224 for next gun. Default value: spam weapons"
seta cl_weaponpriority5 "laser hook porto" "use impulse 205 for prev gun from this list, 215 for best gun, 225 for next gun. Default value: weapons for moving"
seta cl_weaponpriority6 "" "use impulse 206 for prev gun from this list, 216 for best gun, 226 for next gun"
alias cl_hook_gamestart_nexball
alias cl_hook_gamestart_cts
alias cl_hook_gamestart_ka
+alias cl_hook_gamestart_freezetag
alias cl_hook_gameend
alias cl_hook_activeweapon
alias sv_hook_gamestart_nexball
alias sv_hook_gamestart_cts
alias sv_hook_gamestart_ka
+alias sv_hook_gamestart_freezetag
alias sv_hook_gamerestart
alias sv_hook_gameend
set g_weaponreplace_minstanex ""
set g_weaponreplace_hook ""
set g_weaponreplace_hlac ""
-set g_weaponreplace_campingrifle ""
+set g_weaponreplace_sniperrifle ""
set g_weaponreplace_tuba ""
set g_weaponreplace_fireball ""
set g_weaponreplace_seeker ""
scr_loadingscreen_barcolor "0 0.5 1"
scr_loadingscreen_barheight 20
scr_loadingscreen_count 1
+scr_conforcewhiledisconnected 0
// DP cannot properly detect this, so rather turn off the detection
r_texture_dds_load_dxt1_noalpha 1
+r_texture_dds_load_swdecode 1 // SW decode to quarter res if we want to load DDS but don't support the extension for it
// particles optimization
r_drawparticles_nearclip_min 8
// safe font defaults
r_font_hinting 1
r_font_disable_freetype 0
-r_font_size_snapping 2
+r_font_size_snapping 4
// database management
set sv_db_saveasdump 0 "write server.db in dump format (loads slower, easier to read/parse)"
liquidfriction 4
velocityjitter 16 16 16
-
-
// rocket guiding start
// underwater bubbles
effect rocket_guide
velocityjitter 300 300 300
velocitymultiplier 0.5
airfriction 3
+
+
+// weak rifle bullet trail (somewhat like a tracer)
+// used in qcsrc/server/w_common.qc: zcurveparticles_from_tracetoss(particleeffectnum("tr_bullet"), self.origin, trace_endpos, self.velocity)
+// used in qcsrc/client/projectile.qc: trailparticles(self, particleeffectnum("tr_bullet"), from, to)
+effect tr_rifle_weak
+trailspacing 128
+type spark
+color 0x800000 0xFF8020
+alpha 256 256 2560
+size 1.5 1.5
+stretchfactor 1
+velocitymultiplier 0.7
+effect tr_rifle_weak
+notunderwater
+tex 0 8
+trailspacing 48
+type static
+color 0x202020 0x404040
+size 4 4
+sizeincrease 0.4
+alpha 256 256 256
+airfriction -4
+velocityjitter 4 4 4
+type smoke
+effect tr_rifle_weak
+underwater
+trailspacing 192
+type bubble
+tex 62 62
+color 0x404040 0x808080
+size 2 2
+alpha 256 256 128
+gravity -0.125
+bounce 1.5
+liquidfriction 4
+velocityjitter 16 16 16
+
+// red smoke emiter
+// used nowhere in code
+effect red_smoke
+count 2
+type smoke
+tex 0 8
+color 0xff8866 0x331100
+size 60 120
+sizeincrease 0
+alpha 32 64 32
+gravity -0.007
+originjitter 0 0 0
+velocityjitter 0 0 0
+velocitymultiplier 5
+airfriction -1
+rotate 0 360 -30 30
+
+// pipe smoke emiter
+// used nowhere in code
+effect pipe_smoke
+count 2
+type smoke
+tex 0 8
+color 0x999999 0x555555
+size 5 10
+sizeincrease 35
+alpha 32 64 48
+gravity -0.015
+originjitter 0 0 0
+velocityjitter 0 0 5
+velocitymultiplier 15
+airfriction -1
+rotate 0 360 -180 180
cl_decals_time 10
cl_particles_quality 1
gl_flashblend 0
-gl_picmip -2
+gl_picmip -1
gl_texture_anisotropy 16
mod_q3bsp_nolightmaps 0
r_bloom 1
cl_decals_time 10
cl_particles_quality 1
gl_flashblend 0
-gl_picmip -2
+gl_picmip -1
gl_texture_anisotropy 16
mod_q3bsp_nolightmaps 0
r_bloom 1
--- /dev/null
+#!/bin/sh
+
+main=balanceXonotic.cfg
+for X in balance*.cfg; do
+ case "$X" in
+ "$main")
+ ;;
+ *)
+ perl ../../misc/tools/cfgapply.pl "$main" "$X" > "$X.new" && mv "$X.new" "$X"
+ ;;
+ esac
+done
+git diff
seta cl_swapattacks_laser 0
seta cl_swapattacks_shotgun 0
seta cl_swapattacks_uzi 0
-seta cl_swapattacks_campingrifle 0
+seta cl_swapattacks_sniperrifle 0
seta cl_swapattacks_grenadelauncher 0
seta cl_swapattacks_electro 0
seta cl_swapattacks_hlac 0
seta hud_panel_weapons_ammo_color "0 1 0"
seta hud_panel_weapons_ammo_alpha "1"
seta hud_panel_weapons_aspect "2"
+seta hud_panel_weapons_timeout "3"
+seta hud_panel_weapons_timeout_effect "1"
seta hud_panel_ammo 1
seta hud_panel_ammo_pos "0.190000 0.920000"
seta hud_panel_chat_bg_border ""
seta hud_panel_chat_bg_padding ""
-seta hud_panel_engineinfo 1
+seta hud_panel_engineinfo 0
seta hud_panel_engineinfo_pos "0.910000 0.970000"
seta hud_panel_engineinfo_size "0.090000 0.030000"
seta hud_panel_engineinfo_bg "0"
seta hud_panel_weapons_ammo_color "0 1 0"
seta hud_panel_weapons_ammo_alpha "1"
seta hud_panel_weapons_aspect "2"
+seta hud_panel_weapons_timeout "0"
+seta hud_panel_weapons_timeout_effect "0"
seta hud_panel_ammo 1
seta hud_panel_ammo_pos "0.650000 0.890000"
seta hud_panel_weapons_ammo_color "0 1 0"
seta hud_panel_weapons_ammo_alpha "1"
seta hud_panel_weapons_aspect "2"
+seta hud_panel_weapons_timeout "0"
+seta hud_panel_weapons_timeout_effect "0"
seta hud_panel_ammo 1
seta hud_panel_ammo_pos "0.450000 0.630000"
seta hud_panel_weapons_ammo_color "0 1 0"
seta hud_panel_weapons_ammo_alpha "1"
seta hud_panel_weapons_aspect "2"
+seta hud_panel_weapons_timeout "0"
+seta hud_panel_weapons_timeout_effect "0"
seta hud_panel_ammo 1
seta hud_panel_ammo_pos "0.160000 0.910000"
seta hud_panel_chat_bg_border ""
seta hud_panel_chat_bg_padding ""
-seta hud_panel_engineinfo 1
+seta hud_panel_engineinfo 0
seta hud_panel_engineinfo_pos "0.887500 0.870000"
seta hud_panel_engineinfo_size "0.112500 0.030000"
seta hud_panel_engineinfo_bg "0"
"impulse 14" "porto / hook"
"" ""
"" "View"
-"+zoom" "zoom"
+"+zoom" "hold zoom"
+"togglezoom" "toggle zoom"
"+showscores" "show scores"
"screenshot" "screen shot"
"" ""
// float coop;
// float deathmatch;
-// float dmg_take;
+float dmg_take;
// float dmg_save;
// vector dmg_origin;
string w_deathtypestring;
vector w_org, w_backoff;
-float campingrifle_scope;
+float sniperrifle_scope;
float nex_scope;
float cr_maxbullets;
#endif
float i;
- CSQC_CheckEngine();
binddb = db_create();
tempdb = db_create();
ClientProgsDB = db_load("client.db");
compressShortVector_init();
- drawfont = 0;
+ drawfont = FONT_USER+1;
menu_visible = FALSE;
menu_show = menu_show_error;
menu_action = menu_sub_null;
g_balance_electro_secondary_bouncestop = ReadCoord();
nex_scope = !ReadByte();
- campingrifle_scope = !ReadByte();
+ sniperrifle_scope = !ReadByte();
serverflags = ReadByte();
+ cr_maxbullets = ReadByte();
+
if(!postinit)
PostInit();
}
Net_WeaponComplain();
bHandled = true;
break;
- case TE_CSQC_CR_MAXBULLETS:
- cr_maxbullets = ReadByte();
- bHandled = true;
- break;
default:
// No special logic for this temporary entity; return 0 so the engine can handle it
bHandled = false;
zoomspeed = 3.5;
zoomdir = button_zoom;
- if((getstati(STAT_ACTIVEWEAPON) == WEP_NEX && nex_scope) || (getstati(STAT_ACTIVEWEAPON) == WEP_CAMPINGRIFLE && campingrifle_scope)) // do NOT use switchweapon here
+ if((getstati(STAT_ACTIVEWEAPON) == WEP_NEX && nex_scope) || (getstati(STAT_ACTIVEWEAPON) == WEP_SNIPERRIFLE && sniperrifle_scope)) // do NOT use switchweapon here
zoomdir += button_attack2;
if(spectatee_status > 0 || isdemo())
{
case WEP_MINSTANEX:
mv = MOVE_NORMAL;
break;
- case WEP_CAMPINGRIFLE:
+ case WEP_SNIPERRIFLE:
ta = trueaim_rifle;
mv = MOVE_NORMAL;
if(zoomscript_caught)
// next R_RenderScene call
drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0);
- if(autocvar_r_fakelight >= 2 || autocvar_r_fullbright >= 1)
+ if(autocvar_r_fakelight >= 2 || autocvar_r_fullbright)
if not(serverflags & SERVERFLAG_ALLOW_FULLBRIGHT)
{
// apply night vision effect
// the view to go back to normal, so reticle_type would become 0 as we fade out)
if(spectatee_status || getstati(STAT_HEALTH) <= 0)
reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
- else if(activeweapon == WEP_NEX && (button_zoom || zoomscript_caught) || activeweapon == WEP_CAMPINGRIFLE && (button_zoom || zoomscript_caught) || activeweapon == WEP_MINSTANEX && (button_zoom || zoomscript_caught))
+ else if(activeweapon == WEP_NEX && (button_zoom || zoomscript_caught) || activeweapon == WEP_SNIPERRIFLE && (button_zoom || zoomscript_caught) || activeweapon == WEP_MINSTANEX && (button_zoom || zoomscript_caught))
reticle_type = 2; // nex zoom
else if(button_zoom || zoomscript_caught)
reticle_type = 1; // normal zoom
- else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_CAMPINGRIFLE && button_attack2)
+ else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_SNIPERRIFLE && button_attack2)
reticle_type = 2; // nex zoom
if(autocvar_cl_reticle_stretch)
// fade out
myhealth_flash = max(0, myhealth_flash - autocvar_hud_damage_fade_rate * frametime);
// add new damage
- myhealth_flash = bound(0, myhealth_flash + max(0, myhealth_prev - myhealth) * autocvar_hud_damage_factor, autocvar_hud_damage_maxalpha);
+ myhealth_flash = bound(0, myhealth_flash + dmg_take * autocvar_hud_damage_factor, autocvar_hud_damage_maxalpha);
float pain_threshold, pain_threshold_lower, pain_threshold_lower_health;
pain_threshold = autocvar_hud_damage_pain_threshold;
nex_charge_movingavg = nex_charge;
// ring around crosshair representing bullets left in camping rifle clip
- if (activeweapon == WEP_CAMPINGRIFLE && cr_maxbullets)
+ if (activeweapon == WEP_SNIPERRIFLE && cr_maxbullets)
{
bullets = getstati(STAT_BULLETS_LOADED);
f = bound(0, bullets / cr_maxbullets, 1);
- a = autocvar_crosshair_ring_campingrifle_alpha;
+ a = autocvar_crosshair_ring_sniperrifle_alpha;
DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
}
else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
float autocvar_crosshair_per_weapon;
float autocvar_crosshair_pickup;
float autocvar_crosshair_pickup_speed;
-float autocvar_crosshair_ring_campingrifle_alpha;
+float autocvar_crosshair_ring_sniperrifle_alpha;
float autocvar_crosshair_ring_nex_currentcharge_movingavg_rate;
float autocvar_crosshair_ring_nex_currentcharge_scale;
float autocvar_crosshair_ring_nex_inner_alpha;
{
ts = centerprint_messages[i];
drawfontscale = sz * '1 1 0';
- drawfont = hud_bigfont;
pos_x = (vid_conwidth - stringwidth(ts, TRUE, centerprint_fontsize)) * 0.5;
if (ts != "")
{
// half height for empty lines looks better
pos_y = pos_y + sz * centerprint_fontsize_y * 0.5;
drawfontscale = '1 1 0';
- drawfont = hud_font;
}
}
HUD_Write_PanelCvar_q("_ammo_color");
HUD_Write_PanelCvar_q("_ammo_alpha");
HUD_Write_PanelCvar_q("_aspect");
+ HUD_Write_PanelCvar_q("_timeout");
+ HUD_Write_PanelCvar_q("_timeout_effect");
break;
case HUD_PANEL_AMMO:
HUD_Write_PanelCvar_q("_onlycurrent");
case WEP_HLAC: return 3;
case WEP_MINSTANEX: return 3;
case WEP_NEX: return 3;
- case WEP_CAMPINGRIFLE: return 1;
+ case WEP_SNIPERRIFLE: return 1;
case WEP_HAGAR: return 2;
case WEP_ROCKET_LAUNCHER: return 2;
case WEP_SEEKER: return 2;
drawstring(wpnpos, getcommandkey(ftos(weapid), strcat("impulse ", ftos(weapid))), '1 1 0' * 0.5 * wpnsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
// draw ammo status bar
- if(show_ammo && weapid != WEP_TUBA && weapid != WEP_LASER && weapid != WEP_PORTO)
+ if(show_ammo && self.weapon != WEP_TUBA && self.weapon != WEP_LASER && self.weapon != WEP_PORTO)
{
a = 0;
- type = GetAmmoTypeForWep(weapid);
+ type = GetAmmoTypeForWep(self.weapon);
if(type != -1)
a = getstati(GetAmmoStat(type)); // how much ammo do we have?
ammo_size_y = newSize;
}
- drawfont = hud_bigfont;
float i, stat_items, currently_selected;
if (autocvar_hud_panel_ammo_onlycurrent)
{
column = column + 1;
}
}
- drawfont = hud_font;
}
void DrawNumIcon(float iconalign, vector myPos, vector mySize, float x, string icon, float left, vector color, float alpha)
}
}
- drawfont = hud_bigfont;
drawstring_aspect(numpos, ftos(x), eX * (2/3) * newSize_x + eY * newSize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
- drawfont = hud_font;
drawpic_aspect_skin(picpos, icon, '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
}
rightexact = strength_time;
}
- drawfont = hud_bigfont;
float baralign = autocvar_hud_panel_powerups_baralign;
float barflip;
float iconalign = autocvar_hud_panel_powerups_iconalign;
}
}
}
- drawfont = hud_font;
}
// Health/armor (#3)
vector picpos;
vector numpos;
- drawfont = hud_bigfont;
float baralign = autocvar_hud_panel_healtharmor_baralign;
float iconalign = autocvar_hud_panel_healtharmor_iconalign;
float progressbar = autocvar_hud_panel_healtharmor_progressbar;
}
}
}
- drawfont = hud_font;
}
// Notification area (#4)
} else if(msg == MSG_KILL) {
w = DEATH_WEAPONOF(type);
if(WEP_VALID(w)) {
- if((w == WEP_CAMPINGRIFLE || w == WEP_MINSTANEX) && type & HITTYPE_HEADSHOT) // all headshot weapons go here
+ if((w == WEP_SNIPERRIFLE || w == WEP_MINSTANEX) && type & HITTYPE_HEADSHOT) // all headshot weapons go here
HUD_KillNotify_Push(s1, s2, 1, DEATH_HEADSHOT);
else
HUD_KillNotify_Push(s1, s2, 1, type);
timer = seconds_tostring(timeleft);
}
- drawfont = hud_bigfont;
drawstring_aspect(pos, timer, mySize, timer_color, panel_fg_alpha, DRAWFLAG_NORMAL);
- drawfont = hud_font;
}
// Radar (#6)
// race record display
if (distribution <= 0)
HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawfont = hud_bigfont;
drawstring_aspect(pos, timer, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawfont = hud_font;
} else if (!teamplay) { // non-teamgames
// me vector := [team/connected frags id]
pl = players.sort_next;
drawstring_aspect(pos + eX * 0.75 * mySize_x, ftos(distribution), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
if (leader)
HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawfont = hud_bigfont;
drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
- drawfont = hud_font;
} else { // teamgames
float max_fragcount;
max_fragcount = -99;
leader = 1;
if (leader)
HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawfont = hud_bigfont;
drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
- drawfont = hud_font;
} else {
if (max_fragcount == score)
leader = 1;
}
mySize = newSize;
- drawfont = hud_bigfont;
float a, t;
string s, forcetime;
}
}
}
-
- drawfont = hud_font;
}
// Vote window (#9)
redalive = getstati(STAT_REDALIVE);
bluealive = getstati(STAT_BLUEALIVE);
- drawfont = hud_bigfont;
vector redpos, bluepos;
if(mySize_x > mySize_y)
{
drawpic_aspect_skin(bluepos, "player_blue.tga", eX * mySize_x + eY * 0.3 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
drawstring_aspect(bluepos + eY * 0.3 * mySize_y, ftos(bluealive), eX * mySize_x + eY * 0.2 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
}
- drawfont = hud_font;
}
// CTF HUD modicon section
if not((scores_flags[ps_primary] & SFL_TIME) && !teamplay) // race/cts record display on HUD
return; // no records in the actual race
- drawfont = hud_bigfont;
-
// clientside personal record
string rr;
if(gametype == GAME_CTS)
strunzone(race_status_name_prev);
race_status_name_prev = string_null;
}
- drawfont = hud_font;
}
float mod_prev; // previous state of mod_active to check for a change
vector color;
color = HUD_Get_Num_Color (prevfps, 100);
- drawfont = hud_bigfont;
drawstring_aspect(pos, strcat("FPS: ", ftos_decimals(prevfps, autocvar_hud_panel_engineinfo_framecounter_decimals)), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
- drawfont = hud_font;
}
// Info messages panel (#14)
numsize_x = numsize_y = autocvar_cl_showspeed_size;
pos = (vid_conheight - numsize_y) * autocvar_cl_showspeed_position;
- drawfont = hud_bigfont;
drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
if (autocvar_cl_showspeed_z == 1) {
zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit);
drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
}
-
- drawfont = hud_font;
}
vector acc_prevspeed;
}
}
+ current_player = (spectatee_status > 0) ? spectatee_status : player_localentnum;
+
// draw the dock
if(autocvar_hud_dock != "" && autocvar_hud_dock != "0")
{
vector color;
float hud_dock_color_team = autocvar_hud_dock_color_team;
if((teamplay) && hud_dock_color_team) {
- f = stof(getplayerkey(player_localentnum - 1, "colors"));
+ f = stof(getplayerkey(current_player - 1, "colors"));
color = colormapPaletteColor(mod(f, 16), 1) * hud_dock_color_team;
}
else if(autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && hud_dock_color_team) {
{
string hud_dock_color = autocvar_hud_dock_color;
if(hud_dock_color == "shirt") {
- f = stof(getplayerkey(player_localentnum - 1, "colors"));
+ f = stof(getplayerkey(current_player - 1, "colors"));
color = colormapPaletteColor(floor(f / 16), 0);
}
else if(hud_dock_color == "pants") {
- f = stof(getplayerkey(player_localentnum - 1, "colors"));
+ f = stof(getplayerkey(current_player - 1, "colors"));
color = colormapPaletteColor(mod(f, 16), 1);
}
else
var float panel_bg_padding;
var string panel_bg_padding_str;
+float current_player;
+
// Because calling lots of functions in QC apparently cuts fps in half on many machines:
// ----------------------
// MACRO HELL STARTS HERE
// Get value for panel_bg_color: if "" fetch default, else use panel_bg_color. Convert pants, shirt or teamcolor into a vector.
#define HUD_Panel_GetColor()\
if((teamplay) && panel_bg_color_team) {\
- panel_bg_color = colormapPaletteColor(mod(stof(getplayerkey(player_localentnum - 1, "colors")), 16), 1) * panel_bg_color_team;\
+ panel_bg_color = colormapPaletteColor(mod(stof(getplayerkey(current_player - 1, "colors")), 16), 1) * panel_bg_color_team;\
} else if (autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && panel_bg_color_team) {\
panel_bg_color = '1 0 0' * panel_bg_color_team;\
} else {\
panel_bg_color = autocvar_hud_panel_bg_color;\
} else {\
if(panel_bg_color_str == "shirt") {\
- panel_bg_color = colormapPaletteColor(floor(stof(getplayerkey(player_localentnum - 1, "colors")) / 16), 0);\
+ panel_bg_color = colormapPaletteColor(floor(stof(getplayerkey(current_player - 1, "colors")) / 16), 0);\
} else if(panel_bg_color_str == "pants") {\
- panel_bg_color = colormapPaletteColor(mod(stof(getplayerkey(player_localentnum - 1, "colors")), 16), 1);\
+ panel_bg_color = colormapPaletteColor(mod(stof(getplayerkey(current_player - 1, "colors")), 16), 1);\
} else {\
panel_bg_color = stov(panel_bg_color_str);\
}\
string hud_title[MAX_HUD_FIELDS + 1];
float hud_num_fields;
-float hud_font;
-float hud_bigfont;
-
string scores_label[MAX_SCORE];
float scores_flags[MAX_SCORE];
string teamscores_label[MAX_SCORE];
img_size_y = isize;
img_size_x = isize / 0.75; // 4:3 x can be stretched easily, height is defined in isize
- drawfont = hud_font;
pos_y = pos_y + img_size_y;
label = MapVote_FormatMapItem(id, map, count, tsize, hud_fontsize);
rgb = MapVote_RGB(id);
- drawfont = hud_font;
pos_y = pos_y + hud_fontsize_y;
label = MapVote_FormatMapItem(id, "Don't care", count, tsize, hud_fontsize);
if(i >= 0 || ymax < (vid_conheight*0.5))
ymax = vid_conheight - ymin;
- drawfont = hud_bigfont;
hud_fontsize = HUD_GetFontsize("hud_fontsize");
pos_y = ymin;
pos_y += 22;
pos_x = xmin;
- drawfont = hud_font;
-
// base for multi-column stuff...
ymin = pos_y;
if(mv_abstain)
return tm;
}
-void CSQC_CheckEngine()
-{
- hud_font = FONT_USER+1;
- hud_bigfont = FONT_USER+2;
-}
-
vector HUD_GetFontsize(string cvarname)
{
vector v;
case PROJECTILE_ELECTRO: setmodel(self, "models/ebomb.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
case PROJECTILE_ROCKET: setmodel(self, "models/rocket.md3");self.traileffect = particleeffectnum("TR_ROCKET"); self.scale = 2; break;
case PROJECTILE_BULLET: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_bullet"); break;
- case PROJECTILE_BULLET_GLOWING: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_bullet"); break;
+ case PROJECTILE_BULLET_GLOWING: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_rifle_weak"); break;
case PROJECTILE_BULLET_GLOWING_TRACER: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_rifle"); break;
case PROJECTILE_CRYLINK: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
case PROJECTILE_CRYLINK_BOUNCING: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
{
return strcat( // fteqcc sucks
"ping pl name | ",
- "-teams,race,lms/kills -teams,lms/deaths -teams,lms,race,ka/suicides -race,dm,tdm,ka/frags ", // tdm already has this in "score"
+ "-teams,race,lms/kills +freezetag/kills -teams,lms/deaths +freezetag/deaths -teams,lms,race,ka/suicides +freezetag/suicides -race,dm,tdm,ka,freezetag/frags ", // tdm already has this in "score"
"+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns ",
"+lms/lives +lms/rank ",
"+kh/caps +kh/pushes +kh/destroyed ",
"?+race/laps ?+race/time ?+race/fastest ",
- "+as/objectives +nexball/faults +nexball/goals +ka/drops +ka/pickups +ka/bckills ",
+ "+as/objectives +nexball/faults +nexball/goals +ka/drops +ka/pickups +ka/bckills +freezetag/revivals ",
"-lms,race,nexball/score");
}
hud_num_fields = 0;
- drawfont = hud_font;
hud_fontsize = HUD_GetFontsize("hud_fontsize");
for(i = 0; i < argc - 1; ++i)
drawfill(pos + '0 1 0' * weapon_height + '0 1 0' * height * i, '1 0 0' * sbwidth + '0 1 0' * fontsize, '1 1 1', scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
}
- drawfont = hud_bigfont;
average_accuracy = 0;
float weapons_with_stats;
weapons_with_stats = 0;
pos_y += height;
}
}
- drawfont = hud_font;
if(weapons_with_stats)
average_accuracy = floor(average_accuracy / weapons_with_stats);
pos_z = 0;
// Heading
- drawfont = hud_bigfont;
drawstring(pos, "Scoreboard", '24 24 0', '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
centerprint_start_x = vid_conwidth - 0.5 * (pos_x + stringwidth("Scoreboard", FALSE, '24 24 0'));
pos_y += 24;
- drawfont = hud_font;
-
// Draw the scoreboard
vector bg_size = drawgetimagesize("gfx/scoreboard/scoreboard_bg") * autocvar_scoreboard_bg_scale;
waypointsprite_distancefadealpha = autocvar_g_waypointsprite_distancefadealpha;
waypointsprite_distancefadescale = autocvar_g_waypointsprite_distancefadescale;
waypointsprite_distancefadedistance = waypointsprite_fadedistance * autocvar_g_waypointsprite_distancefadedistancemultiplier;
- waypointsprite_alpha = autocvar_g_waypointsprite_alpha;
+ waypointsprite_alpha = autocvar_g_waypointsprite_alpha * (1 - autocvar__menu_alpha);
if(!waypointsprite_initialized)
{
const float TE_CSQC_TARGET_MUSIC = 111;
const float TE_CSQC_NOTIFY = 112;
const float TE_CSQC_WEAPONCOMPLAIN = 113;
-const float TE_CSQC_CAMPINGRIFLE_SCOPE = 115;
const float TE_CSQC_NEX_SCOPE = 116;
const float TE_CSQC_CR_MAXBULLETS = 117;
fn = get_model_datafilename(m, sk, "txt");
fh = fopen(fn, FILE_READ);
if(fh < 0)
- return 0;
+ {
+ sk = 0;
+ fn = get_model_datafilename(m, sk, "txt");
+ fh = fopen(fn, FILE_READ);
+ if(fh < 0)
+ return 0;
+ }
get_model_parameters_modelname = m;
get_model_parameters_modelskin = sk;
if(argv(0) == "sync")
{
loadAllCvars(main);
+ updateCompression();
return;
}
float i;
me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor", "Enable panel"));
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify", "Enable panel"));
me.TR(me);
me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
ATTRIB(XonoticAdvancedDialog, title, string, "Advanced server settings")
ATTRIB(XonoticAdvancedDialog, color, vector, SKINCOLOR_DIALOG_ADVANCED)
ATTRIB(XonoticAdvancedDialog, intendedWidth, float, 0.5)
- ATTRIB(XonoticAdvancedDialog, rows, float, 13)
+ ATTRIB(XonoticAdvancedDialog, rows, float, 14)
ATTRIB(XonoticAdvancedDialog, columns, float, 3)
ATTRIB(XonoticAdvancedDialog, refilterEntity, entity, NULL)
ENDCLASS(XonoticAdvancedDialog)
{
entity e;
me.TR(me);
- me.TD(me, 1, 1.2, makeXonoticTextLabel(0, "Game settings:"));
+ me.TD(me, 1, 3, makeXonoticTextLabel(0, "Game settings:"));
me.TR(me);
me.TDempty(me, 0.2);
- me.TD(me, 1, 1.2, e = makeXonoticCheckBox(0, "sv_spectate", "Allow spectating"));
+ me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "sv_spectate", "Allow spectating"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Spawn shield:"));
- me.TD(me, 1, 1.7, e = makeXonoticSlider(0, 15, 0.5, "g_spawnshieldtime"));
+ me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 15, 0.5, "g_spawnshieldtime"));
me.TR(me);
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Game speed:"));
- me.TD(me, 1, 1.7, e = makeXonoticSlider(0.5, 2.0, 0.1, "slowmo"));
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 1.2, e = makeXonoticCheckBoxEx(2, 0, "g_antilag", "AntiLag"));
+ me.TD(me, 1, 1.6, e = makeXonoticSlider(0.5, 2.0, 0.1, "slowmo"));
me.TR(me);
me.TR(me);
- me.TD(me, 1, 1.2, makeXonoticTextLabel(0, "Teamplay settings:"));
+ me.TD(me, 1, 3, makeXonoticTextLabel(0, "Teamplay settings:"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Friendly fire scale:"));
- me.TD(me, 1, 1.7, e = makeXonoticSlider(0, 1.0, 0.05, "g_friendlyfire"));
+ me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 1.0, 0.05, "g_friendlyfire"));
+ me.TR(me);
+ me.TDempty(me, 0.4);
+ me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_friendlyfire_virtual", "Virtual friendly fire (effect only)"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Friendly fire penalty:"));
- me.TD(me, 1, 1.7, e = makeXonoticSlider(0, 1.0, 0.05, "g_mirrordamage"));
+ me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 1.0, 0.05, "g_mirrordamage"));
+ me.TR(me);
+ me.TDempty(me, 0.4);
+ me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_mirrordamage_virtual", "Virtual penalty (effect only)"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Teams:"));
- me.TD(me, 1, 1.7, e = makeXonoticTextSlider("g_tdm_teams_override g_domination_teams_override g_keyhunt_teams_override"));
+ me.TD(me, 1, 1.6, e = makeXonoticTextSlider("g_tdm_teams_override g_domination_teams_override g_keyhunt_teams_override"));
e.addValue(e, "Default", "0");
e.addValue(e, "2 teams", "2");
e.addValue(e, "3 teams", "3");
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_start_weapon_laser", "0", "No start weapons"));
e.cvarOffValue = "-1";
- makeMulti(e, "g_start_weapon_shotgun g_start_weapon_uzi g_start_weapon_grenadelauncher g_start_weapon_minelayer g_start_weapon_electro g_start_weapon_crylink g_start_weapon_nex g_start_weapon_hagar g_start_weapon_rocketlauncher g_start_weapon_campingrifle g_start_weapon_hlac g_start_weapon_seeker g_start_weapon_minstanex g_start_weapon_hook g_start_weapon_porto g_start_weapon_tuba");
+ makeMulti(e, "g_start_weapon_shotgun g_start_weapon_uzi g_start_weapon_grenadelauncher g_start_weapon_minelayer g_start_weapon_electro g_start_weapon_crylink g_start_weapon_nex g_start_weapon_hagar g_start_weapon_rocketlauncher g_start_weapon_sniperrifle g_start_weapon_hlac g_start_weapon_seeker g_start_weapon_minstanex g_start_weapon_hook g_start_weapon_porto g_start_weapon_tuba g_start_weapon_minelayer");
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
me.TR(me);
me.TD(me, 1, 3.0, box = makeXonoticInputBox(1, "_cl_name"));
box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
- box.maxLength = -63; // negativ means encoded length in bytes
+ box.maxLength = -127; // negative means encoded length in bytes
label.textEntity = box;
me.TR(me);
me.TD(me, 5, 1, e = makeXonoticColorpicker(box));
me.TDempty(me, 0.3);
me.TD(me, 1, 0.7, e = makeXonoticCheckBox(0, "crosshair_color_per_weapon", "Per weapon"));
me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", "Enable centered dot"));
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", "Enable center dot"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Size:"));
return FALSE;
}
-float updateCompression()
-{
- float fh;
- float have_dds, have_jpg, have_tga;
- if((have_dds = ((fh = fopen("dds/particles/particlefont.dds", FILE_READ)) >= 0)))
- fclose(fh);
- if((have_jpg = ((fh = fopen("particles/particlefont.jpg", FILE_READ)) >= 0)))
- fclose(fh);
- if((have_tga = ((fh = fopen("particles/particlefont.tga", FILE_READ)) >= 0)))
- fclose(fh);
- if(have_dds && (have_jpg || have_tga))
- {
- cvar_set("gl_texturecompression", "0");
- return 1;
- }
- else if(have_dds)
- {
- cvar_set("gl_texturecompression", "0");
- cvar_set("r_texture_dds_load", "1");
- return 0;
- }
- else
- {
- cvar_set("gl_texturecompression", cvar_string("r_texture_dds_load"));
- return 2;
- }
-}
-
void XonoticEffectsSettingsTab_fill(entity me)
{
entity e, s;
}
}
localcmd("\nbind \"", keynumtostring(key), "\" \"", func, "\"\n");
+ localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
}
void XonoticKeyBinder_editUserbind(entity me, string theName, string theCommandPress, string theCommandRelease)
{
//localcmd("\nunbind \"", keynumtostring(k), "\"\n");
localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n");
}
-
+ localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
}
void XonoticKeyBinder_clickListBoxItem(entity me, float i, vector where)
{
METHOD(XonoticPicmipSlider, configureXonoticPicmipSlider, void(entity))
METHOD(XonoticPicmipSlider, draw, void(entity))
METHOD(XonoticPicmipSlider, autofix, void(entity))
+ ATTRIB(XonoticPicmipSlider, have_s3tc, float, 0)
ENDCLASS(XonoticPicmipSlider)
entity makeXonoticPicmipSlider(); // note: you still need to call addValue and configureXonoticTextSliderValues!
#endif
{
me.configureXonoticTextSlider(me, "gl_picmip");
me.autofix(me);
+ me.have_s3tc = GL_Have_TextureCompression();
}
-float texmemsize()
+float texmemsize(float s3tc)
{
return
(
- 2500 * pow(0.5, max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
- + 1500 * pow(0.5, max(0, cvar("gl_picmip") + cvar("gl_picmip_world")))
- ) * ((cvar("r_texture_dds_load") || cvar("gl_texturecompression")) ? 0.4 : 1.0); // TC: normalmaps 50%, other 25%, few incompressible, guessing 40% as conservative average
+ 2500 * pow(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
+ + 1500 * pow(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_world")))
+ ) * ((s3tc && (cvar("r_texture_dds_load") || cvar("gl_texturecompression"))) ? 0.2 : 1.0); // TC: normalmaps 50%, other 25%, few incompressible, guessing 40% as conservative average
}
void XonoticPicmipSlider_autofix(entity me)
{
float max_hard, max_soft;
+ if(cvar("menu_picmip_bypass"))
+ return;
max_hard = cvar("sys_memsize_virtual");
max_soft = cvar("sys_memsize_physical");
if(max_hard > 0)
{
- while(me.value > 0 && texmemsize() > max_hard)
+ while(me.value > 0 && texmemsize(me.have_s3tc) > max_hard)
me.setValue(me, me.value - 1);
}
// TODO also check the soft limit!
+float GL_CheckExtension(string ext)
+{
+ return (strstrofs(strcat(" ", cvar_string("gl_info_extensions"), " "), strcat(" ", ext, " "), 0) >= 0);
+}
+
+float GL_Have_TextureCompression()
+{
+ return (GL_CheckExtension("GL_EXT_texture_compression_s3tc") && GL_CheckExtension("GL_ARB_texture_compression"));
+}
+
float tooltipdb;
void loadTooltips()
{
default: return "";
}
}
+
+float updateCompression()
+{
+ float fh;
+ float have_dds, have_jpg, have_tga;
+ float can_dds;
+ if((have_dds = ((fh = fopen("dds/particles/particlefont.dds", FILE_READ)) >= 0)))
+ fclose(fh);
+ if((have_jpg = ((fh = fopen("particles/particlefont.jpg", FILE_READ)) >= 0)))
+ fclose(fh);
+ if((have_tga = ((fh = fopen("particles/particlefont.tga", FILE_READ)) >= 0)))
+ fclose(fh);
+ can_dds = GL_Have_TextureCompression();
+ if(have_dds && (have_jpg || have_tga))
+ {
+ // both? Let's only use good quality precompressed files
+ // but ONLY if we actually support it!
+ if(can_dds)
+ {
+ cvar_set("gl_texturecompression", "0");
+ return 1;
+ }
+ else
+ {
+ cvar_set("gl_texturecompression", "0");
+ cvar_set("r_texture_dds_load", "0");
+ return 0;
+ }
+ }
+ else if(have_dds)
+ {
+ // DDS only? We probably always want texture compression
+ cvar_set("gl_texturecompression", "1");
+ cvar_set("r_texture_dds_load", "1");
+ if(!can_dds)
+ print("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems.\n");
+ return 0;
+ }
+ else
+ {
+ // TGA only? Allow runtime compression
+ if(can_dds)
+ {
+ cvar_set("gl_texturecompression", cvar_string("r_texture_dds_load"));
+ return 2;
+ }
+ else
+ {
+ cvar_set("gl_texturecompression", "0");
+ cvar_set("r_texture_dds_load", "0");
+ return 0;
+ }
+ }
+}
+float GL_CheckExtension(string ext);
+float GL_Have_TextureCompression();
+
void forAllDescendants(entity root, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass);
void saveAllCvars(entity root);
void loadAllCvars(entity root);
+.float anticheat_jointime;
+
void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight)
{
if(weight == 0)
{
if(time < self.anticheat_div0_evade_offset)
self.anticheat_div0_evade_v_angle = self.v_angle;
- MEAN_ACCUMULATE(anticheat_div0_evade, 1 - (self.anticheat_div0_evade_forward_initial * v_forward), 1);
+ MEAN_ACCUMULATE(anticheat_div0_evade, 0.5 - 0.5 * (self.anticheat_div0_evade_forward_initial * v_forward), 1);
}
- MEAN_ACCUMULATE(anticheat_div0_strafebot_old, movement_oddity(self.movement, self.anticheat_div0_strafebot_movement_prev), max(0, sys_frametime - frametime));
+ MEAN_ACCUMULATE(anticheat_div0_strafebot_old, movement_oddity(self.movement, self.anticheat_div0_strafebot_movement_prev), 1);
self.anticheat_div0_strafebot_movement_prev = self.movement;
if(vlen(self.anticheat_div0_strafebot_forward_prev))
- MEAN_ACCUMULATE(anticheat_div0_strafebot_new, 1 - (self.anticheat_div0_strafebot_forward_prev * v_forward), max(0, sys_frametime - frametime));
+ MEAN_ACCUMULATE(anticheat_div0_strafebot_new, 0.5 - 0.5 * (self.anticheat_div0_strafebot_forward_prev * v_forward), 1);
self.anticheat_div0_strafebot_forward_prev = v_forward;
// generic speedhack detection: correlate anticheat_speedhack_movetime (UPDATED BEFORE THIS) and server time
self.anticheat_speedhack_offset = f;
else
{
- MEAN_ACCUMULATE(anticheat_speedhack, fabs(f - self.anticheat_speedhack_offset), 1);
+ MEAN_ACCUMULATE(anticheat_speedhack, max(0, f - self.anticheat_speedhack_offset), 1);
self.anticheat_speedhack_offset += (f - self.anticheat_speedhack_offset) * frametime * 0.1;
}
self.anticheat_div0_evade_offset = 0;
}
+string anticheat_display(float f, float mi, float ma)
+{
+ string s;
+ s = ftos(f);
+ if(f <= mi)
+ return strcat(s, ":N");
+ if(f >= ma)
+ return strcat(s, ":Y");
+ return strcat(s, ":-");
+}
+
void anticheat_report()
{
if(!autocvar_sv_eventlog)
return;
+ GameLogEcho(strcat(":anticheat:_time:", ftos(self.playerid), ":", ftos(servertime - self.anticheat_jointime)));
GameLogEcho(strcat(":anticheat:speedhack:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_speedhack))));
GameLogEcho(strcat(":anticheat:div0_strafebot_old:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_strafebot_old))));
GameLogEcho(strcat(":anticheat:div0_strafebot_new:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_strafebot_new))));
- GameLogEcho(strcat(":anticheat:div0_evade:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_evade))));
+ GameLogEcho(strcat(":anticheat:div0_evade:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_div0_evade), 0.15, 0.3)));
}
void anticheat_serverframe()
void anticheat_init()
{
self.anticheat_speedhack_offset = 0;
+ self.anticheat_jointime = servertime;
}
void anticheat_shutdown()
}
if(other.assault_sprite)
+ {
WaypointSprite_Disown(other.assault_sprite, waypointsprite_deadlifetime);
+ if(other.classname == "func_assault_destructible")
+ other.sprite = world;
+ }
else
return; // already activated! cannot activate again!
for(ent = world; (ent = find(ent, target, self.targetname)); )
{
if(ent.assault_sprite != world)
+ {
WaypointSprite_Disown(ent.assault_sprite, waypointsprite_deadlifetime);
+ if(ent.classname == "func_assault_destructible")
+ ent.sprite = world;
+ }
spr = WaypointSprite_SpawnFixed("<placeholder>", 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite);
spr.assault_decreaser = self;
spr.classname = "sprite_waypoint";
WaypointSprite_UpdateRule(spr, assault_attacker_team, SPRITERULE_TEAMPLAY);
if(ent.classname == "func_assault_destructible")
+ {
WaypointSprite_UpdateSprites(spr, "as-defend", "as-destroy", "as-destroy");
+ WaypointSprite_UpdateMaxHealth(spr, ent.max_health);
+ WaypointSprite_UpdateHealth(spr, ent.health);
+ ent.sprite = spr;
+ }
else
WaypointSprite_UpdateSprites(spr, "as-defend", "as-push", "as-push");
WaypointSprite_UpdateTeamRadar(spr, RADARICON_OBJECTIVE, '1 0.5 0');
float autocvar_g_balance_armor_rotlinear;
float autocvar_g_balance_armor_rotstable;
float autocvar_g_balance_armor_start;
-float autocvar_g_balance_campingrifle_auto_reload_on_switch;
-float autocvar_g_balance_campingrifle_bursttime;
-float autocvar_g_balance_campingrifle_magazinecapacity;
-float autocvar_g_balance_campingrifle_primary_ammo;
-float autocvar_g_balance_campingrifle_primary_animtime;
-float autocvar_g_balance_campingrifle_primary_bulletconstant;
-float autocvar_g_balance_campingrifle_primary_bullethail;
-float autocvar_g_balance_campingrifle_primary_burstcost;
-float autocvar_g_balance_campingrifle_primary_damage;
-float autocvar_g_balance_campingrifle_primary_force;
-float autocvar_g_balance_campingrifle_primary_headshotaddeddamage;
-float autocvar_g_balance_campingrifle_primary_lifetime;
-float autocvar_g_balance_campingrifle_primary_refire;
-float autocvar_g_balance_campingrifle_primary_speed;
-float autocvar_g_balance_campingrifle_primary_spread;
-float autocvar_g_balance_campingrifle_primary_tracer;
-float autocvar_g_balance_campingrifle_reloadtime;
-float autocvar_g_balance_campingrifle_secondary;
-float autocvar_g_balance_campingrifle_secondary_ammo;
-float autocvar_g_balance_campingrifle_secondary_animtime;
-float autocvar_g_balance_campingrifle_secondary_bulletconstant;
-float autocvar_g_balance_campingrifle_secondary_bullethail;
-float autocvar_g_balance_campingrifle_secondary_burstcost;
-float autocvar_g_balance_campingrifle_secondary_damage;
-float autocvar_g_balance_campingrifle_secondary_force;
-float autocvar_g_balance_campingrifle_secondary_headshotaddeddamage;
-float autocvar_g_balance_campingrifle_secondary_lifetime;
-float autocvar_g_balance_campingrifle_secondary_refire;
-float autocvar_g_balance_campingrifle_secondary_speed;
-float autocvar_g_balance_campingrifle_secondary_spread;
-float autocvar_g_balance_campingrifle_secondary_tracer;
+float autocvar_g_balance_sniperrifle_auto_reload_on_switch;
+float autocvar_g_balance_sniperrifle_bursttime;
+float autocvar_g_balance_sniperrifle_magazinecapacity;
+float autocvar_g_balance_sniperrifle_primary_ammo;
+float autocvar_g_balance_sniperrifle_primary_animtime;
+float autocvar_g_balance_sniperrifle_primary_bulletconstant;
+float autocvar_g_balance_sniperrifle_primary_bullethail;
+float autocvar_g_balance_sniperrifle_primary_burstcost;
+float autocvar_g_balance_sniperrifle_primary_damage;
+float autocvar_g_balance_sniperrifle_primary_force;
+float autocvar_g_balance_sniperrifle_primary_headshotaddeddamage;
+float autocvar_g_balance_sniperrifle_primary_lifetime;
+float autocvar_g_balance_sniperrifle_primary_refire;
+float autocvar_g_balance_sniperrifle_primary_speed;
+float autocvar_g_balance_sniperrifle_primary_spread;
+float autocvar_g_balance_sniperrifle_primary_tracer;
+float autocvar_g_balance_sniperrifle_reloadtime;
+float autocvar_g_balance_sniperrifle_secondary;
+float autocvar_g_balance_sniperrifle_secondary_ammo;
+float autocvar_g_balance_sniperrifle_secondary_animtime;
+float autocvar_g_balance_sniperrifle_secondary_bulletconstant;
+float autocvar_g_balance_sniperrifle_secondary_bullethail;
+float autocvar_g_balance_sniperrifle_secondary_burstcost;
+float autocvar_g_balance_sniperrifle_secondary_damage;
+float autocvar_g_balance_sniperrifle_secondary_force;
+float autocvar_g_balance_sniperrifle_secondary_headshotaddeddamage;
+float autocvar_g_balance_sniperrifle_secondary_lifetime;
+float autocvar_g_balance_sniperrifle_secondary_refire;
+float autocvar_g_balance_sniperrifle_secondary_speed;
+float autocvar_g_balance_sniperrifle_secondary_spread;
+float autocvar_g_balance_sniperrifle_secondary_tracer;
float autocvar_g_balance_cloaked_alpha;
float autocvar_g_balance_crylink_primary_ammo;
float autocvar_g_balance_crylink_primary_animtime;
float autocvar_g_balance_crylink_primary_damage;
float autocvar_g_balance_crylink_primary_edgedamage;
float autocvar_g_balance_crylink_primary_force;
+float autocvar_g_balance_crylink_primary_joindelay;
float autocvar_g_balance_crylink_primary_joinexplode;
float autocvar_g_balance_crylink_primary_joinexplode_damage;
float autocvar_g_balance_crylink_primary_joinexplode_edgedamage;
float autocvar_g_balance_crylink_secondary_damage;
float autocvar_g_balance_crylink_secondary_edgedamage;
float autocvar_g_balance_crylink_secondary_force;
+float autocvar_g_balance_crylink_secondary_joindelay;
float autocvar_g_balance_crylink_secondary_joinexplode;
float autocvar_g_balance_crylink_secondary_joinexplode_damage;
float autocvar_g_balance_crylink_secondary_joinexplode_edgedamage;
float autocvar_g_freezetag_point_leadlimit;
float autocvar_g_freezetag_point_limit;
float autocvar_g_freezetag_revive_extra_size;
-float autocvar_g_freezetag_revive_time;
+float autocvar_g_freezetag_revive_speed;
+float autocvar_g_freezetag_revive_clearspeed;
float autocvar_g_freezetag_warmup;
#define autocvar_g_friendlyfire cvar("g_friendlyfire")
+#define autocvar_g_friendlyfire_virtual cvar("g_friendlyfire_virtual")
float autocvar_g_full_getstatus_responses;
float autocvar_g_fullbrightitems;
float autocvar_g_fullbrightplayers;
float autocvar_g_minstagib_ammo_drop;
float autocvar_g_minstagib_extralives;
float autocvar_g_minstagib_speed_highspeed;
+float autocvar_g_mirrordamage;
#define autocvar_g_mirrordamage cvar("g_mirrordamage")
+#define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual")
float autocvar_g_monster_zombie_attack_run_damage;
float autocvar_g_monster_zombie_attack_run_delay;
float autocvar_g_monster_zombie_attack_run_force;
#define autocvar_utf8_enable cvar("utf8_enable")
float autocvar_waypoint_benchmark;
float autocvar_welcome_message_time;
+float autocvar_sv_gameplayfix_gravityunaffectedbyticrate;
{
f = bot_aimdir(v - shotorg, r);
//dprint("AIM: ");dprint(vtos(self.bot_aimtargorigin));dprint(" + ");dprint(vtos(self.bot_aimtargvelocity));dprint(" * ");dprint(ftos(self.bot_aimlatency + vlen(self.bot_aimtargorigin - shotorg) / shotspeed));dprint(" = ");dprint(vtos(v));dprint(" : aimdir = ");dprint(vtos(normalize(v - shotorg)));dprint(" : ");dprint(vtos(shotdir));dprint("\n");
- traceline(shotorg, shotorg + shotdir * 10000, FALSE, self);
- if (trace_ent.takedamage)
- if (trace_fraction < 1)
- if (!bot_shouldattack(trace_ent))
- return FALSE;
+ //traceline(shotorg, shotorg + shotdir * 10000, FALSE, self);
+ //if (trace_ent.takedamage)
+ //if (trace_fraction < 1)
+ //if (!bot_shouldattack(trace_ent))
+ // return FALSE;
traceline(shotorg, self.bot_aimtargorigin, FALSE, self);
if (trace_fraction < 1)
if (trace_ent != self.enemy)
if (!bot_shouldattack(trace_ent))
return FALSE;
}
- if (r > maxshottime * shotspeed)
- return FALSE;
- return f;
+
+ //if (r > maxshottime * shotspeed)
+ // return FALSE;
+ return TRUE;
};
}
else
{
- self.havocbot_role();
+ if not(self.jumppadcount)
+ self.havocbot_role();
}
// TODO: tracewalk() should take care of this job (better path finding under water)
return;
// Don't jump when using some weapons
+ /*
if(self.aistatus & AI_STATUS_ATTACKING)
- if(self.weapon & WEP_CAMPINGRIFLE)
+ if(self.weapon == WEP_SNIPERRIFLE)
return;
if(self.goalcurrent.classname == "player")
return;
+ */
maxspeed = autocvar_sv_maxspeed;
}
// Release jump button
+ if(!cvar("sv_pogostick"))
if(self.flags & FL_ONGROUND == 0)
{
if(self.velocity_z < 0 || vlen(self.velocity)<maxspeed)
// Handling of jump pads
if(self.jumppadcount)
{
- if(self.flags & FL_ONGROUND)
- {
- self.jumppadcount = FALSE;
- if(self.aistatus & AI_STATUS_OUT_JUMPPAD)
- self.aistatus &~= AI_STATUS_OUT_JUMPPAD;
- }
-
- // If got stuck on the jump pad try to reach the farther visible item
+ // If got stuck on the jump pad try to reach the farthest visible item
if(self.aistatus & AI_STATUS_OUT_JUMPPAD)
{
if(fabs(self.velocity_z)<50)
local float threshold;
threshold = maxspeed * 0.2;
if(fabs(self.velocity_x) < threshold && fabs(self.velocity_y) < threshold)
+ {
+ dprint("Warning: ", self.netname, " got stuck on a jumppad, trying to get out of it now\n");
self.aistatus |= AI_STATUS_OUT_JUMPPAD;
+ }
return;
}
+
+ // Don't chase players while using a jump pad
+ if(self.goalcurrent.classname=="player" || self.goalstack01.classname=="player")
+ return;
}
}
+ else if(self.aistatus & AI_STATUS_OUT_JUMPPAD)
+ self.aistatus &~= AI_STATUS_OUT_JUMPPAD;
// If there is a trigger_hurt right below try to use the jetpack or make a rocketjump
if(skill>6)
// (only when the bot is on the ground or jumping intentionally)
self.aistatus &~= AI_STATUS_DANGER_AHEAD;
- if(trace_fraction == 1)
+ if(trace_fraction == 1 && self.jumppadcount == 0)
if(self.flags & FL_ONGROUND || self.aistatus & AI_STATUS_RUNNING || self.BUTTON_JUMP == TRUE)
{
// Look downwards
// I want to do a second scan if no enemy was found or I don't have weapons
// TODO: Perform the scan when using the rifle (requires changes on the rifle code)
- if(best || self.weapons) // || self.weapon == WEP_CAMPINGRIFLE
+ if(best || self.weapons) // || self.weapon == WEP_SNIPERRIFLE
break;
if(i)
break;
return;
// Workaround for rifle reloading (..)
- if(self.weapon == WEP_CAMPINGRIFLE)
- if(i < autocvar_g_balance_campingrifle_reloadtime + 1)
+ if(self.weapon == WEP_SNIPERRIFLE)
+ if(i < autocvar_g_balance_sniperrifle_reloadtime + 1)
return;
local float w;
- local float rocket ; rocket =-1000;
- local float nex ; nex =-1000;
- local float hagar ; hagar =-1000;
- local float grenade ; grenade =-1000;
- local float mine ; mine =-1000;
- local float electro ; electro =-1000;
- local float crylink ; crylink =-1000;
- local float uzi ; uzi =-1000;
- local float shotgun ; shotgun =-1000;
- local float campingrifle ; campingrifle =-1000;
- local float laser ; laser =-1000;
- local float minstanex ; minstanex =-1000;
- local float bestscore; bestscore = 0;
- local float bestweapon; bestweapon=self.switchweapon;
local float distance; distance=bound(10,vlen(self.origin-self.enemy.origin)-200,10000);
- local float maxdelaytime=0.5;
- local float spreadpenalty=10;
// Should it do a weapon combo?
local float af, ct, combo_time, combo;
{
// LordHavoc: disabled because this is too expensive
return '0 0 0';
- /*
+#if 0
local entity head;
local vector dodge, v, n;
local float danger, bestdanger, vl, d;
head = head.chain;
}
return dodge;
- */
+#endif
};
void havocbot_chooserole()
{
dprint("choosing a role...\n");
- navigation_clearroute();
self.bot_strategytime = 0;
if (g_ctf)
havocbot_chooserole_ctf();
self.navigation_jetpack_goal = world;
navigation_bestrating = -1;
self.navigation_hasgoals = FALSE;
+ navigation_clearroute();
navigation_bestgoal = world;
navigation_markroutes(world);
};
void race_SendRankings(float pos, float prevpos, float del, float msg);
void send_CSQC_teamnagger() {
- WriteByte(0, SVC_TEMPENTITY);
- WriteByte(0, TE_CSQC_TEAMNAGGER);
-}
-
-void send_CSQC_cr_maxbullets(entity e) {
- msg_entity = e;
- WriteByte(MSG_ONE, SVC_TEMPENTITY);
- WriteByte(MSG_ONE, TE_CSQC_CR_MAXBULLETS);
- WriteByte(MSG_ONE, autocvar_g_balance_campingrifle_magazinecapacity);
+ WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
+ WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
}
void Announce(string snd) {
self.frags = FRAGS_SPECTATOR;
}
-float RestrictSkin(float s)
-{
- if(!teams_matter)
- return s;
- if(s == 6)
- return 6;
- return mod(s, 3);
-}
-
void FixPlayermodel()
{
local string defaultmodel;
}
oldskin = self.skinindex;
- self.skinindex = RestrictSkin(stof(self.playerskin));
+ self.skinindex = stof(self.playerskin);
}
if(chmdl || oldskin != self.skinindex)
WriteCoord(MSG_ENTITY, self.ebouncefactor); // g_balance_grenadelauncher_bouncefactor
WriteCoord(MSG_ENTITY, self.ebouncestop); // g_balance_grenadelauncher_bouncestop
WriteByte(MSG_ENTITY, autocvar_g_balance_nex_secondary); // client has to know if it should zoom or not
- WriteByte(MSG_ENTITY, autocvar_g_balance_campingrifle_secondary); // client has to know if it should zoom or not
+ WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_secondary); // client has to know if it should zoom or not
WriteByte(MSG_ENTITY, serverflags); // client has to know if it should zoom or not
+ WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_magazinecapacity); // rifle max bullets
return TRUE;
}
self.killindicator.nextthink = time + (self.lip) * 0.05;
self.killindicator.cnt = ceil(killtime);
self.killindicator.count = bound(0, ceil(killtime), 10);
- sprint(self, strcat("^1You'll be dead in ", ftos(self.killindicator.cnt), " seconds\n"));
+ //sprint(self, strcat("^1You'll be dead in ", ftos(self.killindicator.cnt), " seconds\n"));
for(e = world; (e = find(e, classname, "body")) != world; )
{
else if(autocvar_sv_teamnagger && !(autocvar_bot_vs_human && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
send_CSQC_teamnagger();
- send_CSQC_cr_maxbullets(self);
-
CheatInitClient();
PlayerStats_AddPlayer(self);
}
if(!zoomstate_set)
- SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_CAMPINGRIFLE && autocvar_g_balance_campingrifle_secondary == 0));
+ SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_SNIPERRIFLE && autocvar_g_balance_sniperrifle_secondary == 0));
float oldspectatee_status;
oldspectatee_status = self.spectatee_status;
bot_think();
}
- MUTATOR_CALLHOOK(PlayerPhysics);
-
self.items &~= IT_USING_JETPACK;
if(self.classname == "player")
if (self.movetype == MOVETYPE_NONE)
return;
+ // when we get here, disableclientprediction cannot be 2
+ self.disableclientprediction = 0;
+ if(time < self.ladder_time)
+ self.disableclientprediction = 1;
+
+ MUTATOR_CALLHOOK(PlayerPhysics);
+
maxspd_mod = 1;
swampspd_mod = 1;
// on a spawnfunc_func_ladder or swimming in spawnfunc_func_water
self.flags &~= FL_ONGROUND;
+ float g;
+ g = autocvar_sv_gravity * frametime;
+ if(self.gravity)
+ g *= self.gravity;
+ if(autocvar_sv_gameplayfix_gravityunaffectedbyticrate)
+ {
+ g *= 0.5;
+ self.velocity_z += g;
+ }
+
self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
makevectors(self.v_angle);
//wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
- if (self.gravity)
- self.velocity_z = self.velocity_z + self.gravity * autocvar_sv_gravity * frametime;
- else
- self.velocity_z = self.velocity_z + autocvar_sv_gravity * frametime;
+ self.velocity_z += g;
if (self.ladder_entity.classname == "func_water")
{
f = vlen(wishvel);
float player_getspecies()
{
float s;
- get_model_parameters(self.playermodel, self.skinindex);
+ get_model_parameters(self.model, self.skinindex);
s = get_model_parameters_species;
get_model_parameters(string_null, 0);
if(s < 0)
void ClientKill_Now_TeamChange();
void freezetag_CheckWinner();
-void freezetag_Unfreeze();
void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
frag_target = self;
MUTATOR_CALLHOOK(PlayerDies);
- if(g_freezetag)
- return;
-
if(self.flagcarried)
{
if(attacker.classname != "player" && attacker.classname != "gib")
if(self.ballcarried && g_nexball)
DropBall(self.ballcarried, self.origin, self.velocity);
Portal_ClearAllLater(self);
- // clear waypoints
+
+ if(clienttype(self) == CLIENTTYPE_REAL)
+ {
+ stuffcmd(self, "-zoom\n");
+ self.fixangle = TRUE;
+ //msg_entity = self;
+ //WriteByte (MSG_ONE, SVC_SETANGLE);
+ //WriteAngle (MSG_ONE, self.v_angle_x);
+ //WriteAngle (MSG_ONE, self.v_angle_y);
+ //WriteAngle (MSG_ONE, 80);
+ }
+
+ if(defer_ClientKill_Now_TeamChange) // TODO does this work with FreezeTag?
+ ClientKill_Now_TeamChange();
+
+ if(g_arena)
+ Spawnqueue_Unmark(self);
+
+ if(g_freezetag)
+ return;
+
+ // when we get here, player actually dies
+ // clear waypoints (do this AFTER FreezeTag)
WaypointSprite_PlayerDead();
+
// make the corpse upright (not tilted)
self.angles_x = 0;
self.angles_z = 0;
waves = 0;
sdelay = cvar(strcat("g_", GetGametype(), "_respawn_delay"));
if(!sdelay)
- {
- if(g_cts)
- sdelay = 0; // no respawn delay in CTS
- else
- sdelay = autocvar_g_respawn_delay;
- }
+ {
+ if(g_cts)
+ sdelay = 0; // no respawn delay in CTS
+ else
+ sdelay = autocvar_g_respawn_delay;
+ }
waves = cvar(strcat("g_", GetGametype(), "_respawn_waves"));
if(!waves)
waves = autocvar_g_respawn_waves;
// set up to fade out later
SUB_SetFade (self, time + 6 + random (), 1);
- if(clienttype(self) == CLIENTTYPE_REAL)
- {
- self.fixangle = TRUE;
- //msg_entity = self;
- //WriteByte (MSG_ONE, SVC_SETANGLE);
- //WriteAngle (MSG_ONE, self.v_angle_x);
- //WriteAngle (MSG_ONE, self.v_angle_y);
- //WriteAngle (MSG_ONE, 80);
- }
-
- if(g_arena)
- Spawnqueue_Unmark(self);
-
- if(defer_ClientKill_Now_TeamChange)
- ClientKill_Now_TeamChange();
-
if(sv_gentle > 0 || autocvar_ekg) {
// remove corpse
PlayerCorpseDamage (inflictor, attacker, 100.0, deathtype, hitloc, force);
}
// reset fields the weapons may use just in case
- for (j = WEP_FIRST; j <= WEP_LAST; ++j)
+ for (j = WEP_FIRST; j <= WEP_LAST; ++j)
{
- weapon_action(j, WR_RESETPLAYER);
+ weapon_action(j, WR_RESETPLAYER);
ATTACK_FINISHED_FOR(self, j) = 0;
}
}
#undef _VOICEMSG
}
-void LoadPlayerSounds(string f, float first)
+float LoadPlayerSounds(string f, float first)
{
float fh;
string s;
if(fh < 0)
{
dprint("Player sound file not found: ", f, "\n");
- return;
+ return 0;
}
while((s = fgets(fh)))
{
self.field = strzone(strcat(argv(1), " ", argv(2)));
}
fclose(fh);
+ return 1;
}
.float modelindex_for_playersound;
self.skinindex_for_playersound = self.skinindex;
ClearPlayerSounds();
LoadPlayerSounds("sound/player/default.sounds", 1);
- LoadPlayerSounds(get_model_datafilename(self.playermodel, self.skinindex, "sounds"), 0);
+ if(!LoadPlayerSounds(get_model_datafilename(self.model, self.skinindex, "sounds"), 0))
+ LoadPlayerSounds(get_model_datafilename(self.model, 0, "sounds"), 0);
}
void FakeGlobalSound(string sample, float chan, float voicetype)
local float oldsolid;
vector vecs, dv;
oldsolid = ent.dphitcontentsmask;
- if(ent.weapon == WEP_CAMPINGRIFLE)
+ if(ent.weapon == WEP_SNIPERRIFLE)
ent.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
else
ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
if not(self.flags & FL_CLIENT)
return;
- if((inWarmupStage && 0 >= g_warmup_limit) // with unlimited warmup players have to be able to restart
+ if((inWarmupStage)
|| autocvar_sv_ready_restart || g_race_qualifying == 2)
{
if(!readyrestart_happened || autocvar_sv_ready_restart_repeatable)
float client_cefc_accumulatortime;
#endif
-.float campingrifle_bulletcounter;
+.float sniperrifle_bulletcounter;
#define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
// when doing this, hagar can go through clones
.float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
.float freezetag_frozen;
-.float freezetag_beginrevive_time;
.float freezetag_revive_progress;
+
+.entity muzzle_flash;
+.float misc_bulletcounter; // replaces uzi & hlac bullet counter.
void func_breakable_behave_restore()
{
self.health = self.max_health;
+ if(self.sprite)
+ {
+ WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
+ WaypointSprite_UpdateHealth(self.sprite, self.health);
+ }
self.takedamage = DAMAGE_AIM;
self.event_damage = func_breakable_damage;
self.state = 0;
if(self.team)
if(attacker.team == self.team)
return;
+ self.health = self.health - damage;
if(self.sprite)
+ {
WaypointSprite_Ping(self.sprite);
- self.health = self.health - damage;
+ WaypointSprite_UpdateHealth(self.sprite, self.health);
+ }
func_breakable_colormod();
if(self.health <= 0)
// NOTE: f=0 means still count as a (positive) kill, but count no frags for it
void W_SwitchWeapon_Force(entity e, float w);
-void GiveFrags (entity attacker, entity targ, float f)
+void GiveFrags (entity attacker, entity targ, float f, float deathtype)
{
float w;
if(targ != attacker) // not for suicides
if(g_weaponarena_random)
{
- // after a frag, choose another random weapon set
- if(inWarmupStage)
- w = warmup_start_weapons;
- else
- w = start_weapons;
+ // after a frag, exchange the current weapon (or the culprit, if detectable) by a new random weapon
+ float culprit;
+ culprit = DEATH_WEAPONOF(deathtype);
+ if(!culprit || !(attacker.weapons & W_WeaponBit(culprit)))
+ culprit = attacker.weapon;
- attacker.weapons = randombits(w - (w & W_WeaponBit(attacker.weapon)), g_weaponarena_random, TRUE);
- if(attacker.weapons < 0)
+ if(g_weaponarena_random_with_laser && culprit == WEPBIT_LASER)
{
- // error from randombits: no weapon available
- // this means we can just give ALL weapons
- attacker.weapons = w;
+ // no exchange
}
+ else
+ {
+ if(inWarmupStage)
+ w = warmup_start_weapons;
+ else
+ w = start_weapons;
+
+ // all others (including the culprit): remove
+ w &~= attacker.weapons;
+
+ // among the remaining ones, choose one by random
+ w = randombits(w, 1, FALSE);
+ if(w)
+ {
+ attacker.weapons |= w;
+ attacker.weapons &~= W_WeaponBit(culprit);
+ }
+ }
+
+ // after a frag, choose another random weapon set
if not(attacker.weapons & W_WeaponBit(attacker.weapon))
W_SwitchWeapon_Force(attacker, w_getbestweapon(attacker));
}
if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
{
LogDeath("suicide", deathtype, targ, targ);
- GiveFrags(attacker, targ, -1);
+ GiveFrags(attacker, targ, -1, deathtype);
}
if (targ.killcount > 2)
else
type = KILL_TEAM_BLUE;
- GiveFrags(attacker, targ, -1);
+ GiveFrags(attacker, targ, -1, deathtype);
Send_CSQC_Centerprint(attacker, s, "", type, MSG_KILL);
{
UpdateFrags(attacker, ctf_score_value("score_kill"));
PlayerScore_Add(attacker, SP_CTF_FCKILLS, 1);
- GiveFrags(attacker, targ, 0); // for logging
+ GiveFrags(attacker, targ, 0, deathtype); // for logging
}
else
- GiveFrags(attacker, targ, 1);
+ GiveFrags(attacker, targ, 1, deathtype);
if (targ.killcount > 2) {
Send_KillNotification(s, ftos(targ.killcount), a, KILL_END_SPREE, MSG_SPREE);
if(strstrofs(msg, "%", 0) < 0)
msg = strcat("%s ", msg);
- GiveFrags(targ, targ, -1);
+ GiveFrags(targ, targ, -1, deathtype);
if(PlayerScore_Add(targ, SP_SCORE, 0) == -5) {
AnnounceTo(targ, "botlike");
}
else
damage = autocvar_g_friendlyfire * damage;
// mirrordamage will be used LATER
+
+ if(autocvar_g_mirrordamage_virtual)
+ {
+ vector v;
+ v = healtharmor_applydamage(attacker.armorvalue, autocvar_g_balance_armor_blockpercent, mirrordamage);
+ attacker.dmg_take += v_x;
+ attacker.dmg_save += v_y;
+ attacker.dmg_inflictor = inflictor;
+ mirrordamage = 0;
+ mirrorforce = 0;
+ }
+
+ if(autocvar_g_friendlyfire_virtual)
+ {
+ vector v;
+ v = healtharmor_applydamage(targ.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
+ targ.dmg_take += v_x;
+ targ.dmg_save += v_y;
+ targ.dmg_inflictor = inflictor;
+ damage = 0;
+ force = '0 0 0';
+ }
}
else
damage = 0;
if (DEATH_ISWEAPON(deathtype, WEP_LASER))
{
damage = 0;
+ mirrordamage = 0;
if (targ != attacker)
{
if ((targ.health >= 1) && (targ.classname == "player"))
centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "Secondary fire inflicts no damage!"));
- damage = 0;
- mirrordamage = 0;
force = '0 0 0';
// keep mirrorforce
attacker = targ;
{
if(damage > 0)
{
- if(attacker.weapon != WEP_ELECTRO && attacker.weapon != WEP_LASER || ((attacker.weapon == WEP_ELECTRO && autocvar_g_balance_electro_lightning || attacker.weapon == WEP_LASER) && attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time))
+ if(attacker.weapon != WEP_LASER
+ && (attacker.weapon != WEP_ELECTRO || !autocvar_g_balance_electro_lightning)
+ && attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
{
if(targ.BUTTON_CHAT)
attacker.typehitsound += 1;
}
else
{
- if(deathtype != DEATH_FIRE)
+ if(deathtype != DEATH_FIRE
+ && attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
+ {
attacker.typehitsound += 1;
+ attacker.prevhitsound = time;
+ }
if(mirrordamage > 0)
if(time > attacker.teamkill_complain)
{
{
attacker = attacker_save;
if(g_minstagib)
- if(mirrordamage > 0)
+ if(mirrordamage > 0)
+ {
+ // just lose extra LIVES, don't kill the player for mirror damage
+ if(attacker.armorvalue > 0)
{
- // just lose extra LIVES, don't kill the player for mirror damage
- if(attacker.armorvalue > 0)
- {
- attacker.armorvalue = attacker.armorvalue - 1;
- centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "^3Remaining extra lives: ",ftos(attacker.armorvalue)));
- attacker.hitsound += 1;
- }
- mirrordamage = 0;
+ attacker.armorvalue = attacker.armorvalue - 1;
+ centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "^3Remaining extra lives: ",ftos(attacker.armorvalue)));
+ attacker.hitsound += 1;
}
+ mirrordamage = 0;
+ }
+
force = normalize(attacker.origin + attacker.view_ofs - hitloc) * mirrorforce;
Damage(attacker, inflictor, attacker, mirrordamage, DEATH_MIRRORDAMAGE, attacker.origin, force);
}
if((arena_roundbased && time < warmup) || (time < game_starttime))
return;
+ if(g_freezetag && self.freezetag_frozen)
+ return;
+
makevectors(self.v_angle);
s = self.cvar_cl_gunalign;
//missile.glow_size = 120;
missile.touch = GrapplingHookTouch;
missile.think = GrapplingHookThink;
- missile.nextthink = time + 0.1;
+ missile.nextthink = time;
missile.effects = /*EF_FULLBRIGHT | EF_ADDITIVE |*/ EF_LOWPRECISION;
SetCustomizer(self, LOD_customize, LOD_uncustomize);
}
+void ApplyMinMaxScaleAngles(entity e)
+{
+ if(e.angles_x != 0 || e.angles_z != 0 || self.avelocity_x != 0 || self.avelocity_z != 0) // "weird" rotation
+ {
+ e.maxs = '1 1 1' * vlen(
+ '1 0 0' * max(-e.mins_x, e.maxs_x) +
+ '0 1 0' * max(-e.mins_y, e.maxs_y) +
+ '0 0 1' * max(-e.mins_z, e.maxs_z)
+ );
+ e.mins = -e.maxs;
+ }
+ else if(e.angles_y != 0 || self.avelocity_y != 0) // yaw only is a bit better
+ {
+ e.maxs_x = vlen(
+ '1 0 0' * max(-e.mins_x, e.maxs_x) +
+ '0 1 0' * max(-e.mins_y, e.maxs_y)
+ );
+ e.maxs_y = e.maxs_x;
+ e.mins_x = -e.maxs_x;
+ e.mins_y = -e.maxs_x;
+ }
+ if(e.scale)
+ setsize(e, e.mins * e.scale, e.maxs * e.scale);
+ else
+ setsize(e, e.mins, e.maxs);
+}
+
void SetBrushEntityModel()
{
if(self.model != "")
InitializeEntity(self, LODmodel_attach, INITPRIO_FINDTARGET);
}
setorigin(self, self.origin);
- if(self.scale)
- setsize(self, self.mins * self.scale, self.maxs * self.scale);
- else
- setsize(self, self.mins, self.maxs);
+ ApplyMinMaxScaleAngles(self);
}
void SetBrushEntityModelNoLOD()
setmodel(self, self.model); // no precision needed
}
setorigin(self, self.origin);
- if(self.scale)
- setsize(self, self.mins * self.scale, self.maxs * self.scale);
- else
- setsize(self, self.mins, self.maxs);
+ ApplyMinMaxScaleAngles(self);
}
/*
BADPREFIX("gl_");
BADPREFIX("joy");
BADPREFIX("hud_");
+ BADPREFIX("m_");
BADPREFIX("menu_");
BADPREFIX("net_slist_");
BADPREFIX("r_");
BADPREFIX("sbar_");
BADPREFIX("scr_");
BADPREFIX("snd_");
+ BADPREFIX("show");
+ BADPREFIX("sensitivity");
BADPREFIX("userbind");
BADPREFIX("v_");
BADPREFIX("vid_");
BADCVAR("g_ctf");
BADCVAR("g_dm");
BADCVAR("g_domination");
+ BADCVAR("g_freezetag");
BADCVAR("g_keyhunt");
BADCVAR("g_keyhunt_teams");
BADCVAR("g_onslaught");
// does nothing visible
BADCVAR("captureleadlimit_override");
BADCVAR("g_arena_point_leadlimit");
+ BADCVAR("g_balance_kill_delay");
BADCVAR("g_ca_point_leadlimit");
+ BADCVAR("g_ctf_captimerecord_always");
BADCVAR("g_ctf_capture_leadlimit");
+ BADCVAR("g_ctf_flag_capture_effects");
+ BADCVAR("g_ctf_flag_glowtrails");
+ BADCVAR("g_ctf_flag_pickup_effects");
BADCVAR("g_domination_point_leadlimit");
+ BADCVAR("g_forced_respawn");
BADCVAR("g_keyhunt_point_leadlimit");
BADCVAR("g_nexball_goalleadlimit");
BADCVAR("g_runematch_point_leadlimit");
BADCVAR("leadlimit_and_fraglimit");
BADCVAR("leadlimit_override");
+ BADCVAR("pausable");
BADCVAR("sv_checkforpacketsduringsleep");
+ BADCVAR("sv_timeout");
+ BADCVAR("welcome_message_time");
BADPREFIX("crypto_");
BADPREFIX("g_chat_");
+ BADPREFIX("g_ctf_captimerecord_");
+ BADPREFIX("g_maplist_votable_");
BADPREFIX("net_");
BADPREFIX("prvm_");
+ BADPREFIX("skill_");
BADPREFIX("sv_fragmessage_");
+ BADPREFIX("sv_maxidle_");
BADPREFIX("sv_vote_");
BADPREFIX("timelimit_");
BADCVAR("sv_vote_master_password");
BADCVAR("sv_vote_simple_majority_factor");
BADCVAR("timelimit_override");
+ BADCVAR("g_warmup");
+ BADPREFIX("g_warmup_");
+ BADCVAR("teamplay_mode");
if(autocvar_g_minstagib)
{
addstat(STAT_FUEL, AS_INT, ammo_fuel);
addstat(STAT_SHOTORG, AS_INT, stat_shotorg);
addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
- addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter);
+ addstat(STAT_BULLETS_LOADED, AS_INT, sniperrifle_bulletcounter);
addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
g_weaponarena = 0;
s = cvar_string("g_weaponarena");
- if (s == "0")
+ if (s == "0" || s == "")
{
+ if(g_lms || g_ca)
+ s = "most";
+ }
+
+ if (s == "off")
+ {
+ // forcibly turn off weaponarena
}
else if (s == "all")
{
if (g_weaponarena)
{
start_weapons = g_weaponarena;
+ if(!(g_lms || g_ca))
+ start_items |= IT_UNLIMITED_AMMO;
+ }
+ else if (g_minstagib)
+ {
+ start_health = 100;
+ start_armorvalue = 0;
+ start_weapons = WEPBIT_MINSTANEX;
+ weapon_action(WEP_MINSTANEX, WR_PRECACHE);
+ g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
+
+ if (g_minstagib_invis_alpha <= 0)
+ g_minstagib_invis_alpha = -1;
+ }
+ else
+ {
+ for (i = WEP_FIRST; i <= WEP_LAST; ++i)
+ {
+ e = get_weaponinfo(i);
+ if(want_weapon("g_start_weapon_", e, FALSE))
+ start_weapons |= e.weapons;
+ }
+ }
+
+ if(!cvar("g_use_ammunition"))
+ start_items |= IT_UNLIMITED_AMMO;
+
+ if(g_minstagib)
+ {
+ start_ammo_cells = cvar("g_minstagib_ammo_start");
+ start_ammo_fuel = cvar("g_start_ammo_fuel");
+ }
+ else if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+ {
for (j = WEP_FIRST; j <= WEP_LAST; ++j)
{
e = get_weaponinfo(j);
start_ammo_fuel = 999;
}
}
- start_items |= IT_UNLIMITED_AMMO;
- }
- else if (g_minstagib)
- {
- start_health = 100;
- start_armorvalue = 0;
- start_weapons = WEPBIT_MINSTANEX;
- weapon_action(WEP_MINSTANEX, WR_PRECACHE);
- start_ammo_cells = cvar("g_minstagib_ammo_start");
- g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
- start_ammo_fuel = cvar("g_start_ammo_fuel");
-
- if (g_minstagib_invis_alpha <= 0)
- g_minstagib_invis_alpha = -1;
}
else
{
- if (g_lms || g_ca)
+ if(g_lms || g_ca)
{
start_ammo_shells = cvar("g_lms_start_ammo_shells");
start_ammo_nails = cvar("g_lms_start_ammo_nails");
start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
start_ammo_cells = cvar("g_lms_start_ammo_cells");
start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
- start_health = cvar("g_lms_start_health");
- start_armorvalue = cvar("g_lms_start_armor");
}
else
{
start_ammo_cells = cvar("g_start_ammo_cells");
start_ammo_fuel = cvar("g_start_ammo_fuel");
}
+ }
- for (i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- e = get_weaponinfo(i);
- if(want_weapon("g_start_weapon_", e, FALSE))
- start_weapons |= e.weapons;
- }
+ if (g_lms || g_ca)
+ {
+ start_health = cvar("g_lms_start_health");
+ start_armorvalue = cvar("g_lms_start_armor");
}
if (inWarmupStage)
warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
}
- if(!cvar("g_use_ammunition"))
- {
- start_ammo_shells = cvar("g_pickup_shells_max");
- start_ammo_nails = cvar("g_pickup_nails_max");
- start_ammo_rockets = cvar("g_pickup_rockets_max");
- start_ammo_cells = cvar("g_pickup_cells_max");
- start_ammo_fuel = cvar("g_pickup_fuel_max");
- start_items |= IT_UNLIMITED_AMMO;
- warmup_start_ammo_shells = cvar("g_pickup_shells_max");
- warmup_start_ammo_nails = cvar("g_pickup_nails_max");
- warmup_start_ammo_rockets = cvar("g_pickup_rockets_max");
- warmup_start_ammo_cells = cvar("g_pickup_cells_max");
- warmup_start_ammo_fuel = cvar("g_pickup_fuel_max");
- //warmup_start_items |= IT_UNLIMITED_AMMO;
- }
-
if (g_jetpack)
start_items |= IT_JETPACK;
// rule 6: we must not end up in trigger_hurt
if (tracebox_hits_trigger_hurt(start, e.mins, e.maxs, enddown))
- {
- dprint("trigger_hurt! ouch! and nothing else could find it!\n");
continue;
- }
break;
}
// checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
// return error to request removal
+MUTATOR_HOOKABLE(TurretSpawn);
+ // return error to request removal
+ // INPUT: self - turret
+
MUTATOR_HOOKABLE(OnEntityPreSpawn);
// return error to prevent entity spawn, or modify the entity
{
precache_model("models/ice/ice.md3");
warmup = time + autocvar_g_start_delay + autocvar_g_freezetag_warmup;
+ ScoreRules_freezetag();
}
void freezetag_CheckWinner()
entity e, winner;
string teamname;
+ winner = world;
FOR_EACH_PLAYER(e)
{
if(winner != world) // just in case a winner wasn't found
{
- TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
if(winner.team == COLOR_TEAM1)
teamname = "^1Red Team";
else if(winner.team == COLOR_TEAM2)
centerprint(e, strcat(teamname, "^5 wins the round, all other teams were frozen.\n"));
}
bprint(teamname, "^5 wins the round since all the other teams were frozen.\n");
+ TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
}
next_round = time + 5;
}
+// this is needed to allow the player to turn his view around (fixangle can't
+// be used to freeze his view, as that also changes the angles), while not
+// turning that ice object with the player
void freezetag_Ice_Think()
{
setorigin(self, self.owner.origin - '0 0 16');
self.nextthink = time;
}
-void freezetag_Freeze()
+void freezetag_Freeze(entity attacker)
{
+ if(self.freezetag_frozen)
+ return;
self.freezetag_frozen = 1;
+ self.freezetag_revive_progress = 0;
entity ice;
ice = spawn();
ice.frame = floor(random() * 21); // ice model has 20 different looking frames
setmodel(ice, "models/ice/ice.md3");
- self.movement = '0 0 0';
+ entity oldself;
+ oldself = self;
+ self = ice;
+ freezetag_Ice_Think();
+ self = oldself;
// add waypoint
WaypointSprite_Spawn("freezetag_frozen", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attached, TRUE);
{
WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_WAYPOINT, '0.25 0.90 1');
}
+
+ if(attacker == self)
+ {
+ // you froze your own dumb self
+ // counted as "suicide" already
+ PlayerScore_Add(self, SP_SCORE, -1);
+ }
+ else if(attacker.classname == "player")
+ {
+ // got frozen by an enemy
+ // counted as "kill" and "death" already
+ PlayerScore_Add(self, SP_SCORE, -1);
+ PlayerScore_Add(attacker, SP_SCORE, +1);
+ }
+ else
+ {
+ // nothing - got frozen by the game type rules themselves
+ }
}
-void freezetag_Unfreeze()
+void freezetag_Unfreeze(entity attacker)
{
self.freezetag_frozen = 0;
+ self.freezetag_revive_progress = 0;
// remove the ice block
entity ice;
if(totalspawned > 2) // only check for winners if we had more than two players (one of them left, don't let the other player win just because of that)
freezetag_CheckWinner();
- freezetag_Unfreeze();
+ freezetag_Unfreeze(world);
return 1;
}
--pinkalive;
--totalalive;
- freezetag_Freeze();
+ freezetag_Freeze(frag_attacker);
}
if(frag_attacker.classname == STR_PLAYER)
MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
{
- freezetag_Unfreeze(); // start by making sure that all ice blocks are removed
+ freezetag_Unfreeze(world); // start by making sure that all ice blocks are removed
if(totalspawned == 1 && time > game_starttime) // only one player active on server, start a new match immediately
if(!next_round && warmup && (time < warmup - autocvar_g_freezetag_warmup || time > warmup)) // not awaiting next round
if(warmup && time > warmup) // spawn too late, freeze player
{
centerprint(self, "^1You spawned after the round started, you'll spawn as frozen.\n");
- freezetag_Freeze();
+ freezetag_Freeze(world);
}
return 1;
MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
{
- vector revive_extra_size;
- revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
+ float n;
+ vector revive_extra_size;
- float teammate_nearby;
- FOR_EACH_PLAYER(other) if(self != other)
- {
- if(other.freezetag_frozen == 0)
- {
- if(other.team == self.team)
- {
- teammate_nearby = boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax);
- if(teammate_nearby)
- break;
- }
- }
- }
+ revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
- if(teammate_nearby && self.freezetag_frozen == 1) // OK, there is at least one teammate reviving us
- {
- if(self.freezetag_beginrevive_time == -9999) // initialize values if this is the first frame of revival
- {
- self.freezetag_beginrevive_time = time;
- self.freezetag_revive_progress = 0;
- }
- else
- {
- self.freezetag_revive_progress = (time - self.freezetag_beginrevive_time) / autocvar_g_freezetag_revive_time;
- if(time - self.freezetag_beginrevive_time >= autocvar_g_freezetag_revive_time)
- {
- freezetag_Unfreeze();
-
- centerprint(self, strcat("^5You were revived by ^7", other.netname, ".\n"));
- centerprint(other, strcat("^5You revived ^7", self.netname, ".\n"));
- bprint("^7", other.netname, "^5 revived ^7", self.netname, ".\n");
-
- self.freezetag_beginrevive_time = -9999;
- self.freezetag_revive_progress = 0;
- }
- }
- // now find EVERY teammate within reviving radius, set their revive_progress values correct
- FOR_EACH_PLAYER(other) if(self != other)
- {
- if(other.freezetag_frozen == 0)
- {
- if(other.team == self.team)
- {
- teammate_nearby = boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax);
- if(teammate_nearby)
- other.freezetag_revive_progress = self.freezetag_revive_progress;
- }
- }
- }
- }
- else if(!teammate_nearby) // only if no teammate is nearby will we reset
- {
- self.freezetag_beginrevive_time = -9999;
- self.freezetag_revive_progress = 0;
- }
+ entity o;
+ o = world;
+ n = 0;
+ FOR_EACH_PLAYER(other) if(self != other)
+ {
+ if(other.freezetag_frozen == 0)
+ {
+ if(other.team == self.team)
+ {
+ if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax))
+ {
+ if(!o)
+ o = other;
+ ++n;
+ }
+ }
+ }
+ }
+
+ if(n && self.freezetag_frozen) // OK, there is at least one teammate reviving us
+ {
+ self.freezetag_revive_progress = bound(0, self.freezetag_revive_progress + frametime * autocvar_g_freezetag_revive_speed, 1);
+
+ if(self.freezetag_revive_progress >= 1)
+ {
+ freezetag_Unfreeze(self);
+
+ // EVERY team mate nearby gets a point (even if multiple!)
+ FOR_EACH_PLAYER(other) if(self != other)
+ {
+ if(other.freezetag_frozen == 0)
+ {
+ if(other.team == self.team)
+ {
+ if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax))
+ {
+ PlayerScore_Add(other, SP_FREEZETAG_REVIVALS, +1);
+ PlayerScore_Add(other, SP_SCORE, +1);
+ }
+ }
+ }
+ }
+
+ if(n > 1)
+ centerprint(self, strcat("^5You were revived by ^7", o.netname, "^5 et al.\n"));
+ else
+ centerprint(self, strcat("^5You were revived by ^7", o.netname, "^5.\n"));
+ centerprint(o, strcat("^5You revived ^7", self.netname, "^5.\n"));
+ if(n > 1)
+ bprint("^7", o.netname, "^5 et al revived ^7", self.netname, "^5.\n");
+ else
+ bprint("^7", o.netname, "^5 revived ^7", self.netname, "^5.\n");
+ }
+
+ // now find EVERY teammate within reviving radius, set their revive_progress values correct
+ FOR_EACH_PLAYER(other) if(self != other)
+ {
+ if(other.freezetag_frozen == 0)
+ {
+ if(other.team == self.team)
+ {
+ if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax))
+ other.freezetag_revive_progress = self.freezetag_revive_progress;
+ }
+ }
+ }
+ }
+ else if(!n && self.freezetag_frozen) // only if no teammate is nearby will we reset
+ {
+ self.freezetag_revive_progress = bound(0, self.freezetag_revive_progress - frametime * autocvar_g_freezetag_revive_clearspeed, 1);
+ }
+ else if(!n)
+ {
+ self.freezetag_revive_progress = 0; // thawing nobody
+ }
return 1;
}
MUTATOR_HOOKFUNCTION(freezetag_PlayerPhysics)
{
if(self.freezetag_frozen)
+ {
self.movement = '0 0 0';
+ self.disableclientprediction = 1;
+ }
return 1;
}
playerstats_waitforme = TRUE;
}
+//#NO AUTOCVARS START
void PlayerStats_Shutdown()
{
string p, pn;
bufstr_set(b, i++, sprintf("T %s.%06d", strftime(FALSE, "%s"), floor(random() * 1000000)));
bufstr_set(b, i++, sprintf("G %s", GetGametype()));
bufstr_set(b, i++, sprintf("M %s", GetMapname()));
+ bufstr_set(b, i++, sprintf("S %s", cvar_string("hostname")));
+ bufstr_set(b, i++, sprintf("C %d", cvar_purechanges_count));
for(p = playerstats_last; (pn = db_get(playerstats_db, sprintf("%s:*", p))) != ""; p = pn)
{
bufstr_set(b, i++, sprintf("P %s", p));
db_close(playerstats_db);
playerstats_db = -1;
}
+//#NO AUTOCVARS END
void PlayerStats_AddGlobalInfo(entity p)
{
}
void ScoreRules_generic()
{
- CheckAllowedTeams(world);
if(teams_matter)
{
CheckAllowedTeams(world);
ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_DROPS, "drops", SFL_LOWER_IS_BETTER);
ScoreRules_basics_end();
}
+
+// FreezeTag stuff
+#define SP_FREEZETAG_REVIVALS 4
+void ScoreRules_freezetag()
+{
+ CheckAllowedTeams(world);
+ ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY
+ ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS, "revivals", 0);
+ ScoreRules_basics_end();
+}
void trigger_push_touch()
{
- if (self.active == ACTIVE_NOT)
- return;
-
+ if (self.active == ACTIVE_NOT)
+ return;
+
// FIXME: add a .float for whether an entity should be tossed by jumppads
if (!other.iscreature)
if (other.classname != "corpse")
}
local float ct;
ct = clienttype(other);
- if( ct == CLIENTTYPE_REAL)
+ if( ct == CLIENTTYPE_REAL || ct == CLIENTTYPE_BOT)
{
local float i;
local float found;
other.jumppadcount = other.jumppadcount + 1;
}
- if(self.message)
- centerprint(other, self.message);
+ if(ct == CLIENTTYPE_REAL)
+ {
+ if(self.message)
+ centerprint(other, self.message);
+ }
+ else
+ other.lastteleporttime = time;
}
- else if(ct == CLIENTTYPE_BOT)
- other.lastteleporttime = time;
else
other.jumppadcount = TRUE;
SetMovedir ();
EXACTTRIGGER_INIT;
-
- self.active = ACTIVE_ACTIVE;
+
+ self.active = ACTIVE_ACTIVE;
self.use = trigger_push_use;
self.touch = trigger_push_touch;
self.blocked = generic_plat_blocked;
+ self.avelocity_z = 0.0000001;
if not(InitMovingBrushTrigger())
return;
self.angles = '0 0 0';
self.max_health = self.health;
+ self.avelocity = self.movedir;
if not(InitMovingBrushTrigger())
return;
+ self.velocity = '0 0 0';
//self.effects |= EF_LOWPRECISION;
self.classname = "door_rotating";
void spawnfunc_ammo_cells() { spawnfunc_item_rockets(); }
// Rail -> Rifle
-void spawnfunc_weapon_railgun() { spawnfunc_weapon_campingrifle(); }
+void spawnfunc_weapon_railgun() { spawnfunc_weapon_sniperrifle(); }
void spawnfunc_ammo_slugs() { spawnfunc_item_bullets(); }
// BFG -> Crylink
vector turret_stdproc_aim_generic()
{
- vector pre_pos,prep;
- float distance,impact_time,i,mintime;
+ vector pre_pos, prep;
+ float distance, impact_time, i, mintime;
turret_tag_fire_update();
if(self.aim_flags & TFL_AIM_SIMPLE)
return real_origin(self.enemy);
- mintime = max(self.attack_finished_single - time,0) + sys_frametime ;
+ mintime = max(self.attack_finished_single - time,0) + sys_frametime;
// Baseline
pre_pos = real_origin(self.enemy);
// thorw head slightly off aim when hit?
if (self.damage_flags & TFL_DMG_HEADSHAKE)
{
- //baseent.tur_aimoff_x += (random() * damage);
- //baseent.tur_aimoff_y += ((random()*0.75) * damage);
self.tur_head.angles_x = self.tur_head.angles_x + (-0.5 + random()) * damage;
self.tur_head.angles_y = self.tur_head.angles_y + (-0.5 + random()) * damage;
}
if (self.turrcaps_flags & TFL_TURRCAPS_MOVE)
self.velocity = self.velocity + vforce;
- // FIXME: Better damage feedback
- // Start burning when we have 10% or less health left
- //if (self.health < (self.tur_health * 0.1))
- // self.effects = EF_FLAME;
-
+ // FIXME: Better damage feedback?
+
if (self.health <= 0)
{
self.event_damage = SUB_Null;
if (self.ammo < self.ammo_max)
self.ammo = min(self.ammo + self.ammo_recharge, self.ammo_max);
+ if (self.health < (self.tur_health * 0.5))
+ if(random() < 0.25)
+ te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
+
// Inactive turrets needs to run the think loop,
// So they can handle animation and wake up if need be.
if not (self.tur_active)
{
e = spawn();
+ /*
setorigin(e,'0 0 0');
setmodel(e,"models/turrets/plasma.md3");
vector v;
//crash();
}
setmodel(e,"");
+ */
e.classname = "turret_manager";
e.think = turrets_manager_think;
// Offsets & origins
if (!self.tur_shotorg) self.tur_shotorg = '50 0 50';
+// Gane hooks
+ if(MUTATOR_CALLHOOK(TurretSpawn))
+ return 0;
+
// End of default & sanety checks, start building the turret.
// Spawn extra bits
activator = ee;
self.use();
}
-
+
turret_stdproc_respawn();
return 1;
}
void turret_fusionreactor_dinit();
void turret_fusionreactor_fire();
-float turret_fusionreactor_firecheck()
-{
- if (self.enemy == world) return 0;
- if not (self.enemy.ammo_flags & TFL_AMMO_RECIVE) return 0;
- if not (self.enemy.ammo_flags & TFL_AMMO_ENERGY) return 0;
- if (self.ammo < self.shot_dmg) return 0;
- if (self.enemy.ammo >= self.enemy.ammo_max) return 0;
- if (self.tur_dist_aimpos > self.target_range) return 0;
- if (self.tur_dist_aimpos < self.target_range_min) return 0;
-
- return 1;
-}
-
void turret_fusionreactor_fire()
{
vector fl_org;
self.enemy.ammo = min(self.enemy.ammo + self.shot_dmg,self.enemy.ammo_max);
fl_org = 0.5 * (self.enemy.absmin + self.enemy.absmax);
te_smallflash(fl_org);
- //te_lightning1(world,self.origin,self.enemy.origin);
}
void turret_fusionreactor_postthink()
{
- float f;
- f = self.ammo / self.ammo_max;
- self.tur_head.avelocity = '0 250 0' * f;
+ self.tur_head.avelocity = '0 250 0' * (self.ammo / self.ammo_max);
}
+/*
void turret_fusionreactor_respawnhook()
{
self.tur_head.avelocity = '0 50 0';
}
+*/
+
+/**
+** Preforms pre-fire checks for fusionreactor
+**/
+float turret_fusionreactor_firecheck()
+{
+ if (self.attack_finished_single > time)
+ return 0;
+
+ if (self.enemy.deadflag != DEAD_NO)
+ return 0;
+
+ if (self.enemy == world)
+ return 0;
+
+ if (self.ammo < self.shot_dmg)
+ return 0;
+
+ if (self.enemy.ammo >= self.enemy.ammo_max)
+ return 0;
+
+ if (vlen(self.enemy.origin - self.origin) > self.target_range)
+ return 0;
+
+ if(self.team != self.enemy.team)
+ return 0;
+
+ if not (self.enemy.ammo_flags & TFL_AMMO_ENERGY)
+ return 0;
+
+ return 1;
+}
void turret_fusionreactor_dinit()
{
self.shoot_flags = TFL_SHOOT_HITALLVALID;
self.aim_flags = TFL_AIM_NO;
self.track_flags = TFL_TRACK_NO;
- self.turret_respawnhook = turret_fusionreactor_respawnhook;
+ // self.turret_respawnhook = turret_fusionreactor_respawnhook;
if (turret_stdproc_init("fusreac_std",0,"models/turrets/base.md3","models/turrets/reactor.md3") == 0)
{
sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
- if (self.uzi_bulletcounter == 2)
+ if (self.misc_bulletcounter == 2)
{
UziFlash();
setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
- self.uzi_bulletcounter = 0;
+ self.misc_bulletcounter = 0;
}
- self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
self.tur_head.frame = self.tur_head.frame + 1;
}
{
// Fire bullets, alternating trails left<->right
self = self.owner;
- if(self.uzi_bulletcounter == 1)
+ if(self.misc_bulletcounter == 1)
{
spiderbot_minigun_fire(self.vehicle.gun1, 0);
spiderbot_minigun_fire(self.vehicle.gun2, 1);
- self.uzi_bulletcounter = 0;
+ self.misc_bulletcounter = 0;
}
else
{
spiderbot_minigun_fire(self.vehicle.gun1, 1);
spiderbot_minigun_fire(self.vehicle.gun2, 0);
- self.uzi_bulletcounter += 1;
+ self.misc_bulletcounter += 1;
}
self = self.vehicle;
#include "w_hook.qc"
#include "w_hlac.qc"
#include "w_tuba.qc"
-#include "w_campingrifle.qc"
+#include "w_sniperrifle.qc"
#include "w_fireball.qc"
#include "w_seeker.qc"
+++ /dev/null
-#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(CAMPINGRIFLE, w_campingrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "campingrifle", "campingrifle", "Sniper Rifle");
-#else
-#ifdef SVQC
-//Camping rifle Primary mode: manually operated bolt*, Secondary: full automatic**
-//* Manually operating the bolt means that all the power of the gas is used to propell the bullet. In this mode the bolt is prevented from moving backwards in response to the firing of the bullet.
-//** In fully automatic mode some of the gas is used to extract and reload the next cartrige, thus there is less power and range.
-
-.float campingrifle_accumulator;
-
-float W_CampingRifle_CheckMaxBullets(float checkammo)
-{
- float maxbulls;
- maxbulls = autocvar_g_balance_campingrifle_magazinecapacity;
- if(!maxbulls)
- maxbulls = 8; // match HUD
- if(checkammo)
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- maxbulls = min(maxbulls, floor(self.ammo_nails / min(autocvar_g_balance_campingrifle_primary_ammo, autocvar_g_balance_campingrifle_secondary_ammo)));
- if(self.campingrifle_bulletcounter > maxbulls || !autocvar_g_balance_campingrifle_magazinecapacity)
- self.campingrifle_bulletcounter = maxbulls;
- return (self.campingrifle_bulletcounter == maxbulls);
-}
-
-void W_CampingRifle_ReloadedAndReady()
-{
- float t;
- self.campingrifle_bulletcounter = autocvar_g_balance_campingrifle_magazinecapacity;
- W_CampingRifle_CheckMaxBullets(TRUE);
- t = ATTACK_FINISHED(self) - autocvar_g_balance_campingrifle_reloadtime - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
-float W_CampingRifle_Reload()
-{
- float t;
-
- W_CampingRifle_CheckMaxBullets(TRUE);
-
- if(self.ammo_nails < min(autocvar_g_balance_campingrifle_primary_ammo, autocvar_g_balance_campingrifle_secondary_ammo)) // when we get here, bulletcounter must be 0 or -1
- {
- print("cannot reload... not enough bullets\n");
- self.campingrifle_bulletcounter = -1; // reload later
- W_SwitchToOtherWeapon(self);
- return 0;
- }
-
- if (self.campingrifle_bulletcounter >= autocvar_g_balance_campingrifle_magazinecapacity)
- return 0;
-
- if (self.weaponentity)
- {
- if (self.weaponentity.wframe == WFRAME_RELOAD)
- return 0;
-
- // allow to switch away while reloading, but this will cause a new reload!
- self.weaponentity.state = WS_READY;
- }
-
- sound (self, CHAN_WEAPON2, "weapons/campingrifle_reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_campingrifle_reloadtime + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_campingrifle_reloadtime, W_CampingRifle_ReloadedAndReady);
-
- self.campingrifle_bulletcounter = -1;
-
- return 1;
-}
-
-void W_CampingRifle_CheckReloadAndReady()
-{
- w_ready();
- if(self.campingrifle_bulletcounter <= 0)
- if(W_CampingRifle_Reload())
- return;
-}
-
-void W_CampingRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant)
-{
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_nails -= pAmmo;
-
- if(deathtype & HITTYPE_SECONDARY)
- W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, autocvar_g_balance_campingrifle_secondary_damage + autocvar_g_balance_campingrifle_secondary_headshotaddeddamage);
- else
- W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire.wav", CHAN_WEAPON, autocvar_g_balance_campingrifle_primary_damage + autocvar_g_balance_campingrifle_primary_headshotaddeddamage);
-
- pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
-
- if(self.BUTTON_ZOOM) // if zoomed, shoot from the eye
- {
- w_shotdir = v_forward;
- w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
- }
-
- if(deathtype & HITTYPE_SECONDARY)
- fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_campingrifle_secondary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
- else
- fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_campingrifle_primary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
- endFireBallisticBullet();
-
- if (autocvar_g_casings >= 2)
- SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
-
- self.campingrifle_bulletcounter = self.campingrifle_bulletcounter - 1;
- W_CampingRifle_CheckMaxBullets(TRUE);
-}
-
-void W_CampingRifle_Attack()
-{
- W_CampingRifle_FireBullet(autocvar_g_balance_campingrifle_primary_spread, autocvar_g_balance_campingrifle_primary_damage, autocvar_g_balance_campingrifle_primary_headshotaddeddamage, autocvar_g_balance_campingrifle_primary_force, autocvar_g_balance_campingrifle_primary_speed, autocvar_g_balance_campingrifle_primary_lifetime, autocvar_g_balance_campingrifle_primary_ammo, WEP_CAMPINGRIFLE, autocvar_g_balance_campingrifle_primary_bulletconstant);
-}
-
-void W_CampingRifle_Attack2()
-{
- W_CampingRifle_FireBullet(autocvar_g_balance_campingrifle_secondary_spread, autocvar_g_balance_campingrifle_secondary_damage, autocvar_g_balance_campingrifle_secondary_headshotaddeddamage, autocvar_g_balance_campingrifle_secondary_force, autocvar_g_balance_campingrifle_secondary_speed, autocvar_g_balance_campingrifle_secondary_lifetime, autocvar_g_balance_campingrifle_secondary_ammo, WEP_CAMPINGRIFLE | HITTYPE_SECONDARY, autocvar_g_balance_campingrifle_secondary_bulletconstant);
-}
-
-void spawnfunc_weapon_campingrifle (void)
-{
- weapon_defaultspawnfunc(WEP_CAMPINGRIFLE);
-}
-
-.void(void) campingrifle_bullethail_attackfunc;
-.float campingrifle_bullethail_frame;
-.float campingrifle_bullethail_animtime;
-.float campingrifle_bullethail_refire;
-void W_CampingRifle_BulletHail_Continue()
-{
- float r, sw, af;
- W_CampingRifle_CheckReloadAndReady();
- if(self.campingrifle_bulletcounter < 0)
- return; // reloading, so we are done
- sw = self.switchweapon; // make it not detect weapon changes as reason to abort firing
- af = ATTACK_FINISHED(self);
- self.switchweapon = self.weapon;
- ATTACK_FINISHED(self) = time;
- print(ftos(self.ammo_nails), "\n");
- r = weapon_prepareattack(self.campingrifle_bullethail_frame == WFRAME_FIRE2, self.campingrifle_bullethail_refire);
- if(self.switchweapon == self.weapon)
- self.switchweapon = sw;
- if(r)
- {
- self.campingrifle_bullethail_attackfunc();
- weapon_thinkf(self.campingrifle_bullethail_frame, self.campingrifle_bullethail_animtime, W_CampingRifle_BulletHail_Continue);
- print("thinkf set\n");
- }
- else
- {
- ATTACK_FINISHED(self) = af; // reset attack_finished if we didn't fire, so the last shot enforces the refire time
- print("out of ammo... ", ftos(self.weaponentity.state), "\n");
- }
-}
-
-void W_CampingRifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animtime, float refire)
-{
- // if we get here, we have at least one bullet to fire
- AttackFunc();
- if(mode)
- {
- // continue hail
- self.campingrifle_bullethail_attackfunc = AttackFunc;
- self.campingrifle_bullethail_frame = fr;
- self.campingrifle_bullethail_animtime = animtime;
- self.campingrifle_bullethail_refire = refire;
- weapon_thinkf(fr, animtime, W_CampingRifle_BulletHail_Continue);
- }
- else
- {
- // just one shot
- weapon_thinkf(fr, animtime, W_CampingRifle_CheckReloadAndReady);
- }
-}
-
-.float bot_secondary_campingriflemooth;
-float w_campingrifle(float req)
-{
- float full;
- if (req == WR_AIM)
- {
- self.BUTTON_ATCK=FALSE;
- self.BUTTON_ATCK2=FALSE;
- if(vlen(self.origin-self.enemy.origin) > 1000)
- self.bot_secondary_campingriflemooth = 0;
- if(self.bot_secondary_campingriflemooth == 0)
- {
- if(bot_aim(autocvar_g_balance_campingrifle_primary_speed, 0, autocvar_g_balance_campingrifle_primary_lifetime, TRUE))
- {
- self.BUTTON_ATCK = TRUE;
- if(random() < 0.01) self.bot_secondary_campingriflemooth = 1;
- }
- }
- else
- {
- if(bot_aim(autocvar_g_balance_campingrifle_secondary_speed, 0, autocvar_g_balance_campingrifle_secondary_lifetime, TRUE))
- {
- self.BUTTON_ATCK2 = TRUE;
- if(random() < 0.03) self.bot_secondary_campingriflemooth = 0;
- }
- }
- }
- else if (req == WR_THINK)
- {
- if(self.campingrifle_bulletcounter < 0) // forced reload (e.g. because interrupted)
- {
- if(self.switchweapon == self.weapon)
- if(self.weaponentity.state == WS_READY)
- W_CampingRifle_Reload();
- }
- else
- {
- self.campingrifle_accumulator = bound(time - autocvar_g_balance_campingrifle_bursttime, self.campingrifle_accumulator, time);
- if (self.BUTTON_ATCK)
- if (weapon_prepareattack_check(0, autocvar_g_balance_campingrifle_primary_refire))
- if (time >= self.campingrifle_accumulator + autocvar_g_balance_campingrifle_primary_burstcost)
- {
- weapon_prepareattack_do(0, autocvar_g_balance_campingrifle_primary_refire);
- W_CampingRifle_BulletHail(autocvar_g_balance_campingrifle_primary_bullethail, W_CampingRifle_Attack, WFRAME_FIRE1, autocvar_g_balance_campingrifle_primary_animtime, autocvar_g_balance_campingrifle_primary_refire);
- self.campingrifle_accumulator += autocvar_g_balance_campingrifle_primary_burstcost;
- }
- if (self.BUTTON_ATCK2)
- {
- if (autocvar_g_balance_campingrifle_secondary)
- {
- if (weapon_prepareattack_check(1, autocvar_g_balance_campingrifle_secondary_refire))
- if (time >= self.campingrifle_accumulator + autocvar_g_balance_campingrifle_secondary_burstcost)
- {
- weapon_prepareattack_do(1, autocvar_g_balance_campingrifle_secondary_refire);
- W_CampingRifle_BulletHail(autocvar_g_balance_campingrifle_secondary_bullethail, W_CampingRifle_Attack2, WFRAME_FIRE2, autocvar_g_balance_campingrifle_secondary_animtime, autocvar_g_balance_campingrifle_primary_refire);
- self.campingrifle_accumulator += autocvar_g_balance_campingrifle_secondary_burstcost;
- }
- }
- }
- }
- }
- else if (req == WR_PRECACHE)
- {
- precache_model ("models/weapons/g_campingrifle.md3");
- precache_model ("models/weapons/v_campingrifle.md3");
- precache_model ("models/weapons/h_campingrifle.iqm");
- precache_sound ("weapons/campingrifle_reload.wav");
- precache_sound ("weapons/campingrifle_fire.wav");
- precache_sound ("weapons/campingrifle_fire2.wav");
- }
- else if (req == WR_SETUP)
- {
- weapon_setup(WEP_CAMPINGRIFLE);
-
- full = W_CampingRifle_CheckMaxBullets(TRUE);
- if(autocvar_g_balance_campingrifle_auto_reload_on_switch)
- if(!full)
- self.campingrifle_bulletcounter = -1;
- }
- else if (req == WR_CHECKAMMO1)
- return self.ammo_nails >= autocvar_g_balance_campingrifle_primary_ammo;
- else if (req == WR_CHECKAMMO2)
- return self.ammo_nails >= autocvar_g_balance_campingrifle_secondary_ammo;
- else if (req == WR_RELOAD)
- {
- W_CampingRifle_Reload();
- }
- else if (req == WR_RESETPLAYER)
- {
- self.campingrifle_accumulator = time - autocvar_g_balance_campingrifle_bursttime;
- self.campingrifle_bulletcounter = autocvar_g_balance_campingrifle_magazinecapacity;
- W_CampingRifle_CheckMaxBullets(FALSE);
- }
- return TRUE;
-};
-#endif
-#ifdef CSQC
-float w_campingrifle(float req)
-{
- if(req == WR_IMPACTEFFECT)
- {
- vector org2;
- org2 = w_org + w_backoff * 2;
- pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
- if(!w_issilent)
- {
- if(w_random < 0.2)
- sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
- else if(w_random < 0.4)
- sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
- else if(w_random < 0.5)
- sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
- }
- }
- else if(req == WR_PRECACHE)
- {
- precache_sound("weapons/ric1.wav");
- precache_sound("weapons/ric2.wav");
- precache_sound("weapons/ric3.wav");
- }
- else if (req == WR_SUICIDEMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = "%s shot themself automatically";
- else
- w_deathtypestring = "%s sniped themself somehow";
- }
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- {
- if(w_deathtype & HITTYPE_BOUNCE)
- w_deathtypestring = "%s failed to hide from %s's bullet hail";
- else
- w_deathtypestring = "%s died in %s's bullet hail";
- }
- else
- {
- if(w_deathtype & HITTYPE_BOUNCE)
- {
- // TODO special headshot message here too?
- w_deathtypestring = "%s failed to hide from %s's rifle";
- }
- else
- {
- if(w_deathtype & HITTYPE_HEADSHOT)
- w_deathtypestring = "%s got hit in the head by %s";
- else
- w_deathtypestring = "%s was sniped by %s";
- }
- }
- }
- return TRUE;
-}
-#endif
-#endif
}
.float railgundistance;
+.vector railgunforce;
void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype)
{
local vector hitloc, force, endpoint, dir;
trace_ent.railgunhitloc = end;
trace_ent.railgunhitsolidbackup = trace_ent.solid;
trace_ent.railgundistance = vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos) - start);
+ trace_ent.railgunforce = WarpZone_TransformVelocity(WarpZone_trace_transform, force);
// stop if this is a wall
if (trace_ent.solid == SOLID_BSP)
// apply the damage
if (ent.takedamage)
- Damage (ent, self, self, bdamage * f, deathtype, hitloc, force * ffs);
+ Damage (ent, self, self, bdamage * f, deathtype, hitloc, ent.railgunforce * ffs);
// create a small explosion to throw gibs around (if applicable)
//setorigin (explosion, hitloc);
if(headshot)
f *= q;
- if(DEATH_WEAPONOF(self.projectiledeathtype) == WEP_CAMPINGRIFLE)
+ if(DEATH_WEAPONOF(self.projectiledeathtype) == WEP_SNIPERRIFLE)
{
if(headshot)
AnnounceTo(self.owner, "headshot");
if(tracereffects & EF_RED)
eff = particleeffectnum("tr_rifle");
+ else if(tracereffects & EF_BLUE)
+ eff = particleeffectnum("tr_rifle_weak");
else
eff = particleeffectnum("tr_bullet");
proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_other_fadetime;
proj.nextthink = time + autocvar_g_balance_crylink_primary_other_lifetime + autocvar_g_balance_crylink_primary_other_fadetime;
}
+ proj.teleport_time = time + autocvar_g_balance_crylink_primary_joindelay;
proj.cnt = autocvar_g_balance_crylink_primary_bounces;
//proj.scale = 1 + 1 * proj.cnt;
proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_line_fadetime;
proj.nextthink = time + autocvar_g_balance_crylink_secondary_line_lifetime + autocvar_g_balance_crylink_secondary_line_fadetime;
}
+ proj.teleport_time = time + autocvar_g_balance_crylink_secondary_joindelay;
proj.cnt = autocvar_g_balance_crylink_secondary_bounces;
//proj.scale = 1 + 1 * proj.cnt;
}
else
{
- if (self.crylink_waitrelease)
+ if (self.crylink_waitrelease && (!self.crylink_lastgroup || time > self.crylink_lastgroup.teleport_time))
{
// fired and released now!
if(self.crylink_lastgroup)
vector pos;
entity linkjoineffect;
-
if(self.crylink_waitrelease == 1)
{
pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_primary_joinspread * autocvar_g_balance_crylink_primary_speed, autocvar_g_balance_crylink_primary_jointime);
linkjoineffect.nextthink = time + w_crylink_linkjoin_time;
linkjoineffect.owner = self;
setorigin(linkjoineffect, pos);
-
-
}
self.crylink_waitrelease = 0;
if(!w_crylink(WR_CHECKAMMO1) && !w_crylink(WR_CHECKAMMO2))
entity beam, oldself;
self.lgbeam = beam = spawn();
+ beam.classname = "lgbeam";
beam.solid = SOLID_NOT;
beam.think = lgbeam_think;
beam.owner = self;
{
if (self.BUTTON_ATCK)
{
+ if(autocvar_g_balance_electro_lightning)
+ if(self.BUTTON_ATCK_prev)
+ {
+ // prolong the animtime while the gun is being fired
+ if(self.animstate_startframe == self.anim_shoot_x && self.animstate_numframes == self.anim_shoot_y)
+ weapon_thinkf(WFRAME_DONTCHANGE, autocvar_g_balance_electro_primary_animtime, w_ready);
+ else
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
+ }
if (weapon_prepareattack(0, (autocvar_g_balance_electro_lightning ? 0 : autocvar_g_balance_electro_primary_refire)))
{
if(autocvar_g_balance_electro_lightning)
{
W_Electro_Attack3();
}
- self.BUTTON_ATCK_prev = 1;
+ if(!self.BUTTON_ATCK_prev)
+ {
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
+ self.BUTTON_ATCK_prev = 1;
+ }
}
else
{
W_Electro_Attack();
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
}
- weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
}
} else {
if(autocvar_g_balance_electro_lightning)
{
if (self.BUTTON_ATCK_prev != 0)
{
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
ATTACK_FINISHED(self) = time + autocvar_g_balance_electro_primary_refire * W_WeaponRateFactor();
}
self.BUTTON_ATCK_prev = 0;
W_Electro_Attack2();
self.electro_count = autocvar_g_balance_electro_secondary_count;
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_electro_secondary_animtime, w_electro_checkattack);
- self.electro_secondarytime = time + autocvar_g_balance_electro_secondary_refire2;
+ self.electro_secondarytime = time + autocvar_g_balance_electro_secondary_refire2 * W_WeaponRateFactor();
}
}
else if (req == WR_PRECACHE)
REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hlac", "hlac", "Heavy Laser Assault Cannon");
#else
#ifdef SVQC
-.float HLAC_bulletcounter;
-void W_HLAC_Touch (void)
-{
- PROJECTILE_TOUCH;
- self.event_damage = SUB_Null;
-
- RadiusDamage (self, self.owner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
-
- remove (self);
-}
-
-void W_HLAC_Touch2 (void)
+void W_HLAC_Touch (void)
{
PROJECTILE_TOUCH;
self.event_damage = SUB_Null;
-
- RadiusDamage (self, self.owner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
+
+ if(self.projectiledeathtype & HITTYPE_SECONDARY)
+ RadiusDamage (self, self.owner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
+ else
+ RadiusDamage (self, self.owner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
remove (self);
}
self.ammo_cells = self.ammo_cells - autocvar_g_balance_hlac_primary_ammo;
}
- spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.HLAC_bulletcounter);
+ spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.misc_bulletcounter);
spread = min(spread,autocvar_g_balance_hlac_primary_spread_max);
if(self.crouch)
spread = spread * autocvar_g_balance_hlac_primary_spread_crouchmod;
missile = spawn ();
missile.owner = self;
missile.classname = "hlacbolt";
- // missile.dmg = issecondary;
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_hlac_primary_damage;
setsize(missile, '0 0 0', '0 0 0');
W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_primary_speed, spread);
- missile.angles = vectoangles (missile.velocity);
+ //missile.angles = vectoangles (missile.velocity); // csqc
missile.touch = W_HLAC_Touch;
missile.think = SUB_Remove;
missile = spawn ();
missile.owner = self;
missile.classname = "hlacbolt";
- // missile.dmg = issecondary;
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_hlac_secondary_damage;
setsize(missile, '0 0 0', '0 0 0');
W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_secondary_speed, spread);
- missile.angles = vectoangles (missile.velocity);
+ //missile.angles = vectoangles (missile.velocity); // csqc
- missile.touch = W_HLAC_Touch2;
+ missile.touch = W_HLAC_Touch;
missile.think = SUB_Remove;
missile.nextthink = time + autocvar_g_balance_hlac_secondary_lifetime;
ATTACK_FINISHED(self) = time + autocvar_g_balance_hlac_primary_refire * W_WeaponRateFactor();
W_HLAC_Attack();
- self.HLAC_bulletcounter = self.HLAC_bulletcounter + 1;
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
}
else
if (self.BUTTON_ATCK)
if (weapon_prepareattack(0, autocvar_g_balance_hlac_primary_refire))
{
- self.HLAC_bulletcounter = 0;
+ self.misc_bulletcounter = 0;
W_HLAC_Attack();
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
}
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(MINE_LAYER, w_minelayer, IT_ROCKETS, 4, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_HIGH, "minelayer", "minelayer", "Mine Layer");
+REGISTER_WEAPON(MINE_LAYER, w_minelayer, IT_ROCKETS, 4, WEP_TYPE_SPLASH, BOT_PICKUP_RATING_HIGH, "minelayer", "minelayer", "Mine Layer");
#else
#ifdef SVQC
void W_Mine_Think (void);
{
charge = autocvar_g_balance_nex_charge_mindmg / mydmg + (1 - autocvar_g_balance_nex_charge_mindmg / mydmg) * self.nex_charge;
self.nex_charge *= autocvar_g_balance_nex_charge_shot_multiplier; // do this AFTER setting mydmg/myforce
- // O RLY? -- divVerent
- // YA RLY -- FruitieX
+ // O RLY? -- divVerent
+ // YA RLY -- FruitieX
}
else
charge = 1;
myforce *= charge;
W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CHAN_WEAPON, mydmg);
- if(charge > autocvar_g_balance_nex_charge_limit && autocvar_g_balance_nex_charge_limit) // if the Nex is overcharged, we play an extra sound
- {
- sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_limit) / (1 - 0.5 * autocvar_g_balance_nex_charge_limit), ATTN_NORM);
- }
+ if(charge > autocvar_g_balance_nex_charge_limit && autocvar_g_balance_nex_charge_limit) // if the Nex is overcharged, we play an extra sound
+ {
+ sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_limit) / (1 - 0.5 * autocvar_g_balance_nex_charge_limit), ATTN_NORM);
+ }
yoda = 0;
FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_NEX);
//beam and muzzle flash done on client
SendCSQCNexBeamParticle(charge);
-
+
// flash and burn the wall
if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
Damage_DamageInfo(trace_endpos, mydmg, 0, 0, myforce * w_shotdir, WEP_NEX, self);
if(autocvar_g_balance_nex_charge && self.nex_charge < autocvar_g_balance_nex_charge_limit)
self.nex_charge = min(1, self.nex_charge + autocvar_g_balance_nex_charge_rate * frametime / W_TICSPERFRAME);
- if(autocvar_g_balance_nex_charge)
- {
- self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
- self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
- self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
-
- if(self.nex_charge > autocvar_g_balance_nex_charge_limit)
- {
- self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
- self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
- self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
- }
- }
-
if(autocvar_g_balance_nex_secondary_chargepool)
- if(self.nex_chargepool_ammo < 1)
- {
- if(self.nex_chargepool_pauseregen_finished < time)
- self.nex_chargepool_ammo = min(1, self.nex_chargepool_ammo + autocvar_g_balance_nex_secondary_chargepool_regen * frametime / W_TICSPERFRAME);
- self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_nex_secondary_chargepool_pause_health_regen);
- }
+ if(self.nex_chargepool_ammo < 1)
+ {
+ if(self.nex_chargepool_pauseregen_finished < time)
+ self.nex_chargepool_ammo = min(1, self.nex_chargepool_ammo + autocvar_g_balance_nex_secondary_chargepool_regen * frametime / W_TICSPERFRAME);
+ self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_nex_secondary_chargepool_pause_health_regen);
+ }
if (self.BUTTON_ATCK)
{
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nex_primary_animtime, w_ready);
}
}
- if (self.BUTTON_ATCK2)
+ if ((autocvar_g_balance_nex_secondary_charge && !autocvar_g_balance_nex_secondary) ? self.BUTTON_ZOOM : self.BUTTON_ATCK2)
{
if(autocvar_g_balance_nex_secondary_charge)
{
self.nex_charge_rottime = time + autocvar_g_balance_nex_charge_rot_pause;
dt = frametime / W_TICSPERFRAME;
- if(autocvar_g_balance_nex_secondary_chargepool)
+ if(self.nex_charge < 1)
{
- if(autocvar_g_balance_nex_secondary_ammo)
+ if(autocvar_g_balance_nex_secondary_chargepool)
{
- // always deplete if secondary is held
- self.nex_chargepool_ammo = max(0, self.nex_chargepool_ammo - autocvar_g_balance_nex_secondary_ammo * dt);
+ if(autocvar_g_balance_nex_secondary_ammo)
+ {
+ // always deplete if secondary is held
+ self.nex_chargepool_ammo = max(0, self.nex_chargepool_ammo - autocvar_g_balance_nex_secondary_ammo * dt);
- dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
- self.nex_chargepool_pauseregen_finished = time + autocvar_g_balance_nex_secondary_chargepool_pause_regen;
- dt = min(dt, self.nex_chargepool_ammo);
- dt = max(0, dt);
+ dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
+ self.nex_chargepool_pauseregen_finished = time + autocvar_g_balance_nex_secondary_chargepool_pause_regen;
+ dt = min(dt, self.nex_chargepool_ammo);
+ dt = max(0, dt);
- self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
+ self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
+ }
}
- }
- else if(autocvar_g_balance_nex_secondary_ammo)
- {
- if(self.nex_charge < 1)
+ else if(autocvar_g_balance_nex_secondary_ammo)
{
- dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if(self.BUTTON_ATCK2) // only eat ammo when the button is pressed
{
- dt = min(dt, (self.ammo_cells - autocvar_g_balance_nex_primary_ammo) / autocvar_g_balance_nex_secondary_ammo);
- dt = max(0, dt);
- if(dt > 0)
+ dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
- self.ammo_cells = max(autocvar_g_balance_nex_secondary_ammo, self.ammo_cells - autocvar_g_balance_nex_secondary_ammo * dt);
+ dt = min(dt, (self.ammo_cells - autocvar_g_balance_nex_primary_ammo) / autocvar_g_balance_nex_secondary_ammo);
+ dt = max(0, dt);
+ if(dt > 0)
+ {
+ self.ammo_cells = max(autocvar_g_balance_nex_secondary_ammo, self.ammo_cells - autocvar_g_balance_nex_secondary_ammo * dt);
+ }
}
+ self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
}
+ }
+
+ else
+ {
+ dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
}
}
}
}
}
+
+ if(autocvar_g_balance_nex_charge)
+ {
+ self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
+ self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
+ self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
+
+ if(self.nex_charge > autocvar_g_balance_nex_charge_limit)
+ {
+ self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
+ self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
+ self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
+ }
+ }
}
else if (req == WR_PRECACHE)
{
vector angle;
angle = v_forward;
+ float meleetime;
+ meleetime = autocvar_g_balance_shotgun_secondary_melee_time * W_WeaponRateFactor();
+
// perform trace
float f;
- f = (self.cnt + autocvar_g_balance_shotgun_secondary_melee_time - time) / autocvar_g_balance_shotgun_secondary_melee_time * 2 - 1;
+ f = (self.cnt + meleetime - time) / meleetime * 2 - 1;
vector targpos;
targpos = self.owner.origin + self.owner.view_ofs + angle * autocvar_g_balance_shotgun_secondary_melee_range + v_right * f * autocvar_g_balance_shotgun_secondary_melee_swing + v_up * f * autocvar_g_balance_shotgun_secondary_melee_swing;
Damage (trace_ent, self.owner, self.owner, autocvar_g_balance_shotgun_secondary_damage * min(1, f + 1), WEP_SHOTGUN | HITTYPE_SECONDARY , self.owner.origin + self.owner.view_ofs, force);
remove(self);
}
- else if(time >= self.cnt + autocvar_g_balance_shotgun_secondary_melee_time) // missed, remove ent
+ else if(time >= self.cnt + meleetime) // missed, remove ent
remove(self);
else // continue swinging the weapon in hope of hitting someone :)
self.nextthink = time;
--- /dev/null
+#ifdef REGISTER_WEAPON
+REGISTER_WEAPON(SNIPERRIFLE, w_sniperrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "campingrifle", "sniperrifle", "Sniper Rifle");
+#else
+#ifdef SVQC
+//Sniper rifle Primary mode: manually operated bolt*, Secondary: full automatic**
+//* Manually operating the bolt means that all the power of the gas is used to propell the bullet. In this mode the bolt is prevented from moving backwards in response to the firing of the bullet.
+//** In fully automatic mode some of the gas is used to extract and reload the next cartrige, thus there is less power and range.
+
+.float sniperrifle_accumulator;
+
+float W_SniperRifle_CheckMaxBullets(float checkammo)
+{
+ float maxbulls;
+ maxbulls = autocvar_g_balance_sniperrifle_magazinecapacity;
+ if(!maxbulls)
+ maxbulls = 8; // match HUD
+ if(checkammo)
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ maxbulls = min(maxbulls, floor(self.ammo_nails / min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo)));
+ if(self.sniperrifle_bulletcounter > maxbulls || !autocvar_g_balance_sniperrifle_magazinecapacity)
+ self.sniperrifle_bulletcounter = maxbulls;
+ return (self.sniperrifle_bulletcounter == maxbulls);
+}
+
+void W_SniperRifle_ReloadedAndReady()
+{
+ float t;
+ self.sniperrifle_bulletcounter = autocvar_g_balance_sniperrifle_magazinecapacity;
+ W_SniperRifle_CheckMaxBullets(TRUE);
+ t = ATTACK_FINISHED(self) - autocvar_g_balance_sniperrifle_reloadtime - 1;
+ ATTACK_FINISHED(self) = t;
+ w_ready();
+}
+
+float W_SniperRifle_Reload()
+{
+ float t;
+
+ W_SniperRifle_CheckMaxBullets(TRUE);
+
+ if(self.ammo_nails < min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo)) // when we get here, bulletcounter must be 0 or -1
+ {
+ print("cannot reload... not enough bullets\n");
+ self.sniperrifle_bulletcounter = -1; // reload later
+ W_SwitchToOtherWeapon(self);
+ return 0;
+ }
+
+ if (self.sniperrifle_bulletcounter >= autocvar_g_balance_sniperrifle_magazinecapacity)
+ return 0;
+
+ if (self.weaponentity)
+ {
+ if (self.weaponentity.wframe == WFRAME_RELOAD)
+ return 0;
+
+ // allow to switch away while reloading, but this will cause a new reload!
+ self.weaponentity.state = WS_READY;
+ }
+
+ sound (self, CHAN_WEAPON2, "weapons/campingrifle_reload.wav", VOL_BASE, ATTN_NORM);
+
+ t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_sniperrifle_reloadtime + 1;
+ ATTACK_FINISHED(self) = t;
+
+ weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_sniperrifle_reloadtime, W_SniperRifle_ReloadedAndReady);
+
+ self.sniperrifle_bulletcounter = -1;
+
+ return 1;
+}
+
+void W_SniperRifle_CheckReloadAndReady()
+{
+ w_ready();
+ if(self.sniperrifle_bulletcounter <= 0)
+ if(W_SniperRifle_Reload())
+ return;
+}
+
+void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant)
+{
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ self.ammo_nails -= pAmmo;
+
+ if(deathtype & HITTYPE_SECONDARY)
+ W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, autocvar_g_balance_sniperrifle_secondary_damage + autocvar_g_balance_sniperrifle_secondary_headshotaddeddamage);
+ else
+ W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire.wav", CHAN_WEAPON, autocvar_g_balance_sniperrifle_primary_damage + autocvar_g_balance_sniperrifle_primary_headshotaddeddamage);
+
+ pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
+
+ if(self.BUTTON_ZOOM) // if zoomed, shoot from the eye
+ {
+ w_shotdir = v_forward;
+ w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
+ }
+
+ if(deathtype & HITTYPE_SECONDARY)
+ fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_sniperrifle_secondary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
+ else
+ fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_sniperrifle_primary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
+ endFireBallisticBullet();
+
+ if (autocvar_g_casings >= 2)
+ SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
+
+ self.sniperrifle_bulletcounter = self.sniperrifle_bulletcounter - 1;
+ W_SniperRifle_CheckMaxBullets(TRUE);
+}
+
+void W_SniperRifle_Attack()
+{
+ W_SniperRifle_FireBullet(autocvar_g_balance_sniperrifle_primary_spread, autocvar_g_balance_sniperrifle_primary_damage, autocvar_g_balance_sniperrifle_primary_headshotaddeddamage, autocvar_g_balance_sniperrifle_primary_force, autocvar_g_balance_sniperrifle_primary_speed, autocvar_g_balance_sniperrifle_primary_lifetime, autocvar_g_balance_sniperrifle_primary_ammo, WEP_SNIPERRIFLE, autocvar_g_balance_sniperrifle_primary_bulletconstant);
+}
+
+void W_SniperRifle_Attack2()
+{
+ W_SniperRifle_FireBullet(autocvar_g_balance_sniperrifle_secondary_spread, autocvar_g_balance_sniperrifle_secondary_damage, autocvar_g_balance_sniperrifle_secondary_headshotaddeddamage, autocvar_g_balance_sniperrifle_secondary_force, autocvar_g_balance_sniperrifle_secondary_speed, autocvar_g_balance_sniperrifle_secondary_lifetime, autocvar_g_balance_sniperrifle_secondary_ammo, WEP_SNIPERRIFLE | HITTYPE_SECONDARY, autocvar_g_balance_sniperrifle_secondary_bulletconstant);
+}
+
+void spawnfunc_weapon_sniperrifle (void)
+{
+ weapon_defaultspawnfunc(WEP_SNIPERRIFLE);
+}
+
+// compatibility alias
+void spawnfunc_weapon_campingrifle (void)
+{
+ spawnfunc_weapon_sniperrifle();
+}
+
+.void(void) sniperrifle_bullethail_attackfunc;
+.float sniperrifle_bullethail_frame;
+.float sniperrifle_bullethail_animtime;
+.float sniperrifle_bullethail_refire;
+void W_SniperRifle_BulletHail_Continue()
+{
+ float r, sw, af;
+ W_SniperRifle_CheckReloadAndReady();
+ if(self.sniperrifle_bulletcounter < 0)
+ return; // reloading, so we are done
+ sw = self.switchweapon; // make it not detect weapon changes as reason to abort firing
+ af = ATTACK_FINISHED(self);
+ self.switchweapon = self.weapon;
+ ATTACK_FINISHED(self) = time;
+ print(ftos(self.ammo_nails), "\n");
+ r = weapon_prepareattack(self.sniperrifle_bullethail_frame == WFRAME_FIRE2, self.sniperrifle_bullethail_refire);
+ if(self.switchweapon == self.weapon)
+ self.switchweapon = sw;
+ if(r)
+ {
+ self.sniperrifle_bullethail_attackfunc();
+ weapon_thinkf(self.sniperrifle_bullethail_frame, self.sniperrifle_bullethail_animtime, W_SniperRifle_BulletHail_Continue);
+ print("thinkf set\n");
+ }
+ else
+ {
+ ATTACK_FINISHED(self) = af; // reset attack_finished if we didn't fire, so the last shot enforces the refire time
+ print("out of ammo... ", ftos(self.weaponentity.state), "\n");
+ }
+}
+
+void W_SniperRifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animtime, float refire)
+{
+ // if we get here, we have at least one bullet to fire
+ AttackFunc();
+ if(mode)
+ {
+ // continue hail
+ self.sniperrifle_bullethail_attackfunc = AttackFunc;
+ self.sniperrifle_bullethail_frame = fr;
+ self.sniperrifle_bullethail_animtime = animtime;
+ self.sniperrifle_bullethail_refire = refire;
+ weapon_thinkf(fr, animtime, W_SniperRifle_BulletHail_Continue);
+ }
+ else
+ {
+ // just one shot
+ weapon_thinkf(fr, animtime, W_SniperRifle_CheckReloadAndReady);
+ }
+}
+
+.float bot_secondary_sniperriflemooth;
+float w_sniperrifle(float req)
+{
+ float full;
+ if (req == WR_AIM)
+ {
+ self.BUTTON_ATCK=FALSE;
+ self.BUTTON_ATCK2=FALSE;
+ if(vlen(self.origin-self.enemy.origin) > 1000)
+ self.bot_secondary_sniperriflemooth = 0;
+ if(self.bot_secondary_sniperriflemooth == 0)
+ {
+ if(bot_aim(autocvar_g_balance_sniperrifle_primary_speed, 0, autocvar_g_balance_sniperrifle_primary_lifetime, TRUE))
+ {
+ self.BUTTON_ATCK = TRUE;
+ if(random() < 0.01) self.bot_secondary_sniperriflemooth = 1;
+ }
+ }
+ else
+ {
+ if(bot_aim(autocvar_g_balance_sniperrifle_secondary_speed, 0, autocvar_g_balance_sniperrifle_secondary_lifetime, TRUE))
+ {
+ self.BUTTON_ATCK2 = TRUE;
+ if(random() < 0.03) self.bot_secondary_sniperriflemooth = 0;
+ }
+ }
+ }
+ else if (req == WR_THINK)
+ {
+ if(self.sniperrifle_bulletcounter < 0) // forced reload (e.g. because interrupted)
+ {
+ if(self.switchweapon == self.weapon)
+ if(self.weaponentity.state == WS_READY)
+ W_SniperRifle_Reload();
+ }
+ else
+ {
+ self.sniperrifle_accumulator = bound(time - autocvar_g_balance_sniperrifle_bursttime, self.sniperrifle_accumulator, time);
+ if (self.BUTTON_ATCK)
+ if (weapon_prepareattack_check(0, autocvar_g_balance_sniperrifle_primary_refire))
+ if (time >= self.sniperrifle_accumulator + autocvar_g_balance_sniperrifle_primary_burstcost)
+ {
+ weapon_prepareattack_do(0, autocvar_g_balance_sniperrifle_primary_refire);
+ W_SniperRifle_BulletHail(autocvar_g_balance_sniperrifle_primary_bullethail, W_SniperRifle_Attack, WFRAME_FIRE1, autocvar_g_balance_sniperrifle_primary_animtime, autocvar_g_balance_sniperrifle_primary_refire);
+ self.sniperrifle_accumulator += autocvar_g_balance_sniperrifle_primary_burstcost;
+ }
+ if (self.BUTTON_ATCK2)
+ {
+ if (autocvar_g_balance_sniperrifle_secondary)
+ {
+ if (weapon_prepareattack_check(1, autocvar_g_balance_sniperrifle_secondary_refire))
+ if (time >= self.sniperrifle_accumulator + autocvar_g_balance_sniperrifle_secondary_burstcost)
+ {
+ weapon_prepareattack_do(1, autocvar_g_balance_sniperrifle_secondary_refire);
+ W_SniperRifle_BulletHail(autocvar_g_balance_sniperrifle_secondary_bullethail, W_SniperRifle_Attack2, WFRAME_FIRE2, autocvar_g_balance_sniperrifle_secondary_animtime, autocvar_g_balance_sniperrifle_primary_refire);
+ self.sniperrifle_accumulator += autocvar_g_balance_sniperrifle_secondary_burstcost;
+ }
+ }
+ }
+ }
+ }
+ else if (req == WR_PRECACHE)
+ {
+ precache_model ("models/weapons/g_campingrifle.md3");
+ precache_model ("models/weapons/v_campingrifle.md3");
+ precache_model ("models/weapons/h_campingrifle.iqm");
+ precache_sound ("weapons/campingrifle_reload.wav");
+ precache_sound ("weapons/campingrifle_fire.wav");
+ precache_sound ("weapons/campingrifle_fire2.wav");
+ }
+ else if (req == WR_SETUP)
+ {
+ weapon_setup(WEP_SNIPERRIFLE);
+
+ full = W_SniperRifle_CheckMaxBullets(TRUE);
+ if(autocvar_g_balance_sniperrifle_auto_reload_on_switch)
+ if(!full)
+ self.sniperrifle_bulletcounter = -1;
+ }
+ else if (req == WR_CHECKAMMO1)
+ return self.ammo_nails >= autocvar_g_balance_sniperrifle_primary_ammo;
+ else if (req == WR_CHECKAMMO2)
+ return self.ammo_nails >= autocvar_g_balance_sniperrifle_secondary_ammo;
+ else if (req == WR_RELOAD)
+ {
+ W_SniperRifle_Reload();
+ }
+ else if (req == WR_RESETPLAYER)
+ {
+ self.sniperrifle_accumulator = time - autocvar_g_balance_sniperrifle_bursttime;
+ self.sniperrifle_bulletcounter = autocvar_g_balance_sniperrifle_magazinecapacity;
+ W_SniperRifle_CheckMaxBullets(FALSE);
+ }
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_sniperrifle(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ {
+ if(w_random < 0.2)
+ sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.4)
+ sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.5)
+ sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/ric1.wav");
+ precache_sound("weapons/ric2.wav");
+ precache_sound("weapons/ric3.wav");
+ }
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ w_deathtypestring = "%s shot themself automatically";
+ else
+ w_deathtypestring = "%s sniped themself somehow";
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ w_deathtypestring = "%s failed to hide from %s's bullet hail";
+ else
+ w_deathtypestring = "%s died in %s's bullet hail";
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ {
+ // TODO special headshot message here too?
+ w_deathtypestring = "%s failed to hide from %s's rifle";
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_HEADSHOT)
+ w_deathtypestring = "%s got hit in the head by %s";
+ else
+ w_deathtypestring = "%s was sniped by %s";
+ }
+ }
+ }
+ return TRUE;
+}
+#endif
+#endif
REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "uzi", "uzi", "Machine Gun");
#else
#ifdef SVQC
-.entity muzzle_flash;
// leilei's fancy muzzleflash stuff
void Uzi_Flash_Go()
self.muzzle_flash.owner = self;
}
-.float uzi_bulletcounter;
void W_Uzi_Attack (float deathtype)
{
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
- if (self.uzi_bulletcounter == 1)
+ if (self.misc_bulletcounter == 1)
self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_first_ammo;
else
self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_sustained_ammo;
}
- W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.uzi_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
+ W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;
// this attack_finished just enforces a cooldown at the end of a burst
ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
- if (self.uzi_bulletcounter == 1)
+ if (self.misc_bulletcounter == 1)
fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, 0, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
else
fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
w_ready();
return;
}
- self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
W_Uzi_Attack(WEP_UZI);
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
}
self.punchangle_y = random () - 0.5;
}
- uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.uzi_bulletcounter), autocvar_g_balance_uzi_spread_max);
+ uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max);
fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
- self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if (autocvar_g_casings >= 2) // casing code
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
- self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
- if (self.uzi_bulletcounter == 0)
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
+ if (self.misc_bulletcounter == 0)
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire2, w_ready);
else
{
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire, uzi_mode1_fire_burst);
- dprint("bullets:", ftos(self.uzi_bulletcounter),"\n");
}
}
if (self.BUTTON_ATCK)
if (weapon_prepareattack(0, 0))
{
- self.uzi_bulletcounter = 0;
+ self.misc_bulletcounter = 0;
uzi_mode1_fire_auto();
}
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_burst_ammo;
- self.uzi_bulletcounter = autocvar_g_balance_uzi_burst * -1;
+ self.misc_bulletcounter = autocvar_g_balance_uzi_burst * -1;
uzi_mode1_fire_burst();
}
}
if (self.BUTTON_ATCK)
if (weapon_prepareattack(0, 0))
{
- self.uzi_bulletcounter = 1;
+ self.misc_bulletcounter = 1;
W_Uzi_Attack(WEP_UZI); // sets attack_finished
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
}
if (self.BUTTON_ATCK2 && autocvar_g_balance_uzi_first)
if (weapon_prepareattack(1, 0))
{
- self.uzi_bulletcounter = 1;
+ self.misc_bulletcounter = 1;
W_Uzi_Attack(WEP_UZI | HITTYPE_SECONDARY); // sets attack_finished
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_first_refire, w_ready);
}
e.SendFlags |= 32;
}
+.float waypointsprite_pingtime;
void WaypointSprite_Ping(entity e)
{
+ // anti spam
+ if(time < e.waypointsprite_pingtime)
+ return;
+ e.waypointsprite_pingtime = time + 0.3;
// ALWAYS sends (this causes a radar circle), thus no check
e.cnt |= 0x80;
e.SendFlags |= 32;
self = e;
WarpZones_Reconnect();
}
+
+ entity oldself, oldother;
+ oldself = self;
+ oldother = other;
for(e = world; (e = nextent(e)); )
+ {
WarpZone_StoreProjectileData(e);
+ float f;
+ f = clienttype(e);
+ if(f == CLIENTTYPE_REAL)
+ {
+ if(e.solid != SOLID_NOT) // not spectating?
+ continue;
+ if(e.movetype != MOVETYPE_NOCLIP && e.movetype != MOVETYPE_FLY) // not spectating? (this is to catch observers)
+ continue;
+ self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
+ if(!self)
+ continue;
+ other = e;
+ if(WarpZoneLib_ExactTrigger_Touch())
+ continue;
+ WarpZone_Teleport(e); // NOT triggering targets by this!
+ }
+ if(f == CLIENTTYPE_NOTACLIENT)
+ {
+ for(; (e = nextent(e)); )
+ WarpZone_StoreProjectileData(e);
+ break;
+ }
+ }
+ self = oldself;
+ other = oldother;
}
.float warpzone_reconnecting;
//startdemos demos/demo1 demos/demo2 demos/demo3
//startdemos
//play announcer/male/welcome.ogg
-crypto_keygen 0 http://rm.endoftheinternet.org/~xonotic/keygen/?ca=0&key=
+crypto_keygen 0 http://ca.xonotic.org/?ca=0&key=