BT11_028.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT11
  4. {
  5. public class BT11_028 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnEnterFieldAnyone)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("This Digimon gains Blocker and it gets DP+", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[When Digivolving] Until the end of your opponent's turn, this Digimon gains <Blocker> (When an opponent's Digimon attacks, you may suspend this Digimon to force the opponent to attack it instead) and gets +2000 DP for every 4 cards in your opponent's hand.";
  19. }
  20. bool CanUseCondition(Hashtable hashtable)
  21. {
  22. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  23. }
  24. bool CanActivateCondition(Hashtable hashtable)
  25. {
  26. if (CardEffectCommons.IsExistOnBattleArea(card))
  27. {
  28. return true;
  29. }
  30. return false;
  31. }
  32. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  33. {
  34. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(
  35. targetPermanent: card.PermanentOfThisCard(),
  36. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  37. activateClass: activateClass));
  38. int plusDP = 2000 * (card.Owner.Enemy.HandCards.Count / 4);
  39. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  40. targetPermanent: card.PermanentOfThisCard(),
  41. changeValue: plusDP,
  42. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  43. activateClass: activateClass));
  44. }
  45. }
  46. if (timing == EffectTiming.OnAddHand)
  47. {
  48. ActivateClass activateClass = new ActivateClass();
  49. activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card);
  50. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  51. activateClass.SetIsInheritedEffect(true);
  52. activateClass.SetHashString("Unsuspend_BT11_028");
  53. cardEffects.Add(activateClass);
  54. string EffectDiscription()
  55. {
  56. return "[All Turns][Once Per Turn] When an effect adds cards to your opponent's hand, unsuspend this Digimon.";
  57. }
  58. bool CanUseCondition(Hashtable hashtable)
  59. {
  60. if (CardEffectCommons.IsExistOnBattleArea(card))
  61. {
  62. if (CardEffectCommons.CanTriggerWhenAddHand(hashtable, player => player == card.Owner.Enemy, cardEffect => cardEffect != null))
  63. {
  64. return true;
  65. }
  66. }
  67. return false;
  68. }
  69. bool CanActivateCondition(Hashtable hashtable)
  70. {
  71. if (CardEffectCommons.IsExistOnBattleArea(card))
  72. {
  73. return true;
  74. }
  75. return false;
  76. }
  77. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  78. {
  79. Permanent selectedPermanent = card.PermanentOfThisCard();
  80. yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(
  81. new List<Permanent>() { selectedPermanent },
  82. activateClass).Unsuspend());
  83. }
  84. }
  85. return cardEffects;
  86. }
  87. }
  88. }