Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. =begin
  2. #==============================================================================
  3.  ** Rotate Formation
  4.  Author: Tsukihime
  5.  Date: Oct 30, 2012
  6. ------------------------------------------------------------------------------
  7.  ** Change log
  8.  Oct 30, 2012
  9.    - changed it to rotate left or rotate right. Just delete what you don't need
  10.  Oct 29, 2012
  11.    - initial release
  12. ------------------------------------------------------------------------------  
  13.  ** Terms of Use
  14.  * Free to use in commercial/non-commercial projects
  15.  * No real support. The script is provided as-is
  16.  * Will do bug fixes, but no compatibility patches
  17.  * Features may be requested but no guarantees, especially if it is non-trivial
  18.  * Preserve this header
  19. ------------------------------------------------------------------------------
  20.  Rotates the formation of your battle members on the map left by 1.
  21.  Press A to rotate formation.
  22.  
  23.  You can configure this button below.
  24.  You can also configure which direction they rotate
  25. #==============================================================================
  26. =end
  27. $imported = {} if $imported.nil?
  28. $imported["Tsuki_RotateFormation"] = true
  29. #==============================================================================
  30. # ** Configuration
  31. #=============================================================================
  32. module Tsuki
  33.   module Rotate_Formation
  34.     Rotate_L_Button = :L   # key to rotate formation
  35.     Rotate_R_Button = :R
  36.   end
  37. end
  38. #==============================================================================
  39. # ** Rest of the script
  40. #=============================================================================
  41.  
  42. class Game_Party < Game_Unit
  43.  
  44.   def rotate_formation_left
  45.     j = [@actors.size, max_battle_members].min
  46.     @actors = @actors[0...j].rotate.concat((@actors[j+1..-1] || []))
  47.     $game_player.refresh
  48.   end
  49.  
  50.   def rotate_formation_right
  51.     j = [@actors.size, max_battle_members].min
  52.     @actors = @actors[0...j].rotate(-1).concat((@actors[j+1..-1] || []))
  53.     $game_player.refresh
  54.   end
  55. end
  56.  
  57. # If you don't want to rotate by button-press just delete this class
  58. class Scene_Map < Scene_Base
  59.  
  60.   alias :th_rot_form_update_scene :update_scene
  61.   def update_scene
  62.     th_rot_form_update_scene
  63.     update_rotate_formation unless scene_changing?
  64.   end
  65.  
  66.   # new
  67.   def update_rotate_formation
  68.     $game_party.rotate_formation_left if Input.trigger?(Tsuki::Rotate_Formation::Rotate_L_Button)
  69.     $game_party.rotate_formation_right if Input.trigger?(Tsuki::Rotate_Formation::Rotate_R_Button)
  70.   end
  71. end