using System; using System.Buffers.Binary; 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.Holders; 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("Release")] [assembly: AssemblyFileVersion("4.7.56.0")] [assembly: AssemblyInformationalVersion("4.7.56+85a893a55913ac47cc0e170f40d08e7a6b7b0ceb")] [assembly: AssemblyProduct("Homebrewery")] [assembly: AssemblyTitle("Homebrewery")] [assembly: NeutralResourcesLanguage("en")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.7.56.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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 == true; 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 && !uint.TryParse(s.V[1], out var result) && CheckPacketSender(header.SenderID.ToString(CultureInfo.InvariantCulture), result)) { StringsIn(s, result); } } internal static void BP(PacketHeader header, BinaryPacketBase packet) { if (_ready && packet is BF bF && CheckPacketSender(header.SenderID.ToString(CultureInfo.InvariantCulture), (uint)bF.V[1])) { FloatsIn(bF); } } private static bool CheckPacketSender(string steamID, uint senderNetID) { if (!_players.TryGetValue(senderNetID, out Player value)) { HB.Log($"[MissingPlayerNetID] ({senderNetID}) was not in Players Dictionary!", 4); return false; } if (value.Network_steamID.Equals(steamID, StringComparison.OrdinalIgnoreCase)) { return true; } HB.Log($"[InvalidPacket] Sender SteamID did not match the SteamID of the Player the packet referenced by NetID ({senderNetID})!\nPacketHeader SteamID: '{steamID}'\nExpected SteamID: '{value.Network_steamID}'", 4); return false; } 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) { if (num == 7f) { FlipStatesIn(sender, floats.V[2]); } } else { 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()); FlipStatesOut(CharDisplayManager._local.GetFlipStates()); } 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($"[MissingPlayerNetID] ({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($"[MissingPlayerNetID] ({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($"[MissingPlayerNetID] ({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($"[MissingPlayerNetID] ({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 < 1) { 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($"[MissingPlayerNetID] ({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(7f, _mainPlayerIndex, new float[1] { (float)tailmode })); } private static void FlipStatesIn(uint sender, float value) { Player value2; CharDisplayManager charDisplayManager = default(CharDisplayManager); if (sender == _mainPlayerIndex) { HB.Log("Ignored a FlipStates Packet that was ours", 2); } else if (!_players.TryGetValue(sender, out value2)) { HB.Log($"[MissingPlayerNetID] ({sender}) was not in Players Dictionary!", 4); } else if (((Component)value2._pVisual._playerRaceModel).TryGetComponent(ref charDisplayManager)) { HB.Log("Got a FlipStates packet from: " + value2._nickname, 2); charDisplayManager.SetFlipStates((FlipStates)value); } } internal static void FlipStatesOut(FlipStates flipState) { CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(6f, _mainPlayerIndex, new float[1] { (float)flipState })); } internal static void StringsIn(S s, uint senderNetID) { string text = s.V[0]; if (text == "0") { ZPartMarkersIn(senderNetID, s.V[2], s.V[3..]); } } internal static void ZPartMarkersIn(uint senderNetID, string recipient, string[] s) { Player value; CharDisplayManager charDisplayManager = default(CharDisplayManager); if (senderNetID == _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(senderNetID, out value)) { HB.Log($"[MissingPlayerNetID] ({senderNetID}) 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 WeaponDamageCurve() { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < 65; i++) { stringBuilder.AppendLine($"Lvl{i + 1} : {GameManager._current._statLogics._logicCurveTable._weaponDamageCurve.Evaluate((float)i)}"); } return stringBuilder.ToString(); } 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 ScriptableItem val = GameManager._current._cachedScriptableItems.Values.First((ScriptableItem i) => i is ScriptableEquipment && !((ScriptableObject)(object)i).IsIDNegative()); 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; foreach (ScriptableItem item in GameManager._current._cachedScriptableItems.Values.Where((ScriptableItem i) => i is ScriptableEquipment && !((ScriptableObject)(object)i).IsIDNegative())) { ScriptableEquipment val20 = (ScriptableEquipment)(object)((item is ScriptableEquipment) ? item : null); if (val20 != null) { if (((ScriptableItem)val20)._vendorCost > val._vendorCost) { val = (ScriptableItem)(object)val20; } if (val20._equipmentLevel > val2._equipmentLevel) { val2 = val20; } if (val20._bonusStatArray._maxHealth > val3._bonusStatArray._maxHealth) { val3 = val20; } if (val20._bonusStatArray._maxMana > val4._bonusStatArray._maxMana) { val4 = val20; } if (val20._bonusStatArray._maxStamina > val5._bonusStatArray._maxStamina) { val5 = val20; } if (val20._bonusStatArray._attackPower > val6._bonusStatArray._attackPower) { val6 = val20; } if (val20._bonusStatArray._magicPower > val7._bonusStatArray._magicPower) { val7 = val20; } if (val20._bonusStatArray._dexPower > val8._bonusStatArray._dexPower) { val8 = val20; } if (val20._bonusStatArray._criticalRate > val9._bonusStatArray._criticalRate) { val9 = val20; } if (val20._bonusStatArray._evasion > val10._bonusStatArray._evasion) { val10 = val20; } if (val20._bonusStatArray._defense > val11._bonusStatArray._defense) { val11 = val20; } if (val20._bonusStatArray._resist > val12._bonusStatArray._resist) { val12 = val20; } if (val20._bonusStatArray._elementalPower > val13._bonusStatArray._elementalPower) { val13 = val20; } if (val20._bonusStatArray._firePower > val14._bonusStatArray._firePower) { val14 = val20; } if (val20._bonusStatArray._waterPower > val15._bonusStatArray._waterPower) { val15 = val20; } if (val20._bonusStatArray._naturePower > val16._bonusStatArray._naturePower) { val16 = val20; } if (val20._bonusStatArray._earthPower > val17._bonusStatArray._earthPower) { val17 = val20; } if (val20._bonusStatArray._holyPower > val18._bonusStatArray._holyPower) { val18 = val20; } if (val20._bonusStatArray._shadowPower > val19._bonusStatArray._shadowPower) { val19 = val20; } } } 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._bonusStatArray._maxHealth}\r\n_maxMana : {((ScriptableItem)val4)._itemName} : {val4._bonusStatArray._maxMana}\r\n_maxStamina : {((ScriptableItem)val5)._itemName} : {val5._bonusStatArray._maxStamina}\r\n_attackPower : {((ScriptableItem)val6)._itemName} : {val6._bonusStatArray._attackPower}\r\n_magicPower : {((ScriptableItem)val7)._itemName} : {val7._bonusStatArray._magicPower}\r\n_dexPower : {((ScriptableItem)val8)._itemName} : {val8._bonusStatArray._dexPower}\r\n_criticalRate : {((ScriptableItem)val9)._itemName} : {val9._bonusStatArray._criticalRate}\r\n_evasion : {((ScriptableItem)val10)._itemName} : {val10._bonusStatArray._evasion}\r\n_defense : {((ScriptableItem)val11)._itemName} : {val11._bonusStatArray._defense}\r\n_resist : {((ScriptableItem)val12)._itemName} : {val12._bonusStatArray._resist}\r\n_elementalPower : {((ScriptableItem)val13)._itemName} : {val13._bonusStatArray._elementalPower}\r\n_firePower : {((ScriptableItem)val14)._itemName} : {val14._bonusStatArray._firePower}\r\n_waterPower : {((ScriptableItem)val15)._itemName} : {val15._bonusStatArray._waterPower}\r\n_naturePower : {((ScriptableItem)val16)._itemName} : {val16._bonusStatArray._naturePower}\r\n_earthPower : {((ScriptableItem)val17)._itemName} : {val17._bonusStatArray._earthPower}\r\n_holyPower : {((ScriptableItem)val18)._itemName} : {val18._bonusStatArray._holyPower}\r\n_shadowPower : {((ScriptableItem)val19)._itemName} : {val19._bonusStatArray._shadowPower}\r\n```"; } internal static void DumpAllScriptables() { //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Expected O, but got Unknown //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Expected O, but got Unknown //IL_076a: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Expected O, but got Unknown //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Expected O, but got Unknown //IL_0675: Unknown result type (might be due to invalid IL or missing references) //IL_0a49: Unknown result type (might be due to invalid IL or missing references) //IL_0a50: Expected O, but got Unknown //IL_0b9b: Unknown result type (might be due to invalid IL or missing references) //IL_0ba2: Expected O, but got Unknown //IL_0c3e: Unknown result type (might be due to invalid IL or missing references) //IL_0c45: Expected O, but got Unknown //IL_0e01: Unknown result type (might be due to invalid IL or missing references) //IL_0e8d: Unknown result type (might be due to invalid IL or missing references) //IL_0e94: Expected O, but got Unknown //IL_0fd9: Unknown result type (might be due to invalid IL or missing references) //IL_0fe0: Expected O, but got Unknown //IL_115e: Unknown result type (might be due to invalid IL or missing references) //IL_1165: Expected O, but got Unknown //IL_1298: Unknown result type (might be due to invalid IL or missing references) //IL_129f: Expected O, but got Unknown IEnumerable enumerable = GameManager._current._cachedScriptableItems.Values.Where((ScriptableItem i) => !((ScriptableObject)(object)i).IsIDNegative()); DirectoryInfo directoryInfo = HB.Location.CreateSubdirectory("Scriptable"); File.WriteAllTextAsync(PathUtils.LongCombine(directoryInfo.FullName, "LoadedAssetsList.txt"), _loadedAssetsList.ToString()).ContinueWith(ContentLoader.TaskExceptionHandler); Dictionary dictionary = new Dictionary(); Type typeFromHandle = typeof(ScriptableArmorDye); dictionary[typeFromHandle] = directoryInfo.CreateSubdirectory("ArmorDye"); Type typeFromHandle2 = typeof(ScriptableCape); dictionary[typeFromHandle2] = directoryInfo.CreateSubdirectory("Cape"); Type typeFromHandle3 = typeof(ScriptableChestpiece); dictionary[typeFromHandle3] = directoryInfo.CreateSubdirectory("Chestpiece"); Type typeFromHandle4 = typeof(ScriptableHelm); dictionary[typeFromHandle4] = directoryInfo.CreateSubdirectory("Helm"); Type typeFromHandle5 = typeof(ScriptableLeggings); dictionary[typeFromHandle5] = directoryInfo.CreateSubdirectory("Leggings"); Type typeFromHandle6 = typeof(ScriptableRing); dictionary[typeFromHandle6] = directoryInfo.CreateSubdirectory("Ring"); Type typeFromHandle7 = typeof(ScriptableShield); dictionary[typeFromHandle7] = directoryInfo.CreateSubdirectory("Shield"); Type typeFromHandle8 = typeof(ScriptableStatusConsumable); dictionary[typeFromHandle8] = directoryInfo.CreateSubdirectory("StatusConsumable"); Type typeFromHandle9 = typeof(ScriptableTradeItem); dictionary[typeFromHandle9] = directoryInfo.CreateSubdirectory("TradeItem"); Type typeFromHandle10 = typeof(ScriptableWeapon); dictionary[typeFromHandle10] = directoryInfo.CreateSubdirectory("Weapon"); Dictionary dictionary2 = dictionary; HashSet hashSet = new HashSet(); 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).ContinueWith(ContentLoader.TaskExceptionHandler); 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}"); list.Add($"_conditionRemoval : {val2._conditionRemoval}"); if (Object.op_Implicit((Object)(object)val2._consumableCondition?._scriptableCondition)) { list.Add("_consumableCondition : {"); list.Add($" _scriptableCondition : {val2._consumableCondition._scriptableCondition._conditionName} - ID: {val2._consumableCondition._scriptableCondition._conditionID}\r\n _chance : {val2._consumableCondition._chance}\r\n _conditionPower : {val2._consumableCondition._conditionPower}\r\n _bonusDuration : {val2._consumableCondition._bonusDuration}"); list.Add("}"); } else { list.Add("_weaponConditionSlot : None"); } File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list).ContinueWith(ContentLoader.TaskExceptionHandler); } 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).ContinueWith(ContentLoader.TaskExceptionHandler); } continue; } ScriptableEquipment val4 = (ScriptableEquipment)item; list.Add("\n- ScriptableEquipment -"); list.Add($"_equipmentLevel : {val4._equipmentLevel}"); list.Add($"_classRequirement : {val4._classRequirement}"); list.Add($"_statTable : {val4._statTable}"); hashSet.Add(val4._statTable); list.Add($"_statBonusPercent : {val4._statBonusPercent}"); list.Add("_bonusStatArray : {"); list.Add($" _maxHealth : {val4._bonusStatArray._maxHealth}\r\n _maxMana : {val4._bonusStatArray._maxMana}\r\n _maxStamina : {val4._bonusStatArray._maxStamina}\r\n _experience : {val4._bonusStatArray._experience}\r\n _attackPower : {val4._bonusStatArray._attackPower}\r\n _magicPower : {val4._bonusStatArray._magicPower}\r\n _dexPower : {val4._bonusStatArray._dexPower}\r\n _criticalRate : {val4._bonusStatArray._criticalRate}\r\n _evasion : {val4._bonusStatArray._evasion}\r\n _defense : {val4._bonusStatArray._defense}\r\n _resist : {val4._bonusStatArray._resist}\r\n _elementalPower : {val4._bonusStatArray._elementalPower}\r\n _firePower : {val4._bonusStatArray._firePower}\r\n _waterPower : {val4._bonusStatArray._waterPower}\r\n _naturePower : {val4._bonusStatArray._naturePower}\r\n _earthPower : {val4._bonusStatArray._earthPower}\r\n _holyPower : {val4._bonusStatArray._holyPower}\r\n _shadowPower : {val4._bonusStatArray._shadowPower}"); list.Add("}"); if (val4._equipEnchantCost != null) { list.Add("_equipEnchantCost : {"); list.Add($" _scriptTradeItem : {val4._equipEnchantCost._scriptTradeItem}\r\n _setQuantity : {val4._equipEnchantCost._setQuantity}"); list.Add("}"); } if (!(type == typeof(ScriptableCape)) && !(type == typeof(ScriptableChestpiece)) && !(type == typeof(ScriptableHelm)) && !(type == typeof(ScriptableLeggings)) && !(type == typeof(ScriptableRing))) { goto IL_1146; } 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).ContinueWith(ContentLoader.TaskExceptionHandler); } 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).ContinueWith(ContentLoader.TaskExceptionHandler); } 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).ContinueWith(ContentLoader.TaskExceptionHandler); } 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).ContinueWith(ContentLoader.TaskExceptionHandler); } else { if (!(type == typeof(ScriptableLeggings))) { goto IL_1146; } 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).ContinueWith(ContentLoader.TaskExceptionHandler); } goto end_IL_0200; IL_1146: 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).ContinueWith(ContentLoader.TaskExceptionHandler); } 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($"_damageBonusRange : {val11._damageBonusRange}"); 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($"_applyConditionOnCrit : {val11._applyConditionOnCrit}"); list.Add($"weaponTexture : {val11.weaponTexture}"); list.Add($"weaponMesh : {val11.weaponMesh}"); 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).ContinueWith(ContentLoader.TaskExceptionHandler); } end_IL_0200:; } catch { HB.Log("DumpAllScriptables() - Didn't manage to make a file for " + item._itemName); throw; } } DirectoryInfo directoryInfo2 = directoryInfo.CreateSubdirectory("ItemStatTable"); (ItemClass, string, ScriptableItemStatTable)[] allStatTables = EquipItemFolder.GetAllStatTables(); for (int num = 0; num < allStatTables.Length; num++) { var (itemClass, arg, val12) = allStatTables[num]; if ((Object)(object)val12 == (Object)null) { HB.Log($"StatTable {itemClass} {arg} was null!"); continue; } try { List list2 = new List(); list2.Add($"_scaleRange : {val12._scaleRange}"); list2.Add("_statStruct : {"); list2.Add($" _maxHealth : {val12._statStruct._maxHealth}\r\n _maxMana : {val12._statStruct._maxMana}\r\n _maxStamina : {val12._statStruct._maxStamina}\r\n _experience : {val12._statStruct._experience}\r\n _attackPower : {val12._statStruct._attackPower}\r\n _magicPower : {val12._statStruct._magicPower}\r\n _dexPower : {val12._statStruct._dexPower}\r\n _criticalRate : {val12._statStruct._criticalRate}\r\n _evasion : {val12._statStruct._evasion}\r\n _defense : {val12._statStruct._defense}\r\n _resist : {val12._statStruct._resist}\r\n _elementalPower : {val12._statStruct._elementalPower}\r\n _firePower : {val12._statStruct._firePower}\r\n _waterPower : {val12._statStruct._waterPower}\r\n _naturePower : {val12._statStruct._naturePower}\r\n _earthPower : {val12._statStruct._earthPower}\r\n _holyPower : {val12._statStruct._holyPower}\r\n _shadowPower : {val12._statStruct._shadowPower}"); list2.Add("}"); File.WriteAllLinesAsync(PathUtils.LongCombine(directoryInfo2.FullName, ((Object)val12).name + ".txt"), list2).ContinueWith(ContentLoader.TaskExceptionHandler); } catch { HB.Log("DumpAllScriptables() - Didn't manage to make a file for " + ((Object)val12).name); 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.56")] [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__51_0; public static Func <>9__66_0; public static Func <>9__66_1; public static Func <>9__66_2; public static Func <>9__66_3; public static Func <>9__66_4; public static Func <>9__66_5; public static Func <>9__66_6; public static Func <>9__66_7; public static Func <>9__66_8; public static Func <>9__66_9; public static Func <>9__66_10; public static Func <>9__66_11; public static Func <>9__66_12; public static Func <>9__66_13; public static Func <>9__66_14; public static Func <>9__66_15; internal void b__51_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! IF YOU SAW THIS LOG MESSAGE, PLEASE LET ME KNOW!", (int)((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage); } internal bool b__66_0(Mesh m) { return ((Object)m).name.Equals("_mouthEnemy_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__66_1(Mesh m) { return ((Object)m).name.Equals("_mouthEnemy_alt00_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__66_2(Mesh m) { return ((Object)m).name.Equals("angela_hairTuft", StringComparison.OrdinalIgnoreCase); } internal bool b__66_3(Mesh m) { return ((Object)m).name.Equals("_ruko_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__66_4(Mesh m) { return ((Object)m).name.Equals("_sally_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__66_5(Mesh m) { return ((Object)m).name.Equals("_sallyworker00_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__66_6(Mesh m) { return ((Object)m).name.Equals("_vivi_hair", StringComparison.OrdinalIgnoreCase); } internal bool b__66_7(Mesh m) { return ((Object)m).name.Equals("_lordBoar_horns", StringComparison.OrdinalIgnoreCase); } internal bool b__66_8(Mesh m) { return ((Object)m).name.Equals("mekboar_horn", StringComparison.OrdinalIgnoreCase); } internal bool b__66_9(Mesh m) { return ((Object)m).name.Equals("_moth_horn", StringComparison.OrdinalIgnoreCase); } internal bool b__66_10(Mesh m) { return ((Object)m).name.Equals("rageBoar_horn", StringComparison.OrdinalIgnoreCase); } internal bool b__66_11(Mesh m) { return ((Object)m).name.Equals("warboar_horn", StringComparison.OrdinalIgnoreCase); } internal bool b__66_12(Mesh m) { return ((Object)m).name.Equals("wizboar_scepter", StringComparison.OrdinalIgnoreCase); } internal bool b__66_13(Mesh m) { return ((Object)m).name.Equals("angela_horns", StringComparison.OrdinalIgnoreCase); } internal bool b__66_14(Mesh m) { return ((Object)m).name.Equals("_enok_horns", StringComparison.OrdinalIgnoreCase); } internal bool b__66_15(GameObject c) { if (!((Object)c).name.StartsWith("_conditionEffect_", StringComparison.OrdinalIgnoreCase)) { return ((Object)c).name.StartsWith("_conditionObject_", StringComparison.OrdinalIgnoreCase); } return true; } } 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 bool _isManualInstall; private static DirectoryInfo? _location; private static DirectoryInfo? _internal; 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 = 11; internal const string UPDATE_STRING = "Thank you for using Homebrewery 4.7.56!\r\n\r\nI finally got around to reimplementing this once per update message.\r\n\r\nNow I can bother you with some random note about whatever this update even added... which is a lot more than I can really put here without it being a bit silly looking, so maybe not.\r\n\r\nUse Ctrl+P in-game to open HB Phone!\r\n(Has shortcuts to storage, portal and Vanity Mirror UIs)\r\n\r\nFind Skrit behind Sally's shop for custom items!\r\n(Option won't show the first time you speak to him)\r\n\r\nCustom parts are added to character customisation!\r\n(You can edit your character with the Vanity Mirror UI)\r\n\r\nUse \"/hb wiki cmd\" to open the chat commands info page!\r\n\r\nCaution: Place custom items into storage at your own risk!"; internal static bool _shownUpdateMessage; 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 List _texReplacements => TexReplacer._texReplacements; 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!"); public static float RealtimeSinceStartup { get; private set; } 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; } private void LateUpdate() { RealtimeSinceStartup = Time.realtimeSinceStartup; } 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //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_002c: Expected O, but got Unknown Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)2); _self = this; object obj = <>c.<>9__51_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! IF YOU SAW THIS LOG MESSAGE, PLEASE LET ME KNOW!", (int)((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage); }; <>c.<>9__51_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("82026.a1", StringComparison.OrdinalIgnoreCase)) { Log("This version of Homebrewery was made for game version '82026.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"))) { _isManualInstall = true; } Internal = (_isManualInstall ? new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "plugins", "Internal")) : new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "Internal"))); TexReplacer._folder = (_isManualInstall ? new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "config", "TextureReplace")) : new DirectoryInfo(PathUtils.LongCombine(Paths.ConfigPath, "TextureReplace"))); 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; } TextureFile.BlitBleedSetup(); Log("Calling _harmony.PatchAll"); _harmony.PatchAll(Assembly.GetExecutingAssembly()); TexReplacer.Go(); Log("Loading Vanilla assets!", 2); LoadVanillaAssets(); if (MainConfig._current._spreadVanillaParts.Value) { 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[16] { "based", "Nokia_3310", "BrokenDye", "joker", "VanityIco", "PortalIco", "ExitIco", "ForwardIco", "BackIco", "NextIco", "PreviousIco", "StorageIco", "DungeonIco", "SortIco", "FlipTogBG", "FlipTogOn" }; string[] array2 = array; foreach (string text in array2) { Sprites.Add(text, MakeSprite(Internal.FullName, text)); } MainThreadJobber._current = _homebreweryGameObject.AddComponent(); MeshObjManager._current = _homebreweryGameObject.AddComponent(); SpriteManager._current = _homebreweryGameObject.AddComponent(); if (MainConfig._current._noFileSystemWatcher.Value) { Log("FileSystemWatchers disabled: Automatic file reloading will not work! (This is fine if you don't need this feature)", 3); } else { Log("FileSystemWatchers enabled! This may add a dozen seconds to the load time, but automatic file reloading should be functional!", 3); } ContentLoader._current = _homebreweryGameObject.AddComponent(); 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); 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(15, out value)) { ScriptableStatusCondition val2 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null); if (val2 != null) { Cond._cold = val2; } } if (GM._cachedScriptableConditions.TryGetValue(14, out value)) { ScriptableStatusCondition val3 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null); if (val3 != null) { Cond._burn = val3; } } if (GM._cachedScriptableConditions.TryGetValue(20, out value)) { ScriptableStatusCondition val4 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null); if (val4 != null) { Cond._poison = val4; } } if (Object.op_Implicit((Object)(object)ContentLoader._current)) { ModelAliases(); await ContentLoader._current.InitAllItems(); MouthPartFolder.ByrdleBeaksAndMouths(); HairPartFolder.SetVanillaHairTextures(); } if (MainConfig._current._spreadVanillaParts.Value) { Log("Sharing Vanilla parts around!"); Log("Sharing Vanilla parts to Byrdle!", 1); PartSpreader(_raceStructs[RaceType.Byrdle]); Log("Sharing Vanilla parts to Chang!", 1); PartSpreader(_raceStructs[RaceType.Chang]); Log("Sharing Vanilla parts to Imp!", 1); PartSpreader(_raceStructs[RaceType.Imp]); Log("Sharing Vanilla parts to Kubold!", 1); PartSpreader(_raceStructs[RaceType.Kubold]); Log("Sharing Vanilla parts to Poon!", 1); PartSpreader(_raceStructs[RaceType.Poon]); } Log("Generating a shop source for some vanilla items!", 2); GetVanillaItems(); 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) { ArmorRenderFile.CreateAlias(array3[0], array3[1]); } 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) { MeshObj.CreateAlias(array6[0], array6[1]); } } 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() { ContentPack._atylssItself.RegenerateID(); (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++) { var (key, sortIndex) = array2[i]; if (GM._cachedScriptableItems.TryGetValue(key, out var value)) { ScriptableArmorDye val = (ScriptableArmorDye)(object)((value is ScriptableArmorDye) ? value : null); if (val != null) { ((ScriptableConsumable)val)._unperishable = true; } ContentPack._atylssItself.AddToAllItems(new VanillaItemFolder(value, sortIndex, ItemClass.Dye)); } } string[] array3 = new string[5] { "Necro Marrow", "Leather Top", "Sagecloth Top", "Aero Top", "Nutso Top" }; string[] array4 = array3; foreach (string key2 in array4) { if (GM._cachedScriptableItems.TryGetValue(key2, out var value2)) { ContentPack._atylssItself.AddToAllItems(new VanillaItemFolder(value2, 0, ItemClass.Chestpiece)); } } array3 = new string[5] { "Necro Caustics", "Leather Britches", "Sagecloth Shorts", "Aero Pants", "Nutso Pants" }; string[] array5 = array3; foreach (string key3 in array5) { if (GM._cachedScriptableItems.TryGetValue(key3, out var value3)) { ContentPack._atylssItself.AddToAllItems(new VanillaItemFolder(value3, 0, ItemClass.Leggings)); } } ContentPack._atylssItself.SortItems(SortType.BySortIndexThenName); } 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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 (flag) { _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()); } } private static IEnumerator AddSlash() { yield return null; ChatBehaviour._current._chatAssets._chatInput.text = "/"; ChatBehaviour._current._chatAssets._chatInput.MoveTextEnd(false); } [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 //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_0599: 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); } if (!enumerable.Any()) { Log("No vanilla Gear Meshes loaded! Gonna have to check the container paths in the assets!", 4); } else { DataExtractor._loadedAssetsList.AppendLine("Gear Meshes:"); foreach (Mesh item in enumerable) { if (!((Object)(object)item == (Object)null) && MeshObj.StashVanillaMesh(item, out string meshname)) { DataExtractor._loadedAssetsList.AppendLine(meshname); } } } 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); if (!enumerable2.Any()) { Log("No vanilla Hair Meshes loaded! Gonna have to check the container paths in the assets!", 4); } else { DataExtractor._loadedAssetsList.AppendLine("\nHair Meshes:"); foreach (Mesh item2 in enumerable2) { if (!((Object)(object)item2 == (Object)null) && MeshObj.StashVanillaMesh(item2, out string meshname2)) { DataExtractor._loadedAssetsList.AppendLine(meshname2); } } } Mesh val6 = new Mesh { name = "chang_helmHair" }; val6.UploadMeshData(true); MeshObj.StashVanillaMesh(val6, out string _); 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); if (!enumerable3.Any()) { 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 (Mesh item3 in enumerable3) { if (!((Object)(object)item3 == (Object)null) && MeshObj.StashVanillaMesh(item3, out string meshname4)) { DataExtractor._loadedAssetsList.AppendLine(meshname4); } } } IEnumerable enumerable4 = new <>z__ReadOnlyArray(Resources.LoadAll("_graphic/_mesh/00_player/player_meshes/_armormeshes").ToArray()); if (!enumerable4.Any()) { Log("No vanilla ScriptableArmorRenders loaded! Gonna have to check the container paths in the assets!", 4); } else { DataExtractor._loadedAssetsList.AppendLine("\nArmorRenders:"); foreach (ScriptableArmorRender item4 in enumerable4) { if (!((Object)(object)item4 == (Object)null) && ArmorRenderFile.StashVanillaArmorRender(item4, out string name)) { DataExtractor._loadedAssetsList.AppendLine(name); } } } if (ArmorRenderFile.LookupArmorRender("robeSkirt", out ArmorRenderFile _, out ScriptableArmorRender scriptableArmorRender)) { scriptableArmorRender._useThighBlendshape = true; } IEnumerable enumerable5 = new <>z__ReadOnlyArray(Resources.LoadAll("_weapontype/").ToArray()); if (!enumerable5.Any()) { Log("No ScriptableWeaponTypes loaded! Gonna have to check the container paths in the assets!", 4); } else { DataExtractor._loadedAssetsList.AppendLine("\nWeaponTypes:"); foreach (ScriptableWeaponType item5 in enumerable5) { if (!((Object)(object)item5 == (Object)null)) { WeaponItemFolder._weaponTypes[item5._weaponTypeClassTag] = item5; DataExtractor._loadedAssetsList.AppendLine(item5._weaponTypeClassTag); } } WeaponTypeAliases(); } ScriptableWeaponProjectileSet[] array6 = Resources.LoadAll("_item/01_equipment/02_weapon/01_dexterity/00_projectiles_dexterity/"); ScriptableWeaponProjectileSet[] array7 = Resources.LoadAll("_item/01_equipment/02_weapon/02_mind/00_projectiles_mind/"); num = 0; ScriptableWeaponProjectileSet[] array8 = (ScriptableWeaponProjectileSet[])(object)new ScriptableWeaponProjectileSet[array6.Length + array7.Length]; ReadOnlySpan readOnlySpan4 = new ReadOnlySpan(array6); readOnlySpan4.CopyTo(new Span(array8).Slice(num, readOnlySpan4.Length)); num += readOnlySpan4.Length; ReadOnlySpan readOnlySpan5 = new ReadOnlySpan(array7); readOnlySpan5.CopyTo(new Span(array8).Slice(num, readOnlySpan5.Length)); num += readOnlySpan5.Length; IEnumerable enumerable6 = new <>z__ReadOnlyArray(array8); if (!enumerable6.Any()) { Log("No ScriptableWeaponProjectileSets loaded! Gonna have to check the container paths in the assets!", 4); } else { DataExtractor._loadedAssetsList.AppendLine("\nProjectileSets:"); foreach (ScriptableWeaponProjectileSet item6 in enumerable6) { if (!((Object)(object)item6 == (Object)null)) { string text = ((Object)item6).name.Replace("weaponProjectileSet_", string.Empty, StringComparison.OrdinalIgnoreCase); WeaponItemFolder._projectileSets[text] = item6; DataExtractor._loadedAssetsList.AppendLine(text); } } } 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 list3 = new List(); list3.AddRange(Resources.LoadAll("_item/02_consumable/01_dye/")); list3.AddRange(Resources.LoadAll("_item/02_consumable/02_skillscroll/")); list3.AddRange(Resources.LoadAll("_item/02_consumable/03_status/")); list3.AddRange(Resources.LoadAll("_generalconditions/")); list3.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 enumerable7 = new <>z__ReadOnlyList(list3); foreach (GameObject item7 in enumerable7) { string text2 = ((Object)item7).name.Replace("_consumableEffect_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("_conditionEffect_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("_conditionObject_", string.Empty, StringComparison.OrdinalIgnoreCase); if (!ConsumableObjects.TryAdd(text2, item7) && !ConsumableObjects.TryAdd(text2 + "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); } else { DataExtractor._loadedAssetsList.AppendLine("\nConsumableObjects:"); foreach (string key in ConsumableObjects.Keys) { DataExtractor._loadedAssetsList.AppendLine(key); } } OrcaTail(); } private static void OrcaTail() { GameObject val = Resources.Load("_prefab/_entity/_npc/_orcacivilian/_npc_sanctumcivilian_blu"); try { if (Object.op_Implicit((Object)(object)val)) { GameObject val2 = Object.Instantiate(val); val2.SetActive(false); ((Object)val2).name = "_sanctumOrca"; Object.DestroyImmediate((Object)(object)val2.GetComponent()); Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(5)).gameObject); Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(4)).gameObject); Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(3)).gameObject); Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(2)).gameObject); Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(1)).gameObject); Transform child = val2.transform.GetChild(0); Transform child2 = ((Component)child).transform.GetChild(7); ((Component)child).transform.GetChild(6).parent = val2.transform; Object.DestroyImmediate((Object)(object)((Component)((Component)child).transform.GetChild(5)).gameObject); Object.DestroyImmediate((Object)(object)((Component)((Component)child).transform.GetChild(4)).gameObject); Object.DestroyImmediate((Object)(object)((Component)((Component)child).transform.GetChild(3)).gameObject); Object.DestroyImmediate((Object)(object)((Component)((Component)child).transform.GetChild(2)).gameObject); Object.DestroyImmediate((Object)(object)((Component)((Component)child).transform.GetChild(1)).gameObject); Object.DestroyImmediate((Object)(object)((Component)((Component)child).transform.GetChild(0)).gameObject); Transform child3 = child2.GetChild(0).GetChild(0); Object.DestroyImmediate((Object)(object)((Component)((Component)child3).transform.GetChild(2)).gameObject); Object.DestroyImmediate((Object)(object)((Component)((Component)child3).transform.GetChild(1)).gameObject); Transform child4 = child3.GetChild(0); Object.DestroyImmediate((Object)(object)((Component)((Component)child4).transform.GetChild(2)).gameObject); val2.transform.parent = _homebreweryGameObject.transform; TailPartFolder._vanillaTails[((Object)val2).name] = val2.transform; } } catch (Exception thing) { Log("OrcaTail setup failed!", 4); Log(thing, 4); } } 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; } [DebuggerNonUserCode] private static void DumpAllScriptables() { DataExtractor.DumpAllScriptables(); } [DebuggerNonUserCode] private static string MaximumStats() { return DataExtractor.MaximumStats(); } [DebuggerNonUserCode] private static string WeaponDamageCurve() { return DataExtractor.WeaponDamageCurve(); } 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(); } } [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; } } } 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.56"; } } 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("[InvalidVanityItem] Removed null " + itemType + " Vanity: " + itemTag, 3); itemTag = string.Empty; } } [HarmonyPatch("Reset_CameraRotation")] [HarmonyPostfix] [HarmonyWrapSafe] private static void Reset_CameraRotationPostfix(CharacterSelectManager __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) __instance._baseCamTransform.localScale = Vector3.oneVector; } [HarmonyPatch("Handle_CameraControl")] [HarmonyPostfix] [HarmonyWrapSafe] private static void Handle_CameraControlPostfix(CharacterSelectManager __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) MainMenuCondition mainMenuCondition = __instance._mainMenuManager._mainMenuCondition; if (mainMenuCondition - 1 <= 1) { if (!CharGenDX._sliderScroll && (Controls.GetScrollwheelAxis(out var axis) || Controls.GetGamepadAxis((GamepadAxis)3, out axis))) { int num = 4; if (Controls._anyCtrl) { num = 1; } if (Controls._anyShift) { num = 8; } __instance._baseCamTransform.localScale = new Vector3(1f, 1f, __instance._baseCamTransform.localScale.z + 0.1f * (axis * (float)num)); } if (!__instance._characterCreationManager._characterNameInputField.isFocused && Input.GetKeyUp((KeyCode)99)) { __instance.Reset_CameraRotation(); } } else { __instance._baseCamTransform.localScale = Vector3.oneVector; } } } [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