#==============================================================================
# HP/SP/EXP Bars
# by XRXS
# modified by Atoa
#==============================================================================
#==============================================================================
# ? Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# 0 = red
# 1 = blue
# 2 = green
# 3 = pink
# 4 = clear blue
# 5 = yellow
# 6 = withe
#--------------------------------------------------------------------------
HP_COLOR = 0
SP_COLOR = 1
EXP_COLOR = 2
#--------------------------------------------------------------------------
alias draw_actor_hp_meter draw_actor_hp
alias draw_actor_sp_meter draw_actor_sp
alias draw_actor_exp_meter draw_actor_exp
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 120, type = 0)
draw_actor_hp_meter(actor, x, y)
self.contents.fill_rect(x-1 , y + 24, width + 2, 6, Color.new(0, 0, 0, 255))
w = width * actor.hp / actor.maxhp
color = HP_COLOR
bar_color(x, y, w, color)
end
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 120, type = 0)
draw_actor_sp_meter(actor, x, y)
self.contents.fill_rect(x - 1 , y + 24, width + 2, 6, Color.new(0, 0, 0, 255))
w = width * actor.sp / actor.maxsp if actor.maxsp > 0
w = 0 if actor.maxsp == 0
color = SP_COLOR
bar_color(x, y, w, color)
end
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y, width = 120, type = 0)
draw_actor_exp_meter(actor, x, y)
self.contents.fill_rect(x - 1 , y + 24, width + 2, 6, Color.new(0, 0, 0, 255))
w = width * actor.now_exp / actor.next_exp
color = EXP_COLOR
bar_color(x, y, w, color)
end
#--------------------------------------------------------------------------
def bar_color(x, y, w, color)
case color
when 0
self.contents.fill_rect(x, y + 25, w, 1, Color.new(255, 96, 96, 255))
self.contents.fill_rect(x, y + 26, w, 1, Color.new(255, 0, 0, 255))
self.contents.fill_rect(x, y + 27, w, 1, Color.new(192, 0, 0, 255))
self.contents.fill_rect(x, y + 28, w, 1, Color.new(128, 0, 0, 255))
when 1
self.contents.fill_rect(x, y + 25, w, 1, Color.new(96, 96, 255, 255))
self.contents.fill_rect(x, y + 26, w, 1, Color.new(0, 0, 255, 255))
self.contents.fill_rect(x, y + 27, w, 1, Color.new(0, 0, 192, 255))
self.contents.fill_rect(x, y + 28, w, 1, Color.new(0, 0, 128, 255))
when 2
self.contents.fill_rect(x, y + 25, w, 1, Color.new(96, 255, 96, 255))
self.contents.fill_rect(x, y + 26, w, 1, Color.new(0, 255, 0, 255))
self.contents.fill_rect(x, y + 27, w, 1, Color.new(0, 192, 0, 255))
self.contents.fill_rect(x, y + 28, w, 1, Color.new(0, 128, 0, 255))
when 3
self.contents.fill_rect(x, y + 25, w, 1, Color.new(255, 128, 255, 255))
self.contents.fill_rect(x, y + 26, w, 1, Color.new(255, 0, 255, 255))
self.contents.fill_rect(x, y + 27, w, 1, Color.new(192, 0, 192, 255))
self.contents.fill_rect(x, y + 28, w, 1, Color.new(128, 0, 128, 255))
when 4
self.contents.fill_rect(x, y + 25, w, 1, Color.new(128, 255, 255, 255))
self.contents.fill_rect(x, y + 26, w, 1, Color.new(0, 255, 255, 255))
self.contents.fill_rect(x, y + 27, w, 1, Color.new(0, 192, 192, 255))
self.contents.fill_rect(x, y + 28,w, 1, Color.new(0, 128, 128, 255))
when 5
self.contents.fill_rect(x, y + 25, w, 1, Color.new(255, 255, 128, 255))
self.contents.fill_rect(x, y + 26, w, 1, Color.new(255, 255, 0, 255))
self.contents.fill_rect(x, y + 27, w, 1, Color.new(192, 192, 0, 255))
self.contents.fill_rect(x, y + 28, w, 1, Color.new(128, 128, 0, 255))
when 6
self.contents.fill_rect(x, y + 25, w, 1, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y + 26, w, 1, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y + 27, w, 1, Color.new(192, 192, 192, 255))
self.contents.fill_rect(x, y + 28, w, 1, Color.new(128, 128, 128, 255))
end
end
end
#==============================================================================
# ? Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end