diff options
-rw-r--r-- | AnodyneArchipelago/ArchipelagoManager.cs | 14 | ||||
-rw-r--r-- | AnodyneArchipelago/Plugin.cs | 36 |
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 @@ | |||
1 | using AnodyneSharp.Entities; | 1 | using AnodyneSharp.Entities; |
2 | using AnodyneSharp.Entities.Enemy.Redcave; | ||
2 | using AnodyneSharp.Registry; | 3 | using AnodyneSharp.Registry; |
3 | using Archipelago.MultiClient.Net; | 4 | using Archipelago.MultiClient.Net; |
4 | using Archipelago.MultiClient.Net.Enums; | 5 | using 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; | |||
9 | using BepInEx.NET.Common; | 9 | using BepInEx.NET.Common; |
10 | using HarmonyLib; | 10 | using HarmonyLib; |
11 | using HarmonyLib.Tools; | 11 | using HarmonyLib.Tools; |
12 | using Microsoft.Xna.Framework; | ||
12 | using System; | 13 | using System; |
13 | using System.Collections; | 14 | using System.Collections; |
14 | using System.Collections.Generic; | 15 | using 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 | } |