BT2_086.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. public class BT2_086 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.OnAllyAttack)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("DP +1000", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Your Turn] When one of your blue Digimon attacks, you may suspend this Tamer to give that Digimon +1000 DP for the turn.";
  22. }
  23. bool PermanentCondition(Permanent permanent)
  24. {
  25. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  26. {
  27. if (permanent.TopCard.CardColors.Contains(CardColor.Blue))
  28. {
  29. return true;
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanUseCondition(Hashtable hashtable)
  35. {
  36. if (CardEffectCommons.IsExistOnBattleArea(card))
  37. {
  38. if (CardEffectCommons.IsOwnerTurn(card))
  39. {
  40. if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition))
  41. {
  42. return true;
  43. }
  44. }
  45. }
  46. return false;
  47. }
  48. bool CanActivateCondition(Hashtable hashtable)
  49. {
  50. if (CardEffectCommons.IsExistOnBattleArea(card))
  51. {
  52. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  53. {
  54. return true;
  55. }
  56. }
  57. return false;
  58. }
  59. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  60. {
  61. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  62. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: GManager.instance.attackProcess.AttackingPermanent, changeValue: 1000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  63. }
  64. }
  65. if (timing == EffectTiming.OnEnterFieldAnyone)
  66. {
  67. ActivateClass activateClass = new ActivateClass();
  68. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  69. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  70. cardEffects.Add(activateClass);
  71. string EffectDiscription()
  72. {
  73. return "[On Play] Reveal 3 cards from the top of your deck. Add 1 Digimon card with [Vee] in its name among them to your hand. Place the remaining cards on the bottom of your deck in any order.";
  74. }
  75. bool CanSelectCardCondition(CardSource cardSource)
  76. {
  77. if (cardSource.IsDigimon)
  78. {
  79. if (cardSource.ContainsCardName("Vee"))
  80. {
  81. return true;
  82. }
  83. }
  84. return false;
  85. }
  86. bool CanUseCondition(Hashtable hashtable)
  87. {
  88. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  89. }
  90. bool CanActivateCondition(Hashtable hashtable)
  91. {
  92. if (CardEffectCommons.IsExistOnBattleArea(card))
  93. {
  94. if (card.Owner.LibraryCards.Count >= 1)
  95. {
  96. return true;
  97. }
  98. }
  99. return false;
  100. }
  101. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  102. {
  103. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  104. revealCount: 3,
  105. simplifiedSelectCardConditions:
  106. new SimplifiedSelectCardConditionClass[]
  107. {
  108. new SimplifiedSelectCardConditionClass(
  109. canTargetCondition:CanSelectCardCondition,
  110. message: "Select 1 Digimon card with [Vee] in its name.",
  111. mode: SelectCardEffect.Mode.AddHand,
  112. maxCount: 1,
  113. selectCardCoroutine: null),
  114. },
  115. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  116. activateClass: activateClass
  117. ));
  118. }
  119. }
  120. if (timing == EffectTiming.SecuritySkill)
  121. {
  122. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  123. }
  124. return cardEffects;
  125. }
  126. }