mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-02 09:21:29 +00:00
Implement UC_SPRAYCAN condition
Currently impossible to achieve, but will work once I draw the rest of the owl
This commit is contained in:
parent
1d06637a38
commit
b03c82b8b2
3 changed files with 34 additions and 0 deletions
|
|
@ -2620,6 +2620,12 @@ static void readcondition(UINT16 set, UINT32 id, char *word2)
|
|||
stringvar = Z_StrDup(params[1]);
|
||||
re = -1;
|
||||
}
|
||||
else if (fastcmp(params[0], "SPRAYCAN"))
|
||||
{
|
||||
PARAMCHECK(1);
|
||||
ty = UC_SPRAYCAN;
|
||||
re = get_skincolor(params[1]);
|
||||
}
|
||||
else if ((offset=0) || fastcmp(params[0], "AND")
|
||||
|| (++offset && fastcmp(params[0], "COMMA")))
|
||||
{
|
||||
|
|
|
|||
26
src/m_cond.c
26
src/m_cond.c
|
|
@ -1059,6 +1059,14 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
|
|||
return false;
|
||||
case UC_PASSWORD:
|
||||
return (cn->stringvar == NULL);
|
||||
case UC_SPRAYCAN:
|
||||
{
|
||||
if (cn->requirement <= 0
|
||||
|| cn->requirement >= MAXCANCOLORS)
|
||||
return false;
|
||||
|
||||
return gamedata->spraycans[cn->requirement].got;
|
||||
}
|
||||
|
||||
// Just for string building
|
||||
case UC_AND:
|
||||
|
|
@ -1511,6 +1519,24 @@ static const char *M_GetConditionString(condition_t *cn)
|
|||
return NULL;
|
||||
case UC_PASSWORD:
|
||||
return "enter a secret password";
|
||||
case UC_SPRAYCAN:
|
||||
{
|
||||
if (cn->requirement <= 0
|
||||
|| cn->requirement >= MAXCANCOLORS)
|
||||
return va("INVALID SPRAYCAN COLOR \"%d\"", cn->requirement);
|
||||
|
||||
INT32 checkLevel = gamedata->spraycans[cn->requirement].map - 1;
|
||||
|
||||
if (checkLevel < 0 || checkLevel >= nummapheaders || !mapheaderinfo[checkLevel])
|
||||
return va("INVALID SPRAYCAN MAP \"%d:%d\"", cn->requirement, checkLevel);
|
||||
|
||||
title = BUILDCONDITIONTITLE(checkLevel);
|
||||
|
||||
work = va("%s: grab the spraycan", title);
|
||||
|
||||
Z_Free(title);
|
||||
return work;
|
||||
}
|
||||
|
||||
case UC_AND:
|
||||
return "&";
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ typedef enum
|
|||
|
||||
UC_PASSWORD, // Type in something funny
|
||||
|
||||
UC_SPRAYCAN, // Grab a spraycan
|
||||
|
||||
// Just for string building
|
||||
UC_AND,
|
||||
UC_COMMA,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue