class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘状态
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 120)
state_size = 0
for state in actor.states
# 图标数量超出宽度就中断循环
if state_size >= width / 24
break
end
# 此状态不带图标就跳过
if !ICON_STATE_IDS.include?(state)
next
end
bitmap = RPG::Cache.icon($data_states[state].animation_id.to_s)
if actor.states_turn[state] >= $data_states[state].hold_turn/2
opacity = 255
else
opacity = 100
end
# 这里的图标大小默认是24x24,要改就改下面那个Rect.new(0, 0, 24, 24)
self.contents.blt(x + 24 * state_size, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
state_size += 1
end
end
end
class Game_Battler
attr_reader :states_turn # 声明状态剩余回合
end