Advertisement
diamondandplatinum3

Show Damage State Messages ~ RGSS3

May 21st, 2013
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.26 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Show Damage State Messages
  3. #             Authors: DiamondandPlatinum3
  4. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. #  Description:
  6. #
  7. #    This script show messages in battle when you have been dealt damage as a
  8. #    result of a state: such as poison or burn
  9. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10. #------------------------------------------------------------------------------
  11. #  Instructions:
  12. #  
  13. #     In the editable region below you can set up what is necessary
  14. #
  15. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. class Game_Battler
  17.   STATES_DAMAGE_VOCAB = [
  18.   #==================================
  19.   #     Editable Region
  20.   #==================================
  21.   # You can add more states by copying the below lines one after another
  22.  
  23.   # Id of the state;    what you see when you are affected by this state
  24.   [ 2,        "Due to the effects of Poison"            ],
  25.   [ 3,        "If Blind could hurt you, you would have" ], # Lost HP :P
  26.   #==================================
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.   ]
  38.   #--------------------------------------------------------------------------
  39.   # * Regenerate HP
  40.   #--------------------------------------------------------------------------
  41.   alias dp3_showmessg_whenpois_gmbttlr_regenHP_83nd87           regenerate_hp
  42.   def regenerate_hp
  43.     # Make Temp Value
  44.     temporaryHP = self.hp
  45.    
  46.     # Call Original Method
  47.     dp3_showmessg_whenpois_gmbttlr_regenHP_83nd87()
  48.    
  49.     # If Health is lower than before
  50.     if self.hp < temporaryHP && SceneManager.scene_is?(Scene_Battle)
  51.       $game_message.add(sprintf(actor_damage_state_string + " " + self.name + " lost " + @result.hp_damage.to_s + "HP"))
  52.     end
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # * Get Actor Damage State String
  56.   #--------------------------------------------------------------------------
  57.   def actor_damage_state_string
  58.     self.states.each do |state|
  59.       STATES_DAMAGE_VOCAB.each do |element|
  60.         return element[1] if state.id == element[0]
  61.       end
  62.     end
  63.     return ""
  64.   end
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement