From cd85d485584ffb469f141db84334b60551f60c33 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 22 May 2024 18:23:49 -0400 Subject: Added statue items --- AnodyneArchipelago/Plugin.cs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'AnodyneArchipelago/Plugin.cs') 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; using BepInEx.NET.Common; using HarmonyLib; using HarmonyLib.Tools; +using Microsoft.Xna.Framework; using System; using System.Collections; using System.Collections.Generic; @@ -193,4 +194,39 @@ namespace AnodyneArchipelago } } } + + [HarmonyPatch(typeof(EntityPreset), nameof(EntityPreset.Create))] + class EntityPresetCreatePatch + { + static void Postfix(EntityPreset __instance, Entity __result) + { + if (__instance.Type.FullName == "AnodyneSharp.Entities.Interactive.DungeonStatue") + { + __result.Position = __instance.Position; + + string eventName = "StatueMoved_"; + Facing moveDir = Facing.RIGHT; + if (__instance.Frame == 0) + { + eventName += "Temple"; + moveDir = Facing.UP; + } + else if (__instance.Frame == 1) + { + eventName += "Grotto"; + } + else if (__instance.Frame == 2) + { + eventName += "Mountain"; + } + + if (GlobalState.events.GetEvent(eventName) == 0) + { + return; + } + + __result.Position += Entity.FacingDirection(moveDir) * 32f; + } + } + } } -- cgit 1.4.1