about summary refs log tree commit diff stats
path: root/AnodyneArchipelago
diff options
context:
space:
mode:
Diffstat (limited to 'AnodyneArchipelago')
-rw-r--r--AnodyneArchipelago/ArchipelagoManager.cs4
-rw-r--r--AnodyneArchipelago/Plugin.cs36
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 @@
1using AnodyneSharp; 1using AnodyneSharp;
2using AnodyneSharp.Entities; 2using AnodyneSharp.Entities;
3using AnodyneSharp.Entities.Events;
3using AnodyneSharp.Entities.Gadget; 4using AnodyneSharp.Entities.Gadget;
4using AnodyneSharp.Entities.Gadget.Treasures; 5using AnodyneSharp.Entities.Gadget.Treasures;
5using AnodyneSharp.Entities.Interactive; 6using 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}