From ff1574f80f1e98344ac488125c40732a1e8d8790 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Dec 2022 17:48:35 +0000 Subject: [PATCH] Allow for marking Emblems as "not a Medal" via SOC definition Also remove long-unused `hint` string --- src/deh_soc.c | 10 ++-------- src/m_cond.c | 2 ++ src/m_cond.h | 16 ++++++++-------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/deh_soc.c b/src/deh_soc.c index f49e1df20..90434c057 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2124,14 +2124,6 @@ void reademblemdata(MYFILE *f, INT32 num) word2 = tmp += 2; value = atoi(word2); // used for numerical settings - // Up here to allow lowercase in hints - if (fastcmp(word, "HINT")) - { - while ((tmp = strchr(word2, '\\'))) - *tmp = '\n'; - deh_strlcpy(emblemlocations[num-1].hint, word2, sizeof (emblemlocations[num-1].hint), va("Emblem %d: hint", num)); - continue; - } strupr(word2); if (fastcmp(word, "TYPE")) @@ -2172,6 +2164,8 @@ void reademblemdata(MYFILE *f, INT32 num) emblemlocations[num-1].var = get_number(word2); } + else if (fastcmp(word, "NOTMEDAL")) + emblemlocations[num-1].notMedal = (boolean)(i != 0 || word2[0] == 'T' || word2[0] == 'Y'); else deh_warning("Emblem %d: unknown word '%s'", num, word); } diff --git a/src/m_cond.c b/src/m_cond.c index d0a911b25..d14fedb44 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -1067,6 +1067,8 @@ INT32 M_CountMedals(boolean all) INT32 found = 0, i; for (i = 0; i < numemblems; ++i) { + if (emblemlocations[i].notMedal) + continue; if (!all && !gamedata->collected[i]) continue; found++; diff --git a/src/m_cond.h b/src/m_cond.h index 7aaf6e23a..99e3492b9 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -69,14 +69,14 @@ struct conditionset_t struct emblem_t { - UINT8 type; ///< Emblem type - INT16 tag; ///< Tag of emblem mapthing - char * level; ///< Level on which this emblem can be found. - UINT8 sprite; ///< emblem sprite to use, 0 - 25 - UINT16 color; ///< skincolor to use - INT32 var; ///< If needed, specifies information on the target amount to achieve (or target skin) - char *stringVar; ///< String version - char hint[110]; ///< Hint for emblem hints menu + UINT8 type; ///< Emblem type + INT16 tag; ///< Tag of emblem mapthing + char * level; ///< Level on which this emblem can be found. + UINT8 sprite; ///< emblem sprite to use, 0 - 25 + UINT16 color; ///< skincolor to use + INT32 var; ///< If needed, specifies information on the target amount to achieve (or target skin) + char *stringVar; ///< String version + boolean notMedal; ///< Not a Medal? }; // Unlockable information