Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # Hime's Battle Reactions & DSI Unit System Compatible Fix Bug.
- # -- Last Updated: 2018.02.03
- # -- Author: dsiver144
- # -- Requires: Battle Reactions & DSI Unit System
- #==============================================================================
- if $imported["DSI-UnitSystem"]
- msgbox_p("DSI Unit System not found! Please re-install it to proceed.")
- end
- #==============================================================================
- class Game_ActorUnit < Game_Actor
- #-----------------------------------------------------------------------------
- # overwrite method: remove_execution_states
- #-----------------------------------------------------------------------------
- def remove_execution_states
- return unless @added_execution_states
- @added_execution_states.each {|state| remove_state(state.state_id)}
- end
- #-----------------------------------------------------------------------------
- # overwrite method: skill_reactions
- #-----------------------------------------------------------------------------
- def skill_reactions(item)
- reaction_objects.inject([]) do |r, obj|
- r.concat(obj.skill_reactions(item))
- end
- end
- #-----------------------------------------------------------------------------
- # overwrite method: get_reactions
- #-----------------------------------------------------------------------------
- def get_reactions(item)
- res = []
- reaction_objects.each do |obj|
- res.concat(obj.reactions(item))
- end
- return res
- end
- #-----------------------------------------------------------------------------
- # overwrite method: make_reaction
- #-----------------------------------------------------------------------------
- def make_reaction(user, reaction)
- return unless reaction.condition_met?(self, user)
- return unless movable? || reaction.forced
- chance = reaction.chance(self, user)
- return if chance < rand
- skill = $data_skills[reaction.react_id]
- action = Game_Action.new(self, reaction.forced)
- if skill.for_opponent?
- action.target_index = user.index
- elsif skill.for_friend?
- action.target_index = self.index
- end
- action.set_skill(reaction.react_id)
- action.make_targets
- @actions.push(action)
- BattleManager.force_reaction(self)
- end
- #-----------------------------------------------------------------------------
- # overwrite method: backup_actions
- #-----------------------------------------------------------------------------
- def backup_actions
- @reaction_backup = @actions.dup
- end
- #-----------------------------------------------------------------------------
- # overwrite method: restore_actions
- #-----------------------------------------------------------------------------
- def restore_actions
- @actions = @reaction_backup.dup
- end
- #-----------------------------------------------------------------------------
- # overwrite method: reaction_objects
- #-----------------------------------------------------------------------------
- def reaction_objects
- super
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement