mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-30 21:20:54 +00:00
Okay, made the Mushroom a seperate shield instead of a hacked pity shield. This is a lot nicer in general.
This commit is contained in:
parent
8f1493e135
commit
5e92ca1a4a
6 changed files with 11 additions and 19 deletions
|
@ -197,7 +197,9 @@ typedef enum
|
||||||
// The force shield uses the lower 8 bits to count how many extra hits are left.
|
// The force shield uses the lower 8 bits to count how many extra hits are left.
|
||||||
SH_FORCE = 0x100,
|
SH_FORCE = 0x100,
|
||||||
SH_FORCEHP = 0xFF, // to be used as a bitmask only
|
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
|
SH_NOSTACK = ~SH_STACK
|
||||||
} shieldtype_t; // pw_shield
|
} shieldtype_t; // pw_shield
|
||||||
|
|
||||||
|
|
|
@ -7095,6 +7095,7 @@ struct {
|
||||||
{"SH_FIREFLOWER",SH_FIREFLOWER},
|
{"SH_FIREFLOWER",SH_FIREFLOWER},
|
||||||
// These ones are special and use the upper bits
|
// 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_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
|
// Stack masks
|
||||||
{"SH_STACK",SH_STACK},
|
{"SH_STACK",SH_STACK},
|
||||||
{"SH_NOSTACK",SH_NOSTACK},
|
{"SH_NOSTACK",SH_NOSTACK},
|
||||||
|
|
|
@ -2197,7 +2197,7 @@ void G_PlayerReborn(INT32 player)
|
||||||
p->panim = PA_IDLE; // standing animation
|
p->panim = PA_IDLE; // standing animation
|
||||||
|
|
||||||
if (mariomode)
|
if (mariomode)
|
||||||
p->powers[pw_shield] = SH_PITY; // start big
|
p->powers[pw_shield] = SH_MUSHROOM; // start big
|
||||||
|
|
||||||
if ((netgame || multiplayer) && !p->spectator)
|
if ((netgame || multiplayer) && !p->spectator)
|
||||||
p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent
|
p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent
|
||||||
|
|
|
@ -3427,14 +3427,10 @@ void A_PityShield(mobj_t *actor)
|
||||||
|
|
||||||
player = actor->target->player;
|
player = actor->target->player;
|
||||||
|
|
||||||
if (player->powers[pw_shield] && mariomode)
|
if (P_SwitchShield(player, SH_PITY))
|
||||||
{
|
|
||||||
S_StartSound(player->mo, sfx_itemup);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
P_SwitchShield(player, SH_PITY);
|
|
||||||
S_StartSound(player->mo, actor->info->seesound);
|
S_StartSound(player->mo, actor->info->seesound);
|
||||||
|
else if (mariomode)
|
||||||
|
S_StartSound(player->mo, sfx_itemup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1160,7 +1160,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
toucher->movecount = player->powers[pw_shield];
|
toucher->movecount = player->powers[pw_shield];
|
||||||
player->powers[pw_marioflashing] = MARIOFLASHINGTICS;
|
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);
|
P_SpawnShieldOrb(player);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -1236,7 +1236,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
S_StartSound(toucher, sfx_mario3);
|
S_StartSound(toucher, sfx_mario3);
|
||||||
player->mo->movecount = player->powers[pw_shield];
|
player->mo->movecount = player->powers[pw_shield];
|
||||||
player->powers[pw_marioflashing] = MARIOFLASHINGTICS;
|
player->powers[pw_marioflashing] = MARIOFLASHINGTICS;
|
||||||
player->powers[pw_shield] = SH_PITY;
|
player->powers[pw_shield] = SH_MUSHROOM;
|
||||||
P_SpawnShieldOrb(player);
|
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)
|
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);
|
boolean fireflower = ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER);
|
||||||
if (player->powers[pw_shield] & SH_FORCE)
|
if (player->powers[pw_shield] & SH_FORCE)
|
||||||
{ // Multi-hit
|
{ // Multi-hit
|
||||||
|
@ -2802,8 +2801,6 @@ void P_RemoveShield(player_t *player)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK;
|
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])))
|
if (fireflower && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability])))
|
||||||
{
|
{
|
||||||
player->mo->color = player->skincolor;
|
player->mo->color = player->skincolor;
|
||||||
|
|
|
@ -1388,8 +1388,6 @@ void P_SpawnShieldOrb(player_t *player)
|
||||||
P_RemoveMobj(shieldobj); //kill the old one(s)
|
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);
|
shieldobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, orbtype);
|
||||||
P_SetTarget(&shieldobj->target, player->mo);
|
P_SetTarget(&shieldobj->target, player->mo);
|
||||||
shieldobj->color = (UINT8)shieldobj->info->painchance;
|
shieldobj->color = (UINT8)shieldobj->info->painchance;
|
||||||
|
@ -1474,7 +1472,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype)
|
||||||
G_GhostAddColor(GHC_NORMAL);
|
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);
|
P_SpawnShieldOrb(player);
|
||||||
return true;
|
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!
|
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;
|
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)
|
void P_ElementalFire(player_t *player, boolean cropcircle)
|
||||||
|
|
Loading…
Reference in a new issue