|
@@ -77,6 +77,7 @@ namespace DCGO.CardEffects.BT19
|
|
|
if (selectedCard != null)
|
|
if (selectedCard != null)
|
|
|
{
|
|
{
|
|
|
yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: selectedCard, cardEffect: activateClass));
|
|
yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: selectedCard, cardEffect: activateClass));
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -175,41 +176,112 @@ namespace DCGO.CardEffects.BT19
|
|
|
{
|
|
{
|
|
|
if (CardEffectCommons.HasMatchConditionOwnersHand(card, IsCyberdramon))
|
|
if (CardEffectCommons.HasMatchConditionOwnersHand(card, IsCyberdramon))
|
|
|
{
|
|
{
|
|
|
- int maxCount = Math.Min(1, card.Owner.HandCards.Count(IsCyberdramon));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
|
|
|
|
+ bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, IsCyberdramon);
|
|
|
|
|
+ bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsCyberdramon);
|
|
|
|
|
|
|
|
- selectHandEffect.SetUp(
|
|
|
|
|
- selectPlayer: card.Owner,
|
|
|
|
|
- canTargetCondition: IsCyberdramon,
|
|
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
- canEndSelectCondition: null,
|
|
|
|
|
- maxCount: maxCount,
|
|
|
|
|
- canNoSelect: true,
|
|
|
|
|
- canEndNotMax: false,
|
|
|
|
|
- isShowOpponent: false,
|
|
|
|
|
- selectCardCoroutine: null,
|
|
|
|
|
- afterSelectCardCoroutine: SelectCardCoroutine,
|
|
|
|
|
- mode: SelectHandEffect.Mode.Custom,
|
|
|
|
|
- cardEffect: activateClass);
|
|
|
|
|
|
|
+ if (canSelectHand || canSelectTrash)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (canSelectHand && canSelectTrash)
|
|
|
|
|
+ {
|
|
|
|
|
+ List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
|
|
|
|
|
+ {
|
|
|
|
|
+ new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
|
|
|
|
|
+ new SelectionElement<bool>(message: $"From trash", value : false, spriteIndex: 1),
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- selectHandEffect.SetUpCustomMessage("Select [Cyberdramon] to play.", "The opponent is selecting an [Cyberdramon] to play.");
|
|
|
|
|
|
|
+ string selectPlayerMessage = "From which area do you play a card?";
|
|
|
|
|
+ string notSelectPlayerMessage = "The opponent is choosing from which area to play a card.";
|
|
|
|
|
|
|
|
- yield return StartCoroutine(selectHandEffect.Activate());
|
|
|
|
|
|
|
+ GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ GManager.instance.userSelectionManager.SetBool(canSelectHand);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
|
|
+
|
|
|
|
|
+ bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
|
|
|
|
|
- IEnumerator SelectCardCoroutine(List<CardSource> selectedCards)
|
|
|
|
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
{
|
|
{
|
|
|
- if (selectedCards.Count > 0)
|
|
|
|
|
- {
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
|
|
- cardSources: selectedCards,
|
|
|
|
|
- activateClass: activateClass,
|
|
|
|
|
- payCost: false,
|
|
|
|
|
- isTapped: false,
|
|
|
|
|
- root: SelectCardEffect.Root.Hand,
|
|
|
|
|
- activateETB: true));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ selectedCards.Add(cardSource);
|
|
|
|
|
+
|
|
|
|
|
+ yield return null;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (fromHand)
|
|
|
|
|
+ {
|
|
|
|
|
+ int maxCount = Math.Min(1, card.Owner.HandCards.Count(IsCyberdramon));
|
|
|
|
|
+
|
|
|
|
|
+ SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectHandEffect.SetUp(
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
|
|
+ canTargetCondition: IsCyberdramon,
|
|
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
+ canEndSelectCondition: null,
|
|
|
|
|
+ maxCount: maxCount,
|
|
|
|
|
+ canNoSelect: true,
|
|
|
|
|
+ canEndNotMax: false,
|
|
|
|
|
+ isShowOpponent: false,
|
|
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
|
|
+ mode: SelectHandEffect.Mode.Custom,
|
|
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ selectHandEffect.SetUpCustomMessage("Select [Cyberdramon] to play.", "The opponent is selecting an [Cyberdramon] to play.");
|
|
|
|
|
+
|
|
|
|
|
+ yield return StartCoroutine(selectHandEffect.Activate());
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ int maxCount = 1;
|
|
|
|
|
+
|
|
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectCardEffect.SetUp(
|
|
|
|
|
+ canTargetCondition: IsCyberdramon,
|
|
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
+ canEndSelectCondition: null,
|
|
|
|
|
+ canNoSelect: () => true,
|
|
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
|
|
+ message: "Select 1 card to play.",
|
|
|
|
|
+ maxCount: maxCount,
|
|
|
|
|
+ canEndNotMax: false,
|
|
|
|
|
+ isShowOpponent: true,
|
|
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
|
|
+ customRootCardList: null,
|
|
|
|
|
+ canLookReverseCard: true,
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
|
|
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ SelectCardEffect.Root root = SelectCardEffect.Root.Hand;
|
|
|
|
|
+
|
|
|
|
|
+ if (!fromHand)
|
|
|
|
|
+ root = SelectCardEffect.Root.Trash;
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
|
|
+ cardSources: selectedCards,
|
|
|
|
|
+ activateClass: activateClass,
|
|
|
|
|
+ payCost: false,
|
|
|
|
|
+ isTapped: false,
|
|
|
|
|
+ root: root,
|
|
|
|
|
+ activateETB: true));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|