BT10_020.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. namespace DCGO.CardEffects.BT10
  9. {
  10. public class BT10_020 : CEntity_Effect
  11. {
  12. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  13. {
  14. List<ICardEffect> cardEffects = new List<ICardEffect>();
  15. if (timing == EffectTiming.OnEnterFieldAnyone)
  16. {
  17. ActivateClass activateClass = new ActivateClass();
  18. activateClass.SetUpICardEffect("Draw 1 and draw for each opponent's Digimon", CanUseCondition, card);
  19. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  20. cardEffects.Add(activateClass);
  21. string EffectDiscription()
  22. {
  23. return "[On Play] <Draw 1>. (Draw 1 card from your deck.) Then, for each Digimon your opponent has in play, <Draw 1>.";
  24. }
  25. bool CanUseCondition(Hashtable hashtable)
  26. {
  27. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  28. }
  29. bool CanActivateCondition(Hashtable hashtable)
  30. {
  31. if (CardEffectCommons.IsExistOnBattleArea(card))
  32. {
  33. if (card.Owner.LibraryCards.Count >= 1)
  34. {
  35. return true;
  36. }
  37. }
  38. return false;
  39. }
  40. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  41. {
  42. int drawCount = 1 + card.Owner.Enemy.GetBattleAreaDigimons().Count;
  43. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, drawCount, activateClass).Draw());
  44. }
  45. }
  46. if (timing == EffectTiming.OnDestroyedAnyone)
  47. {
  48. cardEffects.Add(CardEffectFactory.SaveEffect(card: card));
  49. }
  50. if (timing == EffectTiming.None)
  51. {
  52. bool Condition()
  53. {
  54. if (CardEffectCommons.IsExistOnBattleArea(card))
  55. {
  56. if (card.Owner.Enemy.GetBattleAreaDigimons().Count >= 2)
  57. {
  58. return true;
  59. }
  60. }
  61. return false;
  62. }
  63. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  64. }
  65. return cardEffects;
  66. }
  67. }
  68. }