|
|
@@ -10,8 +10,10 @@ namespace DCGO.CardEffects.EX10
|
|
|
public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
|
|
|
{
|
|
|
List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
+ ActivateClass deleteDigimonActivateClass = null;
|
|
|
|
|
|
#region Hand - Main
|
|
|
+
|
|
|
if (timing == EffectTiming.OnDeclaration)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
@@ -40,6 +42,7 @@ namespace DCGO.CardEffects.EX10
|
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
|
#region reduce play cost
|
|
|
+
|
|
|
if (card.Owner.CanReduceCost(null, card))
|
|
|
ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
|
|
|
|
|
|
@@ -77,7 +80,6 @@ namespace DCGO.CardEffects.EX10
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
else
|
|
|
{
|
|
|
if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
|
|
|
@@ -103,6 +105,7 @@ namespace DCGO.CardEffects.EX10
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
@@ -114,13 +117,12 @@ namespace DCGO.CardEffects.EX10
|
|
|
activateETB: true));
|
|
|
|
|
|
#region Delete Digimon Played
|
|
|
+
|
|
|
Permanent selectedPermanent = card.PermanentOfThisCard();
|
|
|
|
|
|
- ActivateClass activateClass1 = new ActivateClass();
|
|
|
- activateClass1.SetUpICardEffect("Delete this Digimon", CanUseCondition2, selectedPermanent.TopCard);
|
|
|
- activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
|
|
|
- activateClass1.SetEffectSourcePermanent(selectedPermanent);
|
|
|
- selectedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect);
|
|
|
+ deleteDigimonActivateClass.SetUpICardEffect("Delete this Digimon", CanUseCondition2, selectedPermanent.TopCard);
|
|
|
+ deleteDigimonActivateClass.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
|
|
|
+ deleteDigimonActivateClass.SetEffectSourcePermanent(selectedPermanent);
|
|
|
|
|
|
if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
{
|
|
|
@@ -134,27 +136,19 @@ namespace DCGO.CardEffects.EX10
|
|
|
|
|
|
bool CanUseCondition2(Hashtable hashtable1)
|
|
|
{
|
|
|
- if (CardEffectCommons.IsOpponentTurn(card))
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(selectedPermanent, selectedPermanent.TopCard))
|
|
|
- {
|
|
|
- if (CardEffectCommons.CanTriggerOnEndAttack(hashtable1, selectedPermanent.TopCard))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(selectedPermanent, selectedPermanent.TopCard);
|
|
|
}
|
|
|
|
|
|
bool CanActivateCondition1(Hashtable hashtable1)
|
|
|
{
|
|
|
if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
|
|
|
{
|
|
|
- if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
+ if (CardEffectCommons.IsOwnerTurn(selectedPermanent.TopCard))
|
|
|
{
|
|
|
- return true;
|
|
|
+ if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -167,22 +161,23 @@ namespace DCGO.CardEffects.EX10
|
|
|
{
|
|
|
yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(
|
|
|
new List<Permanent>() { selectedPermanent },
|
|
|
- CardEffectCommons.CardEffectHashtable(activateClass1)).Destroy());
|
|
|
+ CardEffectCommons.CardEffectHashtable(deleteDigimonActivateClass)).Destroy());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- ICardEffect GetCardEffect(EffectTiming _timing)
|
|
|
- {
|
|
|
- if (_timing == EffectTiming.OnEndTurn)
|
|
|
- {
|
|
|
- return activateClass1;
|
|
|
- }
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
#endregion
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region End of Turn (Only used if Hand - Main was activated)
|
|
|
+
|
|
|
+ if (timing == EffectTiming.OnEndTurn && deleteDigimonActivateClass != null)
|
|
|
+ {
|
|
|
+ cardEffects.Add(deleteDigimonActivateClass);
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region On Play/When Attacking Shared
|
|
|
@@ -253,13 +248,13 @@ namespace DCGO.CardEffects.EX10
|
|
|
if (timing == EffectTiming.OnAllyAttack)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("1 Digimon and 1 Tamer cant suspend", CanUseCondition, card);
|
|
|
+ activateClass.SetUpICardEffect("Delete 1 unsuspended Digimon", CanUseCondition, card);
|
|
|
activateClass.SetUpActivateClass(CanActivateSharedCondition, ActivateCoroutine, -1, false, EffectDescription());
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
string EffectDescription()
|
|
|
{
|
|
|
- return "[When Attacking] 1 of your opponent's Digimon and 1 of their Tamers can't suspend until their turn ends.";
|
|
|
+ return "[When Attacking] Delete 1 of your opponent's unsuspended Digimon.";
|
|
|
}
|
|
|
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
@@ -296,6 +291,7 @@ namespace DCGO.CardEffects.EX10
|
|
|
#endregion
|
|
|
|
|
|
#region All Turns
|
|
|
+
|
|
|
if (timing == EffectTiming.None)
|
|
|
{
|
|
|
bool Condition()
|
|
|
@@ -324,15 +320,16 @@ namespace DCGO.CardEffects.EX10
|
|
|
effectName: "[All Turns] This Digimon can only digivolve into [Apocalymon].")
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region On Deletion
|
|
|
+
|
|
|
if (timing == EffectTiming.OnDestroyedAnyone)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
activateClass.SetUpICardEffect("Place this Digimon face up as bottom security, add top security to hand", CanUseCondition, card);
|
|
|
activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
|
|
|
- activateClass.SetIsInheritedEffect(true);
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
string EffectDiscription()
|
|
|
@@ -340,7 +337,7 @@ namespace DCGO.CardEffects.EX10
|
|
|
return "[On Deletion] If you have no purple face-up security cards, place this Digimon face up as the bottom security card.";
|
|
|
}
|
|
|
|
|
|
- bool FaceUpBlack(CardSource card)
|
|
|
+ bool FaceUpPurple(CardSource card)
|
|
|
{
|
|
|
return card.IsFlipped &&
|
|
|
card.CardColors.Contains(CardColor.Purple);
|
|
|
@@ -349,7 +346,7 @@ namespace DCGO.CardEffects.EX10
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
return CardEffectCommons.CanTriggerOnDeletion(hashtable, card) &&
|
|
|
- !CardEffectCommons.HasMatchConditionOwnersSecurity(card, FaceUpBlack);
|
|
|
+ !CardEffectCommons.HasMatchConditionOwnersSecurity(card, FaceUpPurple);
|
|
|
}
|
|
|
|
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
|
@@ -362,14 +359,16 @@ namespace DCGO.CardEffects.EX10
|
|
|
yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(card, false, true));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region Security
|
|
|
+
|
|
|
if (timing == EffectTiming.SecuritySkill)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect($"Play 1 Level 5 or lower", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
+ activateClass.SetUpICardEffect($"Play 1 Level 5 or lower digimon with [Dark Masters] in text from hand or trash", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, true, EffectDiscription());
|
|
|
activateClass.SetIsSecurityEffect(true);
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
@@ -377,18 +376,117 @@ namespace DCGO.CardEffects.EX10
|
|
|
{
|
|
|
return "[Security] If this card was face-up, you may play 1 level 5 or lower card with [Dark Masters] in its text from your hand or trash without paying the cost.";
|
|
|
}
|
|
|
+
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
|
|
|
+ return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card)
|
|
|
+ && (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition) || CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
|
|
|
+ && card.IsFlipped;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanSelectCardCondition(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.IsDigimon
|
|
|
+ && cardSource.HasLevel && cardSource.Level <= 5
|
|
|
+ && cardSource.HasText("Dark Masters");
|
|
|
}
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
{
|
|
|
- yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
|
|
|
+ bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition);
|
|
|
+ bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
|
|
|
+
|
|
|
+ if (canSelectHand || canSelectTrash)
|
|
|
+ {
|
|
|
+ if (canSelectHand && canSelectTrash)
|
|
|
+ {
|
|
|
+ List<SelectionElement<bool>> selectionElements = 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 selectPlayerMessage = "From which area do you select a card?";
|
|
|
+ string notSelectPlayerMessage = "The opponent is choosing from which area to select a card.";
|
|
|
+
|
|
|
+ GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ GManager.instance.userSelectionManager.SetBool(canSelectHand);
|
|
|
+ }
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
+
|
|
|
+ bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
+
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedCards.Add(cardSource);
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
|
|
|
+ if (fromHand)
|
|
|
+ {
|
|
|
+ SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
+
|
|
|
+ selectHandEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectCardCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoSelect: true,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ mode: SelectHandEffect.Mode.Custom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectHandEffect.SetUpCustomMessage("Select 1 digimon to play.", "The opponent is selecting 1 digimon to play.");
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: CanSelectCardCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select 1 card to add as source.",
|
|
|
+ maxCount: 1,
|
|
|
+ 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 add as source.", "The opponent is selecting 1 card to add as source.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (selectedCards.Any()) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
+ cardSources: selectedCards,
|
|
|
+ activateClass: activateClass,
|
|
|
+ payCost: false,
|
|
|
+ isTapped: false,
|
|
|
+ root: fromHand ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash,
|
|
|
+ activateETB: true
|
|
|
+ ));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
return cardEffects;
|