Decompiled source of Genshin Impact Mod v0.2.2
GenshinMod.dll
Decompiled 10 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using DigitalRuby.LightningBolt; using DiskCardGame; using HarmonyLib; using Infiniscryption.PackManagement; using InscryptionAPI.Ascension; using InscryptionAPI.Card; using InscryptionAPI.Guid; using InscryptionAPI.Helpers; using InscryptionAPI.Helpers.Extensions; using InscryptionAPI.Sound; using Microsoft.CodeAnalysis; using Pixelplacement; using SpritesheetAPI; using SpritesheetAPI.JSONData; 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("GenshinMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("GenshinMod' cards")] [assembly: AssemblyFileVersion("0.2.1.0")] [assembly: AssemblyInformationalVersion("0.2.1")] [assembly: AssemblyProduct("GenshinMod")] [assembly: AssemblyTitle("GenshinMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.2.1.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 GenshinMod { [BepInPlugin("pdd.Genshin", "GenshinMod", "0.2.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public class LogoAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("logo.png", (FilterMode)0); ((CardAppearanceBehaviour)this).Card.Info.TempDecals.Clear(); ((CardAppearanceBehaviour)this).Card.Info.TempDecals.Add((Texture)(object)imageAsTexture); ((CardAppearanceBehaviour)this).Card.RenderInfo.forceEmissivePortrait = true; } } private Harmony harmony = new Harmony("pdd.Genshin"); private const string PluginGuid = "pdd.Genshin"; private const string PluginName = "GenshinMod"; private const string PluginVersion = "0.2.1"; private const string PluginPrefix = "GenshinMod"; public static string Directory; public static Tribe wu_tribe; public static int randomSeed; public static float StartingFixedDeltaTime; public static List<Sprite> art_sprites; public static readonly Appearance AP = CardAppearanceBehaviourManager.Add("pdd.Genshin", "Spritesheet Animator", typeof(SpritesheetBehaviour)).Id; public static readonly Appearance LogoAppearance = CardAppearanceBehaviourManager.Add("pdd.Genshin", "LogoAppearance", typeof(LogoAppearanceBehaviour)).Id; private void AddGrass_seeds() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected I4, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected I4, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected I4, but got Unknown CardInfo val = CardExtensions.AddAppearances(CardExtensions.AddAbilities(CardExtensions.SetCost(CardManager.New("GenshinMod", "Grass_seeds", "草种子", 0, 1, "小心爆炸"), (int?)0, (int?)0, (int?)0, (List<GemType>)null), (Ability[])(object)new Ability[1] { (Ability)(int)Grassseeds.ability }), (Appearance[])(object)new Appearance[2] { (Appearance)(int)LogoAppearance, (Appearance)(int)GuidManager.GetEnumValue<Appearance>("spapi.inscryption.coloredportraits", "ColoredPortrait") }); CardManager.Add("GenshinMod", val); } private void AddAymxzs() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Aymxzs", "雷电将军汇聚万千真言,竭尽诸愿百眼之愿力,斩出粉碎一切诅咒的梦想一刀,造成雷元素范围伤害;并在接下来的一段时间内,为自身附加雷元素附魔", typeof(Aymxzs), (Texture)(object)Asset.LoadIcon("Ay_mxzs"))); val.canStack = false; val.passive = false; val.activated = true; val.opponentUsable = false; val.powerLevel = 5; val.rulebookName = "奥义·梦想真说"; Aymxzs.ability = val.ability; } private void Addleishen() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected I4, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected I4, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected I4, but got Unknown CardInfo val = CardExtensions.AddAppearances(CardExtensions.AddMetaCategories(CardExtensions.AddDecal(CardExtensions.AddAbilities(CardExtensions.SetCost(CardExtensions.SetPixelPortrait(CardExtensions.SetPortrait(CardManager.New("GenshinMod", "leishen", "雷电将军", 1, 2, "那里很早就有了风雨和雷电,有了天光与大海……有了“雷电将军”。"), Asset.LoadPortrait("leishen"), (FilterMode?)null), Asset.Loadpixel("leishen"), (FilterMode?)null), (int?)1, (int?)0, (int?)0, (List<GemType>)null), (Ability[])(object)new Ability[2] { (Ability)(int)Sbeyky1.ability, (Ability)(int)Aymxzs.ability }), (Texture[])(object)new Texture[1] { (Texture)Asset.LoadPortrait("logo") }), (CardMetaCategory[])(object)new CardMetaCategory[1] { (CardMetaCategory)3 }), (Appearance[])(object)new Appearance[1] { (Appearance)(int)GuidManager.GetEnumValue<Appearance>("spapi.inscryption.coloredportraits", "ColoredPortrait") }); CardManager.Add("GenshinMod", val); } private void AddleishenE() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected I4, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected I4, but got Unknown CardInfo val = CardExtensions.SetExtendedProperty(CardExtensions.AddAppearances(CardExtensions.SetCost(CardExtensions.SetPortrait(CardManager.New("GenshinMod", "leishenE", "", 2, 4, "那里很早就有了风雨和雷电,有了天光与大海……有了“雷电将军”。"), Asset.LoadPortrait("leishen"), (FilterMode?)null), (int?)0, (int?)0, (int?)0, (List<GemType>)null), (Appearance[])(object)new Appearance[2] { (Appearance)(int)GuidManager.GetEnumValue<Appearance>("spapi.inscryption.coloredportraits", "ColoredPortrait"), (Appearance)(int)GuidManager.GetEnumValue<Appearance>("spapi.inscryption.configemissions", "ConfigurableBackground") }), "customBackground", (object)"tm.png"); CardManager.Add("GenshinMod", val); val.hideAttackAndHealth = true; } private void AddleishenQ() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected I4, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected I4, but got Unknown CardInfo val = CardExtensions.SetExtendedProperty(CardExtensions.AddAppearances(CardExtensions.SetCost(CardExtensions.SetPortrait(CardManager.New("GenshinMod", "leishenQ", "", 2, 4, "那里很早就有了风雨和雷电,有了天光与大海……有了“雷电将军”。"), Asset.LoadPortrait("leishen"), (FilterMode?)null), (int?)0, (int?)0, (int?)0, (List<GemType>)null), (Appearance[])(object)new Appearance[2] { (Appearance)(int)GuidManager.GetEnumValue<Appearance>("spapi.inscryption.coloredportraits", "ColoredPortrait"), (Appearance)(int)GuidManager.GetEnumValue<Appearance>("spapi.inscryption.configemissions", "ConfigurableBackground") }), "customBackground", (object)"tm.png"); CardManager.Add("GenshinMod", val); val.hideAttackAndHealth = true; } private void AddSbeyky1() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Sbeyky1", "【消耗1骨头激活】雷电将军展开净土的一角,对周围的敌人造成雷元素伤害,为队伍中附近的所有角色授以雷罚恶曜之眼。", typeof(Sbeyky1), (Texture)(object)Asset.LoadIcon("Sb_eyky1"))); val.canStack = false; val.passive = false; val.activated = true; val.opponentUsable = false; val.powerLevel = 5; val.rulebookName = "神变·恶曜开眼"; Sbeyky1.ability = val.ability; } private void AddSbeyky2() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Sbeyky2", "获授雷罚恶曜之眼的角色的攻击对敌人造成伤害时,雷罚恶曜之眼会进行协同攻击,在敌人的位置造成雷元素伤害。", typeof(Sbeyky2), (Texture)(object)Asset.LoadIcon("sb_eyky2"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 5; val.rulebookName = "雷罚恶曜之眼"; Sbeyky2.ability = val.ability; } private void Addxingqiu() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected I4, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected I4, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected I4, but got Unknown CardInfo val = CardExtensions.AddAppearances(CardExtensions.AddMetaCategories(CardExtensions.AddDecal(CardExtensions.AddAbilities(CardExtensions.SetCost(CardExtensions.SetPixelPortrait(CardExtensions.SetPortrait(CardManager.New("GenshinMod", "xingqiu", "行秋", 1, 2, "偷得浮生半日闲"), Asset.LoadPortrait("xingqiu"), (FilterMode?)null), Asset.Loadpixel("xingqiu"), (FilterMode?)null), (int?)1, (int?)0, (int?)0, (List<GemType>)null), (Ability[])(object)new Ability[2] { (Ability)(int)xingqiu_yszj.ability, (Ability)(int)xingqiu_ysbf.ability }), (Texture[])(object)new Texture[1] { (Texture)Asset.LoadPortrait("logo") }), (CardMetaCategory[])(object)new CardMetaCategory[2] { default(CardMetaCategory), (CardMetaCategory)1 }), (Appearance[])(object)new Appearance[1] { (Appearance)(int)GuidManager.GetEnumValue<Appearance>("spapi.inscryption.coloredportraits", "ColoredPortrait") }); CardManager.Add("GenshinMod", val); } private void AddxingqiuQ() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected I4, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected I4, but got Unknown CardInfo val = CardExtensions.SetExtendedProperty(CardExtensions.AddAppearances(CardExtensions.SetCost(CardExtensions.SetPortrait(CardManager.New("GenshinMod", "xingqiuQ", "", 2, 4, "行秋喵"), Asset.LoadPortrait("xingqiu"), (FilterMode?)null), (int?)0, (int?)0, (int?)0, (List<GemType>)null), (Appearance[])(object)new Appearance[2] { (Appearance)(int)GuidManager.GetEnumValue<Appearance>("spapi.inscryption.coloredportraits", "ColoredPortrait"), (Appearance)(int)GuidManager.GetEnumValue<Appearance>("spapi.inscryption.configemissions", "ConfigurableBackground") }), "customBackground", (object)"tm.png"); CardManager.Add("GenshinMod", val); val.hideAttackAndHealth = true; } private void Addxingqiu_ysbf() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "xingqiu_ysbf", "【消耗4能量激活】为自身附加【雨帘剑】", typeof(xingqiu_ysbf), (Texture)(object)Asset.LoadIcon("xingqiu_ysbf"))); val.canStack = false; val.passive = false; val.activated = true; val.opponentUsable = false; val.powerLevel = 3; val.rulebookName = "古华剑·裁雨留虹"; xingqiu_ysbf.ability = val.ability; } private void Addxingqiu_yszj() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "xingqiu_yszj", "【消耗1骨头激活】对对面的卡牌造成基于自身攻击力的水元素伤害", typeof(xingqiu_yszj), (Texture)(object)Asset.LoadIcon("xingqiu_yszj"))); val.canStack = false; val.passive = false; val.activated = true; val.opponentUsable = false; val.powerLevel = 2; val.rulebookName = "古华剑·画雨笼山"; xingqiu_yszj.ability = val.ability; } private void Addxingqiu_ysbf_ylj() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "xingqiu_ysbf_ylj", "行秋会为他与他两侧的卡牌提供1点伤害减免,并使他们在受到伤害时回复1点生命值。当其他角色发动攻击时,雨帘剑会协同友军对其目标卡牌进行攻击,造成基于自身攻击力的伤害", typeof(xingqiu_ysbf_ylj), (Texture)(object)Asset.LoadIcon("xingqiu_ysbf_ylj"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 2; val.rulebookName = "雨帘剑"; xingqiu_ysbf_ylj.ability = val.ability; } private void CreatePack() { PackInfo packInfo = PackManager.GetPackInfo("GenshinMod"); packInfo.Title = "原神模组"; packInfo.Description = "众所周知,你可以在各种各样的地方启动原神,哪怕这里也不例外。有bug请在QQ群或B站私信向我反馈"; packInfo.SetTexture(Asset.LoadTexture("pack")); packInfo.ValidFor.Add((PackMetacategory)0); packInfo.SplitPackByCardTemple = false; } private void Awake() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown Directory = ((BaseUnityPlugin)this).Info.Location.Replace("GenshinMod.dll", ""); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded GenshinMod!"); Harmony val = new Harmony("pdd.Genshin"); val.PatchAll(typeof(Plugin)); val.PatchAll(typeof(TakeDamagePatch)); val.PatchAll(typeof(AudioHelper)); Addfire(); Addwater(); Addice(); Addthunder(); AddSuperconducting(); Addgrass(); AddBurn(); AddGrassseeds(); AddAdddfire(); AddAdddgrass(); AddAdddice(); AddAdddrock(); AddAdddthunder(); AddAdddwater(); AddAdddwind(); AddSbeyky1(); AddSbeyky2(); AddAymxzs(); Addxingqiu_ysbf_ylj(); Addxingqiu_ysbf(); Addxingqiu_yszj(); AddGrass_seeds(); Addleishen(); AddleishenE(); AddleishenQ(); Addxingqiu(); AddxingqiuQ(); RegisterPortrait.Add("GenshinMod_leishen", "leishen_Spritesheet.png", 24, 89, false, 0f); Register.Add("GenshinMod_leishenE", "leishen_SpritesheetE.png", 33, 40, HasPause: false, 1f); Register.Add("GenshinMod_leishenQ", "leishen_SpritesheetQ.png", 12, 40, HasPause: false, 1f); RegisterPortrait.Add("GenshinMod_xingqiu", "xingqiu_Spritesheet.png", 33, 204, false, 0f); Register.Add("GenshinMod_xingqiuQ", "xingqiu_SpritesheetQ.png", 24, 53, HasPause: false, 1f); StarterDeckInfo val2 = ScriptableObject.CreateInstance<StarterDeckInfo>(); val2.title = "雷电将军"; val2.iconSprite = TextureHelper.GetImageAsSprite("deck_thunder.png", (SpriteType)9, (FilterMode)0); val2.cards = new List<CardInfo> { CardLoader.GetCardByName("GenshinMod_leishen"), CardLoader.GetCardByName("RingWorm"), CardLoader.GetCardByName("GenshinMod_xingqiu") }; StarterDeckManager.Add("pdd.Genshin", val2, 0); } public static CardModificationInfo CreateModForFreeze(PlayableCard playableCard) { //IL_001d: 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_0049: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown int num = ((playableCard.Attack != 0) ? (-playableCard.Attack) : 0); CardModificationInfo val = new CardModificationInfo(num, 1 - playableCard.Health) { negateAbilities = new List<Ability> { (Ability)83, (Ability)13, (Ability)55 } }; if (CardExtensions.LacksAbility(playableCard, (Ability)26)) { val.abilities = new List<Ability> { (Ability)26, Ice_cling.ability }; ((Card)playableCard).Info.iceCubeParams = new IceCubeParams { creatureWithin = ((Card)playableCard).Info }; ((Card)playableCard).RenderCard(); } return val; } public static CardModificationInfo CreateModBreakFreeze(PlayableCard playableCard) { //IL_001d: 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_0037: Expected O, but got Unknown int num = ((playableCard.Attack != 0) ? (-playableCard.Attack) : 0); CardModificationInfo result = new CardModificationInfo(num, 1 - playableCard.Health) { negateAbilities = new List<Ability> { (Ability)26 } }; ((Card)playableCard).RenderCard(); return result; } private void AddBurn() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Burn", "该单位正在被灼烧,每回合扣1点血(可叠加)", typeof(Burn), (Texture)(object)Asset.LoadIcon("burn"))); val.canStack = true; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = -2; val.rulebookName = "燃烧"; Burn.ability = val.ability; } private void AddAdddfire() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Adddfire", "这张卡牌攻击时会为敌方卡牌附加火元素附着", typeof(Adddfire), (Texture)(object)Asset.LoadIcon("Addd_fire"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 2; val.rulebookName = "火元素附魔"; Adddfire.ability = val.ability; } private void AddAdddgrass() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Adddgrass", "这张卡牌攻击时会为敌方卡牌附加草元素附着", typeof(Adddgrass), (Texture)(object)Asset.LoadIcon("Addd_grass"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 2; val.rulebookName = "草元素附魔"; Adddgrass.ability = val.ability; } private void AddAdddice() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Adddice", "这张卡牌攻击时会为敌方卡牌附加冰元素附着", typeof(Adddice), (Texture)(object)Asset.LoadIcon("Addd_ice"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 2; val.rulebookName = "冰元素附魔"; Adddice.ability = val.ability; } private void AddAdddrock() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Adddrock", "这张卡牌攻击时会为敌方卡牌附造成岩元素伤害", typeof(Adddrock), (Texture)(object)Asset.LoadIcon("Addd_rock"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 2; val.rulebookName = "岩元素附魔"; Adddrock.ability = val.ability; } private void AddAdddthunder() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Adddthunder", "这张卡牌攻击时会为敌方卡牌附加雷元素附着", typeof(Adddthunder), (Texture)(object)Asset.LoadIcon("Addd_thunder"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 2; val.rulebookName = "雷元素附魔"; Adddthunder.ability = val.ability; } private void AddAdddwater() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Adddwater", "这张卡牌攻击时会为敌方卡牌附加水元素附着", typeof(Adddwater), (Texture)(object)Asset.LoadIcon("Addd_water"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 2; val.rulebookName = "水元素附魔"; Adddwater.ability = val.ability; } private void AddAdddwind() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Adddwind", "这张卡牌攻击时会对敌方卡牌造成风元素伤害", typeof(Adddwind), (Texture)(object)Asset.LoadIcon("Addd_wind"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 2; val.rulebookName = "风元素附魔"; Adddwind.ability = val.ability; } private void Addfire() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "fire", "该单位具有火元素附着,尝试让其它元素与之反应以触发强力效果,2回合后附着消失", typeof(Fire_cling), (Texture)(object)Asset.LoadIcon("fire"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 0; val.rulebookName = "火元素附着"; Fire_cling.ability = val.ability; } private void Addgrass() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "grass", "该单位具有草元素附着,尝试让其它元素与之反应以触发强力效果,2回合后附着消失", typeof(grass_cling), (Texture)(object)Asset.LoadIcon("grass"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 0; val.rulebookName = "草元素附着"; grass_cling.ability = val.ability; } private void Addice() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "ice", "该单位具有冰元素附着,尝试让其它元素与之反应以触发强力效果,2回合后附着消失", typeof(Ice_cling), (Texture)(object)Asset.LoadIcon("ice"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 0; val.rulebookName = "冰元素附着"; Ice_cling.ability = val.ability; } private void AddGrassseeds() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Grassseeds", "这是个草种子", typeof(Grassseeds), (Texture)(object)Asset.LoadIcon("grassseeds"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = false; val.powerLevel = 7; val.rulebookName = "草种子"; Grassseeds.ability = val.ability; } private void AddSuperconducting() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "Superconducting", "拥有该印记的卡牌会受到额外2点伤害", typeof(Superconducting), (Texture)(object)Asset.LoadIcon("superconducting"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = -2; val.rulebookName = "超导"; Superconducting.ability = val.ability; } private void Addthunder() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "thunder", "该单位具有雷元素附着,尝试让其它元素与之反应以触发强力效果,2回合后附着消失", typeof(thunder_cling), (Texture)(object)Asset.LoadIcon("thunder"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 0; val.rulebookName = "雷元素附着"; thunder_cling.ability = val.ability; } private void Addwater() { //IL_005e: 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) AbilityInfo val = AbilityExtensions.SetDefaultPart1Ability(AbilityManager.New("pdd.Genshin", "water", "该单位具有水元素附着,尝试让其它元素与之反应以触发强力效果,2回合后附着消失", typeof(Water_cling), (Texture)(object)Asset.LoadIcon("water"))); val.canStack = false; val.passive = false; val.activated = false; val.opponentUsable = true; val.powerLevel = 0; val.rulebookName = "水元素附着"; Water_cling.ability = val.ability; } } public class Aymxzs : ActivatedAbilityBehaviour { public static Ability ability; public const string leishen_q1_SOUND = "leishen_q1"; public const string leishen_q2_SOUND = "leishen_q2"; public const string leishen_q3_SOUND = "leishen_q3"; public string leishen_q_SOUND; public int a; public override Ability Ability => ability; public override int EnergyCost => 6; public override IEnumerator Activate() { Random random = new Random(); a = random.Next(3); if (a == 0) { leishen_q_SOUND = "leishen_q1"; } if (a == 1) { leishen_q_SOUND = "leishen_q2"; } if (a == 2) { leishen_q_SOUND = "leishen_q3"; } Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.15f); get get2 = new get(); _ = ((AbilityBehaviour)this).Card.Slot.opposingSlot.Card; PlayableCard playableCard = ((AbilityBehaviour)this).Card; CardSlot basecardslot = ((AbilityBehaviour)this).Card.Slot; bool flag = basecardslot.Card.HasAbility(Sbeyky2.ability); yield return get2.getart(basecardslot, "GenshinMod_leishen", "GenshinMod_leishenQ", leishen_q_SOUND, 2.4f); yield return get2.getsigil(basecardslot.Card, Adddthunder.ability, "Adddthunder", "雷元素附魔", 2); if (flag) { yield return get2.getsigil(basecardslot.Card, Sbeyky2.ability, "Sbeyky2", "雷罚恶曜之眼", 2); } List<PlayableCard> cards = new List<PlayableCard>(); cards.AddRange(Singleton<BoardManager>.Instance.CardsOnBoard.FindAll((PlayableCard x) => Object.op_Implicit((Object)(object)x) != playableCard.OpponentCard && !x.Dead)); if (cards.Count > 0) { for (int i = cards.Count - 1; i >= 0; i--) { if (cards[i].OpponentCard) { yield return get2.getgetthunder(basecardslot.Card, cards[i]); if (!cards[i].Dead) { yield return get2.ShockCard(cards[i], basecardslot.Card, basecardslot.Card.Attack, 1.0); } } } } ((Card)basecardslot.Card).Anim.LightNegationEffect(); Singleton<ViewManager>.Instance.SwitchToView((View)0, false, false); Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0; yield return (object)new WaitForSeconds(0.15f); } } public class Sbeyky1 : ActivatedAbilityBehaviour { public static Ability ability; public const string leishen_e1_SOUND = "leishen_e1"; public const string leishen_e2_SOUND = "leishen_e2"; public const string leishen_e3_SOUND = "leishen_e3"; public string leishen_e_SOUND; public int a; public override Ability Ability => ability; public override int BonesCost => 1; public override IEnumerator Activate() { Random random = new Random(); a = random.Next(3); if (a == 0) { leishen_e_SOUND = "leishen_e1"; } if (a == 1) { leishen_e_SOUND = "leishen_e2"; } if (a == 2) { leishen_e_SOUND = "leishen_e3"; } Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.15f); get get2 = new get(); PlayableCard card = ((AbilityBehaviour)this).Card.Slot.opposingSlot.Card; _ = ((AbilityBehaviour)this).Card; CardSlot basecardslot = ((AbilityBehaviour)this).Card.Slot; bool flag = basecardslot.Card.HasAbility(Adddthunder.ability); yield return get2.getart(basecardslot, "GenshinMod_leishen", "GenshinMod_leishenE", leishen_e_SOUND, 0.7f); yield return get2.getsigil(basecardslot.Card, Sbeyky2.ability, "Sbeyky2", "雷罚恶曜之眼", 2); if (flag) { yield return get2.getsigil(basecardslot.Card, Adddthunder.ability, "Adddthunder", "雷元素附魔", 2); } if ((Object)(object)card != (Object)null && card.Health > 0) { yield return get2.getgetthunder(basecardslot.Card, card); yield return get2.ShockCard(card, basecardslot.Card, basecardslot.Card.Attack, 0.5); yield return Singleton<ResourcesManager>.Instance.AddMaxEnergy(2); yield return Singleton<ResourcesManager>.Instance.AddEnergy(2); } else { ((Card)basecardslot.Card).Anim.LightNegationEffect(); Singleton<ViewManager>.Instance.SwitchToView((View)0, false, false); Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0; } } } public class Sbeyky2 : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Sbeyky2", "雷罚恶曜之眼"); } public override bool RespondsToOtherCardDealtDamage(PlayableCard attacker, int amount, PlayableCard target) { return true; } public override IEnumerator OnOtherCardDealtDamage(PlayableCard attacker, int amount, PlayableCard target) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); List<CardSlot> cardsToHelp = BoardManagerExtensions.GetSlotsCopy(Singleton<BoardManager>.Instance, !((AbilityBehaviour)this).Card.OpponentCard).FindAll((CardSlot slot) => (Object)(object)slot.Card != (Object)null); cardsToHelp.RemoveAll((CardSlot x) => (Object)(object)x.Card == (Object)(object)((AbilityBehaviour)this).Card); CardSlot slotSaved = ((AbilityBehaviour)this).Card.slot; foreach (CardSlot slot2 in cardsToHelp) { if ((Object)(object)slot2 != (Object)null && (Object)(object)slot2.Card != (Object)null && (Object)(object)slot2.Card == (Object)(object)attacker && !target.Dead && !target.InOpponentQueue) { get get2 = new get(); yield return get2.getgetthunder(((AbilityBehaviour)this).Card, target); yield return (object)new WaitForSeconds(0.1f); yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return ((AbilityBehaviour)this).LearnAbility(0.4f); if (!target.Dead) { yield return Singleton<CombatPhaseManager>.Instance.SlotAttackSlot(slotSaved, target.slot, 0f); } yield return Singleton<ResourcesManager>.Instance.AddMaxEnergy(1); yield return Singleton<ResourcesManager>.Instance.AddEnergy(1); yield return (object)new WaitForSeconds(0.1f); } } Singleton<ViewManager>.Instance.SwitchToView((View)0, false, false); Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0; yield return ((AbilityBehaviour)this).LearnAbility(0.1f); } } public class xingqiu_ysbf : ActivatedAbilityBehaviour { public static Ability ability; public const string xingqiu_ysbf1_SOUND = "xingqiu_q1"; public const string xingqiu_ysbf2_SOUND = "xingqiu_q2"; public const string xingqiu_ysbf3_SOUND = "xingqiu_q3"; public string xingqiu_ysbf_SOUND; public int a; public override Ability Ability => ability; public override int EnergyCost => 4; public override IEnumerator Activate() { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return ((AbilityBehaviour)this).LearnAbility(0.4f); Random random = new Random(); a = random.Next(3); if (a == 0) { xingqiu_ysbf_SOUND = "xingqiu_q1"; } if (a == 1) { xingqiu_ysbf_SOUND = "xingqiu_q2"; } if (a == 2) { xingqiu_ysbf_SOUND = "xingqiu_q3"; } Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.15f); get get2 = new get(); _ = ((AbilityBehaviour)this).Card.Slot.opposingSlot.Card; _ = ((AbilityBehaviour)this).Card; CardSlot basecardslot = ((AbilityBehaviour)this).Card.Slot; yield return get2.getart(basecardslot, "GenshinMod_xingqiu", "GenshinMod_xingqiuQ", xingqiu_ysbf_SOUND, 0.7f); yield return get2.getsigil(basecardslot.Card, xingqiu_ysbf_ylj.ability, "xingqiu_ysbf_ylj", "雨帘剑", 2); ((Card)basecardslot.Card).Anim.LightNegationEffect(); Singleton<ViewManager>.Instance.SwitchToView((View)0, false, false); Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0; } } public class xingqiu_yszj : ActivatedAbilityBehaviour { public static Ability ability; public const string xingqiu_yszj1_SOUND = "xingqiu_e1"; public const string xingqiu_yszj2_SOUND = "xingqiu_e2"; public const string xingqiu_yszj3_SOUND = "xingqiu_e3"; public string xingqiu_yszj_SOUND; public int a; public override Ability Ability => ability; public override int BonesCost => 1; public override IEnumerator Activate() { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return ((AbilityBehaviour)this).LearnAbility(0.4f); Random random = new Random(); a = random.Next(3); if (a == 0) { xingqiu_yszj_SOUND = "xingqiu_e1"; } if (a == 1) { xingqiu_yszj_SOUND = "xingqiu_e2"; } if (a == 2) { xingqiu_yszj_SOUND = "xingqiu_e3"; } Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.15f); get get2 = new get(); PlayableCard card = ((AbilityBehaviour)this).Card.Slot.opposingSlot.Card; PlayableCard playableCard = ((AbilityBehaviour)this).Card; CardSlot basecardslot = ((AbilityBehaviour)this).Card.Slot; yield return get2.getgetwater(playableCard, card); if ((Object)(object)card != (Object)null && card.Health > 0) { yield return (object)new WaitForSeconds(0.5f); AudioController.Instance.PlaySound3D(xingqiu_yszj_SOUND, (MixerGroup)5, ((Component)basecardslot.Card).transform.position, 1f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); yield return (object)new WaitForSeconds(0.5f); yield return get2.ShockCard(card, playableCard, playableCard.Attack, 0.5); } } } public class xingqiu_ysbf_ylj : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "xingqiu_ysbf_ylj", "雨帘剑"); } public override bool RespondsToOtherCardDealtDamage(PlayableCard attacker, int amount, PlayableCard target) { return true; } public override IEnumerator OnOtherCardDealtDamage(PlayableCard attacker, int amount, PlayableCard target) { get get2 = new get(); CardSlot basecardslot = ((AbilityBehaviour)this).Card.Slot; if (amount > 0 && CardExtensions.NotDead(target) && Singleton<BoardManager>.Instance.GetAdjacentSlots(((AbilityBehaviour)this).Card.Slot).Contains(target.Slot)) { if (target.Status.damageTaken > 0) { target.HealDamage(1); } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return ((AbilityBehaviour)this).LearnAbility(0.4f); } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); CardSlot toLeft = Singleton<BoardManager>.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, true); CardSlot toRight = Singleton<BoardManager>.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, false); if ((Object)(object)toLeft != (Object)null && (Object)(object)toLeft.Card != (Object)null && (Object)(object)toLeft.Card == (Object)(object)attacker && !target.Dead && !target.InOpponentQueue) { yield return get2.getgetwater(basecardslot.Card, target); yield return (object)new WaitForSeconds(0.1f); if (!target.Dead) { yield return target.TakeDamage(basecardslot.Card.Attack * 3 / 10 + 1, basecardslot.Card); yield break; } yield return Singleton<ResourcesManager>.Instance.AddMaxEnergy(1); yield return Singleton<ResourcesManager>.Instance.AddEnergy(1); yield return (object)new WaitForSeconds(0.1f); } else if ((Object)(object)toRight != (Object)null && (Object)(object)toRight.Card != (Object)null && (Object)(object)toRight.Card == (Object)(object)attacker && !target.Dead && !target.InOpponentQueue) { yield return get2.getgetwater(basecardslot.Card, target); yield return (object)new WaitForSeconds(0.1f); if (!target.Dead) { yield return target.TakeDamage(basecardslot.Card.Attack * 3 / 10 + 1, basecardslot.Card); yield break; } yield return Singleton<ResourcesManager>.Instance.AddMaxEnergy(1); yield return Singleton<ResourcesManager>.Instance.AddEnergy(1); yield return (object)new WaitForSeconds(0.1f); } else { yield return ((AbilityBehaviour)this).LearnAbility(0.1f); } } public override bool RespondsToTakeDamage(PlayableCard source) { return true; } public override IEnumerator OnTakeDamage(PlayableCard source) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.55f); if (((AbilityBehaviour)this).Card.Status.damageTaken > 0) { ((AbilityBehaviour)this).Card.HealDamage(1); } yield return ((AbilityBehaviour)this).LearnAbility(0.4f); } } internal class Asset { private static Assembly _assembly; public static Assembly CurrentAssembly => _assembly ?? (_assembly = Assembly.GetExecutingAssembly()); public static Texture2D LoadIcon(string name) { return TextureHelper.GetImageAsTexture(("ability_" + name + (name.EndsWith(".png") ? "" : ".png")).ToLowerInvariant(), CurrentAssembly, (FilterMode)0); } public static Texture2D LoadPortrait(string name) { return TextureHelper.GetImageAsTexture(("portrait_" + name + (name.EndsWith(".png") ? "" : ".png")).ToLowerInvariant(), CurrentAssembly, (FilterMode)0); } public static Texture2D Loadpixel(string name) { return TextureHelper.GetImageAsTexture(("pixel_" + name + (name.EndsWith(".png") ? "" : ".png")).ToLowerInvariant(), CurrentAssembly, (FilterMode)0); } public static Texture2D LoadEmission(string name) { return TextureHelper.GetImageAsTexture(("portrait_" + name + (name.EndsWith("_emission.png") ? "" : "_emission.png")).ToLowerInvariant(), CurrentAssembly, (FilterMode)0); } public static Texture2D LoadTexture(string name) { return TextureHelper.GetImageAsTexture(name + (name.EndsWith(".png") ? "" : ".png"), CurrentAssembly, (FilterMode)0); } public static Sprite LoadSprite(string name) { return TextureHelper.ConvertTexture(TextureHelper.GetImageAsTexture(name + (name.EndsWith(".png") ? "" : ".png"), CurrentAssembly, (FilterMode)0), (Vector2?)null); } } public static class AudioHelper { public struct AudioState { public int sourceNum; public string clipName; public float position; public bool isPlaying; public float volume; } [HarmonyPatch(typeof(AudioController), "Awake")] [HarmonyPostfix] internal static void LoadMyCustomAudio(ref AudioController __instance) { string[] array = new string[12] { "leishen_e1", "leishen_e2", "leishen_e3", "leishen_q1", "leishen_q2", "leishen_q3", "xingqiu_e1", "xingqiu_e2", "xingqiu_e3", "xingqiu_q1", "xingqiu_q2", "xingqiu_q3" }; foreach (string clipName in array) { if (!__instance.SFX.Any((AudioClip ac) => ((Object)ac).name.Equals(clipName, StringComparison.InvariantCultureIgnoreCase))) { AudioClip val = SoundManager.LoadAudioClip("GenshinMod", clipName + ".wav"); ((Object)val).name = clipName; __instance.SFX.Add(val); } } } public static List<AudioState> PauseAllLoops() { Traverse val = Traverse.Create((object)AudioController.Instance); List<AudioSource> value = val.Field("loopSources").GetValue<List<AudioSource>>(); List<AudioState> list = new List<AudioState>(); for (int i = 0; i < value.Count; i++) { AudioSource val2 = value[i]; if ((Object)(object)val2 == (Object)null || (Object)(object)val2.clip == (Object)null) { List<AudioState> list2 = list; AudioState audioState = default(AudioState); audioState.sourceNum = i; audioState.position = 0f; audioState.clipName = null; audioState.isPlaying = false; AudioState item = audioState; list2.Add(item); } else { List<AudioState> list3 = list; AudioState audioState = default(AudioState); audioState.sourceNum = i; audioState.position = (val2.isPlaying ? (val2.time / val2.clip.length) : 0f); audioState.clipName = ((Object)val2.clip).name; audioState.isPlaying = val2.isPlaying; audioState.volume = val2.volume; AudioState item2 = audioState; list3.Add(item2); } } AudioController.Instance.StopAllLoops(); return list; } public static void ResumeAllLoops(List<AudioState> states) { for (int i = 0; i < states.Count; i++) { if (states[i].isPlaying) { AudioController.Instance.SetLoopAndPlay(states[i].clipName, i, true, true); AudioController.Instance.SetLoopVolumeImmediate(0f, i); AudioController.Instance.SetLoopTimeNormalized(states[i].position, i); AudioController.Instance.FadeInLoop(1f, states[i].volume, new int[1] { i }); } else { AudioController.Instance.StopLoop(i); } } } } [HarmonyPatch(typeof(PlayableCard), "TakeDamage")] public class TakeDamagePatch : PlayableCard { private static void Prefix(ref PlayableCard __instance, ref int damage) { //IL_0003: 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_003e: Unknown result type (might be due to invalid IL or missing references) if (__instance.HasAbility(Superconducting.ability)) { damage += 2; } if (__instance.HasAbility(Ice_cling.ability) && __instance.HasAbility((Ability)26)) { damage = 0; } if (__instance.HasAbility(xingqiu_ysbf_ylj.ability)) { damage--; } damage -= CardSlotExtensions.GetAdjacentCards(__instance.Slot).FindAll((PlayableCard x) => x.HasAbility(xingqiu_ysbf_ylj.ability)).Count; } } public static class CardRelatedExtension { public static void RemoveAbilityFromThisCard(this PlayableCard playableCard, CardModificationInfo modInfo, Action callback = null) { object obj = ((Card)playableCard).Info.Clone(); CardInfo val = (CardInfo)((obj is CardInfo) ? obj : null); val.Mods.Add(modInfo); ((Card)playableCard).SetInfo(val); callback?.Invoke(); } } public class get { private readonly GameObject bombPrefab = ResourceBank.Get<GameObject>("Prefabs/Cards/SpecificCardModels/DetonatorHoloBomb"); public IEnumerator ShockCard(PlayableCard target, PlayableCard attacker, int damage, double num) { double newDamage = Math.Floor((double)damage * num + 1.0); int finalDamage = (int)newDamage; ((Card)target).Anim.SetOverclocked(true); ((Card)target).Anim.PlayHitAnimation(); yield return target.TakeDamage(finalDamage, attacker); ((Card)target).Anim.SetOverclocked(false); yield return (object)new WaitForSeconds(0.2f); } public IEnumerator getgetfire(PlayableCard playableCard, PlayableCard card) { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.1f); if (card.HasAbility(thunder_cling.ability) && playableCard.OnBoard && (Object)(object)playableCard.Slot.opposingSlot != (Object)null && (Object)(object)Singleton<BoardManager>.Instance != (Object)null) { yield return nosigil(card, thunder_cling.ability, "雷元素附着"); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]超载![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, false); List<CardSlot> slotsToAttack = new List<CardSlot> { playableCard.Slot.opposingSlot }; slotsToAttack.AddRange(Singleton<BoardManager>.Instance.GetAdjacentSlots(playableCard.Slot.opposingSlot)); slotsToAttack.RemoveAll((CardSlot x) => (Object)(object)x == (Object)null || (Object)(object)x.Card == (Object)null); slotsToAttack.Sort((CardSlot x, CardSlot x2) => x.Index - x2.Index); foreach (CardSlot slot in slotsToAttack) { if ((Object)(object)slot.Card != (Object)null) { GameObject bomb = Object.Instantiate<GameObject>(bombPrefab); bomb.transform.position = ((Component)playableCard).transform.position + Vector3.up * 0.1f; Tween.Position(bomb.transform, ((Component)slot.Card).transform.position + Vector3.up * 0.1f, 0.5f, 0f, Tween.EaseLinear, (LoopType)0, (Action)null, (Action)null, true); yield return (object)new WaitForSeconds(0.5f); ((Card)slot.Card).Anim.PlayHitAnimation(); Object.Destroy((Object)(object)bomb); yield return ShockCard(slot.Card, playableCard, playableCard.Attack, 0.75); } } yield return ShockCard(playableCard, playableCard, playableCard.Attack, 0.25); ((Card)card).RenderCard(); } else { if (!((Object)(object)card != (Object)null) || card.Dead) { yield break; } if (card.HasAbility(Water_cling.ability)) { yield return nosigil(card, Water_cling.ability, "水元素附着"); if (card.Health != 0) { yield return ShockCard(card, playableCard, playableCard.Attack, 0.75); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]蒸发![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); } else if (card.HasAbility(grass_cling.ability)) { yield return nosigil(card, grass_cling.ability, "草元素附着"); if (card.Health != 0) { yield return ShockCard(card, playableCard, playableCard.Attack, 0.75); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]燃烧![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); if (card.Health != 0) { int? terrifyTurns = CardExtensions.GetExtendedPropertyAsInt(((Card)card).Info, "Burn"); ((Card)playableCard).Anim.LightNegationEffect(); CardModificationInfo cardModificationInfo = new CardModificationInfo(); foreach (CardModificationInfo mod in card.temporaryMods) { if (mod.abilities.Contains(Burn.ability)) { CardExtensions.SetExtendedProperty(((Card)card).Info, "Burn", (object)(terrifyTurns + 2)); Debug.Log((object)("[" + ((Card)card).Info.displayedName + "] 被附加燃烧了!")); yield break; } } Debug.Log((object)("[" + ((Card)card).Info.displayedName + "] 被附加燃烧了!")); CardExtensions.SetExtendedProperty(((Card)card).Info, "Burn", (object)1); cardModificationInfo.abilities.Add(Burn.ability); cardModificationInfo.abilities.Add(Fire_cling.ability); card.AddTemporaryMod(cardModificationInfo); ((Card)card).RenderCard(); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]燃烧![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); } else if (card.HasAbility(Ice_cling.ability)) { yield return nosigil(card, Ice_cling.ability, "冰元素附着"); if (card.Health != 0) { yield return ShockCard(card, playableCard, playableCard.Attack, 1.0); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]融化![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); } else { ((Card)playableCard).Anim.LightNegationEffect(); yield return getsigil(card, Fire_cling.ability, "Fire_cling", "火元素附着", 2); } } } public IEnumerator getgetice(PlayableCard playableCard, PlayableCard card) { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.1f); if (!((Object)(object)card != (Object)null)) { yield break; } if (card.HasAbility((Ability)26) && card.HasAbility(Ice_cling.ability)) { PlayableCard opposingSlotCard = CardExtensions.OpposingCard(playableCard); if (Object.op_Implicit((Object)(object)opposingSlotCard) && opposingSlotCard.HasAbility((Ability)26) && opposingSlotCard.HasAbility(Ice_cling.ability)) { CardModificationInfo frozenAway2 = Plugin.CreateModBreakFreeze(opposingSlotCard); opposingSlotCard.RemoveAbilityFromThisCard(frozenAway2); ((Card)opposingSlotCard).Anim.PlayTransformAnimation(); yield return (object)new WaitForSeconds(0.25f); yield return opposingSlotCard.TakeDamage(1, playableCard); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]碎冰![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } } else { if (card.Dead) { yield break; } if (card.HasAbility(thunder_cling.ability)) { yield return nosigil(card, thunder_cling.ability, "雷元素附着"); if (card.Health != 0) { ((Card)playableCard).Anim.LightNegationEffect(); yield return getsigil(card, Superconducting.ability, "Superconducting", "超导", 2); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]超导![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); } else if (card.HasAbility(Fire_cling.ability)) { yield return nosigil(card, Fire_cling.ability, "火元素附着"); if (card.Health != 0) { yield return ShockCard(card, playableCard, playableCard.Attack, 0.5); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]融化![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); } else if (card.HasAbility(Water_cling.ability)) { yield return nosigil(card, Water_cling.ability, "水元素附着"); if (card.Health == 0) { yield break; } PlayableCard opposingSlotCard2 = CardExtensions.OpposingCard(playableCard); if (Object.op_Implicit((Object)(object)opposingSlotCard2)) { if (opposingSlotCard2.HasTrait((Trait)16)) { yield return (object)new WaitForSeconds(0.25f); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("这种程度的寒冷还不足以将" + ((Card)opposingSlotCard2).Info.DisplayedNameLocalized + "冻结!", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); yield return opposingSlotCard2.TakeDamage(4, playableCard); } else if (CardExtensions.LacksAbility(opposingSlotCard2, (Ability)26)) { CardModificationInfo frozenAway = Plugin.CreateModForFreeze(opposingSlotCard2); opposingSlotCard2.RemoveAbilityFromThisCard(frozenAway); ((Card)opposingSlotCard2).Anim.PlayTransformAnimation(); yield return (object)new WaitForSeconds(0.25f); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]冻结![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } } } else { ((Card)playableCard).Anim.LightNegationEffect(); yield return getsigil(card, Fire_cling.ability, "Fire_cling", "火元素附着", 2); } } } public IEnumerator getgetwater(PlayableCard playableCard, PlayableCard card) { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.1f); if (!((Object)(object)card != (Object)null)) { yield break; } if (card.HasAbility((Ability)26) && card.HasAbility(Ice_cling.ability)) { PlayableCard opposingSlotCard = CardExtensions.OpposingCard(playableCard); if (Object.op_Implicit((Object)(object)opposingSlotCard) && opposingSlotCard.HasAbility((Ability)26) && opposingSlotCard.HasAbility(Ice_cling.ability)) { CardModificationInfo frozenAway2 = Plugin.CreateModBreakFreeze(opposingSlotCard); opposingSlotCard.RemoveAbilityFromThisCard(frozenAway2); ((Card)opposingSlotCard).Anim.PlayTransformAnimation(); yield return (object)new WaitForSeconds(0.25f); yield return opposingSlotCard.TakeDamage(1, playableCard); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]碎冰![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } } else if (card.HasAbility(thunder_cling.ability)) { if (!card.Dead) { yield return nosigil(card, thunder_cling.ability, "雷元素附着"); } yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]感电![c:]对所有生物造成伤害!", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); List<PlayableCard> cards = new List<PlayableCard>(); cards.AddRange(Singleton<BoardManager>.Instance.CardsOnBoard.FindAll((PlayableCard x) => Object.op_Implicit((Object)(object)x) != playableCard.OpponentCard && !x.Dead)); if (cards.Count > 0) { for (int i = cards.Count - 1; i >= 0; i--) { if (cards[i].OpponentCard) { yield return ShockCard(cards[i], playableCard, playableCard.Attack, 0.25); } } } ((Card)card).RenderCard(); } else { if (card.Dead) { yield break; } if (card.HasAbility(Fire_cling.ability)) { yield return nosigil(card, Fire_cling.ability, "火元素附着"); if (card.Health != 0) { yield return ShockCard(card, playableCard, playableCard.Attack, 1.0); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]蒸发![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); } else if (card.HasAbility(grass_cling.ability)) { yield return nosigil(card, grass_cling.ability, "草元素附着"); if (card.Health != 0) { yield return ShockCard(card, playableCard, playableCard.Attack, 0.75); } ((Card)card).RenderCard(); List<CardSlot> cards2 = Singleton<BoardManager>.Instance.OpponentSlotsCopy; List<CardSlot> openspots = new List<CardSlot>(); foreach (CardSlot slot in cards2) { if ((Object)(object)slot.Card == (Object)null) { openspots.Add(slot); } } if (openspots.Count != 0) { Random random = new Random(); yield return (object)new WaitForSeconds(0.3f); Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.3f); yield return Singleton<BoardManager>.Instance.CreateCardInSlot(ScriptableObjectLoader<CardInfo>.AllData.Find((CardInfo info) => ((Object)info).name == "GenshinMod_Grass_seeds"), openspots[random.Next(openspots.Count)], 0.1f, true); yield return (object)new WaitForSeconds(0.3f); Singleton<ViewManager>.Instance.SwitchToView((View)1, false, false); } } else if (card.HasAbility(Ice_cling.ability)) { yield return nosigil(card, Ice_cling.ability, "冰元素附着"); if (card.Health != 0) { PlayableCard opposingSlotCard2 = CardExtensions.OpposingCard(playableCard); if (Object.op_Implicit((Object)(object)opposingSlotCard2)) { if (opposingSlotCard2.HasTrait((Trait)16)) { yield return (object)new WaitForSeconds(0.25f); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("这种程度的寒冷还不足以将" + ((Card)opposingSlotCard2).Info.DisplayedNameLocalized + "冻结!", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); yield return opposingSlotCard2.TakeDamage(4, playableCard); } else if (CardExtensions.LacksAbility(opposingSlotCard2, (Ability)26)) { CardModificationInfo frozenAway = Plugin.CreateModForFreeze(opposingSlotCard2); opposingSlotCard2.RemoveAbilityFromThisCard(frozenAway); ((Card)opposingSlotCard2).Anim.PlayTransformAnimation(); yield return (object)new WaitForSeconds(0.25f); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]冻结![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } } } else { ((Card)card).RenderCard(); } } else { ((Card)playableCard).Anim.LightNegationEffect(); yield return getsigil(card, Water_cling.ability, "Water_cling", "水元素附着", 2); } } } public IEnumerator getgetthunder(PlayableCard playableCard, PlayableCard card) { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.1f); if (card.HasAbility(Fire_cling.ability) && playableCard.OnBoard && (Object)(object)playableCard.Slot.opposingSlot != (Object)null && (Object)(object)Singleton<BoardManager>.Instance != (Object)null) { yield return nosigil(card, Fire_cling.ability, "火元素附着"); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]超载![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); List<CardSlot> slotsToAttack = new List<CardSlot> { playableCard.Slot.opposingSlot }; slotsToAttack.AddRange(Singleton<BoardManager>.Instance.GetAdjacentSlots(playableCard.Slot.opposingSlot)); slotsToAttack.RemoveAll((CardSlot x) => (Object)(object)x == (Object)null || (Object)(object)x.Card == (Object)null); slotsToAttack.Sort((CardSlot x, CardSlot x2) => x.Index - x2.Index); foreach (CardSlot slot in slotsToAttack) { if ((Object)(object)slot.Card != (Object)null) { GameObject bomb = Object.Instantiate<GameObject>(bombPrefab); bomb.transform.position = ((Component)playableCard).transform.position + Vector3.up * 0.1f; Tween.Position(bomb.transform, ((Component)slot.Card).transform.position + Vector3.up * 0.1f, 0.5f, 0f, Tween.EaseLinear, (LoopType)0, (Action)null, (Action)null, true); yield return (object)new WaitForSeconds(0.5f); ((Card)slot.Card).Anim.PlayHitAnimation(); Object.Destroy((Object)(object)bomb); yield return ShockCard(slot.Card, playableCard, playableCard.Attack, 0.75); } } yield return ShockCard(playableCard, playableCard, playableCard.Attack, 0.25); ((Card)card).RenderCard(); } else { if (!((Object)(object)card != (Object)null)) { yield break; } if (card.HasAbility(Water_cling.ability)) { if (!card.Dead) { yield return nosigil(card, Water_cling.ability, "水元素附着"); } yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]感电![c:]对所有生物造成伤害!", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); List<PlayableCard> cards = new List<PlayableCard>(); cards.AddRange(Singleton<BoardManager>.Instance.CardsOnBoard.FindAll((PlayableCard x) => Object.op_Implicit((Object)(object)x) != playableCard.OpponentCard && !x.Dead)); if (cards.Count > 0) { for (int i = cards.Count - 1; i >= 0; i--) { if (cards[i].OpponentCard) { yield return ShockCard(cards[i], playableCard, playableCard.Attack, 0.25); } } } ((Card)card).RenderCard(); } else { if (card.Dead) { yield break; } if (card.HasAbility(grass_cling.ability)) { yield return nosigil(card, grass_cling.ability, "草元素附着"); if (card.Health != 0) { yield return ShockCard(card, playableCard, playableCard.Attack, 0.75); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]超激化![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); } else if (card.HasAbility(Ice_cling.ability)) { yield return nosigil(card, Ice_cling.ability, "冰元素附着"); if (card.Health != 0) { ((Card)playableCard).Anim.LightNegationEffect(); yield return getsigil(card, Superconducting.ability, "Superconducting", "超导", 2); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]超导![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); } else { ((Card)playableCard).Anim.LightNegationEffect(); yield return getsigil(card, thunder_cling.ability, "thunder_cling", "雷元素附着", 2); } } } } public IEnumerator getgetwind(PlayableCard playableCard, PlayableCard card) { get get2 = new get(); Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.1f); if (card.HasAbility(Water_cling.ability) && playableCard.OnBoard && (Object)(object)playableCard.Slot.opposingSlot != (Object)null && (Object)(object)Singleton<BoardManager>.Instance != (Object)null) { yield return nosigil(card, Water_cling.ability, "水元素附着"); List<CardSlot> slots = new List<CardSlot>(); if (Object.op_Implicit((Object)(object)playableCard.slot.opposingSlot)) { slots.AddRange(Singleton<BoardManager>.Instance.GetAdjacentSlots(playableCard.slot.opposingSlot)); } foreach (CardSlot slot2 in slots) { if (Object.op_Implicit((Object)(object)playableCard) && playableCard.OnBoard && Object.op_Implicit((Object)(object)slot2) && (Object)(object)slot2.Card != (Object)null) { ((Card)playableCard).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.1f); yield return get2.getgetwater(playableCard, slot2.Card); yield return (object)new WaitForSeconds(0.4f); } } } else if (card.HasAbility(thunder_cling.ability) && playableCard.OnBoard && (Object)(object)playableCard.Slot.opposingSlot != (Object)null && (Object)(object)Singleton<BoardManager>.Instance != (Object)null) { yield return nosigil(card, thunder_cling.ability, "雷元素附着"); List<CardSlot> slots2 = new List<CardSlot>(); if (Object.op_Implicit((Object)(object)playableCard.slot.opposingSlot)) { slots2.AddRange(Singleton<BoardManager>.Instance.GetAdjacentSlots(playableCard.slot.opposingSlot)); } foreach (CardSlot slot3 in slots2) { if (Object.op_Implicit((Object)(object)playableCard) && playableCard.OnBoard && Object.op_Implicit((Object)(object)slot3) && (Object)(object)slot3.Card != (Object)null) { ((Card)playableCard).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.1f); yield return get2.getgetthunder(playableCard, slot3.Card); yield return (object)new WaitForSeconds(0.4f); } } } else if (card.HasAbility(Fire_cling.ability) && playableCard.OnBoard && (Object)(object)playableCard.Slot.opposingSlot != (Object)null && (Object)(object)Singleton<BoardManager>.Instance != (Object)null) { yield return nosigil(card, Fire_cling.ability, "火元素附着"); List<CardSlot> slots3 = new List<CardSlot>(); if (Object.op_Implicit((Object)(object)playableCard.slot.opposingSlot)) { slots3.AddRange(Singleton<BoardManager>.Instance.GetAdjacentSlots(playableCard.slot.opposingSlot)); } foreach (CardSlot slot4 in slots3) { if (Object.op_Implicit((Object)(object)playableCard) && playableCard.OnBoard && Object.op_Implicit((Object)(object)slot4) && (Object)(object)slot4.Card != (Object)null) { ((Card)playableCard).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.1f); yield return get2.getgetfire(playableCard, slot4.Card); yield return (object)new WaitForSeconds(0.4f); } } } else { if (!card.HasAbility(Ice_cling.ability) || !playableCard.OnBoard || !((Object)(object)playableCard.Slot.opposingSlot != (Object)null) || !((Object)(object)Singleton<BoardManager>.Instance != (Object)null)) { yield break; } yield return nosigil(card, Ice_cling.ability, "冰元素附着"); List<CardSlot> slots4 = new List<CardSlot>(); if (Object.op_Implicit((Object)(object)playableCard.slot.opposingSlot)) { slots4.AddRange(Singleton<BoardManager>.Instance.GetAdjacentSlots(playableCard.slot.opposingSlot)); } foreach (CardSlot slot in slots4) { if (Object.op_Implicit((Object)(object)playableCard) && playableCard.OnBoard && Object.op_Implicit((Object)(object)slot) && (Object)(object)slot.Card != (Object)null) { ((Card)playableCard).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.1f); yield return get2.getgetice(playableCard, slot.Card); yield return (object)new WaitForSeconds(0.4f); } } } } public IEnumerator getgetgrass(PlayableCard playableCard, PlayableCard card) { new get(); Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.1f); if (!((Object)(object)card != (Object)null) || card.Dead) { yield break; } if (card.HasAbility(thunder_cling.ability)) { yield return nosigil(card, thunder_cling.ability, "雷元素附着"); if (card.Health != 0) { yield return ShockCard(card, playableCard, playableCard.Attack, 0.75); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]超激化![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); } else if (card.HasAbility(Fire_cling.ability)) { if (card.Health != 0) { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.1f); int? terrifyTurns = CardExtensions.GetExtendedPropertyAsInt(((Card)card).Info, "Burn"); ((Card)playableCard).Anim.LightNegationEffect(); CardModificationInfo cardModificationInfo = new CardModificationInfo(); foreach (CardModificationInfo mod in card.temporaryMods) { if (mod.abilities.Contains(Burn.ability)) { CardExtensions.SetExtendedProperty(((Card)card).Info, "Burn", (object)(terrifyTurns + 2)); Debug.Log((object)("[" + ((Card)card).Info.displayedName + "] 被附加燃烧了!")); yield break; } } Debug.Log((object)("[" + ((Card)card).Info.displayedName + "] 被附加燃烧了!")); CardExtensions.SetExtendedProperty(((Card)card).Info, "Burn", (object)2); cardModificationInfo.abilities.Add(Burn.ability); card.AddTemporaryMod(cardModificationInfo); ((Card)card).RenderCard(); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]燃烧![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } ((Card)card).RenderCard(); } else if (card.HasAbility(Water_cling.ability)) { yield return nosigil(card, Water_cling.ability, "水元素附着"); List<CardSlot> cards = Singleton<BoardManager>.Instance.OpponentSlotsCopy; List<CardSlot> openspots = new List<CardSlot>(); foreach (CardSlot slot in cards) { if ((Object)(object)slot.Card == (Object)null) { openspots.Add(slot); } } if (openspots.Count != 0) { Random random = new Random(); yield return (object)new WaitForSeconds(0.3f); yield return Singleton<BoardManager>.Instance.CreateCardInSlot(ScriptableObjectLoader<CardInfo>.AllData.Find((CardInfo info) => ((Object)info).name == "GenshinMod_Grass_seeds"), openspots[random.Next(openspots.Count)], 0.1f, true); yield break; } List<CardSlot> slotsToAttack = new List<CardSlot> { playableCard.Slot.opposingSlot }; slotsToAttack.AddRange(Singleton<BoardManager>.Instance.GetAdjacentSlots(playableCard.Slot.opposingSlot)); slotsToAttack.RemoveAll((CardSlot x) => (Object)(object)x == (Object)null || (Object)(object)x.Card == (Object)null); slotsToAttack.Sort((CardSlot x, CardSlot x2) => x.Index - x2.Index); foreach (CardSlot slot2 in slotsToAttack) { if ((Object)(object)slot2.Card != (Object)null) { GameObject bomb = Object.Instantiate<GameObject>(bombPrefab); bomb.transform.position = ((Component)playableCard).transform.position + Vector3.up * 0.1f; Tween.Position(bomb.transform, ((Component)slot2.Card).transform.position + Vector3.up * 0.1f, 0.5f, 0f, Tween.EaseLinear, (LoopType)0, (Action)null, (Action)null, true); yield return (object)new WaitForSeconds(0.5f); ((Card)slot2.Card).Anim.PlayHitAnimation(); Object.Destroy((Object)(object)bomb); yield return ShockCard(slot2.Card, playableCard, playableCard.Attack, 0.75); } } yield return ShockCard(playableCard, playableCard, playableCard.Attack, 0.25); ((Card)card).RenderCard(); } else { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.1f); ((Card)playableCard).Anim.LightNegationEffect(); yield return getsigil(card, grass_cling.ability, "grass_cling", "草元素附着", 2); } } public IEnumerator getgetrock(PlayableCard playableCard, PlayableCard card) { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.1f); if (!card.HasAbility(Water_cling.ability) && !card.HasAbility(Fire_cling.ability) && !card.HasAbility(thunder_cling.ability) && !card.HasAbility(Ice_cling.ability)) { yield break; } yield return nosigil(card, Water_cling.ability, "水元素附着"); List<CardSlot> cards = Singleton<BoardManager>.Instance.PlayerSlotsCopy; List<CardSlot> openspots = new List<CardSlot>(); foreach (CardSlot slot in cards) { int shield = CardExtensions.GetTotalShields(slot.Card); if ((Object)(object)slot.Card != (Object)null && shield == 0) { openspots.Add(slot); } } if (openspots.Count == 0) { yield break; } Random random = new Random(); PlayableCard opencard = openspots[random.Next(openspots.Count)].Card; yield return (object)new WaitForSeconds(0.3f); ((Card)opencard).Anim.LightNegationEffect(); CardModificationInfo cardModificationInfo = new CardModificationInfo(); foreach (CardModificationInfo mod in opencard.temporaryMods) { if (mod.abilities.Contains((Ability)54)) { DamageShieldBehaviour component = ((Component)opencard).GetComponent<DamageShieldBehaviour>(); component.numShields++; yield break; } } CardExtensions.ResetShield(opencard, (Ability)54); cardModificationInfo.abilities.Add((Ability)54); opencard.AddTemporaryMod(cardModificationInfo); ((Card)opencard).RenderCard(); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("[c:bR]结晶![c:]", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } public IEnumerator getart(CardSlot basecardslot, string name, string name1, string music, float time) { int damageTaken = basecardslot.Card.Status.damageTaken; CardInfo evolution = CardLoader.GetCardByName(name); CardInfo evolution2 = CardLoader.GetCardByName(name1); yield return (object)new WaitForSeconds(0.25f); foreach (CardModificationInfo item in ((Card)basecardslot.Card).Info.Mods.FindAll((CardModificationInfo x) => !x.nonCopyable)) { CardModificationInfo cardModificationInfo = (CardModificationInfo)item.Clone(); evolution.Mods.Add(cardModificationInfo); } yield return (object)new WaitForSeconds(0.1f); ((Card)basecardslot.Card).ExitBoard(0f, new Vector3(0f, 0f, 0f)); yield return Singleton<BoardManager>.Instance.CreateCardInSlot(evolution2, basecardslot, 0.1f, false); yield return (object)new WaitForSeconds(0.5f); AudioController.Instance.PlaySound3D(music, (MixerGroup)5, ((Component)basecardslot.Card).transform.position, 1f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); yield return (object)new WaitForSeconds(time); ((Card)basecardslot.Card).ExitBoard(0f, new Vector3(0f, 0f, 0f)); yield return Singleton<BoardManager>.Instance.CreateCardInSlot(evolution, basecardslot, 0.1f, false); PlayableCard player = basecardslot.Card; player.Status.damageTaken = damageTaken; yield return (object)new WaitForSeconds(0.5f); } public IEnumerator getsigil(PlayableCard playableCard, Ability ability, string name, string displayname, int turn) { //IL_0015: 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) CardModificationInfo cardModificationInfo22 = new CardModificationInfo { fromDuplicateMerge = true }; foreach (CardModificationInfo mod in playableCard.temporaryMods) { if (mod.abilities.Contains(ability)) { Debug.Log((object)("[" + ((Card)playableCard).Info.displayedName + "]的" + displayname + "还剩两回合!")); yield break; } } Debug.Log((object)("[" + ((Card)playableCard).Info.displayedName + "] 附加了" + displayname)); CardExtensions.SetExtendedProperty(((Card)playableCard).Info, name, (object)turn); cardModificationInfo22.abilities.Add(ability); playableCard.AddTemporaryMod(cardModificationInfo22); ((Card)playableCard).RenderCard(); } public IEnumerator removesigil(PlayableCard playableCard, Ability ability, string name, string displayname) { //IL_0015: 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) int? pl = CardExtensions.GetExtendedPropertyAsInt(((Card)playableCard).Info, name); Debug.Log((object)(displayname + $"还剩[{pl}] 回合!")); if (pl == 0) { CardModificationInfo removeMe = null; foreach (CardModificationInfo mod in playableCard.temporaryMods) { if (mod.abilities.Contains(ability)) { removeMe = mod; } } if (removeMe != null) { playableCard.RemoveTemporaryMod(removeMe, true); } ((Card)playableCard).Info.ModAbilities.Remove(ability); Debug.Log((object)("[" + ((Card)playableCard).Info.displayedName + "]的" + displayname + "消失了!")); ((Card)playableCard).RenderCard(); } else { CardExtensions.SetExtendedProperty(((Card)playableCard).Info, name, (object)(pl - 1)); } yield break; } public IEnumerator nosigil(PlayableCard playableCard, Ability ability, string displayname) { //IL_0015: 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) CardModificationInfo removeMe = null; foreach (CardModificationInfo mod in playableCard.temporaryMods) { if (mod.abilities.Contains(ability)) { removeMe = mod; } } if (removeMe != null) { playableCard.RemoveTemporaryMod(removeMe, true); } ((Card)playableCard).Info.ModAbilities.Remove(ability); Debug.Log((object)("[" + ((Card)playableCard).Info.displayedName + "]的" + displayname + "消失了!")); ((Card)playableCard).RenderCard(); yield break; } } public class APIDeathShield : DamageShieldBehaviour { public override Ability Ability => (Ability)54; public override int StartingNumShields => CardExtensions.GetAbilityStacks(((AbilityBehaviour)this).Card, (Ability)54); } internal static class Library { public static List<string> CardsToPatch = new List<string>(); public static Dictionary<string, PortraitJSON> Spritesheets = new Dictionary<string, PortraitJSON>(); public static Dictionary<string, (Sprite[] frames, int frameRate, float pauseTime)> AnimatedPortraits = new Dictionary<string, (Sprite[], int, float)>(); } internal static class ParseSpritesheet { public const int pWidth = 125; public const int pHeight = 190; public static void Parse() { List<string> cardsToPatch = Library.CardsToPatch; foreach (string item2 in cardsToPatch) { if (Library.AnimatedPortraits.ContainsKey(item2) || !Library.Spritesheets.ContainsKey(item2)) { continue; } PortraitJSON val = Library.Spritesheets[item2]; string text = FindImage(val.Spritesheet); if (text != null) { Texture2D tex = LoadTexture2D(text); Sprite[] item = LoadAllSprites(tex, val.FrameCount); if (!val.HasPause || val.PauseTime < 0f) { val.PauseTime = 0f; } Library.AnimatedPortraits.Add(item2, (item, val.FrameRate, val.PauseTime)); } } } public static Texture2D LoadTexture2D(string path) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(1, 1); ((Texture)val).filterMode = (FilterMode)0; ImageConversion.LoadImage(val, array); return val; } public static Sprite MakeSprite(Texture2D tex) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); return Sprite.Create(tex, val, val2); } public static Sprite[] LoadAllSprites(Texture2D tex, int frameCount) { //IL_0066: 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) int height = ((Texture)tex).height; int width = ((Texture)tex).width; int num = height / 190; int num2 = width / 125; List<Sprite> list = new List<Sprite>(); Rect val = default(Rect); Vector2 val2 = default(Vector2); for (int num3 = num - 1; num3 >= 0; num3--) { for (int i = 0; i < num2; i++) { ((Rect)(ref val))..ctor((float)(i * 125), (float)(num3 * 190), 125f, 190f); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); Sprite item = Sprite.Create(tex, val, val2); list.Add(item); if (list.Count >= frameCount) { break; } } if (list.Count == frameCount) { break; } } return list.ToArray(); } public static string FindImage(string fileName) { string[] files = Directory.GetFiles(Paths.PluginPath, fileName, SearchOption.AllDirectories); if (files.Length == 0) { return null; } if (files.Length > 1) { } return files.First(); } } public static class Register { public static void Add(string CardName, string Spritesheet, int FrameRate, int FrameCount, bool HasPause = false, float PauseTime = 0f) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected I4, but got Unknown PortraitJSON val = new PortraitJSON(CardName, Spritesheet, FrameRate, FrameCount, HasPause, PauseTime); bool flag = Utility.IsNullOrWhiteSpace(val.Spritesheet); bool flag2 = Utility.IsNullOrWhiteSpace(val.CardName); bool flag3 = val.FrameRate <= 0 || val.FrameRate > 60; bool flag4 = val.FrameCount <= 0; if (flag || flag2 || flag3 || flag4) { return; } CardInfo val2 = null; val2 = CardLoader.GetCardByName(val.CardName); if (!((Object)(object)val2 == (Object)null)) { CardExtensions.AddAppearances(val2, (Appearance[])(object)new Appearance[1] { (Appearance)(int)Plugin.AP }); if (!Library.CardsToPatch.Contains(val.CardName)) { Library.CardsToPatch.Add(val.CardName); } if (!Library.Spritesheets.ContainsKey(val.CardName)) { Library.Spritesheets.Add(val.CardName, val); } ParseSpritesheet.Parse(); } } } internal class SpritesheetBehaviour : CardAppearanceBehaviour { private (Sprite[] frames, int frameRate, float PauseTime) Anim; private bool coroutineStart; private bool noAnim; public override void ApplyAppearance() { if (!coroutineStart && !noAnim) { noAnim = !Library.AnimatedPortraits.ContainsKey(((Object)((CardAppearanceBehaviour)this).Card.Info).name); if (!noAnim) { Anim = Library.AnimatedPortraits[((Object)((CardAppearanceBehaviour)this).Card.Info).name]; coroutineStart = true; ((MonoBehaviour)this).StartCoroutine(AnimatePortrait()); } } } public IEnumerator AnimatePortrait() { Sprite[] frames = Anim.frames; float frameWait = 1f / (float)Anim.frameRate; while (true) { for (int i = 0; i < frames.Length; i++) { ((CardAppearanceBehaviour)this).Card.RenderInfo.portraitOverride = frames[i]; ((CardAppearanceBehaviour)this).Card.StatsLayer.RenderCard(((CardAppearanceBehaviour)this).Card.RenderInfo); yield return (object)new WaitForSeconds(frameWait); } if (Anim.PauseTime > 0f) { yield return (object)new WaitForSeconds(Anim.PauseTime); } } } } public class Burn : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); PlayableCard card = ((AbilityBehaviour)this).Card.Slot.opposingSlot.Card; _ = ((AbilityBehaviour)this).Card; int? terrifyTurns = CardExtensions.GetExtendedPropertyAsInt(((Card)((AbilityBehaviour)this).Card).Info, "Burn"); yield return get2.ShockCard(num: 0.5 * (double)terrifyTurns.Value, target: ((AbilityBehaviour)this).Card, attacker: ((AbilityBehaviour)this).Card, damage: ((AbilityBehaviour)this).Card.Attack); if ((Object)(object)card != (Object)null && card.Health > 0) { yield return get2.getgetfire(card, card); } Debug.Log((object)$"燃烧还剩[{terrifyTurns}] 回合!"); if (terrifyTurns == 0) { CardModificationInfo removeMe = null; foreach (CardModificationInfo mod in ((AbilityBehaviour)this).Card.temporaryMods) { if (mod.abilities.Contains(ability)) { removeMe = mod; } } if (removeMe != null) { ((AbilityBehaviour)this).Card.RemoveTemporaryMod(removeMe, true); } ((Card)((AbilityBehaviour)this).Card).Info.ModAbilities.Remove(ability); Debug.Log((object)"燃烧结束了!"); ((Card)((AbilityBehaviour)this).Card).RenderCard(); } else { CardExtensions.SetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "Burn", (object)(terrifyTurns - 1)); } } } public class Adddfire : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Adddfire", "火元素附魔"); } public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { return (Object)(object)attacker == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)slot.Card != (Object)null && slot.Card.Health > 0) { get get2 = new get(); yield return get2.getgetfire(attacker, slot.Card); } else { yield return (object)new WaitForSeconds(0.05f); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } public class Adddgrass : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Adddgrass", "草元素附魔"); } public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { return (Object)(object)attacker == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)slot.Card != (Object)null && slot.Card.Health > 0) { get get2 = new get(); yield return get2.getgetgrass(attacker, slot.Card); } else { yield return (object)new WaitForSeconds(0.05f); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } public class Adddice : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Adddice", "冰元素附魔"); } public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { return (Object)(object)attacker == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)slot.Card != (Object)null && slot.Card.Health > 0) { get get2 = new get(); yield return get2.getgetice(attacker, slot.Card); } else { yield return (object)new WaitForSeconds(0.05f); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } public class Adddrock : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Adddrock", "岩元素附魔"); } public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { return (Object)(object)attacker == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)slot.Card != (Object)null && slot.Card.Health > 0) { get get2 = new get(); yield return get2.getgetrock(attacker, slot.Card); } else { yield return (object)new WaitForSeconds(0.05f); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } public class Adddthunder : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Adddthunder", "雷元素附魔"); } public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { return (Object)(object)attacker == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)slot.Card != (Object)null && slot.Card.Health > 0) { get get2 = new get(); yield return get2.getgetthunder(attacker, slot.Card); } else { yield return (object)new WaitForSeconds(0.05f); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } public class Adddwater : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Adddwater", "水元素附魔"); } public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { return (Object)(object)attacker == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)slot.Card != (Object)null && slot.Card.Health > 0) { get get2 = new get(); yield return get2.getgetwater(attacker, slot.Card); } else { yield return (object)new WaitForSeconds(0.05f); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } public class Adddwind : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Adddwind", "风元素附魔"); } public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { return (Object)(object)attacker == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)slot.Card != (Object)null && slot.Card.Health > 0) { get get2 = new get(); yield return get2.getgetwind(attacker, slot.Card); } else { yield return (object)new WaitForSeconds(0.05f); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } public class Fire_cling : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Fire_cling", "火元素附着"); } } public class grass_cling : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "grass_cling", "草元素附着"); } } public class Ice_cling : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Ice_cling", "冰元素附着"); } } public class Grassseeds : AbilityBehaviour { public static Ability ability; private const string BOMB_PREFAB_PATH = "Prefabs/Cards/SpecificCardModels/DetonatorHoloBomb"; private GameObject bombPrefab; public override Ability Ability => ability; private void Awake() { bombPrefab = ResourceBank.Get<GameObject>("Prefabs/Cards/SpecificCardModels/DetonatorHoloBomb"); } public override bool RespondsToPreDeathAnimation(bool wasSacrifice) { return ((AbilityBehaviour)this).Card.OnBoard; } public override IEnumerator OnPreDeathAnimation(bool wasSacrifice) { ((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect(); yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return ExplodeFromSlot(((AbilityBehaviour)this).Card.Slot); yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } protected IEnumerator ExplodeFromSlot(CardSlot slot) { List<CardSlot> adjacentSlots = Singleton<BoardManager>.Instance.GetAdjacentSlots(slot); if (adjacentSlots.Count > 0 && adjacentSlots[0].Index < slot.Index) { if ((Object)(object)adjacentSlots[0].Card != (Object)null && !adjacentSlots[0].Card.Dead) { yield return BombCard(adjacentSlots[0].Card, slot.Card); } adjacentSlots.RemoveAt(0); } if ((Object)(object)slot.opposingSlot.Card != (Object)null && !slot.opposingSlot.Card.Dead) { yield return BombCard(slot.opposingSlot.Card, slot.Card); } if (adjacentSlots.Count > 0 && (Object)(object)adjacentSlots[0].Card != (Object)null && !adjacentSlots[0].Card.Dead) { yield return BombCard(adjacentSlots[0].Card, slot.Card); } } private IEnumerator BombCard(PlayableCard target, PlayableCard attacker) { GameObject bomb = Object.Instantiate<GameObject>(bombPrefab); bomb.transform.position = ((Component)attacker).transform.position + Vector3.up * 0.1f; Tween.Position(bomb.transform, ((Component)target).transform.position + Vector3.up * 0.1f, 0.5f, 0f, Tween.EaseLinear, (LoopType)0, (Action)null, (Action)null, true); yield return (object)new WaitForSeconds(0.5f); ((Card)target).Anim.PlayHitAnimation(); Object.Destroy((Object)(object)bomb); yield return target.TakeDamage(10, attacker); } } public class Superconducting : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Superconducting", "超导"); } } public class thunder_cling : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "thunder_cling", "雷元素附着"); } } public class Water_cling : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { get get2 = new get(); yield return get2.removesigil(((AbilityBehaviour)this).Card, ability, "Water_cling", "水元素附着"); } } public static class Tools { public static GameObject act1holotarget = ResourceBank.Get<GameObject>("Prefabs/Cards/SpecificCardModels/CannonTargetIcon"); public static GameObject act3holotarget = ResourceBank.Get<GameObject>("Prefabs/Cards/SpecificCardModels/SniperTargetIcon"); public static GameObject DeathcardCorner = ResourceBank.Get<GameObject>("Prefabs/GBCCardBattle/PixelDeathcardOverlay"); public static GameObject Particle; public static int CombinedPower(this List<Ability> abilities) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) i