using System; using System.Collections; using System.Collections.Generic; namespace DCGO.CardEffects.BT19 { public class BT19_080 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Start of Your Turn if (timing == EffectTiming.OnStartTurn) { cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card)); } #endregion #region Your Turn if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Give a Digimon Raid and it attacks", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[Your Turn] When any of your Digimon digivolve into a Digimon with [Growlmon]/[Gallantmon] in its name, by suspending this Tamer, that Digimon gains for the turn. Then, that Digimon attacks a player."; } bool CanSelectPermanentCondition(Permanent permanent) { if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)) { if (permanent.IsDigimon && permanent.TopCard.ContainsCardName("Growlmon") || permanent.IsDigimon && permanent.TopCard.ContainsCardName("Gallantmon")) { return true; } } return false; } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.IsOwnerTurn(card)) { if (CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, CanSelectPermanentCondition)) { return true; } } } return false; } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.CanActivateSuspendCostEffect(card)) { return true; } } return false; } IEnumerator ActivateCoroutine(Hashtable hashtable) { List digivolvedPermanent = CardEffectCommons.GetPlayedPermanentsFromEnterFieldHashtable(hashtable, null); List selectedCards = new List(); yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap()); yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRaid( targetPermanent: digivolvedPermanent[0], effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass)); if (digivolvedPermanent[0].CanAttack(activateClass)) { SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent(); selectAttackEffect.SetUp( attacker: digivolvedPermanent[0], canAttackPlayerCondition: () => true, defenderCondition: (permanent) => false, cardEffect: activateClass); selectAttackEffect.SetCanNotSelectNotAttack(); yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate()); } } } #endregion #region Security if (timing == EffectTiming.SecuritySkill) { cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card)); } #endregion return cardEffects; } } }