BT22_045.cs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. //WezenGammamon
  5. namespace DCGO.CardEffects.BT22
  6. {
  7. public class BT22_045 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Alternative Digivolution Condition
  13. if (timing == EffectTiming.None)
  14. {
  15. bool PermanentCondition(Permanent targetPermanent)
  16. {
  17. return targetPermanent.TopCard.EqualsCardName("Gammamon");
  18. }
  19. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  20. permanentCondition: PermanentCondition,
  21. digivolutionCost: 2,
  22. ignoreDigivolutionRequirement: false,
  23. card: card,
  24. condition: null)
  25. );
  26. }
  27. #endregion
  28. #region On-play/When-digivolving shared
  29. bool HasGammamonNameDigimon(CardSource card)
  30. {
  31. return card.IsDigimon && card.ContainsCardName("Gammamon");
  32. }
  33. bool CanActivateShared(Hashtable hashtable)
  34. {
  35. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  36. {
  37. return CardEffectCommons.HasMatchConditionOwnersHand(card, HasGammamonNameDigimon);
  38. }
  39. return false;
  40. }
  41. #endregion
  42. #region On Play
  43. if (timing == EffectTiming.OnEnterFieldAnyone)
  44. {
  45. ActivateClass activateClass = new ActivateClass();
  46. activateClass.SetUpICardEffect("Tuck gammamon to gain <Blocker> +3000 DP", CanUseEffect, card);
  47. activateClass.SetUpActivateClass(CanActivateShared, ActivateCoroutine, -1, true, EffectDescription());
  48. cardEffects.Add(activateClass);
  49. string EffectDescription()
  50. {
  51. return "[On Play] By placing 1 Digimon card with [Gammamon] in its name from your hand as this Digimon's bottom digivolution card, it gains <Blocker> and +3000 DP until your opponent's turn ends.";
  52. }
  53. bool CanUseEffect(Hashtable hashtable)
  54. {
  55. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  56. CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  57. }
  58. IEnumerator ActivateCoroutine(Hashtable hashtable)
  59. {
  60. if (CardEffectCommons.HasMatchConditionOwnersHand(card, HasGammamonNameDigimon))
  61. {
  62. CardSource selectedCard = null;
  63. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  64. selectHandEffect.SetUp(
  65. selectPlayer: card.Owner,
  66. canTargetCondition: HasGammamonNameDigimon,
  67. canTargetCondition_ByPreSelecetedList: null,
  68. canEndSelectCondition: null,
  69. maxCount: 1,
  70. canNoSelect: true,
  71. canEndNotMax: false,
  72. isShowOpponent: true,
  73. selectCardCoroutine: SelectCardCoroutine,
  74. afterSelectCardCoroutine: null,
  75. mode: SelectHandEffect.Mode.Custom,
  76. cardEffect: activateClass);
  77. selectHandEffect.SetUpCustomMessage("Select 1 card to place on bottom of digivolution cards.", "The opponent is selecting 1 card to place on bottom of digivolution cards.");
  78. selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
  79. yield return StartCoroutine(selectHandEffect.Activate());
  80. IEnumerator SelectCardCoroutine(CardSource cardSource)
  81. {
  82. selectedCard = cardSource;
  83. yield return null;
  84. }
  85. if (selectedCard != null)
  86. {
  87. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { selectedCard }, activateClass));
  88. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(
  89. targetPermanent: card.PermanentOfThisCard(),
  90. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  91. activateClass: activateClass));
  92. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  93. targetPermanent: card.PermanentOfThisCard(),
  94. changeValue: 3000,
  95. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  96. activateClass: activateClass));
  97. }
  98. }
  99. }
  100. }
  101. #endregion
  102. #region When Digivolving
  103. if (timing == EffectTiming.OnEnterFieldAnyone)
  104. {
  105. ActivateClass activateClass = new ActivateClass();
  106. activateClass.SetUpICardEffect("Tuck gammamon to gain <Blocker> +3000 DP", CanUseEffect, card);
  107. activateClass.SetUpActivateClass(CanActivateShared, ActivateCoroutine, -1, true, EffectDescription());
  108. cardEffects.Add(activateClass);
  109. string EffectDescription()
  110. {
  111. return "[On Play] By placing 1 Digimon card with [Gammamon] in its name from your hand as this Digimon's bottom digivolution card, it gains <Blocker> and +3000 DP until your opponent's turn ends.";
  112. }
  113. bool CanUseEffect(Hashtable hashtable)
  114. {
  115. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  116. CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  117. }
  118. IEnumerator ActivateCoroutine(Hashtable hashtable)
  119. {
  120. if (CardEffectCommons.HasMatchConditionOwnersHand(card, HasGammamonNameDigimon))
  121. {
  122. CardSource selectedCard = null;
  123. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  124. selectHandEffect.SetUp(
  125. selectPlayer: card.Owner,
  126. canTargetCondition: HasGammamonNameDigimon,
  127. canTargetCondition_ByPreSelecetedList: null,
  128. canEndSelectCondition: null,
  129. maxCount: 1,
  130. canNoSelect: true,
  131. canEndNotMax: false,
  132. isShowOpponent: true,
  133. selectCardCoroutine: SelectCardCoroutine,
  134. afterSelectCardCoroutine: null,
  135. mode: SelectHandEffect.Mode.Custom,
  136. cardEffect: activateClass);
  137. selectHandEffect.SetUpCustomMessage("Select 1 card to place on bottom of digivolution cards.", "The opponent is selecting 1 card to place on bottom of digivolution cards.");
  138. selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
  139. yield return StartCoroutine(selectHandEffect.Activate());
  140. IEnumerator SelectCardCoroutine(CardSource cardSource)
  141. {
  142. selectedCard = cardSource;
  143. yield return null;
  144. }
  145. if (selectedCard != null)
  146. {
  147. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { selectedCard }, activateClass));
  148. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(
  149. targetPermanent: card.PermanentOfThisCard(),
  150. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  151. activateClass: activateClass));
  152. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  153. targetPermanent: card.PermanentOfThisCard(),
  154. changeValue: 3000,
  155. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  156. activateClass: activateClass));
  157. }
  158. }
  159. }
  160. }
  161. #endregion
  162. #region Piercing - ESS
  163. if (timing == EffectTiming.OnDetermineDoSecurityCheck)
  164. {
  165. cardEffects.Add(CardEffectFactory.PierceSelfEffect(
  166. isInheritedEffect: true,
  167. card: card,
  168. condition: null));
  169. }
  170. #endregion
  171. return cardEffects;
  172. }
  173. }
  174. }