BT21_089.cs 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. //BT21_089 Takato
  5. namespace DCGO.CardEffects.BT21
  6. {
  7. public class BT21_089 : 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 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, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  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. if (CardEffectCommons.IsExistOnBattleArea(card))
  26. {
  27. if (CardEffectCommons.IsOwnerTurn(card))
  28. {
  29. return true;
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanActivateCondition(Hashtable hashtable)
  35. {
  36. if (CardEffectCommons.IsExistOnBattleArea(card))
  37. {
  38. if (card.Owner.Enemy.GetBattleAreaDigimons().Count >= 1)
  39. {
  40. if (card.Owner.CanAddMemory(activateClass))
  41. {
  42. return true;
  43. }
  44. }
  45. }
  46. return false;
  47. }
  48. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  49. {
  50. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  51. }
  52. }
  53. #endregion
  54. #region All turns
  55. if(timing == EffectTiming.OnEnterFieldAnyone)
  56. {
  57. ActivateClass activateClass = new ActivateClass();
  58. activateClass.SetUpICardEffect("Gain blocker and maybe +2k", CanUseCondition, card);
  59. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
  60. cardEffects.Add(activateClass);
  61. string EffectDescription()
  62. {
  63. return "[All Turns] When any of your Digimon are played or digivolve, by suspending this Tamer, until your opponent's turn ends, 1 of your Digimon with [Guilmon], [Growlmon], [Gallantmon], or [Megidramon] in its name or the [Hero] trait gains <Blocker> and, it here are 10 or more total cards in both players' trashes, gets +2000 DP.";
  64. }
  65. bool MyDigimonPlayedDigid(Permanent permanent)
  66. {
  67. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  68. }
  69. bool CanUseCondition(Hashtable hashtable)
  70. {
  71. if (isExistOnField(card))
  72. {
  73. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, MyDigimonPlayedDigid))
  74. return true;
  75. if (CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, MyDigimonPlayedDigid))
  76. return true;
  77. }
  78. return false;
  79. }
  80. bool CanReceiveGainCondtion(Permanent permanent)
  81. {
  82. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) && (
  83. permanent.TopCard.ContainsCardName("Guilmon") ||
  84. permanent.TopCard.ContainsCardName("Growlmon") ||
  85. permanent.TopCard.ContainsCardName("Gallantmon") ||
  86. permanent.TopCard.ContainsCardName("Megidramon") ||
  87. permanent.TopCard.EqualsTraits("Hero"));
  88. }
  89. bool CanActivateCondition(Hashtable hashtable)
  90. {
  91. return isExistOnField(card)
  92. && CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanReceiveGainCondtion)
  93. && CardEffectCommons.CanActivateSuspendCostEffect(card);
  94. }
  95. IEnumerator ActivateCoroutine(Hashtable hashtable)
  96. {
  97. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
  98. new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  99. if (CardEffectCommons.HasMatchConditionPermanent(CanReceiveGainCondtion))
  100. {
  101. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanReceiveGainCondtion));
  102. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  103. selectPermanentEffect.SetUp(
  104. selectPlayer: card.Owner,
  105. canTargetCondition: CanReceiveGainCondtion,
  106. canTargetCondition_ByPreSelecetedList: null,
  107. canEndSelectCondition: null,
  108. maxCount: maxCount,
  109. canNoSelect: false,
  110. canEndNotMax: false,
  111. selectPermanentCoroutine: SelectPermanentCoroutine,
  112. afterSelectPermanentCoroutine: null,
  113. mode: SelectPermanentEffect.Mode.Custom,
  114. cardEffect: activateClass);
  115. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will gain <Blocker> and 2k DP if 10+ cards in trash.", "The opponent is selecting 1 Digimon that will gain <Blocker> and 2k DP if 10+ cards in trash.");
  116. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  117. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  118. {
  119. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(targetPermanent: permanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  120. if (card.Owner.TrashCards.Count + card.Owner.Enemy.TrashCards.Count >= 10)
  121. {
  122. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(permanent, 2000, EffectDuration.UntilOpponentTurnEnd, activateClass));
  123. }
  124. }
  125. }
  126. }
  127. }
  128. #endregion
  129. #region Security
  130. if (timing == EffectTiming.SecuritySkill)
  131. {
  132. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  133. }
  134. #endregion
  135. return cardEffects;
  136. }
  137. }
  138. }