Jump to content
Sign in to follow this  
Megablackdragon31

Battle hud v 1.1

Recommended Posts

image.png


# ==============================================================================
# ** Battle Hud v 1.1
# Author: Megablackdragon31
# Platform: RPG Maker VX Ace
# ------------------------------------------------------------------------------
# Releases:
# V 0.1 alpha 27/04/12  (only for facebook friends)
# V 0.5 beta 28/04/12 Improve coordinates for windows.(Only for facebook friends)
# V 1.0 29/04/12 Public Release
# V 1.1 05/05/12 Improved interface of the battle status.
# Instructions: I do not seem necessary,just the X and Y cordinates.
#==============================================================================
class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # * Update Information Display Viewport
 #--------------------------------------------------------------------------
 def update_info_viewport
move_info_viewport(0)   if @party_command_window.active
move_info_viewport(0) if @actor_command_window.active
move_info_viewport(0)  if BattleManager.in_turn?
 end
 #--------------------------------------------------------------------------
 # * Create Status Window
 #--------------------------------------------------------------------------
 def create_status_window
@status_window = Window_BattleStatus.new
@status_window.x = 0
@status_window.y = 0
 end
 #--------------------------------------------------------------------------
 # * Create Information Display Viewport
 #--------------------------------------------------------------------------
 def create_info_viewport
@info_viewport = Viewport.new
@info_viewport.rect.y = Graphics.height - @status_window.height
@info_viewport.rect.height = @status_window.height
@info_viewport.z = 100
@info_viewport.ox = 64
@status_window.viewport = @info_viewport
 end
 #--------------------------------------------------------------------------
 # * Create Party Commands Window
 #--------------------------------------------------------------------------
 def create_party_command_window
@party_command_window = Window_PartyCommand.new
@party_command_window.viewport = nil
@party_command_window.set_handler(:fight,  method(:command_fight))
@party_command_window.set_handler(:escape, method(:command_escape))
@party_command_window.unselect
@party_command_window.x = 202
@party_command_window.y = 133
@party_command_window.width = 141 #Ancho de la ventana
@party_command_window.height = 120 #Alto de la ventana
 end
 #--------------------------------------------------------------------------
 # * Create Actor Commands Window
 #--------------------------------------------------------------------------
 def create_actor_command_window
@actor_command_window = Window_ActorCommand.new
@actor_command_window.viewport = nil
@actor_command_window.set_handler(:attack, method(:command_attack))
@actor_command_window.set_handler(:skill,  method(:command_skill))
@actor_command_window.set_handler(:guard,  method(:command_guard))
@actor_command_window.set_handler(:item,   method(:command_item))
@actor_command_window.set_handler(:cancel, method(:prior_command))
@actor_command_window.x = 202
@actor_command_window.y = 133
@actor_command_window.width = 141 #Ancho de la ventana
@actor_command_window.height = 120 #Alto de la ventana
 end
end
#==============================================================================
# â–  Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
super(0, 0, 544, 120)
refresh
self.openness = 0
self.contents.font.size =16
 end
 #--------------------------------------------------------------------------
 # â— Get the height of the HP / MP / TP line
 #--------------------------------------------------------------------------
 def gauge_line_height
return 16
 end
 #--------------------------------------------------------------------------
 # â— Get Number of Lines to Show
 #--------------------------------------------------------------------------
 def col_max
return [item_max, 4].max
 end
 #--------------------------------------------------------------------------
 # â— Get Number of Items
 #--------------------------------------------------------------------------
 def spacing
return 0
 end
 #--------------------------------------------------------------------------
 # â— Draw Item
 #--------------------------------------------------------------------------
 def item_rect(index)
rect = Rect.new
rect.width = item_width
rect.height = contents_height
rect.x = index % col_max * (item_width + spacing)
rect.y = index / col_max * contents_height
rect
 end
 #--------------------------------------------------------------------------
 # â— Get Basic Area Retangle
 #--------------------------------------------------------------------------
 def basic_area_rect(index)
rect = item_rect_for_text(index)
rect.height -= gauge_area_height
rect
 end
 #--------------------------------------------------------------------------
 # â— Get Gauge Area Rectangle
 #--------------------------------------------------------------------------
 def gauge_area_rect(index)
rect = item_rect_for_text(index)
rect.y += contents_height - gauge_area_height - 8
rect.height = gauge_area_height
rect
 end
 #--------------------------------------------------------------------------
 # â— Get Gauge Area height
 #--------------------------------------------------------------------------
 def gauge_area_height
return (gauge_line_height * ($data_system.opt_display_tp ? 3 : 2))
 end
 #--------------------------------------------------------------------------
 # â— Draw Basic Area
 #--------------------------------------------------------------------------
 def draw_basic_area(rect, actor)
draw_actor_name(actor, rect.x, rect.y - 3, 100)
draw_actor_icons(actor, rect.x + 2, rect.y + 72, rect.width+8)
 end
 #--------------------------------------------------------------------------
 # â— Draw Gauge Area (with TP)
 #--------------------------------------------------------------------------
 def draw_gauge_area_with_tp(rect, actor)
draw_actor_hp(actor, rect.x, rect.y - 26 + gauge_line_height * 0, rect.width)
draw_actor_mp(actor, rect.x, rect.y - 24 + gauge_line_height * 1, rect.width)
draw_actor_tp(actor, rect.x, rect.y - 22 + gauge_line_height * 2, rect.width)
 end
 #--------------------------------------------------------------------------
 # â— Draw Gauge Area (without TP)
 #--------------------------------------------------------------------------
 def draw_gauge_area_without_tp(rect, actor)
draw_actor_hp(actor, rect.x, rect.y + gauge_line_height * 1, rect.width)
draw_actor_mp(actor, rect.x, rect.y + gauge_line_height * 2, rect.width)
 end
end
#==============================================================================
# ** Window_BattleActor
#------------------------------------------------------------------------------
#  This window is for selecting an actor's action target on the battle screen.
#==============================================================================
class Window_BattleActor < Window_BattleStatus
 #--------------------------------------------------------------------------
 # * Object Initialization
 #	 info_viewport : Viewport for displaying information
 #--------------------------------------------------------------------------
 def initialize(info_viewport)
super()
self.x = 0
self.y = 296
self.visible = false
self.openness = 255
@info_viewport = info_viewport
 end
 #--------------------------------------------------------------------------
 # * Show Window
 #--------------------------------------------------------------------------
 def show
if @info_viewport
  width_remain = Graphics.width - width
  self.x = 0
  self.y = 296
  @info_viewport.rect.width = 0
  select(0)
end
super
 end
 #--------------------------------------------------------------------------
 # * Hide Window
 #--------------------------------------------------------------------------
 def hide
@info_viewport.rect.width = Graphics.width if @info_viewport
super
 end
end
#==============================================================================
# ** Window_BattleEnemy
#------------------------------------------------------------------------------
#  Window for selecting the enemy who is the action target on the battle
# screen.
#==============================================================================
class Window_BattleEnemy < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #	 info_viewport : Viewport for displaying information
 #--------------------------------------------------------------------------
 def initialize(info_viewport)
super(0, info_viewport.rect.y, window_width, fitting_height(4))
refresh
self.visible = false
@info_viewport = info_viewport
 end
 #--------------------------------------------------------------------------
 # * Get Window Width
 #--------------------------------------------------------------------------
 def window_width
Graphics.width - 0
 end
end

Edited by Megablackdragon31

Share this post


Link to post
Share on other sites

You said that it is customizable but as far as I can I cant see the configurable part. Especially the for the beginners which will use this script (It was just an assumption). I think it is better to create a module with all the configurable variables instead of just presenting the script in a way that a developer can only understand.

Share this post


Link to post
Share on other sites

Also the author hasn't replied since May last year. If you want help with this, you might have better luck starting a thread in script support forum.

I'll close this one for now - Megablackdragon can PM me if he returns and I will re-open.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×