Skip to content

Commit

Permalink
Fix boss rooms closing when reentering them after boss dead
Browse files Browse the repository at this point in the history
Fixes #214
  • Loading branch information
Miepee committed Jul 11, 2024
1 parent 4219796 commit ba26e39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions YAMS-LIB/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public static void Main(string am2rPath, string outputAm2rPath, string jsonPath)
gmData.Code.ByName("gml_Object_oDoor_Alarm_0").ReplaceGMLInCode("event_user(2)",
"{ event_user(2); if(event > 0 && lock < 4) global.event[event] = 1; }");
// ...But don't make them automatically opened for non-ammo doors!
gmData.Code.ByName("gml_Object_oDoor_Alarm_0").ReplaceGMLInCode("lock = 0", "if (lock < 4) lock = 0;");
gmData.Code.ByName("gml_Object_oDoor_Alarm_0").ReplaceGMLInCode("lock = 0", "if (lock <= 4) lock = 0;");

// Make doors when unlocked, go to the type they were before except for ammo doors
gmData.Code.ByName("gml_Object_oDoor_Create_0").AppendGMLInCode("originalLock = lock;");
Expand All @@ -163,7 +163,7 @@ public static void Main(string am2rPath, string outputAm2rPath, string jsonPath)
gmData.Code.ByName("gml_Room_rm_a2a04_Create").AppendGMLInCode("if (!global.event[103]) {with (oDoor) lock = 4;}");
gmData.Code.ByName("gml_Room_rm_a3a01_Create").AppendGMLInCode("if (!global.event[152]) {with (oDoor) lock = 4;}");
gmData.Code.ByName("gml_Room_rm_a4a05_Create").AppendGMLInCode("if (!global.event[207]) {with (oDoor) lock = 4;}");
gmData.Code.ByName("gml_Object_oErisBossTrigger_Create_0").AppendGMLInCode("else { with (oDoor) lock = 4; }");
gmData.GameObjects.ByName("oErisBossTrigger").EventHandlerFor(EventType.Step, gmData).SubstituteGMLCode("with (oDoor) lock = 4;");
gmData.Code.ByName("gml_Room_rm_a8a11_Create").AppendGMLInCode("if (!global.event[307]) {with (oDoor) lock = 4;}");

// Fix doors in tester to be always blue
Expand Down

0 comments on commit ba26e39

Please sign in to comment.