mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
UCRP_ISENGINECLASS
Checks for the player's character's engine class As before, A-I and J are valid classes
This commit is contained in:
parent
65a4f33b6f
commit
84e807cfa0
3 changed files with 25 additions and 0 deletions
|
|
@ -2597,6 +2597,21 @@ static void readcondition(UINT8 set, UINT32 id, char *word2)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
else if (fastcmp(params[0], "ISENGINECLASS"))
|
||||
{
|
||||
PARAMCHECK(1);
|
||||
ty = UCRP_ISENGINECLASS;
|
||||
if (!params[1][1]
|
||||
&& params[1][0] >= 'A' && params[1][0] <= 'J')
|
||||
{
|
||||
re = params[1][0] - 'A';
|
||||
}
|
||||
else
|
||||
{
|
||||
deh_warning("engine class requirement \"%s\" invalid for condition ID %d", params[1], id+1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (fastcmp(params[0], "ISDIFFICULTY"))
|
||||
{
|
||||
//PARAMCHECK(1);
|
||||
|
|
|
|||
|
|
@ -796,6 +796,13 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
|
|||
return (gamemap == cn->requirement+1);
|
||||
case UCRP_ISCHARACTER:
|
||||
return (player->skin == cn->requirement);
|
||||
case UCRP_ISENGINECLASS:
|
||||
return (player->skin < numskins
|
||||
&& R_GetEngineClass(
|
||||
skins[player->skin].kartspeed,
|
||||
skins[player->skin].kartweight,
|
||||
skins[player->skin].flags
|
||||
) == (unsigned)cn->requirement);
|
||||
case UCRP_ISDIFFICULTY:
|
||||
if (grandprixinfo.gp == false)
|
||||
return (gamespeed >= cn->requirement);
|
||||
|
|
@ -1265,6 +1272,8 @@ static const char *M_GetConditionString(condition_t *cn)
|
|||
if (cn->requirement < 0 || !skins[cn->requirement].realname[0])
|
||||
return va("INVALID CHAR CONDITION \"%d:%d\"", cn->type, cn->requirement);
|
||||
return va("as %s", skins[cn->requirement].realname);
|
||||
case UCRP_ISENGINECLASS:
|
||||
return va("with engine class %c", 'A' + cn->requirement);
|
||||
case UCRP_ISDIFFICULTY:
|
||||
{
|
||||
const char *speedtext = "", *orbetter = "";
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ typedef enum
|
|||
UCRP_ISMAP, // gamemap == [map]
|
||||
|
||||
UCRP_ISCHARACTER, // character == [skin]
|
||||
UCRP_ISENGINECLASS, // engine class [class]
|
||||
UCRP_ISDIFFICULTY, // difficulty >= [difficulty]
|
||||
|
||||
UCRP_PODIUMCUP, // cup == [cup] [optional: >= grade OR place]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue