module Cache
#--------------------------------------------------------------------------
# ● 显示会变更人物图的状态index
#--------------------------------------------------------------------------
State_actor = [18, 19]
#--------------------------------------------------------------------------
# ● 获取全身像+铠甲名+状态
#--------------------------------------------------------------------------
def self.body(filename, armor_name, state)
load_bitmap("Graphics/Characters_/", filename + armor_name + state.to_s)
end
end
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘全身像
# enabled : 有效的标志。 false 的时候使用半透明效果绘制
#--------------------------------------------------------------------------
def draw_body(body_name, armor_name, state, x, y, enabled = true)
bitmap = Cache.body(body_name, armor_name, state)
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
#--------------------------------------------------------------------------
# ● 取得铠甲名字
#--------------------------------------------------------------------------
def armor_name
@actor.equips[3] ? @actor.equips[3].name : "none"
end
#--------------------------------------------------------------------------
# ● actor的全身像描画
#--------------------------------------------------------------------------
def draw_actor_body(actor, armor_name, state_effect, x, y, enabled = true)
draw_body(actor.name, armor_name, state_effect, x, y, enabled)
end
#--------------------------------------------------------------------------
# ● 取得状态index
#--------------------------------------------------------------------------
def state_effect
Cache::State_actor.each do |state_index|
return state_index if @actor.state_icons.include?(state_index)
end
return 0
end
end
class Window_Status < Window_Selectable
#--------------------------------------------------------------------------
# ● 绘制区域 1
#--------------------------------------------------------------------------
alias body_draw_block1 draw_block1
def draw_block1(y)
draw_actor_body(@actor, armor_name, state_effect, 400, 150)
body_draw_block1(y)
end
end
class Window_ActorCommand < Window_Command
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
alias body_initialize initialize
def initialize
body_initialize
@body = Sprite.new
end
#--------------------------------------------------------------------------
# ● 设置
#--------------------------------------------------------------------------
alias body_setup setup
def setup(actor)
body_setup(actor)
@body.bitmap = Cache.body(@actor.name, armor_name, state_effect)
@body.x = 12; @body.y = 160
end
#--------------------------------------------------------------------------
# ● 可視设置
#--------------------------------------------------------------------------
def visible(visible = true)
@body.visible = visible
end
end
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 开始角色指令的选择
#--------------------------------------------------------------------------
alias body_start_actor_command_selection start_actor_command_selection
def start_actor_command_selection
body_start_actor_command_selection
@actor_command_window.visible(true)
end
#--------------------------------------------------------------------------
# ● 回合开始
#--------------------------------------------------------------------------
alias body_turn_start turn_start
def turn_start
body_turn_start
@actor_command_window.visible(false)
end
end