mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Ironman: return to base character when exiting
This commit is contained in:
parent
02bf3bc695
commit
8d2d6bfc78
5 changed files with 32 additions and 16 deletions
|
|
@ -7710,7 +7710,6 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
|
||||
if (mobj->state == &states[S_MAGICIANBOX]) // sides
|
||||
{
|
||||
CONS_Printf("side\n");
|
||||
fakeangle = (FixedInt(AngleFixed(mobj->angle)) + 90)%360; // What
|
||||
|
||||
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
|
||||
{
|
||||
CONS_Printf("top\n");
|
||||
zoff = mobj->radius*4;
|
||||
}
|
||||
else {
|
||||
CONS_Printf("bottom\n");
|
||||
}
|
||||
|
||||
if (mobj->flags2 & MF2_AMBUSH)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1919,9 +1919,6 @@ static void K_HandleLapIncrement(player_t *player)
|
|||
player->karthud[khud_lapanimation] = 80;
|
||||
}
|
||||
|
||||
if (skins[player->skin].flags & SF_IRONMAN)
|
||||
SetRandomFakePlayerSkin(player, true);
|
||||
|
||||
if (rainbowstartavailable == true)
|
||||
{
|
||||
S_StartSound(player->mo, sfx_s23c);
|
||||
|
|
@ -1965,7 +1962,11 @@ static void K_HandleLapIncrement(player_t *player)
|
|||
{
|
||||
P_DoPlayerExit(player);
|
||||
P_SetupSignExit(player);
|
||||
} else if (skins[player->skin].flags & SF_IRONMAN)
|
||||
{
|
||||
SetRandomFakePlayerSkin(player, true);
|
||||
}
|
||||
|
||||
|
||||
if (player->laps > player->latestlap)
|
||||
{
|
||||
|
|
|
|||
26
src/p_user.c
26
src/p_user.c
|
|
@ -1264,6 +1264,8 @@ void P_DoPlayerExit(player_t *player)
|
|||
|
||||
if (!player->spectator)
|
||||
{
|
||||
ClearFakePlayerSkin(player);
|
||||
|
||||
if ((gametyperules & GTR_CIRCUIT)) // If in Race Mode, allow
|
||||
{
|
||||
K_KartUpdatePosition(player);
|
||||
|
|
@ -4168,18 +4170,26 @@ void P_PlayerThink(player_t *player)
|
|||
player->stairjank--;
|
||||
}
|
||||
// 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 (player->mo) {
|
||||
if (player->fakeskin != MAXSKINS)
|
||||
if (((skin_t *)player->mo->skin)->flags & SF_IRONMAN) // no fakeskin yet
|
||||
{
|
||||
if (leveltime >= introtime && !player->exiting)
|
||||
{
|
||||
SetFakePlayerSkin(player, player->fakeskin);
|
||||
}
|
||||
else if (!(gametyperules & GTR_CIRCUIT))
|
||||
{
|
||||
SetRandomFakePlayerSkin(player, false);
|
||||
if (player->fakeskin != MAXSKINS)
|
||||
{
|
||||
SetFakePlayerSkin(player, player->fakeskin);
|
||||
}
|
||||
else if (!(gametyperules & GTR_CIRCUIT))
|
||||
{
|
||||
SetRandomFakePlayerSkin(player, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (player->exiting) // wearing a fakeskin, but need to display signpost postrace etc
|
||||
{
|
||||
ClearFakePlayerSkin(player);
|
||||
}
|
||||
}
|
||||
|
||||
K_KartPlayerThink(player, cmd); // SRB2kart
|
||||
|
|
|
|||
|
|
@ -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
|
||||
//
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ void SetPlayerSkin(INT32 playernum,const char *skinname);
|
|||
void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002
|
||||
void SetFakePlayerSkin(player_t* player, INT32 skinnum);
|
||||
void SetRandomFakePlayerSkin(player_t* player, boolean fast);
|
||||
void ClearFakePlayerSkin(player_t* player);
|
||||
boolean R_SkinUsable(INT32 playernum, INT32 skinnum);
|
||||
UINT32 R_GetSkinAvailabilities(void);
|
||||
INT32 R_SkinAvailable(const char *name);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue