using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using DiskCardGame;
using InscryptionAPI.Card;
using InscryptionAPI.Helpers;
using InscryptionAPI.Pelts;
using Microsoft.CodeAnalysis;
using UnityEngine;
[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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("PerkPelts")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PerkPelts")]
[assembly: AssemblyTitle("PerkPelts")]
[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 PerkPelts
{
[BepInPlugin("Keks.Inscryption.PerkPelts", "PerkPelts", "0.0.1")]
public class Plugin : BaseUnityPlugin
{
internal const string PluginGUID = "Keks.Inscryption.PerkPelts";
internal const string PluginNAME = "PerkPelts";
internal const string PluginVERSION = "0.0.1";
public static string ModPrefix = "PerkPelt";
private void Awake()
{
addDraw1Bone();
addGen4Bone();
addCard();
addPelt();
}
private void addGen4Bone()
{
//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)
AbilityInfo val = AbilityManager.New("Keks.Inscryption.PerkPelts", "Fertilizer", "When [creature] is played, 4 Bones will be generated.", typeof(Gen4Bone), (Texture)(object)Tools.LoadTexture("ability_Fertilizer"));
val.powerLevel = 3;
val.metaCategories = new List<AbilityMetaCategory>
{
(AbilityMetaCategory)0,
(AbilityMetaCategory)1
};
val.canStack = false;
val.opponentUsable = false;
Gen4Bone.ability = val.ability;
}
private void addDraw1Bone()
{
//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)
AbilityInfo val = AbilityManager.New("Keks.Inscryption.PerkPelts", "Draw Bone", "When [creature] is drawn, a Bone will be generated.", typeof(Draw1Bone), (Texture)(object)Tools.LoadTexture("ability_BoneDraw"));
val.powerLevel = 2;
val.metaCategories = new List<AbilityMetaCategory>
{
(AbilityMetaCategory)0,
(AbilityMetaCategory)1
};
val.canStack = false;
val.opponentUsable = false;
Draw1Bone.ability = val.ability;
}
private void addPelt()
{
Tools.AddPeltToManager(Tools.CreatePeltCard(ModPrefix, "PerkToken", "Perk Rat", "PerkRatBase", "Empty", 2, 2, 2, 0, 0, null, new List<Ability>(), new List<SpecialTriggeredAbility>(), new List<Appearance> { (Appearance)6 }), "PerkRat", 4, 0, 8);
Tools.AddPeltToManager(Tools.CreatePeltCard(ModPrefix, "PerkBase", "Perk Tree", "TreeBase", "Empty", 1, 1, 0, 3, 0, null, new List<Ability>(), new List<SpecialTriggeredAbility>(), new List<Appearance> { (Appearance)6 }), "PerkTree", 3, 0, 8);
}
private void addCard()
{
//IL_044f: Unknown result type (might be due to invalid IL or missing references)
//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
Tools.CreateCard(ModPrefix, "PerkRatOneBlood", "Stunted Rat", "PerkRatOneBlood", "PerkRatEmission", 2, 2, 1, 0, 0, null, new List<Ability>(), new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "BloodDecalSacRat", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkRatBall", "Shedding Rat", "PerkRatBall", "PerkRatEmission", 2, 2, 2, 0, 0, null, new List<Ability> { (Ability)46 }, new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe> { (Tribe)1 }, new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "PerkRatDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkRatBloodPower", "Bloody Rat", "PerkRatBloodPower", "PerkRatEmission", 0, 4, 2, 0, 0, null, new List<Ability>(), new List<SpecialTriggeredAbility> { (SpecialTriggeredAbility)26 }, new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)7, "BloodDecalOneRat", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkRatBones", "Marrow Rat", "PerkRatBones", "PerkRatEmission", 2, 2, 0, 3, 0, null, new List<Ability>(), new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "PerkRatDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkRatDigger", "Digging Rat", "PerkRatDigger", "PerkRatEmission", 2, 4, 2, 0, 0, null, new List<Ability> { (Ability)28 }, new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "SmokeDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkRatItem", "Packing Rat", "PerkRatItem", "PerkRatEmission", 2, 3, 2, 0, 0, null, new List<Ability> { (Ability)29 }, new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "PerkRatDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkRatLooter", "Orlus Rat", "PerkRatLooter", "PerkRatEmission", 2, 2, 2, 0, 0, null, new List<Ability> { (Ability)79 }, new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "PerkRatDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkRatStatic", "Corrupted Rat", "PerkRatStatic", "PerkRatEmission", 6, 6, 0, 6, 0, null, new List<Ability>(), new List<SpecialTriggeredAbility> { (SpecialTriggeredAbility)7 }, new List<Trait>(), new List<Tribe>(), new List<Appearance>
{
(Appearance)15,
(Appearance)14,
(Appearance)7
}, (SpecialStatIcon)0, "PerkRatDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkTreeApple", "Apple Tree", "TreeApple", "BoneTreeEmission", 1, 3, 0, 3, 0, null, new List<Ability> { (Ability)103 }, new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "PerkTreeDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkTreeChopped", "Chopped Tree", "TreeShopped", "BoneTreeEmission", 1, 1, 0, 1, 0, null, new List<Ability>(), new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "PerkTreeDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkTreeSquirrel", "Drey Tree", "TreeSquirrel", "BoneTreeEmission", 1, 1, 0, 3, 0, null, new List<Ability> { (Ability)46 }, new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe> { (Tribe)1 }, new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "PerkTreeDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkTreeVitalised", "Vitalised Tree", "TreeSnatched", "SnatchTreeEmission", 2, 2, 0, 3, 0, null, new List<Ability>(), new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "Infection_Decal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkTreeLone", "Lone Tree", "TreeLone", "BoneTreeEmission", 1, 1, 0, 3, 0, null, new List<Ability> { Draw1Bone.ability }, new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "PerkTreeDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkTreeEnchanted", "Enchanted Tree", "TreeBone", "BoneTreeEmission", 1, 1, 0, 3, 0, null, new List<Ability> { Gen4Bone.ability }, new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "SmokeDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkTreeHaunted", "Haunted Tree", "TreeHaunted", "BoneTreeEmission", 1, 1, 0, 3, 0, null, new List<Ability> { (Ability)45 }, new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "SmokeDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
Tools.CreateCard(ModPrefix, "PerkTreeSapling", "Young Tree", "TreeSapling", "Empty", 1, 1, 0, 3, 0, null, new List<Ability>
{
(Ability)9,
(Ability)31
}, new List<SpecialTriggeredAbility>(), new List<Trait>(), new List<Tribe>(), new List<Appearance> { (Appearance)7 }, (SpecialStatIcon)0, "PerkTreeDecal", appearChoiceNode: false, appearTrader: false, Rare: false, (CardTemple)0);
}
}
public class Tools
{
public static Assembly _assembly;
public static Assembly CurrentAssembly => _assembly ?? (_assembly = Assembly.GetExecutingAssembly());
public static Texture2D LoadTexture(string name)
{
if (name == null)
{
return null;
}
return TextureHelper.GetImageAsTexture(name + (name.EndsWith(".png") ? "" : ".png"), CurrentAssembly, (FilterMode)0);
}
public static void AddPeltToManager(CardInfo info, string Name, int baseBuyPrice = 5, int extraAbilities = 0, int choiceAmount = 4)
{
PeltManager.New("Keks.Inscryption.PerkPelts", info, baseBuyPrice, extraAbilities, choiceAmount, (Func<List<CardInfo>>)(() => CardManager.AllCardsCopy.FindAll((CardInfo a) => ((Object)a).name.Contains(Name))));
}
public static CardInfo CreatePeltCard(string modPrefix, string internalName, string displayName, string imageName, string imageEmissiveName, int attack = 0, int health = 1, int bloodCost = 0, int bonesCost = 0, int energyCost = 0, List<GemType> gemsCost = null, List<Ability> abilities = null, List<SpecialTriggeredAbility> specialAbilities = null, List<Appearance> appearances = null, string decalName = null, bool Rare = false)
{
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
CardInfo val = CardExtensions.SetPortraitAndEmission(CardManager.New(modPrefix, internalName, displayName, attack, health, (string)null), LoadTexture(imageName), LoadTexture(imageEmissiveName), (FilterMode?)null);
if (decalName != null)
{
CardExtensions.AddDecal(val, (Texture[])(object)new Texture[1] { (Texture)LoadTexture(decalName) });
}
val.cardComplexity = (CardComplexity)1;
CardExtensions.SetCost(val, (int?)bloodCost, (int?)bonesCost, (int?)energyCost, gemsCost);
CardExtensions.AddTraits(val, (Trait[])(object)new Trait[1] { (Trait)13 });
val.temple = (CardTemple)0;
val.abilities = abilities;
val.specialAbilities = specialAbilities;
CardExtensions.AddSpecialAbilities(val, (SpecialTriggeredAbility[])(object)new SpecialTriggeredAbility[1] { (SpecialTriggeredAbility)27 });
val.appearanceBehaviour = appearances;
CardExtensions.AddAppearances(val, (Appearance[])(object)new Appearance[1] { (Appearance)2 });
if (Rare)
{
CardExtensions.AddAppearances(val, (Appearance[])(object)new Appearance[1] { (Appearance)6 });
}
CardManager.Add(modPrefix, val);
return val;
}
public static CardInfo CreateCard(string modPrefix, string internalName, string displayName, string imageName, string imageEmissiveName, int attack = 0, int health = 1, int bloodCost = 0, int bonesCost = 0, int energyCost = 0, List<GemType> gemsCost = null, List<Ability> abilities = null, List<SpecialTriggeredAbility> specialAbilities = null, List<Trait> traits = null, List<Tribe> tribes = null, List<Appearance> appearances = null, SpecialStatIcon icon = 0, string decalName = null, bool appearChoiceNode = true, bool appearTrader = true, bool Rare = false, CardTemple temple = 0)
{
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Invalid comparison between Unknown and I4
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
CardInfo val = CardExtensions.SetCost(CardExtensions.SetPortraitAndEmission(CardManager.New(modPrefix, internalName, displayName, attack, health, (string)null), LoadTexture(imageName), LoadTexture(imageEmissiveName), (FilterMode?)null), (int?)bloodCost, (int?)bonesCost, (int?)energyCost, gemsCost);
if (decalName != null)
{
CardExtensions.AddDecal(val, (Texture[])(object)new Texture[1] { (Texture)LoadTexture(decalName) });
}
val.abilities = abilities;
val.specialAbilities = specialAbilities;
if ((int)icon > 0)
{
CardExtensions.SetStatIcon(val, icon);
}
val.traits = traits;
val.tribes = tribes;
val.appearanceBehaviour = appearances;
if (appearChoiceNode)
{
CardExtensions.AddMetaCategories(val, (CardMetaCategory[])(object)new CardMetaCategory[1]);
}
if (appearTrader)
{
CardExtensions.AddMetaCategories(val, (CardMetaCategory[])(object)new CardMetaCategory[1] { (CardMetaCategory)1 });
}
if (Rare)
{
CardExtensions.AddMetaCategories(val, (CardMetaCategory[])(object)new CardMetaCategory[1] { (CardMetaCategory)3 });
CardExtensions.AddAppearances(val, (Appearance[])(object)new Appearance[1] { (Appearance)7 });
}
val.temple = temple;
CardManager.Add(modPrefix, val);
return val;
}
}
public class Draw1Bone : AbilityBehaviour
{
public static Ability ability;
public override Ability Ability => ability;
public override IEnumerator OnDrawn()
{
yield return Singleton<ResourcesManager>.Instance.AddBones(1, (CardSlot)null);
}
public override bool RespondsToDrawn()
{
return true;
}
}
public class Gen4Bone : AbilityBehaviour
{
public static Ability ability;
public override Ability Ability => ability;
public override IEnumerator OnPlayFromHand()
{
yield return Singleton<ResourcesManager>.Instance.AddBones(4, (CardSlot)null);
}
public override bool RespondsToPlayFromHand()
{
return true;
}
}
}