Decompiled source of Homebrewery v4.5.13
Homebrewery.dll
Decompiled 21 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; 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 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.Items; using Homebrewery.Code.Enums; using Homebrewery.Code.Objects; using Homebrewery.Code.Objects.Things; using Homebrewery.Code.Structs; using Marioalexsan.AtlyssGLTF; using Microsoft.CodeAnalysis; using Mirror; using Newtonsoft.Json; using TMPro; 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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Homebrewery")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("4.5.13.0")] [assembly: AssemblyInformationalVersion("4.5.13+b02b737781559e02272a1344957f7369a2f89d1d")] [assembly: AssemblyProduct("Homebrewery")] [assembly: AssemblyTitle("Homebrewery")] [assembly: NeutralResourcesLanguage("en")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.5.13.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class RequiresLocationAttribute : Attribute { } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Homebrewery { internal static class CT { [CompilerGenerated] private static class <>O { public static PacketListener <0>__P; } internal const string MOD_ID = "CodeTalker"; private static bool? _enabled; internal static uint _playerIndex; internal static bool _ready; internal static Dictionary<uint, Player> _players = new Dictionary<uint, Player>(); internal static bool _floatsOn; internal static bool _stringsOn; internal static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("CodeTalker"); _enabled = valueOrDefault; } return _enabled.Value; } } internal static void RegisterListeners() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown object obj = <>O.<0>__P; if (obj == null) { PacketListener val = P; <>O.<0>__P = val; obj = (object)val; } if (!CodeTalkerNetwork.RegisterListener<F>((PacketListener)obj)) { HB.Log("Could not register float packet listener!", 4); } else { _floatsOn = true; } object obj2 = <>O.<0>__P; if (obj2 == null) { PacketListener val2 = P; <>O.<0>__P = val2; obj2 = (object)val2; } if (!CodeTalkerNetwork.RegisterListener<S>((PacketListener)obj2)) { HB.Log("Could not register string packet listener!", 4); } else { _stringsOn = true; } } internal static void P(PacketHeader header, PacketBase packet) { if (_ready) { if (packet is F floats) { FloatsIn(floats); } else if (packet is S s) { StringsIn(s); } } } internal static void FloatsIn(F floats) { uint sender = (uint)floats.V[1]; float num = floats.V[0]; if (num != 0f) { if (num != 1f) { if (num != 2f) { if (num == 3f) { 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 == _playerIndex) { ZPartMarkersOut(); LimitsPacketOut(); } else { ZPartMarkersOut(sender.ToString(CultureInfo.InvariantCulture)); LimitsPacketOut(sender); } } private static void LimitsPacketIn(uint sender, float recipient, float[] values) { Player value; CondEffectManager condEffectManager = default(CondEffectManager); if (sender == _playerIndex) { HB.Log("Ignored a LimitsPacket that was ours", 2); } else if (recipient != -1f && recipient != (float)_playerIndex) { HB.Log("Ignored a LimitsPacket that wasn't for us", 2); } else if (!_players.TryGetValue(sender, out value)) { HB.Log($"Sender ID ({sender}) was not in Players Dictionary!", 4); } else if (((Component)value).TryGetComponent<CondEffectManager>(ref condEffectManager)) { condEffectManager._yourLimits[CondType.Boobs][MinMax.Min] = values[0]; condEffectManager._yourLimits[CondType.Boobs][MinMax.Max] = values[1]; condEffectManager._yourLimits[CondType.Butt][MinMax.Min] = values[2]; condEffectManager._yourLimits[CondType.Butt][MinMax.Max] = values[3]; condEffectManager._yourLimits[CondType.Belly][MinMax.Min] = values[4]; condEffectManager._yourLimits[CondType.Belly][MinMax.Max] = values[5]; condEffectManager._yourLimits[CondType.Arms][MinMax.Min] = values[6]; condEffectManager._yourLimits[CondType.Arms][MinMax.Max] = values[7]; condEffectManager._yourLimits[CondType.Torso][MinMax.Min] = values[8]; condEffectManager._yourLimits[CondType.Torso][MinMax.Max] = values[9]; condEffectManager._yourLimits[CondType.Muzzle][MinMax.Min] = values[10]; condEffectManager._yourLimits[CondType.Muzzle][MinMax.Max] = values[11]; condEffectManager._yourLimits[CondType.Height][MinMax.Min] = values[12]; condEffectManager._yourLimits[CondType.Height][MinMax.Max] = values[13]; condEffectManager._yourLimits[CondType.Width][MinMax.Min] = values[14]; condEffectManager._yourLimits[CondType.Width][MinMax.Max] = values[15]; condEffectManager._yourLimits[CondType.Head][MinMax.Min] = values[16]; condEffectManager._yourLimits[CondType.Head][MinMax.Max] = values[17]; condEffectManager._yourLimits[CondType.Voice][MinMax.Min] = values[18]; condEffectManager._yourLimits[CondType.Voice][MinMax.Max] = values[19]; } } internal static void LimitsPacketOut(float recipient = -1f) { CondEffectManager condEffectManager = default(CondEffectManager); if (((Component)Player._mainPlayer).TryGetComponent<CondEffectManager>(ref condEffectManager)) { CodeTalkerNetwork.SendNetworkPacket((PacketBase)(object)new F(1f, _playerIndex, new float[20] { condEffectManager._yourLimits[CondType.Boobs][MinMax.Min], condEffectManager._yourLimits[CondType.Boobs][MinMax.Max], condEffectManager._yourLimits[CondType.Butt][MinMax.Min], condEffectManager._yourLimits[CondType.Butt][MinMax.Max], condEffectManager._yourLimits[CondType.Belly][MinMax.Min], condEffectManager._yourLimits[CondType.Belly][MinMax.Max], condEffectManager._yourLimits[CondType.Arms][MinMax.Min], condEffectManager._yourLimits[CondType.Arms][MinMax.Max], condEffectManager._yourLimits[CondType.Torso][MinMax.Min], condEffectManager._yourLimits[CondType.Torso][MinMax.Max], condEffectManager._yourLimits[CondType.Muzzle][MinMax.Min], condEffectManager._yourLimits[CondType.Muzzle][MinMax.Max], condEffectManager._yourLimits[CondType.Height][MinMax.Min], condEffectManager._yourLimits[CondType.Height][MinMax.Max], condEffectManager._yourLimits[CondType.Width][MinMax.Min], condEffectManager._yourLimits[CondType.Width][MinMax.Max], condEffectManager._yourLimits[CondType.Head][MinMax.Min], condEffectManager._yourLimits[CondType.Head][MinMax.Max], condEffectManager._yourLimits[CondType.Voice][MinMax.Min], condEffectManager._yourLimits[CondType.Voice][MinMax.Max] }, recipient)); } } private static void CondEffectIn(uint sender, float[] values) { CondEffectManager condEffectManager = default(CondEffectManager); if (!_players.TryGetValue(sender, out Player value)) { HB.Log($"Sender ID ({sender}) was not in Players Dictionary!", 4); } else if (((Component)value).TryGetComponent<CondEffectManager>(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((PacketBase)(object)new F(2f, _playerIndex, 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($"Sender ID ({sender}) was not in Players Dictionary!", 4); } else if (((Component)value).TryGetComponent<CondEffectManager>(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.Player._pVisual._playerAppearanceStruct._widthWeight; num = 2000f; break; case CondType.HeightWidth: 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((PacketBase)(object)new F(3f, _playerIndex, new float[3] { (float)slider, endPoint, time })); } internal static void StringsIn(S s) { if (uint.TryParse(s.V[1], out var result)) { string text = s.V[0]; if (text == "0") { ZPartMarkersIn(result, s.V[2], s.V[3..]); } } } internal static void ZPartMarkersIn(uint sender, string recipient, string[] s) { Player value; if (sender == _playerIndex) { HB.Log("Ignored a ZPartMarkers that was ours", 2); } else if (recipient.Length > 0 && !recipient.Equals(_playerIndex.ToString(CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase)) { HB.Log("Ignored a ZPartMarkers that wasn't for us", 2); } else if (HB._players.TryGetValue(sender, out value)) { HB.Log("Got a ZPartMarkers from: " + value._nickname, 2); if (s[0].Length > 0) { Sync.Part(value, FolderType.Skin, s[0]); } if (s[1].Length > 0) { Sync.Part(value, FolderType.Mouth, s[1]); } if (s[2].Length > 0) { Sync.Part(value, FolderType.Eyes, s[2]); } if (s[3].Length > 0) { Sync.Part(value, FolderType.Hair, s[3]); } } } internal static void ZPartMarkersOut(string recipient = "") { PlayerRaceModel playerRaceModel = Player._mainPlayer._pVisual._playerRaceModel; if (Lookup._raceTypes.TryGetValue(playerRaceModel._scriptablePlayerRace._raceName, out var value)) { string key = playerRaceModel.SetTextureIndex.ToString(CultureInfo.InvariantCulture); string key2 = playerRaceModel.SetMouthIndex.ToString(CultureInfo.InvariantCulture); string key3 = playerRaceModel.SetEyeIndex.ToString(CultureInfo.InvariantCulture); string key4 = playerRaceModel._setHairIndex.ToString(CultureInfo.InvariantCulture); string value2; string text = (HB._partInd[value][FolderType.Skin].TryGetValue(key, out value2) ? value2 : string.Empty); string value3; string text2 = (HB._partInd[value][FolderType.Mouth].TryGetValue(key2, out value3) ? value3 : string.Empty); string value4; string text3 = (HB._partInd[value][FolderType.Eyes].TryGetValue(key3, out value4) ? value4 : string.Empty); string value5; string text4 = (HB._partInd[value][FolderType.Hair].TryGetValue(key4, out value5) ? value5 : string.Empty); if (text.Length + text2.Length + text3.Length + text4.Length != 0) { CodeTalkerNetwork.SendNetworkPacket((PacketBase)(object)new S("0", _playerIndex.ToString(CultureInfo.InvariantCulture), new string[4] { text, text2, text3, text4 }, recipient)); } } } } internal sealed class F : PacketBase { public override string PacketSourceGUID => "Homebrewery"; [JsonProperty] public float[] V { get; set; } public F(float type, float sender, float[] values = null, float recipient = -1f) { List<float> list = new List<float>(); list.Add(type); list.Add(sender); list.Add(recipient); list.AddRange(values ?? Array.Empty<float>()); V = list.ToArray(); ((PacketBase)this)..ctor(); } } 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<string> list = new List<string>(); list.Add(type); list.Add(sender); list.Add(recipient); list.AddRange(values ?? Array.Empty<string>()); V = list.ToArray(); ((PacketBase)this)..ctor(); } } [BepInPlugin("Homebrewery", "Homebrewery", "4.5.13")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class HB : BaseUnityPlugin { private static readonly Stopwatch _stopwatch = Stopwatch.StartNew(); internal static HB _self = null; internal static FileInfo _dll = null; internal static DirectoryInfo _configHomebrewery = null; internal static DirectoryInfo _limitCfgsFolder = null; private readonly Harmony _harmony = new Harmony("Homebrewery"); public const StringComparison ORD = StringComparison.OrdinalIgnoreCase; internal static InstallType _installType = InstallType.r2ModMan; private DirectoryInfo? _location; private static DirectoryInfo? _internal; private DirectoryInfo? _hbFiles; private DirectoryInfo? _contentPacks; internal static GameObject _homebreweryGameObject = null; public static readonly Dictionary<string, ScriptableArmorRender> ARend = new Dictionary<string, ScriptableArmorRender>(StringComparer.OrdinalIgnoreCase); public static readonly Dictionary<string, Mesh> AMesh = new Dictionary<string, Mesh>(StringComparer.OrdinalIgnoreCase); private readonly Stopwatch _modsSW = new Stopwatch(); internal static readonly Dictionary<string, ModFolder> _modFolders = new Dictionary<string, ModFolder>(); internal static readonly PieceType[] _armorRenderTypes = new PieceType[9] { PieceType.chestRenderDisplay, PieceType.robeSkirtRender, PieceType.armCuffRender, PieceType.helmRender, PieceType.legPieceRend1, PieceType.legPieceRend2, PieceType.legPieceRend3, PieceType.legPieceRend4, PieceType.hipMesh }; internal static readonly PieceType[] _meshPartTypes = new PieceType[6] { PieceType.capeMesh, PieceType.neckCollarMesh, PieceType.shoulderPadMesh, PieceType.helmOverrideMesh, PieceType.shieldMesh, PieceType.weaponMesh }; internal static readonly List<ModShop> _modShops = new List<ModShop>(); internal static readonly Dictionary<PieceType, List<Action>> _modelPartAssignments = new Dictionary<PieceType, List<Action>> { { PieceType.capeMesh, new List<Action>() }, { PieceType.neckCollarMesh, new List<Action>() }, { PieceType.chestRenderDisplay, new List<Action>() }, { PieceType.robeSkirtRender, new List<Action>() }, { PieceType.armCuffRender, new List<Action>() }, { PieceType.shoulderPadMesh, new List<Action>() }, { PieceType.hipMesh, new List<Action>() }, { PieceType.helmRender, new List<Action>() }, { PieceType.helmOverrideMesh, new List<Action>() }, { PieceType.legPieceRend1, new List<Action>() }, { PieceType.legPieceRend2, new List<Action>() }, { PieceType.legPieceRend3, new List<Action>() }, { PieceType.legPieceRend4, new List<Action>() }, { PieceType.shieldMesh, new List<Action>() }, { PieceType.weaponMesh, new List<Action>() } }; internal static readonly List<Action> _weaponActionsActions = new List<Action>(); internal static readonly List<Action> _consumableDXActions = new List<Action>(); internal static readonly List<Action> _addNewItems = new List<Action>(); internal static readonly List<PNG> _pNGs = new List<PNG>(); internal static readonly List<Task> _importTasks = new List<Task>(); internal static readonly List<Action> _playerRaceAssignments = new List<Action>(); internal static readonly List<Action> _hairReplaceActions = new List<Action>(); internal static Dictionary<RaceType, Dictionary<FolderType, List<AnyThing>>> _addParts = new Dictionary<RaceType, Dictionary<FolderType, List<AnyThing>>> { { RaceType.Byrdle, new Dictionary<FolderType, List<AnyThing>> { { FolderType.Eyes, new List<AnyThing>() }, { FolderType.Mouth, new List<AnyThing>() }, { FolderType.Skin, new List<AnyThing>() }, { FolderType.Hair, new List<AnyThing>() } } }, { RaceType.Chang, new Dictionary<FolderType, List<AnyThing>> { { FolderType.Eyes, new List<AnyThing>() }, { FolderType.Mouth, new List<AnyThing>() }, { FolderType.Skin, new List<AnyThing>() }, { FolderType.Hair, new List<AnyThing>() } } }, { RaceType.Imp, new Dictionary<FolderType, List<AnyThing>> { { FolderType.Eyes, new List<AnyThing>() }, { FolderType.Mouth, new List<AnyThing>() }, { FolderType.Skin, new List<AnyThing>() }, { FolderType.Hair, new List<AnyThing>() } } }, { RaceType.Kubold, new Dictionary<FolderType, List<AnyThing>> { { FolderType.Eyes, new List<AnyThing>() }, { FolderType.Mouth, new List<AnyThing>() }, { FolderType.Skin, new List<AnyThing>() }, { FolderType.Hair, new List<AnyThing>() } } }, { RaceType.Poon, new Dictionary<FolderType, List<AnyThing>> { { FolderType.Eyes, new List<AnyThing>() }, { FolderType.Mouth, new List<AnyThing>() }, { FolderType.Skin, new List<AnyThing>() }, { FolderType.Hair, new List<AnyThing>() } } } }; internal static Dictionary<RaceType, RaceStruct> _races = new Dictionary<RaceType, RaceStruct>(); 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 Dictionary<RaceType, Dictionary<FolderType, Dictionary<string, string>>> _partInd = new Dictionary<RaceType, Dictionary<FolderType, Dictionary<string, string>>> { { RaceType.Byrdle, new Dictionary<FolderType, Dictionary<string, string>> { { FolderType.Eyes, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Mouth, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Skin, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Hair, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) } } }, { RaceType.Chang, new Dictionary<FolderType, Dictionary<string, string>> { { FolderType.Eyes, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Mouth, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Skin, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Hair, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) } } }, { RaceType.Imp, new Dictionary<FolderType, Dictionary<string, string>> { { FolderType.Eyes, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Mouth, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Skin, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Hair, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) } } }, { RaceType.Kubold, new Dictionary<FolderType, Dictionary<string, string>> { { FolderType.Eyes, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Mouth, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Skin, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Hair, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) } } }, { RaceType.Poon, new Dictionary<FolderType, Dictionary<string, string>> { { FolderType.Eyes, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Mouth, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Skin, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) }, { FolderType.Hair, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) } } }, { RaceType.HB_ALLRACES, new Dictionary<FolderType, Dictionary<string, string>> { { FolderType.Dye, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) } } } }; internal static bool _hotkeysOn = true; public static readonly int UpdateCount = 10; internal const string UPDATE_STRING = "Thank you for using Homebrewery 4.5.13!\r\n\r\n\r\n\r\n\r\n\r\nRemember: don't store custom items!\r\nClose: 'T' | Ctrl+P to open HB Phone!"; internal static bool _shownUpdateMessage; public static readonly Dictionary<string, AudioClip> AudioClips = new Dictionary<string, AudioClip>(StringComparer.OrdinalIgnoreCase); public static readonly Dictionary<string, Sprite> Sprites = new Dictionary<string, Sprite>(); public static readonly Dictionary<string, GameObject> ConsumableObjects = new Dictionary<string, GameObject>(StringComparer.OrdinalIgnoreCase); internal static readonly Dictionary<ScriptableItem, ItemThing> _itemDeluxe = new Dictionary<ScriptableItem, ItemThing>(); internal static float _foodLevel; internal static ScriptableArmorDye? _testDye; internal static ManualLogSource _logger = null; private static readonly List<(string msg, int typ)> _errorList = new List<(string, int)>(); internal static int _nudge; internal 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 DirectoryInfo HBFiles { get { return _hbFiles ?? throw new InvalidOperationException("HBFiles wasn't initialised!"); } set { _hbFiles = value; } } internal DirectoryInfo ContentPacks { get { return _contentPacks ?? throw new InvalidOperationException("ContentPacks wasn't initialised!"); } set { _contentPacks = value; } } internal static List<TexReplace> _texReplacements => TexReplacer._texReplacements; public static Dictionary<string, ScriptableWeaponType> WeaponTypes => WeaponItemFolder._weaponTypes; public static Dictionary<string, ScriptableWeaponProjectileSet> ProjectileSets => WeaponItemFolder._projectileSets; internal static Dictionary<uint, Player> _players => CT._players; public static GameManager GM { get { if (!((Object)(object)GameManager._current != (Object)null)) { throw new InvalidOperationException("Tried to use GameManager._current before it was ready!"); } return GameManager._current; } } internal static async Task ReloadAll(bool nocheck) { if (!nocheck) { Log("Reloading everything that's changed, hopefully!"); } else { Log("Reloading everything without checking!"); } foreach (ModFolder value in _modFolders.Values) { value.Reload(nocheck); } await Task.WhenAll(_importTasks).ConfigureAwait(continueOnCapturedContext: true); _importTasks.Clear(); PieceType[] armorRenderTypes = _armorRenderTypes; foreach (PieceType key in armorRenderTypes) { foreach (Action item in _modelPartAssignments[key]) { item(); } } PieceType[] meshPartTypes = _meshPartTypes; foreach (PieceType key2 in meshPartTypes) { foreach (Action item2 in _modelPartAssignments[key2]) { item2(); } } if (_hairReplaceActions.Count > 0) { foreach (Action hairReplaceAction in _hairReplaceActions) { hairReplaceAction(); } } _hairReplaceActions.Clear(); } 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; } internal static bool AddNewItem(ScriptableItem item, ItemThing thing) { if (GM._cachedScriptableItems.TryAdd(item._itemName, item)) { if (!thing.secretitem) { thing.Mod.StoreItem(thing); } return true; } Log(((Object)item).name + " - Failed to add to cachedScriptableItems!", 4); return false; } internal static void AddNewItem(CapeEquip item) { item.Added = AddNewItem((ScriptableItem)(object)item._obj, item); } internal static void AddNewItem(ChestpieceEquip item) { item.Added = AddNewItem((ScriptableItem)(object)item._obj, item); } internal static void AddNewItem(Consumable item) { item.Added = AddNewItem((ScriptableItem)(object)item._obj, item); } internal static void AddNewItem(DyeItem item) { item.Added = AddNewItem((ScriptableItem)(object)item._obj, item); if (item.Added) { string text = GM._statLogics._armorDyes.Length.ToString(CultureInfo.InvariantCulture); _partInd[RaceType.HB_ALLRACES][FolderType.Dye].Add(item.Marker, text); _partInd[RaceType.HB_ALLRACES][FolderType.Dye].Add(text, item.Marker); StatLogics statLogics = GM._statLogics; ScriptableArmorDye[] armorDyes = GM._statLogics._armorDyes; int num = 0; ScriptableArmorDye[] array = (ScriptableArmorDye[])(object)new ScriptableArmorDye[1 + armorDyes.Length]; ReadOnlySpan<ScriptableArmorDye> readOnlySpan = new ReadOnlySpan<ScriptableArmorDye>(armorDyes); readOnlySpan.CopyTo(new Span<ScriptableArmorDye>(array).Slice(num, readOnlySpan.Length)); num += readOnlySpan.Length; array[num] = item._obj; statLogics._armorDyes = array; } } internal static void AddNewItem(HelmEquip item) { item.Added = AddNewItem((ScriptableItem)(object)item._obj, item); } internal static void AddNewItem(LeggingsEquip item) { item.Added = AddNewItem((ScriptableItem)(object)item._obj, item); } internal static void AddNewItem(ShieldEquip item) { item.Added = AddNewItem((ScriptableItem)(object)item._obj, item); } internal static void AddNewItem(TradeItem item) { item.Added = AddNewItem((ScriptableItem)(object)item._obj, item); } internal static void AddNewItem(WeaponEquip item) { item.Added = AddNewItem((ScriptableItem)(object)item._obj, item); } public static void FilterModePNGs() { for (int i = 0; i < _pNGs.Count; i++) { _pNGs[i].SetFilterMode(); } } internal static void ImportArmorRender(GLB glb) { ArmorRender armorRender = (ArmorRender)glb._thingF.Thing; ((Object)armorRender._obj).name = glb._name; if (armorRender._obj._raceArmorRenders == null || armorRender._obj._raceArmorRenders.Length == 0) { armorRender._obj._raceArmorRenders = (RaceArmorRender[])(object)new RaceArmorRender[5] { armorRender._byrdle, armorRender._chang, armorRender._imp, armorRender._kubold, armorRender._poon }; RaceArmorRender[] raceArmorRenders = armorRender._obj._raceArmorRenders; foreach (RaceArmorRender rar in raceArmorRenders) { _playerRaceAssignments.Add(delegate { RaceArmorPlayerRace(rar); }); } } _importTasks.Add(AtlyssGLTF.GetArmorRender(glb, armorRender)); } internal static void RaceArmorPlayerRace(RaceArmorRender rar) { if (GM._cachedScriptableRaces.TryGetValue(rar._raceNameTag, out var value)) { rar._scriptableRace = value; } } internal static void ImportMeshPart(GLB glb) { MeshPart meshPart = (MeshPart)glb._thingF.Thing; _importTasks.Add(AtlyssGLTF.GetMeshPart(glb, meshPart)); } internal static void ImportHair(GLB glb) { Hair hair = (Hair)glb._thingF.Thing; hair._name = glb._thingF._mod._name + "-Hair-" + glb._thingF._dir.Name; _importTasks.Add(AtlyssGLTF.GetHair(glb, hair)); if (!hair.Added) { _addParts[RaceType.Byrdle][FolderType.Hair].Add(hair); _addParts[RaceType.Chang][FolderType.Hair].Add(hair); _addParts[RaceType.Imp][FolderType.Hair].Add(hair); _addParts[RaceType.Kubold][FolderType.Hair].Add(hair); _addParts[RaceType.Poon][FolderType.Hair].Add(hair); } else { _hairReplaceActions.Add(delegate { HairReplace(hair); }); } } internal static void HairReplace(Hair hair) { foreach (KeyValuePair<RaceType, Mesh> item in hair._obj) { if (_partInd[item.Key][FolderType.Hair].TryGetValue(hair._name, out string value)) { _races[item.Key]._race._hairStyleMeshes[int.Parse(value, CultureInfo.InvariantCulture)] = item.Value; } } } internal static void ImportAudio(MP3OGG mp3) { Audio audio = (Audio)mp3._thingF.Thing; _importTasks.Add(SFX.GetAudioClip(mp3, audio)); } public static void Log(object? t = null, int l = 0) { if (MainConfig._current._logLevel.Value == -1) { return; } if (t == null) { _logger.LogMessage((object)"Logged a null, nice one."); return; } switch (l) { case 1: if (MainConfig._current._logLevel.Value <= 1) { _logger.LogDebug(t); } break; case 2: if (MainConfig._current._logLevel.Value <= 2) { _logger.LogMessage(t); } break; case 3: _errorList.Add((t.ToString(), 3)); if (MainConfig._current._logLevel.Value <= 3) { _logger.LogWarning((object)$"{t}\n"); } break; case 4: _errorList.Add((t.ToString(), 4)); _logger.LogError((object)$"{t}\n"); break; default: _logger.LogMessage(t); break; } } public static void ErrorLister() { Log("Reprinting warnings and errors:", 2); foreach (var (text, num) in _errorList) { if (num == 3) { _logger.LogWarning((object)text); } else { _logger.LogError((object)text); } } Log("List cleared.", 2); _errorList.Clear(); } private 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) { Log("Well I'm quite feeling the lack of bumpscosity in here.\nOnly a single bumpscosit. Still, it'll have to do.\n"); } else { Log("Well I'm quite feeling the lack of bumpscosity in here.\nOnly a few bumpscosits. Still, it'll have to do.\n"); } } else { 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 { 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) { Log("Ahh, quite a pleasant amount of bumpscosity we've got today, wouldn't you say? Very enjoyable.\n"); } else { 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) { 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 { 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"); } } 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(Path.Combine(Paths.ConfigPath, "Homebrewery")); _limitCfgsFolder = Directory.CreateDirectory(Path.Combine(_configHomebrewery.FullName, "LimitCFGs")); TryMoveFile(Path.Combine(Paths.ConfigPath, "Homebrewery.cfg"), Path.Combine(_configHomebrewery.FullName, "Homebrewery.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HB_JiggleSettings.cfg"), Path.Combine(_configHomebrewery.FullName, "JiggleSettings.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HBLimitCFGs", "HB_Byrdle_YourLimits.cfg"), Path.Combine(_limitCfgsFolder.FullName, "Byrdle_YourLimits.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HBLimitCFGs", "HB_Chang_YourLimits.cfg"), Path.Combine(_limitCfgsFolder.FullName, "Chang_YourLimits.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HBLimitCFGs", "HB_Imp_YourLimits.cfg"), Path.Combine(_limitCfgsFolder.FullName, "Imp_YourLimits.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HBLimitCFGs", "HB_Kubold_YourLimits.cfg"), Path.Combine(_limitCfgsFolder.FullName, "Kubold_YourLimits.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HBLimitCFGs", "HB_Poon_YourLimits.cfg"), Path.Combine(_limitCfgsFolder.FullName, "Poon_YourLimits.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HBLimitCFGs", "HB_Byrdle_OthersLimits.cfg"), Path.Combine(_limitCfgsFolder.FullName, "Byrdle_OthersLimits.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HBLimitCFGs", "HB_Chang_OthersLimits.cfg"), Path.Combine(_limitCfgsFolder.FullName, "Chang_OthersLimits.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HBLimitCFGs", "HB_Imp_OthersLimits.cfg"), Path.Combine(_limitCfgsFolder.FullName, "Imp_OthersLimits.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HBLimitCFGs", "HB_Kubold_OthersLimits.cfg"), Path.Combine(_limitCfgsFolder.FullName, "Kubold_OthersLimits.cfg")); TryMoveFile(Path.Combine(Paths.ConfigPath, "HBLimitCFGs", "HB_Poon_OthersLimits.cfg"), Path.Combine(_limitCfgsFolder.FullName, "Poon_OthersLimits.cfg")); if (Directory.Exists(Path.Combine(Paths.ConfigPath, "HBLimitCFGs")) && !Directory.EnumerateFileSystemEntries(Path.Combine(Paths.ConfigPath, "HBLimitCFGs")).Any()) { Directory.Delete(Path.Combine(Paths.ConfigPath, "HBLimitCFGs")); } } private void Awake() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Expected O, but got Unknown //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Expected O, but got Unknown Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)2); _self = this; _logger = ((BaseUnityPlugin)this).Logger; _dll = new FileInfo(((BaseUnityPlugin)this).Info.Location); _homebreweryGameObject = new GameObject("Homebrewery-GameObject") { hideFlags = (HideFlags)61 }; ConfigMover(); ConfigManager._current = _homebreweryGameObject.AddComponent<ConfigManager>(); CultureInfo.CurrentCulture = CultureInfo.InvariantCulture; Log($"Waking up at {DateTime.UtcNow:yyyy-MM-dd h:mm:ss tt} UTC... Game Version is: {Application.version}"); string text = "82025.a2"; if (!Application.version.Equals(text, StringComparison.OrdinalIgnoreCase)) { Log("This version of Homebrewery was made for game version '" + text + "', so be wary of issues arising due to game changes!", 3); } Bumpscosity(); Log($"AtlyssGLTF available: {AtlyssGLTF.Enabled}."); Location = _dll.Directory; if (Location.Name.Equals("plugins", StringComparison.OrdinalIgnoreCase)) { Log("Homebrewery is not installed incorrectly! The DLL should not be directly in the plugins folder - Leave it inside its 'Catman232-Homebrewery' folder!", 4); Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1); return; } string pluginshbfiles = "HomebreweryFiles"; if (Directory.Exists(Path.Combine(Location.FullName, "plugins"))) { _installType = InstallType.Manual; pluginshbfiles = Path.Combine("plugins", "HomebreweryFiles"); } if (_installType == InstallType.r2ModMan) { Internal = new DirectoryInfo(Path.Combine(Location.FullName, "Internal")); HBFiles = new DirectoryInfo(Path.Combine(Location.FullName, "HomebreweryFiles")); TexReplacer._folder = new DirectoryInfo(Path.Combine(Paths.ConfigPath, "TextureReplace")); ContentPacks = new DirectoryInfo(Path.Combine(Paths.ConfigPath, "ContentPacks")); } else if (_installType == InstallType.Manual) { Internal = new DirectoryInfo(Path.Combine(Location.FullName, "plugins", "Internal")); HBFiles = new DirectoryInfo(Path.Combine(Location.FullName, "plugins", "HomebreweryFiles")); TexReplacer._folder = new DirectoryInfo(Path.Combine(Location.FullName, "config", "TextureReplace")); ContentPacks = new DirectoryInfo(Path.Combine(Location.FullName, "config", "ContentPacks")); } if (!Internal.Exists) { Log("Internal folder could not be found! Something is wrong with your mod installation!", 4); Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1); return; } if (!HBFiles.Exists) { Log("HomebreweryFiles folder could not be found! Something is wrong with your mod installation!", 4); Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1); return; } if (!ContentPacks.Exists) { ContentPacks.Create(); } Log("Info:\r\nMod's folder name: " + Location.Name + "\r\nPlugins path: " + Paths.PluginPath + "\r\n"); TextureFile.BlitBleedSetup(); ContentLoader._current = _homebreweryGameObject.AddComponent<ContentLoader>(); _harmony.PatchAll(Assembly.GetExecutingAssembly()); Log("_harmony.PatchAll done"); TexReplacer.Go(); Assign._nothingMesh = new Mesh { name = "NothingMesh" }; Assign._nothingGameObject = new GameObject("NothingGameObject") { hideFlags = (HideFlags)61 }; Log("Loading Vanilla assets!", 2); List<Mesh> list = new List<Mesh>(); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_collars")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_shoulderpads/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_helms/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_capes/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/03_shield/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/00_axehammer/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/01_sword/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/02_dagger/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/03_scepter/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/04_magicbell/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/06_longbow/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/08_polearm/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/09_gun/")); IEnumerable<Mesh> enumerable = new <>z__ReadOnlyList<Mesh>(list); foreach (Mesh item in enumerable) { if (!AMesh.TryAdd(((Object)item).name, item) && !AMesh.TryAdd(((Object)item).name + "HB", item)) { Log("Vanilla Mesh Name: " + ((Object)item).name + " is too frequent! Cannot add to Mesh Dictionary!", 4); } } ScriptableArmorRender[] array = Resources.LoadAll<ScriptableArmorRender>("_graphic/_mesh/00_player/player_meshes/_armormeshes"); foreach (ScriptableArmorRender val in array) { ARend[((Object)val).name.Replace("00_armorRender_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("armorRender_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("helmRender_", string.Empty, StringComparison.OrdinalIgnoreCase)] = val; } ScriptableWeaponType[] array2 = Resources.LoadAll<ScriptableWeaponType>("_weapontype/"); foreach (ScriptableWeaponType val2 in array2) { WeaponItemFolder._weaponTypes[val2._weaponTypeClassTag] = val2; } ScriptableWeaponProjectileSet[] array3 = Resources.LoadAll<ScriptableWeaponProjectileSet>("_item/01_equipment/02_weapon/01_ranged/00_rangeweapon_projectilesets/"); ScriptableWeaponProjectileSet[] array4 = Resources.LoadAll<ScriptableWeaponProjectileSet>("_item/01_equipment/02_weapon/05_magicscepter/scepterprojectilesets/"); ScriptableWeaponProjectileSet[] array5 = Resources.LoadAll<ScriptableWeaponProjectileSet>("_item/01_equipment/02_weapon/06_magicbell/bell_projectilesets/"); int num = 0; ScriptableWeaponProjectileSet[] array6 = (ScriptableWeaponProjectileSet[])(object)new ScriptableWeaponProjectileSet[array3.Length + array4.Length + array5.Length]; ReadOnlySpan<ScriptableWeaponProjectileSet> readOnlySpan = new ReadOnlySpan<ScriptableWeaponProjectileSet>(array3); readOnlySpan.CopyTo(new Span<ScriptableWeaponProjectileSet>(array6).Slice(num, readOnlySpan.Length)); num += readOnlySpan.Length; ReadOnlySpan<ScriptableWeaponProjectileSet> readOnlySpan2 = new ReadOnlySpan<ScriptableWeaponProjectileSet>(array4); readOnlySpan2.CopyTo(new Span<ScriptableWeaponProjectileSet>(array6).Slice(num, readOnlySpan2.Length)); num += readOnlySpan2.Length; ReadOnlySpan<ScriptableWeaponProjectileSet> readOnlySpan3 = new ReadOnlySpan<ScriptableWeaponProjectileSet>(array5); readOnlySpan3.CopyTo(new Span<ScriptableWeaponProjectileSet>(array6).Slice(num, readOnlySpan3.Length)); num += readOnlySpan3.Length; IEnumerable<ScriptableWeaponProjectileSet> enumerable2 = new <>z__ReadOnlyArray<ScriptableWeaponProjectileSet>(array6); foreach (ScriptableWeaponProjectileSet item2 in enumerable2) { WeaponItemFolder._projectileSets[((Object)item2).name.Replace("weaponProjectileSet_", string.Empty, StringComparison.OrdinalIgnoreCase)] = item2; } ConsumableItemFolder.ConsumableObject = Resources.Load<GameObject>("_item/02_consumable/03_status/_consumableeffect_healthconsumable"); DyeItemFolder.DyeObject = Resources.Load<GameObject>("_item/02_consumable/01_dye/_consumableeffect_blackdye"); List<GameObject> list2 = new List<GameObject>(); list2.AddRange(Resources.LoadAll<GameObject>("_item/02_consumable/01_dye/")); list2.AddRange(Resources.LoadAll<GameObject>("_item/02_consumable/02_skillscroll/")); list2.AddRange(Resources.LoadAll<GameObject>("_item/02_consumable/03_status/")); list2.AddRange(from c in Resources.LoadAll<GameObject>("_skill/") where ((Object)c).name.StartsWith("_conditionEffect_", StringComparison.OrdinalIgnoreCase) || ((Object)c).name.StartsWith("_conditionObject_", StringComparison.OrdinalIgnoreCase) select c); IEnumerable<GameObject> enumerable3 = new <>z__ReadOnlyList<GameObject>(list2); foreach (GameObject item3 in enumerable3) { string text2 = ((Object)item3).name.Replace("_consumableEffect_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("_conditionEffect_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("_conditionObject_", string.Empty, StringComparison.OrdinalIgnoreCase); if (!ConsumableObjects.TryAdd(text2, item3) && !ConsumableObjects.TryAdd(text2 + "HB", item3)) { Log("ConsumableObject Name: " + ((Object)item3).name + " is too frequent! Cannot add to ConsumableObjects Dictionary!", 4); } } ConsumableObjects.Remove("crya"); Cond.IDSet(); Log("Making Internal Sprites!", 2); string[] array7 = new string[13] { "based", "Nokia_3310", "BrokenDye", "joker", "VanityIco", "PortalIco", "ExitIco", "ForwardIco", "BackIco", "NextIco", "PreviousIco", "StorageIco", "DungeonIco" }; string[] array8 = array7; foreach (string text3 in array8) { Sprites.Add(text3, MakeSprite(Internal.FullName, text3)); } Log("Checking HomebreweryFiles and constructing objects!"); _modsSW.Start(); _modShops.Add(new ModShop("All Items")); _modFolders.Add("Catman-Homebrewery", new ModFolder("Catman-Homebrewery", HBFiles)); Log("Finding other content folders and constructing objects!"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("Paths:"); List<DirectoryInfo> list3 = (from d in Location.Parent.EnumerateDirectories() where !File.Exists(Path.Combine(d.FullName, "manifest.json.old")) && Directory.Exists(Path.Combine(d.FullName, pluginshbfiles)) select d).ToList(); _modFolders.TryAdd(Location.Name, null); int length = Paths.PluginPath.Length; List<DirectoryInfo> list4 = new List<DirectoryInfo>(1) { HBFiles }; foreach (DirectoryInfo item4 in list3) { string name = item4.Name; string text4 = Path.Combine(item4.FullName, pluginshbfiles, "HB_Info.json"); if (File.Exists(text4)) { HB_InfoJson hB_InfoJson = new HB_InfoJson(text4); if (hB_InfoJson.Name.Length != 0) { name = hB_InfoJson.Name; } } if (!_modFolders.ContainsKey(name)) { _modFolders.Add(name, new ModFolder(name, new DirectoryInfo(Path.Combine(item4.FullName, pluginshbfiles)))); list4.Add(new DirectoryInfo(Path.Combine(item4.FullName, pluginshbfiles))); string fullName = item4.FullName; num = length; stringBuilder.AppendLine(fullName.Substring(num, fullName.Length - num)); } } List<DirectoryInfo> list5 = new List<DirectoryInfo>(); if (_contentPacks != null) { list5.AddRange(from d in ContentPacks.EnumerateDirectories() where Directory.Exists(Path.Combine(d.FullName, "plugins", "HomebreweryFiles")) select d); foreach (DirectoryInfo item5 in list5) { string name2 = item5.Name; string text5 = Path.Combine(item5.FullName, "plugins", "HomebreweryFiles", "HB_Info.json"); if (File.Exists(text5)) { HB_InfoJson hB_InfoJson2 = new HB_InfoJson(text5); if (hB_InfoJson2.Name.Length != 0) { name2 = hB_InfoJson2.Name; } } if (!_modFolders.ContainsKey(name2)) { _modFolders.Add(name2, new ModFolder(name2, new DirectoryInfo(Path.Combine(item5.FullName, "plugins", "HomebreweryFiles")))); list4.Add(new DirectoryInfo(Path.Combine(item5.FullName, pluginshbfiles))); string fullName = item5.FullName; num = length; stringBuilder.AppendLine(fullName.Substring(num, fullName.Length - num)); } } } if (list4.Count + list5.Count > 0) { Log($"Mods imported: {list4.Count + list5.Count}"); } else { Log("None found!\n"); } Log(stringBuilder.ToString(), 1); _modsSW.Stop(); Log($"Time Taken: {_modsSW.Elapsed.TotalSeconds:N2}s"); if (CT.Enabled) { CT.RegisterListeners(); } MainThreadJobber._jobber = _homebreweryGameObject.AddComponent<MainThreadJobber>(); Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1); } internal static async Task Cache_HBScriptableAssets() { Log("Cache_HBScriptableAssets()", 1); WeaponTypeCombatParams val = WeaponItemFolder._weaponTypes["Unarmed"]._weaponAnimSlots[0]._weaponTypeCombatParams[0]; val._allowJumpAttack = true; val._timeBeforeJumpAttack = 0.08f; val._JumpAttackJumpForce = 50f; val._JumpAttackFowardForce = 90f; val._JumpAttackJumpGravityMultiply = 50f; val._jumpLandDelayTime = 0.5f; RaceStructer(); Log("Doing RaceArmorRender race assignments!", 2); foreach (Action playerRaceAssignment in _playerRaceAssignments) { playerRaceAssignment(); } _playerRaceAssignments.Clear(); Log("Awaiting GLB and MP3 imports!"); await Task.WhenAll(_importTasks).ConfigureAwait(continueOnCapturedContext: true); _importTasks.Clear(); ModelAliases(); Log("Doing model part assignments!", 2); foreach (List<Action> value7 in _modelPartAssignments.Values) { foreach (Action item in value7) { item(); } } Log("Sorting out fancy consumables!", 2); foreach (Action consumableDXAction in _consumableDXActions) { consumableDXAction(); } _consumableDXActions.Clear(); Log("Inserting Custom items!"); foreach (Action addNewItem in _addNewItems) { addNewItem(); } _addNewItems.Clear(); if (GM._cachedScriptableItems.TryGetValue("#HB#TEST Dye`Catman-Homebrewery-Dye-Homebrewery_Dye_Test#HB#", out var value)) { _testDye = (ScriptableArmorDye)value; } Log("Sorting out weapon properties!", 2); foreach (Action weaponActionsAction in _weaponActionsActions) { weaponActionsAction(); } _weaponActionsActions.Clear(); if (_races.TryGetValue(RaceType.Byrdle, out var value2)) { Log("Inserting Custom parts for Byrdle!"); _addParts[RaceType.Byrdle][FolderType.Mouth] = _addParts[RaceType.Byrdle][FolderType.Mouth].OrderBy((AnyThing m) => (!m._beak) ? 1 : 0).ToList(); PartInserter(value2); } if (_races.TryGetValue(RaceType.Chang, out var value3)) { Log("Inserting Custom parts for Chang!"); PartInserter(value3); } if (_races.TryGetValue(RaceType.Imp, out var value4)) { Log("Inserting Custom parts for Imp!"); PartInserter(value4); } if (_races.TryGetValue(RaceType.Kubold, out var value5)) { Log("Inserting Custom parts for Kubold!"); PartInserter(value5); } if (_races.TryGetValue(RaceType.Poon, out var value6)) { Log("Inserting Custom parts for Poon!"); PartInserter(value6); } if (MainConfig._current._spreadVanillaParts.Value) { Log("Sharing Vanilla parts to Byrdle!"); PartSpreader(value2, value3, value4, value5, value6); Log("Sharing Vanilla parts to Chang!"); PartSpreader(value3, value2, value4, value5, value6); Log("Sharing Vanilla parts to Imp!"); PartSpreader(value4, value2, value3, value5, value6); Log("Sharing Vanilla parts to Kubold!"); PartSpreader(value5, value2, value3, value4, value6); Log("Sharing Vanilla parts to Poon!"); PartSpreader(value6, value2, value3, value4, value5); } Log("Generating a shop source for some vanilla items!", 2); GetVanillaItems(); Log("Organising the shop sources!", 2); for (int i = 1; i < _modShops.Count; i++) { _modShops[i].SortThem(); _modShops[i].ChunkThem(); _modShops[0]._items_Cons.AddRange(_modShops[i]._items_Cons); _modShops[0]._items_Gear.AddRange(_modShops[i]._items_Gear); _modShops[0]._items_Trad.AddRange(_modShops[i]._items_Trad); } _modShops[0].ChunkThem(); if (MainConfig._current._condenseSmallMods.Value > 0) { ModShop modShop = new ModShop("Small Mods"); foreach (ModShop item2 in _modShops.ToList()) { int num = item2._items_Gear.Count + item2._items_Trad.Count + item2._items_Cons.Count; if (num <= MainConfig._current._condenseSmallMods.Value) { modShop._items_Gear.AddRange(item2._items_Gear); modShop._items_Cons.AddRange(item2._items_Cons); modShop._items_Trad.AddRange(item2._items_Trad); _modShops.Remove(item2); } } modShop.SortThem(); modShop.ChunkThem(); _modShops.Add(modShop); } Shop._current = _homebreweryGameObject.AddComponent<Shop>(); Phone._current = _homebreweryGameObject.AddComponent<Phone>(); _stopwatch.Stop(); Log($"Everything accomplished! Took {_stopwatch.Elapsed.TotalSeconds:N2}s from Instantiation to this Log."); } internal static void ModelAliases() { string[][] array = new string[12][] { new string[2] { "hood", "hood01" }, new string[2] { "robeSkirt", "robeSkirt01" }, new string[2] { "armCuffs_00", "armCuff01" }, new string[2] { "armCuffs_01", "armCuff02" }, new string[2] { "armCuffs_02", "armCuff03" }, new string[2] { "chestMesh_00", "chestpiece03" }, new string[2] { "hipMesh_00", "legPads03" }, new string[2] { "legCuffs_00", "legCuffs03" }, new string[2] { "legCuffs_01", "shinPads01" }, new string[2] { "chestTabard_00", "chestTabard02" }, new string[2] { "chestTabard_01", "chestTabard03" }, new string[2] { "belt_00", "beltSash02" } }; string[][] array2 = array; foreach (string[] array3 in array2) { if (ARend.TryGetValue(array3[0], out ScriptableArmorRender value)) { ARend[array3[1]] = value; } } string[][] array4 = new string[5][] { new string[2] { "_collar_00", "vikingArmor_collar" }, new string[2] { "Catman-Homebrewery-Mesh-warlockArmor_collar", "warlockArmor_collar" }, new string[2] { "Catman-Homebrewery-Mesh-thiefArmor_collar", "thiefArmor_collar" }, new string[2] { "Catman-Homebrewery-Mesh-mysticArmor_collar", "mysticArmor_collar" }, new string[2] { "Catman-Homebrewery-Mesh-maidArmor_collar", "maidArmor_collar" } }; string[][] array5 = array4; foreach (string[] array6 in array5) { if (AMesh.TryGetValue(array6[0], out Mesh value2)) { AMesh[array6[1]] = value2; } } } private static void PartInserter(RaceStruct them) { foreach (FolderType key in _addParts[them._type].Keys) { foreach (AnyThing item in _addParts[them._type][key]) { switch (key) { case FolderType.Eyes: { Eyes eyes = (Eyes)item; string text = them._race._eyeTextures.Length.ToString(CultureInfo.InvariantCulture); _partInd[them._type][FolderType.Eyes].Add(eyes._name, text); _partInd[them._type][FolderType.Eyes].Add(text, eyes._name); ScriptablePlayerRace race2 = them._race; EyeTextureGroup[] eyeTextures = them._race._eyeTextures; int num = 0; EyeTextureGroup[] array2 = (EyeTextureGroup[])(object)new EyeTextureGroup[1 + eyeTextures.Length]; ReadOnlySpan<EyeTextureGroup> readOnlySpan2 = new ReadOnlySpan<EyeTextureGroup>(eyeTextures); readOnlySpan2.CopyTo(new Span<EyeTextureGroup>(array2).Slice(num, readOnlySpan2.Length)); num += readOnlySpan2.Length; array2[num] = eyes._obj; race2._eyeTextures = array2; eyes.Added = true; break; } case FolderType.Hair: { Hair hair = (Hair)item; if (!((Object)(object)hair._obj[them._type] == (Object)null)) { string text = them._race._hairStyleMeshes.Length.ToString(CultureInfo.InvariantCulture); _partInd[them._type][FolderType.Hair].Add(hair._name, text); _partInd[them._type][FolderType.Hair].Add(text, hair._name); ScriptablePlayerRace race4 = them._race; Mesh[] hairStyleMeshes = them._race._hairStyleMeshes; int num = 0; Mesh[] array4 = (Mesh[])(object)new Mesh[1 + hairStyleMeshes.Length]; ReadOnlySpan<Mesh> readOnlySpan4 = new ReadOnlySpan<Mesh>(hairStyleMeshes); readOnlySpan4.CopyTo(new Span<Mesh>(array4).Slice(num, readOnlySpan4.Length)); num += readOnlySpan4.Length; array4[num] = hair._obj[them._type]; race4._hairStyleMeshes = array4; hair.Added = true; } break; } case FolderType.Mouth: { Mouth mouth = (Mouth)item; string text = them._race._mouthTextures.Length.ToString(CultureInfo.InvariantCulture); _partInd[them._type][FolderType.Mouth].Add(mouth._name, text); _partInd[them._type][FolderType.Mouth].Add(text, mouth._name); ScriptablePlayerRace race3 = them._race; MouthTextureGroup[] mouthTextures = them._race._mouthTextures; int num = 0; MouthTextureGroup[] array3 = (MouthTextureGroup[])(object)new MouthTextureGroup[1 + mouthTextures.Length]; ReadOnlySpan<MouthTextureGroup> readOnlySpan3 = new ReadOnlySpan<MouthTextureGroup>(mouthTextures); readOnlySpan3.CopyTo(new Span<MouthTextureGroup>(array3).Slice(num, readOnlySpan3.Length)); num += readOnlySpan3.Length; array3[num] = mouth._obj; race3._mouthTextures = array3; mouth.Added = true; break; } case FolderType.Skin: { Skin skin = (Skin)item; if (skin._obj[them._type]._textureGroupTag.Length != 0) { string text = them._race._skinTextureGroups.Length.ToString(CultureInfo.InvariantCulture); _partInd[them._type][FolderType.Skin].Add(skin._name, text); _partInd[them._type][FolderType.Skin].Add(text, skin._name); if ((Object)(object)skin._obj[them._type]._bodyTexture == (Object)null) { skin._obj[them._type]._bodyTexture = them._race._skinTextureGroups[2]._bodyTexture; } if ((Object)(object)skin._obj[them._type]._legTexture == (Object)null) { skin._obj[them._type]._legTexture = them._race._skinTextureGroups[2]._legTexture; } if ((Object)(object)skin._obj[them._type]._headTexture == (Object)null) { skin._obj[them._type]._headTexture = them._race._skinTextureGroups[2]._headTexture; } if ((Object)(object)skin._obj[them._type]._hairTexture == (Object)null) { skin._obj[them._type]._hairTexture = them._race._skinTextureGroups[2]._hairTexture; } if ((Object)(object)skin._obj[them._type]._earTexture == (Object)null) { skin._obj[them._type]._earTexture = them._race._skinTextureGroups[2]._earTexture; } if ((Object)(object)skin._obj[them._type]._tailTexture == (Object)null) { skin._obj[them._type]._tailTexture = them._race._skinTextureGroups[2]._tailTexture; } ScriptablePlayerRace race = them._race; SkinTextureGroup[] skinTextureGroups = them._race._skinTextureGroups; int num = 0; SkinTextureGroup[] array = (SkinTextureGroup[])(object)new SkinTextureGroup[1 + skinTextureGroups.Length]; ReadOnlySpan<SkinTextureGroup> readOnlySpan = new ReadOnlySpan<SkinTextureGroup>(skinTextureGroups); readOnlySpan.CopyTo(new Span<SkinTextureGroup>(array).Slice(num, readOnlySpan.Length)); num += readOnlySpan.Length; array[num] = skin._obj[them._type]; race._skinTextureGroups = array; skin.Added = true; } break; } } } _addParts[them._type][key].Clear(); } } private static void PartSpreader(RaceStruct them, RaceStruct a, RaceStruct b, RaceStruct c, RaceStruct d) { RaceStruct[] array = new RaceStruct[4] { a, b, c, d }; RaceStruct[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaceStruct raceStruct = array2[i]; int num = 0; EyeTextureGroup[] eyes = raceStruct._eyes; foreach (EyeTextureGroup val in eyes) { string text = them._race._eyeTextures.Length.ToString(CultureInfo.InvariantCulture); string text2 = $"Atlyss-Eyes-{raceStruct._race._raceName}{num}"; num++; _partInd[them._type][FolderType.Eyes].Add(text2, text); _partInd[them._type][FolderType.Eyes].Add(text, text2); ScriptablePlayerRace race = them._race; EyeTextureGroup[] eyeTextures = them._race._eyeTextures; int num2 = 0; EyeTextureGroup[] array3 = (EyeTextureGroup[])(object)new EyeTextureGroup[1 + eyeTextures.Length]; ReadOnlySpan<EyeTextureGroup> readOnlySpan = new ReadOnlySpan<EyeTextureGroup>(eyeTextures); readOnlySpan.CopyTo(new Span<EyeTextureGroup>(array3).Slice(num2, readOnlySpan.Length)); num2 += readOnlySpan.Length; array3[num2] = val; race._eyeTextures = array3; } num = 0; if (them._type != RaceType.Byrdle) { MouthTextureGroup[] mouth = raceStruct._mouth; foreach (MouthTextureGroup val2 in mouth) { string text = them._race._mouthTextures.Length.ToString(CultureInfo.InvariantCulture); string text3 = $"Atlyss-Mouth-{raceStruct._race._raceName}{num}"; num++; _partInd[them._type][FolderType.Mouth].Add(text3, text); _partInd[them._type][FolderType.Mouth].Add(text, text3); ScriptablePlayerRace race2 = them._race; MouthTextureGroup[] mouthTextures = them._race._mouthTextures; int num2 = 0; MouthTextureGroup[] array4 = (MouthTextureGroup[])(object)new MouthTextureGroup[1 + mouthTextures.Length]; ReadOnlySpan<MouthTextureGroup> readOnlySpan2 = new ReadOnlySpan<MouthTextureGroup>(mouthTextures); readOnlySpan2.CopyTo(new Span<MouthTextureGroup>(array4).Slice(num2, readOnlySpan2.Length)); num2 += readOnlySpan2.Length; array4[num2] = val2; race2._mouthTextures = array4; } } num = 0; SkinTextureGroup[] skins = raceStruct._skins; foreach (SkinTextureGroup val3 in skins) { string text = them._race._skinTextureGroups.Length.ToString(CultureInfo.InvariantCulture); string text4 = $"Atlyss-Skin-{raceStruct._race._raceName}{num}"; num++; _partInd[them._type][FolderType.Skin].Add(text4, text); _partInd[them._type][FolderType.Skin].Add(text, text4); ScriptablePlayerRace race3 = them._race; SkinTextureGroup[] skinTextureGroups = them._race._skinTextureGroups; int num2 = 0; SkinTextureGroup[] array5 = (SkinTextureGroup[])(object)new SkinTextureGroup[1 + skinTextureGroups.Length]; ReadOnlySpan<SkinTextureGroup> readOnlySpan3 = new ReadOnlySpan<SkinTextureGroup>(skinTextureGroups); readOnlySpan3.CopyTo(new Span<SkinTextureGroup>(array5).Slice(num2, readOnlySpan3.Length)); num2 += readOnlySpan3.Length; array5[num2] = val3; race3._skinTextureGroups = array5; } } } private static void GetVanillaItems() { ModShop modShop = new ModShop("Vanilla Items"); _modShops.Add(modShop); (string, int)[] array = new(string, int)[13] { ("Red Dye", 1), ("Orange Dye", 2), ("Lime Dye", 3), ("Green Dye", 4), ("Blue Dye", 5), ("Cyan Dye", 6), ("Yellow Dye", 7), ("Brown Dye", 8), ("Pink Dye", 9), ("Purple Dye", 10), ("White Dye", 11), ("Grey Dye", 12), ("Black Dye", 13) }; (string, int)[] array2 = array; for (int i = 0; i < array2.Length; i++) { (string, int) tuple = array2[i]; string item = tuple.Item1; int item2 = tuple.Item2; VanillaItem vanillaItem = new VanillaItem(null, null, FolderType.Dye, (ShopTab)1) { _itemName = item, Added = true, SortTag = (SortTag)1, sortindex = item2 }; vanillaItem.ShopItem._scriptItem = GM._cachedScriptableItems[item]; vanillaItem.ShopItem._itemNameTag = item; modShop._items_Cons.Add(vanillaItem); } string[] array3 = new string[5] { "Necro Marrow", "Leather Top", "Sagecloth Top", "Aero Top", "Nutso Top" }; string[] array4 = array3; foreach (string text in array4) { VanillaItem vanillaItem2 = new VanillaItem(null, null, FolderType.Chestpiece, (ShopTab)0) { _itemName = text, Added = true }; vanillaItem2.ShopItem._scriptItem = GM._cachedScriptableItems[text]; vanillaItem2.ShopItem._itemNameTag = text; modShop._items_Gear.Add(vanillaItem2); } array3 = new string[5] { "Necro Caustics", "Leather Britches", "Sagecloth Shorts", "Aero Pants", "Nutso Pants" }; string[] array5 = array3; foreach (string text2 in array5) { VanillaItem vanillaItem3 = new VanillaItem(null, null, FolderType.Leggings, (ShopTab)0) { _itemName = text2, Added = true }; vanillaItem3.ShopItem._scriptItem = GM._cachedScriptableItems[text2]; vanillaItem3.ShopItem._itemNameTag = text2; modShop._items_Gear.Add(vanillaItem3); } } private static Sprite MakeSprite(string path, string name) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) byte[] array = File.ReadAllBytes(Path.Combine(path, name + ".png")); 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, false); 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Invalid comparison between Unknown and I4 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Invalid comparison between Unknown and I4 //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Invalid comparison between Unknown and I4 //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKey((KeyCode)308) && Input.GetKeyUp((KeyCode)120)) { _hotkeysOn = !_hotkeysOn; Log($"Toggled hotkeysOn to {_hotkeysOn}"); } if (!_hotkeysOn) { return; } bool flag = Object.op_Implicit((Object)(object)Player._mainPlayer) && (int)Player._mainPlayer._currentGameCondition == 1 && !Player._mainPlayer._inChat && !Player._mainPlayer._inUI; bool flag2 = Object.op_Implicit((Object)(object)MainMenuManager._current) && (int)MainMenuManager._current._mainMenuCondition == 2; bool flag3 = Object.op_Implicit((Object)(object)MainMenuManager._current) && (int)MainMenuManager._current._mainMenuCondition == 1 && Object.op_Implicit((Object)(object)MainMenuManager._current._characterSelectManager._setRaceModelED) && Object.op_Implicit((Object)(object)MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel); bool flag4 = Input.GetKey((KeyCode)304) || Input.GetKey((KeyCode)303); bool flag5 = Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)305); if (Input.GetKeyDown((KeyCode)114) && flag5) { if (!flag4) { ReloadAll(nocheck: false); } else { ReloadAll(nocheck: true); } } if (Input.GetKeyUp((KeyCode)286)) { ErrorLister(); } if (flag) { if (Input.GetKeyUp((KeyCode)287) && Player._mainPlayer._isHostPlayer) { if (GameWorldManager._current._dayNightCycleInterval == 0f) { if ((int)GameWorldManager._current._clockSetting == 1) { GameWorldManager._current._dayNightCycleInterval = 0f; GameWorldManager._current._clockSetting = (ClockSetting)0; GameWorldManager._current._timeDisplay = 12; GameWorldManager._current._worldTime = (WorldTime)1; } else { GameWorldManager._current._dayNightCycleInterval = 40f; } } else { GameWorldManager._current._dayNightCycleInterval = 0f; GameWorldManager._current._clockSetting = (ClockSetting)1; GameWorldManager._current._timeDisplay = 12; GameWorldManager._current._worldTime = (WorldTime)0; } } if (!_shownUpdateMessage) { _shownUpdateMessage = true; if (!MainConfig._current._alwaysShowUpdateMsg.Value) { MainConfig._current._updateMessage.Value = UpdateCount; } } _foodLevel -= Time.deltaTime / MainConfig._current._foodDigestRate.Value; if (_foodLevel < 0f) { _foodLevel = 0f; } } if ((Object)(object)_testDye != (Object)null && (flag || flag2)) { if (flag4) { if (Input.GetKeyDown((KeyCode)45)) { ColorAdjustShader_Profile dyeParams = _testDye._dyeParams; dyeParams._hue += 15f; if (_testDye._dyeParams._hue > 360f) { _testDye._dyeParams._hue = -345f; } Log($"TEST Dye Hue is now {_testDye._dyeParams._hue}"); } } else if (Input.GetKeyUp((KeyCode)45)) { ColorAdjustShader_Profile dyeParams2 = _testDye._dyeParams; dyeParams2._hue += 1f; if (_testDye._dyeParams._hue > 360f) { _testDye._dyeParams._hue = -359f; } Log($"TEST Dye Hue is now {_testDye._dyeParams._hue}"); } if (Input.GetKeyUp((KeyCode)61)) { _testDye._dyeParams._saturation = (float)((double)_testDye._dyeParams._saturation + 0.1); if (_testDye._dyeParams._saturation > 2.05f) { _testDye._dyeParams._saturation = 0f; } Log($"TEST Dye Saturation is now {_testDye._dyeParams._saturation}"); } if (Input.GetKeyUp((KeyCode)91)) { _testDye._dyeParams._brightness = (float)Math.Round((float)((double)_testDye._dyeParams._brightness + 0.1), 1); if (_testDye._dyeParams._brightness > 1.05f) { _testDye._dyeParams._brightness = -1f; } Log($"TEST Dye Brightness is now {_testDye._dyeParams._brightness}"); } if (Input.GetKeyUp((KeyCode)93)) { _testDye._dyeParams._contrast = (float)((double)_testDye._dyeParams._contrast + 0.1); if (_testDye._dyeParams._contrast > 2.05f) { _testDye._dyeParams._contrast = 0f; } Log($"TEST Dye Contrast is now {_testDye._dyeParams._contrast}"); } } if (!flag3 || flag5) { return; } PlayerRaceModel playerRaceModel = MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel; if ((Object)(object)playerRaceModel != (Object)null) { if (Input.GetKeyUp((KeyCode)119)) { playerRaceModel.Set_EyeCondition((EyeCondition)1, 2f); } if (Input.GetKeyUp((KeyCode)115)) { playerRaceModel.Set_EyeCondition((EyeCondition)2, 2f); } if (Input.GetKeyUp((KeyCode)97)) { playerRaceModel.Set_EyeCondition((EyeCondition)3, 2f); } if (Input.GetKeyUp((KeyCode)100)) { playerRaceModel.Set_EyeCondition((EyeCondition)4, 2f); } if (Input.GetKeyUp((KeyCode)101)) { playerRaceModel.Set_EyeCondition((EyeCondition)8, 2f); } if (Input.GetKeyUp((KeyCode)113)) { playerRaceModel.Set_EyeCondition((EyeCondition)7, 2f); } if (Input.GetKeyUp((KeyCode)114)) { playerRaceModel.Set_EyeCondition((EyeCondition)5, 2f); } if (Input.GetKeyUp((KeyCode)102)) { playerRaceModel.Set_MouthCondition((MouthCondition)1, 2f); } } } internal static void DropMe(string item, int n = 1) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown if (!Assign.ItemMatcher(item, out ScriptableItem firstmatch) || (Object)(object)firstmatch == (Object)null) { Log(item + " is not a real item!", 3); return; } GameManager._current.Client_SpawnLocalItemObject(new ItemData { _itemName = firstmatch._itemName, _quantity = n }, NetworkClient.localPlayer, ((Component)Player._mainPlayer).transform.position, 0, ((Component)Player._mainPlayer).transform, true); } public static void TellMeAbout(object it, bool showempty = true) { Log("TellMeAbout..."); if (it == null) { Log("It's null"); Log("...ToldYouAbout.\n"); return; } Log("Object: " + it); List<FieldInfo> 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) { Log(item.Name.Replace("k__BackingField", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("<", string.Empty, StringComparison.OrdinalIgnoreCase).Replace(">", string.Empty, StringComparison.OrdinalIgnoreCase) + " " + item.GetValue(it)); } } } List<PropertyInfo> 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) { Log(item2.Name.Replace("k__BackingField", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("<", string.Empty, StringComparison.OrdinalIgnoreCase).Replace(">", string.Empty, StringComparison.OrdinalIgnoreCase) + " " + item2.GetValue(it)); } } } Log("...ToldYouAbout.\n"); } internal void DumpAllScriptables() { //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Expected O, but got Unknown //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Expected O, but got Unknown //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Expected O, but got Unknown //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Expected O, but got Unknown //IL_07ef: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Expected O, but got Unknown //IL_0992: Unknown result type (might be due to invalid IL or missing references) //IL_0999: Expected O, but got Unknown //IL_0a09: Unknown result type (might be due to invalid IL or missing references) //IL_0a10: Expected O, but got Unknown //IL_0bcc: Unknown result type (might be due to invalid IL or missing references) //IL_0ea5: Unknown result type (might be due to invalid IL or missing references) //IL_0eac: Expected O, but got Unknown //IL_0c2c: Unknown result type (might be due to invalid IL or missing references) //IL_0c33: Expected O, but got Unknown //IL_0fb3: Unknown result type (might be due to invalid IL or missing references) //IL_0fba: Expected O, but got Unknown //IL_0d4c: Unknown result type (might be due to invalid IL or missing references) //IL_0d53: Expected O, but got Unknown //IL_10a5: Unknown result type (might be due to invalid IL or missing references) //IL_11c0: Unknown result type (might be due to invalid IL or missing references) //IL_11d7: Unknown result type (might be due to invalid IL or missing references) IEnumerable<ScriptableItem> enumerable = GameManager._current._cachedScriptableItems.Values.Where((ScriptableItem i) => !i._itemName.StartsWith("#HB#", StringComparison.OrdinalIgnoreCase)); DirectoryInfo directoryInfo = Location.CreateSubdirectory("Scriptable"); Dictionary<Type, DirectoryInfo> dictionary = new Dictionary<Type, DirectoryInfo>(); dictionary.Add(typeof(ScriptableArmorDye), directoryInfo.CreateSubdirectory("ArmorDye")); dictionary.Add(typeof(ScriptableCape), directoryInfo.CreateSubdirectory("Cape")); dictionary.Add(typeof(ScriptableChestpiece), directoryInfo.CreateSubdirectory("Chestpiece")); dictionary.Add(typeof(ScriptableHelm), directoryInfo.CreateSubdirectory("Helm")); dictionary.Add(typeof(ScriptableLeggings), directoryInfo.CreateSubdirectory("Leggings")); dictionary.Add(typeof(ScriptableRing), directoryInfo.CreateSubdirectory("Ring")); dictionary.Add(typeof(ScriptableShield), directoryInfo.CreateSubdirectory("Shield")); dictionary.Add(typeof(ScriptableStatusConsumable), directoryInfo.CreateSubdirectory("StatusConsumable")); dictionary.Add(typeof(ScriptableTradeItem), directoryInfo.CreateSubdirectory("TradeItem")); dictionary.Add(typeof(ScriptableWeapon), directoryInfo.CreateSubdirectory("Weapon")); Dictionary<Type, DirectoryInfo> dictionary2 = dictionary; foreach (ScriptableItem item in enumerable) { try { List<string> list = new List<string>(); 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(Path.Combine(value.FullName, item._itemName + ".txt"), list); continue; } if (type == typeof(ScriptableArmorDye) || type == typeof(ScriptableStatusConsumable)) { ScriptableConsumable val = (ScriptableConsumable)item; list.Add("\n- ScriptableConsumable -"); list.Add($"_consumableCooldown : {val._consumableCooldown}"); list.Add($"_consumableObject : {val._consumableObject}"); list.Add($"_useOnlyInTown : {val._useOnlyInTown}"); list.Add($"_unperishable : {val._unperishable}"); if (type == typeof(ScriptableStatusConsumable)) { ScriptableStatusConsumable val2 = (ScriptableStatusConsumable)val; list.Add("\n- ScriptableStatusConsumable -"); list.Add($"_healthApply : {val2._healthApply}"); list.Add($"_manaApply : {val2._manaApply}"); list.Add($"_staminaApply : {val2._staminaApply}"); list.Add($"_expGain : {val2._expGain}"); list.Add($"_resetSkillPoints : {val2._resetSkillPoints}"); list.Add($"_resetAttributePoints : {val2._resetAttributePoints}"); File.WriteAllLinesAsync(Path.Combine(value.FullName, item._itemName + ".txt"), list); } else if (type == typeof(ScriptableArmorDye)) { ScriptableArmorDye val3 = (ScriptableArmorDye)val; list.Add("\n- ScriptableArmorDye -"); 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(Path.Combine(value.FullName, item._itemName + ".txt"), list); } continue; } ScriptableEquipment val4 = (ScriptableEquipment)item; list.Add("\n- ScriptableEquipment -"); list.Add($"_equipmentLevel : {val4._equipmentLevel}"); list.Add($"_classRequirement : {val4._classRequirement}"); list.Add("_statArray : {"); list.Add($" _maxHealth : {val4._statArray._maxHealth}\r\n _maxMana : {val4._statArray._maxMana}\r\n _maxStamina : {val4._statArray._maxStamina}\r\n _experience : {val4._statArray._experience}\r\n _attackPower : {val4._statArray._attackPower}\r\n _magicPower : {val4._statArray._magicPower}\r\n _dexPower : {val4._statArray._dexPower}\r\n _criticalRate : {val4._statArray._criticalRate}\r\n _magicCriticalRate : {val4._statArray._magicCriticalRate}\r\n _evasion : {val4._statArray._evasion}\r\n _defense : {val4._statArray._defense}\r\n _magicDefense : {val4._statArray._magicDefense}\r\n _fireResist : {val4._statArray._fireResist}\r\n _waterResist : {val4._statArray._waterResist}\r\n _natureResist : {val4._statArray._natureResist}\r\n _earthResist : {val4._statArray._earthResist}\r\n _holyResist : {val4._statArray._holyResist}\r\n _shadowResist : {val4._statArray._shadowResist}"); list.Add("}"); if (val4._statModifierCost != null) { list.Add("_statModifierCost : {"); list.Add($" _scriptItem : {val4._statModifierCost._scriptItem}\r\n _scriptItemQuantity : {val4._statModifierCost._scriptItemQuantity}"); list.Add("}"); } if (!(type == typeof(ScriptableCape)) && !(type == typeof(ScriptableChestpiece)) && !(type == typeof(ScriptableHelm)) && !(type == typeof(ScriptableLeggings)) && !(type == typeof(ScriptableRing))) { goto IL_0e8d; } ScriptableArmor val5 = (ScriptableArmor)val4; list.Add("\n- ScriptableArmor -"); if (val5._conditionResistances == null || val5._conditionResistances.Length == 0) { list.Add("_conditionResistances : []"); } else { list.Add("_conditionResistances : ["); ConditionResistance[] conditionResistances = val5._conditionResistances; foreach (ConditionResistance val6 in conditionResistances) { list.Add($" '{val6._conditionTag}' ~ {val6._resistancePercent}"); } list.Add("]"); } 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(Path.Combine(value.FullName, item._itemName + ".txt"), list); } else if (type == typeof(ScriptableCape)) { ScriptableCape val7 = (ScriptableCape)val5; list.Add("\n- ScriptableCape -"); list.Add($"_capeMesh : {val7._capeMesh}"); File.WriteAllLinesAsync(Path.Combine(value.FullName, item._itemName + ".txt"), list); } else if (type == typeof(ScriptableChestpiece)) { ScriptableChestpiece val8 = (ScriptableChestpiece)val5; list.Add("\n- ScriptableChestpiece -"); list.Add($"_lockBoobs : {val8._lockBoobs}"); list.Add($"_disableJiggleBoobBones : {val8._disableJiggleBoobBones}"); list.Add($"_textureArms : {val8._textureArms}"); list.Add($"_legOverlayTexture : {val8._legOverlayTexture}"); list.Add($"_boobOverrideTexture : {val8._boobOverrideTexture}"); list.Add($"_neckCollarMesh : {val8._neckCollarMesh}"); list.Add($"_neckCollarTexture : {val8._neckCollarTexture}"); list.Add($"_chestRenderDisplay : {val8._chestRenderDisplay}"); list.Add($"_chestRenderTexture : {val8._chestRenderTexture}"); list.Add($"_chestRenderBoobTexture : {val8._chestRenderBoobTexture}"); list.Add($"_robeSkirtRender : {val8._robeSkirtRender}"); list.Add($"_robeSkirtTexture : {val8._robeSkirtTexture}"); list.Add($"_hipMeshDisplay : {val8._hipMeshDisplay}"); list.Add($"_hipMeshTexture : {val8._hipMeshTexture}"); list.Add($"_armCuffRender : {val8._armCuffRender}"); list.Add($"_shoulderpadMesh : {val8._shoulderpadMesh}"); list.Add($"_shoulderpadTexture : {val8._shoulderpadTexture}"); list.Add($"_shoulderPadDisplayType : {val8._shoulderPadDisplayType}"); File.WriteAllLinesAsync(Path.Combine(value.FullName, item._itemName + ".txt"), list); } else if (type == typeof(ScriptableHelm)) { ScriptableHelm val9 = (ScriptableHelm)val5; list.Add("\n- ScriptableHelm -"); list.Add($"_blendHelmValue : {val9._blendHelmValue}"); list.Add($"_useHelmHairDisplay : {val9._useHelmHairDisplay}"); list.Add($"_hideEars : {val9._hideEars}"); list.Add($"_hideMisc : {val9._hideMisc}"); list.Add($"_isFullHelm : {val9._isFullHelm}"); list.Add($"_helmRender : {val9._helmRender}"); list.Add($"_helmOverrideMesh : {val9._helmOverrideMesh}"); File.WriteAllLinesAsync(Path.Combine(value.FullName, item._itemName + ".txt"), list); } else { if (!(type == typeof(ScriptableLeggings))) { goto IL_0e8d; } ScriptableLeggings val10 = (ScriptableLeggings)val5; list.Add("\n- ScriptableLeggings -"); list.Add($"_textureUpperLegOnly : {val10._textureUpperLegOnly}"); list.Add($"_textureFeet : {val10._textureFeet}"); list.Add($"_legPieceRender_01 : {val10._legPieceRender_01}"); list.Add($"_legPieceTexture_01 : {val10._legPieceTexture_01}"); list.Add($"_legPieceRender_02 : {val10._legPieceRender_02}"); list.Add($"_legPieceTexture_02 : {val10._legPieceTexture_02}"); list.Add($"_legPieceRender_03 : {val10._legPieceRender_03}"); list.Add($"_legPieceTexture_03 : {val10._legPieceTexture_03}"); list.Add($"_legPieceRender_04 : {val10._legPieceRender_04}"); list.Add($"_legPieceTexture_04 : {val10._legPieceTexture_04}"); File.WriteAllLinesAsync(Path.Combine(value.FullName, item._itemName + ".txt"), list); } goto end_IL_0171; IL_0e8d: if (type == typeof(ScriptableShield)) { ScriptableShield val11 = (ScriptableShield)val4; list.Add("\n- ScriptableShield -"); list.Add($"_shieldMesh : {val11._shieldMesh}"); list.Add($"_shieldTexture : {val11._shieldTexture}"); 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("}"); File.WriteAllLinesAsync(Path.Combine(value.FullName, item._itemName + ".txt"), list); } else if (type == typeof(ScriptableWeapon)) { ScriptableWeapon val12 = (ScriptableWeapon)val4; list.Add("\n- ScriptableWeapon -"); list.Add("weaponType : " + val12.weaponType._weaponTypeClassTag); list.Add($"_weaponHoldClipIndex : {val12._weaponHoldClipIndex}"); if (Object.op_Implicit((Object)(object)val12._combatElement)) { list.Add($"_combatElement : {val12._combatElement._elementName} - ID: {val12._combatElement._elementID}"); } else { list.Add("_combatElement : None"); } list.Add($"_weaponProjectileSet : {val12._weaponProjectileSet}"); list.Add($"_weaponDamage : {val12._weaponDamage}"); list.Add($"_damageBonus : {val12._damageBonus}"); list.Add($"_readonlyDamageRange : {val12._readonlyDamageRange}"); if (val12._weaponConditionSlot != null && Object.op_Implicit((Object)(object)val12._weaponConditionSlot._scriptableCondition)) { list.Add("_weaponConditionSlot : {"); list.Add($" _scriptableCondition : {val12._weaponConditionSlot._scriptableCondition._conditionName} - ID: {val12._weaponConditionSlot._scriptableCondition._ID}\r\n _chance : {val12._weaponConditionSlot._chance}\r\n _bonusPower : {val12._weaponConditionSlot._bonusPower}\r\n _bonusDuration : {val12._weaponConditionSlot._bonusDuration}"); list.Add("}"); } else { list.Add("_weaponConditionSlot : None"); } list.Add($"weaponTexture : {val12.weaponTexture}"); list.Add($"weaponMesh : {val12.weaponMesh}"); list.Add("trailColors : #" + ColorUtility.ToHtmlStringRGBA(val12.trailColors[0]) + " & #" + ColorUtility.ToHtmlStringRGBA(val12.trailColors[1])); list.Add("_textureColorAdjust : {"); list.Add($" _hue : {val12._textureColorAdjust._hue}\r\n _saturation : {val12._textureColorAdjust._saturation}\r\n _brightness : {val12._textureColorAdjust._brightness}\r\n _contrast : {val12._textureColorAdjust._contrast}"); list.Add("}"); list.Add($"_weaponTakeOutSfxIndex : {val12._weaponTakeOutSfxIndex}"); list.Add($"_setWeaponTakeOutSfx : {val12._setWeaponTakeOutSfx}"); list.Add($"_weaponSwingSfxIndex : {val12._weaponSwingSfxIndex}"); list.Add($"_setWeaponSwingSfx : {val12._setWeaponSwingSfx}"); File.WriteAllLinesAsync(Path.Combine(value.FullName, item._itemName + ".txt"), list); } end_IL_0171:; } catch { Log("DumpAllScriptables() - Didn't manage to make a file for " + item._itemName); throw; } } } internal static void RaceStructer() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown _playerRace_imp = Resources.Load<ScriptablePlayerRace>("_race/01_race_imp/playerrace_imp"); _playerRace_poon = Resources.Load<ScriptablePlayerRace>("_race/02_race_poon/playerrace_poon"); _playerRace_kubold = Resources.Load<ScriptablePlayerRace>("_race/03_race_kubold/playerrace_kubold"); _playerRace_byrdle = Resources.Load<ScriptablePlayerRace>("_race/04_race_byrdle/playerrace_byrdle"); _playerRace_chang = Resources.Load<ScriptablePlayerRace>("_race/05_race_chang/playerrace_chang"); _races.Add(RaceType.Imp, new RaceStruct(RaceType.Imp, _playerRace_imp)); _races.Add(RaceType.Poon, new RaceStruct(RaceType.Poon, _playerRace_poon)); _races.Add(RaceType.Kubold, new RaceStruct(RaceType.Kubold, _playerRace_kubold)); _races.Add(RaceType.Chang, new RaceStruct(RaceType.Chang, _playerRace_chang)); _playerRace_byrdle._disableMouthSelector = false; MouthTextureGroup val = new MouthTextureGroup { _closed = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_02"), _open = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_02") }; MouthTextureGroup val2 = new MouthTextureGroup { _closed = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_01"), _open = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_01") }; MouthTextureGroup val3 = new MouthTextureGroup { _closed = (Texture)(object)Texture2D.blackTexture, _open = (Texture)(object)Texture2D.blackTexture }; _playerRace_byrdle._mouthTextures = Array.Empty<MouthTextureGroup>(); _races.Add(RaceType.Byrdle, new RaceStruct(RaceType.Byrdle, _playerRace_byrdle)); _playerRace_byrdle._mouthTextures = (MouthTextureGroup[])(object)new MouthTextureGroup[3] { val, val2, val3 }; _partInd[RaceType.Byrdle][FolderType.Mouth].Add("Atlyss-Byrdle-Mouth-ByrdleBeakTex_02", "0"); _partInd[RaceType.Byrdle][FolderType.Mouth].Add("0", "Atlyss-Byrdle-Mouth-ByrdleBeakTex_02"); _partInd[RaceType.Byrdle][FolderType.Mouth].Add("Atlyss-Byrdle-Mouth-ByrdleBeakTex_01", "1"); _partInd[RaceType.Byrdle][FolderType.Mouth].Add("1", "Atlyss-Byrdle-Mouth-ByrdleBeakTex_01"); _partInd[RaceType.Byrdle][FolderType.Mouth].Add("Catman-Homebrewery-Byrdle-Mouth-hbInvisBeak", "2"); _partInd[RaceType.Byrdle][FolderType.Mouth].Add("2", "Catman-Homebrewery-Byrdle-Mouth-hbInvisBeak"); } 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 void OffsetSliders() { if (!Object.op_Implicit((Object)(object)SettingsManager._current._cameraVertPosSlider) || !Object.op_Implicit((Object)(object)SettingsManager._current._cameraHorizPosSlider)) { Log("Camera position offset sliders did not exist!", 4); return; } SettingsManager._current._cameraVertPosSlider.minValue = MainConfig._current._camera_VerticalMin.Value; SettingsManager._current._cameraVertPosSlider.maxValue = MainConfig._current._camera_VerticalMax.Value; SettingsManager._current._cameraHorizPosSlider.minValue = MainConfig._current._camera_HorizontalLeft.Value; SettingsManager._current._cameraHorizPosSlider.maxValue = MainConfig._current._camera_HorrizontalRight.Value; } } [HarmonyPatch(typeof(GameManager), "Cache_ScriptableAssets")] public static class WaitingForGameManager { [HarmonyPostfix] private static async void Cache_ScriptableAssetsPatch() { await HB.Cache_HBScriptableAssets().ConfigureAwait(continueOnCapturedContext: true); } } [HarmonyPatch(typeof(VanityMirrorManager), "Update")] public static class VanityMirrorManagerPatch { private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ret, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null) }).Advance(2).SetInstruction(new CodeInstruction(OpCodes.Ldc_I4_3, (object)null)) .InstructionEnumeration(); } } [HarmonyPatch(typeof(ItemObjectVisual), "Apply_ItemObjectVisual")] public static class ItemObjectLastLong { [HarmonyPostfix] private static void Init_itemObjectPatch(ItemObjectVisual __instance) { if (Object.op_Implicit((Object)(object)__instance._itemObject._foundItem)) { int instanceID = ((Object)__instance._itemObject._foundItem).GetInstanceID(); if (instanceID < 0 && ItemFolder._dropItemTimers.TryGetValue(instanceID, out var value)) { __instance._itemObject._currentDestroyObjectTimer = value; } } } } [HarmonyPatch(typeof(PlayerMove), "JumpPress")] public static class UnstuckFromGround { [HarmonyPostfix] private static void JumpPressPatch(PlayerMove __instance) { if ((Object)(object)__instance._player != (Object)(object)Player._mainPlayer) { 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")]