]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add damage and force falloff to shotgun, machinegun, rifle, vaporizer, okmachinegun...
authorDr. Jaska <drjaska83@gmail.com>
Tue, 21 May 2024 18:50:21 +0000 (18:50 +0000)
committerDr. Jaska <drjaska83@gmail.com>
Tue, 21 May 2024 18:50:21 +0000 (18:50 +0000)
19 files changed:
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
qcsrc/common/mutators/mutator/overkill/okmachinegun.qc
qcsrc/common/mutators/mutator/overkill/okmachinegun.qh
qcsrc/common/mutators/mutator/overkill/okshotgun.qc
qcsrc/common/mutators/mutator/overkill/okshotgun.qh
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/machinegun.qh
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/rifle.qh
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/shotgun.qh
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vaporizer.qh
qcsrc/common/weapons/weapon/vortex.qh
qcsrc/server/weapons/tracing.qc

index 25293a947af3f7afc0994764749394e28a8ed7db..66b029fea0d5006c391ae6fda9bd1fab21c889f5 100644 (file)
@@ -36,6 +36,10 @@ set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_animtime 0.2
 set g_balance_shotgun_primary_bullets 12
 set g_balance_shotgun_primary_damage 4
+set g_balance_shotgun_primary_damagefalloff_forcehalflife 0
+set g_balance_shotgun_primary_damagefalloff_halflife 0
+set g_balance_shotgun_primary_damagefalloff_maxdist 0
+set g_balance_shotgun_primary_damagefalloff_mindist 0
 set g_balance_shotgun_primary_force 15
 set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_solidpenetration 3.8
@@ -72,6 +76,10 @@ set g_balance_machinegun_burst_animtime 0.3
 set g_balance_machinegun_burst_refire 0.06
 set g_balance_machinegun_burst_refire2 0.45
 set g_balance_machinegun_burst_spread 0.02
+set g_balance_machinegun_damagefalloff_forcehalflife 0
+set g_balance_machinegun_damagefalloff_halflife 0
+set g_balance_machinegun_damagefalloff_maxdist 0
+set g_balance_machinegun_damagefalloff_mindist 0
 set g_balance_machinegun_first 1
 set g_balance_machinegun_first_ammo 1
 set g_balance_machinegun_first_damage 14
@@ -446,6 +454,10 @@ set g_balance_porto_weaponthrowable 1
 set g_balance_vaporizer_primary_ammo 10
 set g_balance_vaporizer_primary_animtime 0.3
 set g_balance_vaporizer_primary_damage 150
+set g_balance_vaporizer_primary_damagefalloff_forcehalflife 0
+set g_balance_vaporizer_primary_damagefalloff_halflife 0
+set g_balance_vaporizer_primary_damagefalloff_maxdist 0
+set g_balance_vaporizer_primary_damagefalloff_mindist 0
 set g_balance_vaporizer_primary_force 800
 set g_balance_vaporizer_primary_refire 1
 set g_balance_vaporizer_reload_ammo 0
@@ -558,6 +570,10 @@ set g_balance_rifle_primary_animtime 0.4
 set g_balance_rifle_primary_bullethail 0
 set g_balance_rifle_primary_burstcost 0
 set g_balance_rifle_primary_damage 80
+set g_balance_rifle_primary_damagefalloff_forcehalflife 0
+set g_balance_rifle_primary_damagefalloff_halflife 0
+set g_balance_rifle_primary_damagefalloff_maxdist 0
+set g_balance_rifle_primary_damagefalloff_mindist 0
 set g_balance_rifle_primary_force 100
 set g_balance_rifle_primary_headshot_multiplier 0
 set g_balance_rifle_primary_refire 1.2
@@ -573,6 +589,10 @@ set g_balance_rifle_secondary_animtime 0.3
 set g_balance_rifle_secondary_bullethail 0
 set g_balance_rifle_secondary_burstcost 0
 set g_balance_rifle_secondary_damage 20
+set g_balance_rifle_secondary_damagefalloff_forcehalflife 0
+set g_balance_rifle_secondary_damagefalloff_halflife 0
+set g_balance_rifle_secondary_damagefalloff_maxdist 0
+set g_balance_rifle_secondary_damagefalloff_mindist 0
 set g_balance_rifle_secondary_force 50
 set g_balance_rifle_secondary_headshot_multiplier 0
 set g_balance_rifle_secondary_refire 0.9
@@ -829,6 +849,10 @@ set g_balance_okhmg_weaponstartoverride 0
 set g_balance_okhmg_weaponthrowable 0
 // }}}
 // {{{ #22: Overkill MachineGun (MUTATOR WEAPON)
+set g_balance_okmachinegun_damagefalloff_forcehalflife 0
+set g_balance_okmachinegun_damagefalloff_halflife 0
+set g_balance_okmachinegun_damagefalloff_maxdist 0
+set g_balance_okmachinegun_damagefalloff_mindist 0
 set g_balance_okmachinegun_primary_ammo 1
 set g_balance_okmachinegun_primary_damage 25
 set g_balance_okmachinegun_primary_force 5
@@ -955,6 +979,10 @@ set g_balance_okshotgun_primary_animtime 0.65
 set g_balance_okshotgun_primary_bot_range 512
 set g_balance_okshotgun_primary_bullets 10
 set g_balance_okshotgun_primary_damage 17
+set g_balance_okshotgun_primary_damagefalloff_forcehalflife 0
+set g_balance_okshotgun_primary_damagefalloff_halflife 0
+set g_balance_okshotgun_primary_damagefalloff_maxdist 0
+set g_balance_okshotgun_primary_damagefalloff_mindist 0
 set g_balance_okshotgun_primary_force 80
 set g_balance_okshotgun_primary_refire 0.75
 set g_balance_okshotgun_primary_solidpenetration 3.8
index 17f5b31cab3b29b313e70f27606e6cf42bd7e082..ebc0ab77294d55e7608752970cbc2316877840f6 100644 (file)
@@ -36,6 +36,10 @@ set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_animtime 0.2
 set g_balance_shotgun_primary_bullets 6
 set g_balance_shotgun_primary_damage 9
+set g_balance_shotgun_primary_damagefalloff_forcehalflife 0
+set g_balance_shotgun_primary_damagefalloff_halflife 0
+set g_balance_shotgun_primary_damagefalloff_maxdist 0
+set g_balance_shotgun_primary_damagefalloff_mindist 0
 set g_balance_shotgun_primary_force 60
 set g_balance_shotgun_primary_refire 0.5
 set g_balance_shotgun_primary_solidpenetration 3.8
@@ -72,6 +76,10 @@ set g_balance_machinegun_burst_animtime 0.75
 set g_balance_machinegun_burst_refire 0.05
 set g_balance_machinegun_burst_refire2 0.75
 set g_balance_machinegun_burst_spread 0.04
+set g_balance_machinegun_damagefalloff_forcehalflife 0
+set g_balance_machinegun_damagefalloff_halflife 0
+set g_balance_machinegun_damagefalloff_maxdist 0
+set g_balance_machinegun_damagefalloff_mindist 0
 set g_balance_machinegun_first 1
 set g_balance_machinegun_first_ammo 1
 set g_balance_machinegun_first_damage 30
@@ -446,6 +454,10 @@ set g_balance_porto_weaponthrowable 1
 set g_balance_vaporizer_primary_ammo 10
 set g_balance_vaporizer_primary_animtime 0.3
 set g_balance_vaporizer_primary_damage -1
+set g_balance_vaporizer_primary_damagefalloff_forcehalflife 0
+set g_balance_vaporizer_primary_damagefalloff_halflife 0
+set g_balance_vaporizer_primary_damagefalloff_maxdist 0
+set g_balance_vaporizer_primary_damagefalloff_mindist 0
 set g_balance_vaporizer_primary_force 800
 set g_balance_vaporizer_primary_refire 1
 set g_balance_vaporizer_reload_ammo 0
@@ -558,6 +570,10 @@ set g_balance_rifle_primary_animtime 0.4
 set g_balance_rifle_primary_bullethail 0
 set g_balance_rifle_primary_burstcost 0
 set g_balance_rifle_primary_damage 80
+set g_balance_rifle_primary_damagefalloff_forcehalflife 0
+set g_balance_rifle_primary_damagefalloff_halflife 0
+set g_balance_rifle_primary_damagefalloff_maxdist 0
+set g_balance_rifle_primary_damagefalloff_mindist 0
 set g_balance_rifle_primary_force 100
 set g_balance_rifle_primary_headshot_multiplier 1.25
 set g_balance_rifle_primary_refire 1.2
@@ -573,6 +589,10 @@ set g_balance_rifle_secondary_animtime 0.3
 set g_balance_rifle_secondary_bullethail 0
 set g_balance_rifle_secondary_burstcost 0
 set g_balance_rifle_secondary_damage 20
+set g_balance_rifle_secondary_damagefalloff_forcehalflife 0
+set g_balance_rifle_secondary_damagefalloff_halflife 0
+set g_balance_rifle_secondary_damagefalloff_maxdist 0
+set g_balance_rifle_secondary_damagefalloff_mindist 0
 set g_balance_rifle_secondary_force 50
 set g_balance_rifle_secondary_headshot_multiplier 0.1875
 set g_balance_rifle_secondary_refire 0.9
@@ -829,6 +849,10 @@ set g_balance_okhmg_weaponstartoverride 0
 set g_balance_okhmg_weaponthrowable 0
 // }}}
 // {{{ #22: Overkill MachineGun (MUTATOR WEAPON)
+set g_balance_okmachinegun_damagefalloff_forcehalflife 0
+set g_balance_okmachinegun_damagefalloff_halflife 0
+set g_balance_okmachinegun_damagefalloff_maxdist 0
+set g_balance_okmachinegun_damagefalloff_mindist 0
 set g_balance_okmachinegun_primary_ammo 1
 set g_balance_okmachinegun_primary_damage 25
 set g_balance_okmachinegun_primary_force 5
@@ -955,6 +979,10 @@ set g_balance_okshotgun_primary_animtime 0.65
 set g_balance_okshotgun_primary_bot_range 512
 set g_balance_okshotgun_primary_bullets 10
 set g_balance_okshotgun_primary_damage 17
+set g_balance_okshotgun_primary_damagefalloff_forcehalflife 0
+set g_balance_okshotgun_primary_damagefalloff_halflife 0
+set g_balance_okshotgun_primary_damagefalloff_maxdist 0
+set g_balance_okshotgun_primary_damagefalloff_mindist 0
 set g_balance_okshotgun_primary_force 80
 set g_balance_okshotgun_primary_refire 0.75
 set g_balance_okshotgun_primary_solidpenetration 3.8
index 2799a2496b47fb4debea904aa6b051b95c59a621..049e080cb21360c2af7f6a161225a0d4c134b1b5 100644 (file)
@@ -36,6 +36,10 @@ set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_animtime 0.2
 set g_balance_shotgun_primary_bullets 14
 set g_balance_shotgun_primary_damage 4
+set g_balance_shotgun_primary_damagefalloff_forcehalflife 0
+set g_balance_shotgun_primary_damagefalloff_halflife 0
+set g_balance_shotgun_primary_damagefalloff_maxdist 0
+set g_balance_shotgun_primary_damagefalloff_mindist 0
 set g_balance_shotgun_primary_force 15
 set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_solidpenetration 3.8
@@ -72,6 +76,10 @@ set g_balance_machinegun_burst_animtime 0.3
 set g_balance_machinegun_burst_refire 0.06
 set g_balance_machinegun_burst_refire2 0.45
 set g_balance_machinegun_burst_spread 0.02
+set g_balance_machinegun_damagefalloff_forcehalflife 0
+set g_balance_machinegun_damagefalloff_halflife 0
+set g_balance_machinegun_damagefalloff_maxdist 0
+set g_balance_machinegun_damagefalloff_mindist 0
 set g_balance_machinegun_first 1
 set g_balance_machinegun_first_ammo 1
 set g_balance_machinegun_first_damage 14
@@ -446,6 +454,10 @@ set g_balance_porto_weaponthrowable 1
 set g_balance_vaporizer_primary_ammo 10
 set g_balance_vaporizer_primary_animtime 0.3
 set g_balance_vaporizer_primary_damage 150
+set g_balance_vaporizer_primary_damagefalloff_forcehalflife 0
+set g_balance_vaporizer_primary_damagefalloff_halflife 0
+set g_balance_vaporizer_primary_damagefalloff_maxdist 0
+set g_balance_vaporizer_primary_damagefalloff_mindist 0
 set g_balance_vaporizer_primary_force 800
 set g_balance_vaporizer_primary_refire 1
 set g_balance_vaporizer_reload_ammo 0
@@ -558,6 +570,10 @@ set g_balance_rifle_primary_animtime 0.4
 set g_balance_rifle_primary_bullethail 0
 set g_balance_rifle_primary_burstcost 0
 set g_balance_rifle_primary_damage 80
+set g_balance_rifle_primary_damagefalloff_forcehalflife 0
+set g_balance_rifle_primary_damagefalloff_halflife 0
+set g_balance_rifle_primary_damagefalloff_maxdist 0
+set g_balance_rifle_primary_damagefalloff_mindist 0
 set g_balance_rifle_primary_force 100
 set g_balance_rifle_primary_headshot_multiplier 0
 set g_balance_rifle_primary_refire 1.2
@@ -573,8 +589,12 @@ set g_balance_rifle_secondary_animtime 0.3
 set g_balance_rifle_secondary_bullethail 0
 set g_balance_rifle_secondary_burstcost 0
 set g_balance_rifle_secondary_damage 20
-set g_balance_rifle_secondary_headshot_multiplier 0
+set g_balance_rifle_secondary_damagefalloff_forcehalflife 0
+set g_balance_rifle_secondary_damagefalloff_halflife 0
+set g_balance_rifle_secondary_damagefalloff_maxdist 0
+set g_balance_rifle_secondary_damagefalloff_mindist 0
 set g_balance_rifle_secondary_force 50
+set g_balance_rifle_secondary_headshot_multiplier 0
 set g_balance_rifle_secondary_refire 0.9
 set g_balance_rifle_secondary_reload 0
 set g_balance_rifle_secondary_shots 4
@@ -829,6 +849,10 @@ set g_balance_okhmg_weaponstartoverride 0
 set g_balance_okhmg_weaponthrowable 0
 // }}}
 // {{{ #22: Overkill MachineGun (MUTATOR WEAPON)
+set g_balance_okmachinegun_damagefalloff_forcehalflife 0
+set g_balance_okmachinegun_damagefalloff_halflife 0
+set g_balance_okmachinegun_damagefalloff_maxdist 0
+set g_balance_okmachinegun_damagefalloff_mindist 0
 set g_balance_okmachinegun_primary_ammo 1
 set g_balance_okmachinegun_primary_damage 25
 set g_balance_okmachinegun_primary_force 5
@@ -955,6 +979,10 @@ set g_balance_okshotgun_primary_animtime 0.65
 set g_balance_okshotgun_primary_bot_range 512
 set g_balance_okshotgun_primary_bullets 10
 set g_balance_okshotgun_primary_damage 17
+set g_balance_okshotgun_primary_damagefalloff_forcehalflife 0
+set g_balance_okshotgun_primary_damagefalloff_halflife 0
+set g_balance_okshotgun_primary_damagefalloff_maxdist 0
+set g_balance_okshotgun_primary_damagefalloff_mindist 0
 set g_balance_okshotgun_primary_force 80
 set g_balance_okshotgun_primary_refire 0.75
 set g_balance_okshotgun_primary_solidpenetration 3.8
index 491f0db713aeb77630fa60ae396f0d6261fe735b..70fdb47005d39c5dd216ad0ffc3bdb24cfe41d33 100644 (file)
@@ -36,6 +36,10 @@ set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_animtime 0.2
 set g_balance_shotgun_primary_bullets 12
 set g_balance_shotgun_primary_damage 4
+set g_balance_shotgun_primary_damagefalloff_forcehalflife 0
+set g_balance_shotgun_primary_damagefalloff_halflife 0
+set g_balance_shotgun_primary_damagefalloff_maxdist 0
+set g_balance_shotgun_primary_damagefalloff_mindist 0
 set g_balance_shotgun_primary_force 15
 set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_solidpenetration 3.8
@@ -72,6 +76,10 @@ set g_balance_machinegun_burst_animtime 0.3
 set g_balance_machinegun_burst_refire 0.06
 set g_balance_machinegun_burst_refire2 0.45
 set g_balance_machinegun_burst_spread 0.03
+set g_balance_machinegun_damagefalloff_forcehalflife 0
+set g_balance_machinegun_damagefalloff_halflife 0
+set g_balance_machinegun_damagefalloff_maxdist 0
+set g_balance_machinegun_damagefalloff_mindist 0
 set g_balance_machinegun_first 1
 set g_balance_machinegun_first_ammo 1
 set g_balance_machinegun_first_damage 14
@@ -446,6 +454,10 @@ set g_balance_porto_weaponthrowable 1
 set g_balance_vaporizer_primary_ammo 10
 set g_balance_vaporizer_primary_animtime 0.3
 set g_balance_vaporizer_primary_damage 150
+set g_balance_vaporizer_primary_damagefalloff_forcehalflife 0
+set g_balance_vaporizer_primary_damagefalloff_halflife 0
+set g_balance_vaporizer_primary_damagefalloff_maxdist 0
+set g_balance_vaporizer_primary_damagefalloff_mindist 0
 set g_balance_vaporizer_primary_force 800
 set g_balance_vaporizer_primary_refire 1
 set g_balance_vaporizer_reload_ammo 0
@@ -558,6 +570,10 @@ set g_balance_rifle_primary_animtime 0.4
 set g_balance_rifle_primary_bullethail 0
 set g_balance_rifle_primary_burstcost 0
 set g_balance_rifle_primary_damage 80
+set g_balance_rifle_primary_damagefalloff_forcehalflife 0
+set g_balance_rifle_primary_damagefalloff_halflife 0
+set g_balance_rifle_primary_damagefalloff_maxdist 0
+set g_balance_rifle_primary_damagefalloff_mindist 0
 set g_balance_rifle_primary_force 100
 set g_balance_rifle_primary_headshot_multiplier 0
 set g_balance_rifle_primary_refire 1.2
@@ -573,6 +589,10 @@ set g_balance_rifle_secondary_animtime 0.3
 set g_balance_rifle_secondary_bullethail 0
 set g_balance_rifle_secondary_burstcost 0
 set g_balance_rifle_secondary_damage 20
+set g_balance_rifle_secondary_damagefalloff_forcehalflife 0
+set g_balance_rifle_secondary_damagefalloff_halflife 0
+set g_balance_rifle_secondary_damagefalloff_maxdist 0
+set g_balance_rifle_secondary_damagefalloff_mindist 0
 set g_balance_rifle_secondary_force 50
 set g_balance_rifle_secondary_headshot_multiplier 0
 set g_balance_rifle_secondary_refire 0.9
@@ -829,6 +849,10 @@ set g_balance_okhmg_weaponstartoverride 0
 set g_balance_okhmg_weaponthrowable 0
 // }}}
 // {{{ #22: Overkill MachineGun (MUTATOR WEAPON)
+set g_balance_okmachinegun_damagefalloff_forcehalflife 0
+set g_balance_okmachinegun_damagefalloff_halflife 0
+set g_balance_okmachinegun_damagefalloff_maxdist 0
+set g_balance_okmachinegun_damagefalloff_mindist 0
 set g_balance_okmachinegun_primary_ammo 1
 set g_balance_okmachinegun_primary_damage 25
 set g_balance_okmachinegun_primary_force 5
@@ -955,6 +979,10 @@ set g_balance_okshotgun_primary_animtime 0.65
 set g_balance_okshotgun_primary_bot_range 512
 set g_balance_okshotgun_primary_bullets 10
 set g_balance_okshotgun_primary_damage 17
+set g_balance_okshotgun_primary_damagefalloff_forcehalflife 0
+set g_balance_okshotgun_primary_damagefalloff_halflife 0
+set g_balance_okshotgun_primary_damagefalloff_maxdist 0
+set g_balance_okshotgun_primary_damagefalloff_mindist 0
 set g_balance_okshotgun_primary_force 80
 set g_balance_okshotgun_primary_refire 0.75
 set g_balance_okshotgun_primary_solidpenetration 3.8
index 29d73a4240dce99f1ed7f9db67a7dd0f18394a13..1b2a56176f50ac16a1d733ec18e9a7986446a1a2 100644 (file)
@@ -36,6 +36,10 @@ set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_animtime 0.2
 set g_balance_shotgun_primary_bullets 12
 set g_balance_shotgun_primary_damage 4
+set g_balance_shotgun_primary_damagefalloff_forcehalflife 0
+set g_balance_shotgun_primary_damagefalloff_halflife 0
+set g_balance_shotgun_primary_damagefalloff_maxdist 0
+set g_balance_shotgun_primary_damagefalloff_mindist 0
 set g_balance_shotgun_primary_force 15
 set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_solidpenetration 3.8
@@ -72,6 +76,10 @@ set g_balance_machinegun_burst_animtime 0.3
 set g_balance_machinegun_burst_refire 0.06
 set g_balance_machinegun_burst_refire2 0.45
 set g_balance_machinegun_burst_spread 0
+set g_balance_machinegun_damagefalloff_forcehalflife 0
+set g_balance_machinegun_damagefalloff_halflife 0
+set g_balance_machinegun_damagefalloff_maxdist 0
+set g_balance_machinegun_damagefalloff_mindist 0
 set g_balance_machinegun_first 1
 set g_balance_machinegun_first_ammo 1
 set g_balance_machinegun_first_damage 14
@@ -446,6 +454,10 @@ set g_balance_porto_weaponthrowable 1
 set g_balance_vaporizer_primary_ammo 10
 set g_balance_vaporizer_primary_animtime 0.3
 set g_balance_vaporizer_primary_damage 150
+set g_balance_vaporizer_primary_damagefalloff_forcehalflife 0
+set g_balance_vaporizer_primary_damagefalloff_halflife 0
+set g_balance_vaporizer_primary_damagefalloff_maxdist 0
+set g_balance_vaporizer_primary_damagefalloff_mindist 0
 set g_balance_vaporizer_primary_force 800
 set g_balance_vaporizer_primary_refire 1
 set g_balance_vaporizer_reload_ammo 0
@@ -558,6 +570,10 @@ set g_balance_rifle_primary_animtime 0.4
 set g_balance_rifle_primary_bullethail 0
 set g_balance_rifle_primary_burstcost 0
 set g_balance_rifle_primary_damage 80
+set g_balance_rifle_primary_damagefalloff_forcehalflife 0
+set g_balance_rifle_primary_damagefalloff_halflife 0
+set g_balance_rifle_primary_damagefalloff_maxdist 0
+set g_balance_rifle_primary_damagefalloff_mindist 0
 set g_balance_rifle_primary_force 100
 set g_balance_rifle_primary_headshot_multiplier 0
 set g_balance_rifle_primary_refire 1.2
@@ -573,6 +589,10 @@ set g_balance_rifle_secondary_animtime 0.3
 set g_balance_rifle_secondary_bullethail 0
 set g_balance_rifle_secondary_burstcost 0
 set g_balance_rifle_secondary_damage 20
+set g_balance_rifle_secondary_damagefalloff_forcehalflife 0
+set g_balance_rifle_secondary_damagefalloff_halflife 0
+set g_balance_rifle_secondary_damagefalloff_maxdist 0
+set g_balance_rifle_secondary_damagefalloff_mindist 0
 set g_balance_rifle_secondary_force 50
 set g_balance_rifle_secondary_headshot_multiplier 0
 set g_balance_rifle_secondary_refire 0.9
@@ -829,6 +849,10 @@ set g_balance_okhmg_weaponstartoverride 0
 set g_balance_okhmg_weaponthrowable 0
 // }}}
 // {{{ #22: Overkill MachineGun (MUTATOR WEAPON)
+set g_balance_okmachinegun_damagefalloff_forcehalflife 0
+set g_balance_okmachinegun_damagefalloff_halflife 0
+set g_balance_okmachinegun_damagefalloff_maxdist 0
+set g_balance_okmachinegun_damagefalloff_mindist 0
 set g_balance_okmachinegun_primary_ammo 1
 set g_balance_okmachinegun_primary_damage 25
 set g_balance_okmachinegun_primary_force 5
@@ -955,6 +979,10 @@ set g_balance_okshotgun_primary_animtime 0.65
 set g_balance_okshotgun_primary_bot_range 512
 set g_balance_okshotgun_primary_bullets 10
 set g_balance_okshotgun_primary_damage 17
+set g_balance_okshotgun_primary_damagefalloff_forcehalflife 0
+set g_balance_okshotgun_primary_damagefalloff_halflife 0
+set g_balance_okshotgun_primary_damagefalloff_maxdist 0
+set g_balance_okshotgun_primary_damagefalloff_mindist 0
 set g_balance_okshotgun_primary_force 80
 set g_balance_okshotgun_primary_refire 0.75
 set g_balance_okshotgun_primary_solidpenetration 3.8
index 0b5fdc7df2624557a3117bcd551b09c41a22950e..e73e63fa1fb51eef9d050d4b7ebe4828dcd2e748 100644 (file)
@@ -30,7 +30,17 @@ void W_OverkillMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weap
        }
 
        okmachinegun_spread = bound(WEP_CVAR_PRI(okmachinegun, spread_min), WEP_CVAR_PRI(okmachinegun, spread_min) + (WEP_CVAR_PRI(okmachinegun, spread_add) * actor.(weaponentity).misc_bulletcounter), WEP_CVAR_PRI(okmachinegun, spread_max));
-       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, okmachinegun_spread, WEP_CVAR_PRI(okmachinegun, solidpenetration), WEP_CVAR_PRI(okmachinegun, damage), 0, WEP_CVAR_PRI(okmachinegun, force), WEP_OVERKILL_MACHINEGUN.m_id, EFFECT_RIFLE);
+
+       fireBullet_falloff(actor, weaponentity, w_shotorg, w_shotdir, okmachinegun_spread,
+                          WEP_CVAR_PRI(okmachinegun, solidpenetration),
+                          WEP_CVAR_PRI(okmachinegun, damage),
+                          WEP_CVAR(okmachinegun, damagefalloff_halflife),
+                          WEP_CVAR(okmachinegun, damagefalloff_mindist),
+                          WEP_CVAR(okmachinegun, damagefalloff_maxdist),
+                          0,
+                          WEP_CVAR_PRI(okmachinegun, force),
+                          WEP_CVAR(okmachinegun, damagefalloff_forcehalflife),
+                          WEP_OVERKILL_MACHINEGUN.m_id, EFFECT_RIFLE, true);
 
        actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1;
 
index 5ec40b7f73b14f79803dc61dc8258813a2655b6d..cd1eac827a1b59f9add89cffc84c89375f5f9ede 100644 (file)
@@ -42,6 +42,10 @@ CLASS(OverkillMachineGun, Weapon)
                P(class, prefix, shotangle, float, SEC) \
                P(class, prefix, speed, float, SEC) \
                P(class, prefix, spread, float, SEC) \
+               P(class, prefix, damagefalloff_forcehalflife, float, NONE) \
+               P(class, prefix, damagefalloff_halflife, float, NONE) \
+               P(class, prefix, damagefalloff_maxdist, float, NONE) \
+               P(class, prefix, damagefalloff_mindist, float, NONE) \
                P(class, prefix, reload_ammo, float, NONE) \
                P(class, prefix, reload_time, float, NONE) \
                P(class, prefix, switchdelay_drop, float, NONE) \
index cd1d618a8c9816adf00e3eda54096c96f285880b..7fae9ad30b1c7e11fdb9a77e198e88c23a73897c 100644 (file)
@@ -50,10 +50,14 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea
                W_Shotgun_Attack(thiswep, actor, weaponentity, true,
                        WEP_CVAR_PRI(okshotgun, ammo),
                        WEP_CVAR_PRI(okshotgun, damage),
+                       WEP_CVAR_PRI(okshotgun, damagefalloff_halflife),
+                       WEP_CVAR_PRI(okshotgun, damagefalloff_mindist),
+                       WEP_CVAR_PRI(okshotgun, damagefalloff_maxdist),
                        WEP_CVAR_PRI(okshotgun, bullets),
                        WEP_CVAR_PRI(okshotgun, spread),
                        WEP_CVAR_PRI(okshotgun, solidpenetration),
                        WEP_CVAR_PRI(okshotgun, force),
+                       WEP_CVAR_PRI(okshotgun, damagefalloff_forcehalflife),
                        EFFECT_RIFLE_WEAK);
                weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(okshotgun, animtime), w_ready);
                return;
index e70fc43269f1eb329f2c9d6f9458ac29da5dd010..094f156882a02386ebf20762521c496ec2add8b6 100644 (file)
@@ -24,6 +24,10 @@ CLASS(OverkillShotgun, Weapon)
                P(class, prefix, bot_range, float, PRI) \
                P(class, prefix, bullets, float, PRI) \
                P(class, prefix, damage, float, PRI) \
+               P(class, prefix, damagefalloff_forcehalflife, float, PRI) \
+               P(class, prefix, damagefalloff_halflife, float, PRI) \
+               P(class, prefix, damagefalloff_maxdist, float, PRI) \
+               P(class, prefix, damagefalloff_mindist, float, PRI) \
                P(class, prefix, force, float, PRI) \
                P(class, prefix, refire, float, PRI) \
                P(class, prefix, solidpenetration, float, PRI) \
index b05f9f720988c73cf34e9ba85ffb9772c8b55e01..efb4913c005ea7abd84a338ea7d67727b5933956 100644 (file)
@@ -5,18 +5,40 @@
 void W_MachineGun_Attack(Weapon thiswep, int deathtype, entity actor, .entity weaponentity)
 {
        W_SetupShot(actor, weaponentity, true, 0, SND_UZI_FIRE, CH_WEAPON_A, ((actor.(weaponentity).misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)), deathtype);
+
        if(!autocvar_g_norecoil)
        {
                actor.punchangle_x = random() - 0.5;
                actor.punchangle_y = random() - 0.5;
        }
+
        // this attack_finished just enforces a cooldown at the end of a burst
        ATTACK_FINISHED(actor, weaponentity) = time + WEP_CVAR(machinegun, first_refire) * W_WeaponRateFactor(actor);
 
        if(actor.(weaponentity).misc_bulletcounter == 1)
-               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, first_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, first_damage), 0, WEP_CVAR(machinegun, first_force), deathtype, EFFECT_BULLET);
+               fireBullet_falloff(actor, weaponentity, w_shotorg, w_shotdir,
+                                  WEP_CVAR(machinegun, first_spread),
+                                  WEP_CVAR(machinegun, solidpenetration),
+                                  WEP_CVAR(machinegun, first_damage),
+                                  WEP_CVAR(machinegun, damagefalloff_halflife),
+                                  WEP_CVAR(machinegun, damagefalloff_mindist),
+                                  WEP_CVAR(machinegun, damagefalloff_maxdist),
+                                  0,
+                                  WEP_CVAR(machinegun, first_force),
+                                  WEP_CVAR(machinegun, damagefalloff_forcehalflife),
+                                  deathtype, EFFECT_BULLET, true);
        else
-               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), 0, WEP_CVAR(machinegun, sustained_force), deathtype, EFFECT_BULLET);
+               fireBullet_falloff(actor, weaponentity, w_shotorg, w_shotdir,
+                                  WEP_CVAR(machinegun, sustained_spread),
+                                  WEP_CVAR(machinegun, solidpenetration),
+                                  WEP_CVAR(machinegun, sustained_damage),
+                                  WEP_CVAR(machinegun, damagefalloff_halflife),
+                                  WEP_CVAR(machinegun, damagefalloff_mindist),
+                                  WEP_CVAR(machinegun, damagefalloff_maxdist),
+                                  0,
+                                  WEP_CVAR(machinegun, sustained_force),
+                                  WEP_CVAR(machinegun, damagefalloff_forcehalflife),
+                                  deathtype, EFFECT_BULLET, true);
 
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
 
@@ -87,7 +109,9 @@ void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity
        }
 
        machinegun_spread = bound(WEP_CVAR(machinegun, spread_min), WEP_CVAR(machinegun, spread_min) + (WEP_CVAR(machinegun, spread_add) * actor.(weaponentity).misc_bulletcounter), WEP_CVAR(machinegun, spread_max));
-       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, machinegun_spread, WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), 0, WEP_CVAR(machinegun, sustained_force), thiswep.m_id, EFFECT_BULLET);
+       fireBullet_falloff(actor, weaponentity, w_shotorg, w_shotdir, machinegun_spread, WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage),
+               WEP_CVAR(machinegun, damagefalloff_halflife), WEP_CVAR(machinegun, damagefalloff_mindist), WEP_CVAR(machinegun, damagefalloff_maxdist), 0,
+               WEP_CVAR(machinegun, sustained_force), WEP_CVAR(machinegun, damagefalloff_forcehalflife), thiswep.m_id, EFFECT_BULLET, true);
 
        actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1;
 
@@ -112,7 +136,9 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, .entity weaponentit
                actor.punchangle_y = random() - 0.5;
        }
 
-       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), 0, WEP_CVAR(machinegun, sustained_force), thiswep.m_id, EFFECT_BULLET);
+       fireBullet_falloff(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage),
+               WEP_CVAR(machinegun, damagefalloff_halflife), WEP_CVAR(machinegun, damagefalloff_mindist), WEP_CVAR(machinegun, damagefalloff_maxdist), 0,
+               WEP_CVAR(machinegun, sustained_force), WEP_CVAR(machinegun, damagefalloff_forcehalflife), thiswep.m_id, EFFECT_BULLET, true);
 
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
 
index a4097f947e252dfa01d49ba4c99459d7ca3cc962..1b77baaee4d9374cb8d3543fc4ef0f8162d25cfe 100644 (file)
@@ -28,6 +28,10 @@ CLASS(MachineGun, Weapon)
                P(class, prefix, burst_refire2, float, NONE) \
                P(class, prefix, burst_refire, float, NONE) \
                P(class, prefix, burst_spread, float, NONE) \
+               P(class, prefix, damagefalloff_forcehalflife, float, NONE) \
+               P(class, prefix, damagefalloff_halflife, float, NONE) \
+               P(class, prefix, damagefalloff_maxdist, float, NONE) \
+               P(class, prefix, damagefalloff_mindist, float, NONE) \
                P(class, prefix, first, float, NONE) \
                P(class, prefix, first_ammo, float, NONE) \
                P(class, prefix, first_damage, float, NONE) \
index df3b537c1cb82550dc37e52e9c920dab22e9200c..265a27b93761d7af799e9ac9d9d10a0e208764e6 100644 (file)
@@ -2,9 +2,20 @@
 
 #ifdef SVQC
 
-void W_Rifle_FireBullet(Weapon thiswep, .entity weaponentity, float pSpread, float pDamage, float pHeadshotDamage, float pForce, float pSolidPenetration, float pAmmo, int deathtype, float pTracer, float pShots, Sound pSound, entity actor)
-{
-       float i;
+void W_Rifle_FireBullet(Weapon thiswep, .entity weaponentity, int deathtype, Sound pSound, entity actor, bool isprimary)
+{
+       float pAmmo = WEP_CVAR_BOTH(rifle, isprimary, ammo);
+       float pDamage = WEP_CVAR_BOTH(rifle, isprimary, damage);
+       float pDF_HalfLife = WEP_CVAR_BOTH(rifle, isprimary, damagefalloff_halflife);
+       float pDF_ForceHalfLife = WEP_CVAR_BOTH(rifle, isprimary, damagefalloff_forcehalflife);
+       float pDF_MaxDist = WEP_CVAR_BOTH(rifle, isprimary, damagefalloff_maxdist);
+       float pDF_MinDist = WEP_CVAR_BOTH(rifle, isprimary, damagefalloff_mindist);
+       float pForce = WEP_CVAR_BOTH(rifle, isprimary, force);
+       float pHeadshotDamage = WEP_CVAR_BOTH(rifle, isprimary, headshot_multiplier);
+       float pShots = WEP_CVAR_BOTH(rifle, isprimary, shots);
+       float pSolidPenetration = WEP_CVAR_BOTH(rifle, isprimary, solidpenetration);
+       float pSpread = WEP_CVAR_BOTH(rifle, isprimary, spread);
+       float pTracer = WEP_CVAR_BOTH(rifle, isprimary, tracer);
 
        W_DecreaseAmmo(thiswep, actor, pAmmo, weaponentity);
 
@@ -18,8 +29,11 @@ void W_Rifle_FireBullet(Weapon thiswep, .entity weaponentity, float pSpread, flo
                w_shotorg = actor.origin + actor.view_ofs + ((w_shotorg - actor.origin - actor.view_ofs) * v_forward) * v_forward;
        }
 
-       for(i = 0; i < pShots; ++i)
-               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pHeadshotDamage, pForce, deathtype, (pTracer ? EFFECT_RIFLE : EFFECT_RIFLE_WEAK));
+       for(int i = 0; i < pShots; ++i)
+               fireBullet_falloff(actor, weaponentity, w_shotorg, w_shotdir, pSpread,
+                       pSolidPenetration, pDamage, pDF_HalfLife, pDF_MinDist,
+                       pDF_MaxDist, pHeadshotDamage, pForce, pDF_ForceHalfLife,
+                       deathtype, (pTracer ? EFFECT_RIFLE : EFFECT_RIFLE_WEAK), true);
 
        if(autocvar_g_casings >= 2)
        {
@@ -30,12 +44,12 @@ void W_Rifle_FireBullet(Weapon thiswep, .entity weaponentity, float pSpread, flo
 
 void W_Rifle_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 {
-       W_Rifle_FireBullet(thiswep, weaponentity, WEP_CVAR_PRI(rifle, spread), WEP_CVAR_PRI(rifle, damage), WEP_CVAR_PRI(rifle, headshot_multiplier), WEP_CVAR_PRI(rifle, force), WEP_CVAR_PRI(rifle, solidpenetration), WEP_CVAR_PRI(rifle, ammo), thiswep.m_id, WEP_CVAR_PRI(rifle, tracer), WEP_CVAR_PRI(rifle, shots), SND_CAMPINGRIFLE_FIRE, actor);
+       W_Rifle_FireBullet(thiswep, weaponentity, thiswep.m_id, SND_CAMPINGRIFLE_FIRE, actor, true);
 }
 
 void W_Rifle_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
 {
-       W_Rifle_FireBullet(thiswep, weaponentity, WEP_CVAR_SEC(rifle, spread), WEP_CVAR_SEC(rifle, damage), WEP_CVAR_SEC(rifle, headshot_multiplier), WEP_CVAR_SEC(rifle, force), WEP_CVAR_SEC(rifle, solidpenetration), WEP_CVAR_SEC(rifle, ammo), thiswep.m_id | HITTYPE_SECONDARY, WEP_CVAR_SEC(rifle, tracer), WEP_CVAR_SEC(rifle, shots), SND_CAMPINGRIFLE_FIRE2, actor);
+       W_Rifle_FireBullet(thiswep, weaponentity, thiswep.m_id | HITTYPE_SECONDARY, SND_CAMPINGRIFLE_FIRE2, actor, false);
 }
 
 .void(Weapon thiswep, entity actor, .entity weaponentity) rifle_bullethail_attackfunc;
index e5a2cde2b0b3956f3081c0889e5aa98d11b56390..9b69985a43f347099779a1ee863102caab63187c 100644 (file)
@@ -28,25 +28,29 @@ CLASS(Rifle, Weapon)
                P(class, prefix, burstcost, float, BOTH) \
                P(class, prefix, bursttime, float, NONE) \
                P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, damagefalloff_forcehalflife, float, BOTH) \
+               P(class, prefix, damagefalloff_halflife, float, BOTH) \
+               P(class, prefix, damagefalloff_maxdist, float, BOTH) \
+               P(class, prefix, damagefalloff_mindist, float, BOTH) \
                P(class, prefix, force, float, BOTH) \
                P(class, prefix, headshot_multiplier, float, BOTH) \
                P(class, prefix, refire, float, BOTH) \
                P(class, prefix, reload, float, SEC) \
                P(class, prefix, reload_ammo, float, NONE) \
-       P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, reload_time, float, NONE) \
                P(class, prefix, secondary, float, NONE) \
                P(class, prefix, shots, float, BOTH) \
                P(class, prefix, solidpenetration, float, BOTH) \
                P(class, prefix, spread, float, BOTH) \
-       P(class, prefix, switchdelay_drop, float, NONE) \
-       P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
                P(class, prefix, tracer, float, BOTH) \
-       P(class, prefix, weaponreplace, string, NONE) \
-       P(class, prefix, weaponstartoverride, float, NONE) \
-       P(class, prefix, weaponstart, float, NONE) \
-       P(class, prefix, weaponthrowable, float, NONE) \
+               P(class, prefix, weaponreplace, string, NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
        END()
-    W_PROPS(X, Rifle, rifle)
+       W_PROPS(X, Rifle, rifle)
 #undef X
 ENDCLASS(Rifle)
 REGISTER_WEAPON(RIFLE, rifle, NEW(Rifle));
index 65cc0d9d926323840f682a60c5fc046ba1ec7dd7..89bdf2a36fc1f7f720d9ac15a8cb5de0b860087e 100644 (file)
@@ -5,19 +5,27 @@
 // enable to debug melee range
 //#define SHOTGUN_MELEEDEBUG
 
-void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float isprimary, float ammocount, float damage, float bullets, float spread, float solidpenetration, float force, entity bullet_trail_effect)
+void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity,
+                      float isprimary, float ammocount, float damage,
+                      float falloff_halflife, float falloff_mindist, float falloff_maxdist,
+                      float bullets, float spread, float solidpenetration,
+                      float force, float falloff_forcehalflife, entity bullet_trail_effect)
 {
        W_DecreaseAmmo(thiswep, actor, ammocount, weaponentity);
 
-       W_SetupShot(actor, weaponentity, true, 5, SND_SHOTGUN_FIRE, ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), damage * bullets, thiswep.m_id);
+       W_SetupShot(actor, weaponentity, true, 5, SND_SHOTGUN_FIRE,
+               ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), damage * bullets, thiswep.m_id);
 
-       // TRICK: do the antilag outside the regular fireBullet function, so it isn't performed unnecessarily on every single bullet!
+       // TRICK: do the antilag outside the regular fireBullet function,
+       // so it isn't performed unnecessarily on every single bullet!
        float lag = antilag_getlag(actor);
        if(lag && bullets > 0)
                antilag_takeback_all(actor, lag);
 
        for(int sc = 0;sc < bullets;sc = sc + 1)
-               fireBullet_antilag(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration, damage, 0, force, thiswep.m_id, bullet_trail_effect, false);
+               fireBullet_falloff(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration,
+                       damage, falloff_halflife, falloff_mindist, falloff_maxdist, 0, force,
+                       falloff_forcehalflife, thiswep.m_id, bullet_trail_effect, false);
 
        if(lag && bullets > 0)
                antilag_restore_all(actor);
@@ -163,10 +171,14 @@ void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, .entity weaponentity
        W_Shotgun_Attack(thiswep, actor, weaponentity, true,
                WEP_CVAR_PRI(shotgun, ammo),
                WEP_CVAR_PRI(shotgun, damage),
+               WEP_CVAR_PRI(shotgun, damagefalloff_halflife),
+               WEP_CVAR_PRI(shotgun, damagefalloff_mindist),
+               WEP_CVAR_PRI(shotgun, damagefalloff_maxdist),
                WEP_CVAR_PRI(shotgun, bullets),
                WEP_CVAR_PRI(shotgun, spread),
                WEP_CVAR_PRI(shotgun, solidpenetration),
                WEP_CVAR_PRI(shotgun, force),
+               WEP_CVAR_PRI(shotgun, damagefalloff_forcehalflife),
                EFFECT_BULLET_WEAK); // actually is secondary, but we trick the last shot into playing full reload sound
        weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), w_ready);
 }
@@ -183,10 +195,14 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity
        W_Shotgun_Attack(thiswep, actor, weaponentity, false,
                WEP_CVAR_PRI(shotgun, ammo),
                WEP_CVAR_PRI(shotgun, damage),
+               WEP_CVAR_PRI(shotgun, damagefalloff_halflife),
+               WEP_CVAR_PRI(shotgun, damagefalloff_mindist),
+               WEP_CVAR_PRI(shotgun, damagefalloff_maxdist),
                WEP_CVAR_PRI(shotgun, bullets),
                WEP_CVAR_PRI(shotgun, spread),
                WEP_CVAR_PRI(shotgun, solidpenetration),
                WEP_CVAR_PRI(shotgun, force),
+               WEP_CVAR_PRI(shotgun, damagefalloff_forcehalflife),
                EFFECT_BULLET_WEAK);
        weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), W_Shotgun_Attack3_Frame2);
 }
@@ -224,10 +240,14 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit
                     W_Shotgun_Attack(thiswep, actor, weaponentity, true,
                                                WEP_CVAR_PRI(shotgun, ammo),
                                                WEP_CVAR_PRI(shotgun, damage),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_halflife),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_mindist),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_maxdist),
                                                WEP_CVAR_PRI(shotgun, bullets),
                                                WEP_CVAR_PRI(shotgun, spread),
                                                WEP_CVAR_PRI(shotgun, solidpenetration),
                                                WEP_CVAR_PRI(shotgun, force),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_forcehalflife),
                                                EFFECT_BULLET_WEAK);
                     actor.(weaponentity).shotgun_primarytime = time + WEP_CVAR_PRI(shotgun, refire) * W_WeaponRateFactor(actor);
                     weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(shotgun, animtime), w_ready);
@@ -244,10 +264,14 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit
                     W_Shotgun_Attack(thiswep, actor, weaponentity, false,
                                                WEP_CVAR_PRI(shotgun, ammo),
                                                WEP_CVAR_PRI(shotgun, damage),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_halflife),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_mindist),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_maxdist),
                                                WEP_CVAR_PRI(shotgun, bullets),
                                                WEP_CVAR_PRI(shotgun, spread),
                                                WEP_CVAR_PRI(shotgun, solidpenetration),
                                                WEP_CVAR_PRI(shotgun, force),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_forcehalflife),
                                                EFFECT_BULLET_WEAK);
                     actor.(weaponentity).shotgun_primarytime = time + WEP_CVAR_SEC(shotgun, alt_refire) * W_WeaponRateFactor(actor);
                     weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), W_Shotgun_Attack3_Frame1);
index 5b200ed588e0df64bcfb951ab16e6e2ffcfb49e3..ca30189fa112de63bafcffd7d1b2fe7245996435 100644 (file)
@@ -27,6 +27,10 @@ CLASS(Shotgun, Weapon)
                P(class, prefix, animtime, float, BOTH) \
                P(class, prefix, bullets, float, PRI) \
                P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, damagefalloff_forcehalflife, float, PRI) \
+               P(class, prefix, damagefalloff_halflife, float, PRI) \
+               P(class, prefix, damagefalloff_maxdist, float, PRI) \
+               P(class, prefix, damagefalloff_mindist, float, PRI) \
                P(class, prefix, force, float, BOTH) \
                P(class, prefix, melee_delay, float, SEC) \
                P(class, prefix, melee_multihit, float, SEC) \
index 4066efc4e00d0d346bc662f2088829ec7228972c..00be9c2188d92eb4e55bcc5dbbc3641a13ba5e8b 100644 (file)
@@ -126,7 +126,7 @@ void W_Vaporizer_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 
        yoda = 0;
        impressive_hits = 0;
-       FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, vaporizer_damage, true, WEP_CVAR_PRI(vaporizer, force), 0, 0, 0, 0, thiswep.m_id);
+       FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, vaporizer_damage, true, WEP_CVAR_PRI(vaporizer, force), WEP_CVAR_PRI(vaporizer, damagefalloff_mindist), WEP_CVAR_PRI(vaporizer, damagefalloff_maxdist), WEP_CVAR_PRI(vaporizer, damagefalloff_halflife), WEP_CVAR_PRI(vaporizer, damagefalloff_forcehalflife), thiswep.m_id);
 
        // do this now, as goodhits is disabled below
        vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
index 83a1660ccc6eb15fe091727b6bd991f3f45d6da2..6d582d45b49835aa6d042dce621204bcbc0794bd 100644 (file)
@@ -24,33 +24,37 @@ CLASS(Vaporizer, Weapon)
 #define X(BEGIN, P, END, class, prefix) \
        BEGIN(class) \
                P(class, prefix, ammo, float, PRI) \
-       P(class, prefix, animtime, float, PRI) \
-        P(class, prefix, damage, float, PRI) \
-       P(class, prefix, force, float, PRI) \
-       P(class, prefix, refire, float, PRI) \
-       P(class, prefix, ammo, float, SEC) \
-       P(class, prefix, animtime, float, SEC) \
-       P(class, prefix, damage, float, SEC) \
-       P(class, prefix, delay, float, SEC) \
-       P(class, prefix, edgedamage, float, SEC) \
-       P(class, prefix, force, float, SEC) \
-        P(class, prefix, force_zscale, float, SEC) \
-       P(class, prefix, lifetime, float, SEC) \
-       P(class, prefix, radius, float, SEC) \
-       P(class, prefix, refire, float, SEC) \
-       P(class, prefix, shotangle, float, SEC) \
-       P(class, prefix, speed, float, SEC) \
-       P(class, prefix, spread, float, SEC) \
-       P(class, prefix, reload_ammo, float, NONE) \
-        P(class, prefix, reload_time, float, NONE) \
-        P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
+               P(class, prefix, animtime, float, PRI) \
+               P(class, prefix, damage, float, PRI) \
+               P(class, prefix, damagefalloff_forcehalflife, float, PRI) \
+               P(class, prefix, damagefalloff_halflife, float, PRI) \
+               P(class, prefix, damagefalloff_maxdist, float, PRI) \
+               P(class, prefix, damagefalloff_mindist, float, PRI) \
+               P(class, prefix, force, float, PRI) \
+               P(class, prefix, refire, float, PRI) \
+               P(class, prefix, ammo, float, SEC) \
+               P(class, prefix, animtime, float, SEC) \
+               P(class, prefix, damage, float, SEC) \
+               P(class, prefix, delay, float, SEC) \
+               P(class, prefix, edgedamage, float, SEC) \
+               P(class, prefix, force, float, SEC) \
+               P(class, prefix, force_zscale, float, SEC) \
+               P(class, prefix, lifetime, float, SEC) \
+               P(class, prefix, radius, float, SEC) \
+               P(class, prefix, refire, float, SEC) \
+               P(class, prefix, shotangle, float, SEC) \
+               P(class, prefix, speed, float, SEC) \
+               P(class, prefix, spread, float, SEC) \
+               P(class, prefix, reload_ammo, float, NONE) \
+               P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, weaponreplace, string, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
        END()
-    W_PROPS(X, Vaporizer, vaporizer)
+       W_PROPS(X, Vaporizer, vaporizer)
 #undef X
 
 ENDCLASS(Vaporizer)
index 2d80a7a61ae89b1266299984f8a783605d9426ab..ef88c6bd83405f324fd2b136394320c8a5568a92 100644 (file)
@@ -42,11 +42,11 @@ CLASS(Vortex, Weapon)
                P(class, prefix, charge_shot_multiplier, float, NONE) \
                P(class, prefix, charge_start, float, NONE) \
                P(class, prefix, charge_velocity_rate, float, NONE) \
+               P(class, prefix, damage, float, BOTH) \
                P(class, prefix, damagefalloff_forcehalflife, float, BOTH) \
                P(class, prefix, damagefalloff_halflife, float, BOTH) \
                P(class, prefix, damagefalloff_maxdist, float, BOTH) \
                P(class, prefix, damagefalloff_mindist, float, BOTH) \
-               P(class, prefix, damage, float, BOTH) \
                P(class, prefix, force, float, BOTH) \
                P(class, prefix, refire, float, BOTH) \
                P(class, prefix, secondary, float, NONE) \
index a8385b686aa87f3b456c9b25bc81bcea467bd7a6..d531fab5190e7b29da9f454ca7625c45813050ad 100644 (file)
@@ -361,7 +361,12 @@ void fireBullet_trace_callback(vector start, vector hit, vector end)
        fireBullet_last_hit = NULL;
 }
 
-void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float headshot_multiplier, float force, float dtype, entity tracer_effect, bool do_antilag)
+void fireBullet_falloff(entity this, .entity weaponentity, vector start, vector dir,
+                        float spread, float max_solid_penetration, float damage,
+                        float falloff_halflife, float falloff_mindist,
+                        float falloff_maxdist, float headshot_multiplier,
+                        float force, float falloff_forcehalflife,
+                        float dtype, entity tracer_effect, bool do_antilag)
 {
        dir = normalize(dir + randomvec() * spread);
        vector end = start + dir * max_shot_distance;
@@ -426,7 +431,9 @@ void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector
                if(!hit || hit.solid == SOLID_BSP || hit.solid == SOLID_SLIDEBOX)
                        Damage_DamageInfo(start, damage * damage_fraction, 0, 0, max(1, force) * dir * damage_fraction, dtype, hit.species, this);
 
-               if (hit && hit != WarpZone_trace_forent && hit != fireBullet_last_hit)  // Avoid self-damage (except after going through a warp); avoid hitting the same entity twice (engine bug).
+               // Avoid self-damage (except after going through a warp)
+               // avoid hitting the same entity twice (engine bug)
+               if (hit && hit != WarpZone_trace_forent && hit != fireBullet_last_hit)
                {
                        fireBullet_last_hit = hit;
                        yoda = 0;
@@ -438,7 +445,29 @@ void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector
                                headshot = true;
                        }
                        bool gooddamage = accuracy_isgooddamage(this, hit);
-                       Damage(hit, this, this, damage * damage_fraction, dtype, weaponentity, start, force * dir * damage_fraction);
+
+                       float dealt_damage = damage * damage_fraction;
+                       vector dealt_force = force * dir * damage_fraction;
+
+                       if (falloff_halflife || falloff_forcehalflife)
+                       {
+                               // start, end and trace_endpos seem unreliable for
+                               // falloff calculations, using `entity.origin`s instead.
+                               // dist is only used to measure distance between shooter
+                               // and target entities and do math based on the distance
+                               // target's location = hit.origin
+                               // shooter's location = this.origin
+                               float dist = vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, hit.origin) - this.origin);
+
+                               if (falloff_halflife)
+                                       dealt_damage *= ExponentialFalloff(falloff_mindist, falloff_maxdist, falloff_halflife,      dist);
+
+                               if (falloff_forcehalflife)
+                                       dealt_force  *= ExponentialFalloff(falloff_mindist, falloff_maxdist, falloff_forcehalflife, dist);
+                       }
+
+                       Damage(hit, this, this, dealt_damage, dtype, weaponentity, start, dealt_force);
+
                        // calculate hits for ballistic weapons
                        if(gooddamage)
                        {
@@ -507,6 +536,11 @@ void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector
                this.dphitcontentsmask = oldsolid;
 }
 
+void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float headshot_multiplier, float force, float dtype, entity tracer_effect, bool do_antilag)
+{
+       fireBullet_falloff(this, weaponentity, start, dir, spread, max_solid_penetration, damage, 0, 0, 0, headshot_multiplier, force, 0, dtype, tracer_effect, do_antilag);
+}
+
 void fireBullet(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float headshot_multiplier, float force, float dtype, entity tracer_effect)
 {
        fireBullet_antilag(this, weaponentity, start, dir, spread, max_solid_penetration, damage, headshot_multiplier, force, dtype, tracer_effect, true);