#==============================================================================
# ** Window_Status MOD
#------------------------------------------------------------------------------
# This window displays full status specs on the status screen.
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(160, 0, 384, 416)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_face(@actor, 8, 8)
draw_actor_name(@actor, 108, 0)
draw_actor_class(@actor, 236, 0)
draw_basic_info(108, 64)
draw_actor_state(@actor, 8, 128)
draw_parameters(8, 160)
draw_actor_level(@actor, 8, 288)
draw_exp_info(8, 320)
draw_equipments(128, 128)
end
#--------------------------------------------------------------------------
# * Draw Basic Information
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_basic_info(x, y)
draw_actor_hp(@actor, x, y)
draw_actor_mp(@actor, x + 108, y)
end
#--------------------------------------------------------------------------
# * Draw Parameters
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_parameters(x, y)
draw_actor_parameter(@actor, x, y + WLH * 0, 0)
draw_actor_parameter(@actor, x, y + WLH * 1, 1)
draw_actor_parameter(@actor, x, y + WLH * 2, 2)
draw_actor_parameter(@actor, x, y + WLH * 3, 3)
end
#--------------------------------------------------------------------------
# * Draw Experience Information
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_exp_info(x, y)
s1 = @actor.exp_s
s2 = @actor.next_rest_exp_s
s_next = sprintf(Vocab::ExpNext, Vocab::level)
self.contents.font.color = system_color
self.contents.draw_text(x, y + WLH * 0, 180, WLH, Vocab::ExpTotal)
self.contents.draw_text(x, y + WLH * 1, 180, WLH, s_next)
self.contents.font.color = normal_color
self.contents.draw_text(x + 128, y + WLH * 0, 180, WLH, s1, 0)
self.contents.draw_text(x + 128, y + WLH * 1, 180, WLH, s2, 0)
end
#--------------------------------------------------------------------------
# * Draw Equipment
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_equipments(x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
for i in 0..4
draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1))
end
end
#--------------------------------------------------------------------------
# * Draw Parameters
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# type : Type of parameters (0-3)
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = Vocab::atk
parameter_value = actor.atk
when 1
parameter_name = Vocab::def
parameter_value = actor.def
when 2
parameter_name = Vocab::spi
parameter_value = actor.spi
when 3
parameter_name = Vocab::agi
parameter_value = actor.agi
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 48, WLH, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 48, y, 36, WLH, parameter_value, 2)
end
#--------------------------------------------------------------------------
# * Draw State
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 96)
count = 0
for state in actor.states
draw_icon(state.icon_index, x + 24 * count, y)
count += 1
break if (24 * count > width - 24)
end
if count == 0
self.contents.draw_text(x, y, 120, WLH, "[Normal]")
end
end
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 100)
draw_actor_hp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::hp)
self.contents.font.color = hp_color(actor)
last_font_size = self.contents.font.size
xr = x + width
if width < 100
self.contents.draw_text(xr - 44, y, 44, WLH, actor.hp, 2)
else
self.contents.draw_text(x, y, width, WLH, actor.maxhp, 2)
maxw = self.contents.text_size(actor.maxhp).width
self.contents.draw_text(x, y, width - maxw, WLH, "/", 2)
self.contents.draw_text(x, y, width - maxw - 8, WLH, actor.hp, 2)
end
end
#--------------------------------------------------------------------------
# * Draw HP gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_actor_hp_gauge(actor, x, y, width = 100)
gw = width * actor.hp / actor.maxhp
gc1 = hp_gauge_color1
gc2 = hp_gauge_color2
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
#--------------------------------------------------------------------------
# * Draw MP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 100)
draw_actor_mp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::mp)
self.contents.font.color = mp_color(actor)
last_font_size = self.contents.font.size
xr = x + width
if width < 100
self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2)
else
self.contents.draw_text(x, y, width, WLH, actor.maxmp, 2)
maxw = self.contents.text_size(actor.maxmp).width
self.contents.draw_text(x, y, width - maxw, WLH, "/", 2)
self.contents.draw_text(x, y, width - maxw - 8, WLH, actor.mp, 2)
end
end
#--------------------------------------------------------------------------
# * Draw MP Gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_actor_mp_gauge(actor, x, y, width = 100)
gw = width * actor.mp / [actor.maxmp, 1].max
gc1 = mp_gauge_color1
gc2 = mp_gauge_color2
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
end