Skip to content
Snippets Groups Projects
Commit f09a5f13 authored by Ace Lite's avatar Ace Lite
Browse files

Added 'LUA' condition and G_UnlockCondition

parent 8647281a
No related branches found
No related tags found
No related merge requests found
......@@ -3453,6 +3453,18 @@ static void readcondition(UINT8 set, UINT32 id, char *word2)
return;
}
}
else if (fastcmp(params[0], "LUA"))
{
PARAMCHECK(1);
ty = UC_LUA;
re = atoi(params[1]);
if (re <= 0 || re > MAXLUACONDITIONS)
{
deh_warning("Lua condition %d out of range (1 - %d)", re, MAXLUACONDITIONS);
return;
}
}
else if (fastcmp(params[0], "CONDITIONSET"))
{
PARAMCHECK(1);
......
......@@ -155,6 +155,8 @@ void M_ClearSecrets(gamedata_t *data)
data->unlocked[i] = false;
for (i = 0; i < MAXCONDITIONSETS; ++i)
data->achieved[i] = false;
for (i = 0; i < MAXLUACONDITIONS; ++i)
data->lua[i] = false;
data->timesBeaten = data->timesBeatenWithEmeralds = data->timesBeatenUltimate = 0;
......@@ -214,6 +216,8 @@ static UINT8 M_CheckCondition(condition_t *cn, gamedata_t *data)
return data->collected[cn->requirement-1];
case UC_EXTRAEMBLEM: // Requires extra emblem x to be obtained
return data->extraCollected[cn->requirement-1];
case UC_LUA:
return data->lua[cn->requirement-1];
case UC_CONDITIONSET: // requires condition set x to already be achieved
return M_Achieved(cn->requirement-1, data);
}
......
......@@ -47,6 +47,7 @@ typedef enum
UC_EMBLEM, // EMBLEM [emblem number]
UC_EXTRAEMBLEM, // EXTRAEMBLEM [extra emblem number]
UC_CONDITIONSET, // CONDITIONSET [condition set number]
UC_LUA, // LUA [condition set number]
} conditiontype_t;
// Condition Set information
......@@ -141,6 +142,7 @@ typedef struct
#define MAXEMBLEMS 512
#define MAXEXTRAEMBLEMS 48
#define MAXUNLOCKABLES 80
#define MAXLUACONDITIONS 128
/** Time attack information, currently a very small structure.
*/
......@@ -202,6 +204,9 @@ typedef struct
// UNLOCKABLES UNLOCKED
boolean unlocked[MAXUNLOCKABLES];
// LUA DATA (NOT SAVED INTO GAMEDATA)
boolean lua[MAXLUACONDITIONS];
// TIME ATTACK DATA
recorddata_t *mainrecords[NUMMAPS];
nightsdata_t *nightsrecords[NUMMAPS];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment