BT15_094.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT15
  5. {
  6. public class BT15_094 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Use Option
  12. if (timing == EffectTiming.OptionSkill)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
  16. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[Main] Suspend 1 level 6 or lower Digimon. 1 of your Digimon with the [Insectoid] trait gets +3000 DP until the end of your opponent's turn.";
  21. }
  22. bool CanSelectPermanentCondition(Permanent permanent)
  23. {
  24. if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
  25. {
  26. if (permanent.Level <= 6)
  27. {
  28. if (permanent.TopCard.HasLevel)
  29. {
  30. return true;
  31. }
  32. }
  33. }
  34. return false;
  35. }
  36. bool CanSelectPermanentCondition1(Permanent permanent)
  37. {
  38. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  39. {
  40. if (permanent.TopCard.CardTraits.Contains("Insectoid"))
  41. {
  42. return true;
  43. }
  44. }
  45. return false;
  46. }
  47. bool CanUseCondition(Hashtable hashtable)
  48. {
  49. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  50. }
  51. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  52. {
  53. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  54. {
  55. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  56. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  57. selectPermanentEffect.SetUp(
  58. selectPlayer: card.Owner,
  59. canTargetCondition: CanSelectPermanentCondition,
  60. canTargetCondition_ByPreSelecetedList: null,
  61. canEndSelectCondition: null,
  62. maxCount: maxCount,
  63. canNoSelect: false,
  64. canEndNotMax: false,
  65. selectPermanentCoroutine: null,
  66. afterSelectPermanentCoroutine: null,
  67. mode: SelectPermanentEffect.Mode.Tap,
  68. cardEffect: activateClass);
  69. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  70. }
  71. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
  72. {
  73. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition1));
  74. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  75. selectPermanentEffect.SetUp(
  76. selectPlayer: card.Owner,
  77. canTargetCondition: CanSelectPermanentCondition1,
  78. canTargetCondition_ByPreSelecetedList: null,
  79. canEndSelectCondition: null,
  80. maxCount: maxCount,
  81. canNoSelect: false,
  82. canEndNotMax: false,
  83. selectPermanentCoroutine: SelectPermanentCoroutine,
  84. afterSelectPermanentCoroutine: null,
  85. mode: SelectPermanentEffect.Mode.Custom,
  86. cardEffect: activateClass);
  87. selectPermanentEffect.SetUpCustomMessage(customMessageArray: CardEffectCommons.customPermanentMessageArray_ChangeDP(changeValue: 3000, maxCount: maxCount));
  88. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  89. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  90. {
  91. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  92. targetPermanent: permanent,
  93. changeValue: 3000,
  94. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  95. activateClass: activateClass));
  96. }
  97. }
  98. }
  99. }
  100. #endregion
  101. if (timing == EffectTiming.SecuritySkill)
  102. {
  103. string EffectDiscription()
  104. {
  105. return "[Security] Activate this card's [Main] effect. Then, add this card to the hand.";
  106. }
  107. IEnumerator AfterMainEffect(ICardEffect activateClass)
  108. {
  109. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
  110. }
  111. CardEffectCommons.AddActivateMainOptionSecurityEffect(card: card, cardEffects: ref cardEffects, effectName: $"Suspend 1 level 6 or lower Digimon, 1 Digimon gains DP +3000 and add this card to hand", effectDiscription: EffectDiscription(), afterMainEffect: AfterMainEffect);
  112. }
  113. return cardEffects;
  114. }
  115. }
  116. }