Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. class PokeBattle_Trainer
  2.  
  3. def get_opacity
  4. return 150 if self.hidden? else 255
  5. end
  6.  
  7. def hide(steps=SHADOW_POINTS)
  8. val = SHADOW_BY_STEPS ? steps : true
  9. @hidden_status = val if !@shadow_points.nil? && @shadow_points > 0
  10. Shadow_Utilities.check_player_charset
  11. end
  12.  
  13. def hidden?
  14. val = !@hidden_status.nil?
  15. val &= !@shadow_points.nil? && @shadow_points > 0
  16. if SHADOW_BY_STEPS
  17. return val && @hidden_status > 0
  18. end
  19. return val && @hidden_status
  20. end
  21.  
  22. def unhide
  23. @hidden_status = SHADOW_BY_STEPS ? 0 : false
  24. Shadow_Utilities.check_player_charset
  25. end
  26.  
  27. def process_hidden_status
  28. self.set_shadow_default_values
  29. if self.hidden?
  30. @shadow_points -= 1 if @shadow_points > 0
  31. @hidden_status -= 1 if SHADOW_BY_STEPS && @hidden_status > 0
  32. if @shadow_points <= 0 || (SHADOW_BY_STEPS && @hidden_status <= 0)
  33. self.unhide
  34. end
  35. elsif self.shadow_recovery_count < SHADOW_RECOVERY_RATE
  36. @shadow_recovery_count += 1
  37. elsif @shadow_points < SHADOW_POINTS
  38. @shadow_points += 1
  39. @shadow_recovery_count = 0
  40. end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement