Save.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System;
  4. using System.Linq;
  5. using UnityEngine;
  6. public partial class CardEffectFactory
  7. {
  8. #region Trigger effect of [Save]
  9. public static ActivateClass SaveEffect(CardSource card)
  10. {
  11. ActivateClass activateClass = new ActivateClass();
  12. activateClass.SetUpICardEffect("Save", CanUseCondition, card);
  13. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, DataBase.SaveEffectDiscription());
  14. bool CanSelectPermanentCondition(Permanent permanent)
  15. {
  16. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  17. {
  18. if (permanent.IsTamer)
  19. {
  20. if (!permanent.IsToken)
  21. {
  22. return true;
  23. }
  24. }
  25. }
  26. return false;
  27. }
  28. bool CanUseCondition(Hashtable hashtable)
  29. {
  30. return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
  31. }
  32. bool CanActivateCondition(Hashtable hashtable)
  33. {
  34. return CardEffectCommons.CanActivateSave(hashtable, CanSelectPermanentCondition);
  35. }
  36. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  37. {
  38. return CardEffectCommons.SaveProcess(_hashtable, activateClass, card, CanSelectPermanentCondition);
  39. }
  40. return activateClass;
  41. }
  42. #endregion
  43. }