mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 12:50:52 +00:00
Updated ZDoom ACS definitions; Updated ZScript parser for compatibility with latest GZDoom
This commit is contained in:
parent
a705dc1e03
commit
e1b9f31525
3 changed files with 68 additions and 0 deletions
|
@ -1122,3 +1122,7 @@
|
|||
#define CPXF_CLOSEST (1 << 10)
|
||||
#define CPXF_SETONPTR (1 << 11)
|
||||
#define CPXF_CHECKSIGHT (1 << 12)
|
||||
|
||||
#define SECPART_Floor 0
|
||||
#define SECPART_Ceiling 1
|
||||
#define SECPART_3D 2
|
|
@ -147,6 +147,8 @@ special
|
|||
143:Player_RemoveItem(2), // Skulltag Functions
|
||||
144:Player_GiveItem(2), // Skulltag Functions
|
||||
145:Player_SetTeam(1), // Skulltag Functions
|
||||
150:Line_SetHealth(2),
|
||||
151:Sector_SetHealth(3),
|
||||
152:Team_Score(2), // Skulltag Functions
|
||||
153:Team_GivePoints(3), // Skulltag Functions
|
||||
154:Teleport_NoStop(2, 3),
|
||||
|
@ -424,6 +426,8 @@ special
|
|||
-209:Ceil(1),
|
||||
-210:ScriptCall(2, 100), // ACS does not know varargs so use something large as maximum.
|
||||
-211:StartSlideshow(1),
|
||||
-212:GetSectorHealth(2),
|
||||
-213:GetLineHealth(1),
|
||||
|
||||
|
||||
// Eternity's
|
||||
|
|
|
@ -319,6 +319,60 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
}
|
||||
}
|
||||
|
||||
private bool ParseFlagdef()
|
||||
{
|
||||
// flagdef identifier: variable, bitnum;
|
||||
tokenizer.SkipWhitespace();
|
||||
ZScriptToken token = tokenizer.ExpectToken(ZScriptTokenType.Identifier);
|
||||
if (token == null || !token.IsValid)
|
||||
{
|
||||
parser.ReportError("Expected flag name, got " + ((Object)token ?? "<null>").ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
tokenizer.SkipWhitespace();
|
||||
token = tokenizer.ExpectToken(ZScriptTokenType.Colon);
|
||||
if (token == null || !token.IsValid)
|
||||
{
|
||||
parser.ReportError("Expected :, got " + ((Object)token ?? "<null>").ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
tokenizer.SkipWhitespace();
|
||||
token = tokenizer.ExpectToken(ZScriptTokenType.Identifier);
|
||||
if (token == null || !token.IsValid)
|
||||
{
|
||||
parser.ReportError("Expected flag base variable, got " + ((Object)token ?? "<null>").ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
tokenizer.SkipWhitespace();
|
||||
token = tokenizer.ExpectToken(ZScriptTokenType.Comma);
|
||||
if (token == null || !token.IsValid)
|
||||
{
|
||||
parser.ReportError("Expected comma, got " + ((Object)token ?? "<null>").ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
tokenizer.SkipWhitespace();
|
||||
token = tokenizer.ExpectToken(ZScriptTokenType.Integer);
|
||||
if (token == null || !token.IsValid)
|
||||
{
|
||||
parser.ReportError("Expected flag bit index, got " + ((Object)token ?? "<null>").ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
tokenizer.SkipWhitespace();
|
||||
token = tokenizer.ExpectToken(ZScriptTokenType.Semicolon);
|
||||
if (token == null || !token.IsValid)
|
||||
{
|
||||
parser.ReportError("Expected semicolon, got " + ((Object)token ?? "<null>").ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ParseProperty()
|
||||
{
|
||||
// property identifier: identifier, identifier, identifier, ...;
|
||||
|
@ -487,6 +541,12 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
return;
|
||||
continue;
|
||||
|
||||
// new flags syntax
|
||||
case "flagdef":
|
||||
if (!ParseFlagdef())
|
||||
return;
|
||||
continue;
|
||||
|
||||
default:
|
||||
stream.Position = ocpos;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue