using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Linq; using Photon; using System; using Photon.Pun; public class BT7_108 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); if (timing == EffectTiming.OptionSkill) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card); activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[Main] For each Digimon with [Hybrid] in its traits and each Tamer you have in play, delete 1 of your opponent's level 5 or lower Digimon."; } bool CanSelectPermanentCondition(Permanent permanent) { if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)) { if (permanent.Level <= 5) { if (permanent.CanSelectBySkill(activateClass)) { if (permanent.TopCard.HasLevel) { return true; } } } } return false; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card); } IEnumerator ActivateCoroutine(Hashtable _hashtable) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition)) { int maxCount = card.Owner.GetBattleAreaDigimons().Count((permanent) => permanent.TopCard.CardTraits.Contains("Hybrid")) + card.Owner.GetBattleAreaPermanents().Count((permanent) => permanent.IsTamer); if (maxCount >= 1) { if (card.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectPermanentCondition) < maxCount) { maxCount = card.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectPermanentCondition); } SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectPermanentCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: maxCount, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: null, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Destroy, cardEffect: activateClass); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); } } } } if (timing == EffectTiming.SecuritySkill) { CardEffectCommons.AddActivateMainOptionSecurityEffect(card: card, cardEffects: ref cardEffects, effectName: $"Delete level 5 or lower Digimon"); } return cardEffects; } }