Merge branch 'trick-prisons' into 'master'

Trick prisons

Closes #784

See merge request KartKrew/Kart!1673
This commit is contained in:
Oni 2023-12-07 05:21:57 +00:00
commit 6639db90f3
4 changed files with 21 additions and 4 deletions

View file

@ -30299,7 +30299,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
0, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SOLID|MF_SHOOTABLE|MF_DONTENCOREMAP|MF_DONTPUNT, // flags
S_NULL // raisestate
},

View file

@ -1233,7 +1233,8 @@ void K_PuntHazard(mobj_t *t1, mobj_t *t2)
boolean K_PuntCollide(mobj_t *t1, mobj_t *t2)
{
if (t1->flags & MF_DONTPUNT)
// MF_SHOOTABLE will get damaged directly, instead
if (t1->flags & (MF_DONTPUNT | MF_SHOOTABLE))
{
return false;
}

View file

@ -13160,6 +13160,11 @@ boolean K_IsPlayingDisplayPlayer(player_t *player)
boolean K_PlayerCanPunt(player_t *player)
{
if (player->trickpanel > TRICKSTATE_READY)
{
return true;
}
if (player->invincibilitytimer > 0)
{
return true;

View file

@ -1472,11 +1472,11 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
// The bump has to happen last
if (P_IsObjectOnGround(thing) && tm.thing->momz < 0 && tm.thing->player->trickpanel)
{
P_DamageMobj(thing, tm.thing, tm.thing, 1, DMG_WIPEOUT|DMG_STEAL);
P_DamageMobj(thing, tm.thing, tm.thing, 1, DMG_TUMBLE);
}
else if (P_IsObjectOnGround(tm.thing) && thing->momz < 0 && thing->player->trickpanel)
{
P_DamageMobj(tm.thing, thing, thing, 1, DMG_WIPEOUT|DMG_STEAL);
P_DamageMobj(tm.thing, thing, thing, 1, DMG_TUMBLE);
}
if (K_KartBouncing(tm.thing, thing) == true)
@ -1616,6 +1616,17 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
K_KartBouncing(tm.thing, thing);
return BMIT_CONTINUE;
}
else if ((thing->flags & MF_SHOOTABLE) && K_PlayerCanPunt(tm.thing->player))
{
// see if it went over / under
if (tm.thing->z > thing->z + thing->height)
return BMIT_CONTINUE; // overhead
if (tm.thing->z + tm.thing->height < thing->z)
return BMIT_CONTINUE; // underneath
P_DamageMobj(thing, tm.thing, tm.thing, 1, DMG_NORMAL);
return BMIT_CONTINUE;
}
else if (thing->flags & MF_SOLID)
{
// see if it went over / under