From 39d701359a05e1b2e46f57c2f4b9f7e248f03a81 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 14 Apr 2024 21:16:32 +0100 Subject: [PATCH 1/3] The "(Find other secrets to learn about this...)" text only happens if it's at the start of the challenge, otherwise it does "???" as before Least need to go over and check every challenge description again --- src/m_cond.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/m_cond.c b/src/m_cond.c index fe095be8c..3e0a2c847 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -3027,7 +3027,10 @@ char *M_BuildConditionSetString(UINT16 unlockid) if (work == NULL) { stopasap = true; - work = "(Find other secrets to learn about this...)"; + if (message[0] && message[1]) + work = "???"; + else + work = "(Find other secrets to learn about this...)"; } else if (cn->type == UC_DESCRIPTIONOVERRIDE) { From 6df31e96f0e65b96aab2cf18a006d7739d0fc213 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 14 Apr 2024 21:33:20 +0100 Subject: [PATCH 2/3] M_BuildConditionString: Fix invalid conjunction behaviour - Nothing except DescriptionOverride will prevent an `- OR ` being inserted - Question marks for further secret types won't prevent alternate conditions from showing up --- src/m_cond.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/m_cond.c b/src/m_cond.c index 3e0a2c847..4b0cc89e0 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -2979,7 +2979,7 @@ char *M_BuildConditionSetString(UINT16 unlockid) static char message[1024] = ""; const char *work = NULL; size_t i; - boolean stopasap = false; + UINT8 stopasap = 0; message[0] = '\0'; @@ -3006,14 +3006,16 @@ char *M_BuildConditionSetString(UINT16 unlockid) { cn = &c->condition[i]; - if (i > 0 && (cn->type != UC_COMMA)) + if (i > 0) { + worklen = 0; if (lastID != cn->id) { + stopasap = 0; worklen = 6; strncat(message, " - OR ", len); } - else + else if (stopasap == 0 && cn->type != UC_COMMA) { worklen = 1; strncat(message, " ", len); @@ -3023,10 +3025,16 @@ char *M_BuildConditionSetString(UINT16 unlockid) lastID = cn->id; + if (stopasap == 1) + { + // Secret challenge -- show unrelated condition IDs + continue; + } + work = M_GetConditionString(cn); if (work == NULL) { - stopasap = true; + stopasap = 1; if (message[0] && message[1]) work = "???"; else @@ -3034,15 +3042,16 @@ char *M_BuildConditionSetString(UINT16 unlockid) } else if (cn->type == UC_DESCRIPTIONOVERRIDE) { - stopasap = true; + stopasap = 2; } worklen = strlen(work); strncat(message, work, len); len -= worklen; - if (stopasap) + if (stopasap == 2) { + // Description override - hide all further ones break; } } From c9651f92afe295b20fdae3ec6064e1bcd7e25937 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 14 Apr 2024 23:38:28 +0100 Subject: [PATCH 3/3] Grab a certain prize from a random Prison Egg Extra word added because the newline situation sucks --- src/m_cond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_cond.c b/src/m_cond.c index 4b0cc89e0..ffb032309 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -2631,7 +2631,7 @@ static const char *M_GetConditionString(condition_t *cn) case UC_PRISONEGGCD: // :butterfly: "alternatively you could say 'grab a hot toooon' or 'smooth beeat'" - return "GRAND PRIX: grab a certain prize from a Prison Egg"; + return "GRAND PRIX: grab a certain prize from a random Prison Egg"; case UC_AND: return "&";