UCRP_CHASEDBYSPB

True if the player has PF_RINGLOCK (SPB on the HUD). Probably the cleanest implementation.
Stacks well with "finish in 1st".
This commit is contained in:
toaster 2023-10-18 00:10:40 +01:00
parent a746c4f33f
commit acdb7fd869
3 changed files with 12 additions and 1 deletions

View file

@ -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;

View file

@ -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";

View file

@ -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