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_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_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_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
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_joinspread 0.2
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 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 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 70
+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"
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_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
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
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"
seta hud_colorflash_alpha 0.5 "starting alpha of the color flash"
seta hud_damage 0.55 "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_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"
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"
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 ""
// 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 8
+r_font_size_snapping 4
// database management
set sv_db_saveasdump 0 "write server.db in dump format (loads slower, easier to read/parse)"
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
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)
// 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)
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;
}
}
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;
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);
if(!autocvar_hud_panel_notify && !autocvar__hud_configure)
return;
- drawfont = hud_bigfont;
-
active_panel = HUD_PANEL_NOTIFY;
HUD_Panel_UpdateCvars(notify);
vector pos, mySize;
}
}
}
-
- drawfont = hud_font;
}
// Timer (#5)
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;
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;
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;
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;
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'));
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
+ ) * (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)
{
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()
{
{
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
- cvar_set("gl_texturecompression", "0");
- return 1;
+ // 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
- cvar_set("gl_texturecompression", cvar_string("r_texture_dds_load"));
- return 2;
+ 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 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;
#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;
};
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)
// 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';
- /*
local entity head;
local vector dodge, v, n;
local float danger, bestdanger, vl, d;
head = head.chain;
}
return dodge;
- */
};
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) {
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;
}
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;
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;
+
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);
frag_target = self;
MUTATOR_CALLHOOK(PlayerDies);
- if(g_freezetag)
- return;
-
if(self.flagcarried)
{
if(attacker.classname != "player" && attacker.classname != "gib")
Portal_ClearAllLater(self);
// clear waypoints
WaypointSprite_PlayerDead();
+
+ 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;
+
// 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;
}
}
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;
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
//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;
// 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("sv_checkforpacketsduringsleep");
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_");
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);
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);
+ 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
+ {
+ 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(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;
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
#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");
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;
#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);
--- /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