| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects.P
- {
- public class P_137 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Digivolution Condition
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.CardNames.Contains("Veemon");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition,
- digivolutionCost: 2,
- ignoreDigivolutionRequirement: false,
- card: card,
- condition: null));
- }
- #endregion
- #region Armor Purge
- if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
- {
- cardEffects.Add(CardEffectFactory.ArmorPurgeEffect(card: card));
- }
- #endregion
- #region Raid
- if (timing == EffectTiming.OnAllyAttack)
- {
- cardEffects.Add(CardEffectFactory.RaidSelfEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region Your Turn
- if (timing == EffectTiming.OnAttackTargetChanged)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Your opponent adds the top card of their security stack to the hand", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
- activateClass.SetHashString("AddOpponentSecurityToHand_P_0137");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Your Turn][Once Per Turn] When this Digimon's attack target is switched, your opponent adds the top card of their security stack to the hand.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (CardEffectCommons.CanTriggerOnAttackTargetSwitch(hashtable, card))
- {
- if (CardEffectCommons.IsOwnerTurn(card))
- {
- return true;
- }
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- return true;
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- if (card.Owner.Enemy.SecurityCards.Count >= 1)
- {
- CardSource topCard = card.Owner.Enemy.SecurityCards[0];
- yield return ContinuousController.instance.StartCoroutine(
- CardObjectController.AddHandCards(new List<CardSource>() { topCard }, false, activateClass));
- yield return ContinuousController.instance.StartCoroutine(new IReduceSecurity(
- player: card.Owner.Enemy,
- refSkillInfos: ref ContinuousController.instance.nullSkillInfos,
- activateClass).ReduceSecurity());
- }
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|