using System.Collections; using System.Collections.Generic; using System.Linq; using System; // Callismon namespace DCGO.CardEffects.BT25 { public class BT25_058 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Alt Digivolution if (timing == EffectTiming.None) { bool PermanentCondition(Permanent permanent) { return permanent.TopCard.HasTSTraits; } cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(PermanentCondition, 4, true, card, null, level: 5)); } #endregion #region Reboot if (timing == EffectTiming.None) { cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: false, card: card, condition: null)); } #endregion #region Blocker if (timing == EffectTiming.None) { cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null)); } #endregion #region Fortitude if (timing == EffectTiming.OnDestroyedAnyone) { cardEffects.Add(CardEffectFactory.FortitudeSelfEffect(isInheritedEffect: false, card: card, condition: null)); } #endregion #region Shared OP / WD / WA string SharedHashString = "BT25_058_OP_WD_WA"; string SharedEffectName = "May suspend 1 enemy digimon or Tamers. 1 enemy digimon or Tamer can't unsuspend until end of their turn."; string SharedEffectDescription(string tag) => $"[{tag}] [Once Per Turn] You may suspend 1 of your opponent's Digimon or Tamers. Then, 1 of their Digimon or Tamers can't unsuspend until their turn ends."; bool CanSelectPermanentConditionShared(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card) && (permanent.IsDigimon || permanent.IsTamer); } CardEffectFactory.ActivateClassesForSharedEffects (ref cardEffects, timing, card, SharedEffectName, SharedActivateCoroutine, SharedEffectDescription, maxCountPerTurn: 1, hashValue: SharedHashString, optional: false, onPlay: true, whenDigivolving: true, whenAttacking: true); IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared)) { SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectPermanentConditionShared, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: true, canEndNotMax: false, selectPermanentCoroutine: null, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Tap, cardEffect: activateClass); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectPermanentConditionShared, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); selectPermanentEffect.SetUpCustomMessage( "Select a Digimon or Tamers that will be unable to unsuspend.", "The opponent is selecting a Digimon or Tamers that will be unable to unsuspend."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd( targetPermanent: permanent, activateClass: activateClass )); } } } #endregion #region All Turns if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect(" 1 enemy Digimon. Then, may battle 1 Digimon", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription()); activateClass.SetHashString("BT25_058_AT"); cardEffects.Add(activateClass); string EffectDescription() => "[All Turns] [Once Per Turn] When effects play or digivolve any Digimon, 1 of your opponent's Digimon. Then, this Digimon may battle 1 of your opponent's Digimon."; bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass) && (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, IsDigimonCondition) || CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, IsDigimonCondition)) && CardEffectCommons.IsByEffect(hashtable, null); } bool IsDigimonCondition(Permanent permanent) => CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent); bool IsOpponentsDigimon(Permanent permanent) => CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); bool IsBattleTarget(Permanent permanent) => IsOpponentsDigimon(permanent) && permanent.HasDP; bool CanActivateCondition(Hashtable hashtable) => CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass); IEnumerator ActivateCoroutine(Hashtable hashtable) { #region De-Digivolve 1 if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, IsOpponentsDigimon)) { SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: IsOpponentsDigimon, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: null, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Degenerate, cardEffect: activateClass); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); } #endregion #region May Battle if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, IsBattleTarget)) { SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: IsBattleTarget, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: true, canEndNotMax: false, selectPermanentCoroutine: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); selectPermanentEffect.SetUpCustomMessage("Select a Digimon to battle.", "Opponent is selecting a Digimon to Battle."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { yield return ContinuousController.instance.StartCoroutine(new IBattle(card.PermanentOfThisCard(), permanent, null, true).Battle()); } } #endregion } } #endregion return cardEffects; } } }