#==============================================================================
# ** Draw HP, SP & Exp With Percents By SephirothSpawn
#==============================================================================
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# Draw "HP" text string
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# Gets Percent
p = Integer(actor.hp / actor.maxhp.to_f * 100)
p = "#{p} %"
# Draw HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
pw = self.contents.text_size(p).width
self.contents.draw_text(x + width - pw, y, pw, 32, p, 2)
end
#--------------------------------------------------------------------------
# * Draw SP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# Draw "SP" text string
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
# Gets Percent
p = Integer(actor.sp / actor.maxsp.to_f * 100)
p = "#{p} %"
# Draw SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
pw = self.contents.text_size(p).width
self.contents.draw_text(x + width - pw, y, pw, 32, p, 2)
end
#--------------------------------------------------------------------------
# * Draw EXP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 24, 32, "E")
self.contents.font.color = normal_color
s = "#{actor.next_exp_percent} %"
self.contents.draw_text(x + 24, y, 180, 32, s)
end
end
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Get Next Exp Percent
#--------------------------------------------------------------------------
def next_exp_percent
lst = @exp_list[@level] > 0 ? @exp_list[@level] : 0
nxt = @exp_list[@level + 1] > 0 ? @exp_list[@level + 1] : 0
rst = nxt - @exp
begin
return 100 - Integer( rst.to_f / (nxt - lst) * 100 )
rescue
return 100
end
end
end