Merge branch 'master' of github.com:rheit/acc

This commit is contained in:
Marisa Heit 2016-09-26 16:59:43 -05:00
commit 32d34fa2a9
9 changed files with 126 additions and 37 deletions

1
.gitignore vendored
View file

@ -12,3 +12,4 @@
/log /log
/t /t
/zdefs.acs.orig /zdefs.acs.orig
/*.o

33
parse.c
View file

@ -341,6 +341,8 @@ static struct ScriptTypes ScriptCounts[] =
{ "unloading", UNLOADING_SCRIPTS_BASE, 0 }, { "unloading", UNLOADING_SCRIPTS_BASE, 0 },
{ "return", RETURN_SCRIPTS_BASE, 0 }, { "return", RETURN_SCRIPTS_BASE, 0 },
{ "event", EVENT_SCRIPTS_BASE, 0 }, { "event", EVENT_SCRIPTS_BASE, 0 },
{ "kill", KILL_SCRIPTS_BASE, 0 },
{ "reopen", REOPEN_SCRIPTS_BASE, 0 },
{ NULL, -1, 0 } { NULL, -1, 0 }
}; };
@ -522,6 +524,7 @@ static void Outside(void)
break; break;
case TK_REGION: // [mxd] case TK_REGION: // [mxd]
case TK_ENDREGION: case TK_ENDREGION:
outertokencount--; // #region markers should not count as "real" tokens
TK_SkipLine(); TK_SkipLine();
break; break;
default: default:
@ -669,6 +672,8 @@ static void OuterScript(void)
case TK_LIGHTNING: case TK_LIGHTNING:
case TK_UNLOADING: case TK_UNLOADING:
case TK_RETURN: case TK_RETURN:
case TK_KILL:
case TK_REOPEN:
ERR_Error(ERR_UNCLOSED_WITH_ARGS, YES); ERR_Error(ERR_UNCLOSED_WITH_ARGS, YES);
break; break;
@ -742,6 +747,14 @@ static void OuterScript(void)
scriptType = EVENT_SCRIPTS_BASE; scriptType = EVENT_SCRIPTS_BASE;
ERR_Error (ERR_EVENT_NEEDS_3_ARG, YES); ERR_Error (ERR_EVENT_NEEDS_3_ARG, YES);
break; break;
case TK_KILL: // [JM]
scriptType = KILL_SCRIPTS_BASE;
break;
case TK_REOPEN: // [Nash]
scriptType = REOPEN_SCRIPTS_BASE;
break;
default: default:
ERR_Error(ERR_BAD_SCRIPT_DECL, YES); ERR_Error(ERR_BAD_SCRIPT_DECL, YES);
@ -1635,7 +1648,21 @@ static void LeadingLineSpecial(boolean executewait)
} }
TK_TokenMustBe(TK_RPAREN, ERR_MISSING_RPAREN); TK_TokenMustBe(TK_RPAREN, ERR_MISSING_RPAREN);
TK_NextTokenMustBe(TK_SEMICOLON, ERR_MISSING_SEMICOLON); TK_NextTokenMustBe(TK_SEMICOLON, ERR_MISSING_SEMICOLON);
if(direct == NO) if (specialValue > 255)
{
for(; argCount < 5; ++argCount)
{
PC_AppendPushVal(0);
}
PC_AppendCmd(PCD_LSPEC5EX);
PC_AppendInt(specialValue);
if(executewait)
{
PC_AppendCmd(PCD_SCRIPTWAITDIRECT);
PC_AppendInt(argSave[0]);
}
}
else if(direct == NO)
{ {
PC_AppendCmd(PCD_LSPEC1+(argCount-1)); PC_AppendCmd(PCD_LSPEC1+(argCount-1));
if(pc_NoShrink) if(pc_NoShrink)
@ -3513,8 +3540,8 @@ static void ExprLineSpecial(void)
} }
TK_TokenMustBe(TK_RPAREN, ERR_MISSING_RPAREN); TK_TokenMustBe(TK_RPAREN, ERR_MISSING_RPAREN);
TK_NextToken(); TK_NextToken();
PC_AppendCmd(PCD_LSPEC5RESULT); PC_AppendCmd(specialValue <= 255? PCD_LSPEC5RESULT : PCD_LSPEC5EXRESULT);
if(pc_NoShrink) if(pc_NoShrink || specialValue > 255)
{ {
PC_AppendInt(specialValue); PC_AppendInt(specialValue);
} }

View file

@ -231,7 +231,7 @@ static char *PCDNames[PCODE_COMMAND_COUNT] =
"PCD_PLAYERGOLDSKULL", "PCD_PLAYERGOLDSKULL",
"PCD_PLAYERBLACKCARD", "PCD_PLAYERBLACKCARD",
"PCD_PLAYERSILVERCARD", "PCD_PLAYERSILVERCARD",
"PCD_PLAYERONTEAM", "PCD_ISNETWORKGAME",
"PCD_PLAYERTEAM", "PCD_PLAYERTEAM",
"PCD_PLAYERHEALTH", "PCD_PLAYERHEALTH",
"PCD_PLAYERARMORPOINTS", "PCD_PLAYERARMORPOINTS",
@ -499,6 +499,8 @@ static char *PCDNames[PCODE_COMMAND_COUNT] =
"PCD_PRINTSCRIPTCHARARRAY", "PCD_PRINTSCRIPTCHARARRAY",
"PCD_PRINTSCRIPTCHRANGE", "PCD_PRINTSCRIPTCHRANGE",
"PCD_STRCPYTOSCRIPTCHRANGE", "PCD_STRCPYTOSCRIPTCHRANGE",
"PCD_LSPEC5EX",
"PCD_LSPEC5EXRESULT",
}; };
// CODE -------------------------------------------------------------------- // CODE --------------------------------------------------------------------

View file

@ -31,6 +31,8 @@ enum
DISCONNECT_SCRIPTS_BASE = 14, DISCONNECT_SCRIPTS_BASE = 14,
RETURN_SCRIPTS_BASE = 15, RETURN_SCRIPTS_BASE = 15,
EVENT_SCRIPTS_BASE = 16, // [BB] EVENT_SCRIPTS_BASE = 16, // [BB]
KILL_SCRIPTS_BASE = 17, // [JM]
REOPEN_SCRIPTS_BASE = 18, // [Nash]
}; };
// Values to indicate script flags (requires new-style .o) // Values to indicate script flags (requires new-style .o)
@ -176,7 +178,7 @@ typedef enum
PCD_PLAYERGOLDSKULL, PCD_PLAYERGOLDSKULL,
PCD_PLAYERBLACKCARD, PCD_PLAYERBLACKCARD,
PCD_PLAYERSILVERCARD, PCD_PLAYERSILVERCARD,
PCD_PLAYERONTEAM, PCD_ISNETWORKGAME,
PCD_PLAYERTEAM, PCD_PLAYERTEAM,
PCD_PLAYERHEALTH, PCD_PLAYERHEALTH,
PCD_PLAYERARMORPOINTS, PCD_PLAYERARMORPOINTS,
@ -444,6 +446,8 @@ typedef enum
PCD_PRINTSCRIPTCHARARRAY, PCD_PRINTSCRIPTCHARARRAY,
PCD_PRINTSCRIPTCHRANGE, PCD_PRINTSCRIPTCHRANGE,
PCD_STRCPYTOSCRIPTCHRANGE, PCD_STRCPYTOSCRIPTCHRANGE,
PCD_LSPEC5EX,
PCD_LSPEC5EXRESULT,
PCODE_COMMAND_COUNT PCODE_COMMAND_COUNT
} pcd_t; } pcd_t;

View file

@ -90,7 +90,7 @@ static internFuncDef_t InternalFunctions[] =
{ "playerbluecard", PCD_NOP, PCD_PLAYERBLUECARD, 0, 0, 0, YES, NO }, { "playerbluecard", PCD_NOP, PCD_PLAYERBLUECARD, 0, 0, 0, YES, NO },
{ "playerredcard", PCD_NOP, PCD_PLAYERREDCARD, 0, 0, 0, YES, NO }, { "playerredcard", PCD_NOP, PCD_PLAYERREDCARD, 0, 0, 0, YES, NO },
{ "playeryellowcard", PCD_NOP, PCD_PLAYERYELLOWCARD, 0, 0, 0, YES, NO }, { "playeryellowcard", PCD_NOP, PCD_PLAYERYELLOWCARD, 0, 0, 0, YES, NO },
{ "playeronteam", PCD_NOP, PCD_PLAYERONTEAM, 0, 0, 0, YES, NO }, { "isnetworkgame", PCD_NOP, PCD_ISNETWORKGAME, 0, 0, 0, YES, NO },
{ "playerteam", PCD_NOP, PCD_PLAYERTEAM, 0, 0, 0, YES, NO }, { "playerteam", PCD_NOP, PCD_PLAYERTEAM, 0, 0, 0, YES, NO },
{ "playerfrags", PCD_NOP, PCD_PLAYERFRAGS, 0, 0, 0, YES, NO }, { "playerfrags", PCD_NOP, PCD_PLAYERFRAGS, 0, 0, 0, YES, NO },
{ "playerhealth", PCD_NOP, PCD_PLAYERHEALTH, 0, 0, 0, YES, NO }, { "playerhealth", PCD_NOP, PCD_PLAYERHEALTH, 0, 0, 0, YES, NO },

View file

@ -199,6 +199,8 @@ static struct keyword_s
{ "strcpy", TK_STRCPY }, // [FDARI] { "strcpy", TK_STRCPY }, // [FDARI]
{ "region", TK_REGION }, // [mxd] { "region", TK_REGION }, // [mxd]
{ "endregion", TK_ENDREGION }, // [mxd] { "endregion", TK_ENDREGION }, // [mxd]
{ "kill", TK_KILL }, // [JM]
{ "reopen", TK_REOPEN }, // [Nash]
}; };
#define NUM_KEYWORDS (sizeof(Keywords)/sizeof(Keywords[0])) #define NUM_KEYWORDS (sizeof(Keywords)/sizeof(Keywords[0]))
@ -1573,5 +1575,5 @@ void TK_SkipLine(void)
{ {
char *sourcenow = tk_SourceName; char *sourcenow = tk_SourceName;
int linenow = tk_Line; int linenow = tk_Line;
do TK_NextToken(); while (tk_Line == linenow && tk_SourceName == sourcenow); do TK_NextToken(); while (tk_Line == linenow && tk_SourceName == sourcenow && tk_Token != TK_EOF);
} }

View file

@ -134,6 +134,8 @@ typedef enum
TK_STRCPY, // 'strcpy' TK_STRCPY, // 'strcpy'
TK_REGION, // 'region' [mxd] TK_REGION, // 'region' [mxd]
TK_ENDREGION, // 'endregion' [mxd] TK_ENDREGION, // 'endregion' [mxd]
TK_KILL, // 'kill' [JM]
TK_REOPEN, // 'reopen' [Nash]
} tokenType_t; } tokenType_t;
// PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- // PUBLIC FUNCTION PROTOTYPES ----------------------------------------------

View file

@ -291,6 +291,9 @@
#define APROP_StencilColor 41 #define APROP_StencilColor 41
#define APROP_Friction 42 #define APROP_Friction 42
#define APROP_DamageMultiplier 43 #define APROP_DamageMultiplier 43
#define APROP_MaxStepHeight 44
#define APROP_MaxDropOffHeight 45
#define APROP_DamageType 46
// Render Styles ------------------------------------------------------------ // Render Styles ------------------------------------------------------------
@ -366,6 +369,8 @@
#define MRF_UNDOBYDEATH 0x00000200 #define MRF_UNDOBYDEATH 0x00000200
#define MRF_UNDOBYDEATHFORCED 0x00000400 #define MRF_UNDOBYDEATHFORCED 0x00000400
#define MRF_UNDOBYDEATHSAVES 0x00000800 #define MRF_UNDOBYDEATHSAVES 0x00000800
#define MRF_UNDOALWAYS 0x00001000
#define MRF_TRANSFERTRANSLATION 0x00002000
// Shared spawnable things from Hexen. You can spawn these in the other ----- // Shared spawnable things from Hexen. You can spawn these in the other -----
// games if you provide sprites for them, otherwise they'll be invisible. --- // games if you provide sprites for them, otherwise they'll be invisible. ---
@ -1086,3 +1091,17 @@
#define WARPF_USEPTR 0x2000 #define WARPF_USEPTR 0x2000
#define WARPF_COPYVELOCITY 0x4000 #define WARPF_COPYVELOCITY 0x4000
#define WARPF_COPYPITCH 0x8000 #define WARPF_COPYPITCH 0x8000
#define CPXF_ANCESTOR (1 << 0)
#define CPXF_LESSOREQUAL (1 << 1)
#define CPXF_NOZ (1 << 2)
#define CPXF_COUNTDEAD (1 << 3)
#define CPXF_DEADONLY (1 << 4)
#define CPXF_EXACT (1 << 5)
#define CPXF_SETTARGET (1 << 6)
#define CPXF_SETMASTER (1 << 7)
#define CPXF_SETTRACER (1 << 8)
#define CPXF_FARTHEST (1 << 9)
#define CPXF_CLOSEST (1 << 10)
#define CPXF_SETONPTR (1 << 11)
#define CPXF_CHECKSIGHT (1 << 12)

View file

@ -24,12 +24,12 @@ special
17:Thing_Raise(1), 17:Thing_Raise(1),
18:StartConversation(1,2), 18:StartConversation(1,2),
19:Thing_Stop(1), 19:Thing_Stop(1),
20:Floor_LowerByValue(3), 20:Floor_LowerByValue(3,4),
21:Floor_LowerToLowest(2), 21:Floor_LowerToLowest(2,3),
22:Floor_LowerToNearest(2), 22:Floor_LowerToNearest(2,3),
23:Floor_RaiseByValue(3), 23:Floor_RaiseByValue(3,5),
24:Floor_RaiseToHighest(2), 24:Floor_RaiseToHighest(2,5),
25:Floor_RaiseToNearest(2), 25:Floor_RaiseToNearest(2,4),
26:Stairs_BuildDown(5), 26:Stairs_BuildDown(5),
27:Stairs_BuildUp(5), 27:Stairs_BuildUp(5),
28:Floor_RaiseAndCrush(3,4), 28:Floor_RaiseAndCrush(3,4),
@ -39,19 +39,19 @@ special
32:Stairs_BuildUpSync(4), 32:Stairs_BuildUpSync(4),
33:ForceField(0), 33:ForceField(0),
34:ClearForceField(1), 34:ClearForceField(1),
35:Floor_RaiseByValueTimes8(3), 35:Floor_RaiseByValueTimes8(3,5),
36:Floor_LowerByValueTimes8(3), 36:Floor_LowerByValueTimes8(3,4),
37:Floor_MoveToValue(3,4), 37:Floor_MoveToValue(3,5),
38:Ceiling_Waggle(5), 38:Ceiling_Waggle(5),
39:Teleport_ZombieChanger(2), 39:Teleport_ZombieChanger(2),
40:Ceiling_LowerByValue(3), 40:Ceiling_LowerByValue(3,4),
41:Ceiling_RaiseByValue(3), 41:Ceiling_RaiseByValue(3,4),
42:Ceiling_CrushAndRaise(3,4), 42:Ceiling_CrushAndRaise(3,4),
43:Ceiling_LowerAndCrush(3,4), 43:Ceiling_LowerAndCrush(3,4),
44:Ceiling_CrushStop(1), 44:Ceiling_CrushStop(1,2),
45:Ceiling_CrushRaiseAndStay(3,4), 45:Ceiling_CrushRaiseAndStay(3,4),
46:Floor_CrushStop(1), 46:Floor_CrushStop(1),
47:Ceiling_MoveToValue(3,4), 47:Ceiling_MoveToValue(3,5),
// 48:Sector_Attach3dMidtex // 48:Sector_Attach3dMidtex
49:GlassBreak(0,1), 49:GlassBreak(0,1),
// 50:ExtraFloor_LightOnly // 50:ExtraFloor_LightOnly
@ -65,15 +65,15 @@ special
// 58: Sector_CopyScroller // 58: Sector_CopyScroller
59:Polyobj_OR_MoveToSpot(3), 59:Polyobj_OR_MoveToSpot(3),
60:Plat_PerpetualRaise(3), 60:Plat_PerpetualRaise(3),
61:Plat_Stop(1), 61:Plat_Stop(1,2),
62:Plat_DownWaitUpStay(3), 62:Plat_DownWaitUpStay(3),
63:Plat_DownByValue(4), 63:Plat_DownByValue(4),
64:Plat_UpWaitDownStay(3), 64:Plat_UpWaitDownStay(3),
65:Plat_UpByValue(4), 65:Plat_UpByValue(4),
66:Floor_LowerInstant(3), 66:Floor_LowerInstant(3,4),
67:Floor_RaiseInstant(3), 67:Floor_RaiseInstant(3,5),
68:Floor_MoveToValueTimes8(4), 68:Floor_MoveToValueTimes8(4,5),
69:Ceiling_MoveToValueTimes8(4), 69:Ceiling_MoveToValueTimes8(4,5),
70:Teleport(1,3), 70:Teleport(1,3),
71:Teleport_NoFog(1,4), 71:Teleport_NoFog(1,4),
72:ThrustThing(2,4), 72:ThrustThing(2,4),
@ -109,6 +109,9 @@ special
// 102:Scroll_Texture_Up // 102:Scroll_Texture_Up
// 103:Scroll_Texture_Down // 103:Scroll_Texture_Down
104:Ceiling_CrushAndRaiseSilentDist(4,5), 104:Ceiling_CrushAndRaiseSilentDist(4,5),
105:Door_WaitRaise(4,5),
106:Door_WaitClose(3,4),
107:Line_SetPortalTarget(2),
109:Light_ForceLightning(1), 109:Light_ForceLightning(1),
110:Light_RaiseByValue(2), 110:Light_RaiseByValue(2),
@ -177,14 +180,14 @@ special
188:Sector_SetCeilingScale(5), 188:Sector_SetCeilingScale(5),
189:Sector_SetFloorScale(5), 189:Sector_SetFloorScale(5),
191:SetPlayerProperty(3), 191:SetPlayerProperty(3),
192:Ceiling_LowerToHighestFloor(2), 192:Ceiling_LowerToHighestFloor(2,5),
193:Ceiling_LowerInstant(3), 193:Ceiling_LowerInstant(3,5),
194:Ceiling_RaiseInstant(3), 194:Ceiling_RaiseInstant(3,4),
195:Ceiling_CrushRaiseAndStayA(4,5), 195:Ceiling_CrushRaiseAndStayA(4,5),
196:Ceiling_CrushAndRaiseA(4,5), 196:Ceiling_CrushAndRaiseA(4,5),
197:Ceiling_CrushAndRaiseSilentA(4,5), 197:Ceiling_CrushAndRaiseSilentA(4,5),
198:Ceiling_RaiseByValueTimes8(3), 198:Ceiling_RaiseByValueTimes8(3,4),
199:Ceiling_LowerByValueTimes8(3), 199:Ceiling_LowerByValueTimes8(3,4),
200:Generic_Floor(5), 200:Generic_Floor(5),
201:Generic_Ceiling(5), 201:Generic_Ceiling(5),
202:Generic_Door(5), 202:Generic_Door(5),
@ -223,9 +226,9 @@ special
235:Floor_TransferTrigger(1), 235:Floor_TransferTrigger(1),
236:Floor_TransferNumeric(1), 236:Floor_TransferNumeric(1),
237:ChangeCamera(3), 237:ChangeCamera(3),
238:Floor_RaiseToLowestCeiling(2), 238:Floor_RaiseToLowestCeiling(2,5),
239:Floor_RaiseByValueTxTy(3), 239:Floor_RaiseByValueTxTy(3),
240:Floor_RaiseByTexture(2), 240:Floor_RaiseByTexture(2,4),
241:Floor_LowerToLowestTxTy(2), 241:Floor_LowerToLowestTxTy(2),
242:Floor_LowerToHighest(3,4), 242:Floor_LowerToHighest(3,4),
243:Exit_Normal(1), 243:Exit_Normal(1),
@ -237,10 +240,31 @@ special
249:Door_CloseWaitOpen(3, 4), 249:Door_CloseWaitOpen(3, 4),
250:Floor_Donut(3), 250:Floor_Donut(3),
251:FloorAndCeiling_LowerRaise(3,4), 251:FloorAndCeiling_LowerRaise(3,4),
252:Ceiling_RaiseToNearest(2), 252:Ceiling_RaiseToNearest(2,3),
253:Ceiling_LowerToLowest(2), 253:Ceiling_LowerToLowest(2,4),
254:Ceiling_LowerToFloor(2), 254:Ceiling_LowerToFloor(2,5),
255:Ceiling_CrushRaiseAndStaySilA(4,5), 255:Ceiling_CrushRaiseAndStaySilA(4,5),
// These are specialized versions of the Generic_* specials which are defined for EE Extradata.
256:Floor_LowerToHighestEE(2, 3),
257:Floor_RaiseToLowest(2, 3),
258:Floor_LowerToLowestCeiling(2,3),
259:Floor_RaiseToCeiling(2, 5),
260:Floor_ToCeilingInstant(1, 4),
261:Floor_LowerByTexture(2, 3),
262:Ceiling_RaiseToHighest(2, 3),
263:Ceiling_ToHighestInstant(1, 3),
264:Ceiling_LowerToNearest(2, 4),
265:Ceiling_RaiseToLowest(2, 3),
266:Ceiling_RaiseToHighestFloor(2, 3),
267:Ceiling_ToFloorInstant(1, 4),
268:Ceiling_RaiseByTexture(2, 3),
269:Ceiling_LowerByTexture(2, 4),
270:Stairs_BuildDownDoom(5),
271:Stairs_BuildUpDoomSync(4),
272:Stairs_BuildDownDoomSync(4),
// internal functions have negative values // internal functions have negative values
-1:GetLineUDMFInt(2), -1:GetLineUDMFInt(2),
@ -334,12 +358,15 @@ special
-88:SetActorRoll(2), -88:SetActorRoll(2),
-89:ChangeActorRoll(2,3), -89:ChangeActorRoll(2,3),
-90:GetActorRoll(1), -90:GetActorRoll(1),
-91:QuakeEx(8,12), -91:QuakeEx(8,16),
-92:Warp(6,11), -92:Warp(6,11),
-93:GetMaxInventory(2), -93:GetMaxInventory(2),
-94:SetSectorDamage(2,5), -94:SetSectorDamage(2,5),
-95:SetSectorTerrain(3), -95:SetSectorTerrain(3),
-96:SpawnParticle(1,15), -96:SpawnParticle(1,16),
-97:SetMusicVolume(1),
-98:CheckProximity(3, 6),
-99:CheckActorState(2,3),
// Zandronum's // Zandronum's
-100:ResetMap(0), -100:ResetMap(0),
@ -369,6 +396,11 @@ special
-124:EndDBTransaction(0), -124:EndDBTransaction(0),
-125:GetDBEntries(1), -125:GetDBEntries(1),
// -1xx are reserved for Zandronum
-200:CheckClass(1),
-201:DamageActor(6), // [arookas]
-202:SetActorFlag(3),
// ZDaemon's // ZDaemon's
-19620:GetTeamScore(1), -19620:GetTeamScore(1),
-19621:SetTeamScore(2), -19621:SetTeamScore(2),