Hyu b gone

This commit is contained in:
James 2019-02-19 23:15:31 -05:00
parent ff57b4bc22
commit 09c3fd4329
7 changed files with 16 additions and 5 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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:

View File

@ -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);

View File

@ -3244,6 +3244,7 @@ boolean P_SetupLevel(boolean skipprecip)
wantedcalcdelay = wantedfrequency*2;
indirectitemcooldown = 0;
hyubgone = 0;
mapreset = 0;
nospectategrief = 0;
thwompsactive = false;

View File

@ -680,6 +680,8 @@ void P_Ticker(boolean run)
if (indirectitemcooldown)
indirectitemcooldown--;
if (hyubgone)
hyubgone--;
if (G_BattleGametype())
{