| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using System.Linq;
- using Photon;
- using System;
- using Photon.Pun;
- public class BT3_031 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- if (timing == EffectTiming.None)
- {
- bool Condition()
- {
- return card.Owner.HandCards.Contains(card);
- }
- bool PermanentCondition(Permanent targetPermanent)
- {
- if (targetPermanent != null)
- {
- if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(targetPermanent, card))
- {
- if (targetPermanent.TopCard.CardNames.Contains("Paildramon"))
- {
- return true;
- }
- if (targetPermanent.TopCard.CardNames.Contains("Dinobeemon"))
- {
- return true;
- }
- }
- }
- return false;
- }
- bool CardSourceCondition(CardSource cardSource)
- {
- return cardSource == card && cardSource.Owner.HandCards.Contains(cardSource);
- }
- bool RootCondition(SelectCardEffect.Root root)
- {
- return root == SelectCardEffect.Root.Hand;
- }
- cardEffects.Add(CardEffectFactory.ChangeDigivolutionCostStaticEffect(
- changeValue: -2,
- permanentCondition: PermanentCondition,
- cardCondition: CardSourceCondition,
- rootCondition: RootCondition,
- isInheritedEffect: false,
- card: card,
- condition: Condition,
- setFixedCost: false));
- }
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
- }
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Unsuspend all your Digimon with Jamming", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[When Digivolving] Unsuspend all of your Digimon with <Jamming>.";
- }
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
- {
- if (permanent.HasJamming)
- {
- if (permanent.IsSuspended)
- {
- return true;
- }
- }
- }
- return false;
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
- {
- return true;
- }
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- if (isExistOnField(card))
- {
- if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
- {
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
- {
- List<Permanent> unsuspendPermanetns = new List<Permanent>();
- foreach (Permanent permanent in card.Owner.GetBattleAreaDigimons())
- {
- if (CanSelectPermanentCondition(permanent))
- {
- unsuspendPermanetns.Add(permanent);
- }
- }
- yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(unsuspendPermanetns, activateClass).Unsuspend());
- }
- }
- }
- }
- }
- return cardEffects;
- }
- }
|