]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
q3compat: New Devastator cvar for mimicking q3df rl's horizontal force 1.2x multiplier
authorDr. Jaska <drjaska83@gmail.com>
Thu, 28 Nov 2024 15:15:08 +0000 (15:15 +0000)
committerterencehill <piuntn@gmail.com>
Thu, 28 Nov 2024 15:15:08 +0000 (15:15 +0000)
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/devastator.qh
qcsrc/server/damage.qc
qcsrc/server/damage.qh

index 6a2462d33534da2164a367b58bb07c358fd72c1d..9352a924d5e30599da6e0f5d17977725067c6d7d 100644 (file)
@@ -394,6 +394,7 @@ set g_balance_devastator_damageforcescale 1
 set g_balance_devastator_detonatedelay 0.02
 set g_balance_devastator_edgedamage 40
 set g_balance_devastator_force 400
+set g_balance_devastator_force_xyscale 1
 set g_balance_devastator_guidedelay 0.2
 set g_balance_devastator_guidegoal 512
 set g_balance_devastator_guiderate 90
index bfd58cf1769c09ee0e7069aa86ee3a171b8974b1..3d23432548d00317d9019bba20ff70e6011751f4 100644 (file)
@@ -394,6 +394,7 @@ set g_balance_devastator_damageforcescale 4
 set g_balance_devastator_detonatedelay 0.2
 set g_balance_devastator_edgedamage 40
 set g_balance_devastator_force 600
+set g_balance_devastator_force_xyscale 1
 set g_balance_devastator_guidedelay 0.15
 set g_balance_devastator_guidegoal 512
 set g_balance_devastator_guiderate 90
index dd555810a2f35eb65a07cc666995696d5bb2f882..4e1d63cbe95db22efd07000786a0fb05869c9051 100644 (file)
@@ -394,6 +394,7 @@ set g_balance_devastator_damageforcescale 1
 set g_balance_devastator_detonatedelay 0.02
 set g_balance_devastator_edgedamage 35
 set g_balance_devastator_force 450
+set g_balance_devastator_force_xyscale 1
 set g_balance_devastator_guidedelay 0.2
 set g_balance_devastator_guidegoal 512
 set g_balance_devastator_guiderate 70
index 0782260f44139370ff6a0b385790fd13dfc5e437..6f9f7f22e68c67a7566c250ca53b4101253687a4 100644 (file)
@@ -394,6 +394,7 @@ set g_balance_devastator_damageforcescale 0
 set g_balance_devastator_detonatedelay 999
 set g_balance_devastator_edgedamage 40
 set g_balance_devastator_force 350
+set g_balance_devastator_force_xyscale 1
 set g_balance_devastator_guidedelay 0.2
 set g_balance_devastator_guidegoal 512
 set g_balance_devastator_guiderate 0
index e049ad22b3d263312a8ef2a659458f62dd446891..76a0a408d246085a575cccd96e977119798b826d 100644 (file)
@@ -394,6 +394,7 @@ set g_balance_devastator_damageforcescale 1
 set g_balance_devastator_detonatedelay 0.02
 set g_balance_devastator_edgedamage 40
 set g_balance_devastator_force 400
+set g_balance_devastator_force_xyscale 1
 set g_balance_devastator_guidedelay 0.2
 set g_balance_devastator_guidegoal 512
 set g_balance_devastator_guiderate 90
index 3a936a5d844c24ca27f212684e92e9b0f0dd8ae1..63e735b3b15cd158182475f3715f89526dc910a6 100644 (file)
@@ -8,6 +8,9 @@ void W_Blaster_Touch(entity this, entity toucher)
 
        this.event_damage = func_null;
 
+       vector force_xyzscale = '1 1 1';
+       force_xyzscale.z = WEP_CVAR_PRI(WEP_BLASTER, force_zscale);
+
        RadiusDamageForSource(
                this,
                (this.origin + (this.mins + this.maxs) * 0.5),
@@ -20,7 +23,7 @@ void W_Blaster_Touch(entity this, entity toucher)
                NULL,
                false,
                WEP_CVAR_PRI(WEP_BLASTER, force),
-               WEP_CVAR_PRI(WEP_BLASTER, force_zscale),
+               force_xyzscale,
                this.projectiledeathtype,
                this.weaponentity_fld,
                toucher
index 150e1b043dbae54c24b8a06ed47c1719c7b45b55..d85cd46349438435b85490144af1b26ce96834a5 100644 (file)
@@ -28,15 +28,23 @@ void W_Devastator_Explode(entity this, entity directhitentity)
        this.event_damage = func_null;
        this.takedamage = DAMAGE_NO;
 
-       RadiusDamage(
+       vector force_xyzscale = '1 1 1';
+       force_xyzscale.x = WEP_CVAR(WEP_DEVASTATOR, force_xyscale);
+       force_xyzscale.y = WEP_CVAR(WEP_DEVASTATOR, force_xyscale);
+
+       RadiusDamageForSource(
                this,
+               this.origin,
+               this.velocity,
                this.realowner,
                WEP_CVAR(WEP_DEVASTATOR, damage),
                WEP_CVAR(WEP_DEVASTATOR, edgedamage),
                WEP_CVAR(WEP_DEVASTATOR, radius),
                NULL,
                NULL,
+               false,
                WEP_CVAR(WEP_DEVASTATOR, force),
+               force_xyzscale,
                this.projectiledeathtype,
                this.weaponentity_fld,
                directhitentity
index 01f3b59f343ae63936611710ca3f40c9945b52b4..1d3261f429ae3716a033444f13bddf1576e22efb 100644 (file)
@@ -29,6 +29,7 @@ CLASS(Devastator, Weapon)
                P(class, prefix, detonatedelay, float, NONE) \
                P(class, prefix, edgedamage, float, NONE) \
                P(class, prefix, force, float, NONE) \
+               P(class, prefix, force_xyscale, float, NONE) \
                P(class, prefix, guidedelay, float, NONE) \
                P(class, prefix, guidegoal, float, NONE) \
                P(class, prefix, guideratedelay, float, NONE) \
index b681ff54d04608740b2799a62ba482f12a22c2d6..8b2af78f22f013fc74d903ffbb86c85e41468ddc 100644 (file)
@@ -893,7 +893,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
 
 // Returns total damage applies to creatures
 float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe,
-                                                               float inflictorselfdamage, float forceintensity, float forcezscale, int deathtype, .entity weaponentity, entity directhitentity)
+                                                               float inflictorselfdamage, float forceintensity, vector forcexyzscale, int deathtype, .entity weaponentity, entity directhitentity)
 {
        entity  targ;
        vector  force;
@@ -1024,10 +1024,13 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
                                        force = force * (finaldmg / max(coredamage, edgedamage)) * forceintensity;
                                        hitloc = nearest;
 
-                                       // apply special scaling along the z axis if set
-                                       // NOTE: 0 value is not allowed for compatibility, in the case of weapon cvars not being set
-                                       if(forcezscale)
-                                               force.z *= forcezscale;
+                                       // apply special force scalings
+                                       if(forcexyzscale.x)
+                                               force.x *= forcexyzscale.x;
+                                       if(forcexyzscale.y)
+                                               force.y *= forcexyzscale.y;
+                                       if(forcexyzscale.z)
+                                               force.z *= forcexyzscale.z;
 
                                        if(targ != directhitentity)
                                        {
@@ -1132,7 +1135,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
 float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity)
 {
        return RadiusDamageForSource(inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad,
-                                                                       cantbe, mustbe, false, forceintensity, 1, deathtype, weaponentity, directhitentity);
+                                                                       cantbe, mustbe, false, forceintensity, '1 1 1', deathtype, weaponentity, directhitentity);
 }
 
 bool Heal(entity targ, entity inflictor, float amount, float limit)
index 06948528f80cfd288f032d1b25ad8e6990834758..bd9e10f97e062f2d775cc4b7e855b8fa53ff4cfa 100644 (file)
@@ -132,7 +132,7 @@ int autocvar_g_player_damageplayercenter;
 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force);
 
 float RadiusDamage_running;
-float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, float forcezscale, int deathtype, .entity weaponentity, entity directhitentity);
+float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, vector forcexyzscale, int deathtype, .entity weaponentity, entity directhitentity);
        // Returns total damage applies to creatures
 
 float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity);