using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using HouseMod.SkillStates.House.TheGame; using Microsoft.CodeAnalysis; using On.RoR2.UI; using R2API; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using RoR2.Skills; using RoR2.UI; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("MoreHouse")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MoreHouse")] [assembly: AssemblyTitle("MoreHouse")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace MoreHouse { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("MoreHouse", "MoreHouse", "1.0.2")] internal class MoreHouse : BaseUnityPlugin { internal class SkillDefInfo { public string skillName; public string skillNameToken; public string skillDescriptionToken; public Sprite skillIcon; public SerializableEntityStateType activationState; public string activationStateMachineName; public int baseMaxStock; public float baseRechargeInterval; public bool beginSkillCooldownOnSkillEnd; public bool canceledFromSprinting; public bool forceSprintDuringState; public bool fullRestockOnAssign; public InterruptPriority interruptPriority; public bool resetCooldownTimerOnUse; public bool isCombatSkill; public bool mustKeyPress; public bool cancelSprintingOnActivation; public int rechargeStock; public int requiredStock; public int stockToConsume; public string[] keywordTokens; } internal class HouseCard { public enum CardType { Positive, Negative, Neutral, Random, None } public Sprite cardArt = null; public Sprite cardIcon = null; public string name = "DefaultCardName"; public string description = "DefualtCardDescription"; public Color color = Color.clear; public CardType type = CardType.None; public bool exhaust = false; public bool etherial = false; public bool indestructible = false; public int id; public HouseCard(string name, string description, Sprite cardIcon, Sprite cardArt, int id) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) this.name = name; this.description = description; this.cardIcon = cardIcon; this.cardArt = cardArt; } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__53_0; public static Func <>9__61_0; public static Func <>9__64_0; internal void b__53_0() { customMenu.SetActive(false); } internal bool b__61_0(Assembly asm) { return asm.GetName().Name == "HouseMod"; } internal bool b__64_0(Assembly asm) { return asm.GetName().Name == "HouseMod"; } } private const string modName = "MoreHouse"; private const string Author = "idolfan"; private const string modGuid = "MoreHouse"; private const string Version = "1.0.2"; public static GameObject customMenu; public static GameObject currentDeckView; public static GameObject keyBindHUD; public static GameObject keyBindPanel; public static Text KeyBindHUDText; public static HouseDeckDef deck1; public static HouseCard[] cards; public static Assembly houseAssembly; public static AssetBundle assetBundle; public static ConfigEntry debug { get; set; } public static int[] firstDeckCards { get; set; } public static ConfigEntry firstDeck { get; set; } public static ConfigEntry firstDeckName { get; set; } public static ConfigEntry firstDeckDescription { get; set; } public static ConfigEntry cardNumbers { get; set; } public static ConfigEntry openCurrentDeckMenu { get; set; } public static ConfigEntry showShortcutHUD { get; set; } private void Awake() { //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Expected O, but got Unknown //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Expected O, but got Unknown //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Expected O, but got Unknown //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Expected O, but got Unknown //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Expected O, but got Unknown assetBundle = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("MoreHouse.dll", "morehouseassets")); debug = ((BaseUnityPlugin)this).Config.Bind("Debug", "Debug mode", true, "Toggles debug messages"); firstDeck = ((BaseUnityPlugin)this).Config.Bind("Decks", "Custom Deck Cards", "16,16,16,6,6,19,19,20,20,2,2,2,2,1,1,1,1,4,4,4,4,14,14,14,14,34,34,34,34,34,31,31,31,31,31,32,32,9,9,13,13,8,8,26", "Cards used by the first Deck. You can manually add Cards separated by commas, or just use the visual Card Selection."); firstDeckName = ((BaseUnityPlugin)this).Config.Bind("Decks", "Custom Deck Name", "Custom Deck", "The displayed name for the custom Deck"); firstDeckDescription = ((BaseUnityPlugin)this).Config.Bind("Decks", "Custom Deck Description", "Your custom deck.", "The displayed description for your custom deck"); string[] array = firstDeck.Value.Split(','); firstDeckCards = new int[array.Length]; openCurrentDeckMenu = ((BaseUnityPlugin)this).Config.Bind("Decks", "View deck", new KeyboardShortcut((KeyCode)282, Array.Empty()), "Open a view for your current deck durung a run."); showShortcutHUD = ((BaseUnityPlugin)this).Config.Bind("Decks", "Show Keybind HUD", true, "Show your keybind for the current deck view in the HUD."); ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(firstDeckName), "MoreHouse", "MoreHouse"); firstDeckName.SettingChanged += changeDeckName; ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(firstDeckDescription), "MoreHouse", "MoreHouse"); firstDeckDescription.SettingChanged += changeDeckDescription; ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(firstDeck), "MoreHouse", "MoreHouse"); firstDeck.SettingChanged += changeDeckCards; ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Select Cards", "Decks", "Select cards for your deck by adding one Card via leftclick, and removing via rightclick. \n Changes will be applied immediately.\n The 'First Deck Cards' will only show your changes after reopening the Mod Options.", "Open Card Selection", new UnityAction(openCardMenu)), "MoreHouse", "MoreHouse"); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(openCurrentDeckMenu), "MoreHouse", "MoreHouse"); openCurrentDeckMenu.SettingChanged += changeKeyBindHUDText; ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(showShortcutHUD), "MoreHouse", "MoreHouse"); showShortcutHUD.SettingChanged += changeKeyBindHUD; ModSettingsManager.SetModIcon(assetBundle.LoadAsset("customDeck.png"), "MoreHouse", "MoreHouse"); ModSettingsManager.SetModDescription("Adds a configurable deck to The House", "MoreHouse", "MoreHouse"); for (int i = 0; i < array.Length; i++) { if (array[i] != "") { firstDeckCards[i] = int.Parse(array[i]); } } cardNumbers = ((BaseUnityPlugin)this).Config.Bind("Indexes", "Indexes of cards", "", "7HEARTS:1\r\n7DIAMONDS:2\r\n7CLUBS:3\r\n7SPADES:4\r\nJACKPOT:5\r\n52:6\r\nBUST:7\r\nSNAKE:8\r\nCOINS:9\r\nSWORDS:10\r\nTOWER:11\r\nJOKER:12\r\n7JACK:13\r\n7ACE:14\r\n7KING:15\r\n7QUEEN:16\r\nRROULETTE:17\r\nWILDCARD:18\r\nFORTUNE:19\r\nTHREEOFAKIND:20\r\nGHEARTS:21\r\nGCLUBS:22\r\nGSPADES:23\r\nCRAZYCARD:24\r\nTHESUN:25\r\nTHEMOON:26\r\nTHESTAR:27\r\nTHEWORLD:28\r\nJUDGEMENT:29\r\nKINGOFWANDS:30\r\nKNIGHTOFSWORDS:31\r\nQUEENOFCUPS:32\r\nPAGEOFPENTACLES:33\r\nANTEUP:34"); changeHouse(); LanguageTokens(); HUD.Awake += new hook_Awake(addKeyBindHUD); HUD.shouldHudDisplay += new ShouldHudDisplayDelegate(displayHUD); if (debug.Value) { Console.WriteLine("MoreHouse awake completed."); } } private void displayHUD(HUD hud, ref bool shouldDisplay) { object obj; if (hud == null) { obj = null; } else { LocalUser localUserViewer = hud.localUserViewer; if (localUserViewer == null) { obj = null; } else { CharacterBody cachedBody = localUserViewer.cachedBody; obj = ((cachedBody != null) ? ((Component)cachedBody).GetComponent("HousePassiveManager") : null); } } if ((Object)obj != (Object)null) { shouldDisplay = true; keyBindHUD.SetActive(true); } } private void changeKeyBindHUDText(object sender, EventArgs e) { //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) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)KeyBindHUDText != (Object)null) { Text keyBindHUDText = KeyBindHUDText; KeyboardShortcut value = openCurrentDeckMenu.Value; KeyCode mainKey = ((KeyboardShortcut)(ref value)).MainKey; keyBindHUDText.text = ((object)(KeyCode)(ref mainKey)).ToString(); } } private void changeKeyBindHUD(object sender, EventArgs e) { if ((Object)(object)keyBindPanel != (Object)null) { keyBindPanel.gameObject.SetActive(showShortcutHUD.Value); } } private void addKeyBindHUD(orig_Awake orig, HUD self) { //IL_0090: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); GameObject val = assetBundle.LoadAsset("KeyBindHUDCanvas.prefab"); keyBindHUD = Object.Instantiate(val); keyBindHUD.SetActive(false); keyBindPanel = ((Component)keyBindHUD.transform.Find("Panel")).gameObject; keyBindPanel.gameObject.SetActive(showShortcutHUD.Value); KeyBindHUDText = ((Component)keyBindPanel.transform.Find("Text")).GetComponent(); Text keyBindHUDText = KeyBindHUDText; KeyboardShortcut value = openCurrentDeckMenu.Value; KeyCode mainKey = ((KeyboardShortcut)(ref value)).MainKey; keyBindHUDText.text = ((object)(KeyCode)(ref mainKey)).ToString(); } public void Update() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Run.instance != (Object)null) { KeyboardShortcut value = openCurrentDeckMenu.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey)) { openCurrentDeckView(); } } } private void showKeyBind() { } private void openCurrentDeckView() { //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0288: 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_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Expected O, but got Unknown //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)currentDeckView != (Object)null) { currentDeckView.SetActive(false); Object.Destroy((Object)(object)currentDeckView); currentDeckView = null; return; } LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); if (firstLocalUser == null) { return; } CharacterBody component = firstLocalUser.cachedMasterController.master.GetBodyObject().GetComponent(); if ((Object)(object)component == (Object)null) { return; } Component component2 = ((Component)component).GetComponent("HousePassiveManager"); if ((Object)(object)component2 == (Object)null) { return; } GameObject val = assetBundle.LoadAsset("CurrentDeckCanvas.prefab"); currentDeckView = Object.Instantiate(val); currentDeckView.SetActive(true); Canvas component3 = currentDeckView.GetComponent(); component3.renderMode = (RenderMode)0; component3.sortingOrder = 1000; GameObject gameObject = ((Component)currentDeckView.transform.Find("Panel")).gameObject; FieldInfo field = ((object)component2).GetType().GetField("gameDeck", BindingFlags.Instance | BindingFlags.Public); FieldInfo field2 = ((object)component2).GetType().GetField("gameDeckDiscardPile", BindingFlags.Instance | BindingFlags.Public); FieldInfo field3 = ((object)component2).GetType().GetField("handCards", BindingFlags.Instance | BindingFlags.Public); List list = (List)field.GetValue(component2); List list2 = (List)field2.GetValue(component2); int[] deck = (int[])field3.GetValue(component2); List list3 = new List(); for (int i = 0; i < cards.Length; i++) { int num = countCardInDeck(list.ToArray(), i) + countCardInDeck(list2.ToArray(), i) + countCardInDeck(deck, i); if (num != 0) { list3.Add(new int[2] { i, num }); } } float num2 = ((list3.Count > 16) ? 0.3f : 0.45f); for (int j = 0; j < list3.Count; j++) { HouseCard houseCard = cards[list3[j][0]]; GameObject val2 = new GameObject(houseCard.name); RectTransform val3 = val2.AddComponent(); RectTransform component4 = gameObject.GetComponent(); Rect rect = component4.rect; float num3 = ((Rect)(ref rect)).width; rect = component4.rect; float num4 = num3 / ((Rect)(ref rect)).height; val3.anchorMin = new Vector2(0.05f + num2 * (float)j % 0.9f, 1f - 0.05f * num4 - num2 * num4 * (float)(int)(1f + num2 * (float)j / 0.9f)); val3.anchorMax = new Vector2(val3.anchorMin.x + num2 * 0.9f, val3.anchorMin.y + num2 * 0.9f * num4); val3.sizeDelta = new Vector2(1f, 1f); Image val4 = val2.AddComponent(); ((Object)val4).name = houseCard.name + "IMAGE"; val4.sprite = houseCard.cardIcon; GameObject val5 = new GameObject("NumberText" + j); val5.transform.SetParent(val2.transform, false); Text val6 = val5.AddComponent(); int num5 = list3[j][1]; val6.text = ((num5 != 0) ? (num5 + "x") : ""); val6.font = Resources.GetBuiltinResource("Arial.ttf"); val6.fontSize = 25; val6.alignment = (TextAnchor)2; Shadow val7 = val5.AddComponent(); val7.effectColor = new Color(0f, 0f, 0f, 0.5f); val7.effectDistance = new Vector2(2f, -2f); val2.transform.SetParent(gameObject.transform, false); } } private void openCardMenu() { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_0123: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Expected O, but got Unknown //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Expected O, but got Unknown //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Expected O, but got Unknown //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Expected O, but got Unknown //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Expected O, but got Unknown //IL_031d: Unknown result type (might be due to invalid IL or missing references) GameObject val = assetBundle.LoadAsset("Canvas.prefab"); GameObject val2 = assetBundle.LoadAsset("Canvas"); customMenu = Object.Instantiate(val); customMenu.SetActive(true); Canvas component = customMenu.GetComponent(); component.renderMode = (RenderMode)0; component.sortingOrder = 1000; GameObject gameObject = ((Component)customMenu.transform.Find("Panel")).gameObject; for (int i = 0; i < cards.Length; i++) { HouseCard houseCard = cards[i]; GameObject val3 = new GameObject(houseCard.name); RectTransform val4 = val3.AddComponent(); RectTransform component2 = gameObject.GetComponent(); Rect rect = component2.rect; float num = ((Rect)(ref rect)).width; rect = component2.rect; float num2 = num / ((Rect)(ref rect)).height; val4.anchorMin = new Vector2(0.1f + 0.1f * (float)i % 0.8f, 0.9f - 0.1f * num2 * (float)(int)(1f + 0.1f * (float)i / 0.8f)); val4.anchorMax = new Vector2(val4.anchorMin.x + 0.09f, val4.anchorMin.y + 0.09f * num2); val4.sizeDelta = new Vector2(1f, 1f); Image val5 = val3.AddComponent(); ((Object)val5).name = houseCard.name + "IMAGE"; val5.sprite = houseCard.cardIcon; Button val6 = val3.AddComponent