using System.Collections; using System.Collections.Generic; // Dokuson Aruba namespace DCGO.CardEffects.EX11 { public class EX11_067 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Security if (timing == EffectTiming.SecuritySkill) { cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card)); } #endregion #region Start of turn set to 3 if (timing == EffectTiming.OnStartTurn) { cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card)); } #endregion #region On Play if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("1 of your Digimon w/[Lucemon] in text can digivolve into a [Lucemon] in name in hand or trash for free.", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription()); cardEffects.Add(activateClass); string EffectDescription() { return "[On Play] 1 of your Digimon with [Lucemon] in its text on the field may digivolve into a Digimon card with [Lucemon] in its name in the hand or trash without paying the cost."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.CanTriggerOnPlay(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleArea(card) && (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition) || CardEffectCommons.HasMatchConditionOwnersBreedingPermanent(card, CanSelectPermanentCondition)); } bool CanSelectPermanentCondition(Permanent permanent) { return (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) || (CardEffectCommons.IsPermanentExistsOnOwnerBreedingArea(permanent, card) && permanent.IsDigimon)) && permanent.TopCard.HasText("Lucemon"); } bool CanSelectCardCondition(CardSource cardSource) { return cardSource.IsDigimon && cardSource.ContainsCardName("Lucemon"); } IEnumerator ActivateCoroutine(Hashtable hashtable) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition, true)) { Permanent selectedPermanent = null; SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectPermanentCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: true, canEndNotMax: false, selectPermanentCoroutine: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will digivolve.", "The opponent is selecting 1 Digimon that will digivolve."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { selectedPermanent = permanent; yield return null; } if (selectedPermanent != null) { bool CanDigivolveCondition(CardSource cardSource) { return CanSelectCardCondition(cardSource) && cardSource.CanPlayCardTargetFrame(selectedPermanent.PermanentFrame, false, activateClass); } List> selectionElements = new List>(); if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanDigivolveCondition)) { selectionElements.Add(new(message: "From hand", value: 0, spriteIndex: 0)); } if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanDigivolveCondition)) { selectionElements.Add(new(message: "From trash", value: 1, spriteIndex: 0)); } selectionElements.Add(new(message: "Do not digivolve", value: 2, spriteIndex: 1)); string selectPlayerMessage = "From which area do you select a card?"; string notSelectPlayerMessage = "The opponent is choosing from which area to digivolve."; GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage); yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager .WaitForEndSelect()); int selection = GManager.instance.userSelectionManager.SelectedIntValue; if (selection != 2) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard( targetPermanent: selectedPermanent, cardCondition: CanSelectCardCondition, payCost: false, reduceCostTuple: null, fixedCostTuple: null, ignoreDigivolutionRequirementFixedCost: -1, isHand: selection == 0, activateClass: activateClass, successProcess: null)); } } } } } #endregion #region Your Turn if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Suspend this tamer to gain 1 memory", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription()); cardEffects.Add(activateClass); string EffectDescription() => "[Your Turn] When any of your Digimon digivolve into a Digimon card with [Lucemon] in its name, by suspending this Tamer, gain 1 memory."; bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card) && CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, PermanentCondition); } bool PermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) && permanent.TopCard.ContainsCardName("Lucemon"); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.CanActivateSuspendCostEffect(card); } IEnumerator ActivateCoroutine(Hashtable hashtable) { yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass( new List() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap()); yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass)); } } #endregion return cardEffects; } } }