|
|
@@ -43,21 +43,181 @@ namespace DCGO.CardEffects.EX7
|
|
|
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
|
|
|
+ if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
|
|
|
+ return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
|
|
|
+
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateSecondEffectCondition(Hashtable hashtable)
|
|
|
{
|
|
|
if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
|
|
|
{
|
|
|
- if (card.Owner.HandCards.Count >= 1)
|
|
|
+ if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
|
|
|
{
|
|
|
- return true;
|
|
|
+ if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("LadyDevimon") || cardSource.CardNames.Contains("X Antibody") || cardSource.CardNames.Contains("XAntibody")) >= 1)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
|
|
|
+ {
|
|
|
+ int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
|
|
|
+
|
|
|
+ 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 that will get [End of Attack] Delete this Digimon.",
|
|
|
+ "The opponent is selecting 1 Digimon that will get [End of Attack] Delete this Digimon.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
+ {
|
|
|
+ Permanent selectedPermanent = permanent;
|
|
|
+
|
|
|
+ if (selectedPermanent != null)
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (selectedPermanent != null)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass1 = new ActivateClass();
|
|
|
+ activateClass1.SetUpICardEffect("Delete this Digimon", CanUseCondition1, selectedPermanent.TopCard);
|
|
|
+ activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
|
|
|
+ activateClass1.SetEffectSourcePermanent(selectedPermanent);
|
|
|
+ selectedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect);
|
|
|
+
|
|
|
+ if (!permanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
|
|
|
+ }
|
|
|
+
|
|
|
+ string EffectDiscription1()
|
|
|
+ {
|
|
|
+ return "[End of Attack] Delete this Digimon.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition1(Hashtable hashtable1)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.CanTriggerOnAttack(hashtable, selectedPermanent.TopCard))
|
|
|
+ {
|
|
|
+ if (selectedPermanent.TopCard.Owner.GetBattleAreaDigimons().Contains(selectedPermanent))
|
|
|
+ {
|
|
|
+ if (GManager.instance.turnStateMachine.gameContext.TurnPlayer == selectedPermanent.TopCard.Owner)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition1(Hashtable hashtable1)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
|
|
|
+ {
|
|
|
+ if (!permanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(
|
|
|
+ new List<Permanent>() { selectedPermanent },
|
|
|
+ CardEffectCommons.CardEffectHashtable(activateClass1)).Destroy());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ICardEffect GetCardEffect(EffectTiming _timing)
|
|
|
+ {
|
|
|
+ if (_timing == EffectTiming.OnEndAttack)
|
|
|
+ {
|
|
|
+ return activateClass1;
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (CanActivateSecondEffectCondition(hashtable))
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayVoléeZerdrücken(activateClass));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region When Digivolving
|
|
|
+ if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Give effects to opponent's Digimon and play a Token", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDiscription()
|
|
|
+ {
|
|
|
+ return "[When Digivolving] 1 of your opponent's Digimon gains \" Delete this Digimon.\" until the end of their turn. Then, if this Digimon has [LadyDevimon]/[X Antibody] in its digivolution cards, you may play 1 [Volée & Zerdrücken] Token (Digimon/Lv.4/Purple/5000 DP/<Blocker>/<Retaliation>).";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ if(CardEffectCommons.IsExistOnBattleAreaDigimon(card))
|
|
|
+ return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
+ }
|
|
|
+
|
|
|
bool CanActivateSecondEffectCondition(Hashtable hashtable)
|
|
|
{
|
|
|
if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
|