diff --git a/src/command.h b/src/command.h index b6e99ebf2..f021caccd 100644 --- a/src/command.h +++ b/src/command.h @@ -188,10 +188,14 @@ extern CV_PossibleValue_t CV_Natural[]; #define KARTGP_MASTER 4 // Not a speed setting, gives hard speed with maxed out bots #define KARTGP_NIGHTMARE 5 // Not a speed setting, gives expert speed with maxed out bots extern CV_PossibleValue_t kartspeed_cons_t[], gpdifficulty_cons_t[]; -// Invincibility types. +// Invincibility types #define KARTINVIN_LEGACY 0 #define KARTINVIN_ALTERN 1 +// Alt item type (alias of kartinvin_x for now until refactor complete) +#define KARTITEM_NORMAL 0 +#define KARTITEM_ALTERN 1 + extern consvar_t cv_execversion; extern consvar_t cv_resetnetvars; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 79548c2ab..47a2ccb5a 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -594,9 +594,10 @@ consvar_t cv_kartspbdist = CVAR_INIT ("kartspbdist", "4432", CV_NETVAR|CV_CHEAT| consvar_t cv_kartlegacyspbdist = CVAR_INIT ("kartlegacyspbdist", "2216", CV_NETVAR|CV_CHEAT|CV_GUARD, spbdist_cons_t, NULL); #undef MAXODDSDIST -// Invincibility modifiers -static CV_PossibleValue_t invintype_cons_t[] = {{0, "Legacy"}, {1, "Alternative"}, {0, NULL}}; -consvar_t cv_kartinvintype = CVAR_INIT ("kartinvintype", "Legacy", CV_NETVAR|CV_CALL, invintype_cons_t, KartInvinType_OnChange); +// Alt Item Modifiers +static CV_PossibleValue_t altitemtype_cons_t[] = {{KARTITEM_NORMAL, "Legacy"}, {KARTITEM_ALTERN, "Alternative"}, {0, NULL}}; +consvar_t cv_kartinvintype = CVAR_INIT ("kartinvintype", "Legacy", CV_NETVAR|CV_CALL, altitemtype_cons_t, KartInvinType_OnChange); +consvar_t cv_karteggmantype = CVAR_INIT ("karteggmantype", "Legacy", CV_NETVAR|CV_CALL, altitemtype_cons_t, KartEggmanType_OnChange); // How far the player must be from the cluster to begin frequently rolling Invincibility. static CV_PossibleValue_t invindist_cons_t[] = {{1, "MIN"}, {32000, "MAX"}, {0, NULL}}; @@ -7831,6 +7832,24 @@ static void KartInvinType_OnChange(void) } } +static void KartEggmanType_OnChange(void) +{ + if (K_CanChangeRules(false) == false) + { + return; + } + + if (leveltime < starttime) + { + CONS_Printf(M_GetText("Eggman Monitor type has been changed to \"%s\".\n"), cv_karteggmantype.string); + eggmantype = (UINT8)cv_karteggmantype.value; + } + else + { + CONS_Printf(M_GetText("Eggman Monitor type will be changed to \"%s\" next round.\n"), cv_karteggmantype.string); + } +} + static void KartBumpSpark_OnChange(void) { if (K_CanChangeRules(false) == false) diff --git a/src/deh_tables.c b/src/deh_tables.c index 345e9488d..e650302a1 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -1686,6 +1686,9 @@ struct int_const_s const INT_CONST[] = { // invintype {"KARTINVIN_LEGACY", KARTINVIN_LEGACY}, {"KARTINVIN_ALTERN", KARTINVIN_ALTERN}, + // alt item type (alias of invintype for now until refactor complete) + {"KARTITEM_NORMAL", KARTITEM_NORMAL}, + {"KARTITEM_ALTERN", KARTITEM_ALTERN}, // k_waypoint.h values {"DEFAULT_WAYPOINT_RADIUS",DEFAULT_WAYPOINT_RADIUS}, diff --git a/src/doomdef.h b/src/doomdef.h index b707eb214..d7df4e4f2 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -91,7 +91,7 @@ extern "C" { // Special Hashing. //#define NOFILEHASH -//#define NOVERIFYIWADS +#define NOVERIFYIWADS // Uncheck this to compile debugging code //#define RANGECHECK diff --git a/src/doomstat.h b/src/doomstat.h index 6f6fe218d..41173c77d 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -665,11 +665,13 @@ extern INT32 cheats; // SRB2kart extern UINT8 numlaps; extern UINT8 gamespeed; -extern UINT8 invintype; extern boolean franticitems; extern boolean encoremode, prevencoremode; extern boolean comeback; +extern UINT8 invintype; +extern UINT8 eggmantype; + extern SINT8 mostwanted; extern SINT8 battlewanted[4]; extern tic_t wantedcalcdelay; diff --git a/src/g_game.c b/src/g_game.c index e9249f005..297e6e3fa 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -295,11 +295,13 @@ INT32 cheats; //for multiplayer cheat commands // Cvars that we don't want changed mid-game UINT8 numlaps; // Removed from Cvar hell UINT8 gamespeed; // Game's current speed (or difficulty, or cc, or etc); 0 for easy, 1 for normal, 2 for hard -UINT8 invintype; // How Invincibility functions. 0 for Legacy/Vanilla, 1 for Alternative. boolean encoremode = false; // Encore Mode currently enabled? boolean prevencoremode; boolean franticitems; // Frantic items currently enabled? boolean comeback; // Battle Mode's karma comeback is on/off +// alt item values +UINT8 invintype; // How Invincibility functions. 0 for Legacy/Vanilla, 1 for Alternative. +UINT8 eggmantype; // How Eggman Monitor functions. 0 for Legacy/Vanilla, 1 for Alternative (Egg Mine). // Voting system INT16 votelevels[12][2]; // Levels that were rolled by the host diff --git a/src/info/mobjs.h b/src/info/mobjs.h index 4d1f31325..c44760310 100644 --- a/src/info/mobjs.h +++ b/src/info/mobjs.h @@ -602,7 +602,11 @@ _(SMOLDERING) // New explosion _(BOOMEXPLODE) _(BOOMPARTICLE) -_(LANDMINE) // Land Mine +// Land Mine +_(LANDMINE) +// Egg Mine +_(EGGMINE_CAPSULE) +_(EGGMINE_SHIELD) _(BALLHOG) // Ballhog _(BALLHOGBOOM) diff --git a/src/info/states.h b/src/info/states.h index 0423ca11b..86c8c67f4 100644 --- a/src/info/states.h +++ b/src/info/states.h @@ -2816,6 +2816,11 @@ _(SLOWBOOM10) _(LANDMINE) _(LANDMINE_EXPLODE) +// Egg mine +_(EGGMINE) +_(EGGMINE_POP) +_(EGGMINE_SHIELD) + // Ballhog _(BALLHOG1) _(BALLHOG2) diff --git a/src/k_collide.c b/src/k_collide.c index 44769c1d5..34ff4b101 100644 --- a/src/k_collide.c +++ b/src/k_collide.c @@ -573,12 +573,13 @@ static void K_BubbleShieldCollideDrain(player_t *player, mobj_t *bubble, INT16 d static boolean K_BubbleReflectingTrapItem(const mobj_t *t) { return t->type == MT_BANANA || (t->type == MT_ORBINAUT && t->flags2 & MF2_AMBUSH) || t->type == MT_JAWZ_DUD || - t->type == MT_EGGMANITEM || t->type == MT_SSMINE || t->type == MT_SSMINE_SHIELD || t->type == MT_LANDMINE; + t->type == MT_EGGMANITEM || t->type == MT_SSMINE || t->type == MT_SSMINE_SHIELD || t->type == MT_LANDMINE || + t->type == MT_EGGMINE_CAPSULE || t->type == MT_EGGMINE_SHIELD; } static boolean K_StrongPlayerBump(const player_t *player) { - return (((K_GetKartInvinType() == KARTINVIN_LEGACY) && (player->invincibilitytimer)) + return (((!K_IsKartItemAlternate(KITEM_INVINCIBILITY)) && (player->invincibilitytimer)) || (player->growshrinktimer > 0)); } @@ -636,7 +637,7 @@ boolean K_BubbleShieldCanReflect(mobj_t *t) { return (t->type == MT_ORBINAUT || t->type == MT_JAWZ || t->type == MT_JAWZ_DUD || t->type == MT_BANANA || t->type == MT_EGGMANITEM || t->type == MT_BALLHOG - || t->type == MT_SSMINE || t->type == MT_LANDMINE || t->type == MT_SINK + || t->type == MT_SSMINE || t->type == MT_LANDMINE || t->type == MT_EGGMINE_CAPSULE || t->type == MT_SINK || t->type == MT_KART_LEFTOVER || t->type == MT_PLAYER); } @@ -656,6 +657,7 @@ static INT16 K_GetBubbleDamage(mobj_t* itm) { case MT_EGGMANITEM: case MT_BALLHOG: + case MT_EGGMINE_CAPSULE: // Experiment: Let Bubble Shields hard-counter Ballhogs and Eggboxes. dmg = 0; break; @@ -820,7 +822,7 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2) boolean t2Condition = false; // Rim suggestion: Flipover damage is negligible at best, just cull it from Invincibility as a whole. - if (K_GetKartInvinType() == KARTINVIN_LEGACY) + if (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)) { t1Condition = (t1->player->invincibilitytimer > 0); t2Condition = (t2->player->invincibilitytimer > 0); @@ -832,7 +834,7 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2) K_DoInstashield(t2->player); return false; } - else if (K_GetKartInvinType() == KARTINVIN_LEGACY) + else if (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)) { if (t1Condition == true && t2Condition == false) { diff --git a/src/k_hud.c b/src/k_hud.c index 4f46dcb4f..795639634 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -1433,7 +1433,7 @@ static void K_drawKartItem(void) else localpatch = kp_nodraw; } - else if ((stplyr->invincibilitytimer) && (K_GetKartInvinType() == KARTINVIN_ALTERN)) + else if ((stplyr->invincibilitytimer) && (K_IsKartItemAlternate(KITEM_INVINCIBILITY))) { itembar = FixedDiv(stplyr->invincibilitytimer, max(1, stplyr->maxinvincibilitytime)); @@ -2102,7 +2102,7 @@ static boolean K_drawKartPositionFaces(void) V_DrawMappedPatch(FACE_X + offsets.x, Y + offsets.y, V_HUDTRANS|V_SNAPTOLEFT, facerank, colormap); - if ((players[rankplayer[i]].invincibilitytimer) && (K_GetKartInvinType() == KARTINVIN_ALTERN)) + if ((players[rankplayer[i]].invincibilitytimer) && (K_IsKartItemAlternate(KITEM_INVINCIBILITY))) { colormap = R_GetTranslationColormap(TC_BLINK, K_AltInvincibilityColor(leveltime / 2), GTC_CACHE); invinchudtrans = K_InvincibilityHUDVisibility(players[rankplayer[i]].invincibilitytimer); @@ -2488,7 +2488,7 @@ static void K_DrawServerMods(INT32 x, INT32 y) {"Bump Drift", 0, NULL, K_GetBumpSpark() > 0, true}, {"Bump Spark", 0, NULL, K_GetBumpSpark() > BUMPSPARK_NOCHARGE, true}, {"Bump Spring", 0, &cv_kartbumpspring, -1, true}, - {"Alt. Invin.", 0, NULL, K_GetKartInvinType() == KARTINVIN_ALTERN, true} + {"Alt. Invin.", 0, NULL, K_IsKartItemAlternate(KITEM_INVINCIBILITY), true} }; for (j = 0; j < 2; j++) @@ -4335,9 +4335,9 @@ static void K_drawKartMinimap(void) invingradient = K_InvincibilityGradient(players[i].invincibilitytimer); - if ((players[i].invincibilitytimer) && ((invingradient > (FRACUNIT/2)) || (K_GetKartInvinType() == KARTINVIN_LEGACY))) + if ((players[i].invincibilitytimer) && ((invingradient > (FRACUNIT/2)) || (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)))) { - usecolor = ((K_GetKartInvinType() == KARTINVIN_ALTERN) ? K_AltInvincibilityColor(leveltime / 2) : K_RainbowColor(leveltime / 2)); + usecolor = ((K_IsKartItemAlternate(KITEM_INVINCIBILITY)) ? K_AltInvincibilityColor(leveltime / 2) : K_RainbowColor(leveltime / 2)); colorizeplayer = true; } else @@ -4370,7 +4370,7 @@ static void K_drawKartMinimap(void) K_drawKartMinimapIcon(interpx, interpy, x, y, splitflags, workingPic, colormap, &iconoffsets); #ifdef ROTSPRITE - if ((K_GetKartInvinType() == KARTINVIN_ALTERN) && + if ((K_IsKartItemAlternate(KITEM_INVINCIBILITY)) && (players[i].invincibilitytimer) && (invingradient)) { // Draw Alt. Invin. sparkles @@ -4665,7 +4665,7 @@ static void K_drawKartMinimap(void) if ((players[localplayers[i]].invincibilitytimer) && ((invingradient > (FRACUNIT / 2)) || - (K_GetKartInvinType() == KARTINVIN_LEGACY))) + (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)))) { usecolor = (K_RainbowColor(leveltime / 2)); colorizeplayer = true; @@ -4735,7 +4735,7 @@ static void K_drawKartMinimap(void) K_drawKartMinimapIcon(interpx, interpy, x, y, splitflags, workingPic, colormap, &iconoffsets); #ifdef ROTSPRITE - if ((!nocontest) && (K_GetKartInvinType() == KARTINVIN_ALTERN) && + if ((!nocontest) && (K_IsKartItemAlternate(KITEM_INVINCIBILITY)) && (players[localplayers[i]].invincibilitytimer) && (invingradient)) { // Draw Alt. Invin. sparkles diff --git a/src/k_kart.c b/src/k_kart.c index 08fb83f3a..b848b6a1b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -912,7 +912,7 @@ static fixed_t K_CheckOffroadCollide(mobj_t *mo) static fixed_t K_OffroadGradient(player_t *player, fixed_t offroad) { // At 50% or lower Invincibility, offroad creeps up on you. - fixed_t invinoffroad = (K_GetKartInvinType() == KARTINVIN_LEGACY) ? ((player->invincibilitytimer) ? FRACUNIT : 0) : min(FRACUNIT, K_InvincibilityGradient(player->invincibilitytimer) << 1); + fixed_t invinoffroad = (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)) ? ((player->invincibilitytimer) ? FRACUNIT : 0) : min(FRACUNIT, K_InvincibilityGradient(player->invincibilitytimer) << 1); fixed_t fac = CLAMP(FRACUNIT - invinoffroad, 0, FRACUNIT); return FixedMul(offroad, fac); @@ -2412,7 +2412,7 @@ UINT16 K_GetInvincibilityTime(player_t *player) UINT32 i, pingame; fixed_t distmul = FRACUNIT; - if (K_GetKartInvinType() == KARTINVIN_LEGACY) + if (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)) return BASEINVINTIME; pingame = 0; @@ -2449,7 +2449,7 @@ UINT16 K_GetInvincibilityTime(player_t *player) static fixed_t K_GetInvincibilitySpeed(UINT16 time) { - if (K_GetKartInvinType() == KARTINVIN_LEGACY) + if (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)) return INVINSPEEDBOOSTLGC; fixed_t t = min(FRACUNIT, K_InvincibilityGradient(time)); @@ -2458,7 +2458,7 @@ static fixed_t K_GetInvincibilitySpeed(UINT16 time) static fixed_t K_GetInvincibilityAccel(UINT16 time) { - if (K_GetKartInvinType() == KARTINVIN_LEGACY) + if (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)) return INVINACCELBOOSTLGC; fixed_t t = min(FRACUNIT, K_InvincibilityGradient(time)); @@ -5035,7 +5035,7 @@ void K_DoInvincibility(player_t *player, tic_t time) overlay->destscale = player->mo->scale; P_SetScale(overlay, player->mo->scale); - if (K_GetKartInvinType() == KARTINVIN_ALTERN) + if (K_IsKartItemAlternate(KITEM_INVINCIBILITY)) { mobj_t *aura = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_OVERLAY); P_SetTarget(&aura->target, player->mo); @@ -5045,7 +5045,7 @@ void K_DoInvincibility(player_t *player, tic_t time) } } - if (K_GetKartInvinType() == KARTINVIN_ALTERN) + if (K_IsKartItemAlternate(KITEM_INVINCIBILITY)) { // Rim suggestion: Don't allow already invincible players to chain. if (K_InvincibilityGradient(player->invincibilitytimer) < (FRACUNIT/2)) @@ -7286,7 +7286,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->invincibilitytimer) { INT16 invinfac = 1; - if ((K_GetKartInvinType() == KARTINVIN_ALTERN) && (player->invincibilitytimer > 2)) + if ((K_IsKartItemAlternate(KITEM_INVINCIBILITY)) && (player->invincibilitytimer > 2)) { UINT32 invindist = INVINDIST >> 2; @@ -7684,7 +7684,7 @@ void K_KartResetPlayerColor(player_t *player) { boolean skip = false; - if (K_GetKartInvinType() == KARTINVIN_LEGACY) + if (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)) { fullbright = true; @@ -10221,7 +10221,7 @@ void K_UnsetItemOut(player_t *player) static boolean K_InvincibilitySlotHogging(player_t *player) { - if (K_GetKartInvinType() == KARTINVIN_LEGACY) + if (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)) return false; return ((player->invincibilitytimer) != 0); @@ -10263,7 +10263,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) || player->itemroulette || player->rocketsneakertimer || player->eggmanexplode - || ((K_GetKartInvinType() == KARTINVIN_ALTERN) && player->invincibilitytimer) + || ((K_IsKartItemAlternate(KITEM_INVINCIBILITY)) && player->invincibilitytimer) || (player->growshrinktimer > 0) || player->flametimer || (leveltime < starttime) @@ -11455,6 +11455,24 @@ boolean K_GetKartInvinType(void) return invintype; } +boolean K_IsKartItemAlternate(UINT8 itemtype) +{ + switch (itemtype) + { + case KITEM_INVINCIBILITY: + return invintype == KARTITEM_ALTERN; + break; + case KITEM_EGGMAN: + return eggmantype == KARTITEM_ALTERN; + break; + + default: + return false; + break; + } + return false; +} + boolean K_UsingLegacyCheckpoints(void) { if (K_UsingPatchedMap() && waypointcap != NULL) diff --git a/src/k_kart.h b/src/k_kart.h index d800661e7..e85aae584 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -345,6 +345,7 @@ boolean K_AirDropActive(void); boolean K_ItemLitterActive(void); boolean K_ItemPushingActive(void); boolean K_GetKartInvinType(void); +boolean K_IsKartItemAlternate(UINT8 itemtype); INT32 K_GetBumpSpark(void); boolean K_BoostChain(player_t *player, INT32 timer, boolean chainsound); INT32 K_ChainOrDeincrementTime(player_t *player, INT32 timer, INT32 deincrement, boolean chainsound); diff --git a/src/k_odds.c b/src/k_odds.c index a5f7d5747..7ad24ea05 100644 --- a/src/k_odds.c +++ b/src/k_odds.c @@ -108,7 +108,7 @@ static UINT8 K_KartItemOddsRace[NUMKARTRESULTS-1][MAXODDS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // Pogo Spring { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // Kitchen Sink { 7, 11, 15, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // Super Ring - { 8, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // Land Mine + { 8, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // Land Mine / Egg Mine { 0, 0, 0, 12, 15, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // Bubble Shield { 0, 0, 0, 0, 0, 0, 2, 4, 12, 24, 27, 12, 7, 4, 0, 0}, // Flame Shield { 0, 0, 0, 0, 0, 0, 8, 20, 40, 12, 0, 0, 0, 0, 0, 0}, // Sneaker x2 @@ -140,7 +140,7 @@ static UINT8 K_KartItemOddsBattle[NUMKARTRESULTS][2] = { 3, 0 }, // Pogo Spring { 0, 0 }, // Kitchen Sink { 0, 0 }, // Super Ring - { 2, 0 }, // Land Mine + { 2, 0 }, // Land Mine / Egg Mine { 1, 0 }, // Bubble Shield { 1, 0 }, // Flame Shield { 0, 0 }, // Sneaker x2 @@ -173,7 +173,7 @@ static UINT8 K_KartItemOddsSpecial[NUMKARTRESULTS-1][4] = { 0, 0, 0, 0 }, // Pogo Spring { 0, 0, 0, 0 }, // Kitchen Sink { 0, 0, 0, 0 }, // Super Ring - { 0, 0, 0, 0 }, // Land Mine + { 0, 0, 0, 0 }, // Land Mine / Egg Mine { 0, 0, 0, 0 }, // Bubble Shield { 0, 0, 0, 0 }, // Flame Shield { 0, 1, 1, 0 }, // Sneaker x2 @@ -209,7 +209,7 @@ tic_t ItemBGone[NUMKARTRESULTS][2] = { 0, 0 }, // Pogo Spring { 0, 0 }, // Kitchen Sink { 0, 0 }, // Super Ring - { 0, 0 }, // Land Mine + { 0, 0 }, // Land Mine / Egg Mine { 5, 0 }, // Bubble Shield { 8, 0 }, // Flame Shield { 0, 0 }, // Sneaker x2 @@ -758,7 +758,7 @@ INT32 K_KartGetItemOdds( notNearEnd = true; break; case KITEM_INVINCIBILITY: - if ((K_GetKartInvinType() == KARTINVIN_ALTERN) && (gametyperules & GTR_RACEODDS)) + if ((K_IsKartItemAlternate(KITEM_INVINCIBILITY)) && (gametyperules & GTR_RACEODDS)) { // It's a power item, yes, but we don't want mashing to lessen // its chances, so we lie to the game's face. diff --git a/src/p_inter.c b/src/p_inter.c index 951bd2ffe..64cf29405 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -147,7 +147,7 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon) if (player->stealingtimer || player->stolentimer || player->rocketsneakertimer || player->eggmanexplode - || ((K_GetKartInvinType() == KARTINVIN_ALTERN) && (player->invincibilitytimer)) + || ((K_IsKartItemAlternate(KITEM_INVINCIBILITY)) && (player->invincibilitytimer)) || (player->growshrinktimer > 0) || player->flametimer) return false; diff --git a/src/p_mobj.c b/src/p_mobj.c index e3847f74b..599ddf2ea 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1229,6 +1229,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo) case MT_EGGMANITEM: case MT_SSMINE: case MT_LANDMINE: + case MT_EGGMINE_CAPSULE: case MT_SINK: if (mo->extravalue2 > 0) { @@ -6514,6 +6515,7 @@ boolean P_IsKartFieldItem(INT32 type) case MT_JAWZ_DUD: case MT_SSMINE: case MT_LANDMINE: + case MT_EGGMINE_CAPSULE: case MT_BALLHOG: case MT_BUBBLESHIELDTRAP: case MT_SINK: @@ -8014,6 +8016,7 @@ static boolean P_MobjDeadThink(mobj_t *mobj) case MT_BANANA: case MT_EGGMANITEM: case MT_LANDMINE: + case MT_EGGMINE_CAPSULE: case MT_SPB: if (P_IsObjectOnGround(mobj)) { @@ -8806,6 +8809,11 @@ static boolean P_MobjRegularThink(mobj_t *mobj) if (mobj->threshold > 0) mobj->threshold--; break; + case MT_EGGMINE_CAPSULE: + // todo + // decrement fuse while on ground + // when fuse runs out pop open and spawn a land mine + break; case MT_SPBEXPLOSION: mobj->health--; break; @@ -10921,6 +10929,8 @@ static void P_DefaultMobjShadowScale(mobj_t *thing) case MT_SSMINE: case MT_SSMINE_SHIELD: case MT_LANDMINE: + case MT_EGGMINE_CAPSULE: + case MT_EGGMINE_SHIELD: case MT_BALLHOG: case MT_SINK: case MT_ROCKETSNEAKER: diff --git a/src/p_user.c b/src/p_user.c index 315556831..160790608 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2286,7 +2286,7 @@ void P_MovePlayer(player_t *player) if ((player->invincibilitytimer > 0) && (((leveltime % max(1, 10 - FixedMul(9, K_InvincibilityGradient(player->invincibilitytimer)))) == 0) || - (K_GetKartInvinType() == KARTINVIN_LEGACY))) + (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)))) { K_SpawnSparkleTrail(player->mo); } diff --git a/src/r_patchrotation.c b/src/r_patchrotation.c index f2ccfe6ec..607a8afe4 100644 --- a/src/r_patchrotation.c +++ b/src/r_patchrotation.c @@ -84,7 +84,7 @@ static angle_t R_PlayerSpriteRotation(player_t *player, player_t *viewPlayer) // Hacky boolean to check if we're the rainbow Invincibility overlay boolean R_IsOverlayingInvinciblePlayer(mobj_t* mobj) { - return ((K_GetKartInvinType() == KARTINVIN_ALTERN) && (mobj->type == MT_OVERLAY) && + return ((K_IsKartItemAlternate(KITEM_INVINCIBILITY)) && (mobj->type == MT_OVERLAY) && (mobj->target) && (mobj->extravalue2) && (mobj->target->player) && (mobj->target->player->invincibilitytimer)); }