Ironman: return to base character when exiting

This commit is contained in:
AJ Martinez 2022-10-31 19:01:28 -07:00
parent 02bf3bc695
commit 8d2d6bfc78
5 changed files with 32 additions and 16 deletions

View file

@ -7710,7 +7710,6 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
if (mobj->state == &states[S_MAGICIANBOX]) // sides if (mobj->state == &states[S_MAGICIANBOX]) // sides
{ {
CONS_Printf("side\n");
fakeangle = (FixedInt(AngleFixed(mobj->angle)) + 90)%360; // What fakeangle = (FixedInt(AngleFixed(mobj->angle)) + 90)%360; // What
destx += FixedMul(mobj->radius*2, FINECOSINE(FixedAngle(fakeangle*FRACUNIT) >> ANGLETOFINESHIFT)); destx += FixedMul(mobj->radius*2, FINECOSINE(FixedAngle(fakeangle*FRACUNIT) >> ANGLETOFINESHIFT));
@ -7718,12 +7717,8 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
} }
else if (mobj->state == &states[S_MAGICIANBOX_TOP]) // top else if (mobj->state == &states[S_MAGICIANBOX_TOP]) // top
{ {
CONS_Printf("top\n");
zoff = mobj->radius*4; zoff = mobj->radius*4;
} }
else {
CONS_Printf("bottom\n");
}
if (mobj->flags2 & MF2_AMBUSH) if (mobj->flags2 & MF2_AMBUSH)
{ {

View file

@ -1919,9 +1919,6 @@ static void K_HandleLapIncrement(player_t *player)
player->karthud[khud_lapanimation] = 80; player->karthud[khud_lapanimation] = 80;
} }
if (skins[player->skin].flags & SF_IRONMAN)
SetRandomFakePlayerSkin(player, true);
if (rainbowstartavailable == true) if (rainbowstartavailable == true)
{ {
S_StartSound(player->mo, sfx_s23c); S_StartSound(player->mo, sfx_s23c);
@ -1965,8 +1962,12 @@ static void K_HandleLapIncrement(player_t *player)
{ {
P_DoPlayerExit(player); P_DoPlayerExit(player);
P_SetupSignExit(player); P_SetupSignExit(player);
} else if (skins[player->skin].flags & SF_IRONMAN)
{
SetRandomFakePlayerSkin(player, true);
} }
if (player->laps > player->latestlap) if (player->laps > player->latestlap)
{ {
if (player->laps > 1) if (player->laps > 1)

View file

@ -1264,6 +1264,8 @@ void P_DoPlayerExit(player_t *player)
if (!player->spectator) if (!player->spectator)
{ {
ClearFakePlayerSkin(player);
if ((gametyperules & GTR_CIRCUIT)) // If in Race Mode, allow if ((gametyperules & GTR_CIRCUIT)) // If in Race Mode, allow
{ {
K_KartUpdatePosition(player); K_KartUpdatePosition(player);
@ -4168,9 +4170,12 @@ void P_PlayerThink(player_t *player)
player->stairjank--; player->stairjank--;
} }
// Random skin / "ironman" // Random skin / "ironman"
if (leveltime >= introtime && ((skin_t *)player->mo->skin)->flags & SF_IRONMAN) if ((!P_MobjWasRemoved(player->mo)) & (skins[player->skin].flags & SF_IRONMAN)) // we are Heavy Magician with a mobj
{
if (((skin_t *)player->mo->skin)->flags & SF_IRONMAN) // no fakeskin yet
{
if (leveltime >= introtime && !player->exiting)
{ {
if (player->mo) {
if (player->fakeskin != MAXSKINS) if (player->fakeskin != MAXSKINS)
{ {
SetFakePlayerSkin(player, player->fakeskin); SetFakePlayerSkin(player, player->fakeskin);
@ -4181,6 +4186,11 @@ void P_PlayerThink(player_t *player)
} }
} }
} }
else if (player->exiting) // wearing a fakeskin, but need to display signpost postrace etc
{
ClearFakePlayerSkin(player);
}
}
K_KartPlayerThink(player, cmd); // SRB2kart K_KartPlayerThink(player, cmd); // SRB2kart

View file

@ -430,6 +430,15 @@ void SetRandomFakePlayerSkin(player_t* player, boolean fast)
} }
} }
// Return to base skin from an SF_IRONMAN randomization
void ClearFakePlayerSkin(player_t* player)
{
if (player->mo)
{
player->mo->skin = &skins[player->skin];
}
}
// //
// Add skins from a pwad, each skin preceded by 'S_SKIN' marker // Add skins from a pwad, each skin preceded by 'S_SKIN' marker
// //

View file

@ -83,6 +83,7 @@ void SetPlayerSkin(INT32 playernum,const char *skinname);
void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002 void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002
void SetFakePlayerSkin(player_t* player, INT32 skinnum); void SetFakePlayerSkin(player_t* player, INT32 skinnum);
void SetRandomFakePlayerSkin(player_t* player, boolean fast); void SetRandomFakePlayerSkin(player_t* player, boolean fast);
void ClearFakePlayerSkin(player_t* player);
boolean R_SkinUsable(INT32 playernum, INT32 skinnum); boolean R_SkinUsable(INT32 playernum, INT32 skinnum);
UINT32 R_GetSkinAvailabilities(void); UINT32 R_GetSkinAvailabilities(void);
INT32 R_SkinAvailable(const char *name); INT32 R_SkinAvailable(const char *name);