Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #===============================================================================
  2. # )----------------------------------------------------------------------------(
  3. # )--     AUTHOR:     Mr Trivel                                              --(
  4. # )--     NAME:       Heal on Move                                           --(
  5. # )--     CREATED:    2014-09-19                                             --(
  6. # )--     VERSION:    1.1                                                    --(
  7. #===============================================================================
  8. # )----------------------------------------------------------------------------(
  9. # )--                         VERSION HISTORY                                --(
  10. # )--  1.0 - Initial script.                                                 --(
  11. #===============================================================================
  12. # )----------------------------------------------------------------------------(
  13. # )--                          DESCRIPTION                                   --(
  14. # )--  Actors heal on movement.                                              --(
  15. #===============================================================================
  16. # )----------------------------------------------------------------------------(
  17. # )--                          INSTRUCTIONS                                  --(
  18. # )--  Define how many % per step do you want your actors to heal in module. --(
  19. #===============================================================================
  20. # )----------------------------------------------------------------------------(
  21. # )--                          LICENSE INFO                                  --(
  22. # )--  Free for non-commercial & commercial games if credit was given to     --(
  23. # )--  Mr Trivel.                                                            --(
  24. # )----------------------------------------------------------------------------(
  25. #===============================================================================
  26.  
  27. # )=======---------------------------------------------------------------------(
  28. # )-- Module: MovementHeal                                                   --(
  29. # )---------------------------------------------------------------------=======(
  30. module MovementHeal
  31.  
  32.   # )--------------------------------------------------------------------------(
  33.   # )--  How many % HP per step your actors will heal.                       --(
  34.   # )--  0.01 = 1%, 0.50 = 50%                                               --(
  35.   # )--------------------------------------------------------------------------(
  36.   HEAL_PER_STEP = 0.01 # 0.01 = 1% per step
  37. end
  38.  
  39. # )=======---------------------------------------------------------------------(
  40. # )-- class: Game_Actor                                                      --(
  41. # )---------------------------------------------------------------------=======(
  42. class Game_Actor < Game_Battler
  43.   alias :mrts_movement_heal_on_player_walk :on_player_walk
  44.  
  45.   # )--------------------------------------------------------------------------(
  46.   # )-- Alias: on_player_walk                                                --(
  47.   # )--------------------------------------------------------------------------(
  48.   def on_player_walk
  49.     if $game_player.normal_walk?
  50.       self.hp += [(self.mhp * MovementHeal::HEAL_PER_STEP).to_i, 1].max
  51.     end
  52.     mrts_movement_heal_on_player_walk
  53.   end
  54. end