Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- module GA_State_Shift
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- Actor_ID = 1
- State_ID = [10, 11]
- Perc = 100
- Min_Dmg = 1
- end
- #===============================================================================
- class Game_Actor
- #===============================================================================
- #-----------------------------------------------------------------------------
- alias :odmgstateshift :on_damage
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def on_damage value
- odmgstateshift value
- perform_state_dmg_change value
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def perform_state_dmg_change value
- return unless self.is_a? Game_Actor
- return unless GA_State_Shift::Actor_ID == self.id
- return unless GA_State_Shift::Perc <= rand(101)
- return unless GA_State_Shift::Min_Dmg <= value
- if self.state? GA_State_Shift::State_ID.first
- remove_state GA_State_Shift::State_ID.first
- add_state GA_State_Shift::State_ID.last
- else
- remove_state GA_State_Shift::State_ID.last
- add_state GA_State_Shift::State_ID.first
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement