BT14_082.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. namespace DCGO.CardEffects.BT14
  6. {
  7. public class BT14_082 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. if (timing == EffectTiming.OnStartMainPhase)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("DP +2000", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[Start of Your Main Phase] 1 of your Digimon with the [Vaccine] trait gets +2000 DP for the turn.";
  21. }
  22. bool CanSelectPermanentCondition(Permanent permanent)
  23. {
  24. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  25. {
  26. if (permanent.TopCard.CardTraits.Contains("Vaccine"))
  27. {
  28. return true;
  29. }
  30. }
  31. return false;
  32. }
  33. bool CanUseCondition(Hashtable hashtable)
  34. {
  35. if (CardEffectCommons.IsExistOnBattleArea(card))
  36. {
  37. if (CardEffectCommons.IsOwnerTurn(card))
  38. {
  39. return true;
  40. }
  41. }
  42. return false;
  43. }
  44. bool CanActivateCondition(Hashtable hashtable)
  45. {
  46. if (CardEffectCommons.IsExistOnBattleArea(card))
  47. {
  48. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
  49. {
  50. return true;
  51. }
  52. }
  53. return false;
  54. }
  55. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  56. {
  57. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
  58. {
  59. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  60. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  61. selectPermanentEffect.SetUp(
  62. selectPlayer: card.Owner,
  63. canTargetCondition: CanSelectPermanentCondition,
  64. canTargetCondition_ByPreSelecetedList: null,
  65. canEndSelectCondition: null,
  66. maxCount: maxCount,
  67. canNoSelect: false,
  68. canEndNotMax: false,
  69. selectPermanentCoroutine: SelectPermanentCoroutine,
  70. afterSelectPermanentCoroutine: null,
  71. mode: SelectPermanentEffect.Mode.Custom,
  72. cardEffect: activateClass);
  73. selectPermanentEffect.SetUpCustomMessage(customMessageArray: CardEffectCommons.customPermanentMessageArray_ChangeDP(changeValue: 2000, maxCount: maxCount));
  74. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  75. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  76. {
  77. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  78. targetPermanent: permanent,
  79. changeValue: 2000,
  80. effectDuration: EffectDuration.UntilEachTurnEnd,
  81. activateClass: activateClass));
  82. }
  83. }
  84. }
  85. }
  86. if (timing == EffectTiming.OnLoseSecurity)
  87. {
  88. ActivateClass activateClass = new ActivateClass();
  89. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  90. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  91. cardEffects.Add(activateClass);
  92. string EffectDiscription()
  93. {
  94. return "[Your Turn] When a card is removed from your opponent's security stack, by suspending this Tamer, gain 1 memory.";
  95. }
  96. bool CanUseCondition(Hashtable hashtable)
  97. {
  98. if (CardEffectCommons.IsExistOnBattleArea(card))
  99. {
  100. if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, player => player == card.Owner.Enemy))
  101. {
  102. if (CardEffectCommons.IsOwnerTurn(card))
  103. {
  104. return true;
  105. }
  106. }
  107. }
  108. return false;
  109. }
  110. bool CanActivateCondition(Hashtable hashtable)
  111. {
  112. if (CardEffectCommons.IsExistOnBattleArea(card))
  113. {
  114. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  115. {
  116. return true;
  117. }
  118. }
  119. return false;
  120. }
  121. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  122. {
  123. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  124. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  125. }
  126. }
  127. if (timing == EffectTiming.SecuritySkill)
  128. {
  129. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  130. }
  131. return cardEffects;
  132. }
  133. }
  134. }