about summary refs log tree commit diff stats
path: root/AnodyneArchipelago/Plugin.cs
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 /AnodyneArchipelago/Plugin.cs
parent3e2419680fa390353be0dc8fc53339817e842b7e (diff)
downloadanodyne-archipelago-cd85d485584ffb469f141db84334b60551f60c33.tar.gz
anodyne-archipelago-cd85d485584ffb469f141db84334b60551f60c33.tar.bz2
anodyne-archipelago-cd85d485584ffb469f141db84334b60551f60c33.zip
Added statue items
Diffstat (limited to 'AnodyneArchipelago/Plugin.cs')
-rw-r--r--AnodyneArchipelago/Plugin.cs36
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;
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}