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:
toasterbabe 2016-07-16 23:26:52 +01:00
parent 8cb8990863
commit 898e17a441
3 changed files with 20 additions and 4 deletions

View file

@ -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

View file

@ -6908,8 +6908,23 @@ void P_MobjThinker(mobj_t *mobj)
}
}
else // Apply gravity to fall downwards.
{
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:
break;

View file

@ -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);