using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using IronValiantNutcracker.Patches;
using RaccoonLib.Modules;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("IronValiantNutcracker")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IronValiantNutcracker")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5bfad06b-61c1-4c55-b506-0d0569bf26b6")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace IronValiantNutcracker
{
[BepInPlugin("Brew.IronValiantNutcracker", "IronValiantNutcracker", "1.0.0")]
public class IronValiantBase : BaseUnityPlugin
{
private const string modGUID = "Brew.IronValiantNutcracker";
private const string modName = "IronValiantNutcracker";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("Brew.IronValiantNutcracker");
public static IronValiantBase Instance;
internal ManualLogSource mls;
public static GameObject IV_Model;
public static BaseUnityPlugin plugin;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("Brew.IronValiantNutcracker");
plugin = (BaseUnityPlugin)(object)Instance;
mls.LogInfo((object)"Iron Valiant Nutcracker mod initialised");
string location = ((BaseUnityPlugin)Instance).Info.Location;
string text = "IronValiantNutcracker.dll";
string text2 = "ironvaliant";
AssetBundle val = ContentLoader.FetchAssetBundle((BaseUnityPlugin)(object)Instance, text, text2);
IV_Model = val.LoadAsset<GameObject>("Assets/AssetBundlesWanted/IronValiant 1.prefab");
Debug.Log((object)"Iron Valiant Nutcracker Model loaded");
harmony.PatchAll(typeof(IronValiantBase));
harmony.PatchAll(typeof(NutcrackerEnemyAIPatch));
}
}
}
namespace IronValiantNutcracker.Patches
{
[HarmonyPatch(typeof(NutcrackerEnemyAI))]
internal class NutcrackerEnemyAIPatch
{
private static GameObject IVM;
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void startPatch(NutcrackerEnemyAI __instance)
{
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
Debug.Log((object)"Iron Valiant has awoken");
GameObject val = EnemyReskinner.ReskinNutcracker(__instance, IronValiantBase.IV_Model);
if (Object.op_Implicit((Object)(object)val))
{
GameObject gameObject = ((Component)val.transform.Find("Model")).gameObject;
val.transform.localPosition = new Vector3(0f, 0f, 0f);
gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
gameObject.transform.localScale = new Vector3(2.7f, 2.7f, 2.7f);
IVM = gameObject;
}
}
}
}