using System; using System.Collections; using System.Collections.Generic; namespace DCGO.CardEffects.BT14 { public class BT14_041 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Recovery +1 (Deck)", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[When Digivolving] Trigger . (Place the top card of your deck on top of your security stack.)"; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (card.Owner.LibraryCards.Count >= 1) { if (card.Owner.CanAddSecurity(activateClass)) { return true; } } } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery()); } } if (timing == EffectTiming.OnAddSecurity) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Opponent's 1 Digimon gains DP -7000 and this Digimon gains Security Attack +1", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription()); activateClass.SetHashString("DP-7000_BT14_041"); cardEffects.Add(activateClass); string EffectDiscription() { return "[All Turns][Once Per Turn] When a card is added to your security stack, 1 of your opponent's Digimon gets -7000 DP and this Digimon gains for the turn."; } bool CanSelectPermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.CanTriggerWhenAddSecurity(hashtable, player => player == card.Owner)) { return true; } } return false; } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { return true; } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition)) { int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(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: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); selectPermanentEffect.SetUpCustomMessage(customMessageArray: CardEffectCommons.customPermanentMessageArray_ChangeDP(changeValue: -7000, maxCount: maxCount)); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -7000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass)); } } yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack( targetPermanent: card.PermanentOfThisCard(), changeValue: 1, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass)); } } return cardEffects; } } }