diff --git a/YAMS-LIB/Program.cs b/YAMS-LIB/Program.cs index e75daf5..530c4ac 100644 --- a/YAMS-LIB/Program.cs +++ b/YAMS-LIB/Program.cs @@ -596,6 +596,7 @@ public static void Main(string am2rPath, string outputAm2rPath, string jsonPath) // Multiworld stuff Multiworld.Apply(gmData, decompileContext, seedObject); + AddBossMWTracking.Apply(gmData, decompileContext, seedObject); // Write back to disk using (FileStream fs = new FileInfo(outputAm2rPath).OpenWrite()) diff --git a/YAMS-LIB/patches/AddBossMWTracking.cs b/YAMS-LIB/patches/AddBossMWTracking.cs new file mode 100644 index 0000000..30145cf --- /dev/null +++ b/YAMS-LIB/patches/AddBossMWTracking.cs @@ -0,0 +1,30 @@ +using UndertaleModLib; +using UndertaleModLib.Decompiler; +using UndertaleModLib.Models; + +namespace YAMS_LIB.patches; + +public class AddBossMWTracking +{ + public static void Apply(UndertaleData gmData, GlobalDecompileContext decompileContext, SeedObject seedObject) + { + // Guardian + gmData.Code.ByName("gml_Object_oBoss1Head_Step_0").ReplaceGMLInCode("sfx_play(sndBoss1Death)", "sfx_play(sndBoss1Death); global.collectedItems += \"Guardian|1,\"; send_location_and_inventory_packet();"); + gmData.Code.ByName("gml_Object_oBoss1Head_Collision_382").ReplaceGMLInCode("sfx_play(sndBoss1Death)", "sfx_play(sndBoss1Death); global.collectedItems += \"Guardian|1,\"; send_location_and_inventory_packet();"); + + // Arachnus + gmData.Code.ByName("gml_Object_oArachnus_Step_0").ReplaceGMLInCode("sfx_play(sndArachnusDeath)", "sfx_play(sndArachnusDeath); global.collectedItems += \"Arachnus|1,\"; send_location_and_inventory_packet();"); + + // Torizo + gmData.Code.ByName("gml_Object_oTorizo2_Step_0").ReplaceGMLInCode("sfx_play(sndTorizoDeath)", "{ sfx_play(sndTorizoDeath); global.collectedItems += \"Torizo|1,\"; send_location_and_inventory_packet(); }"); + + // Tester + gmData.Code.ByName("gml_Object_oTester_Step_0").ReplaceGMLInCode("sfx_play(sndTesterDeath)", "sfx_play(sndTesterDeath); global.collectedItems += \"Tester|1,\"; send_location_and_inventory_packet();"); + + // Serris + gmData.Code.ByName("gml_Object_oErisHead_Step_0").ReplaceGMLInCode("sfx_play(sndErisDeath)", "sfx_play(sndErisDeath); global.collectedItems += \"Serris|1,\"; send_location_and_inventory_packet();"); + + // Genesis + gmData.Code.ByName("gml_Object_oGenesis_Step_0").ReplaceGMLInCode("sfx_play(sndGenesisDeath)", "sfx_play(sndGenesisDeath); global.collectedItems += \"Genesis|1,\"; send_location_and_inventory_packet();"); + } +}