using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Web; using AtlyssCommandLib.API; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CodeTalker.Networking; using CodeTalker.Packets; using GLTFast; using GLTFast.Loading; using GLTFast.Logging; using GLTFast.Materials; using HarmonyLib; using Homebrewery.Code; using Homebrewery.Code.Commands; using Homebrewery.Code.Component; using Homebrewery.Code.Config; using Homebrewery.Code.Content; using Homebrewery.Code.Content.Assets; using Homebrewery.Code.Content.Items; using Homebrewery.Code.Content.Parts; using Homebrewery.Code.Enums; using Homebrewery.Code.Objects; using Homebrewery.Code.Objects.Things; using Homebrewery.Code.Structs; using Marioalexsan.AtlyssGLTF; using Microsoft.CodeAnalysis; using Mirror; using Mirror.RemoteCalls; using Mono.Cecil; using Newtonsoft.Json; using UnityEngine; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Homebrewery")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("4.7.37.0")] [assembly: AssemblyInformationalVersion("4.7.37+2a6732a53b3b330ddc37f251e48b81c091194224")] [assembly: AssemblyProduct("Homebrewery")] [assembly: AssemblyTitle("Homebrewery")] [assembly: NeutralResourcesLanguage("en")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.7.37.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 Homebrewery { internal static class CT { [CompilerGenerated] private static class <>O { public static BinaryPacketListener <0>__BP; public static PacketListener <1>__P; } internal const string MOD_ID = "CodeTalker"; private static bool? _enabled; internal static uint _mainPlayerIndex; internal static bool _ready; internal static Dictionary _players = new Dictionary(); internal static bool _floatsOn; internal static bool _stringsOn; private static readonly Dictionary _typeIndexes = new Dictionary { [Folder.Helm] = 1, [Folder.Cape] = 2, [Folder.Chestpiece] = 3, [Folder.Leggings] = 4, [Folder.Eyes] = 5, [Folder.Mouth] = 6 }; internal static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("CodeTalker"); _enabled = valueOrDefault; } return _enabled.Value; } } internal static void RegisterListeners() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown object obj = <>O.<0>__BP; if (obj == null) { BinaryPacketListener val = BP; <>O.<0>__BP = val; obj = (object)val; } if (!CodeTalkerNetwork.RegisterBinaryListener((BinaryPacketListener)obj)) { HB.Log("Could not register float packet listener!", 4); } else { _floatsOn = true; } object obj2 = <>O.<1>__P; if (obj2 == null) { PacketListener val2 = P; <>O.<1>__P = val2; obj2 = (object)val2; } if (!CodeTalkerNetwork.RegisterListener((PacketListener)obj2)) { HB.Log("Could not register string packet listener!", 4); } else { _stringsOn = true; } } internal static void P(PacketHeader header, PacketBase packet) { if (_ready && packet is S s) { StringsIn(s); } } internal static void BP(PacketHeader header, BinaryPacketBase packet) { if (_ready && packet is BF floats) { FloatsIn(floats); } } internal static void FloatsIn(BF floats) { uint sender = (uint)floats.V[1]; float num = floats.V[0]; if (num != 0f) { if (num != 1f) { if (num != 2f) { if (num != 3f) { if (num != 4f) { if (num != 5f) { if (num == 6f) { TailModeIn(sender, floats.V[3..]); } } else { AllDyesIn(sender, floats.V[2], floats.V[3..]); } } else { DyeColorIn(sender, floats.V[3..]); } } else { ScaleCmdIn(sender, floats.V[3..]); } } else { CondEffectIn(sender, floats.V[3..]); } } else { LimitsPacketIn(sender, floats.V[2], floats.V[3..]); } } else { HBHelloIn(sender); } } private static void HBHelloIn(uint sender) { if (sender == _mainPlayerIndex) { ZPartMarkersOut(); LimitsPacketOut(); AllDyesOut(); } else { ZPartMarkersOut(sender.ToString(CultureInfo.InvariantCulture)); LimitsPacketOut(sender); AllDyesOut(sender); } TailModeOut(CharDisplayManager._local.GetTailMode()); } private static void LimitsPacketIn(uint sender, float recipient, float[] values) { Player value; CharDisplayManager charDisplayManager = default(CharDisplayManager); if (sender == _mainPlayerIndex) { HB.Log("Ignored a LimitsPacket that was ours", 2); } else if (recipient != -1f && recipient != (float)_mainPlayerIndex) { HB.Log("Ignored a LimitsPacket that wasn't for us", 2); } else if (!_players.TryGetValue(sender, out value)) { HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4); } else if (((Component)value._pVisual._playerRaceModel).TryGetComponent(ref charDisplayManager)) { charDisplayManager.SetYourLimits(CondType.Boobs, values[0], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Boobs, values[1], miniftrue: false); charDisplayManager.SetYourLimits(CondType.Butt, values[2], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Butt, values[3], miniftrue: false); charDisplayManager.SetYourLimits(CondType.Belly, values[4], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Belly, values[5], miniftrue: false); charDisplayManager.SetYourLimits(CondType.Arms, values[6], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Arms, values[7], miniftrue: false); charDisplayManager.SetYourLimits(CondType.Torso, values[8], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Torso, values[9], miniftrue: false); charDisplayManager.SetYourLimits(CondType.Muzzle, values[10], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Muzzle, values[11], miniftrue: false); charDisplayManager.SetYourLimits(CondType.Height, values[12], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Height, values[13], miniftrue: false); charDisplayManager.SetYourLimits(CondType.Width, values[14], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Width, values[15], miniftrue: false); charDisplayManager.SetYourLimits(CondType.Head, values[16], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Head, values[17], miniftrue: false); charDisplayManager.SetYourLimits(CondType.Voice, values[18], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Voice, values[19], miniftrue: false); charDisplayManager.SetYourLimits(CondType.Depth, values[20], miniftrue: true); charDisplayManager.SetYourLimits(CondType.Depth, values[21], miniftrue: false); } } internal static void LimitsPacketOut(float recipient = -1f) { CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(1f, _mainPlayerIndex, CharDisplayManager._local.GetAllLimits(), recipient)); } private static void CondEffectIn(uint sender, float[] values) { CondEffectManager condEffectManager = default(CondEffectManager); if (!_players.TryGetValue(sender, out Player value)) { HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4); } else if (((Component)value).TryGetComponent(ref condEffectManager)) { condEffectManager.GetEffect((CondType)values[0], values[1], values[2], values[3], values[4] != 0f); } } internal static void CondEffectOut(CondType cond, float duration, float power, float interval, bool delayed) { CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(2f, _mainPlayerIndex, new float[5] { (float)cond, duration, power, interval, delayed ? 1 : 0 })); } private static void ScaleCmdIn(uint sender, float[] values) { CondEffectManager condEffectManager = default(CondEffectManager); if (!_players.TryGetValue(sender, out Player value)) { HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4); } else if (((Component)value).TryGetComponent(ref condEffectManager)) { CondType condType = (CondType)values[0]; float num = 1f; float num2 = 0f; switch (condType) { case CondType.Boobs: num2 = condEffectManager.Player._pVisual._playerRaceModel._boobWeight; break; case CondType.Butt: num2 = condEffectManager.Player._pVisual._playerRaceModel._bottomWeight; break; case CondType.Belly: num2 = condEffectManager.Player._pVisual._playerRaceModel._bellyWeight; break; case CondType.Height: num2 = condEffectManager.Player._pVisual._playerAppearanceStruct._heightWeight; num = 2000f; break; case CondType.Width: num2 = condEffectManager.Player._pVisual._playerAppearanceStruct._widthWeight; num = 2000f; break; case CondType.Depth: num2 = condEffectManager.CharMan.GetDepth(); num = 2000f; break; case CondType.HeightWidthDepth: num2 = condEffectManager.Player._pVisual._playerAppearanceStruct._heightWeight; num = 2000f; break; case CondType.Head: num2 = condEffectManager.Player._pVisual._playerRaceModel._headWidth; break; case CondType.Arms: num2 = condEffectManager.Player._pVisual._playerRaceModel._armWeight; break; case CondType.Torso: num2 = condEffectManager.Player._pVisual._playerRaceModel._torsoWeight; break; case CondType.Muzzle: num2 = condEffectManager.Player._pVisual._playerRaceModel._muzzleWeight; break; case CondType.Voice: num2 = condEffectManager.Player._pSound._voicePitch; break; } float power = (values[1] - num2) / values[2] / 60f * num; condEffectManager.GetEffect(condType, values[2], power, 1f / 60f, delayed: false); } } internal static void ScaleCmdOut(CondType slider, float endPoint, float time) { CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(3f, _mainPlayerIndex, new float[3] { (float)slider, endPoint, time })); } private static void DyeColorIn(uint sender, float[] values) { //IL_0051: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown Player value; if (sender == _mainPlayerIndex) { HB.Log("Ignored a DyeColor packet that was ours", 2); } else if (!_players.TryGetValue(sender, out value)) { HB.Log($"Sender ID ({sender}) was not in Players Dictionary!", 4); } else { CharDisplayManager charDisplayManager = default(CharDisplayManager); if (!((Component)value._pVisual._playerRaceModel).TryGetComponent(ref charDisplayManager)) { return; } ColorAdjustShader_Profile colorAdjust = new ColorAdjustShader_Profile { _hue = values[1], _saturation = values[2], _brightness = values[3], _contrast = values[4] }; float num = values[0]; if (num != 0f) { if (num != 1f) { if (num != 2f) { if (num != 3f) { if (num != 4f) { if (num != 5f) { if (num == 6f) { charDisplayManager.RecolourMouth(colorAdjust); } } else { charDisplayManager.RecolourEyes(colorAdjust); } } else { charDisplayManager.SetSlotDye(Folder.Leggings, colorAdjust); } } else { charDisplayManager.SetSlotDye(Folder.Chestpiece, colorAdjust); } } else { charDisplayManager.SetSlotDye(Folder.Cape, colorAdjust); } } else { charDisplayManager.SetSlotDye(Folder.Helm, colorAdjust); } } else { charDisplayManager.SetSlotDye(Folder.Helm, colorAdjust); charDisplayManager.SetSlotDye(Folder.Cape, colorAdjust); charDisplayManager.SetSlotDye(Folder.Chestpiece, colorAdjust); charDisplayManager.SetSlotDye(Folder.Leggings, colorAdjust); } } } internal static void DyeColorOut(int type, ColorAdjustShader_Profile colorAdjust) { CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(4f, _mainPlayerIndex, new float[5] { type, colorAdjust._hue, colorAdjust._saturation, colorAdjust._brightness, colorAdjust._contrast })); } internal static void DyeColorOut(Folder type, ColorAdjustShader_Profile colorAdjust) { CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(4f, _mainPlayerIndex, new float[5] { _typeIndexes[type], colorAdjust._hue, colorAdjust._saturation, colorAdjust._brightness, colorAdjust._contrast })); } private static void AllDyesIn(uint sender, float recipient, float[] values) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown Player value; if (sender == _mainPlayerIndex) { HB.Log("Ignored an AllDyes Packet that was ours", 2); } else if (recipient != -1f && recipient != (float)_mainPlayerIndex) { HB.Log("Ignored an AllDyes Packet that wasn't for us", 2); } else if (!_players.TryGetValue(sender, out value)) { HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4); } else { CharDisplayManager charDisplayManager = default(CharDisplayManager); if (!((Component)value._pVisual._playerRaceModel).TryGetComponent(ref charDisplayManager)) { return; } HB.Log("Got an AllDyes packet from: " + value._nickname, 2); int num = 1; for (int i = 0; (float)i < values[0]; i++) { ColorAdjustShader_Profile val = new ColorAdjustShader_Profile { _hue = values[num + 1], _saturation = values[num + 2], _brightness = values[num + 3], _contrast = values[num + 4] }; float num2 = values[num]; if (num2 != 1f) { if (num2 != 2f) { if (num2 != 3f) { if (num2 != 4f) { if (num2 != 5f) { if (num2 == 6f) { charDisplayManager.RecolourMouth(val); HB.Log($"Mouth: H {val._hue}, S {val._saturation}, B {val._brightness}, C {val._contrast}", 1); } } else { charDisplayManager.RecolourEyes(val); } } else { charDisplayManager.SetSlotDye(Folder.Leggings, val); } } else { charDisplayManager.SetSlotDye(Folder.Chestpiece, val); } } else { charDisplayManager.SetSlotDye(Folder.Cape, val); } } else { charDisplayManager.SetSlotDye(Folder.Helm, val); } num += 5; } } } private static void AllDyesOut(float recipient = -1f) { float[] dyesIfNotDefault = CharDisplayManager._local.GetDyesIfNotDefault(); if (dyesIfNotDefault.Length != 0) { CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(5f, _mainPlayerIndex, dyesIfNotDefault, recipient)); } } private static void TailModeIn(uint sender, float[] values) { Player value; CharDisplayManager charDisplayManager = default(CharDisplayManager); if (sender == _mainPlayerIndex) { HB.Log("Ignored a TailMode Packet that was ours", 2); } else if (!_players.TryGetValue(sender, out value)) { HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4); } else if (((Component)value._pVisual._playerRaceModel).TryGetComponent(ref charDisplayManager)) { HB.Log("Got a TailMode packet from: " + value._nickname, 2); charDisplayManager.SetTailMode((TailMode)values[0]); } } internal static void TailModeOut(TailMode tailmode) { CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(6f, _mainPlayerIndex, new float[1] { (float)tailmode })); } internal static void StringsIn(S s) { if (uint.TryParse(s.V[1], out var result)) { string text = s.V[0]; if (text == "0") { ZPartMarkersIn(result, s.V[2], s.V[3..]); } } } internal static void ZPartMarkersIn(uint sender, string recipient, string[] s) { Player value; CharDisplayManager charDisplayManager = default(CharDisplayManager); if (sender == _mainPlayerIndex) { HB.Log("Ignored a ZPartMarkers that was ours", 2); } else if (recipient.Length > 0 && !recipient.Equals(_mainPlayerIndex.ToString(CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase)) { HB.Log("Ignored a ZPartMarkers that wasn't for us", 2); } else if (!_players.TryGetValue(sender, out value)) { HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4); } else if (((Component)value._pVisual._playerRaceModel).TryGetComponent(ref charDisplayManager)) { HB.Log("Got a ZPartMarkers packet from: " + value._nickname, 2); if (s[0].Length > 0) { charDisplayManager.SetPartMarker(Folder.Skin, s[0]); } if (s[1].Length > 0) { charDisplayManager.SetPartMarker(Folder.Mouth, s[1]); } if (s[2].Length > 0) { charDisplayManager.SetPartMarker(Folder.Eyes, s[2]); } if (s[3].Length > 0) { charDisplayManager.SetPartMarker(Folder.Hair, s[3]); } charDisplayManager._playerRaceModel.Apply_CharacterDisplay(); } } internal static void ZPartMarkersOut(string recipient = "") { string partMarker = CharDisplayManager._local.GetPartMarker(Folder.Skin); string partMarker2 = CharDisplayManager._local.GetPartMarker(Folder.Mouth); string partMarker3 = CharDisplayManager._local.GetPartMarker(Folder.Eyes); string partMarker4 = CharDisplayManager._local.GetPartMarker(Folder.Hair); if (partMarker.Length + partMarker2.Length + partMarker3.Length + partMarker4.Length != 0) { CodeTalkerNetwork.SendNetworkPacket((PacketBase)(object)new S("0", _mainPlayerIndex.ToString(CultureInfo.InvariantCulture), new string[4] { partMarker, partMarker2, partMarker3, partMarker4 }, recipient)); } } } internal sealed class BF : BinaryPacketBase { public float[] V { get; set; } = Array.Empty(); public override string PacketSignature => "HB.BF"; public BF() { } public BF(float type, float sender, float[] values = null, float recipient = -1f) { List list = new List(); list.Add(type); list.Add(sender); list.Add(recipient); list.AddRange(values ?? Array.Empty()); V = list.ToArray(); } public override void Deserialize(byte[] data) { V = new float[data.Length / 4]; Buffer.BlockCopy(data, 0, V, 0, data.Length); } public override byte[] Serialize() { byte[] array = new byte[V.Length * 4]; Buffer.BlockCopy(V, 0, array, 0, array.Length); return array; } } internal sealed class S : PacketBase { public override string PacketSourceGUID => "Homebrewery"; [JsonProperty] public string[] V { get; set; } public S(string type, string sender, string[] values = null, string recipient = "") { List list = new List(); list.Add(type); list.Add(sender); list.Add(recipient); list.AddRange(values ?? Array.Empty()); V = list.ToArray(); ((PacketBase)this)..ctor(); } } internal static class DataExtractor { internal static StringBuilder _loadedAssetsList = new StringBuilder(); internal static void TellMeAbout(object? it, bool showempty = true) { HB.Log("TellMeAbout..."); if (it == null) { HB.Log("It's null"); HB.Log("...ToldYouAbout.\n"); return; } HB.Log("Object: " + it); List list = it.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList(); if (list.Count > 0) { list.Sort((FieldInfo f1, FieldInfo f2) => string.Compare(f1.Name, f2.Name, StringComparison.OrdinalIgnoreCase)); foreach (FieldInfo item in list) { if (showempty || item.GetValue(it) != null) { HB.Log(item.Name.Replace("k__BackingField", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("<", string.Empty, StringComparison.OrdinalIgnoreCase).Replace(">", string.Empty, StringComparison.OrdinalIgnoreCase) + " " + item.GetValue(it)); } } } List list2 = it.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList(); if (list2.Count > 0) { list2.Sort((PropertyInfo p1, PropertyInfo p2) => string.Compare(p1.Name, p2.Name, StringComparison.OrdinalIgnoreCase)); foreach (PropertyInfo item2 in list2) { if (showempty || item2.GetValue(it) != null) { HB.Log(item2.Name.Replace("k__BackingField", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("<", string.Empty, StringComparison.OrdinalIgnoreCase).Replace(">", string.Empty, StringComparison.OrdinalIgnoreCase) + " " + item2.GetValue(it)); } } } HB.Log("...ToldYouAbout.\n"); } internal static string MaximumStats() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown ScriptableItem val = GameManager._current._cachedScriptableItems.Values.First((ScriptableItem i) => i is ScriptableEquipment && !i._itemName.StartsWith("#HB#", StringComparison.OrdinalIgnoreCase)); ScriptableEquipment val2 = (ScriptableEquipment)val; ScriptableEquipment val3 = val2; ScriptableEquipment val4 = val2; ScriptableEquipment val5 = val2; ScriptableEquipment val6 = val2; ScriptableEquipment val7 = val2; ScriptableEquipment val8 = val2; ScriptableEquipment val9 = val2; ScriptableEquipment val10 = val2; ScriptableEquipment val11 = val2; ScriptableEquipment val12 = val2; ScriptableEquipment val13 = val2; ScriptableEquipment val14 = val2; ScriptableEquipment val15 = val2; ScriptableEquipment val16 = val2; ScriptableEquipment val17 = val2; ScriptableEquipment val18 = val2; ScriptableEquipment val19 = val2; ScriptableWeapon val20 = (ScriptableWeapon)GameManager._current._cachedScriptableItems.Values.First((ScriptableItem i) => i is ScriptableWeapon && !i._itemName.StartsWith("#HB#", StringComparison.OrdinalIgnoreCase)); ScriptableWeapon val21 = val20; foreach (ScriptableItem item in GameManager._current._cachedScriptableItems.Values.Where((ScriptableItem i) => i is ScriptableEquipment && !i._itemName.StartsWith("#HB#", StringComparison.OrdinalIgnoreCase))) { ScriptableEquipment val22 = (ScriptableEquipment)(object)((item is ScriptableEquipment) ? item : null); if (val22 == null) { continue; } if (((ScriptableItem)val22)._vendorCost > val._vendorCost) { val = (ScriptableItem)(object)val22; } if (val22._equipmentLevel > val2._equipmentLevel) { val2 = val22; } if (val22._statArray._maxHealth > val3._statArray._maxHealth) { val3 = val22; } if (val22._statArray._maxMana > val4._statArray._maxMana) { val4 = val22; } if (val22._statArray._maxStamina > val5._statArray._maxStamina) { val5 = val22; } if (val22._statArray._attackPower > val6._statArray._attackPower) { val6 = val22; } if (val22._statArray._magicPower > val7._statArray._magicPower) { val7 = val22; } if (val22._statArray._dexPower > val8._statArray._dexPower) { val8 = val22; } if (val22._statArray._criticalRate > val9._statArray._criticalRate) { val9 = val22; } if (val22._statArray._evasion > val10._statArray._evasion) { val10 = val22; } if (val22._statArray._defense > val11._statArray._defense) { val11 = val22; } if (val22._statArray._resist > val12._statArray._resist) { val12 = val22; } if (val22._statArray._elementalPower > val13._statArray._elementalPower) { val13 = val22; } if (val22._statArray._firePower > val14._statArray._firePower) { val14 = val22; } if (val22._statArray._waterPower > val15._statArray._waterPower) { val15 = val22; } if (val22._statArray._naturePower > val16._statArray._naturePower) { val16 = val22; } if (val22._statArray._earthPower > val17._statArray._earthPower) { val17 = val22; } if (val22._statArray._holyPower > val18._statArray._holyPower) { val18 = val22; } if (val22._statArray._shadowPower > val19._statArray._shadowPower) { val19 = val22; } ScriptableWeapon val23 = (ScriptableWeapon)(object)((val22 is ScriptableWeapon) ? val22 : null); if (val23 != null) { if (val23._bonusFloorWeaponDamage > val20._bonusFloorWeaponDamage) { val20 = val23; } if (val23._bonusCeilingWeaponDamage > val21._bonusCeilingWeaponDamage) { val21 = val23; } } } return $"```\r\n_vendorCost : {val._itemName} : {val._vendorCost}\r\n\r\n_equipmentLevel : {((ScriptableItem)val2)._itemName} : {val2._equipmentLevel}\r\n\r\n_maxHealth : {((ScriptableItem)val3)._itemName} : {val3._statArray._maxHealth}\r\n_maxMana : {((ScriptableItem)val4)._itemName} : {val4._statArray._maxMana}\r\n_maxStamina : {((ScriptableItem)val5)._itemName} : {val5._statArray._maxStamina}\r\n_attackPower : {((ScriptableItem)val6)._itemName} : {val6._statArray._attackPower}\r\n_magicPower : {((ScriptableItem)val7)._itemName} : {val7._statArray._magicPower}\r\n_dexPower : {((ScriptableItem)val8)._itemName} : {val8._statArray._dexPower}\r\n_criticalRate : {((ScriptableItem)val9)._itemName} : {val9._statArray._criticalRate}\r\n_evasion : {((ScriptableItem)val10)._itemName} : {val10._statArray._evasion}\r\n_defense : {((ScriptableItem)val11)._itemName} : {val11._statArray._defense}\r\n_resist : {((ScriptableItem)val12)._itemName} : {val12._statArray._resist}\r\n_elementalPower : {((ScriptableItem)val13)._itemName} : {val13._statArray._elementalPower}\r\n_firePower : {((ScriptableItem)val14)._itemName} : {val14._statArray._firePower}\r\n_waterPower : {((ScriptableItem)val15)._itemName} : {val15._statArray._waterPower}\r\n_naturePower : {((ScriptableItem)val16)._itemName} : {val16._statArray._naturePower}\r\n_earthPower : {((ScriptableItem)val17)._itemName} : {val17._statArray._earthPower}\r\n_holyPower : {((ScriptableItem)val18)._itemName} : {val18._statArray._holyPower}\r\n_shadowPower : {((ScriptableItem)val19)._itemName} : {val19._statArray._shadowPower}\r\n\r\n_bonusFloorWeaponDamage : {((ScriptableItem)val20)._itemName} : {val20._bonusFloorWeaponDamage}\r\n_bonusCeilingWeaponDamage : {((ScriptableItem)val21)._itemName} : {val21._bonusCeilingWeaponDamage}\r\n```"; } internal static void DumpAllScriptables() { //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Expected O, but got Unknown //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Expected O, but got Unknown //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Expected O, but got Unknown //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Expected O, but got Unknown //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Expected O, but got Unknown //IL_09a7: Unknown result type (might be due to invalid IL or missing references) //IL_09ae: Expected O, but got Unknown //IL_0a29: Unknown result type (might be due to invalid IL or missing references) //IL_0a30: Expected O, but got Unknown //IL_0bec: Unknown result type (might be due to invalid IL or missing references) //IL_0c57: Unknown result type (might be due to invalid IL or missing references) //IL_0c5e: Expected O, but got Unknown //IL_0d82: Unknown result type (might be due to invalid IL or missing references) //IL_0d89: Expected O, but got Unknown //IL_0ee6: Unknown result type (might be due to invalid IL or missing references) //IL_0eed: Expected O, but got Unknown //IL_0fff: Unknown result type (might be due to invalid IL or missing references) //IL_1006: Expected O, but got Unknown //IL_11cd: Unknown result type (might be due to invalid IL or missing references) //IL_11e4: Unknown result type (might be due to invalid IL or missing references) IEnumerable enumerable = GameManager._current._cachedScriptableItems.Values.Where((ScriptableItem i) => !i._itemName.StartsWith("#HB#", StringComparison.OrdinalIgnoreCase)); DirectoryInfo directoryInfo = HB.Location.CreateSubdirectory("Scriptable"); File.WriteAllTextAsync(PathUtils.LongCombine(directoryInfo.FullName, "LoadedAssetsList.txt"), _loadedAssetsList.ToString()); Dictionary dictionary = new Dictionary(); dictionary.Add(typeof(ScriptableArmorDye), directoryInfo.CreateSubdirectory("ArmorDye")); dictionary.Add(typeof(ScriptableCape), directoryInfo.CreateSubdirectory("Cape")); dictionary.Add(typeof(ScriptableChestpiece), directoryInfo.CreateSubdirectory("Chestpiece")); dictionary.Add(typeof(ScriptableHelm), directoryInfo.CreateSubdirectory("Helm")); dictionary.Add(typeof(ScriptableLeggings), directoryInfo.CreateSubdirectory("Leggings")); dictionary.Add(typeof(ScriptableRing), directoryInfo.CreateSubdirectory("Ring")); dictionary.Add(typeof(ScriptableShield), directoryInfo.CreateSubdirectory("Shield")); dictionary.Add(typeof(ScriptableStatusConsumable), directoryInfo.CreateSubdirectory("StatusConsumable")); dictionary.Add(typeof(ScriptableTradeItem), directoryInfo.CreateSubdirectory("TradeItem")); dictionary.Add(typeof(ScriptableWeapon), directoryInfo.CreateSubdirectory("Weapon")); Dictionary dictionary2 = dictionary; foreach (ScriptableItem item in enumerable) { try { List list = new List(); Type type = ((object)item).GetType(); if (!dictionary2.TryGetValue(type, out var value)) { continue; } list.Add("- ScriptableItem -"); list.Add("name : " + ((Object)item).name); list.Add("_itemName : " + item._itemName); list.Add("_itemDescription : " + item._itemDescription); list.Add($"_destroyOnDrop : {item._destroyOnDrop}"); list.Add($"_vendorCost : {item._vendorCost}"); list.Add($"_maxStackAmount : {item._maxStackAmount}"); list.Add($"_itemIcon : {item._itemIcon}"); list.Add($"_itemRarity : {item._itemRarity}"); if (type == typeof(ScriptableTradeItem)) { File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list); continue; } if (type == typeof(ScriptableArmorDye) || type == typeof(ScriptableStatusConsumable)) { ScriptableConsumable val = (ScriptableConsumable)item; list.Add("\n- ScriptableConsumable -"); list.Add($"_consumableCooldown : {val._consumableCooldown}"); list.Add($"_consumableObject : {val._consumableObject}"); list.Add($"_useOnlyInTown : {val._useOnlyInTown}"); list.Add($"_unperishable : {val._unperishable}"); if (type == typeof(ScriptableStatusConsumable)) { ScriptableStatusConsumable val2 = (ScriptableStatusConsumable)val; list.Add("\n- ScriptableStatusConsumable -"); list.Add($"_healthApply : {val2._healthApply}"); list.Add($"_manaApply : {val2._manaApply}"); list.Add($"_staminaApply : {val2._staminaApply}"); list.Add($"_expGain : {val2._expGain}"); list.Add($"_resetSkillPoints : {val2._resetSkillPoints}"); list.Add($"_resetAttributePoints : {val2._resetAttributePoints}"); File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list); } else if (type == typeof(ScriptableArmorDye)) { list.Add("(Dyes are not actually unperishable in vanilla, HB sets them to be!)"); ScriptableArmorDye val3 = (ScriptableArmorDye)val; list.Add("\n- ScriptableArmorDye -"); list.Add("_particleColoration : " + ColorUtility.ToHtmlStringRGBA(val3._particleColoration)); list.Add("_dyeParams : {"); list.Add($" _hue : {val3._dyeParams._hue}\r\n _saturation : {val3._dyeParams._saturation}\r\n _brightness : {val3._dyeParams._brightness}\r\n _contrast : {val3._dyeParams._contrast}"); list.Add("}"); File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list); } continue; } ScriptableEquipment val4 = (ScriptableEquipment)item; list.Add("\n- ScriptableEquipment -"); list.Add($"_equipmentLevel : {val4._equipmentLevel}"); list.Add($"_classRequirement : {val4._classRequirement}"); list.Add("_statArray : {"); list.Add($" _maxHealth : {val4._statArray._maxHealth}\r\n _maxMana : {val4._statArray._maxMana}\r\n _maxStamina : {val4._statArray._maxStamina}\r\n _experience : {val4._statArray._experience}\r\n _attackPower : {val4._statArray._attackPower}\r\n _magicPower : {val4._statArray._magicPower}\r\n _dexPower : {val4._statArray._dexPower}\r\n _criticalRate : {val4._statArray._criticalRate}\r\n _evasion : {val4._statArray._evasion}\r\n _defense : {val4._statArray._defense}\r\n _resist : {val4._statArray._resist}\r\n _elementalPower : {val4._statArray._elementalPower}\r\n _firePower : {val4._statArray._firePower}\r\n _waterPower : {val4._statArray._waterPower}\r\n _naturePower : {val4._statArray._naturePower}\r\n _earthPower : {val4._statArray._earthPower}\r\n _holyPower : {val4._statArray._holyPower}\r\n _shadowPower : {val4._statArray._shadowPower}"); list.Add("}"); if (val4._statModifierCost != null) { list.Add("_statModifierCost : {"); list.Add($" _scriptItem : {val4._statModifierCost._scriptItem}\r\n _scriptItemQuantity : {val4._statModifierCost._scriptItemQuantity}"); list.Add("}"); } if (!(type == typeof(ScriptableCape)) && !(type == typeof(ScriptableChestpiece)) && !(type == typeof(ScriptableHelm)) && !(type == typeof(ScriptableLeggings)) && !(type == typeof(ScriptableRing))) { goto IL_0ece; } ScriptableArmor val5 = (ScriptableArmor)val4; list.Add("\n- ScriptableArmor -"); list.Add($"_canDyeArmor : {val5._canDyeArmor}"); list.Add("_colorAdjustParams : {"); list.Add($" _hue : {val5._colorAdjustParams._hue}\r\n _saturation : {val5._colorAdjustParams._saturation}\r\n _brightness : {val5._colorAdjustParams._brightness}\r\n _contrast : {val5._colorAdjustParams._contrast}"); list.Add("}"); list.Add($"_armorTexture : {val5._armorTexture}"); if (type == typeof(ScriptableRing)) { File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list); } else if (type == typeof(ScriptableCape)) { ScriptableCape val6 = (ScriptableCape)val5; list.Add("\n- ScriptableCape -"); list.Add($"_capeMesh : {val6._capeMesh}"); File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list); } else if (type == typeof(ScriptableChestpiece)) { ScriptableChestpiece val7 = (ScriptableChestpiece)val5; list.Add("\n- ScriptableChestpiece -"); list.Add($"_lockBoobs : {val7._lockBoobs}"); list.Add($"_disableJiggleBoobBones : {val7._disableJiggleBoobBones}"); list.Add($"_textureArms : {val7._textureArms}"); list.Add($"_legOverlayTexture : {val7._legOverlayTexture}"); list.Add($"_boobOverrideTexture : {val7._boobOverrideTexture}"); list.Add($"_neckCollarMesh : {val7._neckCollarMesh}"); list.Add($"_neckCollarTexture : {val7._neckCollarTexture}"); list.Add($"_chestRenderDisplay : {val7._chestRenderDisplay}"); list.Add($"_chestRenderTexture : {val7._chestRenderTexture}"); list.Add($"_chestRenderBoobTexture : {val7._chestRenderBoobTexture}"); list.Add($"_robeSkirtRender : {val7._robeSkirtRender}"); list.Add($"_robeSkirtTexture : {val7._robeSkirtTexture}"); list.Add($"_hipMeshDisplay : {val7._hipMeshDisplay}"); list.Add($"_hipMeshTexture : {val7._hipMeshTexture}"); list.Add($"_armCuffRender : {val7._armCuffRender}"); list.Add($"_shoulderpadMesh : {val7._shoulderpadMesh}"); list.Add($"_shoulderpadTexture : {val7._shoulderpadTexture}"); list.Add($"_shoulderPadDisplayType : {val7._shoulderPadDisplayType}"); File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list); } else if (type == typeof(ScriptableHelm)) { ScriptableHelm val8 = (ScriptableHelm)val5; list.Add("\n- ScriptableHelm -"); list.Add($"_blendHelmValue : {val8._blendHelmValue}"); list.Add($"_useHelmHairDisplay : {val8._useHelmHairDisplay}"); list.Add($"_hideEars : {val8._hideEars}"); list.Add($"_hideMisc : {val8._hideMisc}"); list.Add($"_isFullHelm : {val8._isFullHelm}"); list.Add($"_helmRender : {val8._helmRender}"); list.Add($"_helmOverrideMesh : {val8._helmOverrideMesh}"); File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list); } else { if (!(type == typeof(ScriptableLeggings))) { goto IL_0ece; } ScriptableLeggings val9 = (ScriptableLeggings)val5; list.Add("\n- ScriptableLeggings -"); list.Add($"_textureUpperLegOnly : {val9._textureUpperLegOnly}"); list.Add($"_textureFeet : {val9._textureFeet}"); list.Add($"_legPieceRender_01 : {val9._legPieceRender_01}"); list.Add($"_legPieceTexture_01 : {val9._legPieceTexture_01}"); list.Add($"_legPieceRender_02 : {val9._legPieceRender_02}"); list.Add($"_legPieceTexture_02 : {val9._legPieceTexture_02}"); list.Add($"_legPieceRender_03 : {val9._legPieceRender_03}"); list.Add($"_legPieceTexture_03 : {val9._legPieceTexture_03}"); list.Add($"_legPieceRender_04 : {val9._legPieceRender_04}"); list.Add($"_legPieceTexture_04 : {val9._legPieceTexture_04}"); File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list); } goto end_IL_01b1; IL_0ece: if (type == typeof(ScriptableShield)) { ScriptableShield val10 = (ScriptableShield)val4; list.Add("\n- ScriptableShield -"); list.Add($"_shieldMesh : {val10._shieldMesh}"); list.Add($"_shieldTexture : {val10._shieldTexture}"); list.Add("_textureColorAdjust : {"); list.Add($" _hue : {val10._textureColorAdjust._hue}\r\n _saturation : {val10._textureColorAdjust._saturation}\r\n _brightness : {val10._textureColorAdjust._brightness}\r\n _contrast : {val10._textureColorAdjust._contrast}"); list.Add("}"); File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list); } else if (type == typeof(ScriptableWeapon)) { ScriptableWeapon val11 = (ScriptableWeapon)val4; list.Add("\n- ScriptableWeapon -"); list.Add("weaponType : " + val11.weaponType._weaponTypeClassTag); if (Object.op_Implicit((Object)(object)val11._combatElement)) { list.Add($"_combatElement : {val11._combatElement._elementName} - ID: {val11._combatElement._elementID}"); } else { list.Add("_combatElement : None"); } list.Add($"_weaponProjectileSet : {val11._weaponProjectileSet}"); list.Add($"_bonusFloorWeaponDamage : {val11._bonusFloorWeaponDamage}"); list.Add($"_bonusCeilingWeaponDamage : {val11._bonusCeilingWeaponDamage}"); if (Object.op_Implicit((Object)(object)val11._weaponConditionSlot?._scriptableCondition)) { list.Add("_weaponConditionSlot : {"); list.Add($" _scriptableCondition : {val11._weaponConditionSlot._scriptableCondition._conditionName} - ID: {val11._weaponConditionSlot._scriptableCondition._conditionID}\r\n _chance : {val11._weaponConditionSlot._chance}\r\n _conditionPower : {val11._weaponConditionSlot._conditionPower}\r\n _bonusDuration : {val11._weaponConditionSlot._bonusDuration}"); list.Add("}"); } else { list.Add("_weaponConditionSlot : None"); } list.Add($"weaponTexture : {val11.weaponTexture}"); list.Add($"weaponMesh : {val11.weaponMesh}"); list.Add("trailColors : #" + ColorUtility.ToHtmlStringRGBA(val11.trailColors[0]) + " & #" + ColorUtility.ToHtmlStringRGBA(val11.trailColors[1])); list.Add("_textureColorAdjust : {"); list.Add($" _hue : {val11._textureColorAdjust._hue}\r\n _saturation : {val11._textureColorAdjust._saturation}\r\n _brightness : {val11._textureColorAdjust._brightness}\r\n _contrast : {val11._textureColorAdjust._contrast}"); list.Add("}"); list.Add($"_weaponTakeOutSfxIndex : {val11._weaponTakeOutSfxIndex}"); list.Add($"_setWeaponTakeOutSfx : {val11._setWeaponTakeOutSfx}"); list.Add($"_weaponSwingSfxIndex : {val11._weaponSwingSfxIndex}"); list.Add($"_setWeaponSwingSfx : {val11._setWeaponSwingSfx}"); File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list); } end_IL_01b1:; } catch { HB.Log("DumpAllScriptables() - Didn't manage to make a file for " + item._itemName); throw; } } } } internal static class FunStuff { internal static void Bumpscosity() { int[] array = new int[7] { 0, 1, 12, 50, 76, 100, 1000 }; MainConfig._current._bumpscosity.Value = array[Random.Range(0, 6)]; int value = MainConfig._current._bumpscosity.Value; if (value < 50) { if (value > 0) { if (value < 12) { if (value == 1) { HB.Log("Well I'm quite feeling the lack of bumpscosity in here.\nOnly a single bumpscosit. Still, it'll have to do.\n"); } else { HB.Log("Well I'm quite feeling the lack of bumpscosity in here.\nOnly a few bumpscosits. Still, it'll have to do.\n"); } } else { HB.Log("Just a light breeze of bumpscosity in here at the moment, not bad. I personally enjoy a bit more bumpscosity, but at this amount it's absolutely reasonable.\n"); } } else { HB.Log("Dear me, where did all the bumpscosity go? Quite unnerving in here with all of it gone.\n"); } } else if (value < 100) { if (value < 76) { HB.Log("Ahh, quite a pleasant amount of bumpscosity we've got today, wouldn't you say? Very enjoyable.\n"); } else { HB.Log("Well, the bumpscosity in here is really getting up there, isn't it?\nNo matter, the story must carry on no matter how much or how little bumpscosity there is.\n"); } } else if (value < 1000) { HB.Log("Who turned up the bumpscosity so high?\nI like bumpscosity as much as the next person, but a hundred is quite a lot, wouldn't you say?\n"); } else { HB.Log("My god, the bumpscosity in here is absolutely overwhelming.\nA thousand?! You people have got to be nuts!\nHow can you stand this much bumpscosity?\n"); } } } [BepInPlugin("Homebrewery", "Homebrewery", "4.7.37")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class BepInExPlugin : BaseUnityPlugin { public BepInExPlugin() { HB._dll = new FileInfo(((BaseUnityPlugin)this).Info.Location); HB._logger = ((BaseUnityPlugin)this).Logger; } public void Awake() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown HB._homebreweryGameObject = new GameObject("Homebrewery-GameObject"); Object.DontDestroyOnLoad((Object)(object)HB._homebreweryGameObject); HB._self = HB._homebreweryGameObject.AddComponent(); } } public class HB : MonoBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static MemoryUsageChangedCallback <>9__58_0; public static Func <>9__60_0; public static Func <>9__73_0; public static Func <>9__73_1; public static Func <>9__73_2; public static Func <>9__73_3; public static Func <>9__73_4; public static Func <>9__73_5; public static Func <>9__73_6; public static Func <>9__73_7; public static Func <>9__73_8; public static Func <>9__73_9; public static Func <>9__73_10; public static Func <>9__73_11; public static Func <>9__73_12; public static Func <>9__73_13; public static Func <>9__73_14; public static Func <>9__73_15; internal void b__58_0(in ApplicationMemoryUsageChange newUsage) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected I4, but got Unknown Log($"ApplicationMemoryUsage.{((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage} reported!", (int)((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage); } internal int b__60_0(AnyThing m) { return (!m._beak) ? 1 : 0; } internal bool b__73_0(Mesh m) { return ((Object)m).name.Equals("_mouthEnemy_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__73_1(Mesh m) { return ((Object)m).name.Equals("_mouthEnemy_alt00_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__73_2(Mesh m) { return ((Object)m).name.Equals("angela_hairTuft", StringComparison.OrdinalIgnoreCase); } internal bool b__73_3(Mesh m) { return ((Object)m).name.Equals("_ruko_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__73_4(Mesh m) { return ((Object)m).name.Equals("_sally_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__73_5(Mesh m) { return ((Object)m).name.Equals("_sallyworker00_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__73_6(Mesh m) { return ((Object)m).name.Equals("_vivi_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__73_7(Mesh m) { return ((Object)m).name.Equals("_lordBoar_horns", StringComparison.OrdinalIgnoreCase); } internal bool b__73_8(Mesh m) { return ((Object)m).name.Equals("mekboar_horn", StringComparison.OrdinalIgnoreCase); } internal bool b__73_9(Mesh m) { return ((Object)m).name.Equals("_moth_horn", StringComparison.OrdinalIgnoreCase); } internal bool b__73_10(Mesh m) { return ((Object)m).name.Equals("rageBoar_horn", StringComparison.OrdinalIgnoreCase); } internal bool b__73_11(Mesh m) { return ((Object)m).name.Equals("warboar_horn", StringComparison.OrdinalIgnoreCase); } internal bool b__73_12(Mesh m) { return ((Object)m).name.Equals("wizboar_scepter", StringComparison.OrdinalIgnoreCase); } internal bool b__73_13(Mesh m) { return ((Object)m).name.Equals("angela_horns", StringComparison.OrdinalIgnoreCase); } internal bool b__73_14(Mesh m) { return ((Object)m).name.Equals("_enok_horns", StringComparison.OrdinalIgnoreCase); } internal bool b__73_15(GameObject c) { if (!((Object)c).name.StartsWith("_conditionEffect_", StringComparison.OrdinalIgnoreCase)) { return ((Object)c).name.StartsWith("_conditionObject_", StringComparison.OrdinalIgnoreCase); } return true; } } [CompilerGenerated] private sealed class d__69 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__69(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; ChatBehaviour._current._chatAssets._chatInput.text = "/"; ChatBehaviour._current._chatAssets._chatInput.MoveTextEnd(false); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal static HB _self = null; internal static GameObject _homebreweryGameObject = null; internal static FileInfo _dll = null; internal static ManualLogSource _logger = null; private readonly Stopwatch _stopwatch = Stopwatch.StartNew(); internal static DirectoryInfo _configHomebrewery = null; internal static DirectoryInfo _limitCfgsFolder = null; internal static int _bepinPathLength; private readonly Harmony _harmony = new Harmony("Homebrewery"); public const StringComparison ORD = StringComparison.OrdinalIgnoreCase; internal static InstallType _installType = InstallType.r2ModMan; private static DirectoryInfo? _location; private static DirectoryInfo? _internal; private static DirectoryInfo? _hbFiles; internal static DirectoryInfo _contentPacks = null; public static readonly Dictionary ARend = new Dictionary(StringComparer.OrdinalIgnoreCase); public static readonly Dictionary AMesh = new Dictionary(StringComparer.OrdinalIgnoreCase); internal static Dictionary _raceStructs = new Dictionary(); internal static ScriptablePlayerRace _playerRace_imp = null; internal static ScriptablePlayerRace _playerRace_poon = null; internal static ScriptablePlayerRace _playerRace_kubold = null; internal static ScriptablePlayerRace _playerRace_byrdle = null; internal static ScriptablePlayerRace _playerRace_chang = null; internal static bool _hotkeysOn = true; public static readonly int UpdateCount = 10; internal const string UPDATE_STRING = "Thank you for using Homebrewery 4.7.37!\r\n\r\n\r\n\r\n\r\n\r\nRemember: don't store custom items!\r\nClose: 'T' | Ctrl+P to open HB Phone!"; internal static bool _shownUpdateMessage; public static readonly Dictionary AudioClips = new Dictionary(StringComparer.OrdinalIgnoreCase); public static readonly Dictionary Sprites = new Dictionary(); public static readonly Dictionary ConsumableObjects = new Dictionary(StringComparer.OrdinalIgnoreCase); internal static float _foodLevel; internal static Shader _unlitColorAdjustCutout = null; internal static PlayerRaceModel[] _menuRaceModels = Array.Empty(); internal static PlayerRaceModel[] _inventoryRaceModels = Array.Empty(); internal static GameObject? _glbStorage; private static bool _awakeCompleted; private bool _chatIsKill; internal static int _byrdleVanillaHairsCount; internal static int _byrdleVanillaBeaksCount; internal static int _nudge; internal static DirectoryInfo Location { get { return _location ?? throw new InvalidOperationException("Location wasn't initialised!"); } set { _location = value; } } internal static DirectoryInfo Internal { get { return _internal ?? throw new InvalidOperationException("Internal wasn't initialised!"); } set { _internal = value; } } internal static DirectoryInfo HBFiles { get { return _hbFiles ?? throw new InvalidOperationException("HBFiles wasn't initialised!"); } set { _hbFiles = value; } } internal static List _texReplacements => TexReplacer._texReplacements; public static Dictionary WeaponTypes => WeaponItemFolder._weaponTypes; public static Dictionary ProjectileSets => WeaponItemFolder._projectileSets; internal static Dictionary _players => CT._players; public static GameManager GM => GameManager._current.L() ?? throw new InvalidOperationException("Tried to use GameManager._current before it was ready!"); internal static bool FolderCheck(DirectoryInfo dir) { DateTime lastAccessTime = dir.LastAccessTime; DateTime lastWriteTime = dir.LastWriteTime; dir.Refresh(); if (dir.Exists) { if (!(lastAccessTime < dir.LastAccessTime)) { return lastWriteTime < dir.LastWriteTime; } return true; } return false; } public static void Log(object? thing = null, int level = 0) { if (Object.op_Implicit((Object)(object)MainConfig._current) && MainConfig._current._logLevel.Value == -1) { return; } if (thing == null) { _logger.LogError((object)"Logged a null, nice one."); return; } switch (level) { case 1: if (!Object.op_Implicit((Object)(object)MainConfig._current) || MainConfig._current._logLevel.Value <= 1) { _logger.LogDebug(thing); } break; case 2: if (!Object.op_Implicit((Object)(object)MainConfig._current) || MainConfig._current._logLevel.Value <= 2) { _logger.LogMessage(thing); } break; case 3: if (!Object.op_Implicit((Object)(object)MainConfig._current) || MainConfig._current._logLevel.Value <= 3) { _logger.LogWarning((object)$"{thing}\n"); } break; case 4: _logger.LogError((object)$"{thing}\n"); break; default: _logger.LogInfo(thing); break; } } private static void TryMoveFile(string source, string destination) { if (File.Exists(source) && !File.Exists(destination)) { File.Move(source, destination); } } private static void ConfigMover() { _configHomebrewery = Directory.CreateDirectory(PathUtils.LongCombine(Paths.ConfigPath, "Homebrewery")); _limitCfgsFolder = Directory.CreateDirectory(PathUtils.LongCombine(_configHomebrewery.FullName, "LimitCFGs")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "Homebrewery.cfg"), PathUtils.LongCombine(_configHomebrewery.FullName, "Homebrewery.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HB_JiggleSettings.cfg"), PathUtils.LongCombine(_configHomebrewery.FullName, "JiggleSettings.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Byrdle_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Byrdle_YourLimits.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Chang_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Chang_YourLimits.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Imp_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Imp_YourLimits.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Kubold_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Kubold_YourLimits.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Poon_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Poon_YourLimits.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Byrdle_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Byrdle_OthersLimits.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Chang_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Chang_OthersLimits.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Imp_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Imp_OthersLimits.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Kubold_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Kubold_OthersLimits.cfg")); TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Poon_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Poon_OthersLimits.cfg")); if (Directory.Exists(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs")) && !Directory.EnumerateFileSystemEntries(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs")).Any()) { Directory.Delete(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs")); } } private void Awake() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)2); object obj = <>c.<>9__58_0; if (obj == null) { MemoryUsageChangedCallback val = delegate(in ApplicationMemoryUsageChange newUsage) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected I4, but got Unknown Log($"ApplicationMemoryUsage.{((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage} reported!", (int)((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage); }; <>c.<>9__58_0 = val; obj = (object)val; } Application.memoryUsageChanged += (MemoryUsageChangedCallback)obj; _glbStorage = new GameObject("GLTFContainer"); _glbStorage.transform.parent = _homebreweryGameObject.transform; _glbStorage.SetActive(false); ConfigMover(); ConfigManager._current = _homebreweryGameObject.AddComponent(); CultureInfo.CurrentCulture = CultureInfo.InvariantCulture; Log($"Waking up at {DateTime.UtcNow:yyyy-MM-dd h:mm:ss tt} UTC... Game Version is: {Application.version}"); _bepinPathLength = PathUtils.LongCombine(Paths.BepInExRootPath).Length; if (!Application.version.Equals("62026.a1", StringComparison.OrdinalIgnoreCase)) { Log("This version of Homebrewery was made for game version '62026.a1', so be wary of issues arising due to game changes!", 3); } FunStuff.Bumpscosity(); Log($"AtlyssGLTF available: {AtlyssGLTF.Available}."); if (MainConfig._current._ignoreAtlyssGLTF.Value) { Log("'Ignore AtylssGLTF' debug setting is on! - Homebrewery will not import any GLB files!", 4); } Location = _dll.Directory; if (Location.Name.Equals("plugins", StringComparison.OrdinalIgnoreCase)) { Log("[InstallError] Homebrewery is not installed correctly! The DLL should not be directly in the BepInEx/plugins folder - Leave it inside its 'Catman232-Homebrewery' folder!", 4); Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1); return; } if (Directory.Exists(PathUtils.LongCombine(Location.FullName, "plugins"))) { _installType = InstallType.Manual; } if (_installType == InstallType.r2ModMan) { Internal = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "Internal")); HBFiles = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "HomebreweryFiles")); TexReplacer._folder = new DirectoryInfo(PathUtils.LongCombine(Paths.ConfigPath, "TextureReplace")); _contentPacks = new DirectoryInfo(PathUtils.LongCombine(Paths.ConfigPath, "ContentPacks")); } else if (_installType == InstallType.Manual) { Internal = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "plugins", "Internal")); HBFiles = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "plugins", "HomebreweryFiles")); TexReplacer._folder = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "config", "TextureReplace")); _contentPacks = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "config", "ContentPacks")); } if (!Internal.Exists) { Log("[InstallError] Internal folder could not be found! Something is wrong with your mod installation!", 4); Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1); return; } if (!HBFiles.Exists) { Log("[InstallError] HomebreweryFiles folder could not be found! Something is wrong with your mod installation!", 4); Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1); return; } if (!_contentPacks.Exists) { _contentPacks.Create(); } Log("Info:\r\nMod's folder name: " + Location.Name + "\r\nPlugins path: " + Paths.PluginPath + "\r\nContentPacks path: " + _contentPacks.FullName); TextureFile.BlitBleedSetup(); Log("Calling _harmony.PatchAll"); _harmony.PatchAll(Assembly.GetExecutingAssembly()); TexReplacer.Go(); Log("Loading Vanilla assets!", 2); LoadVanillaAssets(); HairPartFolder.SetupVanillaHairParts(); MiscPartFolder.SetupVanillaMiscParts(); TailPartFolder.SetupVanillaTailParts(); EarsPartFolder.SetupVanillaEarsParts(); if (MainConfig._current._unarmedDiveJump.Value && WeaponItemFolder._weaponTypes.TryGetValue("Unarmed", out ScriptableWeaponType value)) { WeaponTypeCombatParams val2 = value._weaponData._weaponTypeCombatParams[0]; val2._allowJumpAttack = true; val2._timeBeforeJumpAttack = 0.08f; val2._JumpAttackJumpForce = 50f; val2._JumpAttackFowardForce = 90f; val2._JumpAttackJumpGravityMultiply = 50f; val2._jumpLandDelayTime = 0.5f; } Cond.IDSet(); Log("Making Internal Sprites!", 2); string[] array = new string[13] { "based", "Nokia_3310", "BrokenDye", "joker", "VanityIco", "PortalIco", "ExitIco", "ForwardIco", "BackIco", "NextIco", "PreviousIco", "StorageIco", "DungeonIco" }; string[] array2 = array; foreach (string text in array2) { Sprites.Add(text, MakeSprite(Internal.FullName, text)); } MainThreadJobber._jobber = _homebreweryGameObject.AddComponent(); if (MainConfig._current._newContentLoader.Value) { ContentLoader._current = _homebreweryGameObject.AddComponent(); } else { OldContentLoader.Load(); } Log("Registering chat commands!"); Cmd.RegisterCommands(); if (CT.Enabled) { CT.RegisterListeners(); } _awakeCompleted = true; Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1); } internal static async Task Cache_HBScriptableAssets() { if (!_awakeCompleted) { Log("HB.Awake() did not complete, skipping Cache_HBScriptableAssets()!", 4); return; } Log("Cache_HBScriptableAssets()", 1); Log("Awaiting all import tasks!"); await Task.WhenAll(OldContentLoader._importTasks).ConfigureAwait(continueOnCapturedContext: true); OldContentLoader._importTasks.Clear(); ModelAliases(); Log("Doing model part assignments!", 2); foreach (List value7 in OldContentLoader._modelPartAssignments.Values) { foreach (Action item in value7) { item(); } } if (GM._cachedScriptableConditions.TryGetValue(0, out var value)) { ScriptableStatusCondition val = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null); if (val != null) { Cond._bleed = val; } } if (GM._cachedScriptableConditions.TryGetValue(2, out value)) { ScriptableStatusCondition val2 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null); if (val2 != null) { Cond._cold = val2; } } if (GM._cachedScriptableConditions.TryGetValue(1, out value)) { ScriptableStatusCondition val3 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null); if (val3 != null) { Cond._burn = val3; } } if (GM._cachedScriptableConditions.TryGetValue(8, out value)) { ScriptableStatusCondition val4 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null); if (val4 != null) { Cond._poison = val4; } } if (MainConfig._current._newContentLoader.Value) { ContentLoader._current.InitAllItems(); MouthPartFolder.ByrdleBeaksAndMouths(); } Log("Sorting out fancy consumables!", 2); foreach (Action consumableDXAction in OldContentLoader._consumableDXActions) { consumableDXAction(); } OldContentLoader._consumableDXActions.Clear(); Log("Inserting Custom items!"); foreach (Action addNewItem in ItemCraft._addNewItems) { addNewItem(); } ItemCraft._addNewItems.Clear(); Log("Sorting out weapon properties!", 2); foreach (Action weaponActionsAction in OldContentLoader._weaponActionsActions) { weaponActionsAction(); } OldContentLoader._weaponActionsActions.Clear(); Log("Inserting Custom parts!"); if (_raceStructs.TryGetValue(RaceType.Byrdle, out var value2)) { Log("Inserting Custom parts for Byrdle!", 1); OldContentLoader._addParts[RaceType.Byrdle][FolderType.Mouth] = OldContentLoader._addParts[RaceType.Byrdle][FolderType.Mouth].OrderBy((AnyThing m) => (!m._beak) ? 1 : 0).ToList(); OldContentLoader.PartInserter(value2); } if (_raceStructs.TryGetValue(RaceType.Chang, out var value3)) { Log("Inserting Custom parts for Chang!", 1); OldContentLoader.PartInserter(value3); } if (_raceStructs.TryGetValue(RaceType.Imp, out var value4)) { Log("Inserting Custom parts for Imp!", 1); OldContentLoader.PartInserter(value4); } if (_raceStructs.TryGetValue(RaceType.Kubold, out var value5)) { Log("Inserting Custom parts for Kubold!", 1); OldContentLoader.PartInserter(value5); } if (_raceStructs.TryGetValue(RaceType.Poon, out var value6)) { Log("Inserting Custom parts for Poon!", 1); OldContentLoader.PartInserter(value6); } if (MainConfig._current._spreadVanillaParts.Value) { Log("Sharing Vanilla parts around!"); Log("Sharing Vanilla parts to Byrdle!", 1); PartSpreader(value2); Log("Sharing Vanilla parts to Chang!", 1); PartSpreader(value3); Log("Sharing Vanilla parts to Imp!", 1); PartSpreader(value4); Log("Sharing Vanilla parts to Kubold!", 1); PartSpreader(value5); Log("Sharing Vanilla parts to Poon!", 1); PartSpreader(value6); } Log("Generating a shop source for some vanilla items!", 2); GetVanillaItems(); Log("Organising the shop sources!", 2); for (int i = 1; i < OldContentLoader._modShops.Count; i++) { OldContentLoader._modShops[i].SortThem(); OldContentLoader._modShops[i].ChunkThem(); OldContentLoader._modShops[0]._items_Cons.AddRange(OldContentLoader._modShops[i]._items_Cons); OldContentLoader._modShops[0]._items_Gear.AddRange(OldContentLoader._modShops[i]._items_Gear); OldContentLoader._modShops[0]._items_Trad.AddRange(OldContentLoader._modShops[i]._items_Trad); } OldContentLoader._modShops[0].ChunkThem(); if (MainConfig._current._condenseSmallMods.Value > 0) { Log("CondenseSmallMods config setting is active!", 2); ModShop modShop = new ModShop("Small Mods"); foreach (ModShop item2 in OldContentLoader._modShops.ToList()) { int num = item2._items_Gear.Count + item2._items_Trad.Count + item2._items_Cons.Count; if (num <= MainConfig._current._condenseSmallMods.Value) { modShop._items_Gear.AddRange(item2._items_Gear); modShop._items_Cons.AddRange(item2._items_Cons); modShop._items_Trad.AddRange(item2._items_Trad); OldContentLoader._modShops.Remove(item2); } } modShop.SortThem(); modShop.ChunkThem(); OldContentLoader._modShops.Add(modShop); } if (!MainConfig._current._noShop.Value) { Shop._current = _homebreweryGameObject.AddComponent(); } else { Log("NoShop config setting is set to true, so the mod item shop will not be accessible!", 3); } Phone._current = _homebreweryGameObject.AddComponent(); } internal static void ModelAliases() { string[][] array = new string[12][] { new string[2] { "hood", "hood01" }, new string[2] { "robeSkirt", "robeSkirt01" }, new string[2] { "armCuffs_00", "armCuff01" }, new string[2] { "armCuffs_01", "armCuff02" }, new string[2] { "armCuffs_02", "armCuff03" }, new string[2] { "chestMesh_00", "chestpiece03" }, new string[2] { "hipMesh_00", "legPads03" }, new string[2] { "legCuffs_00", "legCuffs03" }, new string[2] { "legCuffs_01", "shinPads01" }, new string[2] { "chestTabard_00", "chestTabard02" }, new string[2] { "chestTabard_01", "chestTabard03" }, new string[2] { "belt_00", "beltSash02" } }; string[][] array2 = array; foreach (string[] array3 in array2) { if (ARend.TryGetValue(array3[0], out ScriptableArmorRender value)) { ARend[array3[1]] = value; } } string[][] array4 = new string[5][] { new string[2] { "_collar_00", "vikingArmor_collar" }, new string[2] { "Catman-Homebrewery-Mesh-warlockArmor_collar", "warlockArmor_collar" }, new string[2] { "Catman-Homebrewery-Mesh-thiefArmor_collar", "thiefArmor_collar" }, new string[2] { "Catman-Homebrewery-Mesh-mysticArmor_collar", "mysticArmor_collar" }, new string[2] { "Catman-Homebrewery-Mesh-maidArmor_collar", "maidArmor_collar" } }; string[][] array5 = array4; foreach (string[] array6 in array5) { AMesh[array6[1]] = (Mesh)(AMesh.TryGetValue(array6[0], out Mesh value2) ? ((object)value2) : ((object)Assign.NothingMesh)); } } internal static void WeaponTypeAliases() { Dictionary dictionary = new Dictionary { ["Katars"] = "Dexterity_Melee_2H", ["Scepter"] = "Mind_Ranged_1H", ["Bell"] = "Mind_Ranged_2H", ["Blade"] = "Sword", ["Sword"] = "Strength_Melee_1H0", ["Mace"] = "Strength_Melee_1H1", ["Bow"] = "Dexterity_Ranged_2H0", ["Shotgun"] = "Dexterity_Ranged_2H1", ["Hammer"] = "Strength_Melee_2H0", ["Greatblade"] = "Strength_Melee_2H1", ["Polearm"] = "Strength_Melee_2H2" }; foreach (var (key, key2) in dictionary) { if (WeaponItemFolder._weaponTypes.TryGetValue(key, out ScriptableWeaponType value)) { WeaponItemFolder._weaponTypes[key2] = value; } } } private static void PartSpreader(RaceStruct thisrace) { foreach (RaceStruct value in _raceStructs.Values) { if (value._type == thisrace._type) { continue; } int num = 0; EyeTextureGroup[] eyes = value._eyes; foreach (EyeTextureGroup val in eyes) { int index = thisrace._scriptRace._eyeTextures.Length + num; string name = $"Atlyss-Eyes-{value._scriptRace._raceName}{num}"; num++; EyesPartFolder._dictionary.AddName(thisrace._type, name, index); } ScriptablePlayerRace scriptRace = thisrace._scriptRace; EyeTextureGroup[] eyeTextures = thisrace._scriptRace._eyeTextures; EyeTextureGroup[] eyes2 = value._eyes; int num2 = 0; EyeTextureGroup[] array = (EyeTextureGroup[])(object)new EyeTextureGroup[eyeTextures.Length + eyes2.Length]; ReadOnlySpan readOnlySpan = new ReadOnlySpan(eyeTextures); readOnlySpan.CopyTo(new Span(array).Slice(num2, readOnlySpan.Length)); num2 += readOnlySpan.Length; ReadOnlySpan readOnlySpan2 = new ReadOnlySpan(eyes2); readOnlySpan2.CopyTo(new Span(array).Slice(num2, readOnlySpan2.Length)); num2 += readOnlySpan2.Length; scriptRace._eyeTextures = array; num = 0; if (thisrace._type != RaceType.Kubold) { MouthTextureGroup[] mouth = value._mouth; foreach (MouthTextureGroup val2 in mouth) { int index = thisrace._scriptRace._mouthTextures.Length + num; string name2 = $"Atlyss-Mouth-{value._scriptRace._raceName}{num}"; num++; MouthPartFolder._dictionary.AddName(thisrace._type, name2, index); } ScriptablePlayerRace scriptRace2 = thisrace._scriptRace; MouthTextureGroup[] mouthTextures = thisrace._scriptRace._mouthTextures; MouthTextureGroup[] mouth2 = value._mouth; num2 = 0; MouthTextureGroup[] array2 = (MouthTextureGroup[])(object)new MouthTextureGroup[mouthTextures.Length + mouth2.Length]; ReadOnlySpan readOnlySpan3 = new ReadOnlySpan(mouthTextures); readOnlySpan3.CopyTo(new Span(array2).Slice(num2, readOnlySpan3.Length)); num2 += readOnlySpan3.Length; ReadOnlySpan readOnlySpan4 = new ReadOnlySpan(mouth2); readOnlySpan4.CopyTo(new Span(array2).Slice(num2, readOnlySpan4.Length)); num2 += readOnlySpan4.Length; scriptRace2._mouthTextures = array2; } num = 0; SkinTextureGroup[] skins = value._skins; foreach (SkinTextureGroup val3 in skins) { int index = thisrace._scriptRace._skinTextureGroups.Length + num; string name3 = $"Atlyss-Skin-{value._scriptRace._raceName}{num}"; num++; SkinPartFolder._dictionary.AddName(thisrace._type, name3, index); } ScriptablePlayerRace scriptRace3 = thisrace._scriptRace; SkinTextureGroup[] skinTextureGroups = thisrace._scriptRace._skinTextureGroups; SkinTextureGroup[] skins2 = value._skins; num2 = 0; SkinTextureGroup[] array3 = (SkinTextureGroup[])(object)new SkinTextureGroup[skinTextureGroups.Length + skins2.Length]; ReadOnlySpan readOnlySpan5 = new ReadOnlySpan(skinTextureGroups); readOnlySpan5.CopyTo(new Span(array3).Slice(num2, readOnlySpan5.Length)); num2 += readOnlySpan5.Length; ReadOnlySpan readOnlySpan6 = new ReadOnlySpan(skins2); readOnlySpan6.CopyTo(new Span(array3).Slice(num2, readOnlySpan6.Length)); num2 += readOnlySpan6.Length; scriptRace3._skinTextureGroups = array3; } } private static void GetVanillaItems() { ModShop modShop = new ModShop("Vanilla Items"); OldContentLoader._modShops.Add(modShop); (string, int)[] array = new(string, int)[13] { ("Red Dye", 1), ("Orange Dye", 2), ("Lime Dye", 3), ("Green Dye", 4), ("Blue Dye", 5), ("Cyan Dye", 6), ("Yellow Dye", 7), ("Brown Dye", 8), ("Pink Dye", 9), ("Purple Dye", 10), ("White Dye", 11), ("Grey Dye", 12), ("Black Dye", 13) }; (string, int)[] array2 = array; for (int i = 0; i < array2.Length; i++) { (string, int) tuple = array2[i]; string item = tuple.Item1; int item2 = tuple.Item2; VanillaItem vanillaItem = new VanillaItem(null, null, FolderType.Dye, (ShopTab)1) { _itemName = item, Added = true, SortTag = (SortTag)2, sortindex = item2 }; vanillaItem.ShopItem._scriptItem = GM._cachedScriptableItems[item]; vanillaItem.ShopItem._itemNameTag = item; modShop._items_Cons.Add(vanillaItem); ScriptableItem scriptItem = vanillaItem.ShopItem._scriptItem; ScriptableArmorDye val = (ScriptableArmorDye)(object)((scriptItem is ScriptableArmorDye) ? scriptItem : null); if (val != null) { ((ScriptableConsumable)val)._unperishable = true; } } string[] array3 = new string[5] { "Necro Marrow", "Leather Top", "Sagecloth Top", "Aero Top", "Nutso Top" }; string[] array4 = array3; foreach (string text in array4) { VanillaItem vanillaItem2 = new VanillaItem(null, null, FolderType.Chestpiece, (ShopTab)0) { _itemName = text, Added = true }; vanillaItem2.ShopItem._scriptItem = GM._cachedScriptableItems[text]; vanillaItem2.ShopItem._itemNameTag = text; modShop._items_Gear.Add(vanillaItem2); } array3 = new string[5] { "Necro Caustics", "Leather Britches", "Sagecloth Shorts", "Aero Pants", "Nutso Pants" }; string[] array5 = array3; foreach (string text2 in array5) { VanillaItem vanillaItem3 = new VanillaItem(null, null, FolderType.Leggings, (ShopTab)0) { _itemName = text2, Added = true }; vanillaItem3.ShopItem._scriptItem = GM._cachedScriptableItems[text2]; vanillaItem3.ShopItem._itemNameTag = text2; modShop._items_Gear.Add(vanillaItem3); } } private static Sprite MakeSprite(string path, string name) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) string text = PathUtils.LongCombine(path, name + ".png"); byte[] array = Array.Empty(); if (!File.Exists(text)) { string text2 = text; int bepinPathLength = _bepinPathLength; Log("[InternalFileMissing] Could not find the file: \"" + text2.Substring(bepinPathLength, text2.Length - bepinPathLength) + "\"", 4); } else { array = File.ReadAllBytes(text); } Texture2D val = new Texture2D(1, 1, (TextureFormat)5, false) { name = name + "_Tex", anisoLevel = 16, filterMode = (FilterMode)MainConfig._current._filterMode.Value, mipMapBias = 0f }; ImageConversion.LoadImage(val, array, true); Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); ((Object)val2).name = name + "_Spr"; return val2; } private void Update() { //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Invalid comparison between Unknown and I4 if (Input.GetKey((KeyCode)308) && Input.GetKeyUp((KeyCode)120)) { _hotkeysOn = !_hotkeysOn; Log($"Toggled hotkeysOn to {_hotkeysOn}"); } if (!_chatIsKill) { try { SlashShortcut(); } catch (Exception ex) when (((ex is MissingFieldException || ex is NullReferenceException) ? 1 : 0) != 0) { _chatIsKill = true; Log("SlashShortcut experienced a MissingField or NullRef Exception! Not trying again.", 4); } } if (!_hotkeysOn) { return; } bool flag = CheckMainPlayer() && !Player._mainPlayer._inChat && !Player._mainPlayer._inUI; if (!flag && Input.GetKeyDown((KeyCode)114) && Controls._anyCtrl) { if (!Controls._anyShift) { OldContentLoader.ReloadAll(nocheck: false); } else { OldContentLoader.ReloadAll(nocheck: true); } } if (flag) { if (!_shownUpdateMessage) { _shownUpdateMessage = true; if (!MainConfig._current._alwaysShowUpdateMsg.Value) { MainConfig._current._updateMessage.Value = UpdateCount; } } _foodLevel -= Time.deltaTime / MainConfig._current._foodDigestRate.Value; if (_foodLevel < 0f) { _foodLevel = 0f; } } MainMenuManager? obj = MainMenuManager._current.L(); if (obj != null && (int)obj._mainMenuCondition == 1 && (Object)(object)MainMenuManager._current._characterSelectManager.L()?._setRaceModelED.L()?._playerRaceModel != (Object)null && !Controls._anyCtrl) { if (Input.GetKeyUp((KeyCode)119)) { MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)1, 2f); } if (Input.GetKeyUp((KeyCode)115)) { MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)2, 2f); } if (Input.GetKeyUp((KeyCode)97)) { MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)3, 2f); } if (Input.GetKeyUp((KeyCode)100)) { MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)4, 2f); } if (Input.GetKeyUp((KeyCode)101)) { MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)8, 2f); } if (Input.GetKeyUp((KeyCode)113)) { MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)7, 2f); } if (Input.GetKeyUp((KeyCode)114)) { MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)5, 2f); } if (Input.GetKeyUp((KeyCode)102)) { MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_MouthCondition((MouthCondition)1, 2f); } } } private void SlashShortcut() { if (MainConfig._current._slashShortcut.Value && Object.op_Implicit((Object)(object)Player._mainPlayer) && !Player._mainPlayer._bufferingStatus && !HostConsole._current._isOpen && !DialogManager._current._isDialogEnabled && !SettingsManager._current._isOpen && !ChatBehaviour._current._focusedInChat && ChatBehaviour._current._inputBuffer == 0f && Input.GetKeyDown((KeyCode)47)) { if (Object.op_Implicit((Object)(object)ChatBehaviour._current._focusInputSfx)) { ChatBehaviour._current.aSrc.PlayOneShot(ChatBehaviour._current._focusInputSfx, 0.55f); } ChatBehaviour._current._chatAssets._chatInput.ActivateInputField(); ChatBehaviour._current._focusedInChat = true; ChatBehaviour._current._inputBuffer = 0.12f; ((MonoBehaviour)this).StartCoroutine(AddSlash()); } } [IteratorStateMachine(typeof(d__69))] private static IEnumerator AddSlash() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__69(0); } [DebuggerNonUserCode] internal static void DropMe(string item, int n = 1) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown if (!Cmd.ItemMatcher(item, out ScriptableItem firstmatch)) { Log(item + " is not a real item!", 3); return; } GameManager._current.Client_SpawnLocalItemObject(new ItemData { _itemName = firstmatch._itemName, _quantity = n }, ((NetworkBehaviour)Player._mainPlayer).netIdentity, ((Component)Player._mainPlayer).transform.position, 0, ((Component)Player._mainPlayer).transform, true); } internal static void LoadVanillaAssets() { //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Expected O, but got Unknown //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown _playerRace_imp = Resources.Load("_race/01_race_imp/playerrace_imp"); _playerRace_poon = Resources.Load("_race/02_race_poon/playerrace_poon"); _playerRace_kubold = Resources.Load("_race/03_race_kubold/playerrace_kubold"); _playerRace_byrdle = Resources.Load("_race/04_race_byrdle/playerrace_byrdle"); _playerRace_chang = Resources.Load("_race/05_race_chang/playerrace_chang"); _byrdleVanillaHairsCount = _playerRace_byrdle._hairStyleMeshes.Length; _raceStructs.Add(RaceType.Imp, new RaceStruct(RaceType.Imp, _playerRace_imp, _playerRace_imp._raceModel.GetComponent())); _raceStructs.Add(RaceType.Poon, new RaceStruct(RaceType.Poon, _playerRace_poon, _playerRace_poon._raceModel.GetComponent())); _raceStructs.Add(RaceType.Kubold, new RaceStruct(RaceType.Kubold, _playerRace_kubold, _playerRace_kubold._raceModel.GetComponent())); _raceStructs.Add(RaceType.Chang, new RaceStruct(RaceType.Chang, _playerRace_chang, _playerRace_chang._raceModel.GetComponent())); _playerRace_byrdle._disableEarSelector = false; _playerRace_byrdle._disableMouthSelector = false; MouthTextureGroup val = new MouthTextureGroup { _closed = Resources.Load("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_02"), _open = Resources.Load("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_02") }; MouthTextureGroup val2 = new MouthTextureGroup { _closed = Resources.Load("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_01"), _open = Resources.Load("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_01") }; MouthTextureGroup val3 = new MouthTextureGroup { _closed = (Texture)(object)Texture2D.blackTexture, _open = (Texture)(object)Texture2D.blackTexture }; MouthTextureGroup val4 = new MouthTextureGroup { _closed = null, _open = null }; _playerRace_byrdle._mouthTextures = Array.Empty(); _raceStructs.Add(RaceType.Byrdle, new RaceStruct(RaceType.Byrdle, _playerRace_byrdle, _playerRace_byrdle._raceModel.GetComponent())); _byrdleVanillaBeaksCount = _raceStructs[RaceType.Byrdle]._miscSkinned.Length; _playerRace_byrdle._mouthTextures = (MouthTextureGroup[])(object)new MouthTextureGroup[4] { val4, val, val2, val3 }; MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "UseBeak'sTextureIfAny", 0); MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "Atlyss-Byrdle-Mouth-ByrdleBeakTex_02", 1); MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "Atlyss-Byrdle-Mouth-ByrdleBeakTex_01", 2); MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "Catman-Homebrewery-Byrdle-Mouth-hbInvisBeak", 3); _unlitColorAdjustCutout = Resources.Load("_graphic/_shader/unlit_coloradjust_cutout"); List list = new List(); list.AddRange(Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_armormeshes/_collars")); list.AddRange(Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_armormeshes/_shoulderpads/")); list.AddRange(Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_armormeshes/_helms/")); list.AddRange(Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_armormeshes/_capes/")); list.AddRange(Resources.LoadAll("_graphic/_mesh/03_item/03_shield/")); list.AddRange(Resources.LoadAll("_graphic/_mesh/03_item/01_weapon/")); IEnumerable enumerable = new <>z__ReadOnlyList(list); Mesh[] array = Resources.LoadAll("_graphic/_mesh/03_item/01_weapon/weapon_models"); foreach (Mesh val5 in array) { Resources.UnloadAsset((Object)(object)val5); } foreach (Mesh item in enumerable) { if (!((Object)(object)item == (Object)null)) { if (!AMesh.TryAdd(((Object)item).name, item) && !AMesh.TryAdd(((Object)item).name + "HB", item)) { Log("Vanilla Mesh Name: " + ((Object)item).name + " is too frequent! Cannot add to Mesh Dictionary!", 4); } MeshObj.StashVanillaMesh(item, out string _); } } if (AMesh.Count == 0) { Log("No vanilla Meshes loaded! Gonna have to check the container paths in the assets!", 4); } else { DataExtractor._loadedAssetsList.AppendLine("Gear Meshes:"); foreach (string key in AMesh.Keys) { DataExtractor._loadedAssetsList.AppendLine(key); } } List list2 = new List(); list2.AddRange(Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/_hairstyles/")); list2.AddRange(Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_racemesh_chang/_hairstyles/")); list2.AddRange(Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_racemesh_imp/_hairstyles/")); list2.AddRange(Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_racemesh_kobold/_hairstyles/")); list2.AddRange(Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_racemesh_poon/_hairstyles/")); list2.Add(((IEnumerable)Resources.LoadAll("_graphic/_mesh/01_creep/mouth/mouthenemy_fbx")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("_mouthEnemy_hair", StringComparison.OrdinalIgnoreCase)))); list2.Add(((IEnumerable)Resources.LoadAll("_graphic/_mesh/01_creep/mouth/mouthenemy_alt00_fbx")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("_mouthEnemy_alt00_hair", StringComparison.OrdinalIgnoreCase)))); list2.Add(((IEnumerable)Resources.LoadAll("_graphic/_mesh/02_friendlynpc/angela/angela_mesh")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("angela_hairTuft", StringComparison.OrdinalIgnoreCase)))); list2.Add(((IEnumerable)Resources.LoadAll("_graphic/_mesh/02_friendlynpc/rukkah/ruko_fbx")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("_ruko_hair", StringComparison.OrdinalIgnoreCase)))); list2.Add(((IEnumerable)Resources.LoadAll("_graphic/_mesh/02_friendlynpc/sally/sally_fbx")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("_sally_hair", StringComparison.OrdinalIgnoreCase)))); list2.Add(((IEnumerable)Resources.LoadAll("_graphic/_mesh/02_friendlynpc/sallyworkers/_sallyworker_00/_sallyworker_00")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("_sallyworker00_hair", StringComparison.OrdinalIgnoreCase)))); list2.Add(((IEnumerable)Resources.LoadAll("_graphic/_mesh/02_friendlynpc/vivian/vivi_fbx")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("_vivi_hair", StringComparison.OrdinalIgnoreCase)))); IEnumerable enumerable2 = new <>z__ReadOnlyList(list2); List list3 = new List(); foreach (Mesh item2 in enumerable2) { if (!((Object)(object)item2 == (Object)null) && MeshObj.StashVanillaMesh(item2, out string meshname2)) { list3.Add(meshname2); } } if (list3.Count == 0) { Log("No vanilla Hair Meshes loaded! Gonna have to check the container paths in the assets!", 4); } else { DataExtractor._loadedAssetsList.AppendLine("\nHair Meshes:"); foreach (string item3 in list3) { DataExtractor._loadedAssetsList.AppendLine(item3); } } Mesh[] array2 = Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_racemesh_imp/_horns/"); Mesh[] array3 = Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_racemesh_kobold/_horns/"); Mesh[] array4 = Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_racemesh_poon/_horns/"); int num = 0; Mesh[] array5 = (Mesh[])(object)new Mesh[8 + (array2.Length + array3.Length + array4.Length)]; ReadOnlySpan readOnlySpan = new ReadOnlySpan(array2); readOnlySpan.CopyTo(new Span(array5).Slice(num, readOnlySpan.Length)); num += readOnlySpan.Length; ReadOnlySpan readOnlySpan2 = new ReadOnlySpan(array3); readOnlySpan2.CopyTo(new Span(array5).Slice(num, readOnlySpan2.Length)); num += readOnlySpan2.Length; ReadOnlySpan readOnlySpan3 = new ReadOnlySpan(array4); readOnlySpan3.CopyTo(new Span(array5).Slice(num, readOnlySpan3.Length)); num += readOnlySpan3.Length; array5[num] = ((IEnumerable)Resources.LoadAll("_graphic/_mesh/01_creep/lordboar/lordboar")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("_lordBoar_horns", StringComparison.OrdinalIgnoreCase))); num++; array5[num] = ((IEnumerable)Resources.LoadAll("_graphic/_mesh/01_creep/mekboar/mekboar_fbx")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("mekboar_horn", StringComparison.OrdinalIgnoreCase))); num++; array5[num] = ((IEnumerable)Resources.LoadAll("_graphic/_mesh/01_creep/moth/mothcreep_fbx")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("_moth_horn", StringComparison.OrdinalIgnoreCase))); num++; array5[num] = ((IEnumerable)Resources.LoadAll("_graphic/_mesh/01_creep/rageboar/rageboar_fbx")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("rageBoar_horn", StringComparison.OrdinalIgnoreCase))); num++; array5[num] = ((IEnumerable)Resources.LoadAll("_graphic/_mesh/01_creep/warboar/warboar_fbx")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("warboar_horn", StringComparison.OrdinalIgnoreCase))); num++; array5[num] = ((IEnumerable)Resources.LoadAll("_graphic/_mesh/01_creep/wizboar/wizboar")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("wizboar_scepter", StringComparison.OrdinalIgnoreCase))); num++; array5[num] = ((IEnumerable)Resources.LoadAll("_graphic/_mesh/02_friendlynpc/angela/angela_mesh")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("angela_horns", StringComparison.OrdinalIgnoreCase))); num++; array5[num] = ((IEnumerable)Resources.LoadAll("_graphic/_mesh/02_friendlynpc/enok/enok_fbx")).FirstOrDefault((Func)((Mesh m) => ((Object)m).name.Equals("_enok_horns", StringComparison.OrdinalIgnoreCase))); IEnumerable enumerable3 = new <>z__ReadOnlyArray(array5); List list4 = new List(); foreach (Mesh item4 in enumerable3) { if (!((Object)(object)item4 == (Object)null) && MeshObj.StashVanillaMesh(item4, out string meshname3)) { list4.Add(meshname3); } } if (list4.Count == 0) { Log("No vanilla Static Misc Meshes loaded! Gonna have to check the container paths in the assets!", 4); } else { DataExtractor._loadedAssetsList.AppendLine("\nStatic Misc Meshes:"); foreach (string item5 in list4) { DataExtractor._loadedAssetsList.AppendLine(item5); } } ScriptableArmorRender[] array6 = Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_armormeshes"); foreach (ScriptableArmorRender val6 in array6) { ARend[((Object)val6).name.Replace("00_armorRender_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("armorRender_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("helmRender_", string.Empty, StringComparison.OrdinalIgnoreCase)] = val6; ArmorRenderFile.StashVanillaArmorRender(val6); } if (ARend.Count == 0) { Log("No vanilla ScriptableArmorRenders loaded! Gonna have to check the container paths in the assets!", 4); } else { DataExtractor._loadedAssetsList.AppendLine("\nArmorRenders:"); foreach (string key2 in ARend.Keys) { DataExtractor._loadedAssetsList.AppendLine(key2); } } DataExtractor._loadedAssetsList.AppendLine("\nWeaponTypes:"); ScriptableWeaponType[] array7 = Resources.LoadAll("_weapontype/"); foreach (ScriptableWeaponType val7 in array7) { WeaponItemFolder._weaponTypes[val7._weaponTypeClassTag] = val7; DataExtractor._loadedAssetsList.AppendLine(val7._weaponTypeClassTag); } WeaponTypeAliases(); if (WeaponItemFolder._weaponTypes.Count == 0) { Log("No ScriptableWeaponTypes loaded! Gonna have to check the container paths in the assets!", 4); } List list5 = new List(); list5.AddRange(Resources.LoadAll("_item/01_equipment/02_weapon/01_dexterity/00_rangeweapon_projectilesets/")); list5.AddRange(Resources.LoadAll("_item/01_equipment/02_weapon/01_dexterity/00_shotgunprojectiles/")); list5.AddRange(Resources.LoadAll("_item/01_equipment/02_weapon/02_mind/scepterprojectilesets/")); list5.AddRange(Resources.LoadAll("_item/01_equipment/02_weapon/02_mind/bell_projectilesets/")); IEnumerable enumerable4 = new <>z__ReadOnlyList(list5); foreach (ScriptableWeaponProjectileSet item6 in enumerable4) { WeaponItemFolder._projectileSets[((Object)item6).name.Replace("weaponProjectileSet_", string.Empty, StringComparison.OrdinalIgnoreCase)] = item6; } if (WeaponItemFolder._projectileSets.Count == 0) { Log("No ScriptableWeaponProjectileSets loaded! Gonna have to check the container paths in the assets!", 4); } else { DataExtractor._loadedAssetsList.AppendLine("\nProjectileSets:"); foreach (string key3 in WeaponItemFolder._projectileSets.Keys) { DataExtractor._loadedAssetsList.AppendLine(key3); } } ConsumableItemFolder.ConsumableObject = Resources.Load("_item/02_consumable/03_status/_consumableeffect_healthconsumable"); if ((Object)(object)ConsumableItemFolder.ConsumableObject == (Object)null) { Log("_consumableeffect_healthconsumable did not load! Gonna have to check the container paths in the assets!", 4); } if ((Object)(object)DyeItemFolder.DyeObject == (Object)null) { Log("_consumableeffect_blackdye did not load! Gonna have to check the container paths in the assets!", 4); } List list6 = new List(); list6.AddRange(Resources.LoadAll("_item/02_consumable/01_dye/")); list6.AddRange(Resources.LoadAll("_item/02_consumable/02_skillscroll/")); list6.AddRange(Resources.LoadAll("_item/02_consumable/03_status/")); list6.AddRange(Resources.LoadAll("_generalconditions/")); list6.AddRange(from c in Resources.LoadAll("_skill/") where ((Object)c).name.StartsWith("_conditionEffect_", StringComparison.OrdinalIgnoreCase) || ((Object)c).name.StartsWith("_conditionObject_", StringComparison.OrdinalIgnoreCase) select c); IEnumerable enumerable5 = new <>z__ReadOnlyList(list6); foreach (GameObject item7 in enumerable5) { string text = ((Object)item7).name.Replace("_consumableEffect_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("_conditionEffect_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("_conditionObject_", string.Empty, StringComparison.OrdinalIgnoreCase); if (!ConsumableObjects.TryAdd(text, item7) && !ConsumableObjects.TryAdd(text + "HB", item7)) { Log("ConsumableObject Name: " + ((Object)item7).name + " is too frequent! Cannot add to ConsumableObjects Dictionary!", 4); } } ConsumableObjects.Remove("crya"); if (ConsumableObjects.Count == 0) { Log("No GameObjects for consumable/condition effects loaded! Gonna have to check the container paths in the assets!", 4); return; } DataExtractor._loadedAssetsList.AppendLine("\nConsumableObjects:"); foreach (string key4 in ConsumableObjects.Keys) { DataExtractor._loadedAssetsList.AppendLine(key4); } } internal static void Nudge(bool cmd = false) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (!cmd) { ErrorPromptTextManager.current.Init_ErrorPrompt("HB - Nudging you out of terrain."); } ((Collider)Player._mainPlayer._pMove._playerController).enabled = false; Player._mainPlayer._pMove.UserCode_Target_SetRotation__Quaternion(Quaternion.LookRotation(Vector3.forward)); Transform transform = ((Component)Player._mainPlayer._pMove._player).transform; transform.position += Vector3.up; ((Collider)Player._mainPlayer._pMove._playerController).enabled = true; } internal static bool EasterEggChance(int mult = 1) { if (MainConfig._current._easterEggChance.Value >= 1) { return Random.Range(0, MainConfig._current._easterEggChance.Value * mult) == 0; } return false; } internal static void MainMenuLabel() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("_GameUI_MainMenu/_mainMenu/Canvas_MainMenu/_text_versionDisplay"); if ((Object)(object)val != (Object)null) { GameObject val2 = Object.Instantiate(val, val.transform, true); ((Object)val2).name = "HomebreweryMainMenuLabel"; val2.transform.localPosition = new Vector3(0f, -23f, 0f); Text component = val2.GetComponent(); component.fontSize = 16; component.text = (EasterEggChance() ? "& Knuckles" : "& Homebrewery 4.7.37"); } } [DebuggerNonUserCode] private static void MakeASkill() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0062: 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_0083: Unknown result type (might be due to invalid IL or missing references) ScriptableSkill skill = ScriptableObject.CreateInstance(); ((Object)skill).name = "SKILL_Cool Skill"; skill._skillName = "Cool Skill"; skill._skillIcon = Sprites["joker"]; skill._skillRankParams = new SkillParameters(); skill._toolTipRequirement = (SkillToolTipRequirement)1; skill._allowAsBonusSkill = true; ScriptableSkillScroll val = ScriptableObject.CreateInstance(); ((ScriptableItem)val)._itemType = (ItemType)1; ((ScriptableItem)val)._itemSortTag = (SortTag)10; ((ScriptableItem)val)._itemName = "Skill Scroll (" + skill._skillName + ")"; ((ScriptableItem)val)._itemDescription = "Teaches the user " + skill._skillName + ", applying it to the general skillbook."; ((ScriptableItem)val)._itemIcon = Sprites["joker"]; val._scriptableSkill = skill; GameManager._current._cachedScriptableSkills.Add(skill._skillName, skill); int index = GameManager._current._foundBonusSkills.FindLastIndex((ScriptableSkill i) => i._skillUtilityType == skill._skillUtilityType && i._skillControlType == skill._skillControlType); GameManager._current._foundBonusSkills.Insert(index, skill); GameManager current = GameManager._current; current._bonusSkillCount++; GameManager._current.Refresh_StaticBonusSkills(); GameManager._current._cachedScriptableItems.Add(((ScriptableItem)val)._itemName, (ScriptableItem)(object)val); } [DebuggerNonUserCode] private static void DumpAllScriptables() { DataExtractor.DumpAllScriptables(); } [DebuggerNonUserCode] private static string MaximumStats() { return DataExtractor.MaximumStats(); } public static bool CheckMainPlayer() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 Player? obj = Player._mainPlayer.L(); if (obj == null) { return false; } return (int)obj._currentGameCondition == 1; } internal static TimeSpan StopTheClock() { _self._stopwatch.Stop(); return _self._stopwatch.Elapsed; } } [HarmonyPatch(typeof(GameManager), "Cache_ScriptableAssets")] public static class WaitingForGameManager { [HarmonyPostfix] [HarmonyWrapSafe] private static async void Cache_ScriptableAssetsPatch() { await HB.Cache_HBScriptableAssets().ConfigureAwait(continueOnCapturedContext: true); } } [HarmonyPatch(typeof(ItemObjectVisual), "Apply_ItemObjectVisual")] public static class ItemObjectLastLong { [HarmonyPostfix] [HarmonyWrapSafe] private static void Init_itemObjectPatch(ItemObjectVisual __instance) { if (Object.op_Implicit((Object)(object)__instance._itemObject._foundItem) && ((ScriptableObject)(object)__instance._itemObject._foundItem).IsIDNegative(out var instanceID)) { if (ItemFolder._dropItemTimers.TryGetValue(instanceID, out var value)) { __instance._itemObject._currentDestroyObjectTimer = value; } ScriptableItem foundItem = __instance._itemObject._foundItem; if ((foundItem is ScriptableShield || foundItem is ScriptableWeapon) ? true : false) { ItemFolder.LookupForAssetLoadAndAssign(instanceID); } } } } [HarmonyPatch(typeof(PlayerMove), "JumpPress")] public static class UnstuckFromGround { [HarmonyPostfix] [HarmonyWrapSafe] private static void JumpPressPatch(PlayerMove __instance) { if (!((NetworkBehaviour)__instance._player).isLocalPlayer) { return; } if (__instance._isJumpInput) { if (!__instance._playerController.isGrounded) { HB._nudge = 0; return; } HB._nudge++; if (HB._nudge >= 3 && __instance._playerController.isGrounded) { HB.Nudge(); HB._nudge = 0; } } else if (!__instance._playerController.isGrounded) { HB._nudge = 0; } } } [HarmonyPatch(typeof(MapInstance), "Handle_VisualSettings")] public static class NoFog { [HarmonyPostfix] [HarmonyWrapSafe] private static void Handle_VisualSettingsPatch() { if (HB.CheckMainPlayer() && MainConfig._current._noFog.Value) { RenderSettings.fog = false; } } } [HarmonyPatch(typeof(MainMenuManager), "Awake")] public static class MainMenuAwake { private static bool _didItAlready; [HarmonyPostfix] [HarmonyWrapSafe] private static void AwakePatch() { HB.MainMenuLabel(); if (Object.op_Implicit((Object)(object)Phone._current) && Object.op_Implicit((Object)(object)Phone._current.DTri) && GameManager._current._cachedScriptableMapDatas.TryGetValue("sanctum", out var value)) { Phone._current.DTri._worldPortalMapData = value; } HB._menuRaceModels = MainMenuManager._current._characterCreationManager._raceDisplayModels.ToArray(); PlayerRaceModel[] menuRaceModels = HB._menuRaceModels; foreach (PlayerRaceModel raceModel in menuRaceModels) { MiscPartFolder.InsertAllPartsAgain(raceModel); TailPartFolder.InsertAllPartsAgain(raceModel); EarsPartFolder.InsertAllPartsAgain(raceModel); } if (UnityEngineObjectExtensions.TryFindAnyObjectByType((FindObjectsInactive)1, out ItemMenuCell foundObject)) { HB._inventoryRaceModels = foundObject._playerRaceModelDisplays.ToArray(); PlayerRaceModel[] inventoryRaceModels = HB._inventoryRaceModels; foreach (PlayerRaceModel raceModel2 in inventoryRaceModels) { MiscPartFolder.InsertAllPartsAgain(raceModel2); TailPartFolder.InsertAllPartsAgain(raceModel2); EarsPartFolder.InsertAllPartsAgain(raceModel2); } } if (!_didItAlready) { _didItAlready = true; if (TexReplacer._texturesReplaced && !SettingsManager._current._settingsProfile._clearUnderClothes) { HB.Log("Textures were replaced but the Disable Undergarments option isn't on! You'll see underwear on the characters until you toggle that option!", 4); } HB.Log($"Took {HB.StopTheClock():m\\:ss\\.fff} from HB's Instantiation to this Log (MainMenuManager.Awake).\n(That includes time spent waiting for the game to load or other mods to do things!)"); } } } public static class PathUtils { public static string LongCombine(params string[] args) { string text = Path.Combine(args); if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { return text; } if (!Path.IsPathFullyQualified(text) || !text.StartsWith("\\\\?\\", StringComparison.InvariantCultureIgnoreCase)) { text = "\\\\?\\" + Path.GetFullPath(text.Replace('/', '\\')); } return text; } public static string StripLongPathPrefix(string path) { if (path == null) { throw new ArgumentNullException("path"); } if (path.StartsWith("\\\\?\\", StringComparison.InvariantCultureIgnoreCase)) { string text = path; path = text.Substring(4, text.Length - 4); } return path; } } public static class ScriptableObjectExtensions { public static bool IsIDNegative(this ScriptableObject scriptableObject) { if ((Object)(object)scriptableObject != (Object)null && Object.op_Implicit((Object)(object)scriptableObject)) { return ((Object)scriptableObject).GetInstanceID() < 0; } return false; } public static bool IsIDNegative(this ScriptableObject scriptableObject, out int instanceID) { if ((Object)(object)scriptableObject == (Object)null || !Object.op_Implicit((Object)(object)scriptableObject)) { instanceID = 0; return false; } instanceID = ((Object)scriptableObject).GetInstanceID(); return instanceID < 0; } } public static class UnityEngineObjectExtensions { public static T? L(this T? obj) where T : Object { if (!Object.op_Implicit((Object)(object)obj)) { return default(T); } return obj; } public static bool TryFindAnyObjectByType(FindObjectsInactive findObjectsInactive, [NotNullWhen(true)] out T? foundObject) where T : Object { //IL_0001: Unknown result type (might be due to invalid IL or missing references) foundObject = Object.FindAnyObjectByType(findObjectsInactive); return (Object)(object)foundObject != (Object)null; } } internal static class ModInfo { public const string PLUGIN_GUID = "Homebrewery"; public const string PLUGIN_NAME = "Homebrewery"; public const string PLUGIN_VERSION = "4.7.37"; } } namespace Homebrewery.Patches { [HarmonyPatch(typeof(CharacterSelectManager))] internal static class CharacterSelectManager_Patches { [HarmonyPatch("Handle_EquipDisplays")] [HarmonyPrefix] [HarmonyWrapSafe] private static void CleanVanitySlots() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)ProfileDataManager._current)) { CharacterFile characterFile = ProfileDataManager._current._characterFile; if (characterFile != null && !characterFile._isEmptySlot) { EquipSyncStruct vanityStruct = ProfileDataManager._current._characterFile._vanityStruct; ClearIfInvalid(ref vanityStruct._helmTag, "Helm"); ClearIfInvalid(ref vanityStruct._chestTag, "Chestpiece"); ClearIfInvalid(ref vanityStruct._leggingTag, "Leggings"); ClearIfInvalid(ref vanityStruct._capeTag, "Cape"); ClearIfInvalid(ref vanityStruct._ringTag, "Ring"); ClearIfInvalid(ref vanityStruct._weaponTag, "Weapon"); ClearIfInvalid(ref vanityStruct._altWeaponTag, "AltWeapon"); ClearIfInvalid(ref vanityStruct._shieldTag, "Shield"); ProfileDataManager._current._characterFile._vanityStruct = vanityStruct; } } } private static void ClearIfInvalid(ref string itemTag, string itemType) { if (!Utility.IsNullOrWhiteSpace(itemTag) && !GameManager._current._cachedScriptableItems.ContainsKey(itemTag)) { HB.Log("Removed Invalid " + itemType + " Vanity: " + itemTag, 3); itemTag = string.Empty; } } } [HarmonyPatch(typeof(DialogTrigger))] internal static class DialogTrigger_Patches { [HarmonyPatch("Start")] [HarmonyPostfix] [HarmonyWrapSafe] private static void DisableKnockbackColliders(DialogTrigger __instance) { if (!MainConfig._current._disableNPCKnockback.Value && !MainConfig._current._disableNPCCollision.Value) { return; } Transform parent = ((Component)__instance).transform.parent; if ((Object)(object)parent == (Object)null) { return; } CapsuleCollider[] componentsInChildren = ((Component)parent).GetComponentsInChildren(); foreach (CapsuleCollider val in componentsInChildren) { if (MainConfig._current._disableNPCKnockback.Value && ((Object)val).name.Equals("_jumpOffCollider", StringComparison.OrdinalIgnoreCase)) { ((Collider)val).enabled = false; } else if (MainConfig._current._disableNPCCollision.Value && (((Object)val).name.StartsWith("_collider", StringComparison.OrdinalIgnoreCase) || ((Object)val).name.StartsWith("_npc", StringComparison.OrdinalIgnoreCase))) { ((Collider)val).enabled = false; } } } } [HarmonyPatch] internal static class Init_ParamsCheckPatches { private static readonly (MethodInfo method, string name)[] _methods = new(MethodInfo, string)[3] { (AccessTools.Method(typeof(VanityMirrorManager), "Send_NewCharacterAppearance", (Type[])null, (Type[])null), "VanityMirrorManager.Send_NewCharacterAppearance"), (AccessTools.Method(typeof(ItemMenuCell), "Apply_RaceModelDisplayParams", (Type[])null, (Type[])null), "ItemMenuCell.Apply_RaceModelDisplayParams"), (AccessTools.FirstMethod(typeof(CharacterSelectManager), (Func)((MethodInfo method) => method.Name.Contains("Init_Display", StringComparison.OrdinalIgnoreCase))), "CharacterSelectManager.Init_Display") }; private static IEnumerable _list = null; [HarmonyPrepare] private static bool Prepare(MethodBase original) { if (original != null) { return true; } bool result = false; (MethodInfo, string)[] methods = _methods; for (int i = 0; i < methods.Length; i++) { var (methodInfo, text) = methods[i]; if (methodInfo == null) { HB.Log("[PatchFail] Init_ParamsCheckPatches.Transpiler target: '" + text + "' wasn't found!", 4); continue; } if (_list == null) { _list = Array.Empty(); } _list = CollectionExtensions.AddItem(_list, methodInfo); result = true; } return result; } [HarmonyTargetMethods] private static IEnumerable TargetMethods() { return _list; } [HarmonyTranspiler] private static IEnumerable Transpiler(IEnumerable code, MethodBase original) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(code, (ILGenerator)null); val = val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction ins) => CodeInstructionExtensions.Calls(ins, AccessTools.Method(typeof(ScriptablePlayerRace), "Init_ParamsCheck", (Type[])null, (Type[])null))), (string)null) }); if (val.IsInvalid) { HB.Log($"Did not manage to CodeMatch Init_ParamsCheck call in {original.DeclaringType}.{original.Name}", 4); return val.InstructionEnumeration(); } val = val.SetInstruction(new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Init_ParamsCheckPatches), "ClampWithYourLimits", (Type[])null, (Type[])null))); HB.Log($"Patched Init_ParamsCheck call in {original.DeclaringType}.{original.Name}", 1); return val.InstructionEnumeration(); } private static PlayerAppearance_Profile ClampWithYourLimits(ScriptablePlayerRace playerRace, PlayerAppearance_Profile profile) { if (MainConfig._current._clampPlayerProportions.Value && Lookup._raceTypes.TryGetValue(playerRace._raceName, out var value)) { return ConfigManager.ClampLimits(useYourLimits: true, value, profile); } return playerRace.Init_ParamsCheck(profile); } } [HarmonyPatch] internal static class Apply_NetworkedCharacterDisplayPatch { private static readonly MethodInfo _method = AccessTools.Method(typeof(PlayerVisual), "Apply_NetworkedCharacterDisplay", (Type[])null, (Type[])null); [HarmonyPrepare] private static bool Prepare() { if (_method == null) { HB.Log("[PatchFail] Apply_NetworkedCharacterDisplayPatch.Transpiler target: 'PlayerVisual.Apply_NetworkedCharacterDisplay' wasn't found!", 4); return false; } return true; } [HarmonyTargetMethod] private static MethodInfo TargetMethod() { return _method; } [HarmonyTranspiler] private static IEnumerable Transpiler(IEnumerable instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val = val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction ins) => CodeInstructionExtensions.Calls(ins, AccessTools.Method(typeof(ScriptablePlayerRace), "Init_ParamsCheck", (Type[])null, (Type[])null))), (string)null) }); if (val.IsInvalid) { HB.Log("Did not manage to CodeMatch Init_ParamsCheck call in PlayerVisual.Apply_NetworkedCharacterDisplay", 4); return val.InstructionEnumeration(); } val = val.SetInstruction(new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Apply_NetworkedCharacterDisplayPatch), "ClampLimits", (Type[])null, (Type[])null))); val = val.MatchBack(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction ins) => CodeInstructionExtensions.LoadsField(ins, AccessTools.Field(typeof(PlayerRaceModel), "_scriptablePlayerRace"), false)), (string)null) }); val = val.RemoveInstruction(); HB.Log("Patched Init_ParamsCheck call in PlayerVisual.Apply_NetworkedCharacterDisplay", 1); return val.InstructionEnumeration(); } private static PlayerAppearance_Profile ClampLimits(PlayerRaceModel raceModel, PlayerAppearance_Profile profile) { CharDisplayManager charDisplayManager = default(CharDisplayManager); if (MainConfig._current._clampPlayerProportions.Value && ((Component)raceModel).TryGetComponent(ref charDisplayManager)) { return ConfigManager.ClampLimits(charDisplayManager._isMainPlayer, charDisplayManager._race, profile); } return raceModel._scriptablePlayerRace.Init_ParamsCheck(profile); } } [HarmonyPatch] internal static class ProfileDataSenderPatch { private static readonly MethodInfo _method = AccessTools.Method(typeof(ProfileDataSender), "Assign_PlayerVisual", (Type[])null, (Type[])null); [HarmonyPrepare] private static bool Prepare() { if (_method == null) { HB.Log("[PatchFail] ProfileDataSenderPatch.Transpiler target: 'ProfileDataSender.Assign_PlayerVisual' wasn't found!", 4); return false; } return true; } [HarmonyTargetMethod] private static MethodInfo TargetMethod() { return _method; } [HarmonyTranspiler] private static IEnumerable Transpiler(IEnumerable instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val = val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction ins) => CodeInstructionExtensions.Calls(ins, AccessTools.Method(typeof(ScriptablePlayerRace), "Init_ParamsCheck", (Type[])null, (Type[])null))), (string)null) }); if (val.IsInvalid) { HB.Log("Did not manage to CodeMatch Init_ParamsCheck call in ProfileDataSender.Assign_PlayerVisual", 4); return val.InstructionEnumeration(); } val = val.SetInstruction(new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(ProfileDataSenderPatch), "NoAlteringIt", (Type[])null, (Type[])null))); HB.Log("Patched Init_ParamsCheck call in ProfileDataSender.Assign_PlayerVisual", 1); return val.InstructionEnumeration(); } private static PlayerAppearance_Profile NoAlteringIt(ScriptablePlayerRace _, PlayerAppearance_Profile profile) { return profile; } } [HarmonyPatch(typeof(ItemListDataEntry))] internal static class ItemListDataEntry_Patches { [HarmonyPatch("Handle_ItemData")] [HarmonyPrefix] [HarmonyWrapSafe] private static void Handle_ItemDataPrefix(ItemListDataEntry __instance) { if (Object.op_Implicit((Object)(object)__instance._itemIcon) && Object.op_Implicit((Object)(object)__instance._scriptableItem) && ((ScriptableObject)(object)__instance._scriptableItem).IsIDNegative()) { __instance._itemIcon.sprite = __instance._scriptableItem._itemIcon; } } [HarmonyPatch("Apply_ItemDataInfo")] [HarmonyPrefix] [HarmonyWrapSafe] private static void Apply_ItemDataInfoPrefix(ItemListDataEntry __instance) { if (Object.op_Implicit((Object)(object)__instance._itemIcon) && Object.op_Implicit((Object)(object)__instance._scriptableItem) && ((ScriptableObject)(object)__instance._scriptableItem).IsIDNegative(out var instanceID)) { ItemFolder.RequestSpriteToLoad(instanceID); } } } [HarmonyPatch(typeof(ItemMenuCell))] internal static class ItemMenuCell_Patches { [CompilerGenerated] private static class <>O { public static UnityAction <0>__PromptButton_UnDyeOption; public static UnityAction <1>__PromptButton_UnDyeAllGear; public static UnityAction <2>__PromptButton_RevertDye; public static UnityAction <3>__PromptButton_UnDyeHelm; public static UnityAction <4>__PromptButton_UnDyeCape; public static UnityAction <5>__PromptButton_UnDyeChest; public static UnityAction <6>__PromptButton_UnDyeLegs; public static UnityAction <7>__PromptButton_UnDyeEyes; public static UnityAction <8>__PromptButton_UnDyeMouth; public static UnityAction <9>__PromptButton_DyeAllGear; public static UnityAction <10>__PromptButton_DyeHelm; public static UnityAction <11>__PromptButton_DyeCape; public static UnityAction <12>__PromptButton_DyeChest; public static UnityAction <13>__PromptButton_DyeLegs; public static UnityAction <14>__PromptButton_DyeEyes; public static UnityAction <15>__PromptButton_DyeMouth; public static UnityAction <16>__PromptButton_ShowItem; public static UnityAction <17>__PromptButton_UseDyeOverride; } private static ItemMenuCell? _instance; private static Button? _showItemButton; private static Button? _undyeButton; private static Button? _undyeAllGearButton; private static Button? _revertDyeButton; private static Button? _undyeHelmButton; private static Button? _undyeCapeButton; private static Button? _undyeChestpieceButton; private static Button? _undyeLeggingsButton; private static Button? _undyeEyesButton; private static Button? _undyeMouthButton; private static Button? _dyeAllGearButton; private static Button? _dyeHelmButton; private static Button? _dyeCapeButton; private static Button? _dyeChestpieceButton; private static Button? _dyeLeggingsButton; private static Button? _dyeEyesButton; private static Button? _dyeMouthButton; [HarmonyPatch("Cell_OnAwake")] [HarmonyPostfix] [HarmonyWrapSafe] private static void Cell_OnAwakePatch(ItemMenuCell __instance) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Expected O, but got Unknown //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Expected O, but got Unknown //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Expected O, but got Unknown //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Expected O, but got Unknown //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Expected O, but got Unknown //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Expected O, but got Unknown //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Expected O, but got Unknown //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Expected O, but got Unknown //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Expected O, but got Unknown //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Expected O, but got Unknown //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Expected O, but got Unknown //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Expected O, but got Unknown //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Expected O, but got Unknown //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Expected O, but got Unknown //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Expected O, but got Unknown //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Expected O, but got Unknown //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Expected O, but got Unknown //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Expected O, but got Unknown //IL_057d: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Expected O, but got Unknown //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Expected O, but got Unknown //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Expected O, but got Unknown //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Expected O, but got Unknown //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Expected O, but got Unknown //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Expected O, but got Unknown //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Expected O, but got Unknown //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_069c: Expected O, but got Unknown if ((Object)(object)_undyeButton == (Object)null) { _undyeButton = CloneButton(__instance, "HB_undyeButton", "Un-Dye..."); ButtonClickedEvent onClick = _undyeButton.onClick; object obj = <>O.<0>__PromptButton_UnDyeOption; if (obj == null) { UnityAction val = PromptButton_UnDyeOption; <>O.<0>__PromptButton_UnDyeOption = val; obj = (object)val; } ((UnityEvent)onClick).AddListener((UnityAction)obj); } if ((Object)(object)_undyeAllGearButton == (Object)null) { _undyeAllGearButton = CloneButton(__instance, "HB_undyeAllButton", "All Gear"); ButtonClickedEvent onClick2 = _undyeAllGearButton.onClick; object obj2 = <>O.<1>__PromptButton_UnDyeAllGear; if (obj2 == null) { UnityAction val2 = PromptButton_UnDyeAllGear; <>O.<1>__PromptButton_UnDyeAllGear = val2; obj2 = (object)val2; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); ((UnityEvent)_undyeAllGearButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_revertDyeButton == (Object)null) { _revertDyeButton = CloneButton(__instance, "HB_revertDyeButton", "Revert"); ButtonClickedEvent onClick3 = _revertDyeButton.onClick; object obj3 = <>O.<2>__PromptButton_RevertDye; if (obj3 == null) { UnityAction val3 = PromptButton_RevertDye; <>O.<2>__PromptButton_RevertDye = val3; obj3 = (object)val3; } ((UnityEvent)onClick3).AddListener((UnityAction)obj3); ((UnityEvent)_revertDyeButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_undyeHelmButton == (Object)null) { _undyeHelmButton = CloneButton(__instance, "HB_undyeHelmButton", "Helm"); ButtonClickedEvent onClick4 = _undyeHelmButton.onClick; object obj4 = <>O.<3>__PromptButton_UnDyeHelm; if (obj4 == null) { UnityAction val4 = PromptButton_UnDyeHelm; <>O.<3>__PromptButton_UnDyeHelm = val4; obj4 = (object)val4; } ((UnityEvent)onClick4).AddListener((UnityAction)obj4); ((UnityEvent)_undyeHelmButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_undyeCapeButton == (Object)null) { _undyeCapeButton = CloneButton(__instance, "HB_undyeCapeButton", "Cape"); ButtonClickedEvent onClick5 = _undyeCapeButton.onClick; object obj5 = <>O.<4>__PromptButton_UnDyeCape; if (obj5 == null) { UnityAction val5 = PromptButton_UnDyeCape; <>O.<4>__PromptButton_UnDyeCape = val5; obj5 = (object)val5; } ((UnityEvent)onClick5).AddListener((UnityAction)obj5); ((UnityEvent)_undyeCapeButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_undyeChestpieceButton == (Object)null) { _undyeChestpieceButton = CloneButton(__instance, "HB_undyeChestpieceButton", "Chest"); ButtonClickedEvent onClick6 = _undyeChestpieceButton.onClick; object obj6 = <>O.<5>__PromptButton_UnDyeChest; if (obj6 == null) { UnityAction val6 = PromptButton_UnDyeChest; <>O.<5>__PromptButton_UnDyeChest = val6; obj6 = (object)val6; } ((UnityEvent)onClick6).AddListener((UnityAction)obj6); ((UnityEvent)_undyeChestpieceButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_undyeLeggingsButton == (Object)null) { _undyeLeggingsButton = CloneButton(__instance, "HB_undyeLeggingsButton", "Legs"); ButtonClickedEvent onClick7 = _undyeLeggingsButton.onClick; object obj7 = <>O.<6>__PromptButton_UnDyeLegs; if (obj7 == null) { UnityAction val7 = PromptButton_UnDyeLegs; <>O.<6>__PromptButton_UnDyeLegs = val7; obj7 = (object)val7; } ((UnityEvent)onClick7).AddListener((UnityAction)obj7); ((UnityEvent)_undyeLeggingsButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_undyeEyesButton == (Object)null) { _undyeEyesButton = CloneButton(__instance, "HB_undyeEyesButton", "Eyes"); ButtonClickedEvent onClick8 = _undyeEyesButton.onClick; object obj8 = <>O.<7>__PromptButton_UnDyeEyes; if (obj8 == null) { UnityAction val8 = PromptButton_UnDyeEyes; <>O.<7>__PromptButton_UnDyeEyes = val8; obj8 = (object)val8; } ((UnityEvent)onClick8).AddListener((UnityAction)obj8); ((UnityEvent)_undyeEyesButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_undyeMouthButton == (Object)null) { _undyeMouthButton = CloneButton(__instance, "HB_undyeMouthButton", "Mouth"); ButtonClickedEvent onClick9 = _undyeMouthButton.onClick; object obj9 = <>O.<8>__PromptButton_UnDyeMouth; if (obj9 == null) { UnityAction val9 = PromptButton_UnDyeMouth; <>O.<8>__PromptButton_UnDyeMouth = val9; obj9 = (object)val9; } ((UnityEvent)onClick9).AddListener((UnityAction)obj9); ((UnityEvent)_undyeMouthButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_dyeAllGearButton == (Object)null) { _dyeAllGearButton = CloneButton(__instance, "HB_dyeAllButton", "All Gear"); ButtonClickedEvent onClick10 = _dyeAllGearButton.onClick; object obj10 = <>O.<9>__PromptButton_DyeAllGear; if (obj10 == null) { UnityAction val10 = PromptButton_DyeAllGear; <>O.<9>__PromptButton_DyeAllGear = val10; obj10 = (object)val10; } ((UnityEvent)onClick10).AddListener((UnityAction)obj10); ((UnityEvent)_dyeAllGearButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_dyeHelmButton == (Object)null) { _dyeHelmButton = CloneButton(__instance, "HB_dyeHelmButton", "Just Helm"); ButtonClickedEvent onClick11 = _dyeHelmButton.onClick; object obj11 = <>O.<10>__PromptButton_DyeHelm; if (obj11 == null) { UnityAction val11 = PromptButton_DyeHelm; <>O.<10>__PromptButton_DyeHelm = val11; obj11 = (object)val11; } ((UnityEvent)onClick11).AddListener((UnityAction)obj11); ((UnityEvent)_dyeHelmButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_dyeCapeButton == (Object)null) { _dyeCapeButton = CloneButton(__instance, "HB_dyeCapeButton", "Just Cape"); ButtonClickedEvent onClick12 = _dyeCapeButton.onClick; object obj12 = <>O.<11>__PromptButton_DyeCape; if (obj12 == null) { UnityAction val12 = PromptButton_DyeCape; <>O.<11>__PromptButton_DyeCape = val12; obj12 = (object)val12; } ((UnityEvent)onClick12).AddListener((UnityAction)obj12); ((UnityEvent)_dyeCapeButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_dyeChestpieceButton == (Object)null) { _dyeChestpieceButton = CloneButton(__instance, "HB_dyeChestpieceButton", "Just Chest"); ButtonClickedEvent onClick13 = _dyeChestpieceButton.onClick; object obj13 = <>O.<12>__PromptButton_DyeChest; if (obj13 == null) { UnityAction val13 = PromptButton_DyeChest; <>O.<12>__PromptButton_DyeChest = val13; obj13 = (object)val13; } ((UnityEvent)onClick13).AddListener((UnityAction)obj13); ((UnityEvent)_dyeChestpieceButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_dyeLeggingsButton == (Object)null) { _dyeLeggingsButton = CloneButton(__instance, "HB_dyeLeggingsButton", "Just Legs"); ButtonClickedEvent onClick14 = _dyeLeggingsButton.onClick; object obj14 = <>O.<13>__PromptButton_DyeLegs; if (obj14 == null) { UnityAction val14 = PromptButton_DyeLegs; <>O.<13>__PromptButton_DyeLegs = val14; obj14 = (object)val14; } ((UnityEvent)onClick14).AddListener((UnityAction)obj14); ((UnityEvent)_dyeLeggingsButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_dyeEyesButton == (Object)null) { _dyeEyesButton = CloneButton(__instance, "HB_dyeEyesButton", "Dye Eyes?"); ButtonClickedEvent onClick15 = _dyeEyesButton.onClick; object obj15 = <>O.<14>__PromptButton_DyeEyes; if (obj15 == null) { UnityAction val15 = PromptButton_DyeEyes; <>O.<14>__PromptButton_DyeEyes = val15; obj15 = (object)val15; } ((UnityEvent)onClick15).AddListener((UnityAction)obj15); ((UnityEvent)_dyeEyesButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_dyeMouthButton == (Object)null) { _dyeMouthButton = CloneButton(__instance, "HB_dyeMouthButton", "Dye Mouth?"); ButtonClickedEvent onClick16 = _dyeMouthButton.onClick; object obj16 = <>O.<15>__PromptButton_DyeMouth; if (obj16 == null) { UnityAction val16 = PromptButton_DyeMouth; <>O.<15>__PromptButton_DyeMouth = val16; obj16 = (object)val16; } ((UnityEvent)onClick16).AddListener((UnityAction)obj16); ((UnityEvent)_dyeMouthButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } if ((Object)(object)_showItemButton == (Object)null) { _showItemButton = CloneButton(__instance, "HB_showItemButton", "Show Off"); ButtonClickedEvent onClick17 = _showItemButton.onClick; object obj17 = <>O.<16>__PromptButton_ShowItem; if (obj17 == null) { UnityAction val17 = PromptButton_ShowItem; <>O.<16>__PromptButton_ShowItem = val17; obj17 = (object)val17; } ((UnityEvent)onClick17).AddListener((UnityAction)obj17); ((UnityEvent)_showItemButton.onClick).AddListener(new UnityAction(__instance.Cancel_ItemPromptWindow)); } ((Component)__instance._cancelButton).transform.SetAsLastSibling(); } private static Button CloneButton(ItemMenuCell itemMenuCell, string name, string label) { GameObject val = Object.Instantiate(((Component)itemMenuCell._equipButton).gameObject, ((Component)itemMenuCell._equipButton).transform.parent); ((Object)val).name = name; Button component = val.GetComponent