BT11_049.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT11
  4. {
  5. public class BT11_049 : 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.OnStartTurn)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[Start of Your Turn] Gain 1 memory.";
  19. }
  20. bool CanUseCondition(Hashtable hashtable)
  21. {
  22. if (CardEffectCommons.IsExistOnBattleArea(card))
  23. {
  24. if (CardEffectCommons.IsOwnerTurn(card))
  25. {
  26. return true;
  27. }
  28. }
  29. return false;
  30. }
  31. bool CanActivateCondition(Hashtable hashtable)
  32. {
  33. if (isExistOnField(card))
  34. {
  35. if (card.Owner.GetBattleAreaPermanents().Contains(card.PermanentOfThisCard()))
  36. {
  37. if (card.Owner.CanAddMemory(activateClass))
  38. {
  39. return true;
  40. }
  41. }
  42. }
  43. return false;
  44. }
  45. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  46. {
  47. if (isExistOnField(card))
  48. {
  49. if (card.Owner.CanAddMemory(activateClass))
  50. {
  51. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  52. }
  53. }
  54. }
  55. }
  56. return cardEffects;
  57. }
  58. }
  59. }