Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2011
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.54 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Shanghai Simple Script - Heal After Battle
  4. # Last Date Updated: 2010.06.03
  5. # Level: Normal
  6. #
  7. # This causes the party to be healed after battle by a percentage. Options are
  8. # adjustable in the module.
  9. #===============================================================================
  10. # Instructions
  11. # -----------------------------------------------------------------------------
  12. # To install this script, open up your script editor and copy/paste this script
  13. # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
  14. #
  15. # This script occurs automatically.
  16. #===============================================================================
  17.  
  18. $imported = {} if $imported == nil
  19. $imported["HealAfterBattle"] = true
  20.  
  21. module SSS
  22.   # Change these constants to adjust what percentage of HP or MP is healed
  23.   # after battle and whether or not states will be cleared, too.
  24.   AFTER_BATTLE_HEAL_HP = 25
  25.   AFTER_BATTLE_HEAL_MP = 25
  26.   AFTER_BATTLE_RECOVER = true
  27. end
  28.  
  29. #==============================================================================
  30. # ** Game_Actor
  31. #==============================================================================
  32.  
  33. class Game_Actor < Game_Battler
  34.   #--------------------------------------------------------------------------
  35.   # * Heal After Battle
  36.   #--------------------------------------------------------------------------
  37.   def heal_after_battle
  38.     if SSS::AFTER_BATTLE_RECOVER
  39.       for state in states do remove_state(state.id) end
  40.     end
  41.     return if dead?
  42.     self.hp += maxhp * SSS::AFTER_BATTLE_HEAL_HP / 100
  43.     self.mp += maxmp * SSS::AFTER_BATTLE_HEAL_MP / 100
  44.   end
  45. end
  46.  
  47. #==============================================================================
  48. # ** Scene_Battle
  49. #==============================================================================
  50.  
  51. class Scene_Battle < Scene_Base
  52.   #--------------------------------------------------------------------------
  53.   # * End Battle
  54.   #--------------------------------------------------------------------------
  55.   alias battle_end_sss_heal_after_battle battle_end unless $@
  56.   def battle_end(result)
  57.     battle_end_sss_heal_after_battle(result)
  58.     if result != 2
  59.       for member in $game_party.members
  60.         member.heal_after_battle
  61.       end
  62.     end
  63.   end
  64. end
  65.  
  66. #===============================================================================
  67. #
  68. # END OF FILE
  69. #
  70. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement