diff --git a/src/d_player.h b/src/d_player.h index 4bdfb9581..8e3f4c904 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -197,7 +197,9 @@ typedef enum // The force shield uses the lower 8 bits to count how many extra hits are left. SH_FORCE = 0x100, SH_FORCEHP = 0xFF, // to be used as a bitmask only - SH_STACK = 0, //SH_FIREFLOWER, + // The mushroom CAN stack with other shields. + SH_MUSHROOM = 0x200, + SH_STACK = SH_MUSHROOM, //|SH_FIREFLOWER, SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield diff --git a/src/dehacked.c b/src/dehacked.c index 7e50f1d8d..3d3a887a7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7095,6 +7095,7 @@ struct { {"SH_FIREFLOWER",SH_FIREFLOWER}, // These ones are special and use the upper bits {"SH_FORCE",SH_FORCE}, // Lower bits are how many hits left, 0 is the last hit + {"SH_MUSHROOM", SH_MUSHROOM}, // Can stack with other shields // Stack masks {"SH_STACK",SH_STACK}, {"SH_NOSTACK",SH_NOSTACK}, diff --git a/src/g_game.c b/src/g_game.c index d90439152..200a0f45b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2197,7 +2197,7 @@ void G_PlayerReborn(INT32 player) p->panim = PA_IDLE; // standing animation if (mariomode) - p->powers[pw_shield] = SH_PITY; // start big + p->powers[pw_shield] = SH_MUSHROOM; // start big if ((netgame || multiplayer) && !p->spectator) p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent diff --git a/src/p_enemy.c b/src/p_enemy.c index a519563de..a2fcd314b 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3427,14 +3427,10 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - if (player->powers[pw_shield] && mariomode) - { + if (P_SwitchShield(player, SH_PITY)) + S_StartSound(player->mo, actor->info->seesound); + else if (mariomode) S_StartSound(player->mo, sfx_itemup); - return; - } - - P_SwitchShield(player, SH_PITY); - S_StartSound(player->mo, actor->info->seesound); } diff --git a/src/p_inter.c b/src/p_inter.c index a8a826fdf..1baeb6baf 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1160,7 +1160,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) toucher->movecount = player->powers[pw_shield]; player->powers[pw_marioflashing] = MARIOFLASHINGTICS; } - player->powers[pw_shield] = (player->powers[pw_shield] & SH_STACK)|SH_FIREFLOWER; + player->powers[pw_shield] = (mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK)|SH_FIREFLOWER; P_SpawnShieldOrb(player); break; @@ -1236,7 +1236,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) S_StartSound(toucher, sfx_mario3); player->mo->movecount = player->powers[pw_shield]; player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_shield] = SH_PITY; + player->powers[pw_shield] = SH_MUSHROOM; P_SpawnShieldOrb(player); } } @@ -2782,7 +2782,6 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so void P_RemoveShield(player_t *player) { - boolean willbetallmario = (mariomode && ((player->powers[pw_shield] & SH_NOSTACK) != SH_PITY)); boolean fireflower = ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER); if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit @@ -2802,8 +2801,6 @@ void P_RemoveShield(player_t *player) } else player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; - if (willbetallmario && !player->powers[pw_shield]) - player->powers[pw_shield] |= SH_PITY; if (fireflower && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) { player->mo->color = player->skincolor; diff --git a/src/p_user.c b/src/p_user.c index 219b82529..d199c86f7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1388,8 +1388,6 @@ void P_SpawnShieldOrb(player_t *player) P_RemoveMobj(shieldobj); //kill the old one(s) } - if (orbtype == MT_PITYORB && mariomode) return; - shieldobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, orbtype); P_SetTarget(&shieldobj->target, player->mo); shieldobj->color = (UINT8)shieldobj->info->painchance; @@ -1474,7 +1472,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) G_GhostAddColor(GHC_NORMAL); } - player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); + player->powers[pw_shield] = shieldtype|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); return true; } @@ -6259,8 +6257,6 @@ void P_BlackOw(player_t *player) P_NukeEnemies(player->mo, player->mo, 1536*FRACUNIT); // Search for all nearby enemies and nuke their pants off! player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; - if (mariomode && !player->powers[pw_shield]) - player->powers[pw_shield] = SH_PITY; } void P_ElementalFire(player_t *player, boolean cropcircle)