mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Guard: reflect items like Bubble
- Clash + player knockback
This commit is contained in:
parent
92f6e61243
commit
9e650fa6c0
2 changed files with 26 additions and 0 deletions
|
|
@ -771,6 +771,11 @@ boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2)
|
||||||
{
|
{
|
||||||
if (!t2->threshold || t2->type == MT_DROPTARGET)
|
if (!t2->threshold || t2->type == MT_DROPTARGET)
|
||||||
{
|
{
|
||||||
|
if (t1->player && K_PlayerGuard(t1->player))
|
||||||
|
{
|
||||||
|
K_KartSolidBounce(t1, t2);
|
||||||
|
K_DoPowerClash(t1, t2);
|
||||||
|
}
|
||||||
if (!t2->momx && !t2->momy)
|
if (!t2->momx && !t2->momy)
|
||||||
{
|
{
|
||||||
t2->momz += (24*t2->scale) * P_MobjFlip(t2);
|
t2->momz += (24*t2->scale) * P_MobjFlip(t2);
|
||||||
|
|
|
||||||
21
src/p_map.c
21
src/p_map.c
|
|
@ -1004,6 +1004,27 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
||||||
if (tm.thing->type == MT_RANDOMITEM)
|
if (tm.thing->type == MT_RANDOMITEM)
|
||||||
return BMIT_CONTINUE;
|
return BMIT_CONTINUE;
|
||||||
|
|
||||||
|
if (tm.thing->type != MT_PLAYER && thing->player && K_PlayerGuard(thing->player) && P_BubbleCanReflect(thing, tm.thing))
|
||||||
|
{
|
||||||
|
// 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
|
||||||
|
|
||||||
|
return K_BubbleShieldCollide(thing, tm.thing) ? BMIT_CONTINUE : BMIT_ABORT;
|
||||||
|
}
|
||||||
|
else if (thing->type != MT_PLAYER && tm.thing->player && K_PlayerGuard(tm.thing->player) && P_BubbleCanReflect(tm.thing, thing))
|
||||||
|
{
|
||||||
|
// 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
|
||||||
|
|
||||||
|
return K_BubbleShieldCollide(tm.thing, thing) ? BMIT_CONTINUE : BMIT_ABORT;
|
||||||
|
}
|
||||||
|
|
||||||
// Bubble Shield reflect
|
// Bubble Shield reflect
|
||||||
if ((thing->type == MT_BUBBLESHIELD && thing->target->player && thing->target->player->bubbleblowup)
|
if ((thing->type == MT_BUBBLESHIELD && thing->target->player && thing->target->player->bubbleblowup)
|
||||||
|| (thing->player && thing->player->bubbleblowup))
|
|| (thing->player && thing->player->bubbleblowup))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue