BT13_076.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT13
  5. {
  6. public class BT13_076 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return (targetPermanent.TopCard.ContainsCardName("Etemon") || targetPermanent.TopCard.ContainsCardName("Sukamon")) && targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 5;
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 4, ignoreDigivolutionRequirement: false, card: card, condition: null));
  18. }
  19. if (timing == EffectTiming.OnDestroyedAnyone)
  20. {
  21. ActivateClass activateClass = new ActivateClass();
  22. activateClass.SetUpICardEffect("DP -3000 and Security Attack -1", CanUseCondition, card);
  23. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  24. activateClass.SetHashString("DP-3000_BT13_076");
  25. cardEffects.Add(activateClass);
  26. string EffectDiscription()
  27. {
  28. return "[All Turns][Once Per Turn] When another Digimon with [Etemon] or [Sukamon] in its name is deleted, 1 of your opponent's Digimon gets -3000 DP and gains <Security Attack -1> until the end of your opponent's turn.";
  29. }
  30. bool CanSelectPermanentCondition(Permanent permanent)
  31. {
  32. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  33. }
  34. bool PermanentCondition(Permanent permanent)
  35. {
  36. if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
  37. {
  38. if (permanent.IsDigimon)
  39. {
  40. if (permanent != card.PermanentOfThisCard())
  41. {
  42. if (permanent.TopCard.ContainsCardName("Sukamon"))
  43. {
  44. return true;
  45. }
  46. if (permanent.TopCard.ContainsCardName("Etemon"))
  47. {
  48. return true;
  49. }
  50. }
  51. }
  52. }
  53. return false;
  54. }
  55. bool CanUseCondition(Hashtable hashtable)
  56. {
  57. if (CardEffectCommons.IsExistOnBattleArea(card))
  58. {
  59. if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition, activateClass))
  60. {
  61. return true;
  62. }
  63. }
  64. return false;
  65. }
  66. bool CanActivateCondition(Hashtable hashtable)
  67. {
  68. if (CardEffectCommons.IsExistOnBattleArea(card))
  69. {
  70. return true;
  71. }
  72. return false;
  73. }
  74. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  75. {
  76. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  77. {
  78. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  79. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  80. selectPermanentEffect.SetUp(
  81. selectPlayer: card.Owner,
  82. canTargetCondition: CanSelectPermanentCondition,
  83. canTargetCondition_ByPreSelecetedList: null,
  84. canEndSelectCondition: null,
  85. maxCount: maxCount,
  86. canNoSelect: false,
  87. canEndNotMax: false,
  88. selectPermanentCoroutine: SelectPermanentCoroutine,
  89. afterSelectPermanentCoroutine: null,
  90. mode: SelectPermanentEffect.Mode.Custom,
  91. cardEffect: activateClass);
  92. selectPermanentEffect.SetUpCustomMessage(
  93. "Select 1 Digimon that will get effects.",
  94. "The opponent is selecting 1 Digimon that will get effects.");
  95. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  96. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  97. {
  98. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  99. targetPermanent: permanent,
  100. changeValue: -3000,
  101. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  102. activateClass: activateClass));
  103. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(
  104. targetPermanent: permanent,
  105. changeValue: -1,
  106. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  107. activateClass: activateClass));
  108. }
  109. }
  110. }
  111. }
  112. if (timing == EffectTiming.None)
  113. {
  114. bool PermanentCondition(Permanent permanent)
  115. {
  116. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  117. {
  118. if (permanent.TopCard.ContainsCardName("Etemon"))
  119. {
  120. return true;
  121. }
  122. if (permanent.TopCard.ContainsCardName("Sukamon"))
  123. {
  124. return true;
  125. }
  126. }
  127. return false;
  128. }
  129. bool CanUseCondition()
  130. {
  131. if (CardEffectCommons.IsExistOnBattleArea(card))
  132. {
  133. if (CardEffectCommons.IsOpponentTurn(card))
  134. {
  135. return true;
  136. }
  137. }
  138. return false;
  139. }
  140. cardEffects.Add(CardEffectFactory.BlockerStaticEffect(
  141. permanentCondition: PermanentCondition,
  142. isInheritedEffect: false,
  143. card: card,
  144. condition: CanUseCondition));
  145. }
  146. if (timing == EffectTiming.None)
  147. {
  148. bool PermanentCondition(Permanent permanent)
  149. {
  150. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  151. {
  152. if (permanent.TopCard.ContainsCardName("Etemon") || permanent.TopCard.ContainsCardName("Sukamon"))
  153. {
  154. return true;
  155. }
  156. }
  157. return false;
  158. }
  159. bool CardEffectCondition(ICardEffect cardEffect)
  160. {
  161. return true;
  162. }
  163. bool CanUseCondition()
  164. {
  165. if (CardEffectCommons.IsExistOnBattleArea(card))
  166. {
  167. if (CardEffectCommons.IsOpponentTurn(card))
  168. {
  169. return true;
  170. }
  171. }
  172. return false;
  173. }
  174. string effectName = "Your Digimon can't return to hand";
  175. cardEffects.Add(CardEffectFactory.CannotReturnToHandStaticEffect(
  176. permanentCondition: PermanentCondition,
  177. cardEffectCondition: CardEffectCondition,
  178. isInheritedEffect: false,
  179. card: card,
  180. condition: CanUseCondition,
  181. effectName: effectName
  182. ));
  183. }
  184. if (timing == EffectTiming.None)
  185. {
  186. bool PermanentCondition(Permanent permanent)
  187. {
  188. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  189. {
  190. if (permanent.TopCard.ContainsCardName("Etemon") || permanent.TopCard.ContainsCardName("Sukamon"))
  191. {
  192. return true;
  193. }
  194. }
  195. return false;
  196. }
  197. bool CardEffectCondition(ICardEffect cardEffect)
  198. {
  199. return true;
  200. }
  201. bool CanUseCondition()
  202. {
  203. if (CardEffectCommons.IsExistOnBattleArea(card))
  204. {
  205. if (CardEffectCommons.IsOpponentTurn(card))
  206. {
  207. return true;
  208. }
  209. }
  210. return false;
  211. }
  212. string effectName = "Your Digimon can't return to deck";
  213. cardEffects.Add(CardEffectFactory.CannotReturnToDeckStaticEffect(
  214. permanentCondition: PermanentCondition,
  215. cardEffectCondition: CardEffectCondition,
  216. isInheritedEffect: false,
  217. card: card,
  218. condition: CanUseCondition,
  219. effectName: effectName
  220. ));
  221. }
  222. return cardEffects;
  223. }
  224. }
  225. }