using System;
using BepInEx;
using BepInEx.Logging;
using JilloSlug.Features;
using JilloSlug.Story;

namespace JilloSlug;

[BepInPlugin(MOD_ID, "Jillo", "0.1.0")]
class Plugin : BaseUnityPlugin {
    private const string MOD_ID = "zone.oat.jilloslug";
    internal static ManualLogSource Log;

    public void OnEnable() {
        Plugin.Log = base.Logger;

        try {
            On.RainWorld.OnModsInit += Extras.WrapInit(LoadResources);

            BounceFeature.AddHooks();
            ImmuneToDartMaggotsFeature.AddHooks();
            MarkFeature.AddHooks();
            CreateSlimeMoldFeature.AddHooks();
            TweakDeathChanceFeature.AddHooks();

            Iterators.AddHooks();

            JilloSlimeMold.AddHooks();
        } catch (Exception err) {
            Logger.LogError($"error initializing: {err}");
        }

        Logger.LogInfo("initialized!");
    }

    // Load any resources, such as sprites or sounds
    private void LoadResources(RainWorld rainWorld) {
    }
}
