From acdb7fd8690826e2fab139f5bdf49a6c48956f85 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 18 Oct 2023 00:10:40 +0100 Subject: [PATCH] UCRP_CHASEDBYSPB True if the player has PF_RINGLOCK (SPB on the HUD). Probably the cleanest implementation. Stacks well with "finish in 1st". --- src/deh_soc.c | 3 ++- src/m_cond.c | 8 ++++++++ src/m_cond.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/deh_soc.c b/src/deh_soc.c index 2dd6c7fd5..068ff5e2a 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2900,7 +2900,8 @@ static void readcondition(UINT16 set, UINT32 id, char *word2) || (++offset && fastcmp(params[0], "FINISHPERFECT")) || (++offset && fastcmp(params[0], "FINISHALLPRISONS")) || (++offset && fastcmp(params[0], "NOCONTEST")) - || (++offset && fastcmp(params[0], "SMASHUFO"))) + || (++offset && fastcmp(params[0], "SMASHUFO")) + || (++offset && fastcmp(params[0], "CHASEDBYSPB"))) { //PARAMCHECK(1); ty = UCRP_FINISHCOOL + offset; diff --git a/src/m_cond.c b/src/m_cond.c index d5b12fddf..ca73cefc0 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -1513,6 +1513,11 @@ boolean M_CheckCondition(condition_t *cn, player_t *player) || specialstageinfo.ufo->health <= 1 ) ); + case UCRP_CHASEDBYSPB: + // The PERFECT implementation would check spbplace, iterate over trackercap, etc. + // But the game already has this handy-dandy SPB signal for us... + // It's only MAYBE invalid in modded context. And mods can already cheat... + return ((player->pflags & PF_RINGLOCK) == PF_RINGLOCK); case UCRP_MAKERETIRE: { @@ -2387,6 +2392,9 @@ static const char *M_GetConditionString(condition_t *cn) cn->requirement ); + case UCRP_CHASEDBYSPB: + return "while chased by a Self-Propelled Bomb"; + case UCRP_TRIGGER: return "do something special"; diff --git a/src/m_cond.h b/src/m_cond.h index 3fcda1761..5ff51018b 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -97,7 +97,9 @@ typedef enum UCRP_FINISHPERFECT, // Finish a perfect race UCRP_FINISHALLPRISONS, // Break all prisons UCRP_NOCONTEST, // No Contest + UCRP_SMASHUFO, // Smash the UFO Catcher + UCRP_CHASEDBYSPB, // Chased by SPB UCRP_MAKERETIRE, // Make another player of [skin] No Contest