Merge branch 'droptarget-collide-plus' into 'master'

More fun with Drop Target punting

See merge request KartKrew/Kart!995
This commit is contained in:
toaster 2023-03-02 13:34:02 +00:00
commit e11738b481
3 changed files with 15 additions and 5 deletions

View file

@ -474,10 +474,10 @@ boolean K_DropTargetCollide(mobj_t *t1, mobj_t *t2)
{
mobj_t *draggeddroptarget = (t1->type == MT_DROPTARGET_SHIELD) ? t1->target : NULL;
if ((t1->threshold > 0 && (t2->hitlag > 0 || !draggeddroptarget)) || (t2->threshold > 0 && t1->hitlag > 0))
if ((t1->threshold > 0 && t2->hitlag > 0) || (t2->threshold > 0 && t1->hitlag > 0))
return true;
if (((t1->target == t2) || (t1->target == t2->target)) && (t1->threshold > 0 || (t2->type != MT_PLAYER && t2->threshold > 0)))
if (((t1->target == t2) || (t1->target == t2->target)) && ((t1->threshold > 0 && t2->type == MT_PLAYER) || (t2->type != MT_PLAYER && t2->threshold > 0)))
return true;
if (t1->health <= 0 || t2->health <= 0)
@ -711,7 +711,7 @@ boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2)
}
else
{
if (!t2->threshold)
if (!t2->threshold || t2->type == MT_DROPTARGET)
{
if (!t2->momx && !t2->momy)
{

View file

@ -917,6 +917,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|| tm.thing->type == MT_BANANA || tm.thing->type == MT_EGGMANITEM || tm.thing->type == MT_BALLHOG
|| tm.thing->type == MT_SSMINE || tm.thing->type == MT_LANDMINE || tm.thing->type == MT_SINK
|| tm.thing->type == MT_GARDENTOP
|| tm.thing->type == MT_DROPTARGET
|| (tm.thing->type == MT_PLAYER && thing->target != tm.thing)))
{
// see if it went over / under
@ -931,8 +932,9 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|| (tm.thing->player && tm.thing->player->bubbleblowup))
&& (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_GACHABOM
|| thing->type == MT_BANANA || thing->type == MT_EGGMANITEM || thing->type == MT_BALLHOG
|| thing->type == MT_SSMINE || tm.thing->type == MT_LANDMINE || thing->type == MT_SINK
|| thing->type == MT_SSMINE || thing->type == MT_LANDMINE || thing->type == MT_SINK
|| thing->type == MT_GARDENTOP
|| thing->type == MT_DROPTARGET
|| (thing->type == MT_PLAYER && tm.thing->target != thing)))
{
// see if it went over / under
@ -967,7 +969,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
else if ((tm.thing->type == MT_DROPTARGET || tm.thing->type == MT_DROPTARGET_SHIELD)
&& (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_GACHABOM
|| thing->type == MT_BANANA || thing->type == MT_EGGMANITEM || thing->type == MT_BALLHOG
|| thing->type == MT_SSMINE || tm.thing->type == MT_LANDMINE || thing->type == MT_SINK
|| thing->type == MT_SSMINE || thing->type == MT_LANDMINE || thing->type == MT_SINK
|| thing->type == MT_GARDENTOP
|| (thing->type == MT_PLAYER)))
{

View file

@ -1791,6 +1791,8 @@ void P_XYMovement(mobj_t *mo)
{
S_StartSound(mo, mo->info->attacksound);
mo->health--;
// This prevents an item thrown at a wall from
// phasing through you on its return.
mo->threshold = 0;
}
/*FALLTHRU*/
@ -1811,6 +1813,12 @@ void P_XYMovement(mobj_t *mo)
S_StartSound(mo, sfx_s3k44); // Bubble bounce
break;
case MT_DROPTARGET:
// This prevents an item thrown at a wall from
// phasing through you on its return.
mo->threshold = 0;
break;
default:
break;
}