]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an armor piercing option to vortex
authorMario <mario@smbclan.net>
Mon, 4 Jun 2018 15:40:50 +0000 (01:40 +1000)
committerMario <mario@smbclan.net>
Mon, 4 Jun 2018 15:40:50 +0000 (01:40 +1000)
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
bal-wep-xpm.cfg
qcsrc/common/deathtypes/all.qh
qcsrc/common/util.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/common/weapons/weapon/vortex.qh

index 94579c3985f928ed6838643ca57b65c3cfcad7e6..a4c4bedda1e60924fad98ed710e54804bb34054a 100644 (file)
@@ -303,6 +303,7 @@ set g_balance_vortex_charge_start 0.5
 set g_balance_vortex_charge_velocity_rate 0
 set g_balance_vortex_primary_ammo 6
 set g_balance_vortex_primary_animtime 0.4
+set g_balance_vortex_primary_armorpierce 0
 set g_balance_vortex_primary_damage 70
 set g_balance_vortex_primary_damagefalloff_forcehalflife 0
 set g_balance_vortex_primary_damagefalloff_halflife 0
@@ -315,6 +316,7 @@ set g_balance_vortex_reload_time 2
 set g_balance_vortex_secondary 0
 set g_balance_vortex_secondary_ammo 2
 set g_balance_vortex_secondary_animtime 0
+set g_balance_vortex_secondary_armorpierce 0
 set g_balance_vortex_secondary_chargepool 0
 set g_balance_vortex_secondary_chargepool_pause_regen 1
 set g_balance_vortex_secondary_chargepool_regen 0.15
index c7935e0e329273d3c1777de86abb9251049a6a38..b1a83000f6f41d18345045cfd9d7b44c9c41442f 100644 (file)
@@ -303,6 +303,7 @@ set g_balance_vortex_charge_start 0.5
 set g_balance_vortex_charge_velocity_rate 0
 set g_balance_vortex_primary_ammo 5
 set g_balance_vortex_primary_animtime 0.3
+set g_balance_vortex_primary_armorpierce 0
 set g_balance_vortex_primary_damage 100
 set g_balance_vortex_primary_damagefalloff_forcehalflife 0
 set g_balance_vortex_primary_damagefalloff_halflife 0
@@ -315,6 +316,7 @@ set g_balance_vortex_reload_time 2
 set g_balance_vortex_secondary 0
 set g_balance_vortex_secondary_ammo 2
 set g_balance_vortex_secondary_animtime 0
+set g_balance_vortex_secondary_armorpierce 0
 set g_balance_vortex_secondary_chargepool 0
 set g_balance_vortex_secondary_chargepool_pause_regen 1
 set g_balance_vortex_secondary_chargepool_regen 0.15
index f5becd0df64c1091d0ddadb1f3d3ade79d5aacd1..380d93ed47acc76f5aae18c560b77962a49ad531 100644 (file)
@@ -369,6 +369,7 @@ set g_balance_vortex_charge_start 0.5
 set g_balance_vortex_charge_velocity_rate 0
 set g_balance_vortex_primary_ammo 6
 set g_balance_vortex_primary_animtime 0.6
+set g_balance_vortex_primary_armorpierce 0
 set g_balance_vortex_primary_damage 80
 set g_balance_vortex_primary_damagefalloff_forcehalflife 0
 set g_balance_vortex_primary_damagefalloff_halflife 0
@@ -381,6 +382,7 @@ set g_balance_vortex_reload_time 2
 set g_balance_vortex_secondary 0
 set g_balance_vortex_secondary_ammo 2
 set g_balance_vortex_secondary_animtime 0
+set g_balance_vortex_secondary_armorpierce 0
 set g_balance_vortex_secondary_chargepool 0
 set g_balance_vortex_secondary_chargepool_pause_regen 1
 set g_balance_vortex_secondary_chargepool_regen 0.15
index ebf1a91b5681b2c03e91542309dd2ee1958e4354..fcf68678d197f048f1b4bad1a270890eea1d7cd4 100644 (file)
@@ -303,6 +303,7 @@ set g_balance_vortex_charge_start 0.5
 set g_balance_vortex_charge_velocity_rate 0
 set g_balance_vortex_primary_ammo 6
 set g_balance_vortex_primary_animtime 0.4
+set g_balance_vortex_primary_armorpierce 0
 set g_balance_vortex_primary_damage 80
 set g_balance_vortex_primary_damagefalloff_forcehalflife 0
 set g_balance_vortex_primary_damagefalloff_halflife 0
@@ -315,6 +316,7 @@ set g_balance_vortex_reload_time 2
 set g_balance_vortex_secondary 0
 set g_balance_vortex_secondary_ammo 2
 set g_balance_vortex_secondary_animtime 0
+set g_balance_vortex_secondary_armorpierce 0
 set g_balance_vortex_secondary_chargepool 0
 set g_balance_vortex_secondary_chargepool_pause_regen 1
 set g_balance_vortex_secondary_chargepool_regen 0.15
index 33e0b3cadcb5b1ffd3e5b630cffca4244d8d2d00..e55e860773424fdad08857e6b3c121c3b686c407 100644 (file)
@@ -303,6 +303,7 @@ set g_balance_vortex_charge_start 0.5
 set g_balance_vortex_charge_velocity_rate 0
 set g_balance_vortex_primary_ammo 6
 set g_balance_vortex_primary_animtime 0.4
+set g_balance_vortex_primary_armorpierce 0
 set g_balance_vortex_primary_damage 80
 set g_balance_vortex_primary_damagefalloff_forcehalflife 0
 set g_balance_vortex_primary_damagefalloff_halflife 0
@@ -315,6 +316,7 @@ set g_balance_vortex_reload_time 2
 set g_balance_vortex_secondary 0
 set g_balance_vortex_secondary_ammo 2
 set g_balance_vortex_secondary_animtime 0
+set g_balance_vortex_secondary_armorpierce 0
 set g_balance_vortex_secondary_chargepool 0
 set g_balance_vortex_secondary_chargepool_pause_regen 1
 set g_balance_vortex_secondary_chargepool_regen 0.15
index 03e003c1223ff5e942fd6a391e5250737aba4b1a..b16e787f5e5a95c029e1c679405b6b7d37d00a08 100644 (file)
@@ -303,6 +303,7 @@ set g_balance_vortex_charge_start 0.5
 set g_balance_vortex_charge_velocity_rate 0
 set g_balance_vortex_primary_ammo 6
 set g_balance_vortex_primary_animtime 0.4
+set g_balance_vortex_primary_armorpierce 0
 set g_balance_vortex_primary_damage 80
 set g_balance_vortex_primary_damagefalloff_forcehalflife 0
 set g_balance_vortex_primary_damagefalloff_halflife 0
@@ -315,6 +316,7 @@ set g_balance_vortex_reload_time 2
 set g_balance_vortex_secondary 0
 set g_balance_vortex_secondary_ammo 2
 set g_balance_vortex_secondary_animtime 0
+set g_balance_vortex_secondary_armorpierce 0
 set g_balance_vortex_secondary_chargepool 0
 set g_balance_vortex_secondary_chargepool_pause_regen 1
 set g_balance_vortex_secondary_chargepool_regen 0.15
index b489a56e4db151ffbea7f70cd7e4326a5c72a822..beb8e3e912221911705429fe210042762ed51cb0 100644 (file)
@@ -25,10 +25,10 @@ const int HITTYPE_SECONDARY = BITS(1) << 8;
 /** automatically set by RadiusDamage */
 const int HITTYPE_SPLASH = BITS(1) << 9;
 const int HITTYPE_BOUNCE = BITS(1) << 10;
+const int HITTYPE_ARMORPIERCE = BITS(1) << 11;
 // unused yet
-const int HITTYPE_RESERVED = BITS(1) << 11;
-const int HITTYPE_RESERVED2 = BITS(1) << 12;
-const int DEATH_HITTYPEMASK = HITTYPE_SECONDARY | HITTYPE_SPLASH | HITTYPE_BOUNCE | HITTYPE_RESERVED | HITTYPE_RESERVED2;
+const int HITTYPE_RESERVED = BITS(1) << 12;
+const int DEATH_HITTYPEMASK = HITTYPE_SECONDARY | HITTYPE_SPLASH | HITTYPE_BOUNCE | HITTYPE_ARMORPIERCE | HITTYPE_RESERVED;
 // normal deaths begin
 const int DT_FIRST = BIT(13);
 
index 97bd155eaada8778baaee2727a270001a9598dce..95ab69ca6e39cbbea6a73898e8165be8860f35c2 100644 (file)
@@ -1126,6 +1126,8 @@ vector healtharmor_applydamage(float a, float armorblock, int deathtype, float d
        vector v;
        if (DEATH_IS(deathtype, DEATH_DROWN))  // Why should armor help here...
                armorblock = 0;
+       if (deathtype & HITTYPE_ARMORPIERCE)
+               armorblock = 0;
        v.y = bound(0, damage * armorblock, a); // save
        v.x = bound(0, damage - v.y, damage); // take
        v.z = 0;
index 8c590bf6e2c6841f56c2a5b978123f5fad64d3f4..b8963229710e23266cba03cb023c2a443773d6b1 100644 (file)
@@ -105,6 +105,10 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i
        myforcehalflife = WEP_CVAR_BOTH(vortex, !issecondary, damagefalloff_forcehalflife);
        myammo = WEP_CVAR_BOTH(vortex, !issecondary, ammo);
 
+    float dtype = WEP_VORTEX.m_id;
+    if(WEP_CVAR_BOTH(vortex, !issecondary, armorpierce))
+        dtype |= HITTYPE_ARMORPIERCE;
+
        float flying;
        flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last
 
@@ -120,7 +124,7 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i
        mydmg *= charge;
        myforce *= charge;
 
-       W_SetupShot(actor, weaponentity, true, 5, SND_NEXFIRE, CH_WEAPON_A, mydmg, WEP_VORTEX.m_id);
+       W_SetupShot(actor, weaponentity, true, 5, SND_NEXFIRE, CH_WEAPON_A, mydmg, dtype);
        if(charge > WEP_CVAR(vortex, charge_animlimit) && WEP_CVAR(vortex, charge_animlimit)) // if the Vortex is overcharged, we play an extra sound
        {
                sound(actor, CH_WEAPON_B, SND_NEXCHARGE, VOL_BASE * (charge - 0.5 * WEP_CVAR(vortex, charge_animlimit)) / (1 - 0.5 * WEP_CVAR(vortex, charge_animlimit)), ATTN_NORM);
@@ -128,7 +132,7 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i
 
        yoda = 0;
        damage_goodhits = 0;
-       FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX.m_id);
+       FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, dtype);
 
        if(yoda && flying)
                Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
index 59152e2759f93b144585d9b8fcc6f394e6751627..cc975ccebdff7748748601b20c59d8ea3008f370 100644 (file)
@@ -22,6 +22,7 @@ CLASS(Vortex, Weapon)
        BEGIN(class) \
                P(class, prefix, ammo, float, BOTH) \
                P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, armorpierce, float, BOTH) \
                P(class, prefix, chargepool, float, SEC) \
                P(class, prefix, chargepool_pause_regen, float, SEC) \
                P(class, prefix, chargepool_regen, float, SEC) \