Page 1 of 1

[MOD] Arachnophobia mod

Posted: Fri Oct 28, 2022 11:41 am
by seehofer
yeah, as the title says. removes potential spiders.
needs melonloader with my patch, see the freecam for instructions and links
get it here
Aragone.zip
(2.28 KiB) Downloaded 299 times
have fun all

code:
Spoiler

Code: Select all

using MelonLoader;
using UnityEngine;

[assembly: MelonInfo(typeof(Aragone.AragoneMod), "Aragone", "1.1.0", "Lenny")]
[assembly: MelonGame("Eek", "House Party")]

namespace Aragone
{
    public class AragoneMod : MelonMod
    {
        bool spiderRemoved = false;
        bool inGameMain = false;

        public override void OnSceneWasInitialized(int buildIndex, string sceneName)
        {
            inGameMain = sceneName == "GameMain";
        }

        public override void OnUpdate()
        {
            if (!spiderRemoved && inGameMain)
            {
                foreach (var item in Object.FindObjectsOfType<GameObject>())
                {
                    if ($"{item.name}" == "SpiderDecoration_Prefab")
                    {
                        Object.DestroyImmediate(item);
                        MelonLogger.Msg("Spider removed");
                        spiderRemoved = true;
                        break;
                    }
                }
            }
        }
    }
}