using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Fields;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("bitmotte.MauriceLegger")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+041286168f30730b9958ec6ac799938ebfd6aa5f")]
[assembly: AssemblyProduct("MauriceLegger")]
[assembly: AssemblyTitle("bitmotte.MauriceLegger")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace MauriceLegger
{
public static class AccessibleConfigs
{
public static float legSpeed = 128f;
public static bool legacyRun = false;
public static bool sit = true;
public static bool armLegs = true;
public static bool realArms = true;
public static bool mauriceLegs = true;
public static bool thighs = true;
}
public static class MauriceConfigurator
{
[CompilerGenerated]
private static class <>O
{
public static PostFloatValueChangeEvent <0>__UpdateLegSpeed;
public static PostBoolValueChangeEvent <1>__UpdateSit;
public static PostBoolValueChangeEvent <2>__UpdateArms;
public static PostBoolValueChangeEvent <3>__UpdateMaurice;
public static PostBoolValueChangeEvent <4>__UpdateThighs;
public static PostBoolValueChangeEvent <5>__UpdateRealArms;
}
public static PluginConfigurator CreateConfigurator()
{
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Expected O, but got Unknown
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Expected O, but got Unknown
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Expected O, but got Unknown
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Expected O, but got Unknown
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Expected O, but got Unknown
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Expected O, but got Unknown
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Expected O, but got Unknown
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Expected O, but got Unknown
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Expected O, but got Unknown
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_017f: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Expected O, but got Unknown
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Expected O, but got Unknown
//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Expected O, but got Unknown
PluginConfigurator val = PluginConfigurator.Create("MauriceLegger", "bitmotte.MauriceLegger");
Texture2D val2 = LoadPNG(Pathing.GetPluginPath() + "/DONTDELETE_icon.png");
Sprite image = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f), 100f);
val.image = image;
FloatField val3 = new FloatField(val.rootPanel, "Leg Speed", "mleg.legspeed", 128f);
BoolField val4 = new BoolField(val.rootPanel, "Sit when near ground", "mleg.sit", true);
ConfigPanel val5 = new ConfigPanel(val.rootPanel, "Secret Variations", "mleg.secretvars");
BoolField val6 = new BoolField(val5, "Arm Legs", "mleg.arms", true);
BoolField val7 = new BoolField(val5, "Maurice Legs", "mleg.maurice", true);
BoolField val8 = new BoolField(val5, "Thigh Highs", "mleg.thighs", true);
BoolField val9 = new BoolField(val5, "Arms", "mleg.real_arms", true);
object obj = <>O.<0>__UpdateLegSpeed;
if (obj == null)
{
PostFloatValueChangeEvent val10 = UpdateLegSpeed;
<>O.<0>__UpdateLegSpeed = val10;
obj = (object)val10;
}
val3.postValueChangeEvent += (PostFloatValueChangeEvent)obj;
object obj2 = <>O.<1>__UpdateSit;
if (obj2 == null)
{
PostBoolValueChangeEvent val11 = UpdateSit;
<>O.<1>__UpdateSit = val11;
obj2 = (object)val11;
}
val4.postValueChangeEvent += (PostBoolValueChangeEvent)obj2;
object obj3 = <>O.<2>__UpdateArms;
if (obj3 == null)
{
PostBoolValueChangeEvent val12 = UpdateArms;
<>O.<2>__UpdateArms = val12;
obj3 = (object)val12;
}
val6.postValueChangeEvent += (PostBoolValueChangeEvent)obj3;
object obj4 = <>O.<3>__UpdateMaurice;
if (obj4 == null)
{
PostBoolValueChangeEvent val13 = UpdateMaurice;
<>O.<3>__UpdateMaurice = val13;
obj4 = (object)val13;
}
val7.postValueChangeEvent += (PostBoolValueChangeEvent)obj4;
object obj5 = <>O.<4>__UpdateThighs;
if (obj5 == null)
{
PostBoolValueChangeEvent val14 = UpdateThighs;
<>O.<4>__UpdateThighs = val14;
obj5 = (object)val14;
}
val8.postValueChangeEvent += (PostBoolValueChangeEvent)obj5;
object obj6 = <>O.<5>__UpdateRealArms;
if (obj6 == null)
{
PostBoolValueChangeEvent val15 = UpdateRealArms;
<>O.<5>__UpdateRealArms = val15;
obj6 = (object)val15;
}
val9.postValueChangeEvent += (PostBoolValueChangeEvent)obj6;
val3.TriggerPostValueChangeEvent();
val4.TriggerPostValueChangeEvent();
val6.TriggerPostValueChangeEvent();
val7.TriggerPostValueChangeEvent();
val8.TriggerPostValueChangeEvent();
val9.TriggerPostValueChangeEvent();
return val;
}
private static void UpdateLegSpeed(float value)
{
Plugin.Logger.LogInfo((object)$"Update leg speed to {value}! ! ! ! ! !");
AccessibleConfigs.legSpeed = value;
}
private static void UpdateRealArms(bool value)
{
Plugin.Logger.LogInfo((object)$"Update real arms to {value}! ! ! ! ! !");
AccessibleConfigs.realArms = value;
}
private static void UpdateSit(bool value)
{
Plugin.Logger.LogInfo((object)$"Update sit to {value}! ! ! ! ! !");
AccessibleConfigs.sit = value;
}
private static void UpdateArms(bool value)
{
Plugin.Logger.LogInfo((object)$"Update arm legs to {value}! ! ! ! ! !");
AccessibleConfigs.armLegs = value;
}
private static void UpdateMaurice(bool value)
{
Plugin.Logger.LogInfo((object)$"Update maurice legs to {value}! ! ! ! ! !");
AccessibleConfigs.mauriceLegs = value;
}
private static void UpdateThighs(bool value)
{
Plugin.Logger.LogInfo((object)$"Update thigh highs to {value}! ! ! ! ! !");
AccessibleConfigs.thighs = value;
}
public static Texture2D LoadPNG(string filePath)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
Texture2D val = null;
if (File.Exists(filePath))
{
byte[] array = File.ReadAllBytes(filePath);
val = new Texture2D(2, 2);
ImageConversion.LoadImage(val, array);
}
return val;
}
}
[HarmonyPatch(typeof(SpiderBody), "Awake")]
public class MauriceDeathPatch : MonoBehaviour
{
[HarmonyPatch(typeof(SpiderBody), "Enrage")]
public class MauriceEnragePatch : MonoBehaviour
{
private static void Postfix(SpiderBody __instance)
{
EnemySimplifier component = ((Component)((Component)__instance).transform.GetChild(3).GetChild(0)).GetComponent<EnemySimplifier>();
component.ChangeMaterialNew((MaterialState)2, component.enragedMaterial);
}
}
[HarmonyPatch(typeof(SpiderBody), "UnEnrage")]
public class MauriceUnEnragePatch : MonoBehaviour
{
private static void Postfix(SpiderBody __instance)
{
EnemySimplifier component = ((Component)((Component)__instance).transform.GetChild(3).GetChild(0)).GetComponent<EnemySimplifier>();
component.ChangeMaterialNew((MaterialState)0, component.originalMaterial);
}
}
[HarmonyPatch(typeof(SpiderBody), "GetHurt")]
public class MauriceWoundPatch : MonoBehaviour
{
private static void Postfix(SpiderBody __instance)
{
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Expected O, but got Unknown
//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01e3: Expected O, but got Unknown
EnemyIdentifier component = ((Component)__instance).GetComponent<EnemyIdentifier>();
if (component.dead)
{
return;
}
Traverse val = Traverse.Create((object)__instance);
float num = (float)val.Field("health").GetValue();
float num2 = (float)val.Field("maxHealth").GetValue();
GameObject gameObject = ((Component)((Component)__instance).transform.GetChild(3)).gameObject;
FollowSpeed component2 = gameObject.GetComponent<FollowSpeed>();
bool wounded = component2.wounded;
if (num < num2 / 2f && !wounded)
{
Shader shader = ((Renderer)((Component)((Component)__instance).transform.GetChild(0).GetChild(5)).GetComponent<SkinnedMeshRenderer>()).material.shader;
SkinnedMeshRenderer component3 = ((Component)gameObject.transform.GetChild(0)).GetComponent<SkinnedMeshRenderer>();
Mesh sharedMesh = ((Component)LoadBundle.legsDamaged.transform.GetChild(0)).GetComponent<SkinnedMeshRenderer>().sharedMesh;
if (component2.special != 0)
{
EnemySimplifier component4 = ((Component)gameObject.transform.GetChild(0)).gameObject.GetComponent<EnemySimplifier>();
((Renderer)component3).material = component4.originalMaterial;
return;
}
component3.sharedMesh = sharedMesh;
Material val2 = new Material(shader)
{
mainTexture = (Texture)(object)LoadBundle.texDamaged
};
val2.EnableKeyword("ENEMY");
val2.EnableKeyword("VERTEX_LIGHTING");
val2.EnableKeyword("_FOG_ON");
val2.EnableKeyword("_USEALBEDOASEMISSIVE_ON");
val2.EnableKeyword("_VERTEXCOLORS_ON");
val2.EnableKeyword("_VERTEXLIGHTING_ON");
val2.EnableKeyword("_ZWRITE_ON");
((Renderer)component3).material = val2;
EnemySimplifier component5 = ((Component)gameObject.transform.GetChild(0)).gameObject.GetComponent<EnemySimplifier>();
component5.originalMaterial = val2;
component5.simplifiedMaterial = val2;
Material val3 = new Material(shader)
{
mainTexture = (Texture)(object)LoadBundle.texEnragedDamaged
};
val3.EnableKeyword("ENEMY");
val3.EnableKeyword("VERTEX_LIGHTING");
val3.EnableKeyword("_FOG_ON");
val3.EnableKeyword("_USEALBEDOASEMISSIVE_ON");
val3.EnableKeyword("_VERTEXCOLORS_ON");
val3.EnableKeyword("_VERTEXLIGHTING_ON");
val3.EnableKeyword("_ZWRITE_ON");
component5.enragedMaterial = val3;
component5.enragedSimplifiedMaterial = val3;
FollowSpeed component6 = gameObject.GetComponent<FollowSpeed>();
component6.wounded = true;
((Component)gameObject.transform.GetChild(0)).gameObject.layer = 25;
}
}
}
[HarmonyPatch(typeof(SpiderBody), "Die")]
public class MauriceBallerDeathPatch : MonoBehaviour
{
private static void Prefix(SpiderBody __instance)
{
FollowSpeed component = ((Component)((Component)__instance).transform.GetChild(3)).GetComponent<FollowSpeed>();
component.setRot = false;
((Component)((Component)component).transform.GetChild(1).GetChild(0).GetChild(2)).gameObject.GetComponent<SitDetector>().Disable();
}
}
private static void Prefix(SpiderBody __instance)
{
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: 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_0075: Expected O, but got Unknown
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_022e: Unknown result type (might be due to invalid IL or missing references)
//IL_0272: Unknown result type (might be due to invalid IL or missing references)
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_0282: Expected O, but got Unknown
//IL_0314: Unknown result type (might be due to invalid IL or missing references)
//IL_0319: Unknown result type (might be due to invalid IL or missing references)
//IL_0324: Expected O, but got Unknown
LineRenderer[] componentsInChildren = ((Component)((Component)__instance).transform.parent).GetComponentsInChildren<LineRenderer>();
Color val = default(Color);
((Color)(ref val))..ctor(0f, 0f, 0f, 0f);
LineRenderer[] array = componentsInChildren;
foreach (LineRenderer val2 in array)
{
val2.startColor = val;
val2.endColor = val;
}
Random random = new Random();
int num = random.Next(100);
GameObject val3 = new GameObject();
Specials specials = Specials.normal;
Texture2D texHealthy = LoadBundle.texHealthy;
Texture2D texEnraged = LoadBundle.texEnraged;
switch (num)
{
case 0:
if (!AccessibleConfigs.armLegs)
{
val3 = LoadBundle.legs;
specials = Specials.normal;
texHealthy = LoadBundle.texHealthy;
texEnraged = LoadBundle.texEnraged;
}
else
{
val3 = LoadBundle.arms;
specials = Specials.arms;
texHealthy = LoadBundle.texHealthy;
texEnraged = LoadBundle.texEnraged;
}
break;
case 1:
if (!AccessibleConfigs.mauriceLegs)
{
val3 = LoadBundle.legs;
specials = Specials.normal;
texHealthy = LoadBundle.texHealthy;
texEnraged = LoadBundle.texEnraged;
}
else
{
val3 = LoadBundle.maurice;
specials = Specials.maurice;
texHealthy = LoadBundle.texMaurice;
texEnraged = LoadBundle.texEnragedMaurice;
}
break;
case 2:
if (!AccessibleConfigs.thighs)
{
val3 = LoadBundle.legs;
specials = Specials.normal;
texHealthy = LoadBundle.texHealthy;
texEnraged = LoadBundle.texEnraged;
}
else
{
val3 = LoadBundle.legs;
specials = Specials.thighs;
texHealthy = LoadBundle.texThighs;
texEnraged = LoadBundle.texThighsEnraged;
}
break;
case 3:
if (!AccessibleConfigs.realArms)
{
val3 = LoadBundle.legs;
specials = Specials.normal;
texHealthy = LoadBundle.texHealthy;
texEnraged = LoadBundle.texEnraged;
}
else
{
val3 = LoadBundle.realArms;
specials = Specials.realArms;
texHealthy = LoadBundle.texHealthy;
texEnraged = LoadBundle.texEnraged;
}
break;
default:
val3 = LoadBundle.legs;
specials = Specials.normal;
texHealthy = LoadBundle.texHealthy;
texEnraged = LoadBundle.texEnraged;
break;
}
GameObject val4 = Object.Instantiate<GameObject>(val3);
val4.transform.parent = ((Component)__instance).transform;
val4.transform.localPosition = new Vector3(0f, -0.96f, 0f);
val4.transform.localScale = new Vector3(0.1f, 0.12f, 0.1f);
Shader shader = ((Renderer)((Component)((Component)__instance).transform.GetChild(0).GetChild(5)).GetComponent<SkinnedMeshRenderer>()).material.shader;
SkinnedMeshRenderer component = ((Component)val4.transform.GetChild(0)).GetComponent<SkinnedMeshRenderer>();
Material val5 = new Material(shader)
{
mainTexture = (Texture)(object)texHealthy
};
val5.EnableKeyword("ENEMY");
val5.EnableKeyword("VERTEX_LIGHTING");
val5.EnableKeyword("_FOG_ON");
val5.EnableKeyword("_USEALBEDOASEMISSIVE_ON");
val5.EnableKeyword("_VERTEXCOLORS_ON");
val5.EnableKeyword("_VERTEXLIGHTING_ON");
val5.EnableKeyword("_ZWRITE_ON");
((Renderer)component).material = val5;
EnemySimplifier val6 = ((Component)val4.transform.GetChild(0)).gameObject.AddComponent<EnemySimplifier>();
val6.originalMaterial = val5;
val6.simplifiedMaterial = val5;
Material val7 = new Material(shader)
{
mainTexture = (Texture)(object)texEnraged
};
val7.EnableKeyword("ENEMY");
val7.EnableKeyword("VERTEX_LIGHTING");
val7.EnableKeyword("_FOG_ON");
val7.EnableKeyword("_USEALBEDOASEMISSIVE_ON");
val7.EnableKeyword("_VERTEXCOLORS_ON");
val7.EnableKeyword("_VERTEXLIGHTING_ON");
val7.EnableKeyword("_ZWRITE_ON");
val6.enragedMaterial = val7;
val6.enragedSimplifiedMaterial = val7;
FollowSpeed followSpeed = val4.AddComponent<FollowSpeed>();
followSpeed.follow = ((Component)__instance).gameObject;
followSpeed.special = specials;
((Component)val4.transform.GetChild(0)).gameObject.layer = 25;
GameObject[] targets = (GameObject[])(object)new GameObject[2]
{
((Component)((Component)__instance).transform.GetChild(0).GetChild(5)).gameObject,
((Component)val4.transform.GetChild(0)).gameObject
};
if ((Object)(object)((Component)__instance).GetComponentInChildren<OutdoorsChecker>() != (Object)null)
{
OutdoorsChecker componentInChildren = ((Component)__instance).GetComponentInChildren<OutdoorsChecker>();
componentInChildren.targets = targets;
}
}
}
public class FollowSpeed : MonoBehaviour
{
public GameObject follow;
public bool wounded;
public Specials special;
public bool setRot = true;
private Animator animator;
private Vector3 prevPos = new Vector3(0f, 0f, 0f);
private float legSpeed;
private Transform childOffsetters;
private Transform baseBone;
private Vector3 offset;
private void Awake()
{
animator = ((Component)this).GetComponent<Animator>();
legSpeed = AccessibleConfigs.legSpeed;
SlowUpdate();
childOffsetters = ((Component)this).transform.parent.GetChild(0);
baseBone = ((Component)this).transform.GetChild(1).GetChild(0);
SitDetector sitDetector = ((Component)((Component)this).transform.GetChild(1).GetChild(0).GetChild(2)).gameObject.AddComponent<SitDetector>();
sitDetector.animator = animator;
}
private void Update()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
animator.speed = Vector3.Distance(prevPos, follow.transform.position) * legSpeed;
if (setRot)
{
((Component)this).transform.eulerAngles = new Vector3(0f, follow.transform.GetChild(0).eulerAngles.y, 0f);
}
Vector3 val = offset;
Transform obj = childOffsetters;
obj.position -= val;
offset = baseBone.position - childOffsetters.position;
Transform obj2 = childOffsetters;
obj2.position += offset;
prevPos = follow.transform.position;
}
private void SlowUpdate()
{
((MonoBehaviour)this).Invoke("SlowUpdate", 1f);
if (!setRot)
{
legSpeed = AccessibleConfigs.legSpeed / 4f;
return;
}
legSpeed = AccessibleConfigs.legSpeed;
if (AccessibleConfigs.legacyRun)
{
animator.SetBoolString("legacy_run", true);
}
else
{
animator.SetBoolString("legacy_run", false);
}
}
}
public class SitDetector : MonoBehaviour
{
private bool disable;
public Animator animator;
public void OnTriggerEnter(Collider other)
{
if (!disable && AccessibleConfigs.sit)
{
animator.SetBoolString("sitting", true);
}
}
public void OnTriggerExit(Collider other)
{
if (!disable)
{
animator.SetBoolString("sitting", false);
}
}
public void Disable()
{
disable = true;
animator.SetBoolString("sitting", false);
}
}
public enum Specials
{
normal,
arms,
maurice,
thighs,
realArms
}
[BepInPlugin("bitmotte.MauriceLegger", "MauriceLegger", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Logger;
public static PluginConfigurator config;
private void Awake()
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
Logger = ((BaseUnityPlugin)this).Logger;
Logger.LogInfo((object)"Plugin bitmotte.MauriceLegger is loaded!");
Harmony val = new Harmony("bitmotte.MauriceLegger");
val.PatchAll();
config = MauriceConfigurator.CreateConfigurator();
SceneManager.sceneLoaded += OnSceneLoad;
}
public static void OnSceneLoad(Scene scene, LoadSceneMode mode)
{
LoadBundle.Load();
}
}
public static class LoadBundle
{
public static GameObject legs;
public static Texture2D texHealthy;
public static Texture2D texEnraged;
public static GameObject legsDamaged;
public static Texture2D texDamaged;
public static Texture2D texEnragedDamaged;
public static GameObject arms;
public static GameObject realArms;
public static GameObject maurice;
public static Texture2D texMaurice;
public static Texture2D texEnragedMaurice;
public static Texture2D texThighs;
public static Texture2D texThighsEnraged;
public static void Load()
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Expected O, but got Unknown
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Expected O, but got Unknown
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Expected O, but got Unknown
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Expected O, but got Unknown
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Expected O, but got Unknown
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Expected O, but got Unknown
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Expected O, but got Unknown
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Expected O, but got Unknown
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Expected O, but got Unknown
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Expected O, but got Unknown
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Expected O, but got Unknown
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Expected O, but got Unknown
AssetBundle val = AssetBundle.LoadFromFile(Pathing.GetPluginPath() + "/leg.bundle");
legs = (GameObject)val.LoadAsset("Assets/legs.prefab");
texHealthy = (Texture2D)val.LoadAsset("Assets/T_Cerberus.png");
texEnraged = (Texture2D)val.LoadAsset("Assets/T_CerberusEnraged.png");
legsDamaged = (GameObject)val.LoadAsset("Assets/legs_cracked.prefab");
texDamaged = (Texture2D)val.LoadAsset("Assets/T_Cerberus_Damaged.png");
texEnragedDamaged = (Texture2D)val.LoadAsset("Assets/T_CerberusEnragedDamaged.png");
maurice = (GameObject)val.LoadAsset("Assets/maurice.prefab");
texMaurice = (Texture2D)val.LoadAsset("Assets/T_MaliciousFace.png");
texEnragedMaurice = (Texture2D)val.LoadAsset("Assets/T_MaliciousFaceEnraged.png");
texThighs = (Texture2D)val.LoadAsset("Assets/T_CerberusThighs.png");
texThighsEnraged = (Texture2D)val.LoadAsset("Assets/T_CerberusThighsEnraged.png");
arms = (GameObject)val.LoadAsset("Assets/arms.prefab");
realArms = (GameObject)val.LoadAsset("Assets/real-arms.prefab");
val.Unload(false);
}
}
public static class Pathing
{
public static string GetPluginPath()
{
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uriBuilder = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uriBuilder.Path);
return Path.GetDirectoryName(path);
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "bitmotte.MauriceLegger";
public const string PLUGIN_NAME = "MauriceLegger";
public const string PLUGIN_VERSION = "1.0.0";
}
}