diff --git a/src/deh_soc.c b/src/deh_soc.c index 7e1b228b6..7475b7e1d 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2935,6 +2935,19 @@ static void readcondition(UINT16 set, UINT32 id, char *word2) return; } } + else if ((offset=0) || fastcmp(params[0], "RINGS") + || (++offset && fastcmp(params[0], "RINGSEXACT"))) + { + PARAMCHECK(1); + ty = UCRP_RINGS + offset; + re = get_number(params[1]); + + if (re < -20 || re > 20) + { + deh_warning("Invalid ring count %d for condition ID %d", re, id+1); + return; + } + } else if (fastcmp(params[0], "TRIGGER")) { PARAMCHECK(1); diff --git a/src/m_cond.c b/src/m_cond.c index 0743f765a..1dffc05c2 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -1585,6 +1585,11 @@ boolean M_CheckCondition(condition_t *cn, player_t *player) && player->realtime < timelimitintics && (timelimitintics + extratimeintics + secretextratime - player->realtime) >= (unsigned)cn->requirement); + case UCRP_RINGS: + return (player->hudrings >= cn->requirement); + case UCRP_RINGSEXACT: + return (player->hudrings == cn->requirement); + case UCRP_TRIGGER: // requires map trigger set return !!(player->roundconditions.unlocktriggers & (1 << cn->requirement)); @@ -2260,6 +2265,13 @@ static const char *M_GetConditionString(condition_t *cn) G_TicsToSeconds(cn->requirement), G_TicsToCentiseconds(cn->requirement)); + case UCRP_RINGS: + if (cn->requirement != 20) + return va("with at least %d Rings", cn->requirement); + // FALLTHRU + case UCRP_RINGSEXACT: + return va("with exactly %d Rings", cn->requirement); + case UCRP_TRIGGER: return "do something special"; diff --git a/src/m_cond.h b/src/m_cond.h index 2c02c57af..41a05e159 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -107,6 +107,9 @@ typedef enum UCRP_FINISHTIMEEXACT, // Finish == [time, tics] UCRP_FINISHTIMELEFT, // Finish with at least [time, tics] to spare + UCRP_RINGS, // Finish >= [rings] + UCRP_RINGSEXACT, // Finish == [rings] + UCRP_TRIGGER, // Map execution trigger [id] UCRP_FALLOFF, // Fall off (or don't) @@ -119,7 +122,7 @@ typedef enum UCRP_LANDMINEDUNK, // huh? you died? that's weird. all i did was try to hug you... UCRP_HITMIDAIR, // Hit another player mid-air with a kartfielditem - UCRP_WETPLAYER, // Don't touch [fluid] + UCRP_WETPLAYER, // Don't touch [strictness] [fluid] } conditiontype_t; // Condition Set information