BT13_008.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. namespace DCGO.CardEffects.BT13
  6. {
  7. public class BT13_008 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.CardNames.Contains("Koromon");
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
  19. }
  20. if (timing == EffectTiming.OnDeclaration)
  21. {
  22. ActivateClass activateClass = new ActivateClass();
  23. activateClass.SetUpICardEffect("Your 1 [Marcus Damon] becomes Digimon", CanUseCondition, card);
  24. activateClass.SetUpActivateClass(null, ActivateCoroutine, 1, false, EffectDiscription());
  25. activateClass.SetHashString("BecomeDigimon_BT13_008");
  26. cardEffects.Add(activateClass);
  27. string EffectDiscription()
  28. {
  29. return "[Main][Once Per Turn] For the turn, 1 of your [Marcus Damon]s is also treated as a 3000 DP Digimon and can't digivolve.";
  30. }
  31. bool CanSelectPermanentCondition(Permanent permanent)
  32. {
  33. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  34. {
  35. if (permanent.TopCard.CardNames.Contains("Marcus Damon"))
  36. {
  37. return true;
  38. }
  39. if (permanent.TopCard.CardNames.Contains("MarcusDamon"))
  40. {
  41. return true;
  42. }
  43. }
  44. return false;
  45. }
  46. bool CanUseCondition(Hashtable hashtable)
  47. {
  48. if (CardEffectCommons.IsExistOnBattleArea(card))
  49. {
  50. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
  51. {
  52. return true;
  53. }
  54. }
  55. return false;
  56. }
  57. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  58. {
  59. int maxCount = Math.Min(1, card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition));
  60. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  61. selectPermanentEffect.SetUp(
  62. selectPlayer: card.Owner,
  63. canTargetCondition: CanSelectPermanentCondition,
  64. canTargetCondition_ByPreSelecetedList: null,
  65. canEndSelectCondition: null,
  66. maxCount: maxCount,
  67. canNoSelect: false,
  68. canEndNotMax: false,
  69. selectPermanentCoroutine: SelectPermanentCoroutine,
  70. afterSelectPermanentCoroutine: null,
  71. mode: SelectPermanentEffect.Mode.Custom,
  72. cardEffect: activateClass);
  73. selectPermanentEffect.SetUpCustomMessage("Select 1 [Marcus Damon].", "The opponent is selecting 1 [Marcus Damon].");
  74. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  75. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  76. {
  77. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BecomeDigimonThatCantDigivolve(targetPermanent: permanent, DP: 3000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  78. }
  79. }
  80. }
  81. if (timing == EffectTiming.OnTappedAnyone)
  82. {
  83. ActivateClass activateClass = new ActivateClass();
  84. activateClass.SetUpICardEffect("Delete 1 Digimon with 3000 DP or less", CanUseCondition, card);
  85. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
  86. activateClass.SetIsInheritedEffect(true);
  87. activateClass.SetHashString("Delete_BT13_008");
  88. cardEffects.Add(activateClass);
  89. string EffectDiscription()
  90. {
  91. return "[Your Turn][Once Per Turn] When one of your red or yellow Tamers becomes suspended, you may delete 1 of your opponent's Digimon with 3000 DP or less.";
  92. }
  93. bool PermanentCondition(Permanent permanent)
  94. {
  95. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  96. {
  97. if (permanent.IsTamer)
  98. {
  99. if (permanent.TopCard.CardColors.Contains(CardColor.Red))
  100. {
  101. return true;
  102. }
  103. if (permanent.TopCard.CardColors.Contains(CardColor.Yellow))
  104. {
  105. return true;
  106. }
  107. }
  108. }
  109. return false;
  110. }
  111. bool CanSelectPermanentCondition(Permanent permanent)
  112. {
  113. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  114. {
  115. if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(3000, activateClass))
  116. {
  117. return true;
  118. }
  119. }
  120. return false;
  121. }
  122. bool CanUseCondition(Hashtable hashtable)
  123. {
  124. if (CardEffectCommons.IsExistOnBattleArea(card))
  125. {
  126. if (CardEffectCommons.IsOwnerTurn(card))
  127. {
  128. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  129. {
  130. return true;
  131. }
  132. }
  133. }
  134. return false;
  135. }
  136. bool CanActivateCondition(Hashtable hashtable)
  137. {
  138. if (CardEffectCommons.IsExistOnBattleArea(card))
  139. {
  140. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  141. {
  142. return true;
  143. }
  144. }
  145. return false;
  146. }
  147. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  148. {
  149. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  150. {
  151. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  152. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  153. selectPermanentEffect.SetUp(
  154. selectPlayer: card.Owner,
  155. canTargetCondition: CanSelectPermanentCondition,
  156. canTargetCondition_ByPreSelecetedList: null,
  157. canEndSelectCondition: null,
  158. maxCount: maxCount,
  159. canNoSelect: false,
  160. canEndNotMax: false,
  161. selectPermanentCoroutine: null,
  162. afterSelectPermanentCoroutine: null,
  163. mode: SelectPermanentEffect.Mode.Destroy,
  164. cardEffect: activateClass);
  165. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  166. }
  167. }
  168. }
  169. return cardEffects;
  170. }
  171. }
  172. }