From 1c1acb9f0e9ac543b33604a7173b7c6d78291f19 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 04:01:58 -0400 Subject: [PATCH] Add emeraldspawndelay for Match "super" Emeralds will not spawn while players are still enjoying their victory dance now. --- src/g_game.c | 1 + src/p_inter.c | 5 +++-- src/p_mobj.c | 8 +++----- src/p_mobj.h | 1 + src/p_setup.c | 1 + 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 643ec8c93..7176d90dc 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -86,6 +86,7 @@ UINT8 modeattacking = ATTACKING_NONE; boolean disableSpeedAdjust = false; boolean imcontinuing = false; boolean runemeraldmanager = false; +UINT16 emeraldspawndelay = 60*TICRATE; // menu demo things UINT8 numDemos = 3; diff --git a/src/p_inter.c b/src/p_inter.c index e7f671ad1..d5c82fefc 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -241,9 +241,10 @@ void P_DoMatchSuper(player_t *player) return; // Got 'em all? Turn "super"! + emeraldspawndelay = invulntics + 1; player->powers[pw_emeralds] = 0; - player->powers[pw_invulnerability] = invulntics + 1; - player->powers[pw_sneakers] = player->powers[pw_invulnerability]; + player->powers[pw_invulnerability] = emeraldspawndelay; + player->powers[pw_sneakers] = emeraldspawndelay; if (P_IsLocalPlayer(player) && !player->powers[pw_super]) { S_StopMusic(); diff --git a/src/p_mobj.c b/src/p_mobj.c index 9565648c2..7742d63e1 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -657,14 +657,12 @@ void P_EmeraldManager(void) else break; - if (leveltime < TICRATE) // Start of map - spawnpoints[j]->threshold = 60*TICRATE + P_Random() * (TICRATE/5); - else - spawnpoints[j]->threshold = P_Random() * (TICRATE/5); - + spawnpoints[j]->threshold = emeraldspawndelay + P_Random() * (TICRATE/5); break; } } + + emeraldspawndelay = 0; } // diff --git a/src/p_mobj.h b/src/p_mobj.h index 8e782b92e..5a4e01caf 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -444,5 +444,6 @@ void P_EmeraldManager(void); extern mapthing_t *huntemeralds[MAXHUNTEMERALDS]; extern INT32 numhuntemeralds; extern boolean runemeraldmanager; +extern UINT16 emeraldspawndelay; extern INT32 numstarposts; #endif diff --git a/src/p_setup.c b/src/p_setup.c index f2b0c49d8..196f6a471 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2015,6 +2015,7 @@ static void P_LevelInitStuff(void) // special stage tokens, emeralds, and ring total tokenbits = 0; runemeraldmanager = false; + emeraldspawndelay = 60*TICRATE; nummaprings = 0; // emerald hunt