Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- RGSS3 VX style BattleLog+ Ver.1.01 mo-to 2012/02/07
- TKOOL COOL
- http://mototkool.blog.fc2.com/
- ★Usage★
- Paste this script above Main.
- You can adjust the customization in various ways.
- If you want something simple as VX battle, set all booleans to false.
- ★Overview★
- Changes battlelog in battle to VX style.
- ★Note★
- Display will always be below if you align the text display
- in middle / upper in a battle event.
- The message background is only transparent.
- ★Update history★
- ver.0.01 Released with basics
- ver.1.00 Added more customizations
- Gold position during battle
- ver.1.01 Status window size change
- You can customize the coordinates for status and transparency.
- =end
- #==============================================================================
- # ★ Customizations
- #==============================================================================
- module MOTO
- SIMPLE_STATUS_WINDOW = true #true:Simple status display at the top | false: None
- #↓Only when you select true in above customization
- TP_GAGE = true #true:Display TP gauge | false: None
- SIMPLE_STATUS_X = 0 #status X coordinate
- SIMPLE_STATUS_Y = 0 #status Y coordinate
- OPACITY = 200 #status transparency (0-255, 0 = transparent)
- PARTY_COMMAND_RIGHT = true #true:Display party commands on the right | false: Default
- ACTOR_COMMAND_LEFT = false #true:Display actor command on the left | false: Default
- end
- #==============================================================================
- # ☆ Window_Battle_Message
- #------------------------------------------------------------------------------
- # A fixed, transparent message window for displaying text during battle.
- #==============================================================================
- class Window_Battle_Message < Window_Message
- #--------------------------------------------------------------------------
- # ☆ Object initialization
- #--------------------------------------------------------------------------
- def initialize
- super
- self.x = 0
- self.y = Graphics.height - height
- self.z = 210
- self.opacity = 0
- end
- #--------------------------------------------------------------------------
- # ☆ Fix window background transparency
- #--------------------------------------------------------------------------
- def update_background
- self.opacity = 0
- end
- #--------------------------------------------------------------------------
- # ☆ Fixed message window and gold window position
- #--------------------------------------------------------------------------
- def update_placement
- @gold_window.x = 0
- @gold_window.y = (Graphics.height - height) - @gold_window.height
- end
- end
- #==============================================================================
- # ☆ Window_Simple_Status
- #==============================================================================
- # This is a simplified status window that displays at the top during battle.
- #==============================================================================
- class Window_Simple_Status < Window_Base
- #--------------------------------------------------------------------------
- # ☆ Object initialization
- #--------------------------------------------------------------------------
- def initialize
- x = MOTO::SIMPLE_STATUS_X
- y = MOTO::SIMPLE_STATUS_Y
- width = $game_party.members.size * 136
- width = 136 if $game_party.members.size == 0
- hight = MOTO::TP_GAGE ? 96 : 81
- super(x, y, width, hight)
- self.openness = 0
- self.opacity = MOTO::OPACITY
- refresh
- end
- #--------------------------------------------------------------------------
- # ☆ Create contents
- #--------------------------------------------------------------------------
- def create_contents
- self.contents.dispose
- self.contents = Bitmap.new((512 / 8 * $game_party.members.size), height - 32)
- end
- #--------------------------------------------------------------------------
- # ☆ Refresh 1
- #--------------------------------------------------------------------------
- def refresh
- create_contents
- draw_contents
- width_refresh
- end
- #--------------------------------------------------------------------------
- # ☆ Draw contents
- #--------------------------------------------------------------------------
- def draw_contents
- self.contents.clear
- return if $game_party.members.size == 0
- for i in 0...$game_party.members.size
- actor = $game_party.members[i]
- actor_x = i * 512 / 8
- contents.font.size = 18
- draw_actor_name(actor, actor_x, 0, 56)
- draw_actor_hp(actor, actor_x, 14, 62)
- draw_actor_mp(actor, actor_x, 28, 62)
- draw_actor_tp(actor, actor_x, 42, 62) if MOTO::TP_GAGE
- end
- end
- #--------------------------------------------------------------------------
- # ☆ Width refresh
- #--------------------------------------------------------------------------
- def width_refresh
- self.width = self.contents.width + 32
- end
- end
- class Window_BattleLog < Window_Selectable
- #--------------------------------------------------------------------------
- # ● Object initialization * Redefinition
- #--------------------------------------------------------------------------
- def initialize
- super(0, 295, window_width, window_height)
- self.z = 200
- @lines = []
- @num_wait = 0
- create_back_bitmap
- create_back_sprite
- refresh
- end
- #--------------------------------------------------------------------------
- # ● Max lines * Redefinition
- #--------------------------------------------------------------------------
- def max_line_number
- return 4
- end
- #--------------------------------------------------------------------------
- # ● Opacity ※ Redefined
- #--------------------------------------------------------------------------
- def back_opacity
- return 0
- end
- #--------------------------------------------------------------------------
- # ○ Line drawing * Alias
- #--------------------------------------------------------------------------
- alias ori_moto_draw_line draw_line
- def draw_line(line_number)
- self.open
- ori_moto_draw_line(line_number)
- end
- end
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # ○ Create all windows * Alias definition
- #--------------------------------------------------------------------------
- alias ori_moto_create_all_windows create_all_windows
- def create_all_windows
- ori_moto_create_all_windows
- create_simple_status_window
- end
- #--------------------------------------------------------------------------
- # ● Create message window ※ Redefine
- #--------------------------------------------------------------------------
- def create_message_window
- @message_window = Window_Battle_Message.new
- end
- #--------------------------------------------------------------------------
- # ☆ Create simple status window
- #--------------------------------------------------------------------------
- def create_simple_status_window
- @simple_status_window = Window_Simple_Status.new
- end
- #--------------------------------------------------------------------------
- # ● Frame update ※ Redefined
- #--------------------------------------------------------------------------
- def update
- super
- if BattleManager.in_turn?
- @log_window.open
- process_event
- process_action
- end
- BattleManager.judge_win_loss
- end
- #--------------------------------------------------------------------------
- # ○ Create party command window ※ Alias definition
- #--------------------------------------------------------------------------
- alias oro_moto_create_party_command_window create_party_command_window
- def create_party_command_window
- oro_moto_create_party_command_window
- @party_command_window.x = Graphics.width if MOTO::PARTY_COMMAND_RIGHT
- end
- #--------------------------------------------------------------------------
- # ○ Create actor command window * Define alias
- #--------------------------------------------------------------------------
- alias oro_moto_create_actor_command_window create_actor_command_window
- def create_actor_command_window
- oro_moto_create_actor_command_window
- @actor_command_window.x -= Graphics.width if MOTO::ACTOR_COMMAND_LEFT
- end
- #--------------------------------------------------------------------------
- # ● Update info display viewport ※ Redefined
- #--------------------------------------------------------------------------
- def update_info_viewport
- n = MOTO::PARTY_COMMAND_RIGHT ? 128 : 0
- m = MOTO::ACTOR_COMMAND_LEFT ? 0 : 128
- move_info_viewport(n) if @party_command_window.active
- move_info_viewport(m) if @actor_command_window.active
- move_info_viewport(64) if BattleManager.in_turn?
- end
- #--------------------------------------------------------------------------
- # ○ Update status window ※ Alias definition
- #--------------------------------------------------------------------------
- alias ori_moto_refresh_status refresh_status
- def refresh_status
- ori_moto_refresh_status
- @simple_status_window.refresh
- end
- #--------------------------------------------------------------------------
- # ○ Turn start * Alias definition
- #--------------------------------------------------------------------------
- alias ori_moto_battle_start battle_start
- def battle_start
- ori_moto_battle_start
- @log_window.close
- end
- #--------------------------------------------------------------------------
- # ○ Battle start ※ Alias definition
- #--------------------------------------------------------------------------
- alias ori_moto_turn_start turn_start
- def turn_start
- @status_window.close
- @simple_status_window.open if MOTO::SIMPLE_STATUS_WINDOW
- ori_moto_turn_start
- end
- #--------------------------------------------------------------------------
- # ● Turn end * Redefined
- #--------------------------------------------------------------------------
- def turn_end
- all_battle_members.each do |battler|
- battler.on_turn_end
- refresh_status
- @log_window.display_auto_affected_status(battler)
- @log_window.wait_and_clear
- end
- BattleManager.turn_end
- process_event
- @log_window.close
- @simple_status_window.close if MOTO::SIMPLE_STATUS_WINDOW
- start_party_command_selection
- end
- #--------------------------------------------------------------------------
- # ● Processing action ※ Redefined
- #--------------------------------------------------------------------------
- def process_action
- return if scene_changing?
- if !@subject || !@subject.current_action
- @subject = BattleManager.next_subject
- end
- return turn_end unless @subject
- if @subject.current_action
- @subject.current_action.prepare
- if @subject.current_action.valid?
- execute_action
- end
- @subject.remove_current_action
- end
- process_action_end unless @subject.current_action
- end
- #--------------------------------------------------------------------------
- # ○ Command [escape] ※ alias definition
- #--------------------------------------------------------------------------
- alias ori_moto_command_escape command_escape
- def command_escape
- @log_window.open
- ori_moto_command_escape
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement