Unlocks: add IsGear condition, restrict IsDifficulty to GP

- IsDifficulty is a GP difficulty requirement
- IsGear is a gear game speed requirement
This commit is contained in:
James R 2024-02-27 06:19:43 -08:00
parent ed832c5486
commit 96543a537a
3 changed files with 21 additions and 5 deletions

View file

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

View file

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

View file

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