Added modified Mario shells. They now hurt everyone if you touch them from the side, and can be stopped by anyone if they stomp on their tops.

This commit is contained in:
toasterbabe 2017-01-25 14:52:36 +00:00
parent 91cbeb5e1a
commit cdf388810b
6 changed files with 35 additions and 31 deletions

View file

@ -6102,10 +6102,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_FIREBALLEXP2", "S_FIREBALLEXP2",
"S_FIREBALLEXP3", "S_FIREBALLEXP3",
"S_SHELL", "S_SHELL",
"S_SHELL1",
"S_SHELL2",
"S_SHELL3",
"S_SHELL4",
"S_PUMA_UP1", "S_PUMA_UP1",
"S_PUMA_UP2", "S_PUMA_UP2",
"S_PUMA_UP3", "S_PUMA_UP3",

View file

@ -2742,11 +2742,7 @@ state_t states[NUMSTATES] =
{SPR_FBLL, FF_FULLBRIGHT|6, 3, {NULL}, 0, 0, S_NULL}, // S_FIREBALLEXP3 {SPR_FBLL, FF_FULLBRIGHT|6, 3, {NULL}, 0, 0, S_NULL}, // S_FIREBALLEXP3
// Turtle Shell // Turtle Shell
{SPR_SHLL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SHELL {SPR_SHLL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SHELL
{SPR_SHLL, 0, 2, {NULL}, 0, 0, S_SHELL2}, // S_SHELL1
{SPR_SHLL, 1, 2, {NULL}, 0, 0, S_SHELL3}, // S_SHELL2
{SPR_SHLL, 2, 2, {NULL}, 0, 0, S_SHELL4}, // S_SHELL3
{SPR_SHLL, 3, 2, {NULL}, 0, 0, S_SHELL1}, // S_SHELL4
// Puma (Mario fireball) // Puma (Mario fireball)
{SPR_PUMA, FF_FULLBRIGHT , 2, {A_FishJump}, 0, MT_PUMATRAIL, S_PUMA_UP2}, // S_PUMA_UP1 {SPR_PUMA, FF_FULLBRIGHT , 2, {A_FishJump}, 0, MT_PUMATRAIL, S_PUMA_UP2}, // S_PUMA_UP1
@ -13148,9 +13144,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate S_NULL, // deathstate
S_NULL, // xdeathstate S_NULL, // xdeathstate
sfx_None, // deathsound sfx_None, // deathsound
20*FRACUNIT, // speed 16, // speed
8*FRACUNIT, // radius 16*FRACUNIT, // radius
16*FRACUNIT, // height 20*FRACUNIT, // height
0, // display offset 0, // display offset
100, // mass 100, // mass
1, // damage 1, // damage

View file

@ -2907,10 +2907,6 @@ typedef enum state
S_FIREBALLEXP2, S_FIREBALLEXP2,
S_FIREBALLEXP3, S_FIREBALLEXP3,
S_SHELL, S_SHELL,
S_SHELL1,
S_SHELL2,
S_SHELL3,
S_SHELL4,
S_PUMA_UP1, S_PUMA_UP1,
S_PUMA_UP2, S_PUMA_UP2,
S_PUMA_UP3, S_PUMA_UP3,

View file

@ -1174,15 +1174,33 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// Mario // // Mario //
// ***** // // ***** //
case MT_SHELL: case MT_SHELL:
if (special->state == &states[S_SHELL]) // Resting anim
{ {
// Kick that sucker around! boolean bounceon = ((P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0));
special->angle = toucher->angle; if (special->threshold == TICRATE) // it's moving
P_InstaThrust(special, special->angle, FixedMul(special->info->speed, special->scale)); {
S_StartSound(toucher, sfx_mario2); if (bounceon)
P_SetMobjState(special, S_SHELL1); {
P_SetTarget(&special->target, toucher); // Stop it!
special->threshold = (3*TICRATE)/2; special->momx = special->momy = 0;
S_StartSound(toucher, sfx_mario2);
P_SetTarget(&special->target, NULL);
special->threshold = TICRATE - 1;
toucher->momz = -toucher->momz;
}
else // source can't be given as otherwise P_PlayerHitsPlayer will fail
P_DamageMobj(toucher, special, NULL/*special->target*/, 1, 0);
}
else if (special->threshold == 0)
{
// Kick that sucker around!
special->movedir = ((special->movedir == 1) ? -1 : 1);
P_InstaThrust(special, toucher->angle, (special->info->speed*special->scale));
S_StartSound(toucher, sfx_mario2);
P_SetTarget(&special->target, toucher);
special->threshold = (3*TICRATE)/2;
if (bounceon)
toucher->momz = -toucher->momz;
}
} }
return; return;
case MT_AXE: case MT_AXE:

View file

@ -768,8 +768,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
} }
} }
if (tmthing->type == MT_SHELL && tmthing->threshold > TICRATE)
return true;
// damage / explode // damage / explode
if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example) if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example)
P_DamageMobj(thing, tmthing, tmthing, 1, 0); P_DamageMobj(thing, tmthing, tmthing, 1, 0);
@ -810,7 +808,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
tmthing->y = thing->y; tmthing->y = thing->y;
P_SetThingPosition(tmthing); P_SetThingPosition(tmthing);
} }
else else if (!(tmthing->type == MT_SHELL && thing->player)) // player collision handled in touchspecial
P_DamageMobj(thing, tmthing, tmthing->target, 1, 0); P_DamageMobj(thing, tmthing, tmthing->target, 1, 0);
// don't traverse any more // don't traverse any more

View file

@ -7691,13 +7691,13 @@ void P_MobjThinker(mobj_t *mobj)
P_NightsItemChase(mobj); P_NightsItemChase(mobj);
break; break;
case MT_SHELL: case MT_SHELL:
if (mobj->threshold > TICRATE) if (mobj->threshold && mobj->threshold != TICRATE)
mobj->threshold--; mobj->threshold--;
if (mobj->state != &states[S_SHELL]) if (mobj->threshold >= TICRATE)
{ {
mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); mobj->angle += ((mobj->movedir == 1) ? ANGLE_22h : ANGLE_337h);
P_InstaThrust(mobj, mobj->angle, FixedMul(mobj->info->speed, mobj->scale)); P_InstaThrust(mobj, R_PointToAngle2(0, 0, mobj->momx, mobj->momy), (mobj->info->speed*mobj->scale));
} }
break; break;
case MT_TURRET: case MT_TURRET: