Skip to content

Commit

Permalink
Hexen: Mushroom poison clouds should not be pushed (vanilla emulation)
Browse files Browse the repository at this point in the history
IssueID #911
  • Loading branch information
skyjake committed Apr 18, 2017
1 parent 9eaefb5 commit 15a1c83
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions doomsday/apps/plugins/hexen/include/p_mobj.h
Expand Up @@ -159,6 +159,7 @@ class MapStateWriter;

#define MF3_NOINFIGHT 0x00000001 // Mobj will never be targeted for in-fighting
#define MF3_CLIENTACTION 0x00000002 // States' action funcs are executed by client
#define MF3_NOBLAST 0x00000004 // Never affected by A_BlastRadius.

typedef enum dirtype_s {
DI_EAST,
Expand Down
10 changes: 8 additions & 2 deletions doomsday/apps/plugins/hexen/src/a_action.c
Expand Up @@ -506,9 +506,9 @@ void C_DECL A_FogMove(mobj_t* actor)
actor->mom[MY] = speed * FIX2FLT(finesine[an]);
}

void C_DECL A_PoisonBagInit(mobj_t* actor)
void C_DECL A_PoisonBagInit(mobj_t *actor)
{
mobj_t* mo;
mobj_t *mo;

if((mo = P_SpawnMobjXYZ(MT_POISONCLOUD, actor->origin[VX], actor->origin[VY],
actor->origin[VZ] + 28, P_Random() << 24, 0)))
Expand All @@ -521,6 +521,12 @@ void C_DECL A_PoisonBagInit(mobj_t* actor)
mo->radius = 20;
mo->height = 30;
mo->flags &= ~MF_NOCLIP;

// Vanilla quirk: poison clouds spawned by mushrooms cannot be blasted (issue 911).
if (actor->type == MT_ZPOISONSHROOM)
{
mo->flags3 |= MF3_NOBLAST;
}
}
}

Expand Down
9 changes: 4 additions & 5 deletions doomsday/apps/plugins/hexen/src/p_inter.c
Expand Up @@ -2180,19 +2180,18 @@ int P_DamageMobj2(mobj_t *target, mobj_t *inflictor, mobj_t *source, int damageP
case MT_POISONCLOUD:
if(target->player)
{
int damageDone = 0;

int damageDone = 0;
if(target->player->poisonCount < 4)
{
damageDone = P_PoisonDamage(target->player, source, 15 + (P_Random() & 15), false); // Don't play painsound
P_PoisonPlayer(target->player, source, 50);
S_StartSound(SFX_PLAYER_POISONCOUGH, target);
}

return damageDone;
}
else if(!(target->flags & MF_COUNTKILL))
{ // Only damage monsters/players with the poison cloud.
{
// Only damage monsters/players with the poison cloud.
return 0;
}
break;
Expand Down Expand Up @@ -2351,7 +2350,7 @@ int P_DamageMobj2(mobj_t *target, mobj_t *inflictor, mobj_t *source, int damageP
}
else
{
statenum_t state;
statenum_t state;

target->flags |= MF_JUSTHIT; // fight back!

Expand Down
8 changes: 6 additions & 2 deletions doomsday/apps/plugins/hexen/src/p_mobj.c
Expand Up @@ -1517,8 +1517,11 @@ static int radiusBlast(thinker_t* th, void* context)
mobj_t* mo = (mobj_t *) th;
coord_t dist;

if(mo == params->source || (mo->flags2 & MF2_BOSS))
if(mo == params->source || (mo->flags2 & MF2_BOSS) || (mo->flags3 & MF3_NOBLAST))
{
// Unaffected.
return false; // Continue iteration.
}

if(mo->type == MT_POISONCLOUD || // poison cloud.
mo->type == MT_HOLY_FX || // holy fx.
Expand All @@ -1532,7 +1535,8 @@ static int radiusBlast(thinker_t* th, void* context)
}
else if(!(mo->flags & MF_COUNTKILL) && !mo->player &&
!(mo->flags & MF_MISSILE))
{ // Must be monster, player, or missile.
{
// Must be monster, player, or missile.
return false; // Continue iteration.
}

Expand Down

0 comments on commit 15a1c83

Please sign in to comment.