|
|
@@ -1,351 +1,352 @@
|
|
|
-using System;
|
|
|
-using System.Collections;
|
|
|
-using System.Collections.Generic;
|
|
|
-
|
|
|
-namespace DCGO.CardEffects.BT21
|
|
|
-{
|
|
|
- public class Snatchmon_BT21_058 : CEntity_Effect
|
|
|
- {
|
|
|
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
|
|
|
- {
|
|
|
- List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
-
|
|
|
- #region On Play
|
|
|
- if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
- {
|
|
|
- ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("Reveal 3, add 1 [Vemmon] in text, trash rest, place up to 2 [Vemmon] from trash as 1 Digimon bottom evo cards", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
- cardEffects.Add(activateClass);
|
|
|
-
|
|
|
- string EffectDiscription()
|
|
|
- {
|
|
|
- return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Vemmon] in its text among them to the hand. Trash the rest. Then, you may place up to 2 [Vemmon] from your trash as 1 of your Digimon's bottom digivolution cards.";
|
|
|
- }
|
|
|
-
|
|
|
- bool HasVemmonInText(CardSource cardSource)
|
|
|
- {
|
|
|
- return cardSource.HasText("Vemmon");
|
|
|
- }
|
|
|
-
|
|
|
- bool IsVemmon(CardSource cardSource)
|
|
|
- {
|
|
|
- return cardSource.EqualsCardName("Vemmon");
|
|
|
- }
|
|
|
-
|
|
|
- bool HasDigimonOnOwnerBattleArea(Permanent permanent)
|
|
|
- {
|
|
|
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
|
|
|
- }
|
|
|
-
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
|
|
|
- }
|
|
|
-
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
- }
|
|
|
-
|
|
|
- IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
- {
|
|
|
- List<CardSource> selectedCards = new List<CardSource>();
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
|
|
|
- revealCount: 3,
|
|
|
- simplifiedSelectCardConditions:
|
|
|
- new SimplifiedSelectCardConditionClass[]
|
|
|
- {
|
|
|
- new SimplifiedSelectCardConditionClass(
|
|
|
- canTargetCondition:HasVemmonInText,
|
|
|
- message: "Select 1 card with [Vemmon] in text.",
|
|
|
- mode: SelectCardEffect.Mode.AddHand,
|
|
|
- maxCount: 1,
|
|
|
- selectCardCoroutine: null),
|
|
|
- },
|
|
|
- remainingCardsPlace: RemainingCardsPlace.Trash,
|
|
|
- activateClass: activateClass,
|
|
|
- canNoSelect: false
|
|
|
- ));
|
|
|
-
|
|
|
- List<CardSource> selectedCardsFromTrash = new List<CardSource>();
|
|
|
-
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
- {
|
|
|
- selectedCardsFromTrash.Add(cardSource);
|
|
|
-
|
|
|
- yield return null;
|
|
|
- }
|
|
|
-
|
|
|
- int maxCountFromTrash = 2;
|
|
|
-
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
-
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: IsVemmon,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- message: "Select up to 2 cards to place on bottom of digivolution cards.",
|
|
|
- maxCount: maxCountFromTrash,
|
|
|
- canEndNotMax: true,
|
|
|
- isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
- customRootCardList: null,
|
|
|
- canLookReverseCard: true,
|
|
|
- selectPlayer: card.Owner,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- selectCardEffect.SetUpCustomMessage("Select up to 2 cards to place on bottom of digivolution cards.", "The opponent is selecting up to 2 cards to place on bottom of digivolution cards.");
|
|
|
- selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
-
|
|
|
- if (selectedCardsFromTrash.Count >= 1)
|
|
|
- {
|
|
|
- if (CardEffectCommons.HasMatchConditionPermanent(HasDigimonOnOwnerBattleArea))
|
|
|
- {
|
|
|
- int maxCountReceiverDigimon = 1;
|
|
|
-
|
|
|
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
-
|
|
|
- selectPermanentEffect.SetUp(
|
|
|
- selectPlayer: card.Owner,
|
|
|
- canTargetCondition: HasDigimonOnOwnerBattleArea,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- maxCount: maxCountReceiverDigimon,
|
|
|
- canNoSelect: true,
|
|
|
- canEndNotMax: false,
|
|
|
- selectPermanentCoroutine: SelectPermanentCoroutine,
|
|
|
- afterSelectPermanentCoroutine: null,
|
|
|
- mode: SelectPermanentEffect.Mode.Custom,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get the digivolution card(s).", "The opponent is selecting 1 Digimon that will get the digivolution card(s).");
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
-
|
|
|
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
- {
|
|
|
- Permanent selectedPermanent = permanent;
|
|
|
-
|
|
|
- if (selectedPermanent != null)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(selectedCardsFromTrash, activateClass));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region When Digivolving
|
|
|
- if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
- {
|
|
|
- ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("Reveal 3, add 1 [Vemmon] in text, trash rest, place up to 2 [Vemmon] from trash as 1 Digimon bottom evo cards", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
- cardEffects.Add(activateClass);
|
|
|
-
|
|
|
- string EffectDiscription()
|
|
|
- {
|
|
|
- return "[When Digivolving] Reveal the top 3 cards of your deck. Add 1 card with [Vemmon] in its text among them to the hand. Trash the rest. Then, you may place up to 2 [Vemmon] from your trash as 1 of your Digimon's bottom digivolution cards.";
|
|
|
- }
|
|
|
-
|
|
|
- bool HasVemmonInText(CardSource cardSource)
|
|
|
- {
|
|
|
- return cardSource.HasText("Vemmon");
|
|
|
- }
|
|
|
-
|
|
|
- bool IsVemmon(CardSource cardSource)
|
|
|
- {
|
|
|
- return cardSource.EqualsCardName("Vemmon");
|
|
|
- }
|
|
|
-
|
|
|
- bool HasDigimonOnOwnerBattleArea(Permanent permanent)
|
|
|
- {
|
|
|
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
|
|
|
- }
|
|
|
-
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
|
|
|
- }
|
|
|
-
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
- }
|
|
|
-
|
|
|
- IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
- {
|
|
|
- List<CardSource> selectedCards = new List<CardSource>();
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
|
|
|
- revealCount: 3,
|
|
|
- simplifiedSelectCardConditions:
|
|
|
- new SimplifiedSelectCardConditionClass[]
|
|
|
- {
|
|
|
- new SimplifiedSelectCardConditionClass(
|
|
|
- canTargetCondition:HasVemmonInText,
|
|
|
- message: "Select 1 card with [Vemmon] in text.",
|
|
|
- mode: SelectCardEffect.Mode.AddHand,
|
|
|
- maxCount: 1,
|
|
|
- selectCardCoroutine: null),
|
|
|
- },
|
|
|
- remainingCardsPlace: RemainingCardsPlace.Trash,
|
|
|
- activateClass: activateClass,
|
|
|
- canNoSelect: false
|
|
|
- ));
|
|
|
-
|
|
|
- List<CardSource> selectedCardsFromTrash = new List<CardSource>();
|
|
|
-
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
- {
|
|
|
- selectedCardsFromTrash.Add(cardSource);
|
|
|
-
|
|
|
- yield return null;
|
|
|
- }
|
|
|
-
|
|
|
- int maxCountFromTrash = 2;
|
|
|
-
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
-
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: IsVemmon,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- message: "Select up to 2 cards to place on bottom of digivolution cards.",
|
|
|
- maxCount: maxCountFromTrash,
|
|
|
- canEndNotMax: true,
|
|
|
- isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
- customRootCardList: null,
|
|
|
- canLookReverseCard: true,
|
|
|
- selectPlayer: card.Owner,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- selectCardEffect.SetUpCustomMessage("Select up to 2 cards to place on bottom of digivolution cards.", "The opponent is selecting up to 2 cards to place on bottom of digivolution cards.");
|
|
|
- selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
-
|
|
|
- if (selectedCardsFromTrash.Count >= 1)
|
|
|
- {
|
|
|
- if (CardEffectCommons.HasMatchConditionPermanent(HasDigimonOnOwnerBattleArea))
|
|
|
- {
|
|
|
- int maxCountReceiverDigimon = 1;
|
|
|
-
|
|
|
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
-
|
|
|
- selectPermanentEffect.SetUp(
|
|
|
- selectPlayer: card.Owner,
|
|
|
- canTargetCondition: HasDigimonOnOwnerBattleArea,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- maxCount: maxCountReceiverDigimon,
|
|
|
- canNoSelect: true,
|
|
|
- canEndNotMax: false,
|
|
|
- selectPermanentCoroutine: SelectPermanentCoroutine,
|
|
|
- afterSelectPermanentCoroutine: null,
|
|
|
- mode: SelectPermanentEffect.Mode.Custom,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get the digivolution card(s).", "The opponent is selecting 1 Digimon that will get the digivolution card(s).");
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
-
|
|
|
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
- {
|
|
|
- Permanent selectedPermanent = permanent;
|
|
|
-
|
|
|
- if (selectedPermanent != null)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(selectedCardsFromTrash, activateClass));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region All Turns Inherited
|
|
|
- if (timing == EffectTiming.OnDigivolutionCardReturnToDeckBottom)
|
|
|
- {
|
|
|
- ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("Delete 1 opponent Digimon with play cost 4 or less", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
|
|
|
- activateClass.SetIsInheritedEffect(true);
|
|
|
- activateClass.SetHashString("Delete_BT21_058");
|
|
|
- cardEffects.Add(activateClass);
|
|
|
-
|
|
|
- string EffectDiscription()
|
|
|
- {
|
|
|
- return "[All Turns] [Once Per Turn] When any [Vemmon] are returned to the bottom of the deck from this Digimon's digivolution cards, delete 1 of your opponent's Digimon with a play cost of 4 or less.";
|
|
|
- }
|
|
|
-
|
|
|
- bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
|
|
|
- {
|
|
|
- if (permanent.TopCard.HasPlayCost & permanent.TopCard.GetCostItself <= 4)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.CanTriggerOnReturnToLibraryBottomDigivolutionCard(hashtable, cardSource => cardSource.EqualsCardName("Vemmon"), card);
|
|
|
- }
|
|
|
-
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.IsExistOnBattleArea(card);
|
|
|
- }
|
|
|
-
|
|
|
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
- {
|
|
|
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
|
|
|
- {
|
|
|
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
|
|
|
-
|
|
|
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
-
|
|
|
- selectPermanentEffect.SetUp(
|
|
|
- selectPlayer: card.Owner,
|
|
|
- canTargetCondition: CanSelectPermanentCondition,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- maxCount: maxCount,
|
|
|
- canNoSelect: false,
|
|
|
- canEndNotMax: false,
|
|
|
- selectPermanentCoroutine: null,
|
|
|
- afterSelectPermanentCoroutine: null,
|
|
|
- mode: SelectPermanentEffect.Mode.Destroy,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- #endregion
|
|
|
-
|
|
|
- return cardEffects;
|
|
|
- }
|
|
|
- }
|
|
|
+using System;
|
|
|
+using System.Collections;
|
|
|
+using System.Collections.Generic;
|
|
|
+
|
|
|
+namespace DCGO.CardEffects.BT21
|
|
|
+{
|
|
|
+ //Snatchmon
|
|
|
+ public class BT21_058 : CEntity_Effect
|
|
|
+ {
|
|
|
+ public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
|
|
|
+ {
|
|
|
+ List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
+
|
|
|
+ #region On Play
|
|
|
+ if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Reveal 3, add 1 [Vemmon] in text, trash rest, place up to 2 [Vemmon] from trash as 1 Digimon bottom evo cards", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDiscription()
|
|
|
+ {
|
|
|
+ return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Vemmon] in its text among them to the hand. Trash the rest. Then, you may place up to 2 [Vemmon] from your trash as 1 of your Digimon's bottom digivolution cards.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool HasVemmonInText(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.HasText("Vemmon");
|
|
|
+ }
|
|
|
+
|
|
|
+ bool IsVemmon(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.EqualsCardName("Vemmon");
|
|
|
+ }
|
|
|
+
|
|
|
+ bool HasDigimonOnOwnerBattleArea(Permanent permanent)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
|
|
|
+ revealCount: 3,
|
|
|
+ simplifiedSelectCardConditions:
|
|
|
+ new SimplifiedSelectCardConditionClass[]
|
|
|
+ {
|
|
|
+ new SimplifiedSelectCardConditionClass(
|
|
|
+ canTargetCondition:HasVemmonInText,
|
|
|
+ message: "Select 1 card with [Vemmon] in text.",
|
|
|
+ mode: SelectCardEffect.Mode.AddHand,
|
|
|
+ maxCount: 1,
|
|
|
+ selectCardCoroutine: null),
|
|
|
+ },
|
|
|
+ remainingCardsPlace: RemainingCardsPlace.Trash,
|
|
|
+ activateClass: activateClass,
|
|
|
+ canNoSelect: false
|
|
|
+ ));
|
|
|
+
|
|
|
+ List<CardSource> selectedCardsFromTrash = new List<CardSource>();
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedCardsFromTrash.Add(cardSource);
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ int maxCountFromTrash = 2;
|
|
|
+
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: IsVemmon,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select up to 2 cards to place on bottom of digivolution cards.",
|
|
|
+ maxCount: maxCountFromTrash,
|
|
|
+ canEndNotMax: true,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select up to 2 cards to place on bottom of digivolution cards.", "The opponent is selecting up to 2 cards to place on bottom of digivolution cards.");
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+
|
|
|
+ if (selectedCardsFromTrash.Count >= 1)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.HasMatchConditionPermanent(HasDigimonOnOwnerBattleArea))
|
|
|
+ {
|
|
|
+ int maxCountReceiverDigimon = 1;
|
|
|
+
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: HasDigimonOnOwnerBattleArea,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: maxCountReceiverDigimon,
|
|
|
+ canNoSelect: true,
|
|
|
+ canEndNotMax: false,
|
|
|
+ selectPermanentCoroutine: SelectPermanentCoroutine,
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
+ mode: SelectPermanentEffect.Mode.Custom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get the digivolution card(s).", "The opponent is selecting 1 Digimon that will get the digivolution card(s).");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
+ {
|
|
|
+ Permanent selectedPermanent = permanent;
|
|
|
+
|
|
|
+ if (selectedPermanent != null)
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(selectedCardsFromTrash, activateClass));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region When Digivolving
|
|
|
+ if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Reveal 3, add 1 [Vemmon] in text, trash rest, place up to 2 [Vemmon] from trash as 1 Digimon bottom evo cards", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDiscription()
|
|
|
+ {
|
|
|
+ return "[When Digivolving] Reveal the top 3 cards of your deck. Add 1 card with [Vemmon] in its text among them to the hand. Trash the rest. Then, you may place up to 2 [Vemmon] from your trash as 1 of your Digimon's bottom digivolution cards.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool HasVemmonInText(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.HasText("Vemmon");
|
|
|
+ }
|
|
|
+
|
|
|
+ bool IsVemmon(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.EqualsCardName("Vemmon");
|
|
|
+ }
|
|
|
+
|
|
|
+ bool HasDigimonOnOwnerBattleArea(Permanent permanent)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
|
|
|
+ revealCount: 3,
|
|
|
+ simplifiedSelectCardConditions:
|
|
|
+ new SimplifiedSelectCardConditionClass[]
|
|
|
+ {
|
|
|
+ new SimplifiedSelectCardConditionClass(
|
|
|
+ canTargetCondition:HasVemmonInText,
|
|
|
+ message: "Select 1 card with [Vemmon] in text.",
|
|
|
+ mode: SelectCardEffect.Mode.AddHand,
|
|
|
+ maxCount: 1,
|
|
|
+ selectCardCoroutine: null),
|
|
|
+ },
|
|
|
+ remainingCardsPlace: RemainingCardsPlace.Trash,
|
|
|
+ activateClass: activateClass,
|
|
|
+ canNoSelect: false
|
|
|
+ ));
|
|
|
+
|
|
|
+ List<CardSource> selectedCardsFromTrash = new List<CardSource>();
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedCardsFromTrash.Add(cardSource);
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ int maxCountFromTrash = 2;
|
|
|
+
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: IsVemmon,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select up to 2 cards to place on bottom of digivolution cards.",
|
|
|
+ maxCount: maxCountFromTrash,
|
|
|
+ canEndNotMax: true,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select up to 2 cards to place on bottom of digivolution cards.", "The opponent is selecting up to 2 cards to place on bottom of digivolution cards.");
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+
|
|
|
+ if (selectedCardsFromTrash.Count >= 1)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.HasMatchConditionPermanent(HasDigimonOnOwnerBattleArea))
|
|
|
+ {
|
|
|
+ int maxCountReceiverDigimon = 1;
|
|
|
+
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: HasDigimonOnOwnerBattleArea,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: maxCountReceiverDigimon,
|
|
|
+ canNoSelect: true,
|
|
|
+ canEndNotMax: false,
|
|
|
+ selectPermanentCoroutine: SelectPermanentCoroutine,
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
+ mode: SelectPermanentEffect.Mode.Custom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get the digivolution card(s).", "The opponent is selecting 1 Digimon that will get the digivolution card(s).");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
+ {
|
|
|
+ Permanent selectedPermanent = permanent;
|
|
|
+
|
|
|
+ if (selectedPermanent != null)
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(selectedCardsFromTrash, activateClass));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region All Turns Inherited
|
|
|
+ if (timing == EffectTiming.OnDigivolutionCardReturnToDeckBottom)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Delete 1 opponent Digimon with play cost 4 or less", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
|
|
|
+ activateClass.SetIsInheritedEffect(true);
|
|
|
+ activateClass.SetHashString("Delete_BT21_058");
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDiscription()
|
|
|
+ {
|
|
|
+ return "[All Turns] [Once Per Turn] When any [Vemmon] are returned to the bottom of the deck from this Digimon's digivolution cards, delete 1 of your opponent's Digimon with a play cost of 4 or less.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
|
|
|
+ {
|
|
|
+ if (permanent.TopCard.HasPlayCost & permanent.TopCard.GetCostItself <= 4)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerOnReturnToLibraryBottomDigivolutionCard(hashtable, cardSource => cardSource.EqualsCardName("Vemmon"), card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleArea(card);
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
|
|
|
+ {
|
|
|
+ int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
|
|
|
+
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectPermanentCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: maxCount,
|
|
|
+ canNoSelect: false,
|
|
|
+ canEndNotMax: false,
|
|
|
+ selectPermanentCoroutine: null,
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
+ mode: SelectPermanentEffect.Mode.Destroy,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return cardEffects;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|