diff options
Diffstat (limited to 'AnodyneArchipelago/Plugin.cs')
-rw-r--r-- | AnodyneArchipelago/Plugin.cs | 36 |
1 files changed, 36 insertions, 0 deletions
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 | } |