- added Xaser's submission for no impact damage from blasting.

SVN r3693 (trunk)
This commit is contained in:
Christoph Oelckers 2012-06-16 09:01:05 +00:00
parent ff25785781
commit 37d9519673
5 changed files with 23 additions and 8 deletions

View file

@ -22,7 +22,7 @@
// //
//========================================================================== //==========================================================================
void BlastActor (AActor *victim, fixed_t strength, fixed_t speed, AActor * Owner, const PClass * blasteffect) void BlastActor (AActor *victim, fixed_t strength, fixed_t speed, AActor * Owner, const PClass * blasteffect, bool dontdamage)
{ {
angle_t angle,ang; angle_t angle,ang;
AActor *mo; AActor *mo;
@ -67,7 +67,7 @@ void BlastActor (AActor *victim, fixed_t strength, fixed_t speed, AActor * Owner
{ {
// Players handled automatically // Players handled automatically
} }
else else if (!dontdamage)
{ {
victim->flags2 |= MF2_BLASTED; victim->flags2 |= MF2_BLASTED;
} }
@ -83,6 +83,7 @@ enum
BF_USEAMMO = 1, BF_USEAMMO = 1,
BF_DONTWARN = 2, BF_DONTWARN = 2,
BF_AFFECTBOSSES = 4, BF_AFFECTBOSSES = 4,
BF_NOIMPACTDAMAGE = 8,
}; };
//========================================================================== //==========================================================================
@ -145,6 +146,6 @@ DEFINE_ACTION_FUNCTION_PARAMS (AActor, A_Blast)
{ // Out of range { // Out of range
continue; continue;
} }
BlastActor (mo, strength, speed, self, blasteffect); BlastActor (mo, strength, speed, self, blasteffect, !!(blastflags & BF_NOIMPACTDAMAGE));
} }
} }

View file

@ -474,7 +474,7 @@ void P_AimCamera (AActor *t1, fixed_t &x, fixed_t &y, fixed_t &z, sector_t *&sec
// [RH] Means of death // [RH] Means of death
void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance, void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance,
FName damageType, bool hurtSelf, bool dodamage=true, int fulldamagedistance=0); FName damageType, bool hurtSelf, bool dodamage=true, int fulldamagedistance=0, bool noimpactdamage=false);
void P_DelSector_List(); void P_DelSector_List();
void P_DelSeclist(msecnode_t *); // phares 3/16/98 void P_DelSeclist(msecnode_t *); // phares 3/16/98

View file

@ -4446,7 +4446,7 @@ CUSTOM_CVAR (Float, splashfactor, 1.f, CVAR_SERVERINFO)
//========================================================================== //==========================================================================
void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int bombdistance, FName bombmod, void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int bombdistance, FName bombmod,
bool DamageSource, bool bombdodamage, int fulldamagedistance) bool DamageSource, bool bombdodamage, int fulldamagedistance, bool noimpactdamage)
{ {
if (bombdistance <= 0) if (bombdistance <= 0)
return; return;
@ -4552,7 +4552,7 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b
int damage = (int)points; int damage = (int)points;
if (bombdodamage) P_DamageMobj (thing, bombspot, bombsource, damage, bombmod); if (bombdodamage) P_DamageMobj (thing, bombspot, bombsource, damage, bombmod);
else if (thing->player == NULL) thing->flags2 |= MF2_BLASTED; else if (thing->player == NULL && !noimpactdamage) thing->flags2 |= MF2_BLASTED;
if (!(thing->flags & MF_ICECORPSE)) if (!(thing->flags & MF_ICECORPSE))
{ {

View file

@ -776,6 +776,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Explode)
} }
} }
enum
{
RTF_AFFECTSOURCE = 1,
RTF_NOIMPACTDAMAGE = 2,
};
//========================================================================== //==========================================================================
// //
// A_RadiusThrust // A_RadiusThrust
@ -787,9 +793,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusThrust)
ACTION_PARAM_START(3); ACTION_PARAM_START(3);
ACTION_PARAM_INT(force, 0); ACTION_PARAM_INT(force, 0);
ACTION_PARAM_INT(distance, 1); ACTION_PARAM_INT(distance, 1);
ACTION_PARAM_BOOL(affectSource, 2); ACTION_PARAM_INT(thrustFlags, 2);
ACTION_PARAM_INT(fullthrustdistance, 3); ACTION_PARAM_INT(fullthrustdistance, 3);
bool affectSource = !!(thrustFlags & RTF_AFFECTSOURCE);
bool noimpactdamage = !!(thrustFlags & RTF_NOIMPACTDAMAGE);
bool sourcenothrust = false; bool sourcenothrust = false;
if (force <= 0) force = 128; if (force <= 0) force = 128;
@ -803,7 +812,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusThrust)
} }
int sourceflags2 = self->target != NULL ? self->target->flags2 : 0; int sourceflags2 = self->target != NULL ? self->target->flags2 : 0;
P_RadiusAttack (self, self->target, force, distance, self->DamageType, affectSource, false, fullthrustdistance); P_RadiusAttack (self, self->target, force, distance, self->DamageType, affectSource, false, fullthrustdistance, noimpactdamage);
P_CheckSplash(self, distance << FRACBITS); P_CheckSplash(self, distance << FRACBITS);
if (sourcenothrust) if (sourcenothrust)

View file

@ -123,10 +123,15 @@ const int MSF_Standard = 0;
const int MSF_Classic = 1; const int MSF_Classic = 1;
const int MSF_DontHurt = 2; const int MSF_DontHurt = 2;
// Flags for A_RadiusThrust
const int RTF_AFFECTSOURCE = 1;
const int RTF_NOIMPACTDAMAGE = 2;
// Flags for A_Blast // Flags for A_Blast
const int BF_USEAMMO = 1; const int BF_USEAMMO = 1;
const int BF_DONTWARN = 2; const int BF_DONTWARN = 2;
const int BF_AFFECTBOSSES = 4; const int BF_AFFECTBOSSES = 4;
const int BF_NOIMPACTDAMAGE = 8;
// Flags for A_SeekerMissile // Flags for A_SeekerMissile
const int SMF_LOOK = 1; const int SMF_LOOK = 1;