BT20_025.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT20
  4. {
  5. public class BT20_025 : 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. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.EqualsCardName("Coredramon");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition,
  18. digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
  19. }
  20. #endregion
  21. #region On Play
  22. if (timing == EffectTiming.OnEnterFieldAnyone)
  23. {
  24. ActivateClass activateClass = new ActivateClass();
  25. activateClass.SetUpICardEffect("Delete 1 Digimon with 6000 DP or less", CanUseCondition, card);
  26. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  27. cardEffects.Add(activateClass);
  28. string EffectDescription()
  29. {
  30. return "[On Play] Delete 1 of your opponent's Digimon with 6000 DP or less.";
  31. }
  32. bool CanUseCondition(Hashtable hashtable)
  33. {
  34. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  35. }
  36. bool CanSelectPermanentCondition(Permanent permanent)
  37. {
  38. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  39. permanent.DP <= card.Owner.MaxDP_DeleteEffect(6000, activateClass);
  40. }
  41. bool CanActivateCondition(Hashtable hashtable)
  42. {
  43. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  44. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
  45. }
  46. IEnumerator ActivateCoroutine(Hashtable hashtable)
  47. {
  48. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  49. selectPermanentEffect.SetUp(
  50. selectPlayer: card.Owner,
  51. canTargetCondition: CanSelectPermanentCondition,
  52. canTargetCondition_ByPreSelecetedList: null,
  53. canEndSelectCondition: null,
  54. maxCount: 1,
  55. canNoSelect: false,
  56. canEndNotMax: false,
  57. selectPermanentCoroutine: null,
  58. afterSelectPermanentCoroutine: null,
  59. mode: SelectPermanentEffect.Mode.Destroy,
  60. cardEffect: activateClass);
  61. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  62. }
  63. }
  64. #endregion
  65. #region When Digivolving
  66. if (timing == EffectTiming.OnEnterFieldAnyone)
  67. {
  68. ActivateClass activateClass = new ActivateClass();
  69. activateClass.SetUpICardEffect("Delete 1 Digimon with 6000 DP or less", CanUseCondition, card);
  70. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  71. cardEffects.Add(activateClass);
  72. string EffectDescription()
  73. {
  74. return "[When Digivolving] Delete 1 of your opponent's Digimon with 6000 DP or less.";
  75. }
  76. bool CanUseCondition(Hashtable hashtable)
  77. {
  78. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  79. }
  80. bool CanSelectPermanentCondition(Permanent permanent)
  81. {
  82. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  83. permanent.DP <= card.Owner.MaxDP_DeleteEffect(6000, activateClass);
  84. }
  85. bool CanActivateCondition(Hashtable hashtable)
  86. {
  87. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  88. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
  89. }
  90. IEnumerator ActivateCoroutine(Hashtable hashtable)
  91. {
  92. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  93. selectPermanentEffect.SetUp(
  94. selectPlayer: card.Owner,
  95. canTargetCondition: CanSelectPermanentCondition,
  96. canTargetCondition_ByPreSelecetedList: null,
  97. canEndSelectCondition: null,
  98. maxCount: 1,
  99. canNoSelect: false,
  100. canEndNotMax: false,
  101. selectPermanentCoroutine: null,
  102. afterSelectPermanentCoroutine: null,
  103. mode: SelectPermanentEffect.Mode.Destroy,
  104. cardEffect: activateClass);
  105. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  106. }
  107. }
  108. #endregion
  109. #region All Turns
  110. if (timing == EffectTiming.None)
  111. {
  112. AddJogressLevelsClass addJogressLevelsClass = new AddJogressLevelsClass();
  113. addJogressLevelsClass.SetUpICardEffect("Also treated as level 6 for DNA Digivolution", CanUseCondition, card);
  114. addJogressLevelsClass.SetUpAddJogressLevelsClass(AddJogressLevels);
  115. cardEffects.Add(addJogressLevelsClass);
  116. bool CanUseCondition(Hashtable hashtable)
  117. {
  118. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  119. }
  120. List<int> AddJogressLevels(CardSource cardSource, Permanent permanent)
  121. {
  122. List<int> levels = new List<int>();
  123. if (permanent == card.PermanentOfThisCard())
  124. {
  125. if (cardSource != null)
  126. {
  127. if (cardSource.Owner == card.Owner)
  128. {
  129. if (cardSource.Owner.HandCards.Contains(cardSource))
  130. {
  131. if (cardSource.CardNames.Contains("Examon"))
  132. {
  133. levels.Add(6);
  134. }
  135. }
  136. }
  137. }
  138. }
  139. return levels;
  140. }
  141. }
  142. if (timing == EffectTiming.None)
  143. {
  144. ChangeCardNamesClass changeCardNamesClass = new ChangeCardNamesClass();
  145. changeCardNamesClass.SetUpICardEffect("Also treated as [Slayerdramon]", CanUseCondition, card);
  146. changeCardNamesClass.SetUpChangeCardNamesClass(changeCardNames: ChangeCardNames);
  147. cardEffects.Add(changeCardNamesClass);
  148. bool CanUseCondition(Hashtable hashtable)
  149. {
  150. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  151. }
  152. List<string> ChangeCardNames(CardSource cardSource, List<string> cardNames)
  153. {
  154. if (cardSource == card)
  155. {
  156. cardNames.Add("Slayerdramon");
  157. }
  158. return cardNames;
  159. }
  160. }
  161. #endregion
  162. #region Security Attack
  163. if (timing == EffectTiming.None)
  164. {
  165. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(
  166. changeValue: 1,
  167. isInheritedEffect: true,
  168. card: card,
  169. condition: null));
  170. }
  171. #endregion
  172. return cardEffects;
  173. }
  174. }
  175. }