Decompiled source of CheatMenu v1.3.9
plugins\CheatMenu\cheat_menu.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Rewired; using Spine; using Spine.Unity; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("cheat_menu")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Cheat/Utility menu for cult of the lamb")] [assembly: AssemblyFileVersion("1.3.9.0")] [assembly: AssemblyInformationalVersion("1.3.9+4a48d882947833fe51db7ba55a3c545d8464a3a9")] [assembly: AssemblyProduct("cheat_menu")] [assembly: AssemblyTitle("cheat_menu")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.9.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CheatMenu { [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class CheatCategory : Attribute { public CheatCategoryEnum Category { get; } public CheatCategory(CheatCategoryEnum category) { Category = category; } } [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class CheatDetails : Attribute { public string Title { get; } public string Description { get; } public string OnTitle { get; } public string OffTitle { get; } public bool IsFlagCheat { get; } public bool IsMultiNameFlagCheat { get; } public int SortOrder { get; } public string SubGroup { get; } public CheatDetails(string title, string description, bool isFlagCheat = false, int sortOrder = 0, string subGroup = null) { Title = title; Description = description; IsFlagCheat = isFlagCheat; SortOrder = sortOrder; SubGroup = subGroup; } public CheatDetails(string title, string offTitle, string onTitle, string description, bool isFlagCheat = true, int sortOrder = 0, string subGroup = null) { if (!isFlagCheat) { throw new Exception("Multi name flag cheat can not have isFlagCheat set to false!"); } Title = title; OffTitle = offTitle; OnTitle = onTitle; Description = description; IsFlagCheat = true; IsMultiNameFlagCheat = true; SortOrder = sortOrder; SubGroup = subGroup; } } [AttributeUsage(AttributeTargets.Method)] public class CheatFlag : Attribute { } [AttributeUsage(AttributeTargets.Method)] public class CheatWIP : Attribute { } [AttributeUsage(AttributeTargets.Method)] public class Init : Attribute { } [AttributeUsage(AttributeTargets.Method)] public class Unload : Attribute { } [AttributeUsage(AttributeTargets.Method)] public class OnGui : Attribute { } [AttributeUsage(AttributeTargets.Method)] public class Update : Attribute { } [AttributeUsage(AttributeTargets.Method)] public class EnforceOrderFirst : Attribute { public int Order { get; } public EnforceOrderFirst(int order = 0) { Order = order; } } [AttributeUsage(AttributeTargets.Method)] public class EnforceOrderLast : Attribute { } [AttributeUsage(AttributeTargets.Method)] public class RequiresDLC : Attribute { public DlcRequirement Requirement { get; } public RequiresDLC(DlcRequirement requirement) { Requirement = requirement; } } [AttributeUsage(AttributeTargets.Field)] public class StringEnum : Attribute { public string Value { get; } public StringEnum(string value) { Value = value; } } public class CheatConfig { public ConfigEntry<KeyboardShortcut> GuiKeybind; public ConfigEntry<KeyboardShortcut> BackCategory; public ConfigEntry<bool> CloseGuiOnEscape; public ConfigEntry<bool> ControllerSupport; public static CheatConfig Instance { get; private set; } public CheatConfig(ConfigFile config) { //IL_0014: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003a: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0071: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_009d: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00c9: Expected O, but got Unknown GuiKeybind = config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "GUIKey"), new KeyboardShortcut((KeyCode)109, Array.Empty<KeyCode>()), new ConfigDescription("The key pressed to open and close the CheatMenu GUI", (AcceptableValueBase)null, Array.Empty<object>())); BackCategory = config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Back Category"), new KeyboardShortcut((KeyCode)110, Array.Empty<KeyCode>()), new ConfigDescription("The key pressed to go back to the previous category/menu", (AcceptableValueBase)null, Array.Empty<object>())); CloseGuiOnEscape = config.Bind<bool>(new ConfigDefinition("Options", "Close GUI on escape"), true, new ConfigDescription("Disable/Enable closing the cheat menu GUI when escape is pressed", (AcceptableValueBase)null, Array.Empty<object>())); ControllerSupport = config.Bind<bool>(new ConfigDefinition("Controller", "Enable Controller Support"), true, new ConfigDescription("Enable controller/gamepad support for menu navigation. Uses the game's detected controller via Rewired. R3=Open/Close, A=Select, B=Back, Stick/D-Pad=Navigate.", (AcceptableValueBase)null, Array.Empty<object>())); Instance = this; } } public static class CheatUtils { public static bool IsDebugMode => true; public static List<T> CloneList<T>(List<T> list) { return new List<T>(list); } public static T[] Concat<T>(T[] first, T[] second) { T[] array = new T[first.Length + second.Length]; first.CopyTo(array, 0); second.CopyTo(array, first.Length); return array; } } internal static class CultUtils { private class HaloAnimator : MonoBehaviour { private void Update() { AnimateRGBHalos(); } } [CompilerGenerated] private sealed class <AscendAnimalCoroutine>d__35 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Interaction_Ranchable ranchable; public Ranchable_Animal animal; private string <animalName>5__1; private string <ascendAnim>5__2; private object <spine>5__3; private Vector3 <spawnPos>5__4; private object <animState>5__5; private object <spineObj>5__6; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AscendAnimalCoroutine>d__35(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <animalName>5__1 = null; <ascendAnim>5__2 = null; <spine>5__3 = null; <animState>5__5 = null; <spineObj>5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Expected O, but got Unknown //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Expected O, but got Unknown //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Expected O, but got Unknown //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; ranchable.BeingAscended = true; ranchable.ReservedByPlayer = true; animal.State = (State)1; <animalName>5__1 = GetAnimationAnimalName(animal.Type); <ascendAnim>5__2 = "ascend-" + <animalName>5__1; <spine>5__3 = Traverse.Create((object)ranchable).Field("spine").GetValue(); if (<spine>5__3 != null) { <animState>5__5 = Traverse.Create(<spine>5__3).Property("AnimationState", (object[])null).GetValue(); if (<animState>5__5 != null) { try { Traverse.Create(<animState>5__5).Method("SetAnimation", new Type[3] { typeof(int), typeof(string), typeof(bool) }, (object[])null).GetValue(new object[3] { 0, <ascendAnim>5__2, false }); } catch { Traverse.Create(<animState>5__5).Method("SetAnimation", new Type[3] { typeof(int), typeof(string), typeof(bool) }, (object[])null).GetValue(new object[3] { 0, "idle", false }); } } <animState>5__5 = null; } try { AudioManager.Instance.PlayOneShot("event:/dlc/animal/shared/ascend", ((Component)ranchable).transform.position); } catch { } try { BiomeConstants.Instance.ChromaticAbberationTween(1f, BiomeConstants.Instance.ChromaticAberrationDefaultValue, 1f); } catch { } <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; <spawnPos>5__4 = ((Component)ranchable).transform.position + new Vector3(0f, 0f, -2f); CollectAnimalResources(animal, <spawnPos>5__4, spawnVisual: true); <>2__current = (object)new WaitForSeconds(2.8333f); <>1__state = 2; return true; case 2: <>1__state = -1; try { BiomeConstants.Instance.ChromaticAbberationTween(0.5f, 1f, BiomeConstants.Instance.ChromaticAberrationDefaultValue); } catch { } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 3; return true; case 3: <>1__state = -1; try { <spineObj>5__6 = Traverse.Create((object)ranchable).Field("spine").GetValue(); if (<spineObj>5__6 != null) { GameObject value = Traverse.Create(<spineObj>5__6).Property("gameObject", (object[])null).GetValue<GameObject>(); if (value != null) { value.SetActive(false); } } <spineObj>5__6 = null; } catch { } try { AudioManager.Instance.PlayOneShot("event:/dlc/animal/shared/cleanup_dead", ((Component)ranchable).transform.position); } catch { } <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 4; return true; case 4: <>1__state = -1; RemoveAnimalData(ranchable, animal); if ((Object)(object)ranchable != (Object)null && (Object)(object)((Component)ranchable).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)ranchable).gameObject); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <PetWolfCoroutine>d__117 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private PlayerFarming <player>5__1; private Interaction_WolfBase <wolf>5__2; private float <wolfToPlayerAngle>5__3; private float <petDist>5__4; private Vector3 <petTarget>5__5; private float <moveSpeed>5__6; private float <timeout>5__7; private float <elapsed>5__8; private float <arrivalThreshold>5__9; private float <angle>5__10; private StateMachine <stateMachine>5__11; private Vector3 <currentPos>5__12; private float <remaining>5__13; private float <moveAngle>5__14; private Vector3 <dir>5__15; private float <wolfAngle>5__16; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <PetWolfCoroutine>d__117(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <player>5__1 = null; <wolf>5__2 = null; <stateMachine>5__11 = null; <>1__state = -2; } private bool MoveNext() { //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Expected O, but got Unknown //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Expected O, but got Unknown //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; s_wolfPetting = true; <player>5__1 = PlayerFarming.Instance; <wolf>5__2 = FriendlyWolf; if ((Object)(object)<player>5__1 == (Object)null || (Object)(object)<wolf>5__2 == (Object)null) { s_wolfPetting = false; return false; } <wolfToPlayerAngle>5__3 = Utils.GetAngle(((Component)<wolf>5__2).transform.position, ((Component)<player>5__1).transform.position); <petDist>5__4 = 1.2f; <petTarget>5__5 = ((Component)<wolf>5__2).transform.position + new Vector3(Mathf.Cos(<wolfToPlayerAngle>5__3 * ((float)Math.PI / 180f)) * <petDist>5__4, Mathf.Sin(<wolfToPlayerAngle>5__3 * ((float)Math.PI / 180f)) * <petDist>5__4, 0f); <moveSpeed>5__6 = 6f; <timeout>5__7 = 3f; <elapsed>5__8 = 0f; <arrivalThreshold>5__9 = 0.3f; goto IL_0285; case 1: <>1__state = -1; goto IL_0285; case 2: <>1__state = -1; try { BiomeConstants.Instance.EmitHeartPickUpVFX(((Component)<wolf>5__2).transform.position, 0f, "red", "burst_big", false); AudioManager.Instance.PlayOneShot("event:/followers/love_hearts", ((Component)<wolf>5__2).transform.position); } catch { } CameraManager.instance.ShakeCameraForDuration(0.3f, 0.4f, 0.3f, true); <>2__current = (object)new WaitForSeconds(0.8f); <>1__state = 3; return true; case 3: { <>1__state = -1; <player>5__1.state.CURRENT_STATE = (State)0; s_wolfPetting = false; PlayNotification("Good wolf!"); return false; } IL_0285: if (<elapsed>5__8 < <timeout>5__7) { if ((Object)(object)<player>5__1 == (Object)null || (Object)(object)<wolf>5__2 == (Object)null || !Object.op_Implicit((Object)(object)<wolf>5__2)) { s_wolfPetting = false; return false; } <currentPos>5__12 = ((Component)<player>5__1).transform.position; <remaining>5__13 = Vector3.Distance(<currentPos>5__12, <petTarget>5__5); if (!(<remaining>5__13 <= <arrivalThreshold>5__9)) { <moveAngle>5__14 = Utils.GetAngle(<currentPos>5__12, <petTarget>5__5); <player>5__1.state.facingAngle = <moveAngle>5__14; <player>5__1.state.CURRENT_STATE = (State)1; Vector3 val = <petTarget>5__5 - <currentPos>5__12; <dir>5__15 = ((Vector3)(ref val)).normalized; ((Component)<player>5__1).transform.position = <currentPos>5__12 + <dir>5__15 * Mathf.Min(<moveSpeed>5__6 * Time.deltaTime, <remaining>5__13); <elapsed>5__8 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } } if ((Object)(object)<player>5__1 == (Object)null || (Object)(object)<wolf>5__2 == (Object)null || !Object.op_Implicit((Object)(object)<wolf>5__2)) { s_wolfPetting = false; return false; } <angle>5__10 = Utils.GetAngle(((Component)<player>5__1).transform.position, ((Component)<wolf>5__2).transform.position); <player>5__1.state.facingAngle = <angle>5__10; <player>5__1.state.CURRENT_STATE = (State)49; <player>5__1.simpleSpineAnimator.Animate("pet-dog", 0, false); <stateMachine>5__11 = Traverse.Create((object)<wolf>5__2).Field("stateMachine").GetValue<StateMachine>(); if ((Object)(object)<stateMachine>5__11 != (Object)null) { <wolfAngle>5__16 = Utils.GetAngle(((Component)<wolf>5__2).transform.position, ((Component)<player>5__1).transform.position); <stateMachine>5__11.facingAngle = <wolfAngle>5__16; <stateMachine>5__11.LookAngle = <wolfAngle>5__16; } SetWolfAnimation(<wolf>5__2.Spine, "idle", force: true); try { AudioManager.Instance.PlayOneShot("event:/dlc/animal/shared/calm", ((Component)<wolf>5__2).transform.position); } catch { } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <ResetSpawnFlagAfterDelay>d__69 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float delay; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ResetSpawnFlagAfterDelay>d__69(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; IsSpawningFollowerFromCheat = false; Debug.Log((object)"[CheatMenu] Reset IsSpawningFollowerFromCheat flag"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static bool IsSpawningFollowerFromCheat = false; private static readonly DoctrineType[] WinterDLCDoctrines; private static float s_hueOffset; private static List<GameObject> s_activeHalos; private static Sprite s_haloSprite; private static Sprite s_glowSprite; public static Interaction_WolfBase FriendlyWolf; public static bool WolfDungeonCombat; private static string s_wolfCurrentAnim; private static bool s_wolfIsRunning; private static Vector3 s_wolfVelocity; private static float s_wolfAttackCooldown; private static bool s_wolfPetting; private static int s_wolfSkinIndex; private static readonly string[] WOLF_SKINS_FALLBACK; private static bool s_wolfShouldExist; private static bool s_wolfRespawning; private static float s_wolfRespawnDelay; private static float s_wolfAnimHoldTimer; private const float WOLF_ANIM_HOLD_MIN = 0.15f; private static string s_wolfAttackAnimName; private static float s_wolfCombatTransitionTimer; private const float WOLF_COMBAT_TRANSITION_MIN = 0.7f; private const float WOLF_ROOM_TRANSITION_DELAY = 1.5f; private const float WOLF_FOLLOW_SPEED = 4.5f; private const float WOLF_TELEPORT_DIST = 8f; private const float WOLF_START_FOLLOW_DIST = 3.5f; private const float WOLF_STOP_FOLLOW_DIST = 1.8f; private const float WOLF_SMOOTH_TIME = 0.35f; private const float WOLF_ATTACK_RANGE = 1.5f; private const float WOLF_DETECT_RANGE = 6f; private const float WOLF_ATTACK_COOLDOWN = 1.8f; private const float WOLF_ATTACK_DAMAGE = 2f; private static Health s_wolfTargetEnemy; private static List<Follower> s_companions; public static bool HasMajorDLC() { return IsInGame() && DataManager.Instance.MAJOR_DLC; } public static bool HasSinfulDLC() { return IsInGame() && DataManager.Instance.DLC_Sinful_Pack; } public static bool HasCultistDLC() { return IsInGame() && DataManager.Instance.DLC_Cultist_Pack; } public static bool HasHereticDLC() { return IsInGame() && DataManager.Instance.DLC_Heretic_Pack; } public static bool HasPilgrimDLC() { return IsInGame() && DataManager.Instance.DLC_Pilgrim_Pack; } public static bool IsInGame() { return SaveAndLoad.Loaded; } public static void PlayNotification(string message) { if (Object.op_Implicit((Object)(object)NotificationCentre.Instance)) { NotificationCentre.Instance.PlayGenericNotification(message, (Flair)0); } } public static void AddInventoryItem(ITEM_TYPE type, int amount) { //IL_0040: 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_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected I4, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) try { Inventory.AddItem((int)type, amount, false); } catch (Exception ex) { Debug.LogWarning((object)$"[CheatMenu] AddInventoryItem fallback for {type}: {ex.Message}"); try { Inventory.AddItem(type, amount, false); } catch (Exception ex2) { Debug.LogWarning((object)$"[CheatMenu] AddInventoryItem failed for {type}: {ex2.Message}"); } } } public static bool RequireInGame(string actionName = "This action") { if (!IsInGame()) { Debug.LogWarning((object)("[CheatMenu] " + actionName + " requires being in-game")); PlayNotification(actionName + " requires being in-game!"); return false; } return true; } public static void SafeExecute(Action action, string actionName, string successMessage = null, string errorPrefix = null) { try { action(); if (successMessage != null) { PlayNotification(successMessage); } } catch (Exception ex) { string text = "[CheatMenu] " + (errorPrefix ?? actionName) + " error: " + ex.Message; Debug.LogWarning((object)text); PlayNotification("Failed to " + actionName.ToLower() + "!"); } } public static void GiveDoctrineStone() { DataManager.Instance.FirstDoctrineStone = true; DataManager.Instance.ForceDoctrineStones = true; DataManager instance = DataManager.Instance; instance.CompletedDoctrineStones++; PlayerDoctrineStone.OnIncreaseCount?.Invoke(); PlayNotification("Commandment stone given!"); } public static void CompleteObjective(ObjectivesData objective) { objective.Complete(); Action action = delegate { FieldInfo field = typeof(ObjectiveManager).GetField("OnObjectiveCompleted", BindingFlags.Static | BindingFlags.NonPublic); if (field != null && field.GetValue(null) != null) { object value = field.GetValue(null); if (value != null) { ObjectiveUpdated val = (ObjectiveUpdated)((value is ObjectiveUpdated) ? value : null); if (val != null) { val.Invoke(objective); } } } }; typeof(ObjectiveManager).GetMethod("InvokeOrQueue", BindingFlags.Static | BindingFlags.NonPublic)?.Invoke(null, new object[1] { action }); DataManager.Instance.Objectives.Remove(objective); DataManager.Instance.CompletedObjectives.Add(objective); } public static void ClearAllDoctrines() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_005c: Unknown result type (might be due to invalid IL or missing references) ClearUnlockedRituals(); DataManager.Instance.CultTraits.Clear(); DoctrineUpgradeSystem.UnlockedUpgrades.Clear(); foreach (SermonCategory allSermonCategory in GetAllSermonCategories()) { DoctrineUpgradeSystem.SetLevelBySermon(allSermonCategory, 0); } UpgradeSystem.UnlockAbility(UpgradeSystem.PrimaryRitual1, false); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)50); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)49); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)47); PlayNotification("Cleared all doctrines!"); } private static bool IsWinterDLCDoctrine(DoctrineType type) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) DoctrineType[] winterDLCDoctrines = WinterDLCDoctrines; foreach (DoctrineType val in winterDLCDoctrines) { if (type == val) { return true; } } return false; } public static void UnlockAllDoctrines() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) try { bool flag = HasMajorDLC(); Dictionary<SermonCategory, List<Tuple<DoctrineType, DoctrineType>>> allDoctrinePairs = GetAllDoctrinePairs(); int num = 0; foreach (KeyValuePair<SermonCategory, List<Tuple<DoctrineType, DoctrineType>>> item in allDoctrinePairs) { foreach (Tuple<DoctrineType, DoctrineType> item2 in item.Value) { bool flag2 = !flag && IsWinterDLCDoctrine(item2.Item1); bool flag3 = !flag && IsWinterDLCDoctrine(item2.Item2); if (!flag2 && (int)item2.Item1 != 0 && !DoctrineUpgradeSystem.GetUnlocked(item2.Item1)) { DoctrineUpgradeSystem.UnlockAbility(item2.Item1); num++; } if (!flag3 && (int)item2.Item2 != 0 && !DoctrineUpgradeSystem.GetUnlocked(item2.Item2)) { DoctrineUpgradeSystem.UnlockAbility(item2.Item2); num++; } } } DoctrineUpgradeSystem.UnlockAbility((DoctrineType)50); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)49); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)47); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)46); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)48); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)52); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)76); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)77); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)79); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)69); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)68); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)61); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)62); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)63); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)67); DoctrineUpgradeSystem.UnlockAbility((DoctrineType)66); PlayNotification($"All doctrines unlocked! ({num + 16} abilities)"); } catch { PlayNotification("Failed to unlock all doctrines!"); } } public static void RemoveDoctrineUpgrades() { //IL_0017: 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_001f: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Invalid comparison between Unknown and I4 //IL_007a: Unknown result type (might be due to invalid IL or missing references) List<DoctrineType> list = new List<DoctrineType>(); foreach (DoctrineType unlockedUpgrade in DoctrineUpgradeSystem.UnlockedUpgrades) { list.Add(unlockedUpgrade); } foreach (DoctrineType unlockedUpgrade2 in DoctrineUpgradeSystem.UnlockedUpgrades) { SermonCategory category = DoctrineUpgradeSystem.GetCategory(unlockedUpgrade2); if ((int)category != 6 && (int)category != 7) { list.Remove(unlockedUpgrade2); } } DoctrineUpgradeSystem.UnlockedUpgrades = list; } public static List<SermonCategory> GetAllSermonCategories() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) List<SermonCategory> list = new List<SermonCategory>(); foreach (object value in Enum.GetValues(typeof(SermonCategory))) { SermonCategory val = (SermonCategory)value; string sermonCategoryLocalizedName = DoctrineUpgradeSystem.GetSermonCategoryLocalizedName(val); if (!sermonCategoryLocalizedName.StartsWith("DoctrineUpgradeSystem")) { list.Add(val); } } return list; } public static int[] GetDoctrineCategoryState(SermonCategory category, List<DoctrineType> upgrades = null) { //IL_0027: 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_0055: Unknown result type (might be due to invalid IL or missing references) List<DoctrineType> list = upgrades; if (list == null) { list = DoctrineUpgradeSystem.UnlockedUpgrades; } Dictionary<SermonCategory, List<Tuple<DoctrineType, DoctrineType>>> allDoctrinePairs = GetAllDoctrinePairs(); int[] array = new int[4]; for (int i = 0; i < array.Length; i++) { Tuple<DoctrineType, DoctrineType> tuple = allDoctrinePairs[category][i]; if (list.Contains(tuple.Item1)) { array[i] = 1; } else if (list.Contains(tuple.Item2)) { array[i] = 2; } else { array[i] = 0; } } return array; } public static void ReapplyAllDoctrinesWithChanges(SermonCategory overridenCategory, int[] stateMap) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) DataManager.Instance.CultTraits.Clear(); List<DoctrineType> list = new List<DoctrineType>(); foreach (DoctrineType unlockedUpgrade in DoctrineUpgradeSystem.UnlockedUpgrades) { list.Add(unlockedUpgrade); } RemoveDoctrineUpgrades(); List<SermonCategory> allSermonCategories = GetAllSermonCategories(); Dictionary<SermonCategory, List<Tuple<DoctrineType, DoctrineType>>> allDoctrinePairs = GetAllDoctrinePairs(); foreach (SermonCategory item in allSermonCategories) { int[] array = ((item == overridenCategory) ? stateMap : GetDoctrineCategoryState(item, list)); for (int i = 0; i < array.Length; i++) { int num = array[i]; switch (num) { case 1: DoctrineUpgradeSystem.UnlockAbility(allDoctrinePairs[item][i].Item1); break; case 2: DoctrineUpgradeSystem.UnlockAbility(allDoctrinePairs[item][i].Item2); break; } if (num != 0) { DoctrineUpgradeSystem.SetLevelBySermon(item, i + 1); } } } } public static void ClearAllCultTraits() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) foreach (TraitType cultTrait in DataManager.Instance.CultTraits) { Debug.Log((object)(FollowerTrait.GetLocalizedTitle(cultTrait) ?? "")); } DataManager.Instance.CultTraits.Clear(); } public static Dictionary<Type, Type> GetDictionaryRitualPairs() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Dictionary<Type, Type> dictionary = new Dictionary<Type, Type>(); for (int i = 0; i < UpgradeSystem.SecondaryRitualPairs.Length - 1; i += 2) { Type val = UpgradeSystem.SecondaryRitualPairs[i]; Type key = (dictionary[val] = UpgradeSystem.SecondaryRitualPairs[i + 1]); dictionary[key] = val; } return dictionary; } public static void ClearUnlockedRituals() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) Type[] secondaryRitualPairs = UpgradeSystem.SecondaryRitualPairs; foreach (Type item in secondaryRitualPairs) { UpgradeSystem.UnlockedUpgrades.Remove(item); } Type[] secondaryRituals = UpgradeSystem.SecondaryRituals; foreach (Type item2 in secondaryRituals) { UpgradeSystem.UnlockedUpgrades.Remove(item2); } UpgradeSystem.UnlockedUpgrades.Remove(UpgradeSystem.PrimaryRitual1); } public static Dictionary<SermonCategory, List<Tuple<DoctrineType, DoctrineType>>> GetAllDoctrinePairs() { //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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) Dictionary<SermonCategory, List<Tuple<DoctrineType, DoctrineType>>> dictionary = new Dictionary<SermonCategory, List<Tuple<DoctrineType, DoctrineType>>>(); Array values = Enum.GetValues(typeof(SermonCategory)); foreach (object item in values) { SermonCategory val = (SermonCategory)item; List<Tuple<DoctrineType, DoctrineType>> list = new List<Tuple<DoctrineType, DoctrineType>>(); if ((int)DoctrineUpgradeSystem.GetSermonReward(val, 1, true) > 0) { for (int i = 1; i <= 4; i++) { list.Add(Tuple.Create<DoctrineType, DoctrineType>(DoctrineUpgradeSystem.GetSermonReward((SermonCategory)item, i, true), DoctrineUpgradeSystem.GetSermonReward((SermonCategory)item, i, false))); } } dictionary[val] = list; } return dictionary; } public static List<Tuple<Type, Type>> GetRitualPairs() { List<Tuple<Type, Type>> list = new List<Tuple<Type, Type>>(); for (int i = 0; i < UpgradeSystem.SecondaryRitualPairs.Length; i += 2) { list.Add(new Tuple<Type, Type>(UpgradeSystem.SecondaryRitualPairs[i], UpgradeSystem.SecondaryRitualPairs[i + 1])); } return list; } public static void RenameCult(Action<string> onNameConfirmed = null) { try { Traverse.Create(typeof(CheatConsole)).Method("RenameCult", Array.Empty<object>()).GetValue(); } catch (Exception ex) { Debug.LogWarning((object)("Failed to rename cult: " + ex.Message)); PlayNotification("Failed to open rename dialog!"); } } public static float CalculateCurrentFaith() { float num = 0f; List<ThoughtData> value = Traverse.Create(typeof(CultFaithManager)).Field("Thoughts").GetValue<List<ThoughtData>>(); if (value == null) { return num; } foreach (ThoughtData item in value) { int i = 0; float num2 = -1f; for (; i <= item.Quantity; i++) { num2 = ((i != 0) ? (num2 + (float)item.StackModifier) : (num2 + item.Modifier)); } num += num2; } return num; } public static float GetCurrentFaith() { return CultFaithManager.CurrentFaith; } public static void ModifyFaith(float value, string notifMessage, bool shouldNotify = true) { //IL_0002: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Flair val = (Flair)1; float currentFaith = GetCurrentFaith(); if (currentFaith > value) { val = (Flair)2; } float num = CalculateCurrentFaith(); float staticFaith = ((currentFaith < value) ? (value - num) : (num - value)); NotificationData val2 = ((!shouldNotify) ? ((NotificationData)null) : new NotificationData(notifMessage, 0f, -1, val, new string[0])); CultFaithManager.StaticFaith = staticFaith; CultFaithManager.Instance.BarController.SetBarSize(value / 85f, true, true, val2); } public static bool IsDlcContentName(string name) { if (string.IsNullOrEmpty(name)) { return false; } string text = name.ToUpperInvariant(); return text.Contains("DLC") || text.Contains("RANCH") || text.Contains("FURNACE") || text.Contains("FORGE") || text.Contains("FLOCKADE") || text.Contains("HEATER") || text.Contains("WOOL") || text.Contains("BREWERY") || text.Contains("BREW_") || text.Contains("BARN") || text.Contains("SPINNING") || text.Contains("LOOM") || text.Contains("TAVERN") || text.Contains("DISTILLERY") || text.Contains("WINTER") || text.Contains("SNOW") || text.Contains("CHAIN") || text.Contains("FLAIL") || text.Contains("ROTBURN") || text.Contains("CALCIFIED") || text.Contains("COD") || text.Contains("PIKE") || text.Contains("CATFISH"); } public static bool ShouldNeverGiveItem(string name) { if (string.IsNullOrEmpty(name)) { return false; } string text = name.ToUpperInvariant(); return text.Contains("BROKEN_WEAPON") || text.Contains("REPAIRED_WEAPON") || text.Contains("ILLEGIBLE_LETTER") || text.Contains("FISHING_ROD") || text.Contains("BEHOLDER_EYE_ROT") || text.Contains("FOUND_ITEM_OUTFIT"); } public static void ForceGrowAllAnimals() { try { int num = 0; List<Ranchable_Animal> animals = AnimalData.GetAnimals(); foreach (Ranchable_Animal item in animals) { if (item.Age < 2) { item.Age = 2; } item.GrowthStage = 0; item.WorkedReady = true; item.WorkedToday = false; item.Satiation = 100f; Interaction_Ranchable animal = Interaction_Ranch.GetAnimal(item); if ((Object)(object)animal != (Object)null) { animal.UpdateSkin(); } num++; } PlayNotification((num > 0) ? $"Force grew {num} animal(s)!" : "No animals to grow!"); } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] ForceGrowAllAnimals error: " + ex.Message)); PlayNotification("Failed to force grow animals!"); } } public static void AscendAllAnimals() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) try { int num = 0; List<Ranchable_Animal> list = new List<Ranchable_Animal>(AnimalData.GetAnimals()); foreach (Ranchable_Animal item in list) { if (item == null) { continue; } Interaction_Ranchable animal = Interaction_Ranch.GetAnimal(item); if ((Object)(object)animal != (Object)null && (Object)(object)((Component)animal).gameObject != (Object)null && ((Component)animal).gameObject.activeInHierarchy) { try { ((MonoBehaviour)animal).StartCoroutine(AscendAnimalCoroutine(animal, item)); } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] Failed to start ascend coroutine: " + ex.Message)); RemoveAnimalImmediate(animal, item); } } else { CollectAnimalResources(item, Vector3.zero, spawnVisual: false); RemoveAnimalData(animal, item); } num++; } PlayNotification((num > 0) ? $"Ascended {num} animal(s)!" : "No animals to ascend!"); } catch (Exception ex2) { Debug.LogWarning((object)("[CheatMenu] AscendAllAnimals error: " + ex2.Message)); PlayNotification("Failed to ascend animals!"); } } [IteratorStateMachine(typeof(<AscendAnimalCoroutine>d__35))] private static IEnumerator AscendAnimalCoroutine(Interaction_Ranchable ranchable, Ranchable_Animal animal) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AscendAnimalCoroutine>d__35(0) { ranchable = ranchable, animal = animal }; } private static void CollectAnimalResources(Ranchable_Animal animal, Vector3 spawnPos, bool spawnVisual) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Invalid comparison between Unknown and I4 //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) List<InventoryItem> meatLoot = Interaction_Ranchable.GetMeatLoot(animal); foreach (InventoryItem item in meatLoot) { item.quantity = Mathf.RoundToInt((float)item.quantity); } if (spawnVisual && spawnPos != Vector3.zero) { int num = Mathf.Min((meatLoot.Count > 0) ? meatLoot[0].quantity : 0, 10); if (num > 0) { InventoryItem.Spawn((ITEM_TYPE)6, num, spawnPos, 4f, (Action<PickUp>)null); } foreach (InventoryItem item2 in meatLoot) { Inventory.AddItem(item2.type, Mathf.Max(0, item2.quantity - num), false); } } else { foreach (InventoryItem item3 in meatLoot) { AddInventoryItem((ITEM_TYPE)item3.type, item3.quantity); } } List<InventoryItem> workLoot = Interaction_Ranchable.GetWorkLoot(animal); foreach (InventoryItem item4 in workLoot) { int num2 = item4.quantity * 3; if (spawnVisual && spawnPos != Vector3.zero) { InventoryItem.Spawn((ITEM_TYPE)item4.type, num2, spawnPos, 4f, (Action<PickUp>)null); } else { AddInventoryItem((ITEM_TYPE)item4.type, num2); } } if ((int)animal.Type == 188) { if (spawnVisual && spawnPos != Vector3.zero) { InventoryItem.Spawn((ITEM_TYPE)197, 5, spawnPos, 4f, (Action<PickUp>)null); } else { AddInventoryItem((ITEM_TYPE)197, 5); } } } private static void RemoveAnimalImmediate(Interaction_Ranchable ranchable, Ranchable_Animal animal) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CollectAnimalResources(animal, Vector3.zero, spawnVisual: false); RemoveAnimalData(ranchable, animal); if ((Object)(object)ranchable != (Object)null && (Object)(object)((Component)ranchable).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)ranchable).gameObject); } } private static void RemoveAnimalData(Interaction_Ranchable ranchable, Ranchable_Animal animal) { if ((Object)(object)ranchable != (Object)null && (Object)(object)ranchable.ranch != (Object)null) { ranchable.ranch.Brain.RemoveAnimal(animal); } DataManager.Instance.BreakingOutAnimals.Remove(animal); DataManager.Instance.DeadAnimalsTemporaryList.Add(animal); } private static string GetAnimationAnimalName(ITEM_TYPE type) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Invalid comparison between Unknown and I4 //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected I4, but got Unknown if ((int)type <= 179) { if ((int)type == 170) { return "goat"; } switch (type - 176) { case 0: return "turtle"; case 1: return "crab"; case 2: return "spider"; case 3: return "snail"; } } else { if ((int)type == 188) { return "cow"; } if ((int)type == 189) { return "llama"; } } return "goat"; } private static float GetAnimalHaloHeight(ITEM_TYPE type) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Invalid comparison between Unknown and I4 //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected I4, but got Unknown if ((int)type <= 179) { if ((int)type == 170) { return 1.2f; } switch (type - 176) { case 0: return 0.8f; case 1: return 0.5f; case 2: return 0.7f; case 3: return 0.4f; } } else { if ((int)type == 188) { return 1.5f; } if ((int)type == 189) { return 1.4f; } } return 1.2f; } public static void AddHalosToAnimals() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Expected O, but got Unknown //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Expected O, but got Unknown //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) try { RemoveAnimalHalos(); GameObject val = new GameObject("HaloAnimationHelper"); Object.DontDestroyOnLoad((Object)(object)val); HaloAnimator haloAnimator = val.AddComponent<HaloAnimator>(); s_hueOffset = 0f; int num = 0; List<Ranchable_Animal> animals = AnimalData.GetAnimals(); foreach (Ranchable_Animal item in animals) { if (item == null) { continue; } Interaction_Ranchable animal = Interaction_Ranch.GetAnimal(item); if ((Object)(object)animal == (Object)null || (Object)(object)((Component)animal).gameObject == (Object)null || !((Component)animal).gameObject.activeInHierarchy) { continue; } try { float animalHaloHeight = GetAnimalHaloHeight(item.Type); GameObject val2 = new GameObject("CheatMenu_AnimalHalo"); val2.transform.SetParent(((Component)animal).transform); val2.transform.localPosition = new Vector3(0f, animalHaloHeight, -1f); SpriteRenderer val3 = val2.AddComponent<SpriteRenderer>(); val3.sprite = CreateHaloSprite(); val3.color = new Color(1f, 1f, 1f, 0.9f); ((Renderer)val3).sortingLayerName = "Above"; ((Renderer)val3).sortingOrder = 1000; ((Renderer)val3).material = new Material(Shader.Find("Sprites/Default")); ((Renderer)val3).material.SetFloat("_PixelSnap", 0f); val2.transform.localScale = new Vector3(0.45f, 0.45f, 1f); GameObject val4 = new GameObject("HaloGlow"); val4.transform.SetParent(val2.transform); val4.transform.localPosition = Vector3.zero; val4.transform.localScale = new Vector3(1.4f, 1.4f, 1f); SpriteRenderer val5 = val4.AddComponent<SpriteRenderer>(); val5.sprite = CreateGlowSprite(); val5.color = new Color(1f, 1f, 1f, 0.5f); ((Renderer)val5).sortingLayerName = "Above"; ((Renderer)val5).sortingOrder = 999; Shader val6 = Shader.Find("Particles/Additive"); if ((Object)(object)val6 == (Object)null) { val6 = Shader.Find("Legacy Shaders/Particles/Additive"); } if ((Object)(object)val6 == (Object)null) { val6 = Shader.Find("Sprites/Default"); } ((Renderer)val5).material = new Material(val6); GameObject val7 = new GameObject("HaloLight"); val7.transform.SetParent(val2.transform); val7.transform.localPosition = Vector3.zero; Light val8 = val7.AddComponent<Light>(); val8.type = (LightType)2; val8.color = Color.white; val8.intensity = 3f; val8.range = 2.5f; val8.renderMode = (LightRenderMode)0; s_activeHalos.Add(val2); num++; } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] Failed to add halo to animal: " + ex.Message)); } } PlayNotification((num > 0) ? $"RGB glowing halos added to {num} animal(s)!" : "No animals to add halos to!"); } catch (Exception ex2) { Debug.LogWarning((object)("[CheatMenu] AddHalosToAnimals error: " + ex2.Message)); PlayNotification("Failed to add halos!"); } } private static Sprite CreateHaloSprite() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)s_haloSprite != (Object)null) { return s_haloSprite; } int num = 128; Texture2D val = new Texture2D(num, num, (TextureFormat)4, false); float num2 = (float)num / 2f; float num3 = 0.85f; float num4 = 0.4f; float num5 = 0.55f; float num6 = 0.2f; float num7 = 0.12f; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num8 = ((float)j - num2) / num2; float num9 = ((float)i - num2) / num2; float num10 = num8 * num8 / (num3 * num3) + num9 * num9 / (num4 * num4); float num11 = num8 * num8 / (num5 * num5) + num9 * num9 / (num6 * num6); float num12 = Mathf.Clamp01((1f - num10) / num7); float num13 = Mathf.Clamp01((num11 - 1f) / num7); float num14 = num12 * num13; float num15 = num8 * num8 / ((num3 + 0.2f) * (num3 + 0.2f)) + num9 * num9 / ((num4 + 0.15f) * (num4 + 0.15f)); float num16 = Mathf.Clamp01(1f - num15) * 0.25f; float num17 = Mathf.Max(num14, num16); if (num17 > 0.01f) { float num18 = Mathf.Lerp(1f, 1f, num14); float num19 = Mathf.Lerp(0.4f, 0.2f, num14); float num20 = Mathf.Lerp(0.8f, 0.6f, num14); val.SetPixel(j, i, new Color(num18, num19, num20, num17)); } else { val.SetPixel(j, i, Color.clear); } } } val.Apply(); s_haloSprite = Sprite.Create(val, new Rect(0f, 0f, (float)num, (float)num), new Vector2(0.5f, 0.5f), 128f); return s_haloSprite; } private static Sprite CreateGlowSprite() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)s_glowSprite != (Object)null) { return s_glowSprite; } int num = 64; Texture2D val = new Texture2D(num, num, (TextureFormat)4, false); float num2 = (float)num / 2f; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num3 = ((float)j - num2) / num2; float num4 = ((float)i - num2) / num2; float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); float num6 = Mathf.Clamp01(1f - num5); num6 *= num6; val.SetPixel(j, i, new Color(1f, 1f, 1f, num6)); } } val.Apply(); s_glowSprite = Sprite.Create(val, new Rect(0f, 0f, (float)num, (float)num), new Vector2(0.5f, 0.5f), 64f); return s_glowSprite; } private static void RemoveAnimalHalos() { foreach (GameObject s_activeHalo in s_activeHalos) { if ((Object)(object)s_activeHalo != (Object)null) { Object.Destroy((Object)(object)s_activeHalo); } } s_activeHalos.Clear(); HaloAnimator[] array = Object.FindObjectsOfType<HaloAnimator>(); HaloAnimator[] array2 = array; foreach (HaloAnimator haloAnimator in array2) { if ((Object)(object)haloAnimator != (Object)null && (Object)(object)((Component)haloAnimator).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)haloAnimator).gameObject); } } s_hueOffset = 0f; } public static void RemoveAllAnimalHalos() { RemoveAnimalHalos(); PlayNotification("All animal halos removed!"); } private static Color HSVtoRGB(float h, float s, float v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) Color white = Color.white; float num = v * s; float num2 = num * (1f - Mathf.Abs(h * 6f % 2f - 1f)); float num3 = v - num; if (h < 1f / 6f) { ((Color)(ref white))..ctor(num, num2, 0f); } else if (h < 1f / 3f) { ((Color)(ref white))..ctor(num2, num, 0f); } else if (h < 0.5f) { ((Color)(ref white))..ctor(0f, num, num2); } else if (h < 2f / 3f) { ((Color)(ref white))..ctor(0f, num2, num); } else if (h < 5f / 6f) { ((Color)(ref white))..ctor(num2, 0f, num); } else { ((Color)(ref white))..ctor(num, 0f, num2); } white.r += num3; white.g += num3; white.b += num3; return white; } private static void AnimateRGBHalos() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) s_hueOffset += Time.deltaTime * 0.5f; if (s_hueOffset > 1f) { s_hueOffset -= 1f; } float num = 0.7f + 0.3f * Mathf.Sin(Time.time * 4f); foreach (GameObject s_activeHalo in s_activeHalos) { if ((Object)(object)s_activeHalo == (Object)null) { continue; } float h = (s_hueOffset + Random.Range(0f, 0.1f)) % 1f; Color val = HSVtoRGB(h, 1f, 1f); SpriteRenderer component = s_activeHalo.GetComponent<SpriteRenderer>(); if ((Object)(object)component != (Object)null) { component.color = new Color(val.r, val.g, val.b, 0.9f); } Transform val2 = s_activeHalo.transform.Find("HaloGlow"); if ((Object)(object)val2 != (Object)null) { SpriteRenderer component2 = ((Component)val2).GetComponent<SpriteRenderer>(); if ((Object)(object)component2 != (Object)null) { component2.color = new Color(val.r, val.g, val.b, 0.5f * num); } } Transform val3 = s_activeHalo.transform.Find("HaloLight"); if ((Object)(object)val3 != (Object)null) { Light component3 = ((Component)val3).GetComponent<Light>(); if ((Object)(object)component3 != (Object)null) { component3.color = val; component3.intensity = 2f + 1f * Mathf.Sin(Time.time * 4f); } } } } public static void SetFollowerFaith(FollowerInfo followerInfo, float value) { followerInfo.Faith = Mathf.Clamp(value, 0f, 100f); } public static void SetFollowerSatiation(FollowerInfo followerInfo, float value) { followerInfo.Satiation = Mathf.Clamp(value, 0f, 100f); } public static void SetFollowerStarvation(FollowerInfo followerInfo, float value) { if (value > 0f) { followerInfo.Starvation = Mathf.Clamp(value, 0f, 75f); } else { followerInfo.Starvation = 0f; } } public static void ConvertDissenting(FollowerInfo followerInfo) { try { if (followerInfo != null && followerInfo.HasThought((Thought)66)) { Follower followerFromInfo = GetFollowerFromInfo(followerInfo); if ((Object)(object)followerFromInfo != (Object)null) { followerFromInfo.RemoveCursedState((Thought)66); } SetFollowerFaith(followerInfo, 100f); } } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] ConvertDissenting error: " + ex.Message)); } } public static void MaximizeSatiationAndRemoveStarvation(FollowerInfo followerInfo) { try { if (followerInfo == null) { return; } SetFollowerSatiation(followerInfo, 100f); SetFollowerStarvation(followerInfo, 0f); if (followerInfo.HasThought((Thought)131)) { Follower followerFromInfo = GetFollowerFromInfo(followerInfo); if ((Object)(object)followerFromInfo != (Object)null) { followerFromInfo.RemoveCursedState((Thought)131); } } } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] MaximizeSatiationAndRemoveStarvation error: " + ex.Message)); } } public static void TurnFollowerYoung(FollowerInfo follower) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Invalid comparison between Unknown and I4 try { if (follower == null) { Debug.LogWarning((object)"[CheatMenu] TurnFollowerYoung: follower is null"); return; } Follower followerFromInfo = GetFollowerFromInfo(follower); if ((Object)(object)followerFromInfo == (Object)null) { Debug.LogWarning((object)$"[CheatMenu] TurnFollowerYoung: Could not find follower {follower.ID}"); return; } followerFromInfo.RemoveCursedState((Thought)146); followerFromInfo.Brain.ClearThought((Thought)146); follower.Age = 0; follower.OldAge = false; followerFromInfo.Brain.CheckChangeState(); DataManager.Instance.Followers_Elderly_IDs.Remove(follower.ID); if (followerFromInfo.Outfit == null || (int)followerFromInfo.Outfit.CurrentOutfit != 7) { return; } try { followerFromInfo.SetOutfit((FollowerOutfitType)3, false, (Thought)0); } catch (Exception ex) { Debug.LogWarning((object)$"[CheatMenu] Failed to set young outfit for follower {follower.ID}: {ex.Message}"); } } catch (Exception ex2) { Debug.LogWarning((object)("[CheatMenu] TurnFollowerYoung error: " + ex2.Message)); } } public static void TurnFollowerOld(FollowerInfo follower) { try { if (follower == null) { Debug.LogWarning((object)"[CheatMenu] TurnFollowerOld: follower is null"); return; } Follower followerFromInfo = GetFollowerFromInfo(follower); if ((Object)(object)followerFromInfo == (Object)null) { Debug.LogWarning((object)$"[CheatMenu] TurnFollowerOld: Could not find follower {follower.ID}"); return; } CultFaithManager.RemoveThought((Thought)146); try { followerFromInfo.Brain.ApplyCurseState((Thought)146, (Thought)0, false); } catch (Exception ex) { Debug.LogWarning((object)$"[CheatMenu] Failed to apply old age curse for follower {follower.ID}: {ex.Message}"); } } catch (Exception ex2) { Debug.LogWarning((object)("[CheatMenu] TurnFollowerOld error: " + ex2.Message)); } } public static FollowerInfo GetFollowerInfo(Follower follower) { return follower.Brain._directInfoAccess; } public static Follower GetFollowerFromInfo(FollowerInfo follower) { try { if (follower == null) { return null; } return FollowerManager.FindFollowerByID(follower.ID); } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] GetFollowerFromInfo error for ID " + ((follower != null) ? follower.ID.ToString() : "null") + ": " + ex.Message)); return null; } } public static void SetFollowerIllness(FollowerInfo follower, float value) { follower.Illness = Mathf.Clamp(value, 0f, 100f); } public static void ClearAllThoughts() { Traverse.Create(typeof(CultFaithManager)).Field("Thoughts").GetValue<List<ThoughtData>>()?.Clear(); CultFaithManager.GetFaith(0f, 0f, true, (Flair)1, "Cleared follower thoughts!", -1, Array.Empty<string>()); } public static void ClearAndAddPositiveFollowerThought() { Traverse.Create(typeof(CultFaithManager)).Field("Thoughts").GetValue<List<ThoughtData>>()?.Clear(); foreach (FollowerInfo follower in DataManager.Instance.Followers) { CultFaithManager.AddThought((Thought)1, follower.ID, 999f, Array.Empty<string>()); } ThoughtData data = FollowerThoughts.GetData((Thought)1); CultFaithManager.GetFaith(0f, data.Modifier, true, (Flair)1, "Cleared follower thoughts and added positive test thougtht!", -1, Array.Empty<string>()); } public static void SetFollowerHunger(FollowerInfo follower, float value) { follower.Satiation = Mathf.Clamp(value, 0f, 100f); } public static Follower GetFollower(FollowerInfo followerInfo) { return FollowerManager.FindFollowerByID(followerInfo.ID); } public static void KillFollower(Follower follower, bool withNotification = false) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) NotificationType val = (NotificationType)((!withNotification) ? 79 : 0); follower.Die(val, false, 1, "dead", (string)null, (Action<GameObject>)null, false); } public static void ReviveFollower(FollowerInfo follower) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (DataManager.Instance.Followers_Dead_IDs.Contains(follower.ID)) { DataManager.Instance.Followers_Dead.Remove(follower); DataManager.Instance.Followers_Dead_IDs.Remove(follower.ID); Follower val = FollowerManager.CreateNewFollower(follower, ((Component)PlayerFarming.Instance).transform.position, false); if (follower.Age > follower.LifeExpectancy) { follower.LifeExpectancy = follower.Age + Random.Range(20, 30); } else { follower.LifeExpectancy += Random.Range(20, 30); } val.Brain.ResetStats(); } } public static void SpawnFollower(FollowerRole role) { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)PlayerFarming.Instance == (Object)null) { PlayNotification("Must be in game to spawn followers!"); return; } try { int count = DataManager.Instance.Followers_Recruit.Count; if (count > 0) { Debug.Log((object)$"[CheatMenu] Clearing {count} existing recruits before spawning new one"); DataManager.Instance.Followers_Recruit.Clear(); FollowerRecruit[] array = Object.FindObjectsOfType<FollowerRecruit>(); foreach (FollowerRecruit val in array) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] Error clearing existing recruits: " + ex.Message)); } IsSpawningFollowerFromCheat = true; Vector3 position = ((Component)PlayerFarming.Instance).transform.position; try { if ((Object)(object)BiomeBaseManager.Instance != (Object)null && (Object)(object)BiomeBaseManager.Instance.RecruitSpawnLocation != (Object)null) { position = BiomeBaseManager.Instance.RecruitSpawnLocation.transform.position; } } catch { } FollowerRecruit val2 = FollowerManager.CreateNewRecruit((FollowerLocation)1, position); PlayNotification(((Object)(object)val2 != (Object)null) ? "Follower arrived for indoctrination!" : "Recruit created (check circle)!"); ((MonoBehaviour)PlayerFarming.Instance).StartCoroutine(ResetSpawnFlagAfterDelay(3f)); } catch (Exception ex2) { Debug.LogWarning((object)("[CheatMenu] SpawnFollower error: " + ex2.Message)); PlayNotification("Failed to spawn follower!"); IsSpawningFollowerFromCheat = false; } } [IteratorStateMachine(typeof(<ResetSpawnFlagAfterDelay>d__69))] private static IEnumerator ResetSpawnFlagAfterDelay(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ResetSpawnFlagAfterDelay>d__69(0) { delay = delay }; } public static void SpawnFollowerEgg() { //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Expected O, but got Unknown //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)PlayerFarming.Instance == (Object)null) { PlayNotification("Must be in game to spawn eggs!"); return; } DataManager.Instance.ForceGoldenEgg = true; List<FollowerInfo> followers = DataManager.Instance.Followers; StructuresData infoByType = StructuresData.GetInfoByType((TYPES)347, 0); if (followers.Count < 2) { EggData eggInfo = new EggData { EggSeed = Random.Range(0, 100000), Parent_1_ID = 0, Parent_2_ID = 0, Parent_1_SkinName = "Lamb", Parent_2_SkinName = "Lamb", Parent1Name = "Lamb", Parent2Name = "Lamb", Traits = new List<TraitType>(), Golden = true, Rotting = false, Special = (FollowerSpecialType)0 }; infoByType.EggInfo = eggInfo; Vector3 val = ((Component)PlayerFarming.Instance).transform.position + ((Component)PlayerFarming.Instance).transform.forward * 2f; StructureManager.BuildStructure((FollowerLocation)1, infoByType, val, Vector2Int.one, false, (Action<GameObject>)delegate(GameObject obj) { Interaction_EggFollower component3 = obj.GetComponent<Interaction_EggFollower>(); if ((Object)(object)component3 != (Object)null) { component3.UpdateEgg(false, false, false, true, (FollowerSpecialType)0); } PickUp component4 = obj.GetComponent<PickUp>(); if ((Object)(object)component4 != (Object)null) { component4.Bounce = false; } }, (Action)null, true); PlayNotification("Golden follower egg spawned!"); return; } FollowerInfo val2 = followers[Random.Range(0, followers.Count)]; FollowerInfo val3 = followers[Random.Range(0, followers.Count)]; EggData eggInfo2 = new EggData { EggSeed = Random.Range(0, 100000), Parent_1_ID = val2.ID, Parent_2_ID = val3.ID, Parent_1_SkinName = val2.SkinName, Parent_2_SkinName = val3.SkinName, Parent1Name = val2.Name, Parent2Name = val3.Name, Traits = new List<TraitType>(), Golden = true, Rotting = false, Special = (FollowerSpecialType)0 }; infoByType.EggInfo = eggInfo2; Vector3 val4 = ((Component)PlayerFarming.Instance).transform.position + ((Component)PlayerFarming.Instance).transform.forward * 2f; StructureManager.BuildStructure((FollowerLocation)1, infoByType, val4, Vector2Int.one, false, (Action<GameObject>)delegate(GameObject obj) { Interaction_EggFollower component = obj.GetComponent<Interaction_EggFollower>(); if ((Object)(object)component != (Object)null) { component.UpdateEgg(false, false, false, true, (FollowerSpecialType)0); } PickUp component2 = obj.GetComponent<PickUp>(); if ((Object)(object)component2 != (Object)null) { component2.Bounce = false; } }, (Action)null, true); PlayNotification("Golden egg spawned from " + val2.Name + " and " + val3.Name + "!"); } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] SpawnFollowerEgg error: " + ex.Message)); PlayNotification("Failed to spawn follower egg!"); } } public static void RemoveSpyStatus(Follower follower, FollowerInfo info) { try { if (info != null) { try { if (info.Traits != null && info.Traits.Contains((TraitType)80)) { info.Traits.Remove((TraitType)80); } } catch { } } try { if ((Object)(object)follower != (Object)null && follower.Brain != null && follower.Brain.Info != null) { FollowerBrainInfo info2 = follower.Brain.Info; if (info2.Traits != null && info2.Traits.Contains((TraitType)80)) { info2.Traits.Remove((TraitType)80); } } } catch { } try { DataManager instance = DataManager.Instance; if (instance == null) { return; } Type type = ((object)instance).GetType(); FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { try { Type fieldType = fieldInfo.FieldType; if (!typeof(IList).IsAssignableFrom(fieldType) || !(fieldInfo.GetValue(instance) is IList list)) { continue; } for (int num = list.Count - 1; num >= 0; num--) { try { object obj3 = list[num]; if (obj3 != null) { if (info == null) { goto IL_0198; } FollowerInfo val = (FollowerInfo)((obj3 is FollowerInfo) ? obj3 : null); if (val == null || val.ID != info.ID) { goto IL_0198; } list.Remove(obj3); } goto end_IL_0144; IL_0198: if (info != null && obj3 is int num2 && num2 == info.ID) { list.RemoveAt(num); } else { PropertyInfo property = obj3.GetType().GetProperty("ID"); if (property != null) { try { object value = property.GetValue(obj3); if (value is int) { int num3 = (int)value; if (info != null && num3 == info.ID) { list.RemoveAt(num); } } } catch { } } } end_IL_0144:; } catch { } } } catch { } } } catch { } } catch { } } public static void CureIllness(FollowerInfo follower) { try { if (follower != null) { follower.Illness = 0f; Follower followerFromInfo = GetFollowerFromInfo(follower); if ((Object)(object)followerFromInfo != (Object)null) { followerFromInfo.RemoveCursedState((Thought)68); } } } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] CureIllness error: " + ex.Message)); } } public static void RemoveSpyFromRecentFollowers(int recentCount = 3) { try { List<FollowerInfo> list = DataManager.Instance?.Followers; if (list == null) { return; } int num = 0; int num2 = list.Count - 1; while (num2 >= 0 && num < recentCount) { try { FollowerInfo val = list[num2]; if (val != null) { try { if (val.Traits != null && val.Traits.Contains((TraitType)80)) { val.Traits.Remove((TraitType)80); } } catch { } try { Follower val2 = FollowerManager.FindFollowerByID(val.ID); if ((Object)(object)val2 != (Object)null) { try { if (val2.Brain != null && val2.Brain.Info != null && val2.Brain.Info.Traits != null && val2.Brain.Info.Traits.Contains((TraitType)80)) { val2.Brain.Info.Traits.Remove((TraitType)80); } } catch { } } } catch { } num++; } } catch { } num2--; } if (num <= 0) { return; } try { PlayNotification($"Removed Spy trait from {num} recent follower(s)"); } catch { } } catch { } } public static ThoughtData HasThought(FollowerInfo follower, Thought thoughtType) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) foreach (ThoughtData thought in follower.Thoughts) { if (thought.ThoughtType == thoughtType) { return thought; } } return null; } public static void ClearBodies() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Invalid comparison between Unknown and I4 //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Invalid comparison between Unknown and I4 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) int num = 0; List<DeadWorshipper> list = new List<DeadWorshipper>(DeadWorshipper.DeadWorshippers); foreach (DeadWorshipper item in list) { if ((Object)(object)item == (Object)null || item.followerInfo == null) { continue; } try { AddInventoryItem((ITEM_TYPE)62, 5); AddInventoryItem((ITEM_TYPE)9, 2); if ((int)item.followerInfo.Necklace > 0) { AddInventoryItem(item.followerInfo.Necklace, 1); } item.followerInfo.Necklace = (ITEM_TYPE)0; StructureManager.RemoveStructure(item.Structure.Brain); num++; } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] Failed to clear dead follower: " + ex.Message)); } } int num2 = 0; try { List<Interaction_Ranchable> list2 = new List<Interaction_Ranchable>(Interaction_Ranchable.DeadRanchables); foreach (Interaction_Ranchable item2 in list2) { if ((Object)(object)item2 == (Object)null || item2.Animal == null || (int)item2.CurrentState != 9) { continue; } try { List<InventoryItem> meatLoot = Interaction_Ranchable.GetMeatLoot(item2.Animal); foreach (InventoryItem item3 in meatLoot) { AddInventoryItem((ITEM_TYPE)item3.type, item3.quantity); } AddInventoryItem((ITEM_TYPE)9, Structures_Ranch.GetAnimalGrowthState(item2.Animal)); if ((Object)(object)item2.ranch != (Object)null) { item2.ranch.Brain.RemoveAnimal(item2.Animal); } DataManager.Instance.BreakingOutAnimals.Remove(item2.Animal); DataManager.Instance.DeadAnimalsTemporaryList.Add(item2.Animal); Object.Destroy((Object)(object)((Component)item2).gameObject); num2++; } catch (Exception ex2) { Debug.LogWarning((object)("[CheatMenu] Failed to clear dead animal: " + ex2.Message)); } } } catch (Exception ex3) { Debug.LogWarning((object)("[CheatMenu] Failed to clear dead animals: " + ex3.Message)); } if (num == 0 && num2 == 0) { PlayNotification("No dead bodies found!"); } else { PlayNotification($"Bodies cleared! ({num} follower, {num2} animal)"); } } public static void ClearBerryBushes() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) try { int num = 0; foreach (object value in Enum.GetValues(typeof(TYPES))) { try { TYPES val = (TYPES)value; string text = ((object)(TYPES)(ref val)).ToString().ToUpperInvariant(); if (!text.Contains("BERRY") && !text.Contains("BUSH") && !text.Contains("BERR")) { continue; } FollowerLocation val2 = (FollowerLocation)1; List<StructureBrain> allStructuresOfType = StructureManager.GetAllStructuresOfType(ref val2, val, false); foreach (StructureBrain item in allStructuresOfType) { try { AddInventoryItem((ITEM_TYPE)21, 3); item.Remove(); num++; } catch { } } } catch { } } PlayNotification((num > 0) ? $"Berry bushes cleared! ({num} bushes, {num * 3} berries)" : "No berry bushes found!"); } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] ClearBerryBushes failed: " + ex.Message)); PlayNotification("Failed to clear berry bushes!"); } } public static void ClearBaseTrees() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) try { int num = 0; FollowerLocation val = (FollowerLocation)1; foreach (StructureBrain item in StructureManager.GetAllStructuresOfType(ref val, (TYPES)16, false)) { try { try { string[] array = new string[5] { "WOOD", "LOG", "FIREWOOD", "WOOD_LOG", "CHARCOAL" }; bool flag = false; string[] array2 = array; foreach (string value in array2) { try { try { object obj = Enum.Parse(typeof(ITEM_TYPE), value, ignoreCase: true); AddInventoryItem((ITEM_TYPE)obj, 3); flag = true; } catch { continue; } } catch { continue; } break; } if (!flag) { AddInventoryItem((ITEM_TYPE)133, 3); } } catch { } item.Remove(); num++; } catch { } } PlayNotification((num > 0) ? $"Trees cleared! ({num} trees, resources added)" : "No trees found to clear!"); } catch (Exception ex) { Debug.LogWarning((object)("Failed to clear trees: " + ex.Message)); PlayNotification("Failed to clear trees!"); } } public static void ClearBaseRubble() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) try { int num = 0; TYPES[] array = new TYPES[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); TYPES[] array2 = (TYPES[])(object)array; TYPES[] array3 = array2; foreach (TYPES val in array3) { FollowerLocation val2 = (FollowerLocation)1; foreach (StructureBrain item in StructureManager.GetAllStructuresOfType(ref val2, val, false)) { item.Remove(); num++; } } PlayNotification($"Rubble cleared! ({num} items)"); } catch (Exception ex) { Debug.LogWarning((object)("Failed to clear rubble: " + ex.Message)); PlayNotification("Failed to clear rubble!"); } } private static bool IsLandscapeType(string typeName) { return typeName.Contains("GRASS") || typeName.Contains("WEED") || typeName.Contains("BUSH") || typeName.Contains("SHRUB") || typeName.Contains("FERN") || typeName.Contains("PLANT") || typeName.Contains("FOLIAGE") || typeName.Contains("STUMP") || typeName.Contains("SAPLING") || typeName.Contains("DECORATION_ENVIRONMENT"); } public static void ClearBaseGrass() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) try { int num = 0; foreach (object value in Enum.GetValues(typeof(FollowerLocation))) { FollowerLocation val = (FollowerLocation)value; foreach (object value2 in Enum.GetValues(typeof(TYPES))) { string typeName = value2.ToString(); if (!IsLandscapeType(typeName)) { continue; } try { List<StructureBrain> allStructuresOfType = StructureManager.GetAllStructuresOfType(ref val, (TYPES)value2, false); foreach (StructureBrain item in allStructuresOfType) { item.Remove(); num++; } } catch { } } } foreach (object value3 in Enum.GetValues(typeof(TYPES))) { string typeName2 = value3.ToString(); if (!IsLandscapeType(typeName2)) { continue; } try { List<StructureBrain> allStructuresOfType2 = StructureManager.GetAllStructuresOfType((TYPES)value3, false, false); foreach (StructureBrain item2 in allStructuresOfType2) { item2.Remove(); num++; } } catch { } } PlayNotification($"Landscape cleared! ({num} items)"); } catch (Exception ex) { Debug.LogWarning((object)("Failed to clear landscape: " + ex.Message)); PlayNotification("Failed to clear landscape!"); } } public static void ClearVomit() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) FollowerLocation val = (FollowerLocation)1; foreach (StructureBrain item in StructureManager.GetAllStructuresOfType(ref val, (TYPES)48, false)) { item.Remove(); } PlayNotification("Vomit cleared!"); } public static async void ClearPoop() { int poopCount = 0; FollowerLocation val = (FollowerLocation)1; foreach (StructureBrain poop in StructureManager.GetAllStructuresOfType(ref val, (TYPES)97, false)) { poop.Remove(); poopCount++; } foreach (object brainType in Enum.GetValues(typeof(TYPES))) { string typeName = brainType.ToString(); if (!typeName.Contains("POOP") || (int)(TYPES)brainType == 97) { continue; } try { val = (FollowerLocation)1; List<StructureBrain> poopStructures = StructureManager.GetAllStructuresOfType(ref val, (TYPES)brainType, false); foreach (StructureBrain ps in poopStructures) { ps.Remove(); poopCount++; } } catch { } } try { foreach (Interaction_Daycare daycare in Interaction_Daycare.Daycares) { if ((Object)(object)daycare == (Object)null || (Object)(object)daycare.Structure == (Object)null) { continue; } List<InventoryItem> inventory = daycare.Structure.Inventory; if (inventory == null || inventory.Count <= 0) { continue; } foreach (InventoryItem item in inventory) { if (item.type == 39 && item.quantity > 0) { AddInventoryItem((ITEM_TYPE)39, item.quantity); poopCount++; } } inventory.RemoveAll((InventoryItem i) => i.type == 39); daycare.UpdatePoopStates(); } } catch (Exception e) { Debug.LogWarning((object)("[CheatMenu] Failed to clear nursery poop: " + e.Message)); } ClearJanitorStations(); await AsyncHelper.WaitSeconds(1); foreach (PickUp pickup in PickUp.PickUps) { if ((int)pickup.type == 39) { pickup.PickMeUp(); } } PlayNotification($"Poop cleared! ({poopCount} sources)"); } public static void ClearJanitorStations() { try { int num = 0; int num2 = 0; List<Structures_JanitorStation> allStructuresOfType = StructureManager.GetAllStructuresOfType<Structures_JanitorStation>(); foreach (Structures_JanitorStation item in allStructuresOfType) { if (item != null && ((StructureBrain)item).SoulCount > 0) { num2 += ((StructureBrain)item).SoulCount; num++; } } if (num2 > 0 && (Object)(object)PlayerFarming.Instance != (Object)null) { foreach (Structures_JanitorStation item2 in allStructuresOfType) { if (item2 != null) { ((StructureBrain)item2).SoulCount = 0; } } foreach (JanitorStation janitorStation in JanitorStation.JanitorStations) { if ((Object)(object)janitorStation != (Object)null) { Traverse.Create((object)janitorStation).Field("previousSoulCount").SetValue((object)(-1)); } } PlayerFarming.Instance.playerChoreXPBarController.AddChoreXP(PlayerFarming.Instance, (float)num2); } if (num > 0 || num2 > 0) { PlayNotification($"Janitor stations collected! ({num2} XP from {num} stations)"); } else { PlayNotification("No janitor stations with XP found!"); } } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] Failed to clear janitor stations: " + ex.Message)); } } public static void ClearOuthouses() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) FollowerLocation val = (FollowerLocation)1; List<StructureBrain> allStructuresOfType = StructureManager.GetAllStructuresOfType(ref val, (TYPES)96, false); val = (FollowerLocation)1; List<StructureBrain> allStructuresOfType2 = StructureManager.GetAllStructuresOfType(ref val, (TYPES)173, false); StructureBrain[] array = CheatUtils.Concat(allStructuresOfType.ToArray(), allStructuresOfType2.ToArray()); int num = 0; StructureBrain[] array2 = array; foreach (StructureBrain val2 in array2) { Structures_Outhouse val3 = (Structures_Outhouse)(object)((val2 is Structures_Outhouse) ? val2 : null); if (val3 != null) { int poopCount = val3.GetPoopCount(); if (poopCount > 0) { AddInventoryItem((ITEM_TYPE)39, poopCount); num += poopCount; } ((StructureBrain)val3).Data.Inventory.Clear(); } } try { foreach (Interaction_Outhouse outhouse in Interaction_Outhouse.Outhouses) { if ((Object)(object)outhouse != (Object)null) { outhouse.UpdateGauge(); } } } catch (Exception ex) { Debug.LogWarning((object)("[CheatMenu] Failed to update outhouse gauges: " + ex.Message)); } PlayNotification((num > 0) ? $"Outhouses cleared! ({num} poop)" : "Outhouses already clean!"); } public static void SpawnFriendlyWolf() { SpawnFriendlyWolfInternal(userInitiated: true); } private static void SpawnFriendlyWolfInternal(bool userInitiated) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)PlayerFarming.Instance == (Object)null) { if (userInitiated) { PlayNotification("Must be in game!"); } return; } if ((Object)(object)FriendlyWolf != (Object)null) { if (userInitiated) { PlayNotification("You already have a friendly wolf!"); } return; } Vector3 position = ((Component)PlayerFarming.Instance