=begin
#==============================================================================
** Rotate Formation
Author: Tsukihime
Date: Oct 30, 2012
------------------------------------------------------------------------------
** Change log
Oct 30, 2012
- changed it to rotate left or rotate right. Just delete what you don't need
Oct 29, 2012
- initial release
------------------------------------------------------------------------------
** Terms of Use
* Free to use in commercial/non-commercial projects
* No real support. The script is provided as-is
* Will do bug fixes, but no compatibility patches
* Features may be requested but no guarantees, especially if it is non-trivial
* Preserve this header
------------------------------------------------------------------------------
Rotates the formation of your battle members on the map left by 1.
Press A to rotate formation.
You can configure this button below.
You can also configure which direction they rotate
#==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Tsuki_RotateFormation"] = true
#==============================================================================
# ** Configuration
#=============================================================================
module Tsuki
module Rotate_Formation
Rotate_L_Button = :L # key to rotate formation
Rotate_R_Button = :R
end
end
#==============================================================================
# ** Rest of the script
#=============================================================================
class Game_Party < Game_Unit
def rotate_formation_left
j = [@actors.size, max_battle_members].min
@actors = @actors[0...j].rotate.concat((@actors[j+1..-1] || []))
$game_player.refresh
end
def rotate_formation_right
j = [@actors.size, max_battle_members].min
@actors = @actors[0...j].rotate(-1).concat((@actors[j+1..-1] || []))
$game_player.refresh
end
end
# If you don't want to rotate by button-press just delete this class
class Scene_Map < Scene_Base
alias :th_rot_form_update_scene :update_scene
def update_scene
th_rot_form_update_scene
update_rotate_formation unless scene_changing?
end
# new
def update_rotate_formation
$game_party.rotate_formation_left if Input.trigger?(Tsuki::Rotate_Formation::Rotate_L_Button)
$game_party.rotate_formation_right if Input.trigger?(Tsuki::Rotate_Formation::Rotate_R_Button)
end
end