Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Enemy Multiact
- # v 1.0
- # By Mithran
- # Requested by Flood_Master / Netmonmatt
- # Allows an enemy to act more than once per round
- # Rules:
- # Actors do not get extra turns
- # Turn-based auto removal of states occurs only after the FINAL action
- # Extra turns do not decrement state counter (only the final turn)
- # For default battle system only.
- # Add the following to the note section:
- # <enemy extra actions n>
- # Where n is the number of extra actions you want an enemy to have.
- # The note tag can be given to an enemy note or a states note.
- # Extra actions through notes and state notes stack.
- # Install: Place in materials section above main.
- # Please do not redistribute without asking!
- class Scene_Battle
- alias process_action_orig_mith_multiact process_action unless $@
- def process_action
- @extra_action_number_mith_multiact = 0
- @extra_actions_mith_multiact = false
- process_action_orig_mith_multiact
- return if @active_battler.nil?
- return unless @active_battler.extra_actions_mith_multiact > 0
- @extra_actions_mith_multiact = true
- @extra_action_number_mith_multiact = @active_battler.extra_actions_mith_multiact
- for i in 1..@active_battler.extra_actions_mith_multiact
- process_battle_event
- @active_battler.make_action
- @last_battler_mith_multiact = @active_battler
- process_action_orig_mith_multiact
- @active_battler = @last_battler_mith_multiact
- process_battle_event
- @extra_action_number_mith_multiact -= 1
- end
- @extra_actions_mith_multiact = false
- end
- alias set_next_active_battler_orig_mith_multiact set_next_active_battler unless $@
- def set_next_active_battler
- if @extra_actions_mith_multiact
- if $game_troop.forcing_battler != nil
- @last_battler_mith_multiact = @active_battler
- @active_battler = $game_troop.forcing_battler
- $game_troop.forcing_battler = nil
- end
- else
- set_next_active_battler_orig_mith_multiact
- end
- end
- alias remove_states_auto_orig_mith_multiact remove_states_auto unless $@
- def remove_states_auto
- if @active_battler.extra_actions_mith_multiact <= 0
- remove_states_auto_orig_mith_multiact
- # Remove states auto on original turn if no multiactions
- elsif @extra_actions_mith_multiact && @extra_action_number_mith_multiact <= 1
- remove_states_auto_orig_mith_multiact
- # Otherwise, remove states auto if on last multiaction
- end
- end
- end
- class Game_Battler
- def extra_actions_mith_multiact
- return 0 if actor?
- n = 0
- n += $1.to_i if enemy.note =~ /<enemy extra actions (\d+)>/i
- for state in states
- n += $1.to_i if state.note =~ /<enemy extra actions (\d+)>/i
- end
- return n
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment