BT14_070.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT14
  4. {
  5. public class BT14_070 : 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.OnDiscardHand)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  15. activateClass.SetIsInheritedEffect(true);
  16. activateClass.SetHashString("Memory+1_BT14_070");
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[Your Turn][Once Per Turn] When one of your effects trashes a card in your hand, gain 1 memory.";
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. if (CardEffectCommons.IsExistOnBattleArea(card))
  25. {
  26. if (CardEffectCommons.IsOwnerTurn(card))
  27. {
  28. bool SkillCondition(ICardEffect cardEffect)
  29. {
  30. return CardEffectCommons.IsOwnerEffect(cardEffect, card);
  31. }
  32. if (CardEffectCommons.CanTriggerOnTrashHand(hashtable, SkillCondition, cardSource => cardSource.Owner == card.Owner))
  33. {
  34. return true;
  35. }
  36. }
  37. }
  38. return false;
  39. }
  40. bool CanActivateCondition(Hashtable hashtable)
  41. {
  42. return CardEffectCommons.IsExistOnBattleArea(card);
  43. }
  44. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  45. {
  46. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  47. }
  48. }
  49. return cardEffects;
  50. }
  51. }
  52. }