Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Skydusk
SRB2
Commits
f09a5f13
Commit
f09a5f13
authored
1 year ago
by
Ace Lite
Browse files
Options
Downloads
Patches
Plain Diff
Added 'LUA' condition and G_UnlockCondition
parent
8647281a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/deh_soc.c
+12
-0
12 additions, 0 deletions
src/deh_soc.c
src/m_cond.c
+4
-0
4 additions, 0 deletions
src/m_cond.c
src/m_cond.h
+5
-0
5 additions, 0 deletions
src/m_cond.h
with
21 additions
and
0 deletions
src/deh_soc.c
+
12
−
0
View file @
f09a5f13
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
src/m_cond.c
+
4
−
0
View file @
f09a5f13
...
...
@@ -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
);
}
...
...
This diff is collapsed.
Click to expand it.
src/m_cond.h
+
5
−
0
View file @
f09a5f13
...
...
@@ -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
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment