|
|
@@ -3,6 +3,7 @@ using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
|
|
|
+// Ravemon
|
|
|
namespace DCGO.CardEffects.EX4
|
|
|
{
|
|
|
public class EX4_058 : CEntity_Effect
|
|
|
@@ -11,155 +12,129 @@ namespace DCGO.CardEffects.EX4
|
|
|
{
|
|
|
List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
|
|
|
+ #region Jamming
|
|
|
if (timing == EffectTiming.None)
|
|
|
{
|
|
|
cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
+ #region End of Attack
|
|
|
if (timing == EffectTiming.OnEndAttack)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
activateClass.SetUpICardEffect("Delete this Digimon to play 1 [Ravemon] from trash at the end of opponent's turn", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
- string EffectDiscription()
|
|
|
+ string EffectDescription()
|
|
|
{
|
|
|
return "[End of Attack] By deleting this Digimon that has a digivolution card with [Bird] or [Avian] in one of its traits, at the end of your opponent's turn, play 1 [Ravemon] from your trash without paying the cost.";
|
|
|
}
|
|
|
|
|
|
bool CanSelectCardCondition(CardSource cardSource)
|
|
|
{
|
|
|
- if (cardSource != null)
|
|
|
- {
|
|
|
- if (cardSource.IsDigimon)
|
|
|
- {
|
|
|
- if (cardSource.Owner == card.Owner)
|
|
|
- {
|
|
|
- if (cardSource.CardNames.Contains("Ravemon"))
|
|
|
- {
|
|
|
- if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return cardSource != null
|
|
|
+ && cardSource.IsDigimon
|
|
|
+ && cardSource.Owner == card.Owner
|
|
|
+ && cardSource.CardNames.Contains("Ravemon")
|
|
|
+ && CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
|
|
|
}
|
|
|
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
|
|
|
+ && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
|
|
|
}
|
|
|
|
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
- {
|
|
|
- if (card.PermanentOfThisCard().DigivolutionCards.Count(cardSource => cardSource.HasBirdTraits) >= 1)
|
|
|
- {
|
|
|
- if (card.PermanentOfThisCard().CanBeDestroyedBySkill(activateClass))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass)
|
|
|
+ && card.PermanentOfThisCard().DigivolutionCards.Count(cardSource => cardSource.HasBirdTraits) >= 1
|
|
|
+ && card.PermanentOfThisCard().CanBeDestroyedBySkill(activateClass);
|
|
|
}
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
{
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { card.PermanentOfThisCard() }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
|
|
|
+
|
|
|
+ IEnumerator SuccessProcess()
|
|
|
{
|
|
|
- if (card.PermanentOfThisCard().DigivolutionCards.Count(cardSource => cardSource.HasBirdTraits) >= 1)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { card.PermanentOfThisCard() }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
|
|
|
+ ActivateClass activateClass1 = new ActivateClass();
|
|
|
+ activateClass1.SetUpICardEffect("Play 1 [Ravemon] from trash", CanUseCondition1, card);
|
|
|
+ activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, 1, false, "");
|
|
|
+ activateClass1.SetHashString("EX4_058_EoOT");
|
|
|
+ CardEffectCommons.AddEffectToPlayer(effectDuration: EffectDuration.UntilOpponentTurnEnd, card: card, cardEffect: activateClass1, timing: EffectTiming.OnEndTurn);
|
|
|
|
|
|
- IEnumerator SuccessProcess()
|
|
|
- {
|
|
|
- ActivateClass activateClass1 = new ActivateClass();
|
|
|
- activateClass1.SetUpICardEffect("Play 1 [Ravemon] from trash", CanUseCondition1, card);
|
|
|
- activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, "");
|
|
|
- CardEffectCommons.AddEffectToPlayer(effectDuration: EffectDuration.UntilOpponentTurnEnd, card: card, cardEffect: activateClass1, timing: EffectTiming.OnEndTurn);
|
|
|
+ bool CanUseCondition1(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsOpponentTurn(card);
|
|
|
+ }
|
|
|
|
|
|
- bool CanUseCondition1(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.IsOpponentTurn(card);
|
|
|
- }
|
|
|
+ bool CanActivateCondition1(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
|
|
|
+ }
|
|
|
|
|
|
- bool CanActivateCondition1(Hashtable hashtable)
|
|
|
+ IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, (cardSource) => CanSelectCardCondition(cardSource)))
|
|
|
+ {
|
|
|
+ int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
|
|
|
+
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: CanSelectCardCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => false,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select 1 [Ravemon] to play.",
|
|
|
+ maxCount: maxCount,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass1);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select 1 [Ravemon] to play.", "The opponent is selecting 1 [Ravemon] to play.");
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
|
|
|
+
|
|
|
+ yield return StartCoroutine(selectCardEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
{
|
|
|
- if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ selectedCards.Add(cardSource);
|
|
|
|
|
|
- return false;
|
|
|
+ yield return null;
|
|
|
}
|
|
|
|
|
|
- IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
|
|
|
- {
|
|
|
- if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, (cardSource) => CanSelectCardCondition(cardSource)))
|
|
|
- {
|
|
|
- int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
|
|
|
-
|
|
|
- List<CardSource> selectedCards = new List<CardSource>();
|
|
|
-
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
-
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: CanSelectCardCondition,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- canNoSelect: () => false,
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- message: "Select 1 [Ravemon] to play.",
|
|
|
- maxCount: maxCount,
|
|
|
- canEndNotMax: false,
|
|
|
- isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
- customRootCardList: null,
|
|
|
- canLookReverseCard: true,
|
|
|
- selectPlayer: card.Owner,
|
|
|
- cardEffect: activateClass1);
|
|
|
-
|
|
|
- selectCardEffect.SetUpCustomMessage("Select 1 [Ravemon] to play.", "The opponent is selecting 1 [Ravemon] to play.");
|
|
|
- selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
|
|
|
-
|
|
|
- yield return StartCoroutine(selectCardEffect.Activate());
|
|
|
-
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
- {
|
|
|
- selectedCards.Add(cardSource);
|
|
|
-
|
|
|
- yield return null;
|
|
|
- }
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Trash, activateETB: true));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- yield return null;
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Trash, activateETB: true));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ yield return null;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
+ #region On Deletion
|
|
|
if (timing == EffectTiming.OnDestroyedAnyone)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
activateClass.SetUpICardEffect("Opponent trashes 1 card from hand and add the top card of opponent's security to hand", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
- string EffectDiscription()
|
|
|
+ string EffectDescription()
|
|
|
{
|
|
|
return "[On Deletion] If your opponent has 8 or more cards in their hand, they trash 1 card in their hand. Then, if your opponent has 7 or fewer cards in their hand, they add the top card of their security stack to their hand.";
|
|
|
}
|
|
|
@@ -236,8 +211,9 @@ namespace DCGO.CardEffects.EX4
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
return cardEffects;
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|