mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 23:42:11 +00:00
Dashmode now destroys spikes and monitors on contact. Enemies? Probably not for now.
This commit is contained in:
parent
cee37819cd
commit
625cb39af7
1 changed files with 29 additions and 0 deletions
29
src/p_map.c
29
src/p_map.c
|
@ -448,6 +448,35 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
return true;
|
||||
}
|
||||
|
||||
// Dashmode users destroy spikes and monitors.
|
||||
if ((tmthing->player) && (tmthing->player->charability == CA_DASHMODE) && (tmthing->player->dashmode >= 3*TICRATE)
|
||||
&& (thing->flags & (MF_MONITOR) || thing->type == MT_SPIKE))
|
||||
{
|
||||
if ((thing->flags & (MF_MONITOR)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE)))
|
||||
return true;
|
||||
blockdist = thing->radius + tmthing->radius;
|
||||
if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist)
|
||||
return true; // didn't hit it
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
if (thing->type == MT_SPIKE)
|
||||
{
|
||||
S_StartSound(tmthing, thing->info->deathsound);
|
||||
for (thing = thing->subsector->sector->thinglist; thing; thing = thing->snext)
|
||||
if (thing->type == MT_SPIKE && thing->health > 0 && thing->flags & MF_SOLID && P_AproxDistance(thing->x - tmthing->x, thing->y - tmthing->y) < FixedMul(56*FRACUNIT, thing->scale))
|
||||
P_KillMobj(thing, tmthing, tmthing, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
thing->health = 0;
|
||||
P_KillMobj(thing, tmthing, tmthing, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)))
|
||||
return true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue