标题: 45度横版5人的位置帮忙改下 [打印本页] 作者: a3239391 时间: 2008-4-7 07:22 标题: 45度横版5人的位置帮忙改下 #==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
# 处理同伴的类。包含金钱以及物品的信息。本类的实例
# 请参考 $game_party。
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# ● 加入同伴
# actor_id : 角色 ID
#--------------------------------------------------------------------------
def add_actor(actor_id)
# 获取角色
actor = $game_actors[actor_id]
# 同伴人数未满 5 人、本角色不在队伍中的情况下
if @actors.size < 5 and not @actors.include?(actor)
# 添加角色
@actors.push(actor)
# 还原主角
$game_player.refresh
end
end
end
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
# 显示菜单画面和同伴状态的窗口。
#==============================================================================
class Window_MenuStatus
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 86
actor = $game_party.actors
draw_actor_graphic(actor, x - 40, y + 70)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 24)
draw_actor_state(actor, x + 90, y + 24)
draw_actor_exp(actor, x, y + 48)
draw_actor_hp(actor, x + 236, y + 24)
draw_actor_sp(actor, x + 236, y + 48)
end
end
#--------------------------------------------------------------------------
# ● 刷新光标矩形
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 86, self.width - 32, 76)
end
end
end
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 显示战斗画面同伴状态的窗口。
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
actor_x = i * 120 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
if @level_up_flags
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 取得战斗画面的 X 坐标
#--------------------------------------------------------------------------
def screen_x
# 返回计算后的队伍 X 坐标的排列顺序
if self.index != nil
return self.index * 120 + 80
else
return 0
end
end
end