using System.Collections; using System.Collections.Generic; namespace DCGO.CardEffects.EX7 { public class EX7_040 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Alternate Digivolution if (timing == EffectTiming.None) { bool PermanentCondition(Permanent targetPermanent) { return targetPermanent.TopCard.IsLevel2 && targetPermanent.TopCard.ContainsTraits("Three Musketeers"); } cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect( permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null) ); } #endregion #region On Play if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Trash 1 [Three Musketeers], ", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription()); cardEffects.Add(activateClass); string EffectDescription() { return "[On Play] By trashing 1 card with the [Three Musketeers] trait in your hand, ."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnPlay(hashtable, card); } bool HasThreeMusketeersInTrait(CardSource cardSource) { return cardSource.ContainsTraits("Three Musketeers"); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.HasMatchConditionOwnersHand(card, HasThreeMusketeersInTrait); } IEnumerator ActivateCoroutine(Hashtable hashtable) { SelectHandEffect selectHandEffect = GManager.instance.GetComponent(); selectHandEffect.SetUp( canTargetCondition: HasThreeMusketeersInTrait, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, canNoSelect: true, selectCardCoroutine: null, afterSelectCardCoroutine: AfterSelectCardCoroutine, maxCount: 1, canEndNotMax: false, isShowOpponent: true, mode: SelectHandEffect.Mode.Discard, selectPlayer: card.Owner, cardEffect: activateClass); selectHandEffect.SetUpCustomMessage("Select 1 card with [Three Musketeers] trait to discard.", "The opponent is selecting 1 card with [Three Musketeers] trait to discard."); yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate()); IEnumerator AfterSelectCardCoroutine(List cardSources) { if (cardSources.Count > 0) { yield return ContinuousController.instance.StartCoroutine( new DrawClass(card.Owner, 2, activateClass).Draw()); } } } } #endregion #region Reboot - ESS if (timing == EffectTiming.None) { cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect( isInheritedEffect: true, card: card, condition: null)); } #endregion return cardEffects; } } }