BT18_067.cs 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT18
  4. {
  5. public class BT18_067 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Alternate Digivolution
  11. // Any black or yellow tamer
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.IsTamer && (targetPermanent.TopCard.CardColors.Contains(CardColor.Black) ||
  17. targetPermanent.TopCard.CardColors.Contains(CardColor.Yellow));
  18. }
  19. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  20. permanentCondition: PermanentCondition, digivolutionCost: 4, ignoreDigivolutionRequirement: false,
  21. card: card, condition: null));
  22. }
  23. // J.P. Shibayama
  24. if (timing == EffectTiming.None)
  25. {
  26. bool PermanentCondition(Permanent targetPermanent)
  27. {
  28. return targetPermanent.TopCard.EqualsCardName("J.P. Shibayama");
  29. }
  30. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  31. permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false,
  32. card: card, condition: null));
  33. }
  34. // Beetlemon
  35. if (timing == EffectTiming.None)
  36. {
  37. bool PermanentCondition(Permanent targetPermanent)
  38. {
  39. return targetPermanent.TopCard.EqualsCardName("Beetlemon");
  40. }
  41. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  42. permanentCondition: PermanentCondition, digivolutionCost: 1, ignoreDigivolutionRequirement: false,
  43. card: card, condition: null));
  44. }
  45. #endregion
  46. #region Blocker
  47. if (timing == EffectTiming.None)
  48. {
  49. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
  50. isInheritedEffect: false,
  51. card: card,
  52. condition: null));
  53. }
  54. #endregion
  55. #region On Play/ When Digivolving Shared
  56. bool CanSelectPermanentConditionShared(Permanent permanent)
  57. {
  58. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  59. }
  60. bool CanActivateConditionShared(Hashtable hashtable)
  61. {
  62. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  63. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared);
  64. }
  65. #endregion
  66. #region On Play
  67. if (timing == EffectTiming.OnEnterFieldAnyone)
  68. {
  69. ActivateClass activateClass = new ActivateClass();
  70. activateClass.SetUpICardEffect("De-Digivolve 1", CanUseCondition, card);
  71. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
  72. cardEffects.Add(activateClass);
  73. string EffectDescription()
  74. {
  75. return
  76. "[On Play] <De-Digivolve 1> 1 of your opponent's Digimon.";
  77. }
  78. bool CanUseCondition(Hashtable hashtable)
  79. {
  80. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  81. }
  82. IEnumerator ActivateCoroutine(Hashtable hashtable)
  83. {
  84. SelectPermanentEffect selectPermanentEffect =
  85. GManager.instance.GetComponent<SelectPermanentEffect>();
  86. selectPermanentEffect.SetUp(
  87. selectPlayer: card.Owner,
  88. canTargetCondition: CanSelectPermanentConditionShared,
  89. canTargetCondition_ByPreSelecetedList: null,
  90. canEndSelectCondition: null,
  91. maxCount: 1,
  92. canNoSelect: false,
  93. canEndNotMax: false,
  94. selectPermanentCoroutine: SelectPermanentCoroutine,
  95. afterSelectPermanentCoroutine: null,
  96. mode: SelectPermanentEffect.Mode.Custom,
  97. cardEffect: activateClass);
  98. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to De-Digivolve.",
  99. "The opponent is selecting 1 Digimon to De-Digivolve.");
  100. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  101. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  102. {
  103. yield return ContinuousController.instance.StartCoroutine(
  104. new IDegeneration(permanent, 1, activateClass).Degeneration());
  105. }
  106. }
  107. }
  108. #endregion
  109. #region When Digivolving
  110. if (timing == EffectTiming.OnEnterFieldAnyone)
  111. {
  112. ActivateClass activateClass = new ActivateClass();
  113. activateClass.SetUpICardEffect("De-Digivolve 1", CanUseCondition, card);
  114. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
  115. cardEffects.Add(activateClass);
  116. string EffectDescription()
  117. {
  118. return
  119. "[When Digivolving] <De-Digivolve 1> 1 of your opponent's Digimon.";
  120. }
  121. bool CanUseCondition(Hashtable hashtable)
  122. {
  123. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  124. }
  125. IEnumerator ActivateCoroutine(Hashtable hashtable)
  126. {
  127. SelectPermanentEffect selectPermanentEffect =
  128. GManager.instance.GetComponent<SelectPermanentEffect>();
  129. selectPermanentEffect.SetUp(
  130. selectPlayer: card.Owner,
  131. canTargetCondition: CanSelectPermanentConditionShared,
  132. canTargetCondition_ByPreSelecetedList: null,
  133. canEndSelectCondition: null,
  134. maxCount: 1,
  135. canNoSelect: false,
  136. canEndNotMax: false,
  137. selectPermanentCoroutine: SelectPermanentCoroutine,
  138. afterSelectPermanentCoroutine: null,
  139. mode: SelectPermanentEffect.Mode.Custom,
  140. cardEffect: activateClass);
  141. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to De-Digivolve.",
  142. "The opponent is selecting 1 Digimon to De-Digivolve.");
  143. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  144. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  145. {
  146. yield return ContinuousController.instance.StartCoroutine(
  147. new IDegeneration(permanent, 1, activateClass).Degeneration());
  148. }
  149. }
  150. }
  151. #endregion
  152. #region Blocker - ESS
  153. if (timing == EffectTiming.None)
  154. {
  155. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
  156. isInheritedEffect: true,
  157. card: card,
  158. condition: null));
  159. }
  160. #endregion
  161. return cardEffects;
  162. }
  163. }
  164. }