EX1_010.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX1
  4. {
  5. public class EX1_010 : 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.None)
  11. {
  12. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card, condition: null));
  13. }
  14. if (timing == EffectTiming.OnAllyAttack)
  15. {
  16. ActivateClass activateClass = new ActivateClass();
  17. activateClass.SetUpICardEffect("Draw 2", CanUseCondition, card);
  18. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return "[When Attacking] When this Digimon attacks a player, <Draw 2>. (Draw 2 cards from your deck.)";
  23. }
  24. bool CanUseCondition(Hashtable hashtable)
  25. {
  26. if (CardEffectCommons.CanTriggerOnAttack(hashtable, card))
  27. {
  28. if (GManager.instance.attackProcess.DefendingPermanent == null)
  29. {
  30. return true;
  31. }
  32. }
  33. return false;
  34. }
  35. bool CanActivateCondition(Hashtable hashtable)
  36. {
  37. if (CardEffectCommons.IsExistOnBattleArea(card))
  38. {
  39. if (card.Owner.LibraryCards.Count >= 1)
  40. {
  41. return true;
  42. }
  43. }
  44. return false;
  45. }
  46. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  47. {
  48. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 2, activateClass).Draw());
  49. }
  50. }
  51. return cardEffects;
  52. }
  53. }
  54. }