From: Mario Date: Mon, 4 Jun 2018 15:40:50 +0000 (+1000) Subject: Add an armor piercing option to vortex X-Git-Tag: xonotic-v0.8.5~2111 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=83752f817b25c136626c27fc2d9e7c75238edc7c;p=xonotic%2Fxonotic-data.pk3dir.git Add an armor piercing option to vortex --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 94579c398..a4c4bedda 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -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 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index c7935e0e3..b1a83000f 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -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 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index f5becd0df..380d93ed4 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -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 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index ebf1a91b5..fcf68678d 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -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 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 33e0b3cad..e55e86077 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -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 diff --git a/bal-wep-xpm.cfg b/bal-wep-xpm.cfg index 03e003c12..b16e787f5 100644 --- a/bal-wep-xpm.cfg +++ b/bal-wep-xpm.cfg @@ -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 diff --git a/qcsrc/common/deathtypes/all.qh b/qcsrc/common/deathtypes/all.qh index b489a56e4..beb8e3e91 100644 --- a/qcsrc/common/deathtypes/all.qh +++ b/qcsrc/common/deathtypes/all.qh @@ -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); diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 97bd155ea..95ab69ca6 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -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; diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 8c590bf6e..b89632297 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -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); diff --git a/qcsrc/common/weapons/weapon/vortex.qh b/qcsrc/common/weapons/weapon/vortex.qh index 59152e275..cc975cceb 100644 --- a/qcsrc/common/weapons/weapon/vortex.qh +++ b/qcsrc/common/weapons/weapon/vortex.qh @@ -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) \