|
@@ -109,11 +109,17 @@ public class Wendigomon_ST17_04 : CEntity_Effect
|
|
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
{
|
|
{
|
|
|
- List<Permanent> selectedDigimon = new List<Permanent>();
|
|
|
|
|
|
|
+ Permanent selectedPermanent;
|
|
|
|
|
|
|
|
if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
|
|
if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
|
|
|
{
|
|
{
|
|
|
int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
|
|
int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
|
|
|
|
|
+
|
|
|
|
|
+ bool deletedOwn = false;
|
|
|
|
|
+
|
|
|
|
|
+ Permanent deletedCard = null;
|
|
|
|
|
+
|
|
|
|
|
+ int deleteCount = 1;
|
|
|
|
|
|
|
|
SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
|
|
|
|
@@ -125,60 +131,240 @@ public class Wendigomon_ST17_04 : CEntity_Effect
|
|
|
maxCount: maxCount,
|
|
maxCount: maxCount,
|
|
|
canNoSelect: false,
|
|
canNoSelect: false,
|
|
|
canEndNotMax: false,
|
|
canEndNotMax: false,
|
|
|
- selectPermanentCoroutine: null,
|
|
|
|
|
|
|
+ selectPermanentCoroutine: SelectPermanentCoroutine,
|
|
|
afterSelectPermanentCoroutine: null,
|
|
afterSelectPermanentCoroutine: null,
|
|
|
- mode: SelectPermanentEffect.Mode.Destroy,
|
|
|
|
|
|
|
+ mode: SelectPermanentEffect.Mode.Custom,
|
|
|
cardEffect: activateClass);
|
|
cardEffect: activateClass);
|
|
|
|
|
|
|
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
|
|
|
|
|
+
|
|
|
yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
|
|
|
|
|
- IEnumerator DeleteDigimonCoroutine(List<Permanent> list)
|
|
|
|
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
{
|
|
{
|
|
|
- if (list.Count == 1 && CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(list[0],card))
|
|
|
|
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
|
|
|
{
|
|
{
|
|
|
- if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, (cardSource) => CanSelectTerrierOrLop(cardSource)))
|
|
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { permanent }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator SuccessProcess()
|
|
|
{
|
|
{
|
|
|
- int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectTerrierOrLop(cardSource)));
|
|
|
|
|
-
|
|
|
|
|
- List<CardSource> selectedCards = new List<CardSource>();
|
|
|
|
|
-
|
|
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
-
|
|
|
|
|
- selectCardEffect.SetUp(
|
|
|
|
|
- canTargetCondition: CanSelectTerrierOrLop,
|
|
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
- canEndSelectCondition: null,
|
|
|
|
|
- canNoSelect: () => false,
|
|
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
|
|
- message: "Select card play.",
|
|
|
|
|
- maxCount: maxCount,
|
|
|
|
|
- canEndNotMax: true,
|
|
|
|
|
- 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 StartCoroutine(selectCardEffect.Activate());
|
|
|
|
|
-
|
|
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
|
|
|
|
+ if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectTerrierOrLop))
|
|
|
{
|
|
{
|
|
|
- selectedCards.Add(cardSource);
|
|
|
|
|
|
|
+ bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectTerrierOrLop);
|
|
|
|
|
+
|
|
|
|
|
+ if (canSelectTrash)
|
|
|
|
|
+ {
|
|
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
|
|
+ {
|
|
|
|
|
+ selectedCards.Add(cardSource);
|
|
|
|
|
+
|
|
|
|
|
+ yield return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ int maxCount = 1;
|
|
|
|
|
+
|
|
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
|
|
|
- yield return null;
|
|
|
|
|
|
|
+ selectCardEffect.SetUp(
|
|
|
|
|
+ canTargetCondition: CanSelectTerrierOrLop,
|
|
|
|
|
+ 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.Trash;
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: root, activateETB: true));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
|
|
|
|
|
+ {
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { permanent }, activateClass: activateClass, successProcess: null, failureProcess: null));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region When Digivolving
|
|
|
|
|
+ if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
|
|
+ {
|
|
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
|
|
+ activateClass.SetUpICardEffect("Delete 1 level 3 Digimon.", CanUseCondition, card);
|
|
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ string EffectDiscription()
|
|
|
|
|
+ {
|
|
|
|
|
+ return "[When Digivolving] Delete 1 level 3 or lower Digimon. If this effect deleted your Digimon , you may play 1 level 3 Digimon card with [Terriermon] or [Lopmon] in its name from your trash without paying the cost.";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (permanent.Level <= 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Trash, activateETB: true));
|
|
|
|
|
|
|
+ bool CanSelectTerrierOrLop(CardSource cardSource)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (cardSource != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (cardSource.IsDigimon)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (cardSource.Owner == card.Owner)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (cardSource.CardNames.Contains("Terriermon") || cardSource.CardNames.Contains("Lopmon"))
|
|
|
|
|
+ {
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
|
|
+ {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ Permanent selectedPermanent;
|
|
|
|
|
+
|
|
|
|
|
+ if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
|
|
|
|
|
+ {
|
|
|
|
|
+ int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
|
|
|
|
|
+
|
|
|
|
|
+ bool deletedOwn = false;
|
|
|
|
|
+
|
|
|
|
|
+ Permanent deletedCard = null;
|
|
|
|
|
+
|
|
|
|
|
+ int deleteCount = 1;
|
|
|
|
|
+
|
|
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
|
|
+ canTargetCondition: CanSelectPermanentCondition,
|
|
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
+ canEndSelectCondition: null,
|
|
|
|
|
+ maxCount: maxCount,
|
|
|
|
|
+ canNoSelect: false,
|
|
|
|
|
+ canEndNotMax: false,
|
|
|
|
|
+ selectPermanentCoroutine: SelectPermanentCoroutine,
|
|
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
|
|
+ mode: SelectPermanentEffect.Mode.Custom,
|
|
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
|
|
|
|
|
+ {
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { permanent }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator SuccessProcess()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectTerrierOrLop))
|
|
|
|
|
+ {
|
|
|
|
|
+ bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectTerrierOrLop);
|
|
|
|
|
+
|
|
|
|
|
+ if (canSelectTrash)
|
|
|
|
|
+ {
|
|
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
|
|
+ {
|
|
|
|
|
+ selectedCards.Add(cardSource);
|
|
|
|
|
+
|
|
|
|
|
+ yield return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ int maxCount = 1;
|
|
|
|
|
+
|
|
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectCardEffect.SetUp(
|
|
|
|
|
+ canTargetCondition: CanSelectTerrierOrLop,
|
|
|
|
|
+ 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.Trash;
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: root, activateETB: true));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
|
|
|
|
|
+ {
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { permanent }, activateClass: activateClass, successProcess: null, failureProcess: null));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
#endregion
|
|
#endregion
|