mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-30 05:00:46 +00:00
SF_MACHINE characters create boss explosions on death.
Also, the gravity of drowning characters has been reduced to look more natural.
This commit is contained in:
parent
8cb8990863
commit
898e17a441
3 changed files with 20 additions and 4 deletions
|
@ -2261,6 +2261,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
target->momx = target->momy = target->momz = 0;
|
||||
if (damagetype == DMG_DROWNED) // drowned
|
||||
{
|
||||
target->movedir = damagetype; // we're MOVING the Damage Into anotheR function... Okay, this is a bit of a hack.
|
||||
if (target->player->charflags & SF_MACHINE)
|
||||
S_StartSound(target, sfx_fizzle);
|
||||
else
|
||||
|
|
17
src/p_mobj.c
17
src/p_mobj.c
|
@ -6908,7 +6908,22 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
}
|
||||
}
|
||||
else // Apply gravity to fall downwards.
|
||||
P_SetObjectMomZ(mobj, -2*FRACUNIT/3, true);
|
||||
{
|
||||
if (mobj->player && !(mobj->fuse % 8) && (mobj->player->charflags & SF_MACHINE))
|
||||
{
|
||||
fixed_t r = mobj->radius>>FRACBITS;
|
||||
mobj_t *explosion = P_SpawnMobj(
|
||||
mobj->x + (P_RandomRange(r, -r)<<FRACBITS),
|
||||
mobj->y + (P_RandomRange(r, -r)<<FRACBITS),
|
||||
mobj->z + (P_RandomKey(mobj->height>>FRACBITS)<<FRACBITS),
|
||||
MT_BOSSEXPLODE);
|
||||
S_StartSound(explosion, sfx_cybdth);
|
||||
}
|
||||
if (mobj->movedir == DMG_DROWNED)
|
||||
P_SetObjectMomZ(mobj, -FRACUNIT/2, true); // slower fall from drowning
|
||||
else
|
||||
P_SetObjectMomZ(mobj, -2*FRACUNIT/3, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -2157,9 +2157,9 @@ static void P_DoBubbleBreath(player_t *player)
|
|||
{
|
||||
if (P_RandomChance((128-(player->powers[pw_underwater]/4))*FRACUNIT/256))
|
||||
{
|
||||
fixed_t rad = player->mo->radius>>FRACBITS;
|
||||
x += (P_RandomRange(rad, -rad)<<FRACBITS);
|
||||
y += (P_RandomRange(rad, -rad)<<FRACBITS);
|
||||
fixed_t r = player->mo->radius>>FRACBITS;
|
||||
x += (P_RandomRange(r, -r)<<FRACBITS);
|
||||
y += (P_RandomRange(r, -r)<<FRACBITS);
|
||||
z += (P_RandomKey(player->mo->height>>FRACBITS)<<FRACBITS);
|
||||
bubble = P_SpawnMobj(x, y, z, MT_WATERZAP);
|
||||
S_StartSound(bubble, sfx_beelec);
|
||||
|
|
Loading…
Reference in a new issue