EX7_064.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System;
  4. using System.Linq;
  5. namespace DCGO.CardEffects.EX7
  6. {
  7. public class EX7_064 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Start of Your Main Phase
  13. if (timing == EffectTiming.OnStartMainPhase)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  18. cardEffects.Add(activateClass);
  19. string EffectDescription()
  20. {
  21. return "[Start of Your Main Phase] If your opponent has a Digimon, gain 1 memory.";
  22. }
  23. bool CanUseCondition(Hashtable hashtable)
  24. {
  25. return CardEffectCommons.IsExistOnBattleArea(card) &&
  26. CardEffectCommons.IsOwnerTurn(card);
  27. }
  28. bool CanActivateCondition(Hashtable hashtable)
  29. {
  30. return CardEffectCommons.IsExistOnBattleArea(card) &&
  31. card.Owner.Enemy.GetBattleAreaDigimons().Count >= 1 &&
  32. card.Owner.CanAddMemory(activateClass);
  33. }
  34. IEnumerator ActivateCoroutine(Hashtable hashtable)
  35. {
  36. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  37. }
  38. }
  39. #endregion
  40. #region End of Your Turn
  41. if (timing == EffectTiming.OnEndTurn)
  42. {
  43. ActivateClass activateClass = new ActivateClass();
  44. activateClass.SetUpICardEffect("1 of your Digimon gets <Piercing> and <Blocker>", CanUseCondition, card);
  45. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
  46. activateClass.SetHashString("PiercingBlocker_EX7_064");
  47. cardEffects.Add(activateClass);
  48. string EffectDescription()
  49. {
  50. return
  51. "[End of Your Turn] By suspending this Tamer, 1 of your Digimon gets <Piercing> and <Blocker> until the end of your opponent's turn. If that Digimon has the [Vortex Warriors] trait, unsuspend that Digimon.";
  52. }
  53. bool CanUseCondition(Hashtable hashtable)
  54. {
  55. return CardEffectCommons.IsExistOnBattleArea(card) &&
  56. CardEffectCommons.IsOwnerTurn(card);
  57. }
  58. bool CanSelectPermanentCondition(Permanent permanent)
  59. {
  60. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  61. }
  62. bool CanActivateCondition(Hashtable hashtable)
  63. {
  64. return CardEffectCommons.IsExistOnBattleArea(card) &&
  65. CardEffectCommons.CanActivateSuspendCostEffect(card) &&
  66. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
  67. }
  68. IEnumerator ActivateCoroutine(Hashtable hashtable)
  69. {
  70. yield return ContinuousController.instance.StartCoroutine(
  71. new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() },
  72. CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  73. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  74. {
  75. Permanent selectedPermanent = null;
  76. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  77. selectPermanentEffect.SetUp(
  78. selectPlayer: card.Owner,
  79. canTargetCondition: CanSelectPermanentCondition,
  80. canTargetCondition_ByPreSelecetedList: null,
  81. canEndSelectCondition: null,
  82. maxCount: 1,
  83. canNoSelect: false,
  84. canEndNotMax: false,
  85. selectPermanentCoroutine: SelectPermanentCoroutine,
  86. afterSelectPermanentCoroutine: null,
  87. mode: SelectPermanentEffect.Mode.Custom,
  88. cardEffect: activateClass);
  89. selectPermanentEffect.SetUpCustomMessage(
  90. "Select 1 Digimon that will get <Piercing> and <Blocker>.",
  91. "The opponent is selecting 1 Digimon that will get <Piercing> and <Blocker>.");
  92. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  93. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  94. {
  95. selectedPermanent = permanent;
  96. yield return null;
  97. }
  98. if (selectedPermanent != null)
  99. {
  100. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainPierce(
  101. targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOpponentTurnEnd,
  102. activateClass: activateClass));
  103. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(
  104. targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOpponentTurnEnd,
  105. activateClass: activateClass));
  106. if (selectedPermanent.TopCard.ContainsTraits("Vortex Warriors"))
  107. {
  108. yield return ContinuousController.instance.StartCoroutine(
  109. new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
  110. }
  111. }
  112. }
  113. }
  114. }
  115. #endregion
  116. #region Security Effect
  117. if (timing == EffectTiming.SecuritySkill)
  118. {
  119. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  120. }
  121. #endregion
  122. return cardEffects;
  123. }
  124. }
  125. }