CanSuspend.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System;
  4. using System.Linq;
  5. using UnityEngine;
  6. public partial class CardEffectCommons
  7. {
  8. #region Can activate effects by suspending oneself
  9. public static bool CanActivateSuspendCostEffect(CardSource card, bool includeBreeding = false)
  10. {
  11. return CanActivatePermanentSuspendCostEffect(card.PermanentOfThisCard(), includeBreeding);
  12. }
  13. #endregion
  14. #region Can activate effects by suspending permanent
  15. public static bool CanActivatePermanentSuspendCostEffect(Permanent permanent, bool includeBreeding = false)
  16. {
  17. if (IsPermanentExistsOnBattleArea(permanent))
  18. {
  19. if (!permanent.IsSuspended && permanent.CanSuspend)
  20. {
  21. return true;
  22. }
  23. }
  24. if (includeBreeding)
  25. {
  26. if (IsPermanentExistsOnBreedingArea(permanent))
  27. {
  28. if (!permanent.IsSuspended && permanent.CanSuspend)
  29. {
  30. return true;
  31. }
  32. }
  33. }
  34. return false;
  35. }
  36. #endregion
  37. }