using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace DCGO.CardEffects.EX1 { public class EX1_043 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); if (timing == EffectTiming.OnEndBattle) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription()); activateClass.SetHashString("Unsuspend_EX1_043"); cardEffects.Add(activateClass); string EffectDiscription() { return "[Your Turn][Once Per Turn] When one of your Digimon with [Insectoid] or [Ancient Insect] in its traits deletes an opponent's Digimon in battle and survives, you may unsuspend this Digimon."; } bool PermanentCondition(Permanent permanent) { if (permanent.TopCard.Owner == card.Owner) { if (permanent.TopCard.CardTraits.Contains("Insectoid")) { return true; } if (permanent.TopCard.CardTraits.Contains("Ancient Insect")) { return true; } if (permanent.TopCard.CardTraits.Contains("AncientInsect")) { return true; } } return false; } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.IsOwnerTurn(card)) { bool WinnerCondition(Permanent permanent) => PermanentCondition(permanent); bool LoserCondition(Permanent permanent) => CardEffectCommons.IsOpponentPermanent(permanent, card); if (CardEffectCommons.CanTriggerWhenDeleteOpponentDigimonByBattle(hashtable: hashtable, winnerCondition: WinnerCondition, loserCondition: LoserCondition, isOnlyWinnerSurvive: true)) { return true; } } } return false; } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.CanUnsuspend(card.PermanentOfThisCard())) { return true; } } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { Permanent selectedPermanent = card.PermanentOfThisCard(); yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List() { selectedPermanent }, activateClass).Unsuspend()); } } if (timing == EffectTiming.None) { int count() { if (CardEffectCommons.IsExistOnBattleArea(card)) { return card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.IsDigimon && cardSource.CardTraits.Contains("Insectoid")); } return 0; } bool Condition() { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.IsOwnerTurn(card)) { if (count() >= 1) { return true; } } } return false; } cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect>(changeValue: () => 1000 * count(), isInheritedEffect: false, card: card, condition: Condition)); } return cardEffects; } } }