BT15_002.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT15
  4. {
  5. public class BT15_002 : 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.OnAddHand)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("DP +1000", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  15. activateClass.SetIsInheritedEffect(true);
  16. activateClass.SetHashString("DP+1000_BT15_002");
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[Your Turn] [Once Per Turn] When one of your Digimon's effects adds cards to your hand, this Digimon gets +1000 DP until the end of your opponent's turn.";
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. if (CardEffectCommons.IsExistOnBattleArea(card))
  25. {
  26. if (CardEffectCommons.IsOwnerTurn(card))
  27. {
  28. bool CardEffectCondition(ICardEffect cardEffect)
  29. {
  30. if (CardEffectCommons.IsOwnerEffect(cardEffect, card))
  31. {
  32. if (cardEffect.IsDigimonEffect)
  33. {
  34. return true;
  35. }
  36. }
  37. return false;
  38. }
  39. if (CardEffectCommons.CanTriggerWhenAddHand(
  40. hashtable,
  41. player => player == card.Owner,
  42. CardEffectCondition))
  43. {
  44. return true;
  45. }
  46. }
  47. }
  48. return false;
  49. }
  50. bool CanActivateCondition(Hashtable hashtable)
  51. {
  52. return CardEffectCommons.IsExistOnBattleArea(card);
  53. }
  54. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  55. {
  56. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  57. targetPermanent: card.PermanentOfThisCard(),
  58. changeValue: 1000,
  59. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  60. activateClass: activateClass));
  61. }
  62. }
  63. return cardEffects;
  64. }
  65. }
  66. }