using System.Collections; using System.Collections.Generic; using System.Linq; namespace DCGO.CardEffects.BT16 { public class BT16_101 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Armor Purge if (timing == EffectTiming.WhenPermanentWouldBeDeleted) { cardEffects.Add(CardEffectFactory.ArmorPurgeEffect(card: card)); } #endregion #region Digivolution Condition if (timing == EffectTiming.None) { bool PermanentCondition(Permanent targetPermanent) { return targetPermanent.TopCard.CardNames.Contains("Rapidmon"); } cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect( permanentCondition: PermanentCondition, digivolutionCost: 4, ignoreDigivolutionRequirement: true, card: card, condition: null)); } #endregion #region When Digivolving if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Suspend all opponent's Digimon and attack.", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[When Digivolving] Suspend all of your opponent's Digimon. Then, this Digimon may attack."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { return true; } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { List tappedPermanents = new List(); foreach (Permanent permanent in card.Owner.Enemy.GetBattleAreaDigimons()) { if (!permanent.TopCard.CanNotBeAffected(activateClass)) { tappedPermanents.Add(permanent); } } yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(tappedPermanents, CardEffectCommons.CardEffectHashtable(activateClass)).Tap()); if (CardEffectCommons.IsExistOnBattleArea(card)) { if (card.PermanentOfThisCard().CanAttack(activateClass)) { SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent(); selectAttackEffect.SetUp( attacker: card.PermanentOfThisCard(), canAttackPlayerCondition: () => true, defenderCondition: (permanent) => true, cardEffect: activateClass); yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate()); } } } } #endregion #region All Turns - Once Per Turn if (timing == EffectTiming.OnDestroyedAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Memory +2", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription()); activateClass.SetIsInheritedEffect(false); activateClass.SetHashString("Memory+2_BT16_101"); cardEffects.Add(activateClass); string EffectDiscription() { return "[All Turns][Once Per Turn] When an opponent's Digimon is deleted in battle or by dropping to 0 DP, gain 2 memory."; } bool PermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition, activateClass)) { if (!CardEffectCommons.IsByEffect(hashtable, null)) { 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(card.Owner.AddMemory(2, activateClass)); } } if (timing == EffectTiming.OnEndBattle) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Memory +2", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription()); activateClass.SetIsInheritedEffect(false); activateClass.SetHashString("Memory+2_BT16_101"); cardEffects.Add(activateClass); string EffectDiscription() { return "[All Turns][Once Per Turn] When an opponent's Digimon is deleted in battle or by dropping to 0 DP, gain 2 memory."; } bool PermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition, activateClass)) { bool WinnerCondition(Permanent permanent) => CardEffectCommons.IsOwnerPermanent(permanent, card); 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)) { return true; } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(2, activateClass)); } } } #endregion #region All Turns if (timing == EffectTiming.None) { bool PermanentCondition(Permanent permanent) { if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)) { if (permanent.IsDigimon) { if (permanent.IsSuspended) { return true; } } } return false; } bool CanUseCondition() { if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Rapidmon") || cardSource.CardNames.Contains("X Antibody") || cardSource.CardNames.Contains("XAntibody")) >= 1) { if (CardEffectCommons.IsExistOnBattleArea(card)) { return true; } } return false; } string effectName() { return "All opponent's suspended Digimon get -4000 DP."; } cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect( permanentCondition: PermanentCondition, changeValue: -4000, isInheritedEffect: false, card: card, condition: CanUseCondition, effectName: effectName)); } #endregion return cardEffects; } } }