From 09c3fd432939fbf4b94c54208d16b56c7f79b6d0 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 19 Feb 2019 23:15:31 -0500 Subject: [PATCH] Hyu b gone --- src/dehacked.c | 3 +++ src/doomstat.h | 1 + src/g_game.c | 1 + src/k_kart.c | 11 ++++++----- src/p_saveg.c | 2 ++ src/p_setup.c | 1 + src/p_tick.c | 2 ++ 7 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 11aed24d..d0c5b8dc 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9852,6 +9852,9 @@ static inline int lib_getenum(lua_State *L) } else if (fastcmp(word,"indirectitemcooldown")) { lua_pushinteger(L, indirectitemcooldown); return 1; + } else if (fastcmp(word,"hyubgone")) { + lua_pushinteger(L, hyubgone); + return 1; } else if (fastcmp(word,"thwompsactive")) { lua_pushboolean(L, thwompsactive); return 1; diff --git a/src/doomstat.h b/src/doomstat.h index 9ae2726d..0f057273 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -468,6 +468,7 @@ extern boolean comeback; extern SINT8 battlewanted[4]; extern tic_t wantedcalcdelay; extern tic_t indirectitemcooldown; +extern tic_t hyubgone; extern tic_t mapreset; extern UINT8 nospectategrief; extern boolean thwompsactive; diff --git a/src/g_game.c b/src/g_game.c index f0d221ff..9edb1d84 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -267,6 +267,7 @@ SINT8 pickedvote; // What vote the host rolls SINT8 battlewanted[4]; // WANTED players in battle, worth x2 points tic_t wantedcalcdelay; // Time before it recalculates WANTED tic_t indirectitemcooldown; // Cooldown before any more Shrink, SPB, or any other item that works indirectly is awarded +tic_t hyubgone; // Cooldown before hyudoro is allowed to be rerolled tic_t mapreset; // Map reset delay when enough players have joined an empty game UINT8 nospectategrief; // How many players need to be in-game to eliminate last; for preventing spectate griefing boolean thwompsactive; // Thwomps activate on lap 2 diff --git a/src/k_kart.c b/src/k_kart.c index b94341bb..4da1f6e0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -556,6 +556,11 @@ static INT32 K_KartItemOddsBattle[NUMKARTRESULTS][6] = */ static void K_KartGetItemResult(player_t *player, SINT8 getitem) { + if (getitem == KITEM_SPB || getitem == KITEM_SHRINK) // Indirect items + indirectitemcooldown = 20*TICRATE; + if (getitem == KITEM_HYUDORO) // Hyudoro cooldown + hyubgone = 5*TICRATE; + switch (getitem) { // Special roulettes first, then the generic ones are handled by default @@ -583,10 +588,6 @@ static void K_KartGetItemResult(player_t *player, SINT8 getitem) player->kartstuff[k_itemtype] = KITEM_JAWZ; player->kartstuff[k_itemamount] = 2; break; - case KITEM_SPB: - case KITEM_SHRINK: // Indirect items - indirectitemcooldown = 20*TICRATE; - /* FALLTHRU */ default: if (getitem <= 0 || getitem >= NUMKARTRESULTS) // Sad (Fallback) { @@ -742,7 +743,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) POWERITEMODDS(newodds); break; case KITEM_HYUDORO: - if (COOLDOWNONSTART) + if ((hyubgone > 0) || COOLDOWNONSTART) newodds = 0; break; default: diff --git a/src/p_saveg.c b/src/p_saveg.c index 975a4a5d..f00e3f9b 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3313,6 +3313,7 @@ static void P_NetArchiveMisc(void) WRITEUINT32(save_p, wantedcalcdelay); WRITEUINT32(save_p, indirectitemcooldown); + WRITEUINT32(save_p, hyubgone); WRITEUINT32(save_p, mapreset); WRITEUINT8(save_p, nospectategrief); WRITEUINT8(save_p, thwompsactive); @@ -3421,6 +3422,7 @@ static inline boolean P_NetUnArchiveMisc(void) wantedcalcdelay = READUINT32(save_p); indirectitemcooldown = READUINT32(save_p); + hyubgone = READUINT32(save_p); mapreset = READUINT32(save_p); nospectategrief = READUINT8(save_p); thwompsactive = (boolean)READUINT8(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index 58e13c2e..fab433fe 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3244,6 +3244,7 @@ boolean P_SetupLevel(boolean skipprecip) wantedcalcdelay = wantedfrequency*2; indirectitemcooldown = 0; + hyubgone = 0; mapreset = 0; nospectategrief = 0; thwompsactive = false; diff --git a/src/p_tick.c b/src/p_tick.c index b46b248b..85eaea9b 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -680,6 +680,8 @@ void P_Ticker(boolean run) if (indirectitemcooldown) indirectitemcooldown--; + if (hyubgone) + hyubgone--; if (G_BattleGametype()) {