|
|
@@ -176,116 +176,134 @@ namespace DCGO.CardEffects.EX11
|
|
|
|
|
|
List<CardSource> selectedCards = new List<CardSource>();
|
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
|
|
|
- revealCount: 2,
|
|
|
- simplifiedSelectCardConditions:
|
|
|
- new SimplifiedSelectCardConditionClass[]
|
|
|
+ if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, targetPermanents.Contains))
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
|
|
|
+ revealCount: 2,
|
|
|
+ simplifiedSelectCardConditions:
|
|
|
+ new SimplifiedSelectCardConditionClass[]
|
|
|
+ {
|
|
|
+ new(
|
|
|
+ canTargetCondition: cardSource => cardSource.EqualsCardName("Vemmon"),
|
|
|
+ message: "Select all Vemmon",
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ maxCount: 2,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine),
|
|
|
+ },
|
|
|
+ remainingCardsPlace: RemainingCardsPlace.Trash,
|
|
|
+ activateClass: activateClass
|
|
|
+ ));
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
{
|
|
|
- new(
|
|
|
- canTargetCondition: cardSource => cardSource.EqualsCardName("Vemmon"),
|
|
|
- message: "Select all Vemmon",
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
- maxCount: 2,
|
|
|
- selectCardCoroutine: SelectCardCoroutine),
|
|
|
- },
|
|
|
- remainingCardsPlace: RemainingCardsPlace.Trash,
|
|
|
- activateClass: activateClass
|
|
|
- ));
|
|
|
-
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
- {
|
|
|
- if (cardSource != null) selectedCards.Add(cardSource);
|
|
|
- yield return null;
|
|
|
- }
|
|
|
+ if (cardSource != null) selectedCards.Add(cardSource);
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
|
|
|
- if (selectedCards.Count > 0 && CardEffectCommons.HasMatchConditionOwnersPermanent(card, targetPermanents.Contains))
|
|
|
- {
|
|
|
- while (selectedCards.Any())
|
|
|
+ if (selectedCards.Count > 0)
|
|
|
{
|
|
|
- Permanent selectedPermament = null;
|
|
|
- if (targetPermanents.Count > 1)
|
|
|
+ while (selectedCards.Any())
|
|
|
{
|
|
|
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
-
|
|
|
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersPermanentCount(card, targetPermanents.Contains));
|
|
|
-
|
|
|
- selectPermanentEffect.SetUp(
|
|
|
- selectPlayer: card.Owner,
|
|
|
- canTargetCondition: permanent => targetPermanents.Contains(permanent),
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- maxCount: maxCount,
|
|
|
- canNoSelect: false,
|
|
|
- canEndNotMax: false,
|
|
|
- selectPermanentCoroutine: SelectPermanentCoroutine,
|
|
|
- afterSelectPermanentCoroutine: null,
|
|
|
- mode: SelectPermanentEffect.Mode.Custom,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
+ Permanent selectedPermament = null;
|
|
|
+ if (targetPermanents.Count > 1)
|
|
|
{
|
|
|
- selectedPermament = permanent;
|
|
|
- yield return null;
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
+
|
|
|
+ int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersPermanentCount(card, targetPermanents.Contains));
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: permanent => targetPermanents.Contains(permanent),
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: maxCount,
|
|
|
+ canNoSelect: false,
|
|
|
+ canEndNotMax: false,
|
|
|
+ selectPermanentCoroutine: SelectPermanentCoroutine,
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
+ mode: SelectPermanentEffect.Mode.Custom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
+ {
|
|
|
+ selectedPermament = permanent;
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get the digivolution cards.", "The opponent is selecting 1 Digimon that will get the digivolution cards.");
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
}
|
|
|
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get the digivolution cards.", "The opponent is selecting 1 Digimon that will get the digivolution cards.");
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
- }
|
|
|
- else selectedPermament = targetPermanents[0];
|
|
|
+ else selectedPermament = targetPermanents[0];
|
|
|
|
|
|
- List<CardSource> digivolutionCards_fixed = new List<CardSource>();
|
|
|
- digivolutionCards_fixed.Clear(); // Clear here in cases of multiple loops
|
|
|
+ List<CardSource> digivolutionCards_fixed = new List<CardSource>();
|
|
|
+ digivolutionCards_fixed.Clear(); // Clear here in cases of multiple loops
|
|
|
|
|
|
- if (selectedCards.Count > 1)
|
|
|
- {
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
-
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: (cardSource) => true,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: CanEndSelectCondition,
|
|
|
- canNoSelect: () => false,
|
|
|
- selectCardCoroutine: null,
|
|
|
- afterSelectCardCoroutine: AfterSelectCardCoroutine,
|
|
|
- message: "Specify the order to place the cards in the digivolution cards\n(cards will be placed so that cards with lower numbers are on top).",
|
|
|
- maxCount: selectedCards.Count,
|
|
|
- canEndNotMax: true,
|
|
|
- isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: SelectCardEffect.Root.Custom,
|
|
|
- customRootCardList: selectedCards,
|
|
|
- canLookReverseCard: true,
|
|
|
- selectPlayer: card.Owner,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Cards");
|
|
|
-
|
|
|
- bool CanEndSelectCondition(List<CardSource> cardSources)
|
|
|
+ if (selectedCards.Count > 1)
|
|
|
{
|
|
|
- return !CardEffectCommons.HasNoElement(cardSources);
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: (cardSource) => true,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: CanEndSelectCondition,
|
|
|
+ canNoSelect: () => false,
|
|
|
+ selectCardCoroutine: null,
|
|
|
+ afterSelectCardCoroutine: AfterSelectCardCoroutine,
|
|
|
+ message: "Specify the order to place the cards in the digivolution cards\n(cards will be placed so that cards with lower numbers are on top).",
|
|
|
+ maxCount: selectedCards.Count,
|
|
|
+ canEndNotMax: true,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Custom,
|
|
|
+ customRootCardList: selectedCards,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Cards");
|
|
|
+
|
|
|
+ bool CanEndSelectCondition(List<CardSource> cardSources)
|
|
|
+ {
|
|
|
+ return !CardEffectCommons.HasNoElement(cardSources);
|
|
|
+ }
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
|
|
|
+ {
|
|
|
+ digivolutionCards_fixed.AddRange(cardSources);
|
|
|
+ selectedCards.RemoveAll(cardSources.Contains);
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect2(digivolutionCards_fixed, "Digivolution Cards", true, true));
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectedPermament.AddDigivolutionCardsBottom(digivolutionCards_fixed, activateClass));
|
|
|
}
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
-
|
|
|
- IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
|
|
|
+ else
|
|
|
{
|
|
|
- digivolutionCards_fixed.AddRange(cardSources);
|
|
|
- selectedCards.RemoveAll(cardSources.Contains);
|
|
|
- yield return null;
|
|
|
- }
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect2(digivolutionCards_fixed, "Digivolution Cards", true, true));
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectedPermament.AddDigivolutionCardsBottom(digivolutionCards_fixed, activateClass));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- digivolutionCards_fixed.AddRange(selectedCards);
|
|
|
- selectedCards.Clear();
|
|
|
+ digivolutionCards_fixed.AddRange(selectedCards);
|
|
|
+ selectedCards.Clear();
|
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect2(digivolutionCards_fixed, "Digivolution Cards", true, true));
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectedPermament.AddDigivolutionCardsBottom(digivolutionCards_fixed, activateClass));
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect2(digivolutionCards_fixed, "Digivolution Cards", true, true));
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectedPermament.AddDigivolutionCardsBottom(digivolutionCards_fixed, activateClass));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.RevealDeckTopCardsAndProcessForAll(
|
|
|
+ revealCount: 2,
|
|
|
+ simplifiedSelectCardCondition:
|
|
|
+ new SimplifiedSelectCardConditionClass(
|
|
|
+ canTargetCondition: null,
|
|
|
+ message: "",
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ maxCount: -1,
|
|
|
+ selectCardCoroutine: null),
|
|
|
+ remainingCardsPlace: RemainingCardsPlace.Trash,
|
|
|
+ activateClass: activateClass
|
|
|
+ ));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|