using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Dialogue; using InscryptionAPI.Helpers; using InscryptionAPI.Pelts; using InscryptionAPI.Pelts.Extensions; using OLD_SA.Pelt; 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("OldSa_Pelt")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Pelt")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("b8818afc-f159-4d5d-a320-9616352cd5db")] [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.Incorporal { [HarmonyPatch(typeof(RenderStatsLayer), "AssignCopiedRenderTexture")] public static class GhostCardRenderTexturePatch { [HarmonyPostfix] private static void Postfix(RenderStatsLayer __instance, Texture tex, bool emission) { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)tex == (Object)null)) { object? obj = AccessTools.Property(typeof(RenderStatsLayer), "PlayableCard")?.GetValue(__instance, null); PlayableCard val = (PlayableCard)((obj is PlayableCard) ? obj : null); if (!((Object)(object)val == (Object)null) && GhostCard.IsApplied(val)) { GhostCard.SyncRenderTexture(val, tex, emission); } } } } } namespace OLD_SA.Pelt { [HarmonyPatch(typeof(CardMergeSequencer), "GetValidCardsForSacrifice")] internal static class CardMergeSequencer_GoldPeltSacrificePatch { [HarmonyPostfix] private static void Postfix(ref List __result) { if (__result == null || __result.Count == 0) { return; } List goldCards = GoldPeltPool.GetGoldCards(); if (goldCards != null && goldCards.Count != 0) { __result.RemoveAll((CardInfo card) => (Object)(object)card != (Object)null && goldCards.Contains(card)); } } } public static class GhostCard { private static AssetBundle ghostBundle; private static Material ghostBaseMaterial; private static readonly Dictionary originalMaterials = new Dictionary(); private static readonly Dictionary ghostMaterials = new Dictionary(); private static string BundlePath => Path.Combine(Paths.PluginPath, "OLD_SA_DLC", "OLD_SA_Card", "old_sa_ghost"); private static bool LoadGhostBundle() { if ((Object)(object)ghostBaseMaterial != (Object)null) { return true; } if ((Object)(object)ghostBundle == (Object)null) { if (!File.Exists(BundlePath)) { return false; } ghostBundle = AssetBundle.LoadFromFile(BundlePath); if ((Object)(object)ghostBundle == (Object)null) { return false; } } ghostBaseMaterial = ghostBundle.LoadAsset("assets/ghostcard_material.mat"); if ((Object)(object)ghostBaseMaterial == (Object)null) { return false; } return true; } public static void SyncRenderTexture(PlayableCard card, Texture tex, bool emission) { if ((Object)(object)card == (Object)null || (Object)(object)tex == (Object)null) { return; } Material value = null; if (!ghostMaterials.TryGetValue(card, out value) || (Object)(object)value == (Object)null) { return; } if (emission) { if (value.HasProperty("_EmissionMap")) { value.SetTexture("_EmissionMap", tex); } } else if (value.HasProperty("_MainTex")) { value.SetTexture("_MainTex", tex); } Material value2 = null; if (!originalMaterials.TryGetValue(card, out value2) || !((Object)(object)value2 != (Object)null)) { return; } if (emission) { if (value2.HasProperty("_EmissionMap")) { value2.SetTexture("_EmissionMap", tex); } } else if (value2.HasProperty("_MainTex")) { value2.SetTexture("_MainTex", tex); } } public static void Apply(PlayableCard card) { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).StatsLayer == (Object)null) { return; } Material value = null; if (ghostMaterials.TryGetValue(card, out value)) { if (!((Object)(object)value == (Object)null)) { if ((Object)(object)((Card)card).StatsLayer.Material != (Object)(object)value) { ((Card)card).StatsLayer.Material = value; } return; } ghostMaterials.Remove(card); } if ((Object)(object)((Card)card).StatsLayer.Material == (Object)null || !LoadGhostBundle()) { return; } Material material = ((Card)card).StatsLayer.Material; if ((Object)(object)material == (Object)null) { return; } Material val = new Material(ghostBaseMaterial); if (material.HasProperty("_MainTex") && val.HasProperty("_MainTex")) { Texture texture = material.GetTexture("_MainTex"); if ((Object)(object)texture != (Object)null) { val.SetTexture("_MainTex", texture); } } if (material.HasProperty("_EmissionMap") && val.HasProperty("_EmissionMap")) { Texture texture2 = material.GetTexture("_EmissionMap"); if ((Object)(object)texture2 != (Object)null) { val.SetTexture("_EmissionMap", texture2); } } originalMaterials[card] = material; ghostMaterials[card] = val; ((Card)card).StatsLayer.Material = val; } public static void Refresh(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { Material value = null; if (ghostMaterials.TryGetValue(card, out value) && !((Object)(object)value == (Object)null) && !((Object)(object)((Card)card).StatsLayer == (Object)null) && (Object)(object)((Card)card).StatsLayer.Material != (Object)(object)value) { ((Card)card).StatsLayer.Material = value; } } } public static void Remove(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { Material value = null; originalMaterials.TryGetValue(card, out value); Material value2 = null; ghostMaterials.TryGetValue(card, out value2); if ((Object)(object)((Card)card).StatsLayer != (Object)null && (Object)(object)value != (Object)null) { ((Card)card).StatsLayer.Material = value; } if ((Object)(object)value2 != (Object)null) { Object.Destroy((Object)(object)value2); } originalMaterials.Remove(card); ghostMaterials.Remove(card); } } public static bool IsApplied(PlayableCard card) { if ((Object)(object)card == (Object)null) { return false; } Material value = null; if (!ghostMaterials.TryGetValue(card, out value)) { return false; } if ((Object)(object)value == (Object)null) { return false; } if ((Object)(object)((Card)card).StatsLayer == (Object)null) { return false; } return (Object)(object)((Card)card).StatsLayer.Material == (Object)(object)value; } public static Material GetGhostMaterial(PlayableCard card) { if ((Object)(object)card == (Object)null) { return null; } Material value = null; if (ghostMaterials.TryGetValue(card, out value)) { return value; } return null; } public static void Forget(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { Material value = null; if (ghostMaterials.TryGetValue(card, out value) && (Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } originalMaterials.Remove(card); ghostMaterials.Remove(card); } } } public static class GoldPeltPool { public const string GoldPeltProperty = "OLD_SA_GoldPool"; private static readonly List goldCards = new List(); public static int Count => goldCards.Count; public static void Initialize() { BuildPool(); } public static void BuildPool() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected I4, but got Unknown goldCards.Clear(); foreach (CardInfo item in CardManager.AllCardsCopy) { if (!((Object)(object)item == (Object)null) && IsGoldPeltCard(item)) { CardExtensions.AddAppearances(item, (Appearance[])(object)new Appearance[1] { (Appearance)(int)OldSaEerieForestBackground.ID }); if (!goldCards.Contains(item)) { goldCards.Add(item); } Debug.Log((object)("[OLD SA Pelt] Gold card registered: " + ((Object)item).name)); } } Debug.Log((object)("[OLD SA Pelt] Gold Pelt Pool built. Count = " + goldCards.Count)); } public static bool IsGoldPeltCard(CardInfo cardInfo) { if ((Object)(object)cardInfo == (Object)null) { return false; } string extendedProperty = CardExtensions.GetExtendedProperty(cardInfo, "OLD_SA_GoldPool"); return string.Equals(extendedProperty, "true", StringComparison.OrdinalIgnoreCase); } public static List GetGoldCards() { return new List(goldCards); } public static CardInfo GetRandomGoldCard() { if (goldCards.Count == 0) { return null; } return goldCards[Random.Range(0, goldCards.Count)]; } } public static class HolyPelt { private const string HolyPeltName = "OLD_SA_HOLY_PELT"; private static readonly HashSet PurchasedAtThisNode = new HashSet(); public static void Initialize() { RegisterHolyPelt(); } private static void RegisterHolyPelt() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) CardInfo cardByName = CardLoader.GetCardByName("OLD_SA_HOLY_PELT"); Func> func = () => CardLoader.GetUnlockedCards((CardMetaCategory)1, (CardTemple)0); PeltData val = PeltManager.New("OLD_SA.Pelt", cardByName, func, 13, 0, 3); val.peltTierName = "Holy"; val.isSoldByTrapper = false; DialogueManager.GenerateTraderPeltsEvent("OLD_SA.Pelt", val, new List { CustomLine.op_Implicit("This will draw their attention.") }, (List>)null); } [HarmonyPatch(typeof(BuyPeltsSequencer), "BuyPelts")] [HarmonyPrefix] private static void BuyPeltsPrefix(BuyPeltsSequencer __instance) { PurchasedAtThisNode.Remove(__instance); } [HarmonyPatch(typeof(BuyPeltsSequencer), "BuyPelt")] [HarmonyPrefix] private static bool BuyPeltPrefix(BuyPeltsSequencer __instance, SelectableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return true; } if (((Object)((Card)card).Info).name != "OLD_SA_HOLY_PELT") { return true; } int holyPeltPrice = GetHolyPeltPrice(card); if (RunState.Run.currency < holyPeltPrice) { return true; } if (!PurchasedAtThisNode.Contains(__instance)) { PurchasedAtThisNode.Add(__instance); return true; } ShowAlreadyHaveEnough(__instance); return false; } private static int GetHolyPeltPrice(SelectableCard card) { PeltData val = PeltManager.AllPeltsAvailableAtTrader().Find((PeltData x) => x != null && x.peltCardName == "OLD_SA_HOLY_PELT"); if (val != null) { return val.BuyPrice; } return 13; } private static void ShowAlreadyHaveEnough(BuyPeltsSequencer instance) { if (!Singleton.Instance.Displaying) { ((MonoBehaviour)instance).StartCoroutine(Singleton.Instance.ShowThenClear("You've got enough already", 3f, 0f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null)); } } } public class OldSaEerieForestBackground : CardAppearanceBehaviour { public static Appearance ID; private static Texture2D BackgroundTexture; public override void ApplyAppearance() { if ((Object)(object)BackgroundTexture == (Object)null) { BackgroundTexture = TextureHelper.GetImageAsTexture("OLD_SA_DLC/OLD_SA_Card/Background/OldSa_Eerie_Forest_Background.png", (FilterMode)0); } if ((Object)(object)BackgroundTexture == (Object)null) { Debug.LogError((object)"[OLD SA Pelt] Failed to load Eerie Forest Background."); } else { ((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = (Texture)(object)BackgroundTexture; } } } public class OldSaPlantBackground : CardAppearanceBehaviour { public static Appearance ID; private static Texture2D BackgroundTexture; public override void ApplyAppearance() { if ((Object)(object)BackgroundTexture == (Object)null) { BackgroundTexture = TextureHelper.GetImageAsTexture("OLD_SA_DLC/OLD_SA_Card/Background/OldSa_Plant_Background.png", (FilterMode)0); } ((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = (Texture)(object)BackgroundTexture; } } [BepInPlugin("OLD_SA.Pelt", "OLD SA Pelt", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.Pelt"; public const string PluginName = "OLD SA Pelt"; public const string PluginVersion = "1.0.0"; internal static Plugin Instance; internal static ManualLogSource Log; private const string BrokenPeltName = "OLD_SA_BROKEN_PELT"; private const string HolyPeltName = "OLD_SA_HOLY_PELT"; private const string BrokenModificationId = "OLD_SA_BROKEN_PELT_MOD"; private unsafe void Awake() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_01cd: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"[OLD SA Pelt] Plugin loaded."); try { FullCardAppearanceBehaviour val = CardAppearanceBehaviourManager.Add("OLD_SA.Pelt", "RainbowEmission", typeof(RainbowEmission)); RainbowEmission.ID = val.Id; Log.LogInfo((object)"[OLD SA Pelt] RainbowEmission registered."); ManualLogSource log = Log; Appearance id = val.Id; log.LogInfo((object)("[OLD SA Pelt] RainbowEmission ID = " + ((object)(*(Appearance*)(&id))/*cast due to .constrained prefix*/).ToString())); Log.LogInfo((object)("[OLD SA Pelt] RainbowEmission Type = " + val.AppearanceBehaviour)); FullCardAppearanceBehaviour val2 = CardAppearanceBehaviourManager.Add("OLD_SA.Pelt", "OldSa_Eerie_Forest_Background", typeof(OldSaEerieForestBackground)); OldSaEerieForestBackground.ID = val2.Id; Log.LogInfo((object)"[OLD SA Pelt] OldSa Eerie Forest Background registered."); ManualLogSource log2 = Log; id = val2.Id; log2.LogInfo((object)("[OLD SA Pelt] OldSa Eerie Forest Background ID = " + ((object)(*(Appearance*)(&id))/*cast due to .constrained prefix*/).ToString())); Log.LogInfo((object)("[OLD SA Pelt] OldSa Eerie Forest Background Type = " + val2.AppearanceBehaviour)); FullCardAppearanceBehaviour val3 = CardAppearanceBehaviourManager.Add("OLD_SA.Pelt", "OldSa_Plant_Background", typeof(OldSaPlantBackground)); OldSaPlantBackground.ID = val3.Id; Log.LogInfo((object)"[OLD SA Pelt] OldSa Plant Background registered."); ManualLogSource log3 = Log; id = val3.Id; log3.LogInfo((object)("[OLD SA Pelt] OldSa Plant Background ID = " + ((object)(*(Appearance*)(&id))/*cast due to .constrained prefix*/).ToString())); Log.LogInfo((object)("[OLD SA Pelt] OldSa Plant Background Type = " + val3.AppearanceBehaviour)); RegisterBrokenPelt(); HolyPelt.Initialize(); Harmony val4 = new Harmony("OLD_SA.Pelt"); val4.PatchAll(); Log.LogInfo((object)"[OLD SA Pelt] Harmony PatchAll completed."); Log.LogInfo((object)"[OLD SA Pelt] Broken Pelt registered successfully."); Log.LogInfo((object)"[OLD SA Pelt] Holy Pelt initialized successfully."); Log.LogInfo((object)"[OLD SA Pelt] Plugin initialization completed."); } catch (Exception ex) { Log.LogError((object)"[OLD SA Pelt] Failed to initialize:"); Log.LogError((object)ex); } } private void RegisterBrokenPelt() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) CardInfo cardByName = CardLoader.GetCardByName("OLD_SA_BROKEN_PELT"); if ((Object)(object)cardByName == (Object)null) { Log.LogError((object)"[OLD SA Pelt] Could not find card: OLD_SA_BROKEN_PELT"); return; } Func> func = delegate { List unlockedCards = CardLoader.GetUnlockedCards((CardMetaCategory)1, (CardTemple)0); unlockedCards.RemoveAll((CardInfo card) => !CanBeBroken(card)); return unlockedCards; }; PeltData val = PeltManager.New("OLD_SA.Pelt", cardByName, func, 1, 0, 8); val.isSoldByTrapper = false; val.peltTierName = "Broken"; DialogueManager.GenerateTraderPeltsEvent("OLD_SA.Pelt", val, new List { CustomLine.op_Implicit("What good do you think I have to offer you?") }, (List>)null); PeltExtensions.SetModifyCardChoiceAtTrader(val, (Action)ModifyBrokenCard); PeltExtensions.SetModifyCardChoiceAtTrader(val, (Action)ModifyBrokenCard); Log.LogInfo((object)"[OLD SA Pelt] Registered OLD_SA_BROKEN_PELT."); } private static bool CanBeBroken(CardInfo cardInfo) { if ((Object)(object)cardInfo == (Object)null) { return false; } if (cardInfo.Attack > 0) { return true; } if (cardInfo.Health > 2) { return true; } if (cardInfo.Abilities != null && cardInfo.Abilities.Count > 0) { return true; } return false; } private static void ModifyBrokenCard(CardInfo cardInfo) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown if ((Object)(object)cardInfo == (Object)null) { return; } if (cardInfo.Mods != null) { foreach (CardModificationInfo mod in cardInfo.Mods) { if (mod == null || !(mod.singletonId == "OLD_SA_BROKEN_PELT_MOD")) { continue; } return; } } int attack = cardInfo.Attack; int health = cardInfo.Health; bool flag = attack > 0; bool flag2 = health > 2; CardModificationInfo val = new CardModificationInfo(); if (flag && flag2) { if (Random.Range(0, 2) == 0) { val.attackAdjustment = -1; Log.LogInfo((object)("[OLD SA Pelt] " + ((Object)cardInfo).name + " -> Attack -1")); } else { val.healthAdjustment = -2; Log.LogInfo((object)("[OLD SA Pelt] " + ((Object)cardInfo).name + " -> Health -2")); } } else if (flag) { val.attackAdjustment = -1; Log.LogInfo((object)("[OLD SA Pelt] " + ((Object)cardInfo).name + " -> Attack -1")); } else if (flag2) { val.healthAdjustment = -2; Log.LogInfo((object)("[OLD SA Pelt] " + ((Object)cardInfo).name + " -> Health -2")); } else { RemoveRandomAbility(cardInfo, val); } string text = cardInfo.DisplayedNameLocalized; if (string.IsNullOrEmpty(text)) { text = ((Object)cardInfo).name; } val.nameReplacement = string.Format(Localization.Translate("Broken {0}"), text); val.singletonId = "OLD_SA_BROKEN_PELT_MOD"; if (cardInfo.Mods == null) { cardInfo.Mods = new List(); } cardInfo.Mods.Add(val); } private unsafe static void RemoveRandomAbility(CardInfo cardInfo, CardModificationInfo brokenMod) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (cardInfo.Abilities == null || cardInfo.Abilities.Count == 0) { Log.LogInfo((object)("[OLD SA Pelt] " + ((Object)cardInfo).name + " -> No abilities to remove.")); return; } List list = new List(cardInfo.Abilities); if (list.Count == 0) { Log.LogInfo((object)("[OLD SA Pelt] " + ((Object)cardInfo).name + " -> No abilities.")); return; } Ability item = list[Random.Range(0, list.Count)]; brokenMod.negateAbilities = new List(); brokenMod.negateAbilities.Add(item); Log.LogInfo((object)("[OLD SA Pelt] " + ((Object)cardInfo).name + " -> Removed ability " + ((object)(*(Ability*)(&item))/*cast due to .constrained prefix*/).ToString())); } internal static bool HasBrokenPeltInHand() { if ((Object)(object)Singleton.Instance == (Object)null) { return false; } foreach (PlayableCard item in Singleton.Instance.CardsInHand) { if ((Object)(object)item == (Object)null || (Object)(object)((Card)item).Info == (Object)null || !(((Object)((Card)item).Info).name == "OLD_SA_BROKEN_PELT")) { continue; } return true; } return false; } internal static bool HasHolyPeltInHand() { if ((Object)(object)Singleton.Instance == (Object)null) { return false; } foreach (PlayableCard item in Singleton.Instance.CardsInHand) { if ((Object)(object)item == (Object)null || (Object)(object)((Card)item).Info == (Object)null || !(((Object)((Card)item).Info).name == "OLD_SA_HOLY_PELT")) { continue; } return true; } return false; } } public class RainbowEmission : CardAppearanceBehaviour { public static Appearance ID; private static AssetBundle rainbowBundle; private static Material rainbowBaseMaterial; private Material originalMaterial; private Material rainbowMaterial; private static string BundlePath => Path.Combine(Paths.PluginPath, "OLD_SA_DLC", "OLD_SA_Card", "old_sa_rainbow"); private static bool LoadRainbowBundle() { if ((Object)(object)rainbowBaseMaterial != (Object)null) { return true; } if ((Object)(object)rainbowBundle == (Object)null) { if (!File.Exists(BundlePath)) { Debug.LogError((object)("[OLD SA Pelt] Rainbow AssetBundle not found: " + BundlePath)); return false; } rainbowBundle = AssetBundle.LoadFromFile(BundlePath); if ((Object)(object)rainbowBundle == (Object)null) { Debug.LogError((object)"[OLD SA Pelt] Failed to load Rainbow AssetBundle."); return false; } Debug.Log((object)"[OLD SA Pelt] Rainbow AssetBundle loaded."); } rainbowBaseMaterial = rainbowBundle.LoadAsset("assets/rainbowoilfilm_material.mat"); if ((Object)(object)rainbowBaseMaterial == (Object)null) { Debug.LogError((object)"[OLD SA Pelt] RainbowOilFilm_Material not found in AssetBundle."); return false; } Debug.Log((object)"[OLD SA Pelt] RainbowOilFilm_Material loaded."); Debug.Log((object)("[OLD SA Pelt] Shader = " + ((Object)rainbowBaseMaterial.shader).name)); return true; } public override void ApplyAppearance() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown if (!((Object)(object)((CardAppearanceBehaviour)this).Card == (Object)null) && !((Object)(object)((CardAppearanceBehaviour)this).Card.StatsLayer == (Object)null) && !((Object)(object)((CardAppearanceBehaviour)this).Card.StatsLayer.Material == (Object)null) && LoadRainbowBundle()) { originalMaterial = ((CardAppearanceBehaviour)this).Card.StatsLayer.Material; rainbowMaterial = new Material(rainbowBaseMaterial); ((CardAppearanceBehaviour)this).Card.StatsLayer.Material = rainbowMaterial; Debug.Log((object)"[OLD SA Pelt] Rainbow material applied to card."); } } public override void ManagedUpdate() { if (!((Object)(object)rainbowMaterial == (Object)null)) { } } public override void ResetAppearance() { if ((Object)(object)((CardAppearanceBehaviour)this).Card != (Object)null && (Object)(object)((CardAppearanceBehaviour)this).Card.StatsLayer != (Object)null && (Object)(object)originalMaterial != (Object)null) { ((CardAppearanceBehaviour)this).Card.StatsLayer.Material = originalMaterial; } if ((Object)(object)rainbowMaterial != (Object)null) { Object.Destroy((Object)(object)rainbowMaterial); rainbowMaterial = null; } originalMaterial = null; } } }