class Window_BattleStatus
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@data = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
@data[i] = Window_ActorStatus.new(actor)
end
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
for i in 0...$game_party.actors.size
@data[i].dispose
end
end
#--------------------------------------------------------------------------
# * Set Level Up Flag
# actor_index : actor index
#--------------------------------------------------------------------------
def level_up(actor_index)
@data[actor_index].level_up
end
#--------------------------------------------------------------------------
# * Add Actor
#--------------------------------------------------------------------------
def add_actor
@data << Window_ActorStatus.new($game_party.actors[-1])
end
#--------------------------------------------------------------------------
# * Remove Actor
#--------------------------------------------------------------------------
def remove_actor(actor_id)
@data.delete_at(actor_id)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
for i in 0...$game_party.actors.size
@data[i].refresh
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
for i in 0...$game_party.actors.size
@data[i].update
end
end
#--------------------------------------------------------------------------
# * Set Visibility
#--------------------------------------------------------------------------
def visible=(bool)
for window in @data
window.visible = bool
end
end
end
#==============================================================================
# ** Window_ActorStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================
class Window_ActorStatus < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#-------------------------------------------------------------------------
def initialize(actor)
@actor = actor
x = (4 - $game_party.actors.size) * 80 + actor.index * 160 + 80 - 80
y = 320
width = 160
height = 160
super(x,y,width,height)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.visible = (not Battler_Setup::Battle_Status_Hidden)
self.back_opacity = 160
@level_up = false
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
x = 4
draw_actor_name(@actor, x, 0)
draw_actor_hp(@actor, x, 32, 120)
draw_actor_sp(@actor, x, 64, 120)
if @level_up
self.contents.font.color = normal_color
self.contents.draw_text(x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(@actor, x, 96)
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
return if not self.visible
# Slightly lower opacity level during main phase
if $game_temp.battle_main_phase
self.contents_opacity -= 4 if self.contents_opacity > 191
else
self.contents_opacity += 4 if self.contents_opacity < 255
end
end
#--------------------------------------------------------------------------
# * Level Up
#--------------------------------------------------------------------------
def level_up
@level_up = true
end
end