eggmine shield
This commit is contained in:
parent
f3e64e3c8a
commit
1de19b6ceb
2 changed files with 58 additions and 0 deletions
|
|
@ -339,6 +339,13 @@ boolean K_EggMineCollide(mobj_t *t1, mobj_t *t2)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (t2->player && t2->player->flamestore && (K_GetShieldFromPlayer(t2->player) == KSHIELD_FLAME))
|
||||
{
|
||||
// Melt item
|
||||
S_StartSound(t2, sfx_s3k43);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (t2->type == MT_PLAYER && t1->health > 1)
|
||||
{
|
||||
if (t1->health > 2)
|
||||
|
|
@ -359,9 +366,39 @@ boolean K_EggMineCollide(mobj_t *t1, mobj_t *t2)
|
|||
}
|
||||
K_EggMineBounce(t1, t2);
|
||||
}
|
||||
else if (K_IsMissileOrKartItem(t2))
|
||||
{
|
||||
if (t2->type == MT_SPB)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
P_KillMobj(t2, t1, t1->target, DMG_INSTAKILL);
|
||||
}
|
||||
P_KillMobj(t1, t2, t2->target, DMG_INSTAKILL);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean K_EggMineShieldCollide(mobj_t *t1, mobj_t *t2)
|
||||
{
|
||||
if (t1->health <= 0 || t2->health <= 0)
|
||||
return true;
|
||||
|
||||
if (K_IsMissileOrKartItem(t2))
|
||||
{
|
||||
if (!(t2->type == MT_SPB || t2->type == MT_EGGMINE || t2->type == MT_EGGMINE_SHIELD))
|
||||
{
|
||||
P_KillMobj(t2, t1, t1->target, DMG_INSTAKILL);
|
||||
}
|
||||
P_KillMobj(t1, t2, t2->target, DMG_INSTAKILL);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean K_MineCollide(mobj_t *t1, mobj_t *t2)
|
||||
{
|
||||
if (((t1->target == t2) || (!(t2->flags & (MF_ENEMY|MF_BOSS)) && (t1->target == t2->target))) && (t1->threshold > 0 || (t2->type != MT_PLAYER && t2->threshold > 0)))
|
||||
|
|
|
|||
21
src/p_map.c
21
src/p_map.c
|
|
@ -793,6 +793,27 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
|||
return K_EggMineCollide(thing, g_tm.thing) ? BMIT_CONTINUE : BMIT_ABORT;
|
||||
}
|
||||
|
||||
if (g_tm.thing->type == MT_EGGMINE_SHIELD)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (g_tm.thing->z > thing->z + thing->height)
|
||||
return BMIT_CONTINUE; // overhead
|
||||
if (g_tm.thing->z + g_tm.thing->height < thing->z)
|
||||
return BMIT_CONTINUE; // underneath
|
||||
|
||||
return K_EggMineShieldCollide(g_tm.thing, thing) ? BMIT_CONTINUE : BMIT_ABORT;
|
||||
}
|
||||
else if (thing->type == MT_EGGMINE_SHIELD)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (g_tm.thing->z > thing->z + thing->height)
|
||||
return BMIT_CONTINUE; // overhead
|
||||
if (g_tm.thing->z + g_tm.thing->height < thing->z)
|
||||
return BMIT_CONTINUE; // underneath
|
||||
|
||||
return K_EggMineShieldCollide(thing, g_tm.thing) ? BMIT_CONTINUE : BMIT_ABORT;
|
||||
}
|
||||
|
||||
if (g_tm.thing->type == MT_RANDOMITEM)
|
||||
return BMIT_CONTINUE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue