From 6d57d39e124e7a6293b8ae7bbcb071c6fa10a5cb Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 3 Jun 2018 20:58:52 -0400 Subject: [PATCH] SUPER CHARGED KARMA ITEMS They give equal chance on a lot of good shit, instead of the normal boring pool of items, mwahaha (also calls P_CheckRacers when someone spectates) --- src/d_main.c | 2 +- src/d_netcmd.c | 2 ++ src/d_player.h | 1 + src/k_kart.c | 57 +++++++++++++++++++++++++++----------------------- src/p_map.c | 2 ++ 5 files changed, 37 insertions(+), 27 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index c0de6133..df1180c8 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -702,7 +702,7 @@ void D_SRB2Loop(void) else if (rendertimeout < entertic) // in case the server hang or netsplit { // Lagless camera! Yay! - /* + /* Not yay, it ruins Kart's drift :y if (gamestate == GS_LEVEL && netgame) { if (camera.chase) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 5c8343d6..f4cd3e12 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3235,6 +3235,8 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) P_CheckSurvivors(); else if (G_BattleGametype()) K_CheckBalloons(); // SRB2Kart + else if (G_RaceGametype()) + K_CheckRacers(); // also SRB2Kart } // diff --git a/src/d_player.h b/src/d_player.h index 2d0edd1b..80e633dc 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -262,6 +262,7 @@ typedef enum k_offroad, // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem") + k_roulettetype, // Used for the roulette, for deciding type (currently only used for Battle, to give you better items from Karma items) k_itemclose, // Used to animate the item window closing (was "pw_psychic") // Some items use timers for their duration or effects diff --git a/src/k_kart.c b/src/k_kart.c index c4da0b22..2f36665a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -385,30 +385,30 @@ static INT32 K_KartItemOddsDistance_Retro[NUMKARTITEMS][9] = /*Feather*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // Feather }; -static INT32 K_KartItemOddsBalloons[NUMKARTITEMS][5] = +static INT32 K_KartItemOddsBalloons[NUMKARTITEMS][6] = { - //P-Odds 0 1 2 3 4 - /*Magnet*/ { 0, 0, 0, 0, 0 }, // Magnet - /*Boo*/ { 0, 0, 1, 1, 0 }, // Boo - /*Mushroom*/ { 0, 1, 2, 1, 0 }, // Mushroom - /*Triple Mushroom*/ { 0, 0, 0, 0, 0 }, // Triple Mushroom - /*Mega Mushroom*/ { 1, 2, 0, 0, 0 }, // Mega Mushroom - /*Gold Mushroom*/ { 0, 0, 0, 0, 0 }, // Gold Mushroom - /*Star*/ { 1, 2, 0, 0, 0 }, // Star + //P-Odds 0 1 2 3 4 5 + /*Magnet*/ { 0, 0, 0, 0, 0, 0 }, // Magnet + /*Boo*/ { 0, 0, 1, 1, 0, 0 }, // Boo + /*Mushroom*/ { 0, 1, 2, 1, 0, 1 }, // Mushroom + /*Triple Mushroom*/ { 0, 0, 0, 0, 0, 0 }, // Triple Mushroom + /*Mega Mushroom*/ { 1, 2, 0, 0, 0, 1 }, // Mega Mushroom + /*Gold Mushroom*/ { 0, 0, 0, 0, 0, 0 }, // Gold Mushroom + /*Star*/ { 1, 2, 0, 0, 0, 1 }, // Star - /*Triple Banana*/ { 0, 1, 1, 0, 0 }, // Triple Banana - /*Fake Item*/ { 0, 0, 2, 1, 1 }, // Fake Item - /*Banana*/ { 0, 0, 3, 1, 1 }, // Banana - /*Green Shell*/ { 0, 0, 5, 3, 2 }, // Green Shell - /*Red Shell*/ { 0, 3, 3, 0, 0 }, // Red Shell - /*Triple Green Shell*/ { 0, 1, 1, 0, 0 }, // Triple Green Shell - /*Bob-omb*/ { 0, 3, 3, 0, 0 }, // Bob-omb - /*Blue Shell*/ { 0, 0, 0, 0, 0 }, // Blue Shell - /*Fire Flower*/ { 0, 3, 3, 0, 0 }, // Fire Flower - /*Triple Red Shell*/ { 1, 2, 0, 0, 0 }, // Triple Red Shell - /*Lightning*/ { 0, 0, 0, 0, 0 }, // Lightning + /*Triple Banana*/ { 0, 1, 1, 0, 0, 1 }, // Triple Banana + /*Fake Item*/ { 0, 0, 2, 1, 1, 0 }, // Fake Item + /*Banana*/ { 0, 0, 3, 1, 1, 0 }, // Banana + /*Green Shell*/ { 0, 0, 5, 3, 2, 0 }, // Green Shell + /*Red Shell*/ { 0, 3, 3, 0, 0, 1 }, // Red Shell + /*Triple Green Shell*/ { 0, 1, 1, 0, 0, 1 }, // Triple Green Shell + /*Bob-omb*/ { 0, 3, 3, 0, 0, 1 }, // Bob-omb + /*Blue Shell*/ { 0, 0, 0, 0, 0, 0 }, // Blue Shell + /*Fire Flower*/ { 0, 3, 3, 0, 0, 1 }, // Fire Flower + /*Triple Red Shell*/ { 1, 2, 0, 0, 0, 1 }, // Triple Red Shell + /*Lightning*/ { 0, 0, 0, 0, 0, 0 }, // Lightning - /*Feather*/ { 0, 0, 1, 1, 0 } // Feather + /*Feather*/ { 0, 0, 1, 1, 0, 0 } // Feather }; /** \brief Item Roulette for Kart @@ -593,11 +593,16 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) if (G_BattleGametype()) // Battle Mode { - useodds = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average - if (useodds > 4) - useodds = 4; - if (useodds < 0) - useodds = 0; + if (player->kartstuff[k_roulettetype] == 1) + useodds = 5; + else + { + useodds = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average + if (useodds > 4) + useodds = 4; + if (useodds < 0) + useodds = 0; + } } else { diff --git a/src/p_map.c b/src/p_map.c index 05e12064..16a3838b 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1710,6 +1710,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (netgame && cv_hazardlog.value) CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[thing->player-players], player_names[tmthing->player-players]); tmthing->player->kartstuff[k_itemroulette] = 1; + tmthing->player->kartstuff[k_roulettetype] = 1; if (thing->player->kartstuff[k_comebackpoints] >= 3) K_StealBalloon(thing->player, tmthing->player, true); thing->player->kartstuff[k_comebacktimer] = comebacktime; @@ -1724,6 +1725,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (netgame && cv_hazardlog.value) CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[tmthing->player-players], player_names[thing->player-players]); thing->player->kartstuff[k_itemroulette] = 1; + thing->player->kartstuff[k_roulettetype] = 1; if (tmthing->player->kartstuff[k_comebackpoints] >= 3) K_StealBalloon(tmthing->player, thing->player, true); tmthing->player->kartstuff[k_comebacktimer] = comebacktime;