#==============================================================================
# ■ Window_SquareBattleActorMessge
#------------------------------------------------------------------------------
# 显示角色信息的类,归到窗口类为了方便。
#==============================================================================
class Window_SquareBattleActorMessge < Window_Base
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
super(0, 480 - 32, 160, 32)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# 角色の绘制
if $game_party.actors.size != 0
@x1 = 16
@x2 = 176
@x3 = 332
@x4 = 496
@ay = 0
# 一号角色
if $game_party.actors.include?($game_actors[1])
draw_actor_head(1, @x1, @ay)
@a1hp = 100.000 / $game_actors[1].maxhp * $game_actors[1].hp
@a1hpzao = Bitmap.new("Graphics/Pictures/HP SP槽")
@a1hpzao.x = @x1 + 64
@a1hpzao.y = @ay + 16
@a1hptiao = Bitmap.new("Graphics/Pictures/HP槽(填充)")
@a1hptiao.x = @a1xuetiao.x + 1
@a1hptiao.y = @a1xuetiao.y + 1
@a1hptiao.zoom_x = @a1hp
@a1sp = 100.000 / $game_actors[1].maxsp * $game_actors[1].sp
@a1spzao = Bitmap.new("Graphics/Pictures/HP SP槽")
@a1spzao.x = @x1 + 64
@a1spzao.y = @ay + 32
@a1sptiao = Bitmap.new("Graphics/Pictures/SP槽(填充)")
@a1sptiao.x = @a1xuetiao.x + 1
@a1sptiao.y = @a1xuetiao.y + 1
@a1sptiao.zoom_x = @a1sp
@a1cp = 100.000 / 100 * $game_actors[1].mor
@a1cpzao = Bitmap.new("Graphics/Pictures/CP槽")
@a1cpzao.x = @x1 + 64
@a1cpzao.y = @ay + 48
@a1cptiao = Bitmap.new("Graphics/Pictures/CP槽(填充)")
@a1cptiao.x = @a1xuetiao.x + 1
@a1cptiao.y = @a1xuetiao.y + 1
@a1cptiao.zoom_x = @a1cp
end
# 二号角色
if $game_party.actors.include?($game_actors[2])
if $game_party.actors.include?($game_actors[1])
draw_actor_head(2, @x2, @ay)
else
draw_actor_head(2, @x1, @ay)
end
@a2hp = 100.000 / $game_actors[2].maxhp * $game_actors[2].hp
@a2hpzao = Bitmap.new("Graphics/Pictures/HP SP槽")
if $game_party.actors.include?($game_actors[1])
@a2hpzao.x = @x2 + 64
else
@a2hptiao.x = @x1 + 64
end
@a2hpzao.y = @ay + 16
@a2hptiao = Bitmap.new("Graphics/Pictures/HP槽(填充)")
@a2hptiao.x = @a1xuetiao.x + 1
@a2hptiao.y = @a1xuetiao.y + 1
@a2hptiao.zoom_x = @a1hp
@a2sp = 100.000 / $game_actors[2].maxsp * $game_actors[2].sp
@a2spzao = Bitmap.new("Graphics/Pictures/HP SP槽")
if $game_party.actors.include?($game_actors[1])
@a2spzao.x = @x2 + 64
else
@a2spzao.x = @x1 + 64
end
@a2spzao.y = @ay + 32
@a2sptiao = Bitmap.new("Graphics/Pictures/SP槽(填充)")
@a2sptiao.x = @a1xuetiao.x + 1
@a2sptiao.y = @a1xuetiao.y + 1
@a2sptiao.zoom_x = @a1sp
@a2cp = 100.000 / 100 * $game_actors[2].mor
@a2cpzao = Bitmap.new("Graphics/Pictures/CP槽")
if $game_party.actors.include?($game_actors[1])
@a2cpzao.x = @x2 + 64
else
@a2cpzao.x = @x1 + 64
end
@a2cpzao.y = @ay + 48
@a2cptiao = Bitmap.new("Graphics/Pictures/CP槽(填充)")
@a2cptiao.x = @a1xuetiao.x + 1
@a2cptiao.y = @a1xuetiao.y + 1
@a2cptiao.zoom_x = @a1cp
end
# 三号角色
if $game_party.actors.include?($game_actors[3])
if $game_party.actors.include?($game_actors[1])
if $game_party.actors.include?($game_actors[2])
draw_actor_head(3, @x3, @ay)
else
draw_actor_head(3, @x2, @ay)
end
elsif $game_party.actors.include?($game_actors[2])
draw_actor_head(3, @x2, @ay)
else
draw_actor_head(3, @x1, @ay)
end
@a3hp = 100.000 / $game_actors[3].maxhp * $game_actors[3].hp
@a3hpzao = Bitmap.new("Graphics/Pictures/HP SP槽")
@a3hpzao.y = @ay + 16
@a3hptiao = Bitmap.new("Graphics/Pictures/HP槽(填充)")
@a3hptiao.x = @a1xuetiao.x + 1
@a3hptiao.y = @a1xuetiao.y + 1
@a3hptiao.zoom_x = @a1hp
@a3sp = 100.000 / $game_actors[3].maxsp * $game_actors[3].sp
@a3spzao = Bitmap.new("Graphics/Pictures/HP SP槽")
@a3spzao.y = @ay + 32
@a3sptiao = Bitmap.new("Graphics/Pictures/SP槽(填充)")
@a3sptiao.x = @a1xuetiao.x + 1
@a3sptiao.y = @a1xuetiao.y + 1
@a3sptiao.zoom_x = @a1sp
@a3cp = 100.000 / 100 * $game_actors[3].mor
@a3cpzao = Bitmap.new("Graphics/Pictures/CP槽")
@a3cpzao.y = @ay + 48
@a3cptiao = Bitmap.new("Graphics/Pictures/CP槽(填充)")
@a3cptiao.x = @a1xuetiao.x + 1
@a3cptiao.y = @a1xuetiao.y + 1
@a3cptiao.zoom_x = @a1cp
if $game_party.actors.include?($game_actors[1])
if $game_party.actors.include?($game_actors[2])
@a3hpzao.x = @x3 + 64
@a3spzao.x = @x3 + 64
@a3cpzao.x = @x3 + 64
else
@a3hpzao.x = @x2 + 64
@a3spzao.x = @x2 + 64
@a3cpzao.x = @x2 + 64
end
elsif $game_party.actors.include?($game_actors[2])
@a3hpzao.x = @x2 + 64
@a3spzao.x = @x2 + 64
@a3cpzao.x = @x2 + 64
else
@a3hpzao.x = @x1 + 64
@a3spzao.x = @x1 + 64
@a3cpzao.x = @x1 + 64
end
end
# 四号角色
if $game_party.actors.include?($game_actors[4])
if $game_party.actors.include?($game_actors[1])
if $game_party.actors.include?($game_actors[2])
if $game_party.actors.include?($game_actors[3])
draw_actor_head(4, @x4, @ay)
else
draw_actor_head(4, @x3, @ay)
end
elsif $game_party.actors.include?($game_actors[3])
draw_actor_head(4, @x3, @ay)
else
draw_actor_head(4, @x2, @ay)
end
elsif $game_party.actors.include?($game_actors[2])
if $game_party.actors.include?($game_actors[3])
draw_actor_head(4, @x3, @ay)
else
draw_actor_head(4, @x2, @ay)
end
elsif $game_party.actors.include?($game_actors[3])
draw_actor_head(4, @x2, @ay)
else
draw_actor_head(4, @x1, @ay)
end
@a4hp = 100.000 / $game_actors[4].maxhp * $game_actors[4].hp
@a4hpzao = Bitmap.new("Graphics/Pictures/HP SP槽")
@a4hpzao.y = @ay + 16
@a4hptiao = Bitmap.new("Graphics/Pictures/HP槽(填充)")
@a4hptiao.x = @a1xuetiao.x + 1
@a4hptiao.y = @a1xuetiao.y + 1
@a4hptiao.zoom_x = @a1hp
@a4sp = 100.000 / $game_actors[4].maxsp * $game_actors[4].sp
@a4spzao = Bitmap.new("Graphics/Pictures/HP SP槽")
@a4spzao.y = @ay + 32
@a4sptiao = Bitmap.new("Graphics/Pictures/SP槽(填充)")
@a4sptiao.x = @a1xuetiao.x + 1
@a4sptiao.y = @a1xuetiao.y + 1
@a4sptiao.zoom_x = @a1sp
@a4cp = 100.000 / 100 * $game_actors[4].mor
@a4cpzao = Bitmap.new("Graphics/Pictures/CP槽")
@a4cpzao.y = @ay + 48
@a4cptiao = Bitmap.new("Graphics/Pictures/CP槽(填充)")
@a4cptiao.x = @a1xuetiao.x + 1
@a4cptiao.y = @a1xuetiao.y + 1
@a4cptiao.zoom_x = @a1cp
if $game_party.actors.include?($game_actors[1])
if $game_party.actors.include?($game_actors[2])
if $game_party.actors.include?($game_actors[3])
@a4hpzao.x = @x4 + 64
@a4spzao.x = @x4 + 64
@a4cpzao.x = @x4 + 64
else
@a4hpzao.x = @x3 + 64
@a4spzao.x = @x3 + 64
@a4cpzao.x = @x3 + 64
end
elsif $game_party.actors.include?($game_actors[3])
@a4hpzao.x = @x3 + 64
@a4spzao.x = @x3 + 64
@a4cpzao.x = @x3 + 64
else
@a4hpzao.x = @x2 + 64
@a4spzao.x = @x2 + 64
@a4cpzao.x = @x2 + 64
end
elsif $game_party.actors.include?($game_actors[2])
if $game_party.actors.include?($game_actors[3])
@a4hpzao.x = @x3 + 64
@a4spzao.x = @x3 + 64
@a4cpzao.x = @x3 + 64
else
@a4hpzao.x = @x2 + 64
@a4spzao.x = @x2 + 64
@a4cpzao.x = @x2 + 64
end
elsif $game_party.actors.include?($game_actors[3])
@a4hpzao.x = @x2 + 64
@a4spzao.x = @x2 + 64
@a4cpzao.x = @x2 + 64
else
@a4hpzao.x = @x1 + 64
@a4spzao.x = @x1 + 64
@a4cpzao.x = @x1 + 64
end
end
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
if @a1hptiao != 100.000 / $game_actors[1].maxhp * $game_actors[1].hp or @a2hptiao != 100.000 / $game_actors[2].maxhp * $game_actors[2].hp or @a3hptiao != 100.000 / $game_actors[3].maxhp * $game_actors[3].hp or @a4hptiao != 100.000 / $game_actors[4].maxhp * $game_actors[4].hp or @a1sptiao != 100.000 / $game_actors[1].maxsp * $game_actors[1].sp or @a2sptiao != 100.000 / $game_actors[2].maxsp * $game_actors[2].sp or @a3sptiao != 100.000 / $game_actors[3].maxsp * $game_actors[3].sp or @a4sptiao != 100.000 / $game_actors[4].maxsp * $game_actors[4].sp or @a1cptiao != 100.000 / 100 * $game_actors[1].cp or @a2cptiao != 100.000 / 100 * $game_actors[2].cp or @a3cptiao != 100.000 / 100 * $game_actors[3].cp or @a4cptiao != 100.000 / 100 * $game_actors[4].cp
refresh
end
end
end