|
|
@@ -117,132 +117,125 @@ namespace DCGO.CardEffects.BT23
|
|
|
|
|
|
#region User Selection - Play Token or Select Card Location
|
|
|
|
|
|
- if (canPlayToken || canSelectHand || canSelectTrash)
|
|
|
+ var playOptions = new List<SelectionElement<bool>>();
|
|
|
+ if (canPlayToken) playOptions.Add(new SelectionElement<bool>(message: $"Play [Atho, René & Por] Token", value: true, spriteIndex: 0));
|
|
|
+ if (canSelectHand || canSelectTrash) playOptions.Add(new SelectionElement<bool>(message: $"Player [Sistermon] in name digimon from hand or trash", value: false, spriteIndex: 1));
|
|
|
+
|
|
|
+ if (playOptions.Count == 1)
|
|
|
+ {
|
|
|
+ if (playOptions[0].Message.Contains("Token")) playToken = true;
|
|
|
+ else if (canSelectHand) playFromHand = true;
|
|
|
+ else playFromTrash = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (playOptions.Count == 2)
|
|
|
{
|
|
|
- if(canPlayToken && (canSelectHand || canSelectTrash))
|
|
|
+ string selectPlayerMessage = "Which effect will you use";
|
|
|
+ string notSelectPlayerMessage = "The opponent is which effect to use.";
|
|
|
+
|
|
|
+ GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: playOptions, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
+ var selectedOption = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
+
|
|
|
+ if (selectedOption) playToken = true;
|
|
|
+ else if (!selectedOption && canSelectHand && !canSelectTrash) playFromHand = true;
|
|
|
+ else if (!selectedOption && canSelectTrash && !canSelectHand) playFromTrash = true;
|
|
|
+ else
|
|
|
{
|
|
|
- List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
|
|
|
+ List<SelectionElement<bool>> selectionElements1 = new List<SelectionElement<bool>>()
|
|
|
{
|
|
|
- new SelectionElement<bool>(message: $"Play [Atho, René & Por] Token", value : true, spriteIndex: 0),
|
|
|
- new SelectionElement<bool>(message: $"Player [Sistermon] in name digimon from hand or trash", value : false, spriteIndex: 1),
|
|
|
+ new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
|
|
|
+ new SelectionElement<bool>(message: $"From trash", value : false, spriteIndex: 1),
|
|
|
};
|
|
|
|
|
|
- string selectPlayerMessage = "Which effect will you use";
|
|
|
- string notSelectPlayerMessage = "The opponent is which effect to use.";
|
|
|
+ string selectPlayerMessage1 = "From which area do you select a card?";
|
|
|
+ string notSelectPlayerMessage1 = "The opponent is choosing from which area to select a card.";
|
|
|
|
|
|
- GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
|
|
|
+ GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1, notSelectPlayerMessage: notSelectPlayerMessage1);
|
|
|
yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
|
|
|
- playToken = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
+ var handOrTrashSelection = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
+ if (handOrTrashSelection) playFromHand = true;
|
|
|
+ else playFromTrash = true;
|
|
|
}
|
|
|
- else if(!canPlayToken && (canSelectHand || canSelectTrash))
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if (playToken)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayAthoRenePorToken(activateClass));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(canSelectHand && canSelectTrash)
|
|
|
- {
|
|
|
- List<SelectionElement<bool>> selectionElements1 = new List<SelectionElement<bool>>()
|
|
|
- {
|
|
|
- new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
|
|
|
- new SelectionElement<bool>(message: $"From trash", value : false, spriteIndex: 1),
|
|
|
- };
|
|
|
-
|
|
|
- string selectPlayerMessage1 = "From which area do you select a card?";
|
|
|
- string notSelectPlayerMessage1 = "The opponent is choosing from which area to select a card.";
|
|
|
+ }
|
|
|
|
|
|
- GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1, notSelectPlayerMessage: notSelectPlayerMessage1);
|
|
|
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
+ #endregion
|
|
|
|
|
|
- playFromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- playFromHand = canSelectHand;
|
|
|
- }
|
|
|
+ CardSource selectedCard = null;
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedCard = cardSource;
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
|
|
|
- CardSource selectedCard = null;
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
- {
|
|
|
- selectedCard = cardSource;
|
|
|
- yield return null;
|
|
|
- }
|
|
|
+ if (playToken) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayAthoRenePorToken(activateClass: activateClass));
|
|
|
|
|
|
- if (playFromHand)
|
|
|
- {
|
|
|
- SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
-
|
|
|
- selectHandEffect.SetUp(
|
|
|
- selectPlayer: card.Owner,
|
|
|
- canTargetCondition: IsValidSistermon,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- maxCount: 1,
|
|
|
- canNoSelect: true,
|
|
|
- canEndNotMax: false,
|
|
|
- isShowOpponent: true,
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- mode: SelectHandEffect.Mode.Custom,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- selectHandEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
|
|
|
-
|
|
|
- if (selectedCard != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
- new List<CardSource>() { selectedCard },
|
|
|
- activateClass: activateClass,
|
|
|
- payCost: false,
|
|
|
- isTapped: false,
|
|
|
- root: SelectCardEffect.Root.Hand,
|
|
|
- activateETB: true));
|
|
|
- }
|
|
|
- if (playFromTrash)
|
|
|
- {
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
-
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: IsValidSistermon,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- message: "Select 1 digimon to play",
|
|
|
- maxCount: 1,
|
|
|
- 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 digimon to play", "The opponent is selecting 1 digimon to play");
|
|
|
- selectCardEffect.SetUpCustomMessage_ShowCard("Selected Digimon");
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
-
|
|
|
- if (selectedCard != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
- new List<CardSource>() { selectedCard },
|
|
|
- activateClass: activateClass,
|
|
|
- payCost: false,
|
|
|
- isTapped: false,
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
- activateETB: true));
|
|
|
- }
|
|
|
- }
|
|
|
+ if (playFromHand)
|
|
|
+ {
|
|
|
+ SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
+
|
|
|
+ selectHandEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: IsValidSistermon,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoSelect: true,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ mode: SelectHandEffect.Mode.Custom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectHandEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
|
|
|
+
|
|
|
+ if (selectedCard != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
+ new List<CardSource>() { selectedCard },
|
|
|
+ activateClass: activateClass,
|
|
|
+ payCost: false,
|
|
|
+ isTapped: false,
|
|
|
+ root: SelectCardEffect.Root.Hand,
|
|
|
+ activateETB: true));
|
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
+ if (playFromTrash)
|
|
|
+ {
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: IsValidSistermon,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select 1 digimon to play",
|
|
|
+ maxCount: 1,
|
|
|
+ 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 digimon to play", "The opponent is selecting 1 digimon to play");
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Selected Digimon");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+ if (selectedCard != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
+ new List<CardSource>() { selectedCard },
|
|
|
+ activateClass: activateClass,
|
|
|
+ payCost: false,
|
|
|
+ isTapped: false,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ activateETB: true));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#endregion
|