BT23_026.cs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // Lopmon
  5. namespace DCGO.CardEffects.BT23
  6. {
  7. public class BT23_026 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Alternative Digivolution Condition
  13. if (timing == EffectTiming.None)
  14. {
  15. bool PermanentCondition(Permanent targetPermanent)
  16. {
  17. return targetPermanent.TopCard.EqualsCardName("Kokomon")
  18. || (targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.IsLevel2 && targetPermanent.TopCard.HasCSTraits);
  19. }
  20. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  21. permanentCondition: PermanentCondition,
  22. digivolutionCost: 0,
  23. ignoreDigivolutionRequirement: false,
  24. card: card,
  25. condition: null)
  26. );
  27. }
  28. #endregion
  29. #region Antylamon Alternative Digivolution Condition
  30. if (timing == EffectTiming.None)
  31. {
  32. bool PermanentCondition(Permanent permanent)
  33. {
  34. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  35. && permanent == card.PermanentOfThisCard();
  36. }
  37. bool Condition()
  38. {
  39. return CardEffectCommons.IsOwnerTurn(card)
  40. && CardEffectCommons.HasMatchConditionPermanent(IsMakikoDate);
  41. }
  42. bool IsMakikoDate(Permanent permanent)
  43. {
  44. return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
  45. && permanent.TopCard.EqualsCardName("Makiko Date");
  46. }
  47. bool IsAntylamon(CardSource cardSource)
  48. {
  49. return cardSource.EqualsCardName("Antylamon");
  50. }
  51. cardEffects.Add(CardEffectFactory.AddDigivolutionRequirementStaticEffect(
  52. permanentCondition: PermanentCondition,
  53. cardCondition: IsAntylamon,
  54. ignoreDigivolutionRequirement: true,
  55. digivolutionCost: 3,
  56. isInheritedEffect: false,
  57. card: card,
  58. condition: Condition,
  59. effectName: "Digivolve for 3 cost, ignoring digivolution requirements.")
  60. );
  61. }
  62. #endregion
  63. #region All Turns - OPT
  64. if (timing == EffectTiming.OnTappedAnyone)
  65. {
  66. ActivateClass activateClass = new ActivateClass();
  67. activateClass.SetUpICardEffect("-2k DP", CanUseCondition, card);
  68. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  69. activateClass.SetIsInheritedEffect(true);
  70. activateClass.SetHashString("BT23_026_ESS");
  71. cardEffects.Add(activateClass);
  72. string EffectDiscription()
  73. {
  74. return "[All Turns] [Once Per Turn] When any of your other Digimon suspend, 1 of your opponent's Digimon gets -2000 DP for the turn.";
  75. }
  76. bool CanUseCondition(Hashtable hashtable)
  77. {
  78. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  79. && CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, IsYourDigimon);
  80. }
  81. bool CanActivateCondition(Hashtable hashtable)
  82. {
  83. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  84. }
  85. bool IsYourDigimon(Permanent permanent)
  86. {
  87. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  88. && permanent != card.PermanentOfThisCard();
  89. }
  90. bool CanSelectPermanentCondition(Permanent permanent)
  91. {
  92. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  93. }
  94. IEnumerator ActivateCoroutine(Hashtable hashtable)
  95. {
  96. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  97. {
  98. Permanent selectedPermament = null;
  99. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  100. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  101. selectPermanentEffect.SetUp(
  102. selectPlayer: card.Owner,
  103. canTargetCondition: CanSelectPermanentCondition,
  104. canTargetCondition_ByPreSelecetedList: null,
  105. canEndSelectCondition: null,
  106. maxCount: maxCount,
  107. canNoSelect: false,
  108. canEndNotMax: false,
  109. selectPermanentCoroutine: SelectPermanentCoroutine,
  110. afterSelectPermanentCoroutine: null,
  111. mode: SelectPermanentEffect.Mode.Custom,
  112. cardEffect: activateClass);
  113. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  114. {
  115. selectedPermament = permanent;
  116. yield return null;
  117. }
  118. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to -2k DP.", "The opponent is selecting 1 Digimon to -2k DP.");
  119. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  120. if (selectedPermament != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  121. targetPermanent: selectedPermament,
  122. changeValue: -2000,
  123. effectDuration: EffectDuration.UntilEachTurnEnd,
  124. activateClass: activateClass));
  125. }
  126. }
  127. }
  128. #endregion
  129. return cardEffects;
  130. }
  131. }
  132. }