Merge branch 'superminecarts' into 'master'

Super and Minecarts fixes (resolves #259)

Closes #259

See merge request STJr/SRB2Internal!408
This commit is contained in:
MascaraSnake 2019-10-25 15:19:47 -04:00
commit 5a28c03a26
2 changed files with 38 additions and 6 deletions

View File

@ -2466,6 +2466,28 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
target->flags |= MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY;
P_SetThingPosition(target);
if (target->player->powers[pw_super])
{
target->player->powers[pw_super] = 0;
if (P_IsLocalPlayer(target->player))
{
music_stack_noposition = true; // HACK: Do not reposition next music
music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music
}
P_RestoreMusic(target->player);
if (gametype != GT_COOP)
{
HU_SetCEchoFlags(0);
HU_SetCEchoDuration(5);
HU_DoCEcho(va("%s\\is no longer super.\\\\\\\\", player_names[target->player-players]));
}
}
target->color = target->player->skincolor;
target->colorized = false;
G_GhostAddColor(GHC_NORMAL);
if ((target->player->lives <= 1) && (netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value == 0))
;
else if (!target->player->bot && !target->player->spectator && !G_IsSpecialStage(gamemap) && (target->player->lives != INFLIVES)

View File

@ -4156,8 +4156,11 @@ static void P_DoSuperStuff(player_t *player)
{
player->powers[pw_super] = 0;
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
music_stack_noposition = true; // HACK: Do not reposition next music
music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music
if (P_IsLocalPlayer(player))
{
music_stack_noposition = true; // HACK: Do not reposition next music
music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music
}
P_RestoreMusic(player);
P_SpawnShieldOrb(player);
@ -4226,7 +4229,7 @@ static void P_DoSuperStuff(player_t *player)
if (gametype != GT_COOP)
player->powers[pw_flashing] = flashingtics-1;
if ((player->mo->health > 0) && (player->mo->sprite2 & FF_SPR2SUPER))
if (player->mo->sprite2 & FF_SPR2SUPER)
P_SetPlayerMobjState(player->mo, player->mo->state-states);
// Inform the netgame that the champion has fallen in the heat of battle.
@ -4239,8 +4242,11 @@ static void P_DoSuperStuff(player_t *player)
}
// Resume normal music if you're the console player
music_stack_noposition = true; // HACK: Do not reposition next music
music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music
if (P_IsLocalPlayer(player))
{
music_stack_noposition = true; // HACK: Do not reposition next music
music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music
}
P_RestoreMusic(player);
// If you had a shield, restore its visual significance.
@ -10674,7 +10680,11 @@ static void P_MinecartThink(player_t *player)
}
}
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
if (player->mo->state-states != S_PLAY_STND)
{
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
player->mo->tics = -1;
}
// Move player to minecart.
P_TeleportMove(player->mo, minecart->x - minecart->momx, minecart->y - minecart->momy, minecart->z + max(minecart->momz, 0) + 8*FRACUNIT);