|
|
@@ -12,13 +12,29 @@ namespace DCGO.CardEffects.BT21
|
|
|
{
|
|
|
List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
|
|
|
- #region Digivolution condition
|
|
|
- if(timing == EffectTiming.None)
|
|
|
+ #region Alternate Digivolution Requirement - Three Musketeers
|
|
|
+
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ static bool PermanentCondition(Permanent targetPermanent)
|
|
|
+ {
|
|
|
+ return targetPermanent.Level == 4 && targetPermanent.TopCard.HasText("Three Musketeers");
|
|
|
+ }
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Alternative Digivolution Condition - Sup.
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
{
|
|
|
- bool Condition(Permanent permanent)
|
|
|
+ bool PermanentCondition(Permanent targetPermanent)
|
|
|
{
|
|
|
- return permanent.Level == 4 && permanent.TopCard.HasText("Three Musketeers");
|
|
|
+ return targetPermanent.TopCard.EqualsTraits("Sup.");
|
|
|
}
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 4, ignoreDigivolutionRequirement: false, card: card, condition: null));
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
@@ -58,7 +74,7 @@ namespace DCGO.CardEffects.BT21
|
|
|
#region OnPlay/WhenDigivolving/WhenAttacking shared
|
|
|
bool CanTuckOrTrash(CardSource cardSource)
|
|
|
{
|
|
|
- return card.EqualsTraits("Appmon") || card.HasThreeMusketeersTraits;
|
|
|
+ return cardSource.EqualsTraits("Appmon") || cardSource.HasThreeMusketeersTraits;
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
@@ -373,38 +389,42 @@ namespace DCGO.CardEffects.BT21
|
|
|
|
|
|
yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
|
|
|
+ Permanent selectedPermanent = null;
|
|
|
+
|
|
|
IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
{
|
|
|
- Permanent selectedPermanent = permanent;
|
|
|
+ selectedPermanent = permanent;
|
|
|
|
|
|
- if (selectedPermanent != null)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(new List<CardSource>() { selectedCards[0] }, activateClass));
|
|
|
-
|
|
|
- #region Immunities
|
|
|
-
|
|
|
- bool CardEffectCondition(ICardEffect cardEffect)
|
|
|
- {
|
|
|
- return CardEffectCommons.IsOpponentEffect(cardEffect, card);
|
|
|
- }
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotReturnToHand(
|
|
|
- targetPermanent: card.PermanentOfThisCard(),
|
|
|
- cardEffectCondition: CardEffectCondition,
|
|
|
- effectDuration: EffectDuration.UntilOpponentTurnEnd,
|
|
|
- activateClass: activateClass,
|
|
|
- effectName: "Can't return to hand by opponent's effects"));
|
|
|
+ if (selectedPermanent != null)
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(new List<CardSource>() { selectedCards[0] }, activateClass));
|
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotReturnToDeck(
|
|
|
- targetPermanent: card.PermanentOfThisCard(),
|
|
|
- cardEffectCondition: CardEffectCondition,
|
|
|
- effectDuration: EffectDuration.UntilOpponentTurnEnd,
|
|
|
- activateClass: activateClass,
|
|
|
- effectName: "Can't return to deck by opponent's effects"));
|
|
|
+ #region Immunities
|
|
|
|
|
|
- ActivateDeDigivolveProtection();
|
|
|
- #endregion
|
|
|
+ bool CardEffectCondition(ICardEffect cardEffect)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsOpponentEffect(cardEffect, card);
|
|
|
}
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotReturnToHand(
|
|
|
+ targetPermanent: selectedPermanent,
|
|
|
+ cardEffectCondition: CardEffectCondition,
|
|
|
+ effectDuration: EffectDuration.UntilOpponentTurnEnd,
|
|
|
+ activateClass: activateClass,
|
|
|
+ effectName: "Can't return to hand by opponent's effects"));
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotReturnToDeck(
|
|
|
+ targetPermanent: selectedPermanent,
|
|
|
+ cardEffectCondition: CardEffectCondition,
|
|
|
+ effectDuration: EffectDuration.UntilOpponentTurnEnd,
|
|
|
+ activateClass: activateClass,
|
|
|
+ effectName: "Can't return to deck by opponent's effects"));
|
|
|
+
|
|
|
+ ActivateDeDigivolveProtection();
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -415,7 +435,16 @@ namespace DCGO.CardEffects.BT21
|
|
|
#region When Digivolving/When Attacking shared
|
|
|
bool CanActivateConditionAtkShared(Hashtable hashtable)
|
|
|
{
|
|
|
- return isExistOnField(card) && card.PermanentOfThisCard().DigivolutionCards.Some(CanTuckOrTrash);
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ card.PermanentOfThisCard().DigivolutionCards.Some(CanTuckOrTrash);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
|
|
|
+ return permanent.DigivolutionCards.Count(CanTuckOrTrash) >= 1;
|
|
|
+
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
bool DedigivolveTarget(Permanent permanent)
|
|
|
@@ -447,47 +476,24 @@ namespace DCGO.CardEffects.BT21
|
|
|
{
|
|
|
bool trashed = false;
|
|
|
|
|
|
- List<CardSource> selectedCards = new List<CardSource>();
|
|
|
-
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
-
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: CanTuckOrTrash,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- message: "Select 1 [Three Musketeers] or [Appmon] card to trash.",
|
|
|
- maxCount: 1,
|
|
|
- canEndNotMax: false,
|
|
|
- isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: SelectCardEffect.Root.Custom,
|
|
|
- customRootCardList: card.PermanentOfThisCard().DigivolutionCards,
|
|
|
- canLookReverseCard: true,
|
|
|
- selectPlayer: card.Owner,
|
|
|
- cardEffect: null);
|
|
|
-
|
|
|
- selectCardEffect.SetUpCustomMessage("Select 1 [Three Musketeers] or [Appmon] card to trash.", "The opponent is selecting 1 [Three Musketeers] or [Appmon] card to trash.");
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
-
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
|
|
|
+ permanentCondition: CanSelectPermanentCondition,
|
|
|
+ cardCondition: CanTuckOrTrash,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoTrash: false,
|
|
|
+ isFromOnly1Permanent: false,
|
|
|
+ activateClass: activateClass,
|
|
|
+ afterSelectionCoroutine: AfterTrashedCards
|
|
|
+ ));
|
|
|
+
|
|
|
+ IEnumerator AfterTrashedCards(Permanent permanent, List<CardSource> cards)
|
|
|
{
|
|
|
- selectedCards.Add(cardSource);
|
|
|
+ if(cards.Count > 0)
|
|
|
+ trashed = true;
|
|
|
|
|
|
yield return null;
|
|
|
}
|
|
|
|
|
|
- if (selectedCards.Count >= 1)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(new ITrashDigivolutionCards(card.PermanentOfThisCard(), selectedCards, activateClass).TrashDigivolutionCards());
|
|
|
-
|
|
|
- trashed = true;
|
|
|
- selectedCards.Clear();
|
|
|
- }
|
|
|
-
|
|
|
if (trashed)
|
|
|
{
|
|
|
if (CardEffectCommons.HasMatchConditionPermanent(DedigivolveTarget))
|
|
|
@@ -544,47 +550,24 @@ namespace DCGO.CardEffects.BT21
|
|
|
{
|
|
|
bool trashed = false;
|
|
|
|
|
|
- List<CardSource> selectedCards = new List<CardSource>();
|
|
|
-
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
-
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: CanTuckOrTrash,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- message: "Select 1 [Three Musketeers] or [Appmon] card to trash.",
|
|
|
- maxCount: 1,
|
|
|
- canEndNotMax: false,
|
|
|
- isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: SelectCardEffect.Root.Custom,
|
|
|
- customRootCardList: card.PermanentOfThisCard().DigivolutionCards,
|
|
|
- canLookReverseCard: true,
|
|
|
- selectPlayer: card.Owner,
|
|
|
- cardEffect: null);
|
|
|
-
|
|
|
- selectCardEffect.SetUpCustomMessage("Select 1 [Three Musketeers] or [Appmon] card to trash.", "The opponent is selecting 1 [Three Musketeers] or [Appmon] card to trash.");
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
-
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
|
|
|
+ permanentCondition: CanSelectPermanentCondition,
|
|
|
+ cardCondition: CanTuckOrTrash,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoTrash: false,
|
|
|
+ isFromOnly1Permanent: false,
|
|
|
+ activateClass: activateClass,
|
|
|
+ afterSelectionCoroutine: AfterTrashedCards
|
|
|
+ ));
|
|
|
+
|
|
|
+ IEnumerator AfterTrashedCards(Permanent permanent, List<CardSource> cards)
|
|
|
{
|
|
|
- selectedCards.Add(cardSource);
|
|
|
+ if (cards.Count > 0)
|
|
|
+ trashed = true;
|
|
|
|
|
|
yield return null;
|
|
|
}
|
|
|
|
|
|
- if (selectedCards.Count >= 1)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(new ITrashDigivolutionCards(card.PermanentOfThisCard(), selectedCards, activateClass).TrashDigivolutionCards());
|
|
|
-
|
|
|
- trashed = true;
|
|
|
- selectedCards.Clear();
|
|
|
- }
|
|
|
-
|
|
|
if (trashed)
|
|
|
{
|
|
|
if (CardEffectCommons.HasMatchConditionPermanent(DedigivolveTarget))
|
|
|
@@ -661,7 +644,7 @@ namespace DCGO.CardEffects.BT21
|
|
|
|
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return isExistOnField(card) && CardEffectCommons.HasMatchConditionOpponentsPermanent(card, DeletionTargetCondition);
|
|
|
+ return isExistOnField(card) && CardEffectCommons.HasMatchConditionPermanent(DeletionTargetCondition);
|
|
|
}
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|