BT22_050.cs 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. //Roamon
  4. namespace DCGO.CardEffects.BT22
  5. {
  6. public class BT22_050 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Link Condition
  12. if (timing == EffectTiming.None)
  13. {
  14. static bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.HasAppmonTraits;
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfLinkConditionStaticEffect(permanentCondition: PermanentCondition, linkCost: 2, card: card));
  19. }
  20. #endregion
  21. #region Link
  22. if (timing == EffectTiming.OnDeclaration)
  23. {
  24. cardEffects.Add(CardEffectFactory.LinkEffect(card));
  25. }
  26. #endregion
  27. #region Alternative Digivolution Condition
  28. if (timing == EffectTiming.None)
  29. {
  30. bool PermanentCondition(Permanent targetPermanent)
  31. {
  32. return targetPermanent.TopCard.EqualsTraits("Stnd.");
  33. }
  34. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  35. permanentCondition: PermanentCondition,
  36. digivolutionCost: 2,
  37. ignoreDigivolutionRequirement: false,
  38. card: card,
  39. condition: null)
  40. );
  41. }
  42. #endregion
  43. #region Security
  44. if (timing == EffectTiming.SecuritySkill)
  45. {
  46. cardEffects.Add(CardEffectFactory.PlaySelfDigimonAfterBattleSecurityEffect(card: card));
  47. }
  48. #endregion
  49. #region On Play
  50. if (timing == EffectTiming.OnEnterFieldAnyone)
  51. {
  52. ActivateClass activateClass = new ActivateClass();
  53. activateClass.SetUpICardEffect("Suspend 1 Digimon", CanUseCondition, card);
  54. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  55. cardEffects.Add(activateClass);
  56. string EffectDiscription()
  57. {
  58. return "[On Play] Suspend 1 of your opponent's Digimon.";
  59. }
  60. bool IsOpponentsDigimon(Permanent permanent)
  61. {
  62. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  63. }
  64. bool CanUseCondition(Hashtable hashtable)
  65. {
  66. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  67. CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  68. }
  69. bool CanActivateCondition(Hashtable hashtable)
  70. {
  71. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  72. CardEffectCommons.HasMatchConditionOpponentsPermanent(card, IsOpponentsDigimon);
  73. }
  74. IEnumerator ActivateCoroutine(Hashtable hashtable)
  75. {
  76. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  77. selectPermanentEffect.SetUp(
  78. selectPlayer: card.Owner,
  79. canTargetCondition: IsOpponentsDigimon,
  80. canTargetCondition_ByPreSelecetedList: null,
  81. canEndSelectCondition: null,
  82. maxCount: 1,
  83. canNoSelect: false,
  84. canEndNotMax: false,
  85. selectPermanentCoroutine: null,
  86. afterSelectPermanentCoroutine: null,
  87. mode: SelectPermanentEffect.Mode.Tap,
  88. cardEffect: activateClass);
  89. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  90. }
  91. }
  92. #endregion
  93. #region When Digivolving
  94. if (timing == EffectTiming.OnEnterFieldAnyone)
  95. {
  96. ActivateClass activateClass = new ActivateClass();
  97. activateClass.SetUpICardEffect("Suspend 1 Digimon", CanUseCondition, card);
  98. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  99. cardEffects.Add(activateClass);
  100. string EffectDiscription()
  101. {
  102. return "[When Digivolving] Suspend 1 of your opponent's Digimon.";
  103. }
  104. bool IsOpponentsDigimon(Permanent permanent)
  105. {
  106. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  107. }
  108. bool CanUseCondition(Hashtable hashtable)
  109. {
  110. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  111. CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  112. }
  113. bool CanActivateCondition(Hashtable hashtable)
  114. {
  115. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  116. CardEffectCommons.HasMatchConditionOpponentsPermanent(card, IsOpponentsDigimon);
  117. }
  118. IEnumerator ActivateCoroutine(Hashtable hashtable)
  119. {
  120. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  121. selectPermanentEffect.SetUp(
  122. selectPlayer: card.Owner,
  123. canTargetCondition: IsOpponentsDigimon,
  124. canTargetCondition_ByPreSelecetedList: null,
  125. canEndSelectCondition: null,
  126. maxCount: 1,
  127. canNoSelect: false,
  128. canEndNotMax: false,
  129. selectPermanentCoroutine: null,
  130. afterSelectPermanentCoroutine: null,
  131. mode: SelectPermanentEffect.Mode.Tap,
  132. cardEffect: activateClass);
  133. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  134. }
  135. }
  136. #endregion
  137. #region When Linking
  138. if (timing == EffectTiming.WhenLinked)
  139. {
  140. ActivateClass activateClass = new ActivateClass();
  141. activateClass.SetUpICardEffect("Suspend 1 Digimon", CanUseCondition, card);
  142. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  143. activateClass.SetIsLinkedEffect(true);
  144. cardEffects.Add(activateClass);
  145. string EffectDiscription()
  146. {
  147. return "[When Linking] Suspend 1 of your opponent's Digimon.";
  148. }
  149. bool IsOpponentsDigimon(Permanent permanent)
  150. {
  151. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  152. }
  153. bool CanUseCondition(Hashtable hashtable)
  154. {
  155. return CardEffectCommons.CanTriggerWhenLinking(hashtable, null, card);
  156. }
  157. bool CanActivateCondition(Hashtable hashtable)
  158. {
  159. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  160. CardEffectCommons.HasMatchConditionOpponentsPermanent(card, IsOpponentsDigimon);
  161. }
  162. IEnumerator ActivateCoroutine(Hashtable hashtable)
  163. {
  164. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  165. selectPermanentEffect.SetUp(
  166. selectPlayer: card.Owner,
  167. canTargetCondition: IsOpponentsDigimon,
  168. canTargetCondition_ByPreSelecetedList: null,
  169. canEndSelectCondition: null,
  170. maxCount: 1,
  171. canNoSelect: false,
  172. canEndNotMax: false,
  173. selectPermanentCoroutine: null,
  174. afterSelectPermanentCoroutine: null,
  175. mode: SelectPermanentEffect.Mode.Tap,
  176. cardEffect: activateClass);
  177. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  178. }
  179. }
  180. #endregion
  181. return cardEffects;
  182. }
  183. }
  184. }