|
|
@@ -4,6 +4,7 @@ using System.Linq;
|
|
|
using System;
|
|
|
using UnityEngine;
|
|
|
|
|
|
+//Machinedramon
|
|
|
namespace DCGO.CardEffects.EX10
|
|
|
{
|
|
|
public class EX10_035 : CEntity_Effect
|
|
|
@@ -108,7 +109,9 @@ namespace DCGO.CardEffects.EX10
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
+ if (CardEffectCommons.CanPlayAsNewPermanent(card, true, activateClass))
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
cardSources: new List<CardSource> { card },
|
|
|
activateClass: activateClass,
|
|
|
payCost: true,
|
|
|
@@ -116,75 +119,76 @@ namespace DCGO.CardEffects.EX10
|
|
|
root: SelectCardEffect.Root.Hand,
|
|
|
activateETB: true));
|
|
|
|
|
|
- yield return new WaitForSeconds(0.2f);
|
|
|
+ yield return new WaitForSeconds(0.2f);
|
|
|
|
|
|
- #region Delete Digimon Played
|
|
|
+ #region Delete Digimon Played
|
|
|
|
|
|
- Permanent playedPermanent = card.PermanentOfThisCard();
|
|
|
+ Permanent playedPermanent = card.PermanentOfThisCard();
|
|
|
|
|
|
- ActivateClass activateClass1 = new ActivateClass();
|
|
|
- activateClass1.SetUpICardEffect("Delete the Digimon", CanUseCondition2, playedPermanent.TopCard);
|
|
|
- activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
|
|
|
- activateClass1.SetEffectSourcePermanent(playedPermanent);
|
|
|
- playedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect);
|
|
|
+ ActivateClass activateClass1 = new ActivateClass();
|
|
|
+ activateClass1.SetUpICardEffect("Delete the Digimon", CanUseCondition2, playedPermanent.TopCard);
|
|
|
+ activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
|
|
|
+ activateClass1.SetEffectSourcePermanent(playedPermanent);
|
|
|
+ playedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect);
|
|
|
|
|
|
- if (!playedPermanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(playedPermanent));
|
|
|
- }
|
|
|
+ if (!playedPermanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(playedPermanent));
|
|
|
+ }
|
|
|
|
|
|
- string EffectDiscription1()
|
|
|
- {
|
|
|
- return "[End of Your Turn] Delete this Digimon.";
|
|
|
- }
|
|
|
+ string EffectDiscription1()
|
|
|
+ {
|
|
|
+ return "[End of Your Turn] Delete this Digimon.";
|
|
|
+ }
|
|
|
|
|
|
- bool CanUseCondition2(Hashtable hashtable1)
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsOwnerTurn(card))
|
|
|
+ bool CanUseCondition2(Hashtable hashtable1)
|
|
|
{
|
|
|
- if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(playedPermanent, playedPermanent.TopCard))
|
|
|
+ if (CardEffectCommons.IsOwnerTurn(card))
|
|
|
{
|
|
|
- return true;
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(playedPermanent, playedPermanent.TopCard))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- bool CanActivateCondition1(Hashtable hashtable1)
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsPermanentExistsOnBattleArea(playedPermanent))
|
|
|
+ bool CanActivateCondition1(Hashtable hashtable1)
|
|
|
{
|
|
|
- if (!playedPermanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnBattleArea(playedPermanent))
|
|
|
{
|
|
|
- return true;
|
|
|
+ if (!playedPermanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsPermanentExistsOnBattleArea(playedPermanent))
|
|
|
+ IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
|
|
|
{
|
|
|
- yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(
|
|
|
- new List<Permanent>() { playedPermanent },
|
|
|
- CardEffectCommons.CardEffectHashtable(activateClass1)).Destroy());
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnBattleArea(playedPermanent))
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(
|
|
|
+ new List<Permanent>() { playedPermanent },
|
|
|
+ CardEffectCommons.CardEffectHashtable(activateClass1)).Destroy());
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- ICardEffect GetCardEffect(EffectTiming _timing)
|
|
|
- {
|
|
|
- if (_timing == EffectTiming.OnEndTurn)
|
|
|
+ ICardEffect GetCardEffect(EffectTiming _timing)
|
|
|
{
|
|
|
- return activateClass1;
|
|
|
+ if (_timing == EffectTiming.OnEndTurn)
|
|
|
+ {
|
|
|
+ return activateClass1;
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
- return null;
|
|
|
+ #endregion
|
|
|
}
|
|
|
-
|
|
|
- #endregion
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -206,6 +210,30 @@ namespace DCGO.CardEffects.EX10
|
|
|
{
|
|
|
if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
|
|
|
{
|
|
|
+ int degenrationMaxCount = 2;
|
|
|
+ int degenrationCount = 0;
|
|
|
+
|
|
|
+ SelectCountEffect selectCountEffect = GManager.instance.GetComponent<SelectCountEffect>();
|
|
|
+ if (selectCountEffect != null)
|
|
|
+ {
|
|
|
+ selectCountEffect.SetUp(
|
|
|
+ SelectPlayer: card.Owner,
|
|
|
+ targetPermanent: null,
|
|
|
+ MaxCount: degenrationMaxCount,
|
|
|
+ CanNoSelect: false,
|
|
|
+ Message: "How much will you De-Digivolve?",
|
|
|
+ Message_Enemy: "The opponent is choosing how much to De-Digivolve.",
|
|
|
+ SelectCountCoroutine: SelectCountCoroutine);
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCountEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectCountCoroutine(int count)
|
|
|
+ {
|
|
|
+ degenrationCount = count;
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
List<Permanent> selectedPermaments = new List<Permanent>();
|
|
|
int maxCount = Math.Min(2, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
|
|
|
|
|
|
@@ -239,7 +267,7 @@ namespace DCGO.CardEffects.EX10
|
|
|
{
|
|
|
if (selectedPermanent != null)
|
|
|
{
|
|
|
- yield return ContinuousController.instance.StartCoroutine(new IDegeneration(selectedPermanent, 2, activateClass, true).Degeneration());
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new IDegeneration(selectedPermanent, degenrationCount, activateClass, true).Degeneration());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -300,20 +328,12 @@ namespace DCGO.CardEffects.EX10
|
|
|
{
|
|
|
bool Condition()
|
|
|
{
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsOwnerTurn(card))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return CardEffectCommons.IsExistOnBattleArea(card);
|
|
|
}
|
|
|
|
|
|
bool CardCondition(CardSource cardSource)
|
|
|
{
|
|
|
- return cardSource.EqualsCardName("Apocalymon");
|
|
|
+ return !cardSource.EqualsCardName("Apocalymon");
|
|
|
}
|
|
|
|
|
|
cardEffects.Add(CardEffectFactory.CanNotDigivolveStaticSelfEffect(
|
|
|
@@ -354,13 +374,13 @@ namespace DCGO.CardEffects.EX10
|
|
|
|
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return CardEffectCommons.CanActivateOnDeletion(card) &&
|
|
|
- !CardEffectCommons.HasMatchConditionOwnersSecurity(card, FaceUpBlack);
|
|
|
+ return CardEffectCommons.CanActivateOnDeletion(card);
|
|
|
}
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(card, false, true));
|
|
|
+ if(!CardEffectCommons.HasMatchConditionOwnersSecurity(card, FaceUpBlack, false))
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(card, false, true));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -385,7 +405,7 @@ namespace DCGO.CardEffects.EX10
|
|
|
{
|
|
|
return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card)
|
|
|
&& (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition) || CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
|
|
|
- && !card.IsFlipped;
|
|
|
+ && CardEffectCommons.GetFaceUpFromHashtable(hashtable);
|
|
|
}
|
|
|
|
|
|
bool CanSelectCardCondition(CardSource cardSource)
|