mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
A Heckloada Mario Stuff
https://gfycat.com/MasculineSatisfiedAfricanwilddog and https://gfycat.com/PastCompetentGypsymoth describe this all in varying states of completion
This commit is contained in:
parent
a842d96a48
commit
d4f0afa0d1
7 changed files with 154 additions and 69 deletions
|
@ -227,6 +227,7 @@ typedef enum
|
|||
pw_underwater, // underwater timer
|
||||
pw_spacetime, // In space, no one can hear you spin!
|
||||
pw_extralife, // Extra Life timer
|
||||
pw_marioflashing, // Getting/losing powerup
|
||||
|
||||
pw_super, // Are you super?
|
||||
pw_gravityboots, // gravity boots
|
||||
|
|
|
@ -3359,6 +3359,12 @@ void A_ForceShield(mobj_t *actor)
|
|||
|
||||
//can't use P_SwitchShield(player, SH_FORCE) - special case
|
||||
|
||||
if (mariomode && player->mo)
|
||||
{
|
||||
player->mo->movecount = player->powers[pw_shield];
|
||||
player->powers[pw_marioflashing] = MARIOFLASHINGTICS;
|
||||
}
|
||||
|
||||
if (!(player->powers[pw_shield] & SH_FORCE))
|
||||
{
|
||||
// Just in case.
|
||||
|
|
|
@ -142,7 +142,7 @@ boolean P_CanPickupItem(player_t *player, boolean weapon)
|
|||
if (player->bot && weapon)
|
||||
return false;
|
||||
|
||||
if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] <= flashingtics)
|
||||
if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] < UINT16_MAX)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -1138,6 +1138,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
case MT_FIREFLOWER:
|
||||
if (player->bot)
|
||||
return;
|
||||
if (mariomode)
|
||||
{
|
||||
toucher->movecount = player->powers[pw_shield];
|
||||
player->powers[pw_marioflashing] = MARIOFLASHINGTICS;
|
||||
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_PITY)
|
||||
player->powers[pw_shield] &= SH_NOSTACK;
|
||||
}
|
||||
player->powers[pw_shield] |= SH_FIREFLOWER;
|
||||
toucher->color = SKINCOLOR_WHITE;
|
||||
G_GhostAddColor(GHC_FIREFLOWER);
|
||||
|
@ -1204,6 +1211,15 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
|
||||
S_StartSound(toucher, special->info->painsound);
|
||||
|
||||
if (mariomode && !player->powers[pw_shield])
|
||||
{
|
||||
S_StartSound(toucher, sfx_mario3);
|
||||
player->mo->movecount = player->powers[pw_shield];
|
||||
player->powers[pw_marioflashing] = MARIOFLASHINGTICS;
|
||||
player->powers[pw_shield] = SH_PITY;
|
||||
P_SpawnShieldOrb(player);
|
||||
}
|
||||
|
||||
if (!(netgame && circuitmap && player != &players[consoleplayer]))
|
||||
P_SetMobjState(special, special->info->painstate);
|
||||
return;
|
||||
|
@ -1997,6 +2013,9 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
}
|
||||
|
||||
target->flags2 &= ~MF2_DONTDRAW;
|
||||
|
||||
if (mariomode)
|
||||
target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS;
|
||||
}
|
||||
|
||||
// if killed by a player
|
||||
|
@ -2773,7 +2792,9 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source,
|
|||
|
||||
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
|
||||
|
||||
if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes
|
||||
if (mariomode)
|
||||
S_StartSound(player->mo, sfx_mario8);
|
||||
else if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes
|
||||
S_StartSound(player->mo, sfx_spkdth);
|
||||
else
|
||||
S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss.
|
||||
|
@ -3134,7 +3155,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
else
|
||||
{
|
||||
player->health -= damage; // mirror mobj health here
|
||||
target->player->powers[pw_flashing] = flashingtics;
|
||||
//target->player->powers[pw_flashing] = flashingtics;
|
||||
if (damage > 0) // don't spill emeralds/ammo/panels for shield damage
|
||||
P_PlayerRingBurst(player, damage);
|
||||
}
|
||||
|
|
|
@ -64,6 +64,8 @@
|
|||
#define mariomode (maptol & TOL_MARIO)
|
||||
#define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0)
|
||||
|
||||
#define MARIOFLASHINGTICS 19
|
||||
|
||||
#define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player))
|
||||
#define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player))
|
||||
|
||||
|
|
43
src/p_mobj.c
43
src/p_mobj.c
|
@ -4061,6 +4061,40 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
|
|||
I_Assert(mobj->player != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mobj));
|
||||
|
||||
if (mobj->player->powers[pw_marioflashing])
|
||||
{
|
||||
if (!mobj->player->powers[pw_nocontrol]++)
|
||||
mobj->player->powers[pw_nocontrol]++;
|
||||
|
||||
if (!(mobj->player->powers[pw_marioflashing] % 4))
|
||||
{
|
||||
UINT16 shieldswitch = mobj->player->powers[pw_shield];
|
||||
mobj->player->powers[pw_shield] = mobj->movecount;
|
||||
mobj->movecount = shieldswitch;
|
||||
if ((mobj->player->powers[pw_shield] & SH_FIREFLOWER) != (mobj->movecount & SH_FIREFLOWER))
|
||||
{
|
||||
if (mobj->player->powers[pw_shield] & SH_FIREFLOWER)
|
||||
{
|
||||
mobj->color = SKINCOLOR_WHITE;
|
||||
G_GhostAddColor(GHC_FIREFLOWER);
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj->color = mobj->player->skincolor;
|
||||
G_GhostAddColor(GHC_NORMAL);
|
||||
}
|
||||
}
|
||||
if (mobj->player->powers[pw_shield] & SH_NOSTACK && (mobj->player->powers[pw_shield] & SH_NOSTACK) != (mobj->movecount & SH_NOSTACK))
|
||||
P_SpawnShieldOrb(mobj->player);
|
||||
}
|
||||
|
||||
mobj->player->powers[pw_marioflashing]--;
|
||||
if (mobj->player->powers[pw_flashing] && mobj->player->powers[pw_flashing] < UINT16_MAX && mobj->player->powers[pw_flashing] > flashingtics)
|
||||
if (--(mobj->player->powers[pw_flashing]) == flashingtics)
|
||||
mobj->player->powers[pw_flashing]--;
|
||||
return;
|
||||
}
|
||||
|
||||
P_MobjCheckWater(mobj);
|
||||
|
||||
#ifdef ESLOPE
|
||||
|
@ -6380,9 +6414,9 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield)
|
|||
thing->x = thing->target->x;
|
||||
thing->y = thing->target->y;
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z = thing->target->z + thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT) - FixedMul(2*FRACUNIT, thing->target->scale);
|
||||
thing->z = thing->target->z + ((thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) << shortmario(thing->target->player)) - FixedMul(2*FRACUNIT, thing->target->scale);
|
||||
else
|
||||
thing->z = thing->target->z - FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT) + FixedMul(2*FRACUNIT, thing->target->scale);
|
||||
thing->z = thing->target->z - ((FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) << shortmario(thing->target->player)) + FixedMul(2*FRACUNIT, thing->target->scale);
|
||||
P_SetThingPosition(thing);
|
||||
P_CheckPosition(thing, thing->x, thing->y);
|
||||
|
||||
|
@ -7091,6 +7125,11 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
break;
|
||||
case MT_PLAYER:
|
||||
/// \todo Have the player's dead body completely finish its animation even if they've already respawned.
|
||||
if (mobj->player && mobj->player->powers[pw_marioflashing])
|
||||
{
|
||||
mobj->player->powers[pw_marioflashing]--;
|
||||
return; // don't do any momz
|
||||
}
|
||||
if (!(mobj->flags2 & MF2_DONTDRAW))
|
||||
{
|
||||
if (!mobj->fuse)
|
||||
|
|
36
src/p_user.c
36
src/p_user.c
|
@ -789,10 +789,18 @@ boolean P_PlayerInPain(player_t *player)
|
|||
// put them in pain.
|
||||
//
|
||||
void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor)
|
||||
{
|
||||
if (player->powers[pw_carry] == CR_ROPEHANG)
|
||||
P_SetTarget(&player->mo->tracer, NULL);
|
||||
|
||||
if (!mariomode)
|
||||
{
|
||||
angle_t ang;
|
||||
fixed_t fallbackspeed;
|
||||
|
||||
P_ResetPlayer(player);
|
||||
P_SetPlayerMobjState(player->mo, player->mo->info->painstate);
|
||||
|
||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||
player->mo->z--;
|
||||
else
|
||||
|
@ -839,9 +847,7 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor)
|
|||
}
|
||||
|
||||
P_InstaThrust(player->mo, ang, fallbackspeed);
|
||||
|
||||
if (player->powers[pw_carry] == CR_ROPEHANG)
|
||||
P_SetTarget(&player->mo->tracer, NULL);
|
||||
}
|
||||
|
||||
// Point penalty for hitting a hazard during tag.
|
||||
// Discourages players from intentionally hurting themselves to avoid being tagged.
|
||||
|
@ -853,9 +859,13 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor)
|
|||
player->score = 0;
|
||||
}
|
||||
|
||||
P_ResetPlayer(player);
|
||||
P_SetPlayerMobjState(player->mo, player->mo->info->painstate);
|
||||
player->powers[pw_flashing] = flashingtics;
|
||||
if (mariomode)
|
||||
{
|
||||
player->powers[pw_marioflashing] = MARIOFLASHINGTICS;
|
||||
player->powers[pw_flashing] += MARIOFLASHINGTICS;
|
||||
player->mo->movecount = player->powers[pw_shield];
|
||||
}
|
||||
|
||||
if (player->timeshit != UINT8_MAX)
|
||||
++player->timeshit;
|
||||
|
@ -1416,6 +1426,12 @@ void P_SpawnShieldOrb(player_t *player)
|
|||
//
|
||||
void P_SwitchShield(player_t *player, UINT16 shieldtype)
|
||||
{
|
||||
if (mariomode && player->mo)
|
||||
{
|
||||
player->mo->movecount = player->powers[pw_shield];
|
||||
player->powers[pw_marioflashing] = MARIOFLASHINGTICS;
|
||||
player->powers[pw_nocontrol] += MARIOFLASHINGTICS;
|
||||
}
|
||||
if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype)
|
||||
{
|
||||
// Just in case.
|
||||
|
@ -8104,7 +8120,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
camstill = cv_cam_still.value;
|
||||
camrotate = cv_cam_rotate.value;
|
||||
camdist = FixedMul(cv_cam_dist.value, FixedMul(player->camerascale, mo->scale));
|
||||
camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale >> shortmario(player), mo->scale));
|
||||
camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale, mo->scale));
|
||||
}
|
||||
else // Camera 2
|
||||
{
|
||||
|
@ -8112,7 +8128,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
camstill = cv_cam2_still.value;
|
||||
camrotate = cv_cam2_rotate.value;
|
||||
camdist = FixedMul(cv_cam2_dist.value, FixedMul(player->camerascale, mo->scale));
|
||||
camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale >> shortmario(player), mo->scale));
|
||||
camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale, mo->scale));
|
||||
}
|
||||
|
||||
if (player->powers[pw_shield] & SH_FORCE && player->pflags & PF_SHIELDABILITY)
|
||||
|
@ -8532,9 +8548,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
dist = FixedHypot(f1, f2);
|
||||
|
||||
if (mo->eflags & MFE_VERTICALFLIP)
|
||||
angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - P_GetPlayerHeight(player));
|
||||
angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - (P_GetPlayerHeight(player) << shortmario(player)));
|
||||
else
|
||||
angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + P_GetPlayerHeight(player));
|
||||
angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + (P_GetPlayerHeight(player) << shortmario(player)));
|
||||
if (player->playerstate != PST_DEAD)
|
||||
angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;'
|
||||
|
||||
|
@ -9268,7 +9284,7 @@ void P_PlayerThink(player_t *player)
|
|||
player->losstime--;
|
||||
|
||||
// Flash player after being hit.
|
||||
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1))
|
||||
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1) && !player->powers[pw_marioflashing])
|
||||
player->mo->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
player->mo->flags2 &= ~MF2_DONTDRAW;
|
||||
|
|
|
@ -1319,12 +1319,6 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
|
||||
xscale = FixedMul(xscale, ang_scale);
|
||||
|
||||
if (shortmarioshift)
|
||||
{
|
||||
yscale >>= shortmarioshift;
|
||||
this_scale >>= shortmarioshift;
|
||||
}
|
||||
|
||||
if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY)
|
||||
{
|
||||
fixed_t linkscale;
|
||||
|
@ -1370,6 +1364,12 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
return;
|
||||
}
|
||||
|
||||
if (shortmarioshift) // squish mario
|
||||
{
|
||||
yscale >>= shortmarioshift;
|
||||
this_scale >>= shortmarioshift;
|
||||
}
|
||||
|
||||
//SoM: 3/17/2000: Disregard sprites that are out of view..
|
||||
if (vflip)
|
||||
{
|
||||
|
@ -1385,7 +1385,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
gz = gzt - FixedMul(spritecachedinfo[lump].height, this_scale);
|
||||
}
|
||||
|
||||
if (shortmarioshift)
|
||||
if (shortmarioshift) // unsquish the x component
|
||||
this_scale <<= shortmarioshift;
|
||||
|
||||
if (thing->subsector->sector->cullheight)
|
||||
|
|
Loading…
Reference in a new issue