using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Linq; using Photon; using System; using Photon.Pun; public class BT7_065 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); if (timing == EffectTiming.None) { int count() { if (CardEffectCommons.IsExistOnBattleArea(card)) { return card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.HasXAntibodyTraits); } return 0; } bool Condition() { if (CardEffectCommons.IsOwnerTurn(card)) { if (count() >= 1) { return true; } } return false; } cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect>(changeValue: () => 1000 * count(), isInheritedEffect: false, card: card, condition: Condition)); } if (timing == EffectTiming.OnAllyAttack) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Place a Card from hand to delete Digimon", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription()); activateClass.SetHashString("PlaceDigivolutionCards_BT7_065"); cardEffects.Add(activateClass); string EffectDiscription() { return "[When Attacking][Once Per Turn] You may place 1 card with [X-Antibody] in its traits from your hand at the bottom of this Digimon's digivolution cards to delete up to 2 of your opponent's Digimon with play costs less than or equal to this Digimon's digivolution cards."; } bool CanSelectCardCondition(CardSource cardSource) { return cardSource.HasXAntibodyTraits; } bool CanSelectPermanentCondition(Permanent permanent) { if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)) { if (CardEffectCommons.IsOwnerTurn(card)) { if (permanent.TopCard.GetCostItself <= card.PermanentOfThisCard().DigivolutionCards.Count) { if (permanent.TopCard.HasPlayCost) { return true; } } } } return false; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnAttack(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (card.Owner.HandCards.Count >= 1) { return true; } } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1) { List selectedCards = new List(); int maxCount = 1; SelectHandEffect selectHandEffect = GManager.instance.GetComponent(); selectHandEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectCardCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: maxCount, canNoSelect: true, canEndNotMax: false, isShowOpponent: true, selectCardCoroutine: SelectCardCoroutine, afterSelectCardCoroutine: null, mode: SelectHandEffect.Mode.Custom, cardEffect: activateClass); selectHandEffect.SetUpCustomMessage("Select 1 card to place on bottom of digivolution cards.", "The opponent is selecting 1 card to place on bottom of digivolution cards."); yield return StartCoroutine(selectHandEffect.Activate()); IEnumerator SelectCardCoroutine(CardSource cardSource) { selectedCards.Add(cardSource); yield return null; } if (selectedCards.Count >= 1) { yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(selectedCards, activateClass)); if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition)) { maxCount = Math.Min(2, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition)); SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectPermanentCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: CanEndSelectCondition, maxCount: maxCount, canNoSelect: false, canEndNotMax: true, selectPermanentCoroutine: null, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Destroy, cardEffect: activateClass); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); bool CanEndSelectCondition(List permanents) { if (CardEffectCommons.HasNoElement(permanents)) { return false; } return true; } } } } } } return cardEffects; } }