|
@@ -0,0 +1,256 @@
|
|
|
|
|
+using System.Collections;
|
|
|
|
|
+using System.Collections.Generic;
|
|
|
|
|
+using System;
|
|
|
|
|
+
|
|
|
|
|
+namespace DCGO.CardEffects.P
|
|
|
|
|
+{
|
|
|
|
|
+ public class RookDevice_P_159 : CEntity_Effect
|
|
|
|
|
+ {
|
|
|
|
|
+ public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
|
|
|
|
|
+ {
|
|
|
|
|
+ List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ #region Ignore Color Requirements
|
|
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
|
|
+ {
|
|
|
|
|
+ IgnoreColorConditionClass ignoreColorConditionClass = new IgnoreColorConditionClass();
|
|
|
|
|
+ ignoreColorConditionClass.SetUpICardEffect("Ignore color requirements", CanUseCondition, card);
|
|
|
|
|
+ ignoreColorConditionClass.SetUpIgnoreColorConditionClass(cardCondition: CardCondition);
|
|
|
|
|
+
|
|
|
|
|
+ cardEffects.Add(ignoreColorConditionClass);
|
|
|
|
|
+
|
|
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ return !CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.TopCard.EqualsCardName("Rook Device"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ bool CardCondition(CardSource cardSource)
|
|
|
|
|
+ {
|
|
|
|
|
+ return (cardSource == card);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region When Trashed from battle area
|
|
|
|
|
+ if (timing == EffectTiming.OnDestroyedAnyone)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (timing == EffectTiming.OptionSkill)
|
|
|
|
|
+ {
|
|
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
|
|
+ activateClass.SetUpICardEffect("Gain Reboot, Blocker, +2000 DP", CanUseCondition, card);
|
|
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ string EffectDiscription()
|
|
|
|
|
+ {
|
|
|
|
|
+ return "[Main] 1 of your Digimon gains <Reboot>, <Blocker> and gets +2000 DP until the end of your opponent's turn. Then, place this card in the battle area.";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool HasDigimon(Permanent permanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (CardEffectCommons.IsOwnerPermanent(permanent, card))
|
|
|
|
|
+ return permanent.IsDigimon;
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.CanActivateOnDeletion(card);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (CardEffectCommons.HasMatchConditionPermanent(HasDigimon))
|
|
|
|
|
+ {
|
|
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
|
|
+ canTargetCondition: HasDigimon,
|
|
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
+ canEndSelectCondition: null,
|
|
|
|
|
+ maxCount: 1,
|
|
|
|
|
+ canNoSelect: false,
|
|
|
|
|
+ canEndNotMax: false,
|
|
|
|
|
+ selectPermanentCoroutine: SelectPermanentCoroutine1,
|
|
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
|
|
+ mode: SelectPermanentEffect.Mode.Custom,
|
|
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get Reboot, Blocker, +2000 DP.", "The opponent is selecting 1 Digimon that will get Reboot, Blocker, +2000 DP.");
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator SelectPermanentCoroutine1(Permanent permanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainReboot(
|
|
|
|
|
+ targetPermanent: permanent,
|
|
|
|
|
+ effectDuration: EffectDuration.UntilOpponentTurnEnd,
|
|
|
|
|
+ activateClass: activateClass));
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(
|
|
|
|
|
+ targetPermanent: permanent,
|
|
|
|
|
+ effectDuration: EffectDuration.UntilOpponentTurnEnd,
|
|
|
|
|
+ activateClass: activateClass));
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
|
|
|
|
|
+ targetPermanent: permanent,
|
|
|
|
|
+ changeValue: 2000,
|
|
|
|
|
+ effectDuration: EffectDuration.UntilOpponentTurnEnd,
|
|
|
|
|
+ activateClass: activateClass));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region Main
|
|
|
|
|
+ if (timing == EffectTiming.OptionSkill)
|
|
|
|
|
+ {
|
|
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
|
|
+ activateClass.SetUpICardEffect("Gain Reboot, Blocker, +2000 DP, then place in battle area", CanUseCondition, card);
|
|
|
|
|
+ activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ string EffectDiscription()
|
|
|
|
|
+ {
|
|
|
|
|
+ return "[Main] 1 of your Digimon gains <Reboot>, <Blocker> and gets +2000 DP until the end of your opponent's turn. Then, place this card in the battle area.";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool HasDigimon(Permanent permanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(CardEffectCommons.IsOwnerPermanent(permanent, card))
|
|
|
|
|
+ return permanent.IsDigimon;
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(CardEffectCommons.HasMatchConditionPermanent(HasDigimon))
|
|
|
|
|
+ {
|
|
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
|
|
+ canTargetCondition: HasDigimon,
|
|
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
+ canEndSelectCondition: null,
|
|
|
|
|
+ maxCount: 1,
|
|
|
|
|
+ canNoSelect: false,
|
|
|
|
|
+ canEndNotMax: false,
|
|
|
|
|
+ selectPermanentCoroutine: SelectPermanentCoroutine1,
|
|
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
|
|
+ mode: SelectPermanentEffect.Mode.Custom,
|
|
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get Reboot, Blocker, +2000 DP.", "The opponent is selecting 1 Digimon that will get Reboot, Blocker, +2000 DP.");
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator SelectPermanentCoroutine1(Permanent permanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainReboot(
|
|
|
|
|
+ targetPermanent: permanent,
|
|
|
|
|
+ effectDuration: EffectDuration.UntilOpponentTurnEnd,
|
|
|
|
|
+ activateClass: activateClass));
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(
|
|
|
|
|
+ targetPermanent: permanent,
|
|
|
|
|
+ effectDuration: EffectDuration.UntilOpponentTurnEnd,
|
|
|
|
|
+ activateClass: activateClass));
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
|
|
|
|
|
+ targetPermanent: permanent,
|
|
|
|
|
+ changeValue: 2000,
|
|
|
|
|
+ effectDuration: EffectDuration.UntilOpponentTurnEnd,
|
|
|
|
|
+ activateClass: activateClass));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region Security Effect
|
|
|
|
|
+ if (timing == EffectTiming.SecuritySkill)
|
|
|
|
|
+ {
|
|
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
|
|
+ activateClass.SetUpICardEffect("De-Digivolve 2, 1 of your opponents Digimon, then add this to hand", CanUseCondition, card);
|
|
|
|
|
+ activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
|
|
+ activateClass.SetIsSecurityEffect(true);
|
|
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ string EffectDiscription()
|
|
|
|
|
+ {
|
|
|
|
|
+ return "[Security] <De-Digivolve 2> 1 of your opponent's Digimon. Then, add this card to the hand.";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ 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 to De-Digivolve.", "The opponent is selecting 1 Digimon to De-Digivolve.");
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ Permanent selectedPermanent = permanent;
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new IDegeneration(selectedPermanent, 2, activateClass).Degeneration());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ return cardEffects;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|