From 5d0369d4eda44f3bb9471596b8281e9660dfc59b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Aug 2013 12:18:58 +0200 Subject: [PATCH] - Ability to set A_VileAttack's initial attack's damage type - by BlueShadow. --- src/g_doom/a_archvile.cpp | 17 +++++++++++++++-- wadsrc/static/actors/actor.txt | 2 +- wadsrc/static/actors/constants.txt | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/g_doom/a_archvile.cpp b/src/g_doom/a_archvile.cpp index e2fb689c2a..8fce33324f 100644 --- a/src/g_doom/a_archvile.cpp +++ b/src/g_doom/a_archvile.cpp @@ -101,15 +101,20 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileTarget) // // A_VileAttack // + +// A_VileAttack flags +#define VAF_DMGTYPEAPPLYTODIRECT 1 + DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileAttack) { - ACTION_PARAM_START(6); + ACTION_PARAM_START(7); ACTION_PARAM_SOUND(snd,0); ACTION_PARAM_INT(dmg,1); ACTION_PARAM_INT(blastdmg,2); ACTION_PARAM_INT(blastrad,3); ACTION_PARAM_FIXED(thrust,4); ACTION_PARAM_NAME(dmgtype,5); + ACTION_PARAM_INT(flags,6); AActor *fire, *target; angle_t an; @@ -123,7 +128,15 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileAttack) return; S_Sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); - int newdam = P_DamageMobj (target, self, self, dmg, NAME_None); + + int newdam; + + if (flags & VAF_DMGTYPEAPPLYTODIRECT) + newdam = P_DamageMobj (target, self, self, dmg, dmgtype); + + else + newdam = P_DamageMobj (target, self, self, dmg, NAME_None); + P_TraceBleed (newdam > 0 ? newdam : dmg, target); an = self->angle >> ANGLETOFINESHIFT; diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index c2fa8a0c72..0ea0184224 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -84,7 +84,7 @@ ACTOR Actor native //: Thinker action native A_VileChase(); action native A_VileStart(); action native A_VileTarget(class fire = "ArchvileFire"); - action native A_VileAttack(sound snd = "vile/stop", int initialdmg = 20, int blastdmg = 70, int blastradius = 70, float thrustfac = 1.0, name damagetype = "Fire"); + action native A_VileAttack(sound snd = "vile/stop", int initialdmg = 20, int blastdmg = 70, int blastradius = 70, float thrustfac = 1.0, name damagetype = "Fire", int flags = 0); action native A_StartFire(); action native A_Fire(float spawnheight = 0); action native A_FireCrackle(); diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 18f991e435..cd9b088ab9 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -4,6 +4,9 @@ const int PAF_NOSKULLATTACK = 1; const int PAF_AIMFACING = 2; const int PAF_NOTARGET = 4; +// Flags for A_VileAttack +const int VAF_DMGTYPEAPPLYTODIRECT = 1; + // Flags for A_Saw const int SF_NORANDOM = 1; const int SF_RANDOMLIGHTMISS = 2;