| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects.P
- {
- public class P_140 : 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.HasLevel && targetPermanent.TopCard.Level == 4 && targetPermanent.TopCard.CardTraits.Contains("Insectoid");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
- }
- #endregion
- #region Evade
- if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
- {
- cardEffects.Add(CardEffectFactory.EvadeSelfEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region All Turns
- if (timing == EffectTiming.None)
- {
- CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
- canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's Digimon's effects", CanUseCondition, card);
- canNotAffectedClass.SetUpCanNotAffectedClass(CardCondition: CardCondition, SkillCondition: SkillCondition);
- cardEffects.Add(canNotAffectedClass);
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (card.PermanentOfThisCard().IsSuspended)
- {
- return true;
- }
- }
- return false;
- }
- bool CardCondition(CardSource cardSource)
- {
- if (cardSource == card)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (cardSource == card.PermanentOfThisCard().TopCard)
- {
- return true;
- }
- }
- }
- return false;
- }
- bool SkillCondition(ICardEffect cardEffect)
- {
- if (CardEffectCommons.IsOpponentEffect(cardEffect, card))
- {
- if (cardEffect.IsDigimonEffect)
- {
- return true;
- }
- }
- return false;
- }
- }
- #endregion
- #region Inherit
- if (timing == EffectTiming.OnEndBattle)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Trash the top card of opponent's security", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
- activateClass.SetIsInheritedEffect(true);
- activateClass.SetHashString("TrashSecurity_P_140");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Your Turn][Once Per Turn] When this Digimon deletes an opponent's Digimon in battle, trash the top card of your opponent's security stack.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- bool WinnerCondition(Permanent permanent) => permanent.cardSources.Contains(card);
- bool LoserCondition(Permanent permanent) => CardEffectCommons.IsOpponentPermanent(permanent, card);
- if (CardEffectCommons.CanTriggerWhenDeleteOpponentDigimonByBattle(
- hashtable: hashtable,
- winnerCondition: WinnerCondition,
- loserCondition: LoserCondition,
- isOnlyWinnerSurvive: false))
- {
- return true;
- }
-
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- return true;
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
- player: card.Owner.Enemy,
- destroySecurityCount: 1,
- cardEffect: activateClass,
- fromTop: true).DestroySecurity());
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|