BT23_050.cs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. using Photon.Pun;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using UnityEngine;
  7. //Ankylomon
  8. namespace DCGO.CardEffects.BT23
  9. {
  10. public class BT23_050 : CEntity_Effect
  11. {
  12. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  13. {
  14. List<ICardEffect> cardEffects = new List<ICardEffect>();
  15. #region Alternate Digivolution
  16. if (timing == EffectTiming.None)
  17. {
  18. bool PermanentCondition(Permanent targetPermanent)
  19. {
  20. return targetPermanent.TopCard.EqualsCardName("Armadillomon") ||
  21. (targetPermanent.TopCard.IsLevel3 &&
  22. targetPermanent.TopCard.HasCSTraits);
  23. }
  24. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  25. permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false,
  26. card: card, condition: null));
  27. }
  28. #endregion
  29. #region Blocker/ Blocker ESS
  30. if (timing == EffectTiming.None)
  31. {
  32. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
  33. isInheritedEffect: false,
  34. card: card,
  35. condition: null));
  36. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
  37. isInheritedEffect: true,
  38. card: card,
  39. condition: null));
  40. }
  41. #endregion
  42. #region OP/WD Shared
  43. bool CanSelectPermanentCondition(Permanent permanent)
  44. {
  45. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  46. }
  47. bool CanSelectDNACardCondition(CardSource cardSource)
  48. {
  49. if (cardSource.IsDigimon)
  50. {
  51. if (cardSource.CanPlayJogress(true))
  52. {
  53. if (cardSource.EqualsCardName("Shakkoumon"))
  54. {
  55. return true;
  56. }
  57. }
  58. }
  59. return false;
  60. }
  61. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  62. {
  63. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  64. {
  65. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  66. selectPermanentEffect.SetUp(
  67. selectPlayer: card.Owner,
  68. canTargetCondition: CanSelectPermanentCondition,
  69. canTargetCondition_ByPreSelecetedList: null,
  70. canEndSelectCondition: null,
  71. maxCount: 1,
  72. canNoSelect: false,
  73. canEndNotMax: false,
  74. selectPermanentCoroutine: SelectPermanentCoroutine,
  75. afterSelectPermanentCoroutine: null,
  76. mode: SelectPermanentEffect.Mode.Custom,
  77. cardEffect: activateClass);
  78. selectPermanentEffect.SetUpCustomMessage(customMessageArray: CardEffectCommons.customPermanentMessageArray_ChangeDP(changeValue: -2000, maxCount: 1));
  79. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  80. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  81. {
  82. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  83. targetPermanent: permanent,
  84. changeValue: -2000,
  85. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  86. activateClass: activateClass));
  87. }
  88. }
  89. if (CardEffectCommons.IsOwnerTurn(card))
  90. {
  91. yield return ContinuousController.instance.StartCoroutine(
  92. CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
  93. CanSelectDNACardCondition,
  94. payCost: true,
  95. isHand: true,
  96. activateClass
  97. ));
  98. }
  99. }
  100. #endregion
  101. #region On Play
  102. if (timing == EffectTiming.OnEnterFieldAnyone)
  103. {
  104. ActivateClass activateClass = new ActivateClass();
  105. activateClass.SetUpICardEffect("Give -2000 DP, then if its your turn, you may DNA", CanUseCondition, card);
  106. activateClass.SetUpActivateClass(CanActivateCondition, hash => SharedActivateCoroutine(hash, activateClass), -1, false, EffectDiscription());
  107. cardEffects.Add(activateClass);
  108. string EffectDiscription()
  109. {
  110. return "[On Play] 1 of your opponent's Digimon gets -2000 DP until their turn ends. Then, if it's your turn, 2 of your Digimon may DNA digivolve into [Shakkoumon] in the hand.";
  111. }
  112. bool CanUseCondition(Hashtable hashtable)
  113. {
  114. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  115. && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  116. }
  117. bool CanActivateCondition(Hashtable hashtable)
  118. {
  119. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  120. }
  121. }
  122. #endregion
  123. #region When Digivolving
  124. if (timing == EffectTiming.OnEnterFieldAnyone)
  125. {
  126. ActivateClass activateClass = new ActivateClass();
  127. activateClass.SetUpICardEffect("Give -2000 DP, then if its your turn, you may DNA", CanUseCondition, card);
  128. activateClass.SetUpActivateClass(CanActivateCondition, hash => SharedActivateCoroutine(hash, activateClass), -1, false, EffectDiscription());
  129. cardEffects.Add(activateClass);
  130. string EffectDiscription()
  131. {
  132. return "[When Digivolving] 1 of your opponent's Digimon gets -2000 DP until their turn ends. Then, if it's your turn, 2 of your Digimon may DNA digivolve into [Shakkoumon] in the hand.";
  133. }
  134. bool CanUseCondition(Hashtable hashtable)
  135. {
  136. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  137. && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  138. }
  139. bool CanActivateCondition(Hashtable hashtable)
  140. {
  141. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  142. }
  143. }
  144. #endregion
  145. return cardEffects;
  146. }
  147. }
  148. }