diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-22 19:09:26 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-22 19:09:26 -0400 |
commit | c94583d2ba54cd5331cf3a4aac3ba47ed770ff82 (patch) | |
tree | d6fa7e49b3e6ba0481f6dac250535ec8a9a8c122 /AnodyneArchipelago | |
parent | cd85d485584ffb469f141db84334b60551f60c33 (diff) | |
download | anodyne-archipelago-c94583d2ba54cd5331cf3a4aac3ba47ed770ff82.tar.gz anodyne-archipelago-c94583d2ba54cd5331cf3a4aac3ba47ed770ff82.tar.bz2 anodyne-archipelago-c94583d2ba54cd5331cf3a4aac3ba47ed770ff82.zip |
Handle Progressive Red Grotto
Diffstat (limited to 'AnodyneArchipelago')
-rw-r--r-- | AnodyneArchipelago/ArchipelagoManager.cs | 4 | ||||
-rw-r--r-- | AnodyneArchipelago/Plugin.cs | 36 |
2 files changed, 38 insertions, 2 deletions
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 | |||
171 | { | 171 | { |
172 | GlobalState.events.SetEvent("StatueMoved_Grotto", 1); | 172 | GlobalState.events.SetEvent("StatueMoved_Grotto", 1); |
173 | } | 173 | } |
174 | else if (itemName == "Progressive Red Grotto") | ||
175 | { | ||
176 | GlobalState.events.IncEvent("ProgressiveRedGrotto"); | ||
177 | } | ||
174 | } | 178 | } |
175 | } | 179 | } |
176 | } | 180 | } |
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 @@ | |||
1 | using AnodyneSharp; | 1 | using AnodyneSharp; |
2 | using AnodyneSharp.Entities; | 2 | using AnodyneSharp.Entities; |
3 | using AnodyneSharp.Entities.Events; | ||
3 | using AnodyneSharp.Entities.Gadget; | 4 | using AnodyneSharp.Entities.Gadget; |
4 | using AnodyneSharp.Entities.Gadget.Treasures; | 5 | using AnodyneSharp.Entities.Gadget.Treasures; |
5 | using AnodyneSharp.Entities.Interactive; | 6 | using AnodyneSharp.Entities.Interactive; |
@@ -51,6 +52,12 @@ namespace AnodyneArchipelago | |||
51 | { | 52 | { |
52 | static void Prefix() | 53 | static void Prefix() |
53 | { | 54 | { |
55 | // Handle Red Grotto stuff. | ||
56 | GlobalState.events.SetEvent("red_cave_l_ss", 999); | ||
57 | GlobalState.events.SetEvent("red_cave_n_ss", 999); | ||
58 | GlobalState.events.SetEvent("red_cave_r_ss", 999); | ||
59 | |||
60 | // Connect to archipelago. | ||
54 | Plugin.Instance.Log.LogInfo("Connecting to Archipelago!"); | 61 | Plugin.Instance.Log.LogInfo("Connecting to Archipelago!"); |
55 | 62 | ||
56 | ArchipelagoManager.Connect("localhost:38281", "Anodyne", ""); | 63 | ArchipelagoManager.Connect("localhost:38281", "Anodyne", ""); |
@@ -124,10 +131,12 @@ namespace AnodyneArchipelago | |||
124 | if (preset.Frame == 0) | 131 | if (preset.Frame == 0) |
125 | { | 132 | { |
126 | ArchipelagoManager.SendLocation("Temple of the Seeing One - Green Key"); | 133 | ArchipelagoManager.SendLocation("Temple of the Seeing One - Green Key"); |
127 | } else if (preset.Frame == 1) | 134 | } |
135 | else if (preset.Frame == 1) | ||
128 | { | 136 | { |
129 | ArchipelagoManager.SendLocation("Red Grotto - Red Key"); | 137 | ArchipelagoManager.SendLocation("Red Grotto - Red Key"); |
130 | } else if (preset.Frame == 2) | 138 | } |
139 | else if (preset.Frame == 2) | ||
131 | { | 140 | { |
132 | ArchipelagoManager.SendLocation("Mountain Cavern - Blue Key"); | 141 | ArchipelagoManager.SendLocation("Mountain Cavern - Blue Key"); |
133 | } | 142 | } |
@@ -227,6 +236,29 @@ namespace AnodyneArchipelago | |||
227 | 236 | ||
228 | __result.Position += Entity.FacingDirection(moveDir) * 32f; | 237 | __result.Position += Entity.FacingDirection(moveDir) * 32f; |
229 | } | 238 | } |
239 | else if (__instance.Type.FullName.StartsWith("AnodyneSharp.Entities.Decorations.RedCave")) | ||
240 | { | ||
241 | string side = __instance.Type.FullName.Substring(41); | ||
242 | int requiredGrottos = 0; | ||
243 | if (side == "Left") | ||
244 | { | ||
245 | requiredGrottos = 1; | ||
246 | } | ||
247 | else if (side == "Right") | ||
248 | { | ||
249 | requiredGrottos = 2; | ||
250 | } | ||
251 | else if (side == "North") | ||
252 | { | ||
253 | requiredGrottos = 3; | ||
254 | } | ||
255 | |||
256 | if (GlobalState.events.GetEvent("ProgressiveRedGrotto") < requiredGrottos) | ||
257 | { | ||
258 | __result.exists = false; | ||
259 | GlobalState.SpawnEntity((Entity)new DoorToggle(__result.Position, __result.width, __result.height)); | ||
260 | } | ||
261 | } | ||
230 | } | 262 | } |
231 | } | 263 | } |
232 | } | 264 | } |