set g_balance_fireball_switchdelay_drop 0.15
set g_balance_fireball_switchdelay_raise 0.15
// }}}
- set g_balance_hmg_speed 24000
- set g_balance_hmg_bulletconstant 115 // 13.1qu
+
+// {{{ heavy machine gun
+set g_balance_hmg_spread_min 0.02
+set g_balance_hmg_spread_max 0.05
+set g_balance_hmg_spread_add 0.01
+
+set g_balance_hmg_sustained_damage 10 // 200 dps
+set g_balance_hmg_sustained_headshotaddeddamage 0
+set g_balance_hmg_sustained_force 5
+set g_balance_hmg_sustained_spread 0.03
+set g_balance_hmg_sustained_refire 0.05
+set g_balance_hmg_sustained_ammo 1
+
++set g_balance_hmg_solidpenetration 32
+
+set g_balance_hmg_reload_ammo 120 //default: 30
+set g_balance_hmg_reload_time 1
+set g_balance_hmg_switchdelay_drop 0.2
+set g_balance_hmg_switchdelay_raise 0.2
+// }}}
+
+// {{{ RPC
+set g_balance_rpc_ammo 10
+set g_balance_rpc_animtime 1
+set g_balance_rpc_damage 150
+set g_balance_rpc_damage2 500
+set g_balance_rpc_damageforcescale 2
+set g_balance_rpc_edgedamage 50
+set g_balance_rpc_force 400
+set g_balance_rpc_health 25
+set g_balance_rpc_lifetime 30
+set g_balance_rpc_radius 300
+set g_balance_rpc_refire 1
+set g_balance_rpc_speed 1250
+set g_balance_rpc_speedaccel 0
+set g_balance_rpc_speedstart 1250
+set g_balance_rpc_reload_ammo 10
+set g_balance_rpc_reload_time 1
+set g_balance_rpc_switchdelay_drop 0.2
+set g_balance_rpc_switchdelay_raise 0.2
+// }}}
set g_balance_fireball_switchdelay_drop 0.15
set g_balance_fireball_switchdelay_raise 0.15
// }}}
- set g_balance_hmg_speed 24000
- set g_balance_hmg_bulletconstant 115 // 13.1qu
+
+// {{{ heavy machine gun
+set g_balance_hmg_spread_min 0.02
+set g_balance_hmg_spread_max 0.05
+set g_balance_hmg_spread_add 0.01
+
+set g_balance_hmg_sustained_damage 10 // 200 dps
+set g_balance_hmg_sustained_headshotaddeddamage 0
+set g_balance_hmg_sustained_force 5
+set g_balance_hmg_sustained_spread 0.03
+set g_balance_hmg_sustained_refire 0.05
+set g_balance_hmg_sustained_ammo 1
+
++set g_balance_hmg_solidpenetration 32
+
+set g_balance_hmg_reload_ammo 120 //default: 30
+set g_balance_hmg_reload_time 1
+set g_balance_hmg_switchdelay_drop 0.2
+set g_balance_hmg_switchdelay_raise 0.2
+// }}}
+
+// {{{ RPC
+set g_balance_rpc_ammo 10
+set g_balance_rpc_animtime 1
+set g_balance_rpc_damage 150
+set g_balance_rpc_damage2 500
+set g_balance_rpc_damageforcescale 2
+set g_balance_rpc_edgedamage 50
+set g_balance_rpc_force 400
+set g_balance_rpc_health 25
+set g_balance_rpc_lifetime 30
+set g_balance_rpc_radius 300
+set g_balance_rpc_refire 1
+set g_balance_rpc_speed 1250
+set g_balance_rpc_speedaccel 0
+set g_balance_rpc_speedstart 1250
+set g_balance_rpc_reload_ammo 10
+set g_balance_rpc_reload_time 1
+set g_balance_rpc_switchdelay_drop 0.2
+set g_balance_rpc_switchdelay_raise 0.2
+// }}}
set g_balance_fireball_switchdelay_drop 0
set g_balance_fireball_switchdelay_raise 0
// }}}
- set g_balance_hmg_speed 24000
- set g_balance_hmg_bulletconstant 115 // 13.1qu
+
+// {{{ heavy machine gun
+set g_balance_hmg_spread_min 0.02
+set g_balance_hmg_spread_max 0.05
+set g_balance_hmg_spread_add 0.01
+
+set g_balance_hmg_sustained_damage 10 // 200 dps
+set g_balance_hmg_sustained_headshotaddeddamage 0
+set g_balance_hmg_sustained_force 5
+set g_balance_hmg_sustained_spread 0.03
+set g_balance_hmg_sustained_refire 0.05
+set g_balance_hmg_sustained_ammo 1
+
++set g_balance_hmg_solidpenetration 32
+
+set g_balance_hmg_reload_ammo 120 //default: 30
+set g_balance_hmg_reload_time 1
+set g_balance_hmg_switchdelay_drop 0.2
+set g_balance_hmg_switchdelay_raise 0.2
+// }}}
+
+// {{{ RPC
+set g_balance_rpc_ammo 10
+set g_balance_rpc_animtime 1
+set g_balance_rpc_damage 150
+set g_balance_rpc_damage2 500
+set g_balance_rpc_damageforcescale 2
+set g_balance_rpc_edgedamage 50
+set g_balance_rpc_force 400
+set g_balance_rpc_health 25
+set g_balance_rpc_lifetime 30
+set g_balance_rpc_radius 300
+set g_balance_rpc_refire 1
+set g_balance_rpc_speed 1250
+set g_balance_rpc_speedaccel 0
+set g_balance_rpc_speedstart 1250
+set g_balance_rpc_reload_ammo 10
+set g_balance_rpc_reload_time 1
+set g_balance_rpc_switchdelay_drop 0.2
+set g_balance_rpc_switchdelay_raise 0.2
+// }}}
+
set g_balance_fireball_switchdelay_drop 0.2
set g_balance_fireball_switchdelay_raise 0.2
// }}}
- set g_balance_hmg_speed 24000
- set g_balance_hmg_bulletconstant 115 // 13.1qu
+
+// {{{ heavy machine gun
+set g_balance_hmg_spread_min 0.02
+set g_balance_hmg_spread_max 0.05
+set g_balance_hmg_spread_add 0.01
+
+set g_balance_hmg_sustained_damage 10 // 200 dps
+set g_balance_hmg_sustained_headshotaddeddamage 0
+set g_balance_hmg_sustained_force 5
+set g_balance_hmg_sustained_spread 0.03
+set g_balance_hmg_sustained_refire 0.05
+set g_balance_hmg_sustained_ammo 1
+
++set g_balance_hmg_solidpenetration 32
+
+set g_balance_hmg_reload_ammo 120 //default: 30
+set g_balance_hmg_reload_time 1
+set g_balance_hmg_switchdelay_drop 0.2
+set g_balance_hmg_switchdelay_raise 0.2
+// }}}
+
+// {{{ RPC
+set g_balance_rpc_ammo 10
+set g_balance_rpc_animtime 1
+set g_balance_rpc_damage 150
+set g_balance_rpc_damage2 500
+set g_balance_rpc_damageforcescale 2
+set g_balance_rpc_edgedamage 50
+set g_balance_rpc_force 400
+set g_balance_rpc_health 25
+set g_balance_rpc_lifetime 30
+set g_balance_rpc_radius 300
+set g_balance_rpc_refire 1
+set g_balance_rpc_speed 1250
+set g_balance_rpc_speedaccel 0
+set g_balance_rpc_speedstart 1250
+set g_balance_rpc_reload_ammo 10
+set g_balance_rpc_reload_time 1
+set g_balance_rpc_switchdelay_drop 0.2
+set g_balance_rpc_switchdelay_raise 0.2
+// }}}
set g_balance_fireball_switchdelay_drop 0.2
set g_balance_fireball_switchdelay_raise 0.2
// }}}
- set g_balance_hmg_speed 24000
- set g_balance_hmg_bulletconstant 115 // 13.1qu
+
+// {{{ heavy machine gun
+set g_balance_hmg_spread_min 0.02
+set g_balance_hmg_spread_max 0.05
+set g_balance_hmg_spread_add 0.01
+
+set g_balance_hmg_sustained_damage 10 // 200 dps
+set g_balance_hmg_sustained_headshotaddeddamage 0
+set g_balance_hmg_sustained_force 5
+set g_balance_hmg_sustained_spread 0.03
+set g_balance_hmg_sustained_refire 0.05
+set g_balance_hmg_sustained_ammo 1
+
++set g_balance_hmg_solidpenetration 32
+
+set g_balance_hmg_reload_ammo 120 //default: 30
+set g_balance_hmg_reload_time 1
+set g_balance_hmg_switchdelay_drop 0.2
+set g_balance_hmg_switchdelay_raise 0.2
+// }}}
+
+// {{{ RPC
+set g_balance_rpc_ammo 10
+set g_balance_rpc_animtime 1
+set g_balance_rpc_damage 150
+set g_balance_rpc_damage2 500
+set g_balance_rpc_damageforcescale 2
+set g_balance_rpc_edgedamage 50
+set g_balance_rpc_force 400
+set g_balance_rpc_health 25
+set g_balance_rpc_lifetime 30
+set g_balance_rpc_radius 300
+set g_balance_rpc_refire 1
+set g_balance_rpc_speed 1250
+set g_balance_rpc_speedaccel 0
+set g_balance_rpc_speedstart 1250
+set g_balance_rpc_reload_ammo 10
+set g_balance_rpc_reload_time 1
+set g_balance_rpc_switchdelay_drop 0.2
+set g_balance_rpc_switchdelay_raise 0.2
+// }}}
--- /dev/null
- g_balance_shotgun_primary_bulletconstant 3000
+g_overkill_ammo_start 50
+g_overkill_ammo_max 100
+g_overkill_ammo_regen 2.52
+g_overkill_superguns_builtin 0
+
+g_use_ammunition 1
+sv_gibhealth 120
+g_spawnshieldtime 0.5
+
+g_balance_health_regen 0
+g_balance_health_regenlinear 100
+g_balance_health_rot 0
+g_balance_health_rotstable 200
+g_balance_armor_rotstable 0
+g_balance_armor_rotlinear 1
+g_balance_armor_rot 0
+g_balance_pause_health_regen 2
+
+g_balance_shotgun_primary_damage 17
+g_balance_shotgun_primary_bullets 10
+g_balance_shotgun_primary_force 80
+g_balance_shotgun_primary_spread 0.07
+g_balance_shotgun_primary_animtime 0.65
+g_balance_shotgun_primary_ammo 6.25
+g_balance_shotgun_reload_ammo 50
+g_balance_shotgun_reload_time 2
- g_balance_hmg_speed 24000
- g_balance_hmg_bulletconstant 115
+
+g_balance_uzi_mode 1
+g_balance_uzi_sustained_damage 25
+g_balance_uzi_sustained_refire 0.1
+g_balance_uzi_sustained_spread 0.01
+g_balance_uzi_sustained_force 5
+g_balance_uzi_reload_ammo 30
+g_balance_uzi_reload_time 1.5
+g_balance_uzi_spread_min 0
+g_balance_uzi_spread_add 0.0015
+g_balance_uzi_bulletconstant 500
+
+g_balance_hmg_spread_min 0.01
+g_balance_hmg_spread_max 0.06
+g_balance_hmg_spread_add 0.005
+
+g_balance_hmg_sustained_damage 30
+g_balance_hmg_sustained_headshotaddeddamage 0
+g_balance_hmg_sustained_force 10
+g_balance_hmg_sustained_spread 0.03
+g_balance_hmg_sustained_refire 0.05
+g_balance_hmg_sustained_ammo 1
+
++g_balance_hmg_solidpenetration 32
+
+g_balance_hmg_reload_ammo 100
+g_balance_hmg_reload_time 1
+
+g_balance_nex_primary_damage 100
+g_balance_nex_primary_force 500
+g_balance_nex_primary_refire 1
+g_balance_nex_primary_animtime 0.95
+g_balance_nex_primary_ammo 10
+g_balance_nex_primary_damagefalloff_mindist 0
+g_balance_nex_primary_damagefalloff_maxdist 0
+g_balance_nex_primary_damagefalloff_halflife 0
+g_balance_nex_primary_damagefalloff_forcehalflife 0
+
+g_balance_nex_secondary 1
+g_balance_nex_charge 0
+g_balance_nex_reload_ammo 50
+g_balance_nex_reload_time 2
+
+g_balance_rpc_ammo 10
+g_balance_rpc_animtime 1
+g_balance_rpc_damage 150
+g_balance_rpc_damage2 500
+g_balance_rpc_damageforcescale 2
+g_balance_rpc_edgedamage 50
+g_balance_rpc_force 400
+g_balance_rpc_health 25
+g_balance_rpc_lifetime 30
+g_balance_rpc_radius 300
+g_balance_rpc_refire 1
+g_balance_rpc_speed 2500
+g_balance_rpc_speedaccel 5000
+g_balance_rpc_reload_ammo 50
+g_balance_rpc_reload_time 1
+
+g_projectiles_newton_style_2_minfactor 1 // rocket will never fly below default speed, even if you move backwards
+
+g_overkill_nade_lifetime 3.5
+g_overkill_nade_minforce 400
+g_overkill_nade_maxforce 2000
+g_overkill_nade_health 25
+g_overkill_nade_refire 10
+
+g_overkill_nade_damage 225
+g_overkill_nade_edgedamage 90
+g_overkill_nade_radius 300
+g_overkill_nade_force 650
+g_overkill_nade_newton_style 0
+
+g_pickup_healthmega_anyway 0
+g_pikup_armorsmall_max 20
+g_pickup_armorsmall_anyway 0
+g_pickup_healthmega_max 200
+g_pickup_healthmega_anyway 0
+
+g_overkill_100a_anyway 1
+g_overkill_100h_anyway 1
+g_overkill_powerups_repalce 1
+g_overkill_superguns_onemag 1
+g_overkill_superguns_respawn_time 20
+
+sv_defaultcharacter 1
+sv_defaultplayermodel "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm"
+sv_defaultplayermodel_red "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm"
+sv_defaultplayermodel_blue "models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm"
precache_model("models/rocket.md3");
precache_model("models/tagrocket.md3");
precache_model("models/tracer.mdl");
-
+
precache_model("models/weapons/v_ok_grenade.md3");
+ precache_model("models/weapons/ok_rocket.md3");
precache_sound("weapons/electro_fly.wav");
precache_sound("weapons/rocket_fly.wav");
const float STAT_WEAPONS2 = 74;
const float STAT_WEAPONS3 = 75;
-const float STAT_MONSTERS_TOTAL = 76;
-const float STAT_MONSTERS_KILLED = 77;
+const float STAT_OK_AMMO_CHARGE = 76;
+const float STAT_OK_AMMO_CHARGEPOOl = 77;
+
++const float STAT_MONSTERS_TOTAL = 78;
++const float STAT_MONSTERS_KILLED = 79;
++
+
// mod stats (1xx)
const float STAT_REDALIVE = 100;
const float STAT_BLUEALIVE = 101;
MSG_INFO_NOTIF(1, INFO_WEAPON_HAGAR_SUICIDE, 2, 1, "s1 s2loc spree_lost", "s1", "weaponhagar", _("^BG%s^K1 played with tiny Hagar rockets%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_HLAC_MURDER, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponhlac", _("^BG%s%s^K1 was cut down with ^BG%s^K1's HLAC%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_HLAC_SUICIDE, 2, 1, "s1 s2loc spree_lost", "s1", "weaponhlac", _("^BG%s^K1 got a little jumpy with their HLAC%s%s"), "") \
++ MSG_INFO_NOTIF(1, INFO_WEAPON_HMG_MURDER_SNIPE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponhmg", _("^BG%s%s^K1 was sniped by ^BG%s^K1's Heavy Machine Gun%s%s"), "") \
++ MSG_INFO_NOTIF(1, INFO_WEAPON_HMG_MURDER_SPRAY, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponhmg", _("^BG%s%s^K1 was torn to bits by ^BG%s^K1's Heavy Machine Gun%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_HOOK_MURDER, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponhook", _("^BG%s%s^K1 was caught in ^BG%s^K1's Hook gravity bomb%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_KLEINBOTTLE_MURDER, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weapontuba", _("^BG%s%s^K1 died of ^BG%s^K1's great playing on the @!#%%'n Klein Bottle%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_KLEINBOTTLE_SUICIDE, 2, 1, "s1 s2loc spree_lost", "s1", "weapontuba", _("^BG%s^K1 hurt their own ears with the @!#%%'n Klein Bottle%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_ROCKETLAUNCHER_MURDER_DIRECT, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrocketlauncher", _("^BG%s%s^K1 ate ^BG%s^K1's rocket%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_ROCKETLAUNCHER_MURDER_SPLASH, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrocketlauncher", _("^BG%s%s^K1 got too close ^BG%s^K1's rocket%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_ROCKETLAUNCHER_SUICIDE, 2, 1, "s1 s2loc spree_lost", "s1", "weaponrocketlauncher", _("^BG%s^K1 blew themself up with their Rocketlauncher%s%s"), "") \
++ MSG_INFO_NOTIF(1, INFO_WEAPON_RPC_MURDER_DIRECT, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrpc", _("^BG%s%s^K1 got sawn in half by ^BG%s^K1's Rocket Propelled Chainsaw%s%s"), "") \
++ MSG_INFO_NOTIF(1, INFO_WEAPON_RPC_MURDER_SPLASH, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrpc", _("^BG%s%s^K1 almost dodged ^BG%s^K1's Rocket Propelled Chainsaw%s%s"), "") \
++ MSG_INFO_NOTIF(1, INFO_WEAPON_RPC_SUICIDE, 2, 1, "s1 s2loc spree_lost", "s1", "weaponrpc", _("^BG%s^K1 blew themself up with their Rocket Propelled Chainsaw%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_SEEKER_MURDER_SPRAY, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponseeker", _("^BG%s%s^K1 was pummeled by ^BG%s^K1's Seeker rockets%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_SEEKER_MURDER_TAG, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponseeker", _("^BG%s%s^K1 was tagged by ^BG%s^K1's Seeker%s%s"), "") \
MSG_INFO_NOTIF(1, INFO_WEAPON_SEEKER_SUICIDE, 2, 1, "s1 s2loc spree_lost", "s1", "weaponseeker", _("^BG%s^K1 played with tiny Seeker rockets%s%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO, 0, 0, "", CPID_MINSTA_FINDAMMO, "1 9", _("^F4^COUNT^BG left to find some ammo!"), "") \
MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO_FIRST, 0, 0, "", CPID_MINSTA_FINDAMMO, "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("^BGGet some ammo! ^F4^COUNT^BG left!")) \
MSG_CENTER_NOTIF(1, CENTER_MINSTA_LIVES_REMAINING, 0, 1, "f1", NO_CPID, "0 0", _("^F2Extra lives remaining: ^K1%s"), "") \
-- MSG_CENTER_NOTIF(1, CENTER_MINSTA_SECONDARY, 0, 0, "", NO_CPID, "0 0", _("^BGSecondary fire inflicts no damage!"), "") \
MSG_CENTER_NOTIF(1, CENTER_MOTD, 1, 0, "s1", CPID_MOTD, "-1 0", _("^BG%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_NIX_COUNTDOWN, 0, 2, "item_wepname", CPID_NIX, "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_NIX_NEWWEAPON, 0, 1, "item_wepname", CPID_NIX, "0 0", _("^F2Active weapon: ^F1%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_POWERUP_SPEED, 0, 0, "", CPID_POWERUP, "0 0", _("^F2You are on speed"), "") \
MSG_CENTER_NOTIF(1, CENTER_POWERUP_STRENGTH, 0, 0, "", CPID_POWERUP, "0 0", _("^F2Strength infuses your weapons with devastating power"), "") \
MSG_CENTER_NOTIF(1, CENTER_RACE_FINISHLAP, 0, 0, "", CPID_RACE_FINISHLAP, "0 0", _("^F2The race is over, finish your lap!"), "") \
++ MSG_CENTER_NOTIF(1, CENTER_SECONDARY_NODAMAGE, 0, 0, "", NO_CPID, "0 0", _("^BGSecondary fire inflicts no damage!"), "") \
MSG_CENTER_NOTIF(1, CENTER_SUPERWEAPON_BROKEN, 0, 0, "", CPID_POWERUP, "0 0", _("^F2Superweapons have broken down"), "") \
MSG_CENTER_NOTIF(1, CENTER_SUPERWEAPON_LOST, 0, 0, "", CPID_POWERUP, "0 0", _("^F2Superweapons have been lost"), "") \
MSG_CENTER_NOTIF(1, CENTER_SUPERWEAPON_PICKUP, 0, 0, "", CPID_POWERUP, "0 0", _("^F2You now have a superweapon"), "") \
float autocvar_sv_gameplayfix_gravityunaffectedbyticrate;
float autocvar_g_trueaim_minrange;
float autocvar_g_debug_defaultsounds;
- float autocvar_g_balance_hmg_bulletconstant;
- float autocvar_g_balance_hmg_speed;
++float autocvar_g_balance_hmg_solidpenetration;
+float autocvar_g_balance_hmg_spread_add;
+float autocvar_g_balance_hmg_spread_max;
+float autocvar_g_balance_hmg_spread_min;
+float autocvar_g_balance_hmg_sustained_ammo;
+float autocvar_g_balance_hmg_sustained_damage;
+float autocvar_g_balance_hmg_sustained_force;
+float autocvar_g_balance_hmg_sustained_refire;
+float autocvar_g_balance_hmg_reload_ammo;
+float autocvar_g_balance_hmg_reload_time;
+float autocvar_g_balance_rpc_ammo;
+float autocvar_g_balance_rpc_animtime;
+float autocvar_g_balance_rpc_damage;
+float autocvar_g_balance_rpc_damage2;
+float autocvar_g_balance_rpc_damageforcescale;
+float autocvar_g_balance_rpc_edgedamage;
+float autocvar_g_balance_rpc_force;
+float autocvar_g_balance_rpc_health;
+float autocvar_g_balance_rpc_lifetime;
+float autocvar_g_balance_rpc_radius;
+float autocvar_g_balance_rpc_refire;
+float autocvar_g_balance_rpc_speed;
+float autocvar_g_balance_rpc_speedaccel;
+float autocvar_g_balance_rpc_reload_ammo;
+float autocvar_g_balance_rpc_reload_time;
float autocvar_g_grab_range;
float autocvar_g_sandbox_info;
float autocvar_g_sandbox_readonly;
entity e;
e = get_weaponinfo(self.weapon);
+
+ if(cvar("g_overkill"))
+ if(autocvar_g_overkill_ammo_charge)
+ return; // TODO
// don't reload weapons that don't have the RELOADABLE flag
- if not(e.spawnflags & WEP_FLAG_RELOADABLE)
+ if (!(e.spawnflags & WEP_FLAG_RELOADABLE))
{
dprint("Warning: Attempted to reload a weapon that does not have the WEP_FLAG_RELOADABLE flag. Fix your code!\n");
return;
// load mutators
#define CHECK_MUTATOR_ADD(mut_cvar,mut_name,dependence) \
{ if(cvar(mut_cvar) && dependence) { MUTATOR_ADD(mut_name); } }
-
+
CHECK_MUTATOR_ADD("g_dodging", mutator_dodging, 1);
- CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, 1);
+ CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, teamplay);
CHECK_MUTATOR_ADD("g_physical_items", mutator_physical_items, 1);
CHECK_MUTATOR_ADD("g_touchexplode", mutator_touchexplode, 1);
CHECK_MUTATOR_ADD("g_minstagib", mutator_minstagib, 1);
CHECK_MUTATOR_ADD("g_nades", mutator_nades, 1);
CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1);
CHECK_MUTATOR_ADD("g_campcheck", mutator_campcheck, 1);
-
+ CHECK_MUTATOR_ADD("g_overkill", mutator_overkill, !cvar("g_minstagib"));
+
#undef CHECK_MUTATOR_ADD
-
+
if(cvar("sv_allow_fullbright"))
serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
if (frag_target != frag_attacker)
{
if (frag_target.health >= 1)
-- Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_MINSTA_SECONDARY);
++ Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE);
frag_force = '0 0 0';
// keep mirrorfrag_force
//frag_attacker = frag_target;
--- /dev/null
- if not(autocvar_g_overkill_ammo_charge) return;
+void ok_DecreaseCharge(entity ent, float wep)
+{
- if(wepent.netname == "")
++ if(!ent.ok_use_ammocharge) return;
+
+ entity wepent = get_weaponinfo(wep);
+
- if(wepent.netname == "")
++ if(wepent.weapon == 0)
+ return; // dummy
+
+ ent.ammo_charge[wep] -= cvar(sprintf("g_overkill_ammo_decharge_%s", wepent.netname));
+}
+
+void ok_IncreaseCharge(entity ent, float wep)
+{
+ entity wepent = get_weaponinfo(wep);
+
- if(autocvar_g_overkill_ammo_charge)
- if not(ent.BUTTON_ATCK)
- if(ent.ammo_charge[wep] <= autocvar_g_overkill_ammo_charge_limit)
++ if(wepent.weapon == 0)
+ return; // dummy
+
- if not(autocvar_g_overkill_ammo_charge) return TRUE;
- //if(wep != swep) return TRUE; // switching, don't even bother checking
++ if(ent.ok_use_ammocharge)
++ if(!ent.BUTTON_ATCK) // not while attacking?
+ ent.ammo_charge[wep] = min(autocvar_g_overkill_ammo_charge_limit, ent.ammo_charge[wep] + cvar(sprintf("g_overkill_ammo_charge_rate_%s", wepent.netname)) * frametime / W_TICSPERFRAME);
+}
+
+float ok_CheckWeaponCharge(entity ent, float wep)
+{
- if(wepent.netname == "")
++ if(!ent.ok_use_ammocharge) return TRUE;
+
+ entity wepent = get_weaponinfo(wep);
+
- return !(ent.ammo_charge[wep] < cvar(sprintf("g_overkill_ammo_decharge_%s", wepent.netname)));
++ if(wepent.weapon == 0)
+ return 0; // dummy
+
- if(DEATH_ISWEAPON(frag_deathtype, WEP_LASER) && frag_target == frag_attacker)
++ return (ent.ammo_charge[wep] >= cvar(sprintf("g_overkill_ammo_decharge_%s", wepent.netname)));
+}
+
+void start_hmg()
+{
+ self.classname = "weapon_hmg";
+ self.respawntime = autocvar_g_overkill_superguns_respawn_time;
+ self.ok_item = TRUE;
+ setmodel(self, "models/weapons/g_ok_hmg.md3");
++ self.pickup_anyway = TRUE;
+ spawnfunc_weapon_hmg();
+}
+
+void start_rpc()
+{
+ self.classname = "weapon_rpc";
+ self.respawntime = autocvar_g_overkill_superguns_respawn_time;
+ self.ok_item = TRUE;
++ self.pickup_anyway = TRUE;
+ setmodel(self, "models/weapons/g_ok_rl.md3");
+ spawnfunc_weapon_rpc();
+}
+
+MUTATOR_HOOKFUNCTION(ok_PlayerDamage_Calculate)
+{
- if(!IS_PLAYER(frag_target) || frag_target == frag_attacker)
- return FALSE;
-
- if not (DEATH_ISWEAPON(frag_deathtype, WEP_LASER))
- return FALSE;
-
- frag_damage = 0;
- if(frag_target.health >= 1 && !frag_target.freezetag_frozen)
- Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_MINSTA_SECONDARY);
-
- frag_force = '0 0 0';
++ if(IS_PLAYER(frag_attacker) && IS_PLAYER(frag_target))
++ if(DEATH_ISWEAPON(frag_deathtype, WEP_LASER))
++ {
+ frag_damage = 0;
+
- MUTATOR_HOOKFUNCTION(ok_BuildMutatorsString)
++ if(frag_attacker != frag_target)
++ {
++ if(frag_target.health >= 1 && !frag_target.freezetag_frozen && frag_target.deadflag == DEAD_NO)
++ Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE);
++ frag_force = '0 0 0';
++ }
++ }
+
+ return FALSE;
+}
+
- ret_string = strcat(ret_string, ":OK");
- return FALSE;
- }
++MUTATOR_HOOKFUNCTION(ok_PlayerDies)
+{
- MUTATOR_HOOKFUNCTION(ok_BuildMutatorsPrettyString)
- {
- ret_string = strcat(ret_string, ", Overkill");
- return FALSE;
- }
++ entity oldself = self;
+
- MUTATOR_HOOKFUNCTION(ok_PlayerDies)
- {
++ if(other.flags & FL_MONSTER)
++ other.monster_loot = func_null; // this hook is shared with monsters
+
-
- entity oldself = self;
-
+ self.ok_lastwep = self.weapon;
+ self.ok_deathloc = self.origin;
- if(self.deadflag != DEAD_NO || !IS_PLAYER(self))
- return FALSE;
-
- if(self.freezetag_frozen)
+ self = spawn();
+ self.ok_item = TRUE;
+ self.noalign = TRUE;
++ self.pickup_anyway = TRUE;
+ spawnfunc_item_armor_small();
+ self.movetype = MOVETYPE_TOSS;
+ self.gravity = 1;
+ self.reset = SUB_Remove;
+ setorigin(self, frag_target.origin + '0 0 32');
+ self.velocity = '0 0 200' + normalize(frag_attacker.origin - self.origin) * 500;
+ self.classname = "droppedweapon"; // hax
+ SUB_SetFade(self, time + 5, 1);
+ self = oldself;
+
+ return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(ok_ForbidThrowCurrentWeapon)
+{
+ return TRUE;
+}
+
+MUTATOR_HOOKFUNCTION(ok_PlayerPreThink)
+{
+ if(intermission_running || gameover)
+ return FALSE;
+
- if(self.jump_interval <= time)
++ if(self.deadflag != DEAD_NO || !IS_PLAYER(self) || self.freezetag_frozen)
+ return FALSE;
+
+ ok_IncreaseCharge(self, self.weapon);
+
+ if(self.BUTTON_ATCK2)
+ if(!forbidWeaponUse() || self.weapon_blocked) // allow if weapon is blocked
- self.stat_ok_ammo_charge = self.ammo_charge[self.weapon];
++ if(time >= self.jump_interval)
+ {
+ self.jump_interval = time + autocvar_g_balance_laser_primary_refire * W_WeaponRateFactor();
+ makevectors(self.v_angle);
+ float w = self.weapon;
+ self.weapon = WEP_LASER;
+ W_Laser_Attack(3);
+ self.weapon = w;
+ }
+
+ self.weapon_blocked = FALSE;
+
- if(autocvar_g_overkill_ammo_charge)
++ self.ok_ammo_charge = self.ammo_charge[self.weapon];
+
- MUTATOR_HOOKFUNCTION(ok_FilterItem)
++ if(self.ok_use_ammocharge)
+ if(!ok_CheckWeaponCharge(self, self.weapon))
+ {
+ if(autocvar_g_overkill_ammo_charge_notice && time > self.ok_notice_time && self.BUTTON_ATCK && IS_REAL_CLIENT(self))
+ {
+ //Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_OVERKILL_CHARGE);
+ self.ok_notice_time = time + 2;
+ play2(self, "weapons/dryfire.wav");
+ }
+ if(self.weaponentity.state != WS_CLEAR)
+ w_ready();
+
+ self.weapon_blocked = TRUE;
+ }
+
+ self.BUTTON_ATCK2 = 0;
+
+ return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(ok_PlayerSpawn)
+{
+ if(autocvar_g_overkill_ammo_charge)
+ {
+ float i;
+
+ for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+ self.ammo_charge[i] = autocvar_g_overkill_ammo_charge_limit;
+
+ self.ok_use_ammocharge = 1;
+ self.ok_notice_time = time;
+ }
+ else
+ self.ok_use_ammocharge = 0;
+
+ return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(ok_OnEntityPreSpawn)
+{
+ if(autocvar_g_powerups)
+ if(autocvar_g_overkill_powerups_replace)
+ if(self.classname == "item_strength")
+ {
+ entity wep = spawn();
+ setorigin(wep, self.origin);
+ wep.ok_item = TRUE;
+ wep.think = start_hmg;
+ wep.nextthink = time + 0.1;
+ wep.noalign = self.noalign;
+ return TRUE;
+ }
+
+ if(autocvar_g_powerups)
+ if(autocvar_g_overkill_powerups_replace)
+ if(self.classname == "item_invincible")
+ {
+ entity wep = spawn();
+ setorigin(wep, self.origin);
+ wep.ok_item = TRUE;
+ wep.think = start_rpc;
+ wep.nextthink = time + 0.1;
+ wep.noalign = self.noalign;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
- switch(self.classname)
++MUTATOR_HOOKFUNCTION(ok_ItemRemove)
+{
+ if(self.ok_item)
+ return FALSE;
+
- case "item_health_mega": return !(autocvar_g_overkill_100h_anyway);
- case "item_armor_large": return !(autocvar_g_overkill_100a_anyway);
++ switch(self.items)
+ {
-
++ case IT_HEALTH: return !(autocvar_g_overkill_100h_anyway);
++ case IT_ARMOR: return !(autocvar_g_overkill_100a_anyway);
+ }
- MUTATOR_HOOKFUNCTION(ok_SetModname)
- {
- modname = "Overkill";
- return TRUE;
- }
-
++
+ return TRUE;
+}
+
+MUTATOR_HOOKFUNCTION(ok_SpectateCopy)
+{
+ self.ammo_charge[self.weapon] = other.ammo_charge[other.weapon];
+ self.ok_use_ammocharge = other.ok_use_ammocharge;
+
+ return FALSE;
+}
+
- start_weapons = (WEPSET_UZI | WEPSET_NEX | WEPSET_SHOTGUN);
+MUTATOR_HOOKFUNCTION(ok_StartItems)
+{
+ start_items |= IT_UNLIMITED_WEAPON_AMMO;
-
++ start_weapons = warmup_start_weapons = (WEPSET_UZI | WEPSET_NEX | WEPSET_SHOTGUN);
+
+ start_ammo_nails = start_ammo_cells = start_ammo_shells = start_ammo_rockets =
+ warmup_start_ammo_nails = warmup_start_ammo_cells = warmup_start_ammo_shells = warmup_start_ammo_rockets = autocvar_g_overkill_ammo_start;
+
+ return FALSE;
+}
+
++MUTATOR_HOOKFUNCTION(ok_BuildMutatorsString)
++{
++ ret_string = strcat(ret_string, ":OK");
++ return FALSE;
++}
++
++MUTATOR_HOOKFUNCTION(ok_BuildMutatorsPrettyString)
++{
++ ret_string = strcat(ret_string, ", Overkill");
++ return FALSE;
++}
++
++MUTATOR_HOOKFUNCTION(ok_SetModname)
++{
++ modname = "Overkill";
++ return TRUE;
++}
++
+void ok_Initialize()
+{
+ precache_all_playermodels("models/ok_player/*.dpm");
+
+ precache_model("models/weapons/h_ok_rl.iqm");
+ precache_model("models/weapons/v_ok_rl.md3");
+ precache_model("models/weapons/g_ok_rl.md3");
+ precache_model("models/weapons/ok_rocket.md3");
+
+ precache_model("models/weapons/h_ok_mg.iqm");
+ precache_model("models/weapons/v_ok_mg.md3");
+ precache_model("models/weapons/g_ok_mg.md3");
+
+ precache_model("models/weapons/h_ok_hmg.iqm");
+ precache_model("models/weapons/v_ok_hmg.md3");
+ precache_model("models/weapons/g_ok_hmg.md3");
+
+ precache_model("models/weapons/h_ok_shotgun.iqm");
+ precache_model("models/weapons/v_ok_shotgun.md3");
+ precache_model("models/weapons/g_ok_shotgun.md3");
+
+ precache_model("models/weapons/h_ok_sniper.iqm");
+ precache_model("models/weapons/v_ok_sniper.md3");
+ precache_model("models/weapons/g_ok_sniper.md3");
+
+ precache_sound("weapons/dryfire.wav");
- addstat(STAT_OK_AMMO_CHARGEPOOl, AS_FLOAT, stat_ok_ammo_charge);
++
+ addstat(STAT_OK_AMMO_CHARGE, AS_FLOAT, ok_use_ammocharge);
- MUTATOR_HOOK(BuildMutatorsString, ok_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, ok_BuildMutatorsPrettyString, CBC_ORDER_ANY);
++ addstat(STAT_OK_AMMO_CHARGEPOOl, AS_FLOAT, ok_ammo_charge);
+
+ w_uzi(WR_PRECACHE);
+ w_nex(WR_PRECACHE);
+ w_shotgun(WR_PRECACHE);
+ w_laser(WR_PRECACHE);
+
+ (get_weaponinfo(WEP_RPC)).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+ (get_weaponinfo(WEP_HMG)).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+
+ (get_weaponinfo(WEP_SHOTGUN)).mdl = "ok_shotgun";
+ (get_weaponinfo(WEP_UZI)).mdl = "ok_mg";
+ (get_weaponinfo(WEP_NEX)).mdl = "ok_sniper";
+
+ string s;
+ float fh = fopen("overkill.cfg", FILE_READ);
+ if(fh >= 0)
+ {
+ while((s = fgets(fh)))
+ {
+ tokenize_console(s);
+ if not(argv(0) == "" || argv(1) == "//" || argv(1) == "")
+ cvar_settemp(argv(0), argv(1));
+ }
+ fclose(fh);
+ }
+ else
+ dprint("^1Mutator Overkill: WARNING! overkill.cfg NOT found, things will be strange!\n");
+}
+
+MUTATOR_DEFINITION(mutator_overkill)
+{
+ MUTATOR_HOOK(ForbidThrowCurrentWeapon, ok_ForbidThrowCurrentWeapon, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, ok_PlayerSpawn, CBC_ORDER_LAST);
+ MUTATOR_HOOK(PlayerPreThink, ok_PlayerPreThink, CBC_ORDER_LAST);
- MUTATOR_HOOK(SetModname, ok_SetModname, CBC_ORDER_ANY);
- MUTATOR_HOOK(FilterItem, ok_FilterItem, CBC_ORDER_ANY);
++ MUTATOR_HOOK(PlayerSpawn, ok_PlayerSpawn, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerDamage_Calculate, ok_PlayerDamage_Calculate, CBC_ORDER_LAST);
+ MUTATOR_HOOK(PlayerDies, ok_PlayerDies, CBC_ORDER_ANY);
+ MUTATOR_HOOK(OnEntityPreSpawn, ok_OnEntityPreSpawn, CBC_ORDER_ANY);
++ MUTATOR_HOOK(FilterItem, ok_ItemRemove, CBC_ORDER_ANY);
++ MUTATOR_HOOK(MonsterDropItem, ok_PlayerDies, CBC_ORDER_ANY);
+ MUTATOR_HOOK(SpectateCopy, ok_SpectateCopy, CBC_ORDER_ANY);
+ MUTATOR_HOOK(SetStartItems, ok_StartItems, CBC_ORDER_ANY);
++ MUTATOR_HOOK(BuildMutatorsString, ok_BuildMutatorsString, CBC_ORDER_ANY);
++ MUTATOR_HOOK(BuildMutatorsPrettyString, ok_BuildMutatorsPrettyString, CBC_ORDER_ANY);
++ MUTATOR_HOOK(SetModname, ok_SetModname, CBC_ORDER_ANY);
+
+ MUTATOR_ONADD
+ {
+ ok_Initialize();
+ }
+
+ MUTATOR_ONREMOVE
+ {
+ (get_weaponinfo(WEP_RPC)).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+ (get_weaponinfo(WEP_HMG)).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+ }
+
+ return FALSE;
+}
--- /dev/null
- .float stat_ok_ammo_charge;
+.vector ok_deathloc;
+.float ok_spawnsys_timer;
+.float ok_lastwep;
+.float ok_item;
+
+.float ok_notice_time;
+.float ammo_charge[WEP_MAXCOUNT];
+.float ok_use_ammocharge;
++.float ok_ammo_charge;
+
+void(entity ent, float wep) ok_DecreaseCharge;
+
mutators/gamemode_keepaway.qh
mutators/gamemode_nexball.qh
mutators/gamemode_lms.qh
+ mutators/gamemode_invasion.qh
mutators/mutator_dodging.qh
mutators/mutator_nades.qh
+mutators/mutator_overkill.qh
//// tZork Turrets ////
tturrets/include/turrets_early.qh
--- /dev/null
- /* WEP_##id */ HMG,
- /* function */ w_hmg,
- /* ammotype */ IT_NAILS,
- /* impulse */ 3,
- /* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_SUPERWEAPON,
- /* rating */ BOT_PICKUP_RATING_HIGH,
- /* model */ "ok_hmg",
+#ifdef REGISTER_WEAPON
+REGISTER_WEAPON(
- /* fullname */ _("Heavy Machine Gun")
++/* WEP_##id */ HMG,
++/* function */ w_hmg,
++/* ammotype */ IT_NAILS,
++/* impulse */ 3,
++/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_SUPERWEAPON,
++/* rating */ BOT_PICKUP_RATING_HIGH,
++/* model */ "ok_hmg",
+/* shortname */ "hmg",
- if (!weapon_action(self.weapon, WR_CHECKAMMO1))
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
++/* fullname */ _("Heavy Machine Gun")
+);
+#else
+#ifdef SVQC
+
+// weapon frames
+
+void hmg_fire_auto()
+{
+ float uzi_spread;
+
+ if (!self.BUTTON_ATCK)
+ {
+ w_ready();
+ return;
+ }
+
+ if(autocvar_g_balance_hmg_reload_ammo)
- W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_hmg_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_hmg_sustained_damage);
- if not(autocvar_g_norecoil)
++ if(!weapon_action(self.weapon, WR_CHECKAMMO1))
++ if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
+ {
+ W_SwitchWeapon_Force(self, w_getbestweapon(self));
+ w_ready();
+ return;
+ }
+
+ W_DecreaseAmmo(ammo_nails, autocvar_g_balance_hmg_sustained_ammo, autocvar_g_balance_hmg_reload_ammo);
+
- fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_hmg_speed, 5, autocvar_g_balance_hmg_sustained_damage, autocvar_g_balance_hmg_sustained_force, WEP_HMG, 0, 1, autocvar_g_balance_hmg_bulletconstant);
- endFireBallisticBullet();
++ W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_hmg_sustained_damage);
++
++ if(!autocvar_g_norecoil)
+ {
+ self.punchangle_x = random () - 0.5;
+ self.punchangle_y = random () - 0.5;
+ }
+
+ uzi_spread = bound(autocvar_g_balance_hmg_spread_min, autocvar_g_balance_hmg_spread_min + (autocvar_g_balance_hmg_spread_add * self.misc_bulletcounter), autocvar_g_balance_hmg_spread_max);
- {
++ fireBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_hmg_solidpenetration, autocvar_g_balance_hmg_sustained_damage, autocvar_g_balance_hmg_sustained_force, WEP_HMG, 0);
+
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
+
+ pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
+
+ UziFlash();
+ W_AttachToShotorg(self.muzzle_flash, '5 0 0');
+
+ if (autocvar_g_casings >= 2) // casing code
+ SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
+
+ ATTACK_FINISHED(self) = time + autocvar_g_balance_hmg_sustained_refire * W_WeaponRateFactor();
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hmg_sustained_refire, hmg_fire_auto);
+}
+
+void spawnfunc_weapon_hmg()
- weapon_action(self.weapon, WR_RELOAD);
++{
+ weapon_defaultspawnfunc(WEP_HMG);
+}
+
+float w_hmg(float req)
+{
+ float ammo_amount;
+ if (req == WR_AIM)
+ if(vlen(self.origin-self.enemy.origin) < 3000 - bound(0, skill, 10) * 200)
+ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
+ else
+ {
+ self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
+ }
+ else if (req == WR_THINK)
+ {
+ if(autocvar_g_balance_hmg_reload_ammo && self.clip_load < autocvar_g_balance_hmg_sustained_ammo) // forced reload
-
- /*
- if(self.BUTTON_ATCK2)
- if(weapon_prepareattack(1, 0))
- {
- if (!weapon_action(self.weapon, WR_CHECKAMMO2))
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- W_SwitchWeapon_Force(self, w_getbestweapon(self));
- w_ready();
- return FALSE;
- }
-
- W_DecreaseAmmo(ammo_nails, autocvar_g_balance_hmg_burst_ammo, autocvar_g_balance_hmg_reload_ammo);
-
- self.misc_bulletcounter = autocvar_g_balance_hmg_burst * -1;
- uzi_mode1_fire_burst();
- }
- */
++ weapon_action(self.weapon, WR_RELOAD);
+ else
+ {
+ if (self.BUTTON_ATCK)
+ if (weapon_prepareattack(0, 0))
+ {
+ self.misc_bulletcounter = 0;
+ hmg_fire_auto();
+ }
- precache_sound ("weapons/uzi_fire.wav");
+ }
+ }
+ else if (req == WR_PRECACHE)
+ {
+ precache_model ("models/uziflash.md3");
+ precache_model ("models/weapons/g_ok_hmg.md3");
+ precache_model ("models/weapons/v_ok_hmg.md3");
+ precache_model ("models/weapons/h_ok_hmg.iqm");
- ammo_amount = self.ammo_nails >= autocvar_g_balance_hmg_sustained_ammo;
++ precache_sound ("weapons/uzi_fire.wav");
+ }
+ else if (req == WR_SETUP)
+ {
+ weapon_setup(WEP_HMG);
+ self.current_ammo = ammo_nails;
+ }
+ else if (req == WR_CHECKAMMO1)
+ {
- if(autocvar_g_balance_hmg_reload_ammo)
- ammo_amount += self.(weapon_load[WEP_HMG]) >= autocvar_g_balance_hmg_sustained_ammo;
-
++ ammo_amount = self.ammo_nails >= autocvar_g_balance_hmg_sustained_ammo;
++
++ if(autocvar_g_balance_hmg_reload_ammo)
++ ammo_amount += self.(weapon_load[WEP_HMG]) >= autocvar_g_balance_hmg_sustained_ammo;
+
- ammo_amount = self.ammo_nails >= autocvar_g_balance_hmg_sustained_ammo;
+ return ammo_amount;
+ }
+ else if (req == WR_CHECKAMMO2)
+ {
- ammo_amount += self.(weapon_load[WEP_HMG]) >= autocvar_g_balance_hmg_sustained_ammo;
-
++ ammo_amount = self.ammo_nails >= autocvar_g_balance_hmg_sustained_ammo;
+
+ if(autocvar_g_balance_hmg_reload_ammo)
++ ammo_amount += self.(weapon_load[WEP_HMG]) >= autocvar_g_balance_hmg_sustained_ammo;
++
+ return ammo_amount;
+ }
+ else if (req == WR_RELOAD)
+ {
+ W_Reload(autocvar_g_balance_hmg_sustained_ammo, autocvar_g_balance_hmg_reload_ammo, autocvar_g_balance_hmg_reload_time, "weapons/reload.wav");
+ }
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_THINKING_WITH_PORTALS;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_HMG_MURDER_SNIPE;
+ else
+ return WEAPON_HMG_MURDER_SPRAY;
+ }
+ return TRUE;
+}
+#endif
+#ifdef CSQC
+float w_hmg(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.05)
+ sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM);
+ else if(w_random < 0.1)
+ sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM);
+ else if(w_random < 0.2)
+ sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/ric1.wav");
+ precache_sound("weapons/ric2.wav");
+ precache_sound("weapons/ric3.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
--- /dev/null
- /* WEP_##id */ RPC,
- /* function */ w_rpc,
- /* ammotype */ IT_ROCKETS,
- /* impulse */ 7,
- /* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_SUPERWEAPON,
- /* rating */ BOT_PICKUP_RATING_HIGH,
- /* model */ "ok_rl",
+#ifdef REGISTER_WEAPON
+REGISTER_WEAPON(
- /* fullname */ _("Rocket Propelled Chainsaw")
++/* WEP_##id */ RPC,
++/* function */ w_rpc,
++/* ammotype */ IT_ROCKETS,
++/* impulse */ 7,
++/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_SUPERWEAPON,
++/* rating */ BOT_PICKUP_RATING_HIGH,
++/* model */ "ok_rl",
+/* shortname */ "rpc",
- if(WarpZone_Projectile_Touch())
++/* fullname */ _("Rocket Propelled Chainsaw")
+);
+#else
+#ifdef SVQC
+
+void W_RPC_Explode()
+{
+ self.event_damage = func_null;
+ self.takedamage = DAMAGE_NO;
+
+ RadiusDamage (self, self.realowner, autocvar_g_balance_rpc_damage, autocvar_g_balance_rpc_edgedamage, autocvar_g_balance_rpc_radius, world, autocvar_g_balance_rpc_force, self.projectiledeathtype, other);
+
+ remove (self);
+}
+
+void W_RPC_Touch (void)
+{
- return;
-
++ if(WarpZone_Projectile_Touch())
+ if(wasfreed(self))
- // return;
-
++ return;
++
+ //if(other.solid != SOLID_BSP)
-
++ // return;
++
+ W_RPC_Explode();
+}
+
+void W_RPC_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+ if (self.health <= 0)
+ return;
-
++
+ if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+ return; // g_projectiles_damage says to halt
-
++
+ self.health = self.health - damage;
- W_PrepareExplosionByDamage(attacker, W_RPC_Explode);
++
+ if (self.health <= 0)
- if(self.cnt <= time)
- {
- remove(self);
- return;
- }
-
- self.cnt = vlen(self.velocity);
- self.wait = self.cnt * sys_frametime;
- self.pos1 = normalize(self.velocity);
-
- tracebox(self.origin, self.mins, self.maxs, self.origin + self.pos1 * (2 * self.wait), MOVE_NORMAL, self);
++ W_PrepareExplosionByDamage(attacker, W_RPC_Explode);
+}
+
+void W_RPC_Think()
+{
- Damage (trace_ent, self, self.realowner, autocvar_g_balance_rpc_damage2, self.projectiledeathtype, self.origin, normalize(self.origin - other.origin) * autocvar_g_balance_rpc_force);
-
- self.velocity = self.pos1 * (self.cnt + (autocvar_g_balance_rpc_speedaccel * sys_frametime));
-
- UpdateCSQCProjectile(self);
- self.nextthink = time;
++ if(self.cnt <= time)
++ {
++ remove(self);
++ return;
++ }
++
++ self.cnt = vlen(self.velocity);
++ self.wait = self.cnt * sys_frametime;
++ self.pos1 = normalize(self.velocity);
++
++ tracebox(self.origin, self.mins, self.maxs, self.origin + self.pos1 * (2 * self.wait), MOVE_NORMAL, self);
+ if(IS_PLAYER(trace_ent))
-
++ Damage (trace_ent, self, self.realowner, autocvar_g_balance_rpc_damage2, self.projectiledeathtype, self.origin, normalize(self.origin - other.origin) * autocvar_g_balance_rpc_force);
++
++ self.velocity = self.pos1 * (self.cnt + (autocvar_g_balance_rpc_speedaccel * sys_frametime));
++
++ UpdateCSQCProjectile(self);
++ self.nextthink = time;
+}
+
+void W_RPC_Attack (void)
+{
+ entity missile = spawn(); //WarpZone_RefSys_SpawnSameRefSys(self);
+ entity flash = spawn ();
- PROJECTILE_MAKETRIGGER(missile);
-
++
+ W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_rpc_ammo, autocvar_g_balance_rpc_reload_ammo);
+ W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, autocvar_g_balance_rpc_damage);
+ pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- missile.bot_dodgerating = autocvar_g_balance_rpc_damage * 2;
++ PROJECTILE_MAKETRIGGER(missile);
++
+ missile.owner = missile.realowner = self;
+ missile.bot_dodge = TRUE;
-
++ missile.bot_dodgerating = autocvar_g_balance_rpc_damage * 2;
+
+ missile.takedamage = DAMAGE_YES;
+ missile.damageforcescale = autocvar_g_balance_rpc_damageforcescale;
+ missile.health = autocvar_g_balance_rpc_health;
+ missile.event_damage = W_RPC_Damage;
+ missile.damagedbycontents = TRUE;
+ missile.movetype = MOVETYPE_FLY;
-
++
+ missile.projectiledeathtype = WEP_RPC;
+ setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
+
+ setorigin (missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
+ W_SetupProjectileVelocity(missile, autocvar_g_balance_rpc_speed, 0);
+
+ missile.touch = W_RPC_Touch;
- missile.nextthink = time;
++
+ missile.think = W_RPC_Think;
+ //missile.think = SUB_Remove;
+ missile.cnt = time + autocvar_g_balance_rpc_lifetime;
-
- setmodel (flash, "models/flash.md3"); // precision set below
++ missile.nextthink = time;
+ //missile.nextthink = time + autocvar_g_balance_rpc_lifetime;
+ missile.flags = FL_PROJECTILE;
+
+ CSQCProjectile(missile, TRUE, PROJECTILE_RPC, FALSE);
+ //CSQCProjectile(missile, TRUE, PROJECTILE_ROCKET, FALSE);
- missile.pos1 = missile.velocity;
-
++
++ setmodel(flash, "models/flash.md3"); // precision set below
+ SUB_SetFade (flash, time, 0.1);
+ flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+ W_AttachToShotorg(flash, '5 0 0');
- {
++ missile.pos1 = missile.velocity;
++
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ //BITXOR_ASSIGN(self.weaponentity.effects, EF_RESTARTANIM_BIT);
+}
+
+void spawnfunc_weapon_rpc()
- // to-do
++{
+ weapon_defaultspawnfunc(WEP_RPC);
+}
+
+float w_rpc(float req)
+{
+ float ammo_amount = FALSE;
+
+ if (req == WR_AIM)
+ {
+ self.BUTTON_ATCK = bot_aim(autocvar_g_balance_rpc_speed, 0, autocvar_g_balance_rpc_lifetime, FALSE);
+ }
+ else if (req == WR_THINK)
+ {
+ if(autocvar_g_balance_rpc_reload_ammo && self.clip_load < autocvar_g_balance_rpc_ammo)
+ weapon_action(self.weapon, WR_RELOAD);
+ else
+ {
+ if (self.BUTTON_ATCK)
+ {
+ if(weapon_prepareattack(0, autocvar_g_balance_rpc_refire))
+ {
+ W_RPC_Attack();
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_rpc_animtime, w_ready);
+ }
+ }
+
+ if (self.BUTTON_ATCK2)
+ {
- if(autocvar_g_balance_rpc_reload_ammo)
- {
- if(self.ammo_rockets < autocvar_g_balance_rpc_ammo && self.(weapon_load[WEP_RPC]) < autocvar_g_balance_rpc_ammo)
- ammo_amount = TRUE;
- }
- else if(self.ammo_rockets < autocvar_g_balance_rpc_ammo)
- ammo_amount = TRUE;
-
- return !ammo_amount;
++ // to-do
+ }
+ }
+ }
+ else if (req == WR_PRECACHE)
+ {
+ precache_model ("models/flash.md3");
+ /*precache_model ("models/weapons/g_rl.md3");
+ precache_model ("models/weapons/v_rl.md3");
+ precache_model ("models/weapons/h_rl.iqm");*/
+ precache_sound ("weapons/rocket_det.wav");
+ precache_sound ("weapons/rocket_fire.wav");
+ precache_sound ("weapons/rocket_mode.wav");
+ }
+ else if (req == WR_SETUP)
+ {
+ weapon_setup(WEP_RPC);
+ self.current_ammo = ammo_rockets;
+ }
+ else if (req == WR_CHECKAMMO1)
+ {
- if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH))
++ if(autocvar_g_balance_rpc_reload_ammo)
++ {
++ if(self.ammo_rockets < autocvar_g_balance_rpc_ammo && self.(weapon_load[WEP_RPC]) < autocvar_g_balance_rpc_ammo)
++ ammo_amount = TRUE;
++ }
++ else if(self.ammo_rockets < autocvar_g_balance_rpc_ammo)
++ ammo_amount = TRUE;
++
++ return !ammo_amount;
+ }
+ else if (req == WR_CHECKAMMO2)
+ return FALSE;
+ else if (req == WR_RESETPLAYER)
+ {
+ }
+ else if (req == WR_RELOAD)
+ {
+ W_Reload(autocvar_g_balance_rpc_ammo, autocvar_g_balance_rpc_reload_ammo, autocvar_g_balance_rpc_reload_time, "weapons/reload.wav");
+ }
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_RPC_SUICIDE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
++ if(w_deathtype & HITTYPE_SECONDARY)
++ return WEAPON_LASER_MURDER;
++ else if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH))
+ return WEAPON_RPC_MURDER_SPLASH;
+ else
+ return WEAPON_RPC_MURDER_DIRECT;
+ }
+ return TRUE;
+}
+#endif
+
+#ifdef CSQC
+float w_rpc(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 12;
+ pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/rocket_impact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif