diff --git a/src/deh_soc.c b/src/deh_soc.c index e98dd0ed3..88755ead8 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2777,7 +2777,7 @@ static void readcondition(UINT16 set, UINT32 id, char *word2) x2 = KARTGP_MASTER; else { - deh_warning("gamespeed requirement \"%s\" invalid for condition ID %d", params[3], id+1); + deh_warning("difficulty requirement \"%s\" invalid for condition ID %d", params[3], id+1); return; } } @@ -2801,7 +2801,7 @@ static void readcondition(UINT16 set, UINT32 id, char *word2) re = KARTGP_MASTER; else { - deh_warning("gamespeed requirement \"%s\" invalid for condition ID %d", params[1], id+1); + deh_warning("difficulty requirement \"%s\" invalid for condition ID %d", params[1], id+1); return; } } @@ -2986,11 +2986,22 @@ static void readcondition(UINT16 set, UINT32 id, char *word2) re = KARTGP_MASTER; else { - deh_warning("gamespeed requirement \"%s\" invalid for condition ID %d", params[1], id+1); + deh_warning("difficulty requirement \"%s\" invalid for condition ID %d", params[1], id+1); return; } } } + else if (fastcmp(params[0], "ISGEAR")) + { + PARAMCHECK(1); + ty = UCRP_ISGEAR; + re = atoi(params[1]) - 1; + if (re < KARTSPEED_NORMAL || re > KARTSPEED_HARD) + { + deh_warning("gear requirement \"%s\" invalid for condition ID %d", params[1], id+1); + return; + } + } else if (fastcmp(params[0], "PODIUMCUP")) { PARAMCHECK(1); diff --git a/src/m_cond.c b/src/m_cond.c index 5e5df8511..a306e4844 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -1612,10 +1612,12 @@ boolean M_CheckCondition(condition_t *cn, player_t *player) return (cn->requirement != -1 && player->followerskin == cn->requirement); case UCRP_ISDIFFICULTY: if (grandprixinfo.gp == false) - return (gamespeed >= cn->requirement); + return false; if (cn->requirement == KARTGP_MASTER) return (grandprixinfo.masterbots == true); return (grandprixinfo.gamespeed >= cn->requirement); + case UCRP_ISGEAR: + return (gamespeed >= cn->requirement); case UCRP_PODIUMCUP: if (grandprixinfo.gp == false || K_PodiumSequence() == false) @@ -2527,6 +2529,8 @@ static const char *M_GetConditionString(condition_t *cn) return speedtext; } + case UCRP_ISGEAR: + return va("in Gear %d", cn->requirement + 1); case UCRP_PODIUMCUP: { diff --git a/src/m_cond.h b/src/m_cond.h index d084ee001..393d046c5 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -92,7 +92,8 @@ typedef enum UCRP_ISCHARACTER, // character == [skin] UCRP_ISENGINECLASS, // engine class [class] UCRP_HASFOLLOWER, // follower == [followerskin] - UCRP_ISDIFFICULTY, // difficulty >= [difficulty] + UCRP_ISDIFFICULTY, // GP difficulty >= [difficulty] + UCRP_ISGEAR, // gear speed >= [speed] UCRP_PODIUMCUP, // cup == [cup] [optional: >= grade OR place] UCRP_PODIUMEMERALD, // Get to podium sequence with that cup's emerald