|
|
@@ -1,5 +1,6 @@
|
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
|
|
|
namespace DCGO.CardEffects.BT19
|
|
|
{
|
|
|
@@ -9,34 +10,331 @@ namespace DCGO.CardEffects.BT19
|
|
|
{
|
|
|
List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
|
|
|
+ #region Alternate Digivolution
|
|
|
+
|
|
|
if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ bool PermanentCondition(Permanent targetPermanent)
|
|
|
+ {
|
|
|
+ return targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 2 &&
|
|
|
+ targetPermanent.TopCard.EqualsTraits("Xros Heart");
|
|
|
+ }
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition,
|
|
|
+ digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Decoy
|
|
|
+
|
|
|
+ if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
|
|
|
+ {
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
|
|
|
+ {
|
|
|
+ if (permanent != card.PermanentOfThisCard())
|
|
|
+ {
|
|
|
+ if (permanent.willBeRemoveField)
|
|
|
+ {
|
|
|
+ if (permanent.TopCard.EqualsTraits("Xros Heart"))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ string EffectDescription()
|
|
|
+ {
|
|
|
+ return "<Decoy (Xros Heart)>";
|
|
|
+ }
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.DecoySelfEffect(
|
|
|
+ isInheritedEffect: false,
|
|
|
+ card: card,
|
|
|
+ condition: null,
|
|
|
+ permanentCondition: CanSelectPermanentCondition,
|
|
|
+ effectName: "Decoy (Xros Heart)",
|
|
|
+ effectDiscription: EffectDescription()));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region On Deletion
|
|
|
+
|
|
|
+ if (timing == EffectTiming.OnDestroyedAnyone)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Play [ShootingStarmon] from under your Tamers", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDescription()
|
|
|
+ {
|
|
|
+ return
|
|
|
+ "[On Deletion] You may play 1 [ShootingStarmon] from under your Tamers without paying the cost. Then, place 1 [Starmons] and 1 [Pickmons] from your trash as that Digimon's bottom digivolution cards.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool PlayCardCondition(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.IsDigimon && cardSource.EqualsCardName("ShootingStarmon") &&
|
|
|
+ cardSource.CanPlayCardTargetFrame(card.PermanentOfThisCard().PermanentFrame, false, activateClass);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool TamerHasDigimonCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) &&
|
|
|
+ permanent.IsTamer && permanent.DigivolutionCards.Count(PlayCardCondition) >= 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool IsStarmonsCardCondition(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.IsDigimon && cardSource.EqualsCardName("Starmons");
|
|
|
+ }
|
|
|
+
|
|
|
+ bool IsPickmonsCardCondition(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.IsDigimon && cardSource.EqualsCardName("Pickmons");
|
|
|
+ }
|
|
|
+
|
|
|
+ bool RootCondition(SelectCardEffect.Root root)
|
|
|
+ {
|
|
|
+ return root == SelectCardEffect.Root.DigivolutionCards;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanActivateOnDeletion(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionPermanent(TamerHasDigimonCondition);
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ bool played = false;
|
|
|
+ Permanent selectedPermanent = null;
|
|
|
+
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: TamerHasDigimonCondition,
|
|
|
+ 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 Tamer.", "The opponent is selecting a Tamer.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
+ {
|
|
|
+ selectedPermanent = permanent;
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (selectedPermanent != null)
|
|
|
+ {
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: PlayCardCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select 1 digivolution card to play.",
|
|
|
+ maxCount: 1,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Custom,
|
|
|
+ customRootCardList: selectedPermanent.DigivolutionCards,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select 1 digivolution card to play.",
|
|
|
+ "The opponent is selecting 1 digivolution card to play.");
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
|
|
|
+
|
|
|
+ yield return StartCoroutine(selectCardEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedCards.Add(cardSource);
|
|
|
+
|
|
|
+ played = true;
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
+ cardSources: selectedCards,
|
|
|
+ activateClass: activateClass,
|
|
|
+ payCost: false,
|
|
|
+ isTapped: false,
|
|
|
+ root: SelectCardEffect.Root.DigivolutionCards,
|
|
|
+ activateETB: true));
|
|
|
+
|
|
|
+ played = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (played)
|
|
|
+ {
|
|
|
+ List<Permanent> playedPermanent =
|
|
|
+ CardEffectCommons.GetPlayedPermanentsFromEnterFieldHashtable(hashtable, RootCondition);
|
|
|
+ List<CardSource> selectedSourceCards = new List<CardSource>();
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedSourceCards.Add(cardSource);
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: IsStarmonsCardCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select 1 [Starmons] to place on bottom of digivolution cards.",
|
|
|
+ maxCount: 1,
|
|
|
+ canEndNotMax: true,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select 1 [Starmons] to place on bottom of digivolution cards.",
|
|
|
+ "The opponent is selecting 1 [Starmons] to place on bottom of digivolution cards.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: IsPickmonsCardCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select 1 [Pickmons] to place on bottom of digivolution cards.",
|
|
|
+ maxCount: 1,
|
|
|
+ canEndNotMax: true,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select 1 [Pickmons] to place on bottom of digivolution cards.",
|
|
|
+ "The opponent is selecting 1 [Pickmons] to place on bottom of digivolution cards.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(playedPermanent[0]
|
|
|
+ .AddDigivolutionCardsBottom(selectedSourceCards, activateClass));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region When Attacking - ESS
|
|
|
+
|
|
|
+ if (timing == EffectTiming.OnAllyAttack)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
|
|
|
+ activateClass.SetUpICardEffect("DP -2000 if this Digimon has [Xros Heart] trait", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
|
|
|
+ activateClass.SetIsInheritedEffect(true);
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
- string EffectDiscription()
|
|
|
+ string EffectDescription()
|
|
|
{
|
|
|
- return "";
|
|
|
+ return
|
|
|
+ "[When Attacking] If this Digimon has the [Xros Heart] trait, 1 of your opponent's Digimon gets -2000 DP for the turn.";
|
|
|
}
|
|
|
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return true;
|
|
|
+ return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
|
|
|
}
|
|
|
|
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return true;
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition) &&
|
|
|
+ card.PermanentOfThisCard().TopCard.EqualsTraits("Xros Heart");
|
|
|
}
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
|
- yield return null;
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectPermanentCondition,
|
|
|
+ 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 that will get DP -2000.",
|
|
|
+ "The opponent is selecting 1 Digimon that will get DP -2000.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(
|
|
|
+ CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -2000,
|
|
|
+ effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ #endregion
|
|
|
+
|
|
|
return cardEffects;
|
|
|
}
|
|
|
}
|