|
|
@@ -232,7 +232,197 @@ namespace DCGO.CardEffects.BT18
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- // TODO: On Deletion
|
|
|
+ #region On Deletion
|
|
|
+ if (timing == EffectTiming.OnDestroyedAnyone)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("DNA into [Millenniummon]", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDiscription()
|
|
|
+ {
|
|
|
+ return "[On Deletion] 1 of your [Machinedramon] in play and 1 [Kimeramon] in the trash may DNA Digivolve into [Millenniummon] in the hand.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool HasMachinedramon(Permanent permanent)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent) &&
|
|
|
+ permanent.TopCard.EqualsCardName("Kimeramon");
|
|
|
+ }
|
|
|
+
|
|
|
+ bool HasKimeramon(CardSource source)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnTrash(source) &&
|
|
|
+ source.EqualsCardName("Machinedramon");
|
|
|
+ }
|
|
|
+
|
|
|
+ bool HasMillenniummon(CardSource source)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnHand(source) &&
|
|
|
+ source.EqualsCardName("Millenniummon") &&
|
|
|
+ source.jogressCondition != null;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanActivateOnDeletion(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionPermanent(HasMachinedramon) &&
|
|
|
+ CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, HasKimeramon) &&
|
|
|
+ CardEffectCommons.HasMatchConditionOwnersHand(card, HasMillenniummon);
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ CardSource dnaTarget = null;
|
|
|
+ Permanent selectedPermanent = null;
|
|
|
+ CardSource selectedCardSource = null;
|
|
|
+
|
|
|
+ SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
+
|
|
|
+ selectHandEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: HasMillenniummon,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoSelect: false,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ selectCardCoroutine: SelectDNACardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ mode: SelectHandEffect.Mode.Custom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectHandEffect.SetUpCustomMessage("Select 1 Digimon to DNA digivolve.", "The opponent is selecting 1 Digimon to DNA digivolve.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectDNACardCoroutine(CardSource source)
|
|
|
+ {
|
|
|
+ dnaTarget = source;
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: HasMachinedramon,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoSelect: false,
|
|
|
+ canEndNotMax: false,
|
|
|
+ selectPermanentCoroutine: SelectPermanentCoroutine,
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
+ mode: SelectPermanentEffect.Mode.Custom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to DNA digivolve.", "The opponent is selecting 1 Digimon to DNA digivolve.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
+ {
|
|
|
+ selectedPermanent = permanent;
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (selectedPermanent != null)
|
|
|
+ {
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: HasKimeramon,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => false,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select 1 Digimon to DNA digivolve.",
|
|
|
+ maxCount: 1,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: false,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetNotShowCard();
|
|
|
+ selectCardEffect.SetNotAddLog();
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedCardSource = cardSource;
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (selectedCardSource != null)
|
|
|
+ {
|
|
|
+ #region play card from trash
|
|
|
+ Permanent playedPermanent = null;
|
|
|
+ int frameID = -1;
|
|
|
+
|
|
|
+ foreach (FieldCardFrame fieldCardFrame in selectedCardSource.Owner.fieldCardFrames)
|
|
|
+ {
|
|
|
+ if (card.CanPlayCardTargetFrame(fieldCardFrame, false, null))
|
|
|
+ {
|
|
|
+ if (fieldCardFrame.IsEmptyFrame())
|
|
|
+ {
|
|
|
+ frameID = fieldCardFrame.FrameID;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (0 <= frameID && frameID < card.Owner.fieldCardFrames.Count)
|
|
|
+ {
|
|
|
+ playedPermanent = new Permanent(new List<CardSource>() { selectedCardSource }) { IsSuspended = false };
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardObjectController.CreateNewPermanent(playedPermanent, frameID));
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ int[] JogressEvoRootsFrameIDs = { playedPermanent.PermanentFrame.FrameID, selectedPermanent.PermanentFrame.FrameID };
|
|
|
+
|
|
|
+ if (dnaTarget.CanPlayJogress(true))
|
|
|
+ {
|
|
|
+ PlayCardClass playCard = new PlayCardClass(
|
|
|
+ cardSources: new List<CardSource>() { dnaTarget },
|
|
|
+ hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
|
|
|
+ payCost: true,
|
|
|
+ targetPermanent: null,
|
|
|
+ isTapped: false,
|
|
|
+ root: SelectCardEffect.Root.Hand,
|
|
|
+ activateETB: true);
|
|
|
+
|
|
|
+ playCard.SetJogress(JogressEvoRootsFrameIDs);
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddTrashCard(selectedCardSource));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
|
|
|
#region Inherit - Sec+1
|
|
|
if (timing == EffectTiming.None)
|