]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
individual dp_sf for devastator drjaska/paul
authordrjaska <drjaska83@gmail.com>
Tue, 27 Dec 2022 12:19:01 +0000 (14:19 +0200)
committerdrjaska <drjaska83@gmail.com>
Tue, 27 Dec 2022 12:19:01 +0000 (14:19 +0200)
14 files changed:
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/devastator.qh
qcsrc/server/client.qc
qcsrc/server/damage.qc
qcsrc/server/weapons/common.qh
qcsrc/server/weapons/weaponsystem.qc

index adb7cc654fa3565e82441a1ca9115936191ebfc1..81a31420250ec069ed783dcad12d98026b032728 100644 (file)
@@ -390,6 +390,7 @@ set g_balance_devastator_ammo 4
 set g_balance_devastator_animtime 0.4
 set g_balance_devastator_damage 80
 set g_balance_devastator_damageforcescale 1
+set g_balance_devastator_damagepush_speedfactor 0
 set g_balance_devastator_detonatedelay 0.02
 set g_balance_devastator_edgedamage 40
 set g_balance_devastator_force 400
index 17f5b31cab3b29b313e70f27606e6cf42bd7e082..ed53139662dccf209564188d6988014d8ea2f2e1 100644 (file)
@@ -390,6 +390,7 @@ set g_balance_devastator_ammo 3
 set g_balance_devastator_animtime 0.3
 set g_balance_devastator_damage 105
 set g_balance_devastator_damageforcescale 4
+set g_balance_devastator_damagepush_speedfactor 0
 set g_balance_devastator_detonatedelay 0.2
 set g_balance_devastator_edgedamage 40
 set g_balance_devastator_force 600
index 2799a2496b47fb4debea904aa6b051b95c59a621..7205ff100cbf5f71d36f26b55c15ad7ae4abfa1d 100644 (file)
@@ -390,6 +390,7 @@ set g_balance_devastator_ammo 4
 set g_balance_devastator_animtime 0.4
 set g_balance_devastator_damage 70
 set g_balance_devastator_damageforcescale 1
+set g_balance_devastator_damagepush_speedfactor 0
 set g_balance_devastator_detonatedelay 0.02
 set g_balance_devastator_edgedamage 35
 set g_balance_devastator_force 450
index 09466acce81bcb3949c256133dce2a9675c89acc..b100674468550cf23d8e5a527390efbae11215cd 100644 (file)
@@ -390,6 +390,7 @@ set g_balance_devastator_ammo 4
 set g_balance_devastator_animtime 0.7
 set g_balance_devastator_damage 80
 set g_balance_devastator_damageforcescale 0
+set g_balance_devastator_damagepush_speedfactor 0
 set g_balance_devastator_detonatedelay 999
 set g_balance_devastator_edgedamage 40
 set g_balance_devastator_force 350
index 319d77923035e150b23bf90fa1ca4321d5564e55..3a4039ac1fc184b9fa22138eeb0dd0bcd6fd67f2 100644 (file)
@@ -390,6 +390,7 @@ set g_balance_devastator_ammo 4
 set g_balance_devastator_animtime 0.4
 set g_balance_devastator_damage 80
 set g_balance_devastator_damageforcescale 1
+set g_balance_devastator_damagepush_speedfactor 0
 set g_balance_devastator_detonatedelay 0.02
 set g_balance_devastator_edgedamage 40
 set g_balance_devastator_force 400
index 4e05e681db3d48d8c37276dfe4339e4e895fcd9e..560c817017dc5319992b401d53257fbab7c4983f 100644 (file)
@@ -1114,7 +1114,6 @@ NET_HANDLE(ENT_CLIENT_INIT, bool isnew)
        strcpy(forcefog, ReadString());
 
        armorblockpercent = ReadByte() / 255.0;
-       damagepush_speedfactor = ReadByte() / 255.0;
 
        serverflags = ReadByte();
 
index 1f9e6a9a03e5aa1f78ef13dd78a8de13b79853ca..333d20cb59c34877e7b2a18216334b28b6b622cf 100644 (file)
@@ -139,7 +139,6 @@ vector camera_direction;
 const float ALPHA_MIN_VISIBLE = 0.003;
 
 float armorblockpercent;
-float damagepush_speedfactor;
 
 //hooks
 int calledhooks;
index 5f3cf9d43b3fd32979fc245e41d3ba66ca49d7c8..411c6d1534981148981e7bf33aef9172f98aa75c 100644 (file)
@@ -240,7 +240,8 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                if(it.damageforcescale)
                        if(vdist(thisforce, !=, 0))
                        {
-                               it.velocity = it.velocity + damage_explosion_calcpush(it.damageforcescale * thisforce, it.velocity, damagepush_speedfactor);
+                               // gibs are unscaled by damagepush_speedfactor
+                               it.velocity += it.damageforcescale * thisforce;
                                UNSET_ONGROUND(it);
                        }
 
index 9ad68db2741d4e73f2c3514e15177b5e5f4ec14d..7bc6c0360969f5f3a350ec39a340d34507fb4181 100644 (file)
@@ -515,6 +515,7 @@ METHOD(Devastator, wr_think, void(entity thiswep, entity actor, .entity weaponen
 METHOD(Devastator, wr_setup, void(entity thiswep, entity actor, .entity weaponentity))
 {
     actor.(weaponentity).rl_release = 1;
+    actor.(weaponentity).damagepush_speedfactor = WEP_CVAR(devastator, damagepush_speedfactor);
 }
 METHOD(Devastator, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
 {
index 70c72f52cba160dbcad5ab19e82e476f102f090c..84205868474d2df1974f6aefbb336b193de13838 100644 (file)
@@ -23,8 +23,9 @@ CLASS(Devastator, Weapon)
        BEGIN(class) \
                P(class, prefix, ammo, float, NONE) \
         P(class, prefix, animtime, float, NONE) \
-        P(class, prefix, damageforcescale, float, NONE) \
         P(class, prefix, damage, float, NONE) \
+        P(class, prefix, damageforcescale, float, NONE) \
+        P(class, prefix, damagepush_speedfactor, float, NONE) \
         P(class, prefix, detonatedelay, float, NONE) \
         P(class, prefix, edgedamage, float, NONE) \
         P(class, prefix, force, float, NONE) \
index 58fda9a016cdc2b42cd0c5ef8622f9c28d699cae..740c377a1d7d47b504176456878d980da26ef903 100644 (file)
@@ -878,7 +878,6 @@ void ClientInit_misc(entity this)
        else
                WriteString(channel, "");
        WriteByte(channel, this.count * 255.0); // g_balance_armor_blockpercent
-       WriteByte(channel, this.cnt * 255.0); // g_balance_damagepush_speedfactor
        WriteByte(channel, serverflags);
        WriteCoord(channel, autocvar_g_trueaim_minrange);
 }
@@ -891,11 +890,6 @@ void ClientInit_CheckUpdate(entity this)
                this.count = autocvar_g_balance_armor_blockpercent;
                this.SendFlags |= 1;
        }
-       if(this.cnt != autocvar_g_balance_damagepush_speedfactor)
-       {
-               this.cnt = autocvar_g_balance_damagepush_speedfactor;
-               this.SendFlags |= 1;
-       }
 }
 
 void ClientInit_Spawn()
index d93d00bf5f58d368a1f338c970d1657368ec46b9..ed7cc4eb099adbb1447510790437243eaf06a5d0 100644 (file)
@@ -829,7 +829,13 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
        if (force)
        if (!IS_PLAYER(targ) || !StatusEffects_active(STATUSEFFECT_SpawnShield, targ) || targ == attacker)
        {
-               vector farce = damage_explosion_calcpush(targ.damageforcescale * force, targ.velocity, autocvar_g_balance_damagepush_speedfactor);
+               float dp_sf = 0;
+               if (attacker.(weaponentity).damagepush_speedfactor != 0) // if initialized
+                       dp_sf = attacker.(weaponentity).damagepush_speedfactor;
+               else
+                       dp_sf = autocvar_g_balance_damagepush_speedfactor;
+
+               vector farce = damage_explosion_calcpush(targ.damageforcescale * force, targ.velocity, dp_sf);
                if(targ.move_movetype == MOVETYPE_PHYSICS)
                {
                        entity farcent = new(farce);
index 779226be3dfc98ded7bb21b56042e9ac54265b40..831b852ddbbc83f8d81a22f68148c30f536e2474 100644 (file)
@@ -17,6 +17,8 @@ bool WarpZone_Projectile_Touch_ImpactFilter_Callback(entity this, entity toucher
 
 .float misc_bulletcounter;
 
+.float damagepush_speedfactor;
+
 .int projectiledeathtype;
 
 .float fade_time;
index fc2c3979c2b15226d5242fc95fdc641ad658b53e..3d5a1b1b41a466afd623b34a4ee10c2566b476e8 100644 (file)
@@ -536,6 +536,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
                                this.m_weapon = newwep;
                                this.weaponname = newwep.mdl;
                                this.bulletcounter = 0;
+                               this.damagepush_speedfactor = autocvar_g_balance_damagepush_speedfactor;
                                newwep.wr_setup(newwep, actor, weaponentity);
                                this.state = WS_RAISE;