about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-05-22 18:23:49 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-05-22 18:23:49 -0400
commitcd85d485584ffb469f141db84334b60551f60c33 (patch)
treefe2938c43a1e92a0f503b6a19c0b4199df4f7e9e
parent3e2419680fa390353be0dc8fc53339817e842b7e (diff)
downloadanodyne-archipelago-cd85d485584ffb469f141db84334b60551f60c33.tar.gz
anodyne-archipelago-cd85d485584ffb469f141db84334b60551f60c33.tar.bz2
anodyne-archipelago-cd85d485584ffb469f141db84334b60551f60c33.zip
Added statue items
-rw-r--r--AnodyneArchipelago/ArchipelagoManager.cs14
-rw-r--r--AnodyneArchipelago/Plugin.cs36
2 files changed, 50 insertions, 0 deletions
diff --git a/AnodyneArchipelago/ArchipelagoManager.cs b/AnodyneArchipelago/ArchipelagoManager.cs index c10d6ee..83e2d8d 100644 --- a/AnodyneArchipelago/ArchipelagoManager.cs +++ b/AnodyneArchipelago/ArchipelagoManager.cs
@@ -1,4 +1,5 @@
1using AnodyneSharp.Entities; 1using AnodyneSharp.Entities;
2using AnodyneSharp.Entities.Enemy.Redcave;
2using AnodyneSharp.Registry; 3using AnodyneSharp.Registry;
3using Archipelago.MultiClient.Net; 4using Archipelago.MultiClient.Net;
4using Archipelago.MultiClient.Net.Enums; 5using Archipelago.MultiClient.Net.Enums;
@@ -157,6 +158,19 @@ namespace AnodyneArchipelago
157 { 158 {
158 GlobalState.inventory.HasTransformer = true; 159 GlobalState.inventory.HasTransformer = true;
159 } 160 }
161 else if (itemName == "Temple of the Seeing One Statue")
162 {
163 // TODO: This and the other two: move while on the same map.
164 GlobalState.events.SetEvent("StatueMoved_Temple", 1);
165 }
166 else if (itemName == "Mountain Cavern Statue")
167 {
168 GlobalState.events.SetEvent("StatueMoved_Mountain", 1);
169 }
170 else if (itemName == "Red Grotto Statue")
171 {
172 GlobalState.events.SetEvent("StatueMoved_Grotto", 1);
173 }
160 } 174 }
161 } 175 }
162} 176}
diff --git a/AnodyneArchipelago/Plugin.cs b/AnodyneArchipelago/Plugin.cs index d40da7c..e89595a 100644 --- a/AnodyneArchipelago/Plugin.cs +++ b/AnodyneArchipelago/Plugin.cs
@@ -9,6 +9,7 @@ using BepInEx;
9using BepInEx.NET.Common; 9using BepInEx.NET.Common;
10using HarmonyLib; 10using HarmonyLib;
11using HarmonyLib.Tools; 11using HarmonyLib.Tools;
12using Microsoft.Xna.Framework;
12using System; 13using System;
13using System.Collections; 14using System.Collections;
14using System.Collections.Generic; 15using System.Collections.Generic;
@@ -193,4 +194,39 @@ namespace AnodyneArchipelago
193 } 194 }
194 } 195 }
195 } 196 }
197
198 [HarmonyPatch(typeof(EntityPreset), nameof(EntityPreset.Create))]
199 class EntityPresetCreatePatch
200 {
201 static void Postfix(EntityPreset __instance, Entity __result)
202 {
203 if (__instance.Type.FullName == "AnodyneSharp.Entities.Interactive.DungeonStatue")
204 {
205 __result.Position = __instance.Position;
206
207 string eventName = "StatueMoved_";
208 Facing moveDir = Facing.RIGHT;
209 if (__instance.Frame == 0)
210 {
211 eventName += "Temple";
212 moveDir = Facing.UP;
213 }
214 else if (__instance.Frame == 1)
215 {
216 eventName += "Grotto";
217 }
218 else if (__instance.Frame == 2)
219 {
220 eventName += "Mountain";
221 }
222
223 if (GlobalState.events.GetEvent(eventName) == 0)
224 {
225 return;
226 }
227
228 __result.Position += Entity.FacingDirection(moveDir) * 32f;
229 }
230 }
231 }
196} 232}