|
@@ -100,8 +100,8 @@ namespace DCGO.CardEffects.BT18
|
|
|
{
|
|
{
|
|
|
if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
{
|
|
{
|
|
|
- bool canSelectHand = card.Owner.HandCards.Count(CanSelectCardCondition) >= 1;
|
|
|
|
|
- bool canSelectTrash = card.Owner.TrashCards.Count(CanSelectCardCondition) >= 1;
|
|
|
|
|
|
|
+ bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition);
|
|
|
|
|
+ bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
|
|
|
|
|
|
|
|
if (canSelectHand || canSelectTrash)
|
|
if (canSelectHand || canSelectTrash)
|
|
|
{
|
|
{
|
|
@@ -129,142 +129,38 @@ namespace DCGO.CardEffects.BT18
|
|
|
bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
|
|
|
|
|
List<CardSource> selectedCards = new List<CardSource>();
|
|
List<CardSource> selectedCards = new List<CardSource>();
|
|
|
|
|
+ CardSource selectedCard = null;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- if (!fromHand)
|
|
|
|
|
|
|
+ if (fromHand)
|
|
|
{
|
|
{
|
|
|
- int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
|
|
|
|
|
-
|
|
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
|
|
- {
|
|
|
|
|
- selectedCards.Add(cardSource);
|
|
|
|
|
-
|
|
|
|
|
- yield return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ int maxCount = Math.Min(1, card.Owner.HandCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
|
|
|
|
|
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
|
|
+ SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
|
|
|
|
|
- selectCardEffect.SetUp(
|
|
|
|
|
|
|
+ selectHandEffect.SetUp(
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
canTargetCondition: CanSelectCardCondition,
|
|
canTargetCondition: CanSelectCardCondition,
|
|
|
canTargetCondition_ByPreSelecetedList: null,
|
|
canTargetCondition_ByPreSelecetedList: null,
|
|
|
canEndSelectCondition: null,
|
|
canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
|
|
- message: "Select 1 card to place on bottom of digivolution cards.",
|
|
|
|
|
maxCount: maxCount,
|
|
maxCount: maxCount,
|
|
|
|
|
+ canNoSelect: true,
|
|
|
canEndNotMax: false,
|
|
canEndNotMax: false,
|
|
|
isShowOpponent: true,
|
|
isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
|
|
- customRootCardList: null,
|
|
|
|
|
- canLookReverseCard: true,
|
|
|
|
|
- selectPlayer: card.Owner,
|
|
|
|
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
|
|
+ mode: SelectHandEffect.Mode.Custom,
|
|
|
cardEffect: activateClass);
|
|
cardEffect: activateClass);
|
|
|
|
|
|
|
|
- selectCardEffect.SetUpCustomMessage(
|
|
|
|
|
|
|
+ selectHandEffect.SetUpCustomMessage(
|
|
|
"Select 1 card to place on bottom of digivolution cards.",
|
|
"Select 1 card to place on bottom of digivolution cards.",
|
|
|
"The opponent is selecting 1 card to place on bottom of digivolution cards.");
|
|
"The opponent is selecting 1 card to place on bottom of digivolution cards.");
|
|
|
- selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
|
|
-
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
|
|
-
|
|
|
|
|
- CardSource selectedCard = null;
|
|
|
|
|
-
|
|
|
|
|
- if (selectedCards.Count >= 1)
|
|
|
|
|
- {
|
|
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
|
|
- {
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
|
|
|
|
|
- selectedCards,
|
|
|
|
|
- activateClass));
|
|
|
|
|
-
|
|
|
|
|
- selectedCard = selectedCards[0];
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (selectedCard != null)
|
|
|
|
|
- {
|
|
|
|
|
- List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
|
|
|
|
|
- .Clone()
|
|
|
|
|
- .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsOnPlay);
|
|
|
|
|
-
|
|
|
|
|
- if (candidateEffects.Count >= 1)
|
|
|
|
|
- {
|
|
|
|
|
- ICardEffect selectedEffect = null;
|
|
|
|
|
-
|
|
|
|
|
- if (candidateEffects.Count == 1)
|
|
|
|
|
- {
|
|
|
|
|
- selectedEffect = candidateEffects[0];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- List<SkillInfo> skillInfos = candidateEffects
|
|
|
|
|
- .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
|
|
|
|
|
-
|
|
|
|
|
- List<CardSource> cardSources = candidateEffects
|
|
|
|
|
- .Map(cardEffect => cardEffect.EffectSourceCard);
|
|
|
|
|
-
|
|
|
|
|
- SelectCardEffect selectSourceCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
-
|
|
|
|
|
- selectSourceCardEffect.SetUp(
|
|
|
|
|
- canTargetCondition: (cardSource) => true,
|
|
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
- canEndSelectCondition: null,
|
|
|
|
|
- canNoSelect: () => false,
|
|
|
|
|
- selectCardCoroutine: null,
|
|
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
|
|
- message: "Select 1 effect to activate.",
|
|
|
|
|
- maxCount: 1,
|
|
|
|
|
- canEndNotMax: false,
|
|
|
|
|
- isShowOpponent: false,
|
|
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
|
|
- root: SelectCardEffect.Root.Custom,
|
|
|
|
|
- customRootCardList: cardSources,
|
|
|
|
|
- canLookReverseCard: true,
|
|
|
|
|
- selectPlayer: card.Owner,
|
|
|
|
|
- cardEffect: activateClass);
|
|
|
|
|
-
|
|
|
|
|
- selectSourceCardEffect.SetNotShowCard();
|
|
|
|
|
- selectSourceCardEffect.SetUpSkillInfos(skillInfos);
|
|
|
|
|
- selectSourceCardEffect.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
|
|
|
|
|
-
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectSourceCardEffect.Activate());
|
|
|
|
|
-
|
|
|
|
|
- IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
|
|
|
|
|
- {
|
|
|
|
|
- if (selectedIndexes.Count == 1)
|
|
|
|
|
- {
|
|
|
|
|
- selectedEffect = candidateEffects[selectedIndexes[0]];
|
|
|
|
|
- yield return null;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (selectedEffect != null)
|
|
|
|
|
- {
|
|
|
|
|
- Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
|
|
|
|
|
-
|
|
|
|
|
- if (selectedEffect.CanUse(effectHashtable))
|
|
|
|
|
- {
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(
|
|
|
|
|
- ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ yield return StartCoroutine(selectHandEffect.Activate());
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- int maxCount = Math.Min(1, card.Owner.HandCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
|
|
|
|
|
-
|
|
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
|
|
- {
|
|
|
|
|
- selectedCards.Add(cardSource);
|
|
|
|
|
-
|
|
|
|
|
- yield return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
|
|
|
|
|
|
|
|
SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
|
|
@@ -280,7 +176,7 @@ namespace DCGO.CardEffects.BT18
|
|
|
canEndNotMax: false,
|
|
canEndNotMax: false,
|
|
|
isShowOpponent: true,
|
|
isShowOpponent: true,
|
|
|
mode: SelectCardEffect.Mode.Custom,
|
|
mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: SelectCardEffect.Root.Hand,
|
|
|
|
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
customRootCardList: null,
|
|
customRootCardList: null,
|
|
|
canLookReverseCard: true,
|
|
canLookReverseCard: true,
|
|
|
selectPlayer: card.Owner,
|
|
selectPlayer: card.Owner,
|
|
@@ -292,89 +188,89 @@ namespace DCGO.CardEffects.BT18
|
|
|
selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
|
|
|
|
|
yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- CardSource selectedCard = null;
|
|
|
|
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
|
|
+ {
|
|
|
|
|
+ selectedCard = cardSource;
|
|
|
|
|
|
|
|
- if (selectedCards.Count >= 1)
|
|
|
|
|
- {
|
|
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
|
|
- {
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
|
|
|
|
|
- selectedCards,
|
|
|
|
|
- activateClass));
|
|
|
|
|
|
|
+ yield return null;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- selectedCard = selectedCards[0];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (selectedCard != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
|
|
|
|
|
+ {
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
|
|
|
|
|
+ new List<CardSource> { selectedCard },
|
|
|
|
|
+ activateClass));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (selectedCard != null)
|
|
|
|
|
- {
|
|
|
|
|
- List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
|
|
|
|
|
|
|
+ List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
|
|
|
.Clone()
|
|
.Clone()
|
|
|
.Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsOnPlay);
|
|
.Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsOnPlay);
|
|
|
|
|
|
|
|
- if (candidateEffects.Count >= 1)
|
|
|
|
|
- {
|
|
|
|
|
- ICardEffect selectedEffect = null;
|
|
|
|
|
|
|
+ if (candidateEffects.Count >= 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ ICardEffect selectedEffect = null;
|
|
|
|
|
|
|
|
- if (candidateEffects.Count == 1)
|
|
|
|
|
- {
|
|
|
|
|
- selectedEffect = candidateEffects[0];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (candidateEffects.Count == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ selectedEffect = candidateEffects[0];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- else
|
|
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ List<SkillInfo> skillInfos = candidateEffects
|
|
|
|
|
+ .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
|
|
|
|
|
+
|
|
|
|
|
+ List<CardSource> cardSources = candidateEffects
|
|
|
|
|
+ .Map(cardEffect => cardEffect.EffectSourceCard);
|
|
|
|
|
+
|
|
|
|
|
+ SelectCardEffect selectSourceCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectSourceCardEffect.SetUp(
|
|
|
|
|
+ canTargetCondition: (cardSource) => true,
|
|
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
+ canEndSelectCondition: null,
|
|
|
|
|
+ canNoSelect: () => false,
|
|
|
|
|
+ selectCardCoroutine: null,
|
|
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
|
|
+ message: "Select 1 effect to activate.",
|
|
|
|
|
+ maxCount: 1,
|
|
|
|
|
+ canEndNotMax: false,
|
|
|
|
|
+ isShowOpponent: false,
|
|
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
|
|
+ root: SelectCardEffect.Root.Custom,
|
|
|
|
|
+ customRootCardList: cardSources,
|
|
|
|
|
+ canLookReverseCard: true,
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ selectSourceCardEffect.SetNotShowCard();
|
|
|
|
|
+ selectSourceCardEffect.SetUpSkillInfos(skillInfos);
|
|
|
|
|
+ selectSourceCardEffect.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectSourceCardEffect.Activate());
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
|
|
|
{
|
|
{
|
|
|
- List<SkillInfo> skillInfos = candidateEffects
|
|
|
|
|
- .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
|
|
|
|
|
-
|
|
|
|
|
- List<CardSource> cardSources = candidateEffects
|
|
|
|
|
- .Map(cardEffect => cardEffect.EffectSourceCard);
|
|
|
|
|
-
|
|
|
|
|
- SelectCardEffect selectSourceCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
-
|
|
|
|
|
- selectSourceCardEffect.SetUp(
|
|
|
|
|
- canTargetCondition: (cardSource) => true,
|
|
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
- canEndSelectCondition: null,
|
|
|
|
|
- canNoSelect: () => false,
|
|
|
|
|
- selectCardCoroutine: null,
|
|
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
|
|
- message: "Select 1 effect to activate.",
|
|
|
|
|
- maxCount: 1,
|
|
|
|
|
- canEndNotMax: false,
|
|
|
|
|
- isShowOpponent: false,
|
|
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
|
|
- root: SelectCardEffect.Root.Custom,
|
|
|
|
|
- customRootCardList: cardSources,
|
|
|
|
|
- canLookReverseCard: true,
|
|
|
|
|
- selectPlayer: card.Owner,
|
|
|
|
|
- cardEffect: activateClass);
|
|
|
|
|
-
|
|
|
|
|
- selectSourceCardEffect.SetNotShowCard();
|
|
|
|
|
- selectSourceCardEffect.SetUpSkillInfos(skillInfos);
|
|
|
|
|
- selectSourceCardEffect.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
|
|
|
|
|
-
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectSourceCardEffect.Activate());
|
|
|
|
|
-
|
|
|
|
|
- IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
|
|
|
|
|
|
|
+ if (selectedIndexes.Count == 1)
|
|
|
{
|
|
{
|
|
|
- if (selectedIndexes.Count == 1)
|
|
|
|
|
- {
|
|
|
|
|
- selectedEffect = candidateEffects[selectedIndexes[0]];
|
|
|
|
|
- yield return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ selectedEffect = candidateEffects[selectedIndexes[0]];
|
|
|
|
|
+ yield return null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (selectedEffect != null)
|
|
|
|
|
- {
|
|
|
|
|
- Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
|
|
|
|
|
|
|
+ if (selectedEffect != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
|
|
|
|
|
|
|
|
- if (selectedEffect.CanUse(effectHashtable))
|
|
|
|
|
- {
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(
|
|
|
|
|
- ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (selectedEffect.CanUse(effectHashtable))
|
|
|
|
|
+ {
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(
|
|
|
|
|
+ ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -444,8 +340,8 @@ namespace DCGO.CardEffects.BT18
|
|
|
{
|
|
{
|
|
|
if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
{
|
|
{
|
|
|
- bool canSelectHand = card.Owner.HandCards.Count(CanSelectCardCondition) >= 1;
|
|
|
|
|
- bool canSelectTrash = card.Owner.TrashCards.Count(CanSelectCardCondition) >= 1;
|
|
|
|
|
|
|
+ bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition);
|
|
|
|
|
+ bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
|
|
|
|
|
|
|
|
if (canSelectHand || canSelectTrash)
|
|
if (canSelectHand || canSelectTrash)
|
|
|
{
|
|
{
|
|
@@ -473,142 +369,38 @@ namespace DCGO.CardEffects.BT18
|
|
|
bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
|
|
|
|
|
List<CardSource> selectedCards = new List<CardSource>();
|
|
List<CardSource> selectedCards = new List<CardSource>();
|
|
|
|
|
+ CardSource selectedCard = null;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- if (!fromHand)
|
|
|
|
|
|
|
+ if (fromHand)
|
|
|
{
|
|
{
|
|
|
- int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
|
|
|
|
|
-
|
|
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
|
|
- {
|
|
|
|
|
- selectedCards.Add(cardSource);
|
|
|
|
|
-
|
|
|
|
|
- yield return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ int maxCount = Math.Min(1, card.Owner.HandCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
|
|
|
|
|
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
|
|
+ SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
|
|
|
|
|
- selectCardEffect.SetUp(
|
|
|
|
|
|
|
+ selectHandEffect.SetUp(
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
canTargetCondition: CanSelectCardCondition,
|
|
canTargetCondition: CanSelectCardCondition,
|
|
|
canTargetCondition_ByPreSelecetedList: null,
|
|
canTargetCondition_ByPreSelecetedList: null,
|
|
|
canEndSelectCondition: null,
|
|
canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
|
|
- message: "Select 1 card to place on bottom of digivolution cards.",
|
|
|
|
|
maxCount: maxCount,
|
|
maxCount: maxCount,
|
|
|
|
|
+ canNoSelect: true,
|
|
|
canEndNotMax: false,
|
|
canEndNotMax: false,
|
|
|
isShowOpponent: true,
|
|
isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
|
|
- customRootCardList: null,
|
|
|
|
|
- canLookReverseCard: true,
|
|
|
|
|
- selectPlayer: card.Owner,
|
|
|
|
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
|
|
+ mode: SelectHandEffect.Mode.Custom,
|
|
|
cardEffect: activateClass);
|
|
cardEffect: activateClass);
|
|
|
|
|
|
|
|
- selectCardEffect.SetUpCustomMessage(
|
|
|
|
|
|
|
+ selectHandEffect.SetUpCustomMessage(
|
|
|
"Select 1 card to place on bottom of digivolution cards.",
|
|
"Select 1 card to place on bottom of digivolution cards.",
|
|
|
"The opponent is selecting 1 card to place on bottom of digivolution cards.");
|
|
"The opponent is selecting 1 card to place on bottom of digivolution cards.");
|
|
|
- selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
|
|
-
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
|
|
-
|
|
|
|
|
- CardSource selectedCard = null;
|
|
|
|
|
-
|
|
|
|
|
- if (selectedCards.Count >= 1)
|
|
|
|
|
- {
|
|
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
|
|
- {
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
|
|
|
|
|
- selectedCards,
|
|
|
|
|
- activateClass));
|
|
|
|
|
-
|
|
|
|
|
- selectedCard = selectedCards[0];
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (selectedCard != null)
|
|
|
|
|
- {
|
|
|
|
|
- List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
|
|
|
|
|
- .Clone()
|
|
|
|
|
- .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsOnPlay);
|
|
|
|
|
-
|
|
|
|
|
- if (candidateEffects.Count >= 1)
|
|
|
|
|
- {
|
|
|
|
|
- ICardEffect selectedEffect = null;
|
|
|
|
|
-
|
|
|
|
|
- if (candidateEffects.Count == 1)
|
|
|
|
|
- {
|
|
|
|
|
- selectedEffect = candidateEffects[0];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- List<SkillInfo> skillInfos = candidateEffects
|
|
|
|
|
- .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
|
|
|
|
|
-
|
|
|
|
|
- List<CardSource> cardSources = candidateEffects
|
|
|
|
|
- .Map(cardEffect => cardEffect.EffectSourceCard);
|
|
|
|
|
-
|
|
|
|
|
- SelectCardEffect selectSourceCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
-
|
|
|
|
|
- selectSourceCardEffect.SetUp(
|
|
|
|
|
- canTargetCondition: (cardSource) => true,
|
|
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
- canEndSelectCondition: null,
|
|
|
|
|
- canNoSelect: () => false,
|
|
|
|
|
- selectCardCoroutine: null,
|
|
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
|
|
- message: "Select 1 effect to activate.",
|
|
|
|
|
- maxCount: 1,
|
|
|
|
|
- canEndNotMax: false,
|
|
|
|
|
- isShowOpponent: false,
|
|
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
|
|
- root: SelectCardEffect.Root.Custom,
|
|
|
|
|
- customRootCardList: cardSources,
|
|
|
|
|
- canLookReverseCard: true,
|
|
|
|
|
- selectPlayer: card.Owner,
|
|
|
|
|
- cardEffect: activateClass);
|
|
|
|
|
-
|
|
|
|
|
- selectSourceCardEffect.SetNotShowCard();
|
|
|
|
|
- selectSourceCardEffect.SetUpSkillInfos(skillInfos);
|
|
|
|
|
- selectSourceCardEffect.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
|
|
|
|
|
-
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectSourceCardEffect.Activate());
|
|
|
|
|
-
|
|
|
|
|
- IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
|
|
|
|
|
- {
|
|
|
|
|
- if (selectedIndexes.Count == 1)
|
|
|
|
|
- {
|
|
|
|
|
- selectedEffect = candidateEffects[selectedIndexes[0]];
|
|
|
|
|
- yield return null;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (selectedEffect != null)
|
|
|
|
|
- {
|
|
|
|
|
- Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
|
|
|
|
|
-
|
|
|
|
|
- if (selectedEffect.CanUse(effectHashtable))
|
|
|
|
|
- {
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(
|
|
|
|
|
- ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ yield return StartCoroutine(selectHandEffect.Activate());
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- int maxCount = Math.Min(1, card.Owner.HandCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
|
|
|
|
|
-
|
|
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
|
|
- {
|
|
|
|
|
- selectedCards.Add(cardSource);
|
|
|
|
|
-
|
|
|
|
|
- yield return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
|
|
|
|
|
|
|
|
SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
|
|
@@ -624,7 +416,7 @@ namespace DCGO.CardEffects.BT18
|
|
|
canEndNotMax: false,
|
|
canEndNotMax: false,
|
|
|
isShowOpponent: true,
|
|
isShowOpponent: true,
|
|
|
mode: SelectCardEffect.Mode.Custom,
|
|
mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: SelectCardEffect.Root.Hand,
|
|
|
|
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
customRootCardList: null,
|
|
customRootCardList: null,
|
|
|
canLookReverseCard: true,
|
|
canLookReverseCard: true,
|
|
|
selectPlayer: card.Owner,
|
|
selectPlayer: card.Owner,
|
|
@@ -636,89 +428,89 @@ namespace DCGO.CardEffects.BT18
|
|
|
selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
|
|
|
|
|
yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- CardSource selectedCard = null;
|
|
|
|
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
|
|
+ {
|
|
|
|
|
+ selectedCard = cardSource;
|
|
|
|
|
|
|
|
- if (selectedCards.Count >= 1)
|
|
|
|
|
- {
|
|
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
|
|
- {
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
|
|
|
|
|
- selectedCards,
|
|
|
|
|
- activateClass));
|
|
|
|
|
|
|
+ yield return null;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- selectedCard = selectedCards[0];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (selectedCard != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
|
|
|
|
|
+ {
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
|
|
|
|
|
+ new List<CardSource> { selectedCard },
|
|
|
|
|
+ activateClass));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (selectedCard != null)
|
|
|
|
|
- {
|
|
|
|
|
- List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
|
|
|
|
|
|
|
+ List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
|
|
|
.Clone()
|
|
.Clone()
|
|
|
.Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsOnPlay);
|
|
.Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsOnPlay);
|
|
|
|
|
|
|
|
- if (candidateEffects.Count >= 1)
|
|
|
|
|
- {
|
|
|
|
|
- ICardEffect selectedEffect = null;
|
|
|
|
|
|
|
+ if (candidateEffects.Count >= 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ ICardEffect selectedEffect = null;
|
|
|
|
|
|
|
|
- if (candidateEffects.Count == 1)
|
|
|
|
|
- {
|
|
|
|
|
- selectedEffect = candidateEffects[0];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (candidateEffects.Count == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ selectedEffect = candidateEffects[0];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- else
|
|
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ List<SkillInfo> skillInfos = candidateEffects
|
|
|
|
|
+ .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
|
|
|
|
|
+
|
|
|
|
|
+ List<CardSource> cardSources = candidateEffects
|
|
|
|
|
+ .Map(cardEffect => cardEffect.EffectSourceCard);
|
|
|
|
|
+
|
|
|
|
|
+ SelectCardEffect selectSourceCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectSourceCardEffect.SetUp(
|
|
|
|
|
+ canTargetCondition: (cardSource) => true,
|
|
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
+ canEndSelectCondition: null,
|
|
|
|
|
+ canNoSelect: () => false,
|
|
|
|
|
+ selectCardCoroutine: null,
|
|
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
|
|
+ message: "Select 1 effect to activate.",
|
|
|
|
|
+ maxCount: 1,
|
|
|
|
|
+ canEndNotMax: false,
|
|
|
|
|
+ isShowOpponent: false,
|
|
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
|
|
+ root: SelectCardEffect.Root.Custom,
|
|
|
|
|
+ customRootCardList: cardSources,
|
|
|
|
|
+ canLookReverseCard: true,
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ selectSourceCardEffect.SetNotShowCard();
|
|
|
|
|
+ selectSourceCardEffect.SetUpSkillInfos(skillInfos);
|
|
|
|
|
+ selectSourceCardEffect.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectSourceCardEffect.Activate());
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
|
|
|
{
|
|
{
|
|
|
- List<SkillInfo> skillInfos = candidateEffects
|
|
|
|
|
- .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
|
|
|
|
|
-
|
|
|
|
|
- List<CardSource> cardSources = candidateEffects
|
|
|
|
|
- .Map(cardEffect => cardEffect.EffectSourceCard);
|
|
|
|
|
-
|
|
|
|
|
- SelectCardEffect selectSourceCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
-
|
|
|
|
|
- selectSourceCardEffect.SetUp(
|
|
|
|
|
- canTargetCondition: (cardSource) => true,
|
|
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
- canEndSelectCondition: null,
|
|
|
|
|
- canNoSelect: () => false,
|
|
|
|
|
- selectCardCoroutine: null,
|
|
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
|
|
- message: "Select 1 effect to activate.",
|
|
|
|
|
- maxCount: 1,
|
|
|
|
|
- canEndNotMax: false,
|
|
|
|
|
- isShowOpponent: false,
|
|
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
|
|
- root: SelectCardEffect.Root.Custom,
|
|
|
|
|
- customRootCardList: cardSources,
|
|
|
|
|
- canLookReverseCard: true,
|
|
|
|
|
- selectPlayer: card.Owner,
|
|
|
|
|
- cardEffect: activateClass);
|
|
|
|
|
-
|
|
|
|
|
- selectSourceCardEffect.SetNotShowCard();
|
|
|
|
|
- selectSourceCardEffect.SetUpSkillInfos(skillInfos);
|
|
|
|
|
- selectSourceCardEffect.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
|
|
|
|
|
-
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectSourceCardEffect.Activate());
|
|
|
|
|
-
|
|
|
|
|
- IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
|
|
|
|
|
|
|
+ if (selectedIndexes.Count == 1)
|
|
|
{
|
|
{
|
|
|
- if (selectedIndexes.Count == 1)
|
|
|
|
|
- {
|
|
|
|
|
- selectedEffect = candidateEffects[selectedIndexes[0]];
|
|
|
|
|
- yield return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ selectedEffect = candidateEffects[selectedIndexes[0]];
|
|
|
|
|
+ yield return null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (selectedEffect != null)
|
|
|
|
|
- {
|
|
|
|
|
- Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
|
|
|
|
|
|
|
+ if (selectedEffect != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
|
|
|
|
|
|
|
|
- if (selectedEffect.CanUse(effectHashtable))
|
|
|
|
|
- {
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(
|
|
|
|
|
- ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (selectedEffect.CanUse(effectHashtable))
|
|
|
|
|
+ {
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(
|
|
|
|
|
+ ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|