From: drjaska Date: Tue, 27 Dec 2022 12:19:01 +0000 (+0200) Subject: individual dp_sf for devastator X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a6e1d0a6f729326631997aea070b6280d94ad8d4;p=xonotic%2Fxonotic-data.pk3dir.git individual dp_sf for devastator --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index adb7cc654..81a314202 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -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 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index 17f5b31ca..ed5313966 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -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 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index 2799a2496..7205ff100 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -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 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index 09466acce..b10067446 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -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 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 319d77923..3a4039ac1 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -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 diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 4e05e681d..560c81701 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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(); diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 1f9e6a9a0..333d20cb5 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -139,7 +139,6 @@ vector camera_direction; const float ALPHA_MIN_VISIBLE = 0.003; float armorblockpercent; -float damagepush_speedfactor; //hooks int calledhooks; diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 5f3cf9d43..411c6d153 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -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); } diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 9ad68db27..7bc6c0360 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -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)) { diff --git a/qcsrc/common/weapons/weapon/devastator.qh b/qcsrc/common/weapons/weapon/devastator.qh index 70c72f52c..842058684 100644 --- a/qcsrc/common/weapons/weapon/devastator.qh +++ b/qcsrc/common/weapons/weapon/devastator.qh @@ -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) \ diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 58fda9a01..740c377a1 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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() diff --git a/qcsrc/server/damage.qc b/qcsrc/server/damage.qc index d93d00bf5..ed7cc4eb0 100644 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@ -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); diff --git a/qcsrc/server/weapons/common.qh b/qcsrc/server/weapons/common.qh index 779226be3..831b852dd 100644 --- a/qcsrc/server/weapons/common.qh +++ b/qcsrc/server/weapons/common.qh @@ -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; diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index fc2c3979c..3d5a1b1b4 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -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;