EX12_057.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Takutoumon
  4. namespace DCGO.CardEffects.EX12
  5. {
  6. public class EX12_057 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Alternative Digivolution Condition
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.EqualsTraits("Shambala");
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  19. permanentCondition: PermanentCondition,
  20. digivolutionCost: 3,
  21. ignoreDigivolutionRequirement: false,
  22. card: card,
  23. condition: null,
  24. level: 5)
  25. );
  26. }
  27. #endregion
  28. #region Shared OP/WD/C
  29. string SharedEffectName = "May play [Paishu] Token";
  30. string SharedEffectHash = "EX12_057_OP_WD_C";
  31. CardEffectFactory.ActivateClassesForSharedEffects
  32. (ref cardEffects, timing, card,
  33. SharedEffectName,
  34. SharedActivateCoroutine,
  35. SharedEffectDescription,
  36. optional: true,
  37. maxCountPerTurn: 1,
  38. hashValue: SharedEffectHash,
  39. onPlay: true,
  40. whenDigivolving: true,
  41. counter: true);
  42. string SharedEffectDescription(string tag)
  43. {
  44. return $"[{tag}] [Once Per Turn] You may play 1 [Paishu] Token. (Digimon / Yellow / 6000 DP / <Blocker> <Guard> (When any of your other Digimon would leave the battle area by your opponent's effects, by deleting this Digimon, they don't leave.))";
  45. }
  46. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  47. {
  48. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPaishuToken(activateClass));
  49. }
  50. #endregion
  51. #region All Turns
  52. if (timing == EffectTiming.OnEnterFieldAnyone)
  53. {
  54. ActivateClass activateClass = new ActivateClass();
  55. activateClass.SetUpICardEffect("<De-Digivolve 2> 1 enemy Digimon, then -6K DP 1 enemy Digimon until their turn ends", CanUseCondition, card);
  56. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  57. activateClass.SetHashString("EX12_057_AT");
  58. cardEffects.Add(activateClass);
  59. string EffectDescription()
  60. {
  61. return "[All Turns] [Once Per Turn] When any of your Digimon are played, <De-Digivolve 2> 1 of your opponent's Digimon. Then, 1 of their Digimon gets -6000 DP until their turn ends.";
  62. }
  63. bool CanUseCondition(Hashtable hashtable)
  64. {
  65. return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
  66. && CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition);
  67. }
  68. bool CanActivateCondition(Hashtable hashtable)
  69. {
  70. return CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass);
  71. }
  72. bool PermanentCondition(Permanent permanent)
  73. {
  74. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  75. }
  76. bool CanSelectPermanentCondition(Permanent permanent)
  77. {
  78. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  79. }
  80. IEnumerator ActivateCoroutine(Hashtable hashtable)
  81. {
  82. if(CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  83. {
  84. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  85. selectPermanentEffect.SetUp(
  86. selectPlayer: card.Owner,
  87. canTargetCondition: CanSelectPermanentCondition,
  88. canTargetCondition_ByPreSelecetedList: null,
  89. canEndSelectCondition: null,
  90. maxCount: 1,
  91. canNoSelect: false,
  92. canEndNotMax: false,
  93. selectPermanentCoroutine: null,
  94. afterSelectPermanentCoroutine: null,
  95. mode: SelectPermanentEffect.Mode.Degenerate,
  96. cardEffect: activateClass);
  97. selectPermanentEffect.SetDegenerationCount(2);
  98. selectPermanentEffect.SetUpCustomMessage("Select 1 opponent's Digimon to De-Digivolve", "The opponent is selecting 1 Digimon to De-Digivolve");
  99. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  100. SelectPermanentEffect selectPermanentEffect2 = GManager.instance.GetComponent<SelectPermanentEffect>();
  101. selectPermanentEffect2.SetUp(
  102. selectPlayer: card.Owner,
  103. canTargetCondition: CanSelectPermanentCondition,
  104. canTargetCondition_ByPreSelecetedList: null,
  105. canEndSelectCondition: null,
  106. maxCount: 1,
  107. canNoSelect: false,
  108. canEndNotMax: false,
  109. selectPermanentCoroutine: SelectPermanentCoroutine,
  110. afterSelectPermanentCoroutine: null,
  111. mode: SelectPermanentEffect.Mode.Custom,
  112. cardEffect: activateClass);
  113. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -6000.", "The opponent is selecting 1 Digimon that will get DP -6000.");
  114. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  115. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  116. {
  117. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -6000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  118. }
  119. }
  120. }
  121. }
  122. #endregion
  123. return cardEffects;
  124. }
  125. }
  126. }