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 94579c3..a4c4bed 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 c7935e0..b1a8300 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 f5becd0..380d93e 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 ebf1a91..fcf6867 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 33e0b3c..e55e860 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 03e003c..b16e787 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 b489a56..beb8e3e 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 97bd155..95ab69c 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 8c590bf..b896322 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 59152e2..cc975cc 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) \