Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Shanghai Simple Script - Autobattle Command
- # Last Date Updated: 2010.05.06
- # Level: Easy
- #
- # This takes off like Final Fantasy XIII. There's an Auto-Battle command where
- # it lets the game choose a skill that's best for them to use. This does not
- # mean it will pick a smart skill though. This was remade to have compatibility
- # with Battle Engine Melody.
- #===============================================================================
- # Instructions
- # -----------------------------------------------------------------------------
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["AutobattleCommand"] = true
- module SSS
- # This is the text used for AutoBattle
- AUTOBATTLE_COMMAND = "Auto"
- end
- #==============================================================================
- # Window_ActorCommand
- #==============================================================================
- class Window_ActorCommand < Window_Command
- #--------------------------------------------------------------------------
- # * Setup
- # actor : actor
- #--------------------------------------------------------------------------
- alias setup_sss_window_actorcommand setup unless $@
- def setup(actor)
- setup_sss_window_actorcommand(actor)
- @commands.insert(0, SSS::AUTOBATTLE_COMMAND)
- if $imported["BattleEngineMelody"]
- @data.insert(0, :autobattle)
- end
- @item_max = @commands.size
- create_contents
- refresh
- self.index = 0
- end
- end
- #==============================================================================
- # Scene_Battle
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # * Update Actor Command Selection
- #--------------------------------------------------------------------------
- unless $imported["BattleEngineMelody"]
- alias update_actor_command_selection_sss_ab update_actor_command_selection
- def update_actor_command_selection
- if Input.trigger?(Input::C)
- case @actor_command_window.index
- when 0
- Sound.play_decision
- @active_battler.make_action
- next_actor
- when 1 # Attack
- Sound.play_decision
- @active_battler.action.set_attack
- start_target_enemy_selection
- when 2 # Skill
- Sound.play_decision
- start_skill_selection
- when 3 # Guard
- Sound.play_decision
- @active_battler.action.set_guard
- next_actor
- when 4 # Item
- Sound.play_decision
- start_item_selection
- end
- else
- update_actor_command_selection_sss_ab
- end
- end
- end
- #--------------------------------------------------------------------------
- # actor_command_case
- #--------------------------------------------------------------------------
- if $imported["BattleEngineMelody"]
- alias actor_command_case_sss_ab actor_command_case
- def actor_command_case
- case @actor_command_window.item
- when :autobattle
- Sound.play_decision
- make_auto_command
- else
- actor_command_case_sss_ab
- end
- end
- end
- #--------------------------------------------------------------------------
- # * make_auto_command
- #--------------------------------------------------------------------------
- def make_auto_command
- @selected_battler.make_action
- @status_window.draw_item(@selected_battler.index)
- if $scene.dtb?
- next_actor if $game_switches[YEM::BATTLE_ENGINE::OPTIONS[:next_actor_sw]]
- elsif $scene.ptb?
- perform_instant_action
- elsif $scene.atb?
- make_action_orders
- if $game_switches[YEM::BATTLE_ENGINE::OPTIONS[:next_actor_sw]]
- @actor_index = -1 if @actor_index == $game_party.members.size - 1
- next_actor
- end
- elsif $scene.ctb?
- if @selected_battler.ctb_active?
- $game_troop.ctb_ready.shift
- $game_troop.clear_ctb_cache
- make_action_orders
- update_ctb_clockticks
- return
- end
- make_action_orders
- if $game_switches[YEM::BATTLE_ENGINE::OPTIONS[:next_actor_sw]]
- @actor_index = -1 if @actor_index == $game_party.members.size - 1
- next_actor
- end
- end
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement