using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OLD_SA.Royalty")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OLD_SA.Royalty")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("7879e24e-cb30-4fed-833d-51d78ca3f60b")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Royalty; [BepInPlugin("OLD_SA.Royalty", "OLD_SA Royalty", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Royalty.Init(); Harmony val = new Harmony("OLD_SA.Royalty"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD_SA Royalty Loaded"); } } public class Royalty : VariableStatBehaviour { public static SpecialStatIcon iconType; protected override SpecialStatIcon IconType => iconType; public static void Init() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) StatIconInfo val = ScriptableObject.CreateInstance(); val.rulebookName = "Royalty"; val.rulebookDescription = "This creature's attack is determined by the number of different tribes present on the board."; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("royalty.png", (FilterMode)0); val.iconGraphic = (Texture)(object)imageAsTexture; Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("royalty_px.png", (FilterMode)0); AbilityExtensions.SetPixelIcon(val, imageAsTexture2, (FilterMode?)null); val.metaCategories = new List { (AbilityMetaCategory)0 }; val.appliesToAttack = true; val.appliesToHealth = false; FullStatIcon val2 = StatIconManager.Add("OLD_SA", val, typeof(Royalty)); iconType = val2.Id; } protected override int[] GetStatValues() { HashSet hashSet = new HashSet(); foreach (CardSlot slot in Singleton.Instance.GetSlots(true)) { AddTribe(slot, hashSet); } foreach (CardSlot slot2 in Singleton.Instance.GetSlots(false)) { AddTribe(slot2, hashSet); } int count = hashSet.Count; int num = count; int? extendedPropertyAsInt = CardExtensions.GetExtendedPropertyAsInt(((Card)((SpecialCardBehaviour)this).PlayableCard).Info, "OLD_SA.RoyaltyBonus"); if (extendedPropertyAsInt.HasValue) { num = extendedPropertyAsInt.Value; } return new int[2] { count + num, 0 }; } private void AddTribe(CardSlot slot, HashSet tribes) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)slot.Card == (Object)null) { return; } if (((Card)slot.Card).Info.tribes == null || ((Card)slot.Card).Info.tribes.Count == 0) { tribes.Add("NONE"); return; } foreach (Tribe tribe in ((Card)slot.Card).Info.tribes) { tribes.Add(((object)tribe/*cast due to .constrained prefix*/).ToString()); } } }