Hardcoded the boss's TouchSpecial hook.

Also cleaned up this part of P_TouchSpecialThing a bit while I'm here
This commit is contained in:
Monster Iestyn 2019-05-05 18:22:19 +01:00
parent 0ae86e4401
commit f9c113a19a

View file

@ -375,13 +375,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
/////ENEMIES & BOSSES!!///////////////////////////////// /////ENEMIES & BOSSES!!/////////////////////////////////
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
if (special->type == MT_BLACKEGGMAN) switch (special->type)
{
case MT_BLACKEGGMAN:
{ {
P_DamageMobj(toucher, special, special, 1, 0); // ouch P_DamageMobj(toucher, special, special, 1, 0); // ouch
return; return;
} }
case MT_BIGMINE:
if (special->type == MT_BIGMINE)
{ {
special->momx = toucher->momx/3; special->momx = toucher->momx/3;
special->momy = toucher->momy/3; special->momy = toucher->momy/3;
@ -396,14 +397,16 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
player->homing = 0; player->homing = 0;
return; return;
} }
case MT_GSNAPPER:
if (special->type == MT_GSNAPPER && !elementalpierce if (!elementalpierce
&& toucher->z < special->z + special->height && toucher->z + toucher->height > special->z && toucher->z < special->z + special->height
&& toucher->z + toucher->height > special->z
&& P_DamageMobj(toucher, special, special, 1, DMG_SPIKE)) && P_DamageMobj(toucher, special, special, 1, DMG_SPIKE))
return; // Can only hit snapper from above return; // Can only hit snapper from above
break;
if (special->type == MT_SPINCUSHION case MT_SPINCUSHION:
&& (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0)) if (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0)
{ {
if (player->pflags & PF_BOUNCING) if (player->pflags & PF_BOUNCING)
{ {
@ -414,6 +417,41 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
else if (P_DamageMobj(toucher, special, special, 1, DMG_SPIKE)) else if (P_DamageMobj(toucher, special, special, 1, DMG_SPIKE))
return; // Cannot hit sharp from above return; // Cannot hit sharp from above
} }
break;
case MT_FANG:
if (!player->powers[pw_flashing]
&& !(player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)
&& !(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2))
{
if ((special->state == &states[S_FANG_BOUNCE3]
|| special->state == &states[S_FANG_BOUNCE4]
|| special->state == &states[S_FANG_PINCHBOUNCE3]
|| special->state == &states[S_FANG_PINCHBOUNCE4])
&& P_MobjFlip(special)*((special->z + special->height/2) - (toucher->z - toucher->height/2)) > 0)
{
P_DamageMobj(toucher, special, special, 1, 0);
P_SetTarget(&special->tracer, toucher);
if (special->state == &states[S_FANG_PINCHBOUNCE3]
|| special->state == &states[S_FANG_PINCHBOUNCE4])
P_SetMobjState(special, S_FANG_PINCHPATHINGSTART2);
else
{
var1 = var2 = 4;
A_Boss5ExtraRepeat(special);
P_SetMobjState(special, S_FANG_PATHINGCONT2); //S_FANG_PATHINGCONT1 if you want him to drop a bomb on the player
}
if (special->eflags & MFE_VERTICALFLIP)
special->z = toucher->z - special->height;
else
special->z = toucher->z + toucher->height;
return;
}
}
break;
default:
break;
}
if (((player->powers[pw_carry] == CR_NIGHTSMODE) && (player->pflags & PF_DRILLING)) if (((player->powers[pw_carry] == CR_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|| ((player->pflags & PF_JUMPED) && (!(player->pflags & PF_NOJUMPDAMAGE) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) || ((player->pflags & PF_JUMPED) && (!(player->pflags & PF_NOJUMPDAMAGE) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))