| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects.EX3
- {
- public class EX3_049 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
- }
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("The played Digimon gains Rush", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
- activateClass.SetIsInheritedEffect(true);
- activateClass.SetHashString("GainRush_EX3_049");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Your Turn][Once Per Turn] When you play another Digimon with [D-Brigade] in its traits, it gains <Rush> for the turn. (This Digimon may attack the turn it was played.)";
- }
- bool PermanentCondition(Permanent permanent)
- {
- if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
- {
- if (permanent != card.PermanentOfThisCard())
- {
- if (permanent.TopCard.CardTraits.Contains("D-Brigade"))
- {
- return true;
- }
- }
- }
- return false;
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (CardEffectCommons.IsOwnerTurn(card))
- {
- if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
- {
- return true;
- }
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- return true;
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- List<Permanent> permanents = CardEffectCommons.GetPlayedPermanentsFromEnterFieldHashtable(
- hashtable: _hashtable,
- rootCondition: null);
- if (permanents != null)
- {
- foreach (Permanent permanent in permanents.Filter(PermanentCondition).Clone())
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(
- targetPermanent: permanent,
- effectDuration: EffectDuration.UntilEachTurnEnd,
- activateClass: activateClass));
- }
- }
- }
- }
- return cardEffects;
- }
- }
- }
|