From c94583d2ba54cd5331cf3a4aac3ba47ed770ff82 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 22 May 2024 19:09:26 -0400 Subject: Handle Progressive Red Grotto --- AnodyneArchipelago/ArchipelagoManager.cs | 4 ++++ AnodyneArchipelago/Plugin.cs | 36 ++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) (limited to 'AnodyneArchipelago') diff --git a/AnodyneArchipelago/ArchipelagoManager.cs b/AnodyneArchipelago/ArchipelagoManager.cs index 83e2d8d..c16978a 100644 --- a/AnodyneArchipelago/ArchipelagoManager.cs +++ b/AnodyneArchipelago/ArchipelagoManager.cs @@ -171,6 +171,10 @@ namespace AnodyneArchipelago { GlobalState.events.SetEvent("StatueMoved_Grotto", 1); } + else if (itemName == "Progressive Red Grotto") + { + GlobalState.events.IncEvent("ProgressiveRedGrotto"); + } } } } diff --git a/AnodyneArchipelago/Plugin.cs b/AnodyneArchipelago/Plugin.cs index e89595a..0bc372b 100644 --- a/AnodyneArchipelago/Plugin.cs +++ b/AnodyneArchipelago/Plugin.cs @@ -1,5 +1,6 @@ using AnodyneSharp; using AnodyneSharp.Entities; +using AnodyneSharp.Entities.Events; using AnodyneSharp.Entities.Gadget; using AnodyneSharp.Entities.Gadget.Treasures; using AnodyneSharp.Entities.Interactive; @@ -51,6 +52,12 @@ namespace AnodyneArchipelago { static void Prefix() { + // Handle Red Grotto stuff. + GlobalState.events.SetEvent("red_cave_l_ss", 999); + GlobalState.events.SetEvent("red_cave_n_ss", 999); + GlobalState.events.SetEvent("red_cave_r_ss", 999); + + // Connect to archipelago. Plugin.Instance.Log.LogInfo("Connecting to Archipelago!"); ArchipelagoManager.Connect("localhost:38281", "Anodyne", ""); @@ -124,10 +131,12 @@ namespace AnodyneArchipelago if (preset.Frame == 0) { ArchipelagoManager.SendLocation("Temple of the Seeing One - Green Key"); - } else if (preset.Frame == 1) + } + else if (preset.Frame == 1) { ArchipelagoManager.SendLocation("Red Grotto - Red Key"); - } else if (preset.Frame == 2) + } + else if (preset.Frame == 2) { ArchipelagoManager.SendLocation("Mountain Cavern - Blue Key"); } @@ -227,6 +236,29 @@ namespace AnodyneArchipelago __result.Position += Entity.FacingDirection(moveDir) * 32f; } + else if (__instance.Type.FullName.StartsWith("AnodyneSharp.Entities.Decorations.RedCave")) + { + string side = __instance.Type.FullName.Substring(41); + int requiredGrottos = 0; + if (side == "Left") + { + requiredGrottos = 1; + } + else if (side == "Right") + { + requiredGrottos = 2; + } + else if (side == "North") + { + requiredGrottos = 3; + } + + if (GlobalState.events.GetEvent("ProgressiveRedGrotto") < requiredGrottos) + { + __result.exists = false; + GlobalState.SpawnEntity((Entity)new DoorToggle(__result.Position, __result.width, __result.height)); + } + } } } } -- cgit 1.4.1