mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-11 03:12:09 +00:00
Add UC_CHARACTERWINS
Just in case I don't get to do a major pass on adding a ton of extra unlockable conditions later, this is an easy, quick add featuring a stat gamedata and the statistics menu has been tracking for a while.
This commit is contained in:
parent
b9a6f7362b
commit
595b3d67d5
3 changed files with 33 additions and 17 deletions
|
|
@ -2542,6 +2542,14 @@ static void readcondition(UINT16 set, UINT32 id, char *word2)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (fastcmp(params[0], "CHARACTERWINS"))
|
||||||
|
{
|
||||||
|
PARAMCHECK(2);
|
||||||
|
ty = UC_CHARACTERWINS;
|
||||||
|
stringvar = Z_StrDup(params[1]);
|
||||||
|
re = -1;
|
||||||
|
x1 = atoi(params[2]);
|
||||||
|
}
|
||||||
else if ((offset=0) || fastcmp(params[0], "ALLCHAOS")
|
else if ((offset=0) || fastcmp(params[0], "ALLCHAOS")
|
||||||
|| (++offset && fastcmp(params[0], "ALLSUPER"))
|
|| (++offset && fastcmp(params[0], "ALLSUPER"))
|
||||||
|| (++offset && fastcmp(params[0], "ALLEMERALDS")))
|
|| (++offset && fastcmp(params[0], "ALLEMERALDS")))
|
||||||
|
|
@ -2662,22 +2670,8 @@ static void readcondition(UINT16 set, UINT32 id, char *word2)
|
||||||
{
|
{
|
||||||
PARAMCHECK(1);
|
PARAMCHECK(1);
|
||||||
ty = UCRP_ISCHARACTER;
|
ty = UCRP_ISCHARACTER;
|
||||||
#if 0
|
stringvar = Z_StrDup(params[1]);
|
||||||
{
|
re = -1;
|
||||||
re = R_SkinAvailable(params[1]);
|
|
||||||
|
|
||||||
if (re < 0)
|
|
||||||
{
|
|
||||||
deh_warning("Invalid character %s for condition ID %d", params[1], id+1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
stringvar = Z_StrDup(params[1]);
|
|
||||||
re = -1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (fastcmp(params[0], "ISENGINECLASS"))
|
else if (fastcmp(params[0], "ISENGINECLASS"))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
22
src/m_cond.c
22
src/m_cond.c
|
|
@ -819,13 +819,14 @@ void M_UpdateConditionSetsPending(void)
|
||||||
|
|
||||||
switch (cn->type)
|
switch (cn->type)
|
||||||
{
|
{
|
||||||
|
case UC_CHARACTERWINS:
|
||||||
case UCRP_ISCHARACTER:
|
case UCRP_ISCHARACTER:
|
||||||
{
|
{
|
||||||
cn->requirement = R_SkinAvailable(cn->stringvar);
|
cn->requirement = R_SkinAvailable(cn->stringvar);
|
||||||
|
|
||||||
if (cn->requirement < 0)
|
if (cn->requirement < 0)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, "UCRP_ISCHARACTER: Invalid character %s for condition ID %d", cn->stringvar, cn->id+1);
|
CONS_Alert(CONS_WARNING, "UC TYPE %u: Invalid character %s for condition ID %d", cn->type, cn->stringvar, cn->id+1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -981,6 +982,12 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
|
||||||
case UC_MAPTIME: // Requires time on map <= x
|
case UC_MAPTIME: // Requires time on map <= x
|
||||||
return (G_GetBestTime(cn->extrainfo1) <= (unsigned)cn->requirement);
|
return (G_GetBestTime(cn->extrainfo1) <= (unsigned)cn->requirement);
|
||||||
|
|
||||||
|
case UC_CHARACTERWINS:
|
||||||
|
if (cn->requirement < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return (skins[cn->requirement].records.wins >= (UINT32)cn->extrainfo1);
|
||||||
|
|
||||||
case UC_ALLCHAOS:
|
case UC_ALLCHAOS:
|
||||||
case UC_ALLSUPER:
|
case UC_ALLSUPER:
|
||||||
case UC_ALLEMERALDS:
|
case UC_ALLEMERALDS:
|
||||||
|
|
@ -1353,6 +1360,19 @@ static const char *M_GetConditionString(condition_t *cn)
|
||||||
return work;
|
return work;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case UC_CHARACTERWINS:
|
||||||
|
{
|
||||||
|
if (cn->requirement < 0 || !skins[cn->requirement].realname[0])
|
||||||
|
return va("INVALID CHAR CONDITION \"%d:%d:%d\"", cn->type, cn->requirement, cn->extrainfo1);
|
||||||
|
work = (R_SkinUsable(-1, cn->requirement, false))
|
||||||
|
? skins[cn->requirement].realname
|
||||||
|
: "???";
|
||||||
|
return va("win %d Round%s as %s",
|
||||||
|
cn->extrainfo1,
|
||||||
|
cn->extrainfo1 == 1 ? "" : "s",
|
||||||
|
work);
|
||||||
|
}
|
||||||
|
|
||||||
case UC_ALLCHAOS:
|
case UC_ALLCHAOS:
|
||||||
case UC_ALLSUPER:
|
case UC_ALLSUPER:
|
||||||
case UC_ALLEMERALDS:
|
case UC_ALLEMERALDS:
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ typedef enum
|
||||||
UC_MAPSPBATTACK, // MAPSPBATTACK [map]
|
UC_MAPSPBATTACK, // MAPSPBATTACK [map]
|
||||||
UC_MAPTIME, // MAPTIME [map] [time to beat, tics]
|
UC_MAPTIME, // MAPTIME [map] [time to beat, tics]
|
||||||
|
|
||||||
|
UC_CHARACTERWINS, // CHARACTERWINS [character] [x rounds]
|
||||||
|
|
||||||
UC_ALLCHAOS, // ALLCHAOS [minimum difficulty]
|
UC_ALLCHAOS, // ALLCHAOS [minimum difficulty]
|
||||||
UC_ALLSUPER, // ALLSUPER [minimum difficulty]
|
UC_ALLSUPER, // ALLSUPER [minimum difficulty]
|
||||||
UC_ALLEMERALDS, // ALLEMERALDS [minimum difficulty]
|
UC_ALLEMERALDS, // ALLEMERALDS [minimum difficulty]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue