|
|
@@ -32,7 +32,7 @@ namespace DCGO.CardEffects.EX9
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
activateClass.SetUpICardEffect("By placing 3 Ver3 digimon flipped in source, digivolve into a ver3", CanUseCondition, card);
|
|
|
activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
|
|
|
- activateClass.SetHashString("Digivolve~EX9_049");
|
|
|
+ activateClass.SetHashString("Digivolve_EX9-049");
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
string EffectDiscription()
|
|
|
@@ -40,177 +40,115 @@ namespace DCGO.CardEffects.EX9
|
|
|
return "[End of Your Turn] [Once Per Turn] By placing 3 Digimon cards with the [Ver.3] trait from your trash face down as this Digimon's bottom digivolution cards, it may digivolve into a Digimon card with the [Ver.3] trait in the hand or trash.";
|
|
|
}
|
|
|
|
|
|
- bool CanSelectCardCondition(CardSource cardSource)
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- if (cardSource.IsDigimon)
|
|
|
- {
|
|
|
- if (cardSource.EqualsTraits("Ver.3"))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.IsOwnerTurn(card);
|
|
|
}
|
|
|
|
|
|
- bool CanSelectCardCondition1(CardSource cardSource)
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- if (cardSource.EqualsTraits("Ver.3"))
|
|
|
- {
|
|
|
- if (cardSource.CanPlayCardTargetFrame(card.PermanentOfThisCard().PermanentFrame, false, activateClass))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectCardCondition) >= 3;
|
|
|
}
|
|
|
|
|
|
- bool ValidDigivolveIntoHand(CardSource source)
|
|
|
+ bool CanSelectCardCondition(CardSource cardSource)
|
|
|
{
|
|
|
- return source.EqualsTraits("Ver.3");
|
|
|
+ return cardSource.IsDigimon &&
|
|
|
+ cardSource.EqualsTraits("Ver.3");
|
|
|
}
|
|
|
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
+ bool CanSelectCardCondition1(CardSource cardSource)
|
|
|
{
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
+ if (cardSource.EqualsTraits("Ver.3"))
|
|
|
{
|
|
|
- if (CardEffectCommons.IsOwnerTurn(card))
|
|
|
+ if (cardSource.CanPlayCardTargetFrame(card.PermanentOfThisCard().PermanentFrame, false, activateClass))
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: CanSelectCardCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: null,
|
|
|
+ afterSelectCardCoroutine: AfterSelectCardCoroutine,
|
|
|
+ message: "Select 3 cards to add as source",
|
|
|
+ maxCount: 3,
|
|
|
+ canEndNotMax: true,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select 3 cards to add as source.", "The opponent is selecting 3 cards to add as source.");
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Selected Cards");
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
|
|
|
{
|
|
|
- if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ selectedCards.AddRange(cardSources);
|
|
|
+ yield return null;
|
|
|
}
|
|
|
- return false;
|
|
|
- }
|
|
|
|
|
|
- IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
- {
|
|
|
- if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
|
|
|
+ if (selectedCards.Count == 3)
|
|
|
{
|
|
|
- List<CardSource> selectedCards = new List<CardSource>();
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: CanSelectCardCondition,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- message: "Select 3 Ver.3 digimon to add as bottom digivolution card",
|
|
|
- maxCount: 3,
|
|
|
- canEndNotMax: true,
|
|
|
- isShowOpponent: false,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
- customRootCardList: card.Owner.TrashCards,
|
|
|
- canLookReverseCard: true,
|
|
|
- selectPlayer: card.Owner,
|
|
|
- cardEffect: activateClass
|
|
|
- );
|
|
|
-
|
|
|
- selectCardEffect.SetUpCustomMessage("Select 3 cards to add as bottom digivolution card.", "The opponent is selecting 3 cards to add as bottom digivolution card.");
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
-
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ foreach (var selectedCard in selectedCards)
|
|
|
{
|
|
|
- selectedCards.Add(cardSource);
|
|
|
- yield return null;
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddExecutingCard(selectedCard));
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource>() { selectedCard }, activateClass, isFacedown: true));
|
|
|
}
|
|
|
|
|
|
- if (selectedCards.Count == 3)
|
|
|
- {
|
|
|
- foreach (var selectedCard in selectedCards)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddExecutingCard(selectedCard));
|
|
|
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource>() { selectedCard }, activateClass, isFacedown: true));
|
|
|
- }
|
|
|
-
|
|
|
- bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition1);
|
|
|
- bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition1);
|
|
|
+ bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition1);
|
|
|
+ bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition1);
|
|
|
|
|
|
- if (canSelectHand || canSelectTrash)
|
|
|
+ if (canSelectHand || canSelectTrash)
|
|
|
+ {
|
|
|
+ if (canSelectHand && canSelectTrash)
|
|
|
{
|
|
|
- List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
|
|
|
- {
|
|
|
- new SelectionElement<bool>(message: $"Yes", value : true, spriteIndex: 0),
|
|
|
- new SelectionElement<bool>(message: $"No ", value : false, spriteIndex: 1),
|
|
|
- };
|
|
|
-
|
|
|
- string selectPlayerMessage = "Will you digivolve?";
|
|
|
- string notSelectPlayerMessage = "The opponent is choosing to digivolve";
|
|
|
- GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
|
|
|
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
- bool isDigivolving = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
-
|
|
|
- if (isDigivolving)
|
|
|
- {
|
|
|
- if (canSelectHand && canSelectTrash)
|
|
|
- {
|
|
|
- List<SelectionElement<bool>> selectionElements1 = new List<SelectionElement<bool>>()
|
|
|
+ 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);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- GManager.instance.userSelectionManager.SetBool(canSelectHand);
|
|
|
- }
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
- bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
- CardSource selectedCard = null;
|
|
|
-
|
|
|
- IEnumerator SelectCardCoroutine1(CardSource cardSource)
|
|
|
- {
|
|
|
- selectedCard = cardSource;
|
|
|
- yield return null;
|
|
|
- }
|
|
|
-
|
|
|
- if (fromHand)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
|
|
|
- targetPermanent: card.PermanentOfThisCard(),
|
|
|
- cardCondition: ValidDigivolveIntoHand,
|
|
|
- payCost: true,
|
|
|
- reduceCostTuple: null,
|
|
|
- fixedCostTuple: null,
|
|
|
- ignoreDigivolutionRequirementFixedCost: -1,
|
|
|
- isHand: fromHand,
|
|
|
- activateClass: activateClass,
|
|
|
- successProcess: null));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
|
|
|
- targetPermanent: card.PermanentOfThisCard(),
|
|
|
- cardCondition: ValidDigivolveIntoHand,
|
|
|
- payCost: true,
|
|
|
- reduceCostTuple: null,
|
|
|
- fixedCostTuple: null,
|
|
|
- ignoreDigivolutionRequirementFixedCost: -1,
|
|
|
- isHand: fromHand,
|
|
|
- activateClass: activateClass,
|
|
|
- successProcess: null));
|
|
|
- }
|
|
|
- }
|
|
|
+ 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);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ GManager.instance.userSelectionManager.SetBool(canSelectHand);
|
|
|
+ }
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
+ bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
+
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
|
|
|
+ targetPermanent: card.PermanentOfThisCard(),
|
|
|
+ cardCondition: CanSelectCardCondition1,
|
|
|
+ payCost: true,
|
|
|
+ reduceCostTuple: null,
|
|
|
+ fixedCostTuple: null,
|
|
|
+ ignoreDigivolutionRequirementFixedCost: -1,
|
|
|
+ isHand: fromHand,
|
|
|
+ activateClass: activateClass,
|
|
|
+ successProcess: null));
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|