#==============================================================================
# ■ Game_Temp游戏的调控
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ● Execute Pre Cache Skill Menu执行预缓存技能菜单
#--------------------------------------------------------------------------
def execute_pre_cache_equip_menu
@pre_cache_equip_menu = []
@pre_cache_equip_menu.push(Cache.menu_equip("Background"))
@pre_cache_equip_menu.push(Cache.menu_equip("Layout_U"))
@pre_cache_equip_menu.push(Cache.menu_equip("Layout_R"))
@pre_cache_equip_menu.push(Cache.menu_equip("Layout_D"))
@pre_cache_equip_menu.push(Cache.menu_equip("Layout_L"))
@pre_cache_equip_menu.push(Cache.menu_equip("Par_Number"))
end
end
#==============================================================================
# ■ Scene_Skill现场技术
#==============================================================================
class Scene_Equip
include MOG_MENU_EQUIP
include MOG_MENU_BASE
#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------
def main
execute_setup
execute_loop
execute_dispose
end
#--------------------------------------------------------------------------
# ● Execute Setup
#--------------------------------------------------------------------------
def execute_setup
@actor = $game_temp.actor_menu_temp
@actor_old = @actor
@phase = 0
create_sprites
end
#--------------------------------------------------------------------------
# ● Execute Lopp
#--------------------------------------------------------------------------
def execute_loop
Graphics.transition(10)
loop do
Input.update
update
Graphics.update
break if SceneManager.scene != self
end
end
end
#==============================================================================
# ■ Window_EquipStatus装备状态窗口
#==============================================================================
class Window_EquipStatus < Window_Base
#--------------------------------------------------------------------------
# ● Initializee初始化Zee
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
@actor = nil
@temp_actor = nil
self.visible = false
end
#--------------------------------------------------------------------------
# ● Window Width窗口的宽度
#--------------------------------------------------------------------------
def window_width
return 208
end
#--------------------------------------------------------------------------
# ● Window Height窗口的高度
#--------------------------------------------------------------------------
def window_height
return 296
end
#--------------------------------------------------------------------------
# ● Visible Line Number可见的行数
#--------------------------------------------------------------------------
def visible_line_number
return 1
end
#--------------------------------------------------------------------------
# ● Actor角色
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
end
#--------------------------------------------------------------------------
# ● Refresh刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
end
#--------------------------------------------------------------------------
# ● Set Temp Actor设置临时角色
#--------------------------------------------------------------------------
def set_temp_actor(temp_actor)
return if @temp_actor == temp_actor
@temp_actor = temp_actor
$game_temp.temp_actor_equip = @temp_actor
end
end
#==============================================================================
# ■ Window_EquipCommand已装备窗口
#==============================================================================
class Window_EquipCommand < Window_HorzCommand
#--------------------------------------------------------------------------
# ● Initialize初始化
#--------------------------------------------------------------------------
def initialize(x, y, width)
@window_width = width
super(x, y)
end
#--------------------------------------------------------------------------
# ● Window Width窗口的宽度
#--------------------------------------------------------------------------
def window_width
@window_width
end
#--------------------------------------------------------------------------
# ● Col Max最大标签
#--------------------------------------------------------------------------
def col_max
return 3
end
#--------------------------------------------------------------------------
# ● Make Command List装备命令列表
#--------------------------------------------------------------------------
def make_command_list
add_command(Vocab::equip2, :equip)
add_command(Vocab::optimize, :optimize)
add_command(Vocab::clear, :clear)
end
#--------------------------------------------------------------------------
# ● Draw Item得出项目
#--------------------------------------------------------------------------
def draw_item(index)
end
end
#==============================================================================
# ■ Window_EquipSlot装备槽窗口
#==============================================================================
class Window_EquipSlot < Window_Selectable#窗口选择
attr_reader :status_window #状态窗口
attr_reader :item_window #项目窗口
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(x, y, width)
super(x, y, width, window_height)
@actor = nil
refresh
end
#--------------------------------------------------------------------------
# ● Window Height窗口高度
#--------------------------------------------------------------------------
def window_height
fitting_height(visible_line_number)
end
#--------------------------------------------------------------------------
# ● Visible Line Number可见的行数
#--------------------------------------------------------------------------
def visible_line_number
return 5
end
#--------------------------------------------------------------------------
# ● Actor角色
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ● Update更新
#--------------------------------------------------------------------------
def update
super
@item_window.slot_id = index if @item_window
end
#--------------------------------------------------------------------------
# ● Item Max最大项
#--------------------------------------------------------------------------
def item_max
@actor ? @actor.equip_slots.size : 0#装备槽尺寸
end
#--------------------------------------------------------------------------
# ● Item项目
#--------------------------------------------------------------------------
def item
@actor ? @actor.equips[index] : nil
end
#--------------------------------------------------------------------------
# ● Draw Item得出项目
#--------------------------------------------------------------------------
def draw_item(index)
return unless @actor
rect = item_rect_for_text(index)
change_color(system_color, enable?(index))
set_font_equip
draw_item_name(@actor.equips[index], rect.x + 92, rect.y, enable?(index))
end
#--------------------------------------------------------------------------
# ● Slot Name槽的名称
#--------------------------------------------------------------------------
def slot_name(index)
@actor ? Vocab::etype(@actor.equip_slots[index]) : ""
end
#--------------------------------------------------------------------------
# ● Enable能够用
#--------------------------------------------------------------------------
def enable?(index)
@actor ? @actor.equip_change_ok?(index) : false
end
#--------------------------------------------------------------------------
# ● Current Item Enabled目前能用的项目
#--------------------------------------------------------------------------
def current_item_enabled?
enable?(index)
end
#--------------------------------------------------------------------------
# ● Status Window状态窗口
#--------------------------------------------------------------------------
def status_window=(status_window)
@status_window = status_window
call_update_help
end
#--------------------------------------------------------------------------
# ● Item Window项目窗口
#--------------------------------------------------------------------------
def item_window=(item_window)
@item_window = item_window
update
end
#--------------------------------------------------------------------------
# ● Update Help更新的帮助
#--------------------------------------------------------------------------
def update_help
super
@help_window.set_item(item) if @help_window
$game_temp.temp_actor_equip = nil if @status_window
end
end
#==============================================================================
# ■ Window_EquipItem在项目窗口
#==============================================================================
class Window_EquipItem_Menu < Window_ItemList
attr_reader :status_window
attr_accessor :windows_index
#--------------------------------------------------------------------------
# ● Initialize初始化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
@actor = nil
@slot_id = 0
@windows_index = 0
self.visible = false
self.opacity = 0
end
#--------------------------------------------------------------------------
# ● Col Max最大标签
#--------------------------------------------------------------------------
def col_max
return 1
end
#--------------------------------------------------------------------------
# ● Actor角色
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
self.oy = 0
end
#--------------------------------------------------------------------------
# ● Setup安装程序
#--------------------------------------------------------------------------
def setup(actor,equip_type,index)
@actor = actor
@slot_id = equip_type
@windows_index = index
refresh
end
#--------------------------------------------------------------------------
# ● Slot ID槽号
#--------------------------------------------------------------------------
def slot_id=(slot_id)
end
#--------------------------------------------------------------------------
# ● Include?包括
#--------------------------------------------------------------------------
def include?(item)
return true if item == nil
return false unless item.is_a?(RPG::EquipItem)
return false if @slot_id < 0
return false if item.etype_id != @actor.equip_slots[@slot_id]
return @actor.equippable?(item)
end
#--------------------------------------------------------------------------
# ● Enable?使
#--------------------------------------------------------------------------
def enable?(item)
return true
end
#--------------------------------------------------------------------------
# ● Select Last选择最后一次
#--------------------------------------------------------------------------
def select_last
end
#--------------------------------------------------------------------------
# ● Status Window状态窗口
#--------------------------------------------------------------------------
def status_window=(status_window)
@status_window = status_window
call_update_help
end
#--------------------------------------------------------------------------
# ● Update Help更新的帮助
#--------------------------------------------------------------------------
def update_help
super
if @actor && @status_window
temp_actor = Marshal.load(Marshal.dump(@actor))
temp_actor.force_change_equip(@slot_id, item)
$game_temp.temp_actor_equip = temp_actor
end
end
#--------------------------------------------------------------------------
# ● Draw Item得出项目
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
if item
set_font_equip
rect = item_rect(index)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, enable?(item))
draw_item_number(rect, item)
end
end
#--------------------------------------------------------------------------
# ● Draw Item Number得出项目编号
#--------------------------------------------------------------------------
def draw_item_number(rect, item)
draw_text(rect, sprintf(": %2d", $game_party.item_number(item)), 2)
end
end
module MOG_EQUIP_STATUS
LAYOUT_POSITION = [0,80]
FACE_POSITION = [120,-45]
PAR_POSITION = [5,32]
NAME_POSITION = [15,-5]
FONT_NAME = "Georgia"
FONT_SIZE = 18
FONT_BOLD = true
end
#==============================================================================
# ■ Actor Menu Status角色状态菜单
#==============================================================================
class Actor_Equip_Status
include MOG_EQUIP_STATUS
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(actor)
@actor = actor
@actor_old = @actor
$game_temp.temp_actor_equip = nil
@old_temp_actor = $game_temp.temp_actor_equip
set_old_parameter
create_sprites
end
#--------------------------------------------------------------------------
# ● Create Sprites
#--------------------------------------------------------------------------
def create_sprites
@parameter_number = $game_temp.pre_cache_equip_menu[5]
@parameter_cw = @parameter_number.width / 11
@parameter_ch = @parameter_number.height / 3
create_layout
create_face
create_parameter
create_name
end
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
dispose_layout
dispose_face
dispose_parameter
dispose_name
end
#--------------------------------------------------------------------------
# ● Dispose Layout
#--------------------------------------------------------------------------
def dispose_layout
@layout.dispose
end
#--------------------------------------------------------------------------
# ● Dispose Face
#--------------------------------------------------------------------------
def dispose_face
@face.dispose
end
#--------------------------------------------------------------------------
# ● Dispose Parameter
#--------------------------------------------------------------------------
def dispose_parameter
@parameter.bitmap.dispose
@parameter.dispose
end
#--------------------------------------------------------------------------
# ● Dispose Name
#--------------------------------------------------------------------------
def dispose_name
@name.bitmap.dispose
@name.dispose
end
#--------------------------------------------------------------------------
# ● Create Layout
#--------------------------------------------------------------------------
def create_layout
@layout = Sprite.new
@layout.bitmap = $game_temp.pre_cache_equip_menu[4]
@org_pos = [LAYOUT_POSITION[0],LAYOUT_POSITION[1]]
@layout.x = @org_pos[0] - 150
@layout.y = @org_pos[1]
@layout.z = 10
@layout.opacity = 0
@slide_range = (@org_pos[0] - 150)
end
#--------------------------------------------------------------------------
# ● Create Parameter
#--------------------------------------------------------------------------
def create_parameter
@parameter = Sprite.new
@parameter.bitmap = Bitmap.new(@layout.bitmap.width,@layout.bitmap.height)
@org_pos_par = [@org_pos[0] + PAR_POSITION[0],
@org_pos[1] + PAR_POSITION[1]]
@parameter.x = @org_pos_par[0] - 150
@parameter.y = @org_pos_par[1]
@parameter.z = 11
@parameter.opacity = 0
refresh_parameter
end
#--------------------------------------------------------------------------
# ● Create Face
#--------------------------------------------------------------------------
def create_face
[url=home.php?mod=space&uid=84331]@face[/url] = Sprite.new
@org_pos_face = [@org_pos[0] + FACE_POSITION[0],
@org_pos[1] + FACE_POSITION[1]]
@face.x = @org_pos_face[0] - 150
@face.y = @org_pos_face[1]
@face.z = 11
@face.opacity = 0
refresh_face
end
#--------------------------------------------------------------------------
# ● Create Name
#--------------------------------------------------------------------------
def create_name
@name = Sprite.new
@name.bitmap = Bitmap.new(140,32)
@name.bitmap.font.name = FONT_NAME
@name.bitmap.font.size = FONT_SIZE
@name.bitmap.font.bold = FONT_BOLD
@org_pos_name = [@org_pos[0] + NAME_POSITION[0],
@org_pos[1] + NAME_POSITION[1]]
@name.x = @org_pos_name[0] - 150
@name.y = @org_pos_name[1]
@name.z = 11
@name.opacity = 0
refresh_name
end
#--------------------------------------------------------------------------
# ● Set Old Parameter
#--------------------------------------------------------------------------
def set_old_parameter
@par = [] if @par == nil
@par.clear
@par = [
@actor.param(0),@actor.param(1),@actor.param(2),@actor.param(3),
@actor.param(4),@actor.param(5),@actor.param(6),@actor.param(7),
@old_temp_actor
]
end
#--------------------------------------------------------------------------
# ● Can Refresh Parameter
#--------------------------------------------------------------------------
def can_refresh_parameter?
return true if @par[0] != @actor.param(0)
return true if @par[1] != @actor.param(1)
return true if @par[2] != @actor.param(2)
return true if @par[3] != @actor.param(3)
return true if @par[4] != @actor.param(4)
return true if @par[5] != @actor.param(5)
return true if @par[6] != @actor.param(6)
return true if @par[7] != @actor.param(7)
return true if @old_temp_actor != $game_temp.temp_actor_equip
return false
end
#--------------------------------------------------------------------------
# ● Refresh Name
#--------------------------------------------------------------------------
def refresh_name
@name.bitmap.clear
@name.bitmap.draw_text(0,0,140,32,@actor.name.to_s,0)
end
#--------------------------------------------------------------------------
# ● Create Face
#--------------------------------------------------------------------------
def refresh_parameter
set_old_parameter
@parameter.bitmap.clear
@old_temp_actor = $game_temp.temp_actor_equip
x = 180
for p in 0...8
y = 24 * p
refresh_number(@parameter,@parameter_number,p,@parameter_cw,@parameter_ch,x,y,0)
end
if $game_temp.temp_actor_equip != nil
x = 180 - (@parameter_cw * 7)
for p in 0...8
y = 24 * p
refresh_number(@parameter,@parameter_number,p,@parameter_cw,@parameter_ch,x,y,1)
end
end
end
#--------------------------------------------------------------------------
# ● Refresh Number
#--------------------------------------------------------------------------
def refresh_number(sprite,image,p,number_cw,number_ch,x,y,type)
value = @actor.param(p)
new_value = 0
ch = 0
if type == 1
if $game_temp.temp_actor_equip != nil
new_value = $game_temp.temp_actor_equip.param(p)
end
d_value = new_value - value
if d_value < 0
ch = 2
elsif d_value > 0
ch = 1
else
ch = 0
end
value = new_value
end
draw_arrow(sprite,image,number_cw,number_ch,x,y,ch)
draw_number(sprite,image,value,number_cw,number_ch,x,y,ch)
end
#--------------------------------------------------------------------------
# ● Draw Arrow
#--------------------------------------------------------------------------
def draw_arrow(sprite,image,number_cw,number_ch,x,y,ch)
nsrc_rect = Rect.new(number_cw * 10, number_ch * ch , number_cw , number_ch)
sprite.bitmap.blt(x + number_cw, y, image, nsrc_rect)
end
#--------------------------------------------------------------------------
# ● Draw Number
#--------------------------------------------------------------------------
def draw_number(sprite,image,value,number_cw,number_ch,x,y,ch)
number = value.truncate.abs.to_s.split(//)
x2 = -number_cw * number.size
for i in 0..number.size - 1
number_abs = number.to_i
nsrc_rect = Rect.new(number_cw * number_abs, number_ch * ch , number_cw , number_ch)
sprite.bitmap.blt(x + x2 + (number_cw * i), y, image, nsrc_rect)
end
end
#--------------------------------------------------------------------------
# ● Refresh Face
#--------------------------------------------------------------------------
def refresh_face
face_name = "Face" + @actor.id.to_s
@face.bitmap = Cache.menu(face_name.to_s)
end
#--------------------------------------------------------------------------
# ● Update Move
#--------------------------------------------------------------------------
def update_move
update_slide(0,@layout,@layout.x,@org_pos[0])
update_slide(1,@layout,@layout.y,@org_pos[1])
update_slide(0,@parameter,@parameter.x,@org_pos_par[0])
update_slide(1,@parameter,@parameter.y,@org_pos_par[1])
update_slide(0,@face,@face.x,@org_pos_face[0])
update_slide(1,@face,@face.y,@org_pos_face[1])
update_slide(0,@name,@name.x,@org_pos_name[0])
update_slide(1,@name,@name.y,@org_pos_name[1])
end
#--------------------------------------------------------------------------
# ● Update Slide
#--------------------------------------------------------------------------
def update_slide(type,sprite,cp,np)
sprite.opacity += 5
sp = 3 + ((cp - np).abs / 10)
if cp > np
cp -= sp
cp = np if cp < np
elsif cp < np
cp += sp
cp = np if cp > np
end
sprite.x = cp if type == 0
sprite.y = cp if type == 1
end
#--------------------------------------------------------------------------
# ● Refresh All
#--------------------------------------------------------------------------
def refresh_all(actor)
@actor = actor
refresh_parameter
refresh_face
refresh_name
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update(actor)
update_move
refresh_all(actor) if actor != @actor
refresh_parameter if can_refresh_parameter?
end
end
#==============================================================================
# ■ Scene_Equip现场装备1
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# ● Create Sprites
#--------------------------------------------------------------------------
def create_sprites
create_menu_background
create_layout
create_particles
create_help_window
create_status_window
create_command_window
create_slot_window
create_item_window
create_actor_status
set_sprite_position
end
#--------------------------------------------------------------------------
# ● Set Sprite Position设定精灵的位置
#--------------------------------------------------------------------------
def set_sprite_position
@status_window.opacity = 0
@command_window.opacity = 0
@slot_window.opacity = 0
@help_window.opacity = 0
@status_window.contents_opacity = 0
@command_window.contents_opacity = 0
@slot_window.contents_opacity = 0
@help_window.contents_opacity = 0
@layout2.opacity = 0
@layout3.opacity = 0
@layout4.opacity = 0
@org_pos_help = [@help_window.x,@help_window.y]
@help_window.x = @org_pos_help[0]
@help_window.y = @org_pos_help[1] + 150
@org_pos_com = [@command_window.x,@command_window.y]
@command_window.x = @org_pos_com[0]
@command_window.y = @org_pos_com[1] - 150
@org_pos_slot = [@slot_window.x,@slot_window.y]
@slot_window.x = @org_pos_slot[0] + 150
@slot_window.y = @org_pos_slot[1]
@layout2.y = -150
@layout3.x = 150
@layout4.y = 150
end
#--------------------------------------------------------------------------
# ● Create Actor Status创建的演员的地位
#--------------------------------------------------------------------------
def create_actor_status
@actor_status = Actor_Equip_Status.new(@actor)
end
#--------------------------------------------------------------------------
# ● Create Menu Background创建菜单背景
#--------------------------------------------------------------------------
def create_menu_background
@background = Plane.new
@background.bitmap = $game_temp.pre_cache_equip_menu[0]
@background.z = 0
@background_scroll = [BACKGROUND_SCROLL_SPEED[0],BACKGROUND_SCROLL_SPEED[1]]
end
#--------------------------------------------------------------------------
# ● Create Layout创建布局
#--------------------------------------------------------------------------
def create_layout
@layout2 = Sprite.new
@layout2.bitmap = $game_temp.pre_cache_equip_menu[1]
@layout2.z = 3
@layout3 = Sprite.new
@layout3.bitmap = $game_temp.pre_cache_equip_menu[2]
@layout3.z = 3
@layout4 = Sprite.new
@layout4.bitmap = $game_temp.pre_cache_equip_menu[3]
@layout4.z = 3
end
#--------------------------------------------------------------------------
# ● Create Particles创建粒子
#--------------------------------------------------------------------------
def create_particles
@particles_sprite =[]
for i in 0...NUMBER_OF_PARTICLES
@particles_sprite.push(Particles_Menu.new(nil))
end
end
#--------------------------------------------------------------------------
# ● Create Help Window创建帮助窗口
#--------------------------------------------------------------------------
def create_help_window
@help_window = Window_Help.new
@help_window.x = 0
@help_window.y = Graphics.height - @help_window.height
@help_window.set_font_equip
end
#--------------------------------------------------------------------------
# ● Create Status Window创建状态窗口
#--------------------------------------------------------------------------
def create_status_window
@status_window = Window_EquipStatus.new(0, @help_window.height)
@status_window.viewport = @viewport
@status_window.actor = @actor
@status_window.y = 48
end
#--------------------------------------------------------------------------
# ● Create Command Window创建命令窗口
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_EquipCommand.new(208, 0, 336)
@command_window.help_window = @help_window
@command_window.set_handler(:equip, method(:command_equip))
@command_window.set_handler(:optimize, method(:command_optimize))
@command_window.set_handler(:clear, method(:command_clear))
@command_window.set_handler(:cancel, method(:return_scene))
@command_window.set_handler(:pagedown, method(:next_actor))
@command_window.set_handler(:pageup, method(:prev_actor))
end
#--------------------------------------------------------------------------
# ● Create Slot Window创建窗口内
#--------------------------------------------------------------------------
def create_slot_window
wx = @status_window.width
wy = @command_window.y + @command_window.height + 5
ww = Graphics.width - @status_window.width
@slot_window = Window_EquipSlot.new(wx, wy, ww)
@slot_window.help_window = @help_window
@slot_window.status_window = @status_window
@slot_window.actor = @actor
@slot_window.set_handler(:ok, method(:on_slot_ok))
@slot_window.set_handler(:cancel, method(:on_slot_cancel))
@slot_window.set_handler(:pagedown, method(:next_actor))
@slot_window.set_handler(:pageup, method(:prev_actor))
end
#--------------------------------------------------------------------------
# ● Create Item Window创建项目窗口
#--------------------------------------------------------------------------
def create_item_window
@equip_window = []
index = 0
window_max = 5
for item in 0...window_max
wx = @slot_window.x
wy = @slot_window.y + @slot_window.height + 5
ww = @slot_window.width
wh = @slot_window.height
@equip_window.push(Window_EquipItem_Menu.new(wx, wy, ww, wh))
@equip_window[item].setup(@actor,item, index)
@equip_window[item].visible = false
@equip_window[item].help_window = @help_window
@equip_window[item].status_window = @status_window
@equip_window[item].actor = @actor
@equip_window[item].set_handler(:ok, method(:on_item_ok))
@equip_window[item].set_handler(:cancel, method(:on_item_cancel))
@equip_window[item].opacity = 0
@org_pos_equip = [@equip_window[item].x,@equip_window[item].y]
index += 1
end
end
end
#==============================================================================
# ■ Scene_Equip现场装备2
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# ● Execute Dispose
#--------------------------------------------------------------------------
def execute_dispose
Graphics.freeze
dispose_background
dispose_layout
dispose_particles
dispose_window
dispose_actor_status
end
#--------------------------------------------------------------------------
# ● Dispose Background
#--------------------------------------------------------------------------
def dispose_background
return if @background == nil
@background.dispose
@background = nil
end
#--------------------------------------------------------------------------
# ● Dispose Layout
#--------------------------------------------------------------------------
def dispose_layout
return if @layout2 == nil
@layout2.dispose
@layout3.dispose
@layout4.dispose
@layout2 = nil
end
#--------------------------------------------------------------------------
# ● Dispose Particles
#--------------------------------------------------------------------------
def dispose_particles
return if @particles_sprite == nil
@particles_sprite.each {|sprite| sprite.dispose }
end
#--------------------------------------------------------------------------
# ● Dispose Window
#--------------------------------------------------------------------------
def dispose_window
@status_window.dispose
@command_window.dispose
@slot_window.dispose
@equip_window.each {|sprite| sprite.dispose }
@help_window.dispose
end
#--------------------------------------------------------------------------
# ● Dispose Actor Status
#--------------------------------------------------------------------------
def dispose_actor_status
return if @actor_status == nil
@actor_status.dispose
end
end
#==============================================================================
# ■ Scene_Equip现场装备3
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# ● Update Sprites
#--------------------------------------------------------------------------
def update_sprites
update_actor_status
update_background
update_particles
update_window
update_move
end
#--------------------------------------------------------------------------
# ● Update Move
#--------------------------------------------------------------------------
def update_move
update_slide(0,@command_window,@org_pos_com[0],0)
update_slide(1,@command_window,@org_pos_com[1],0)
update_slide(0,@help_window,@org_pos_help[0],0)
update_slide(1,@help_window,@org_pos_help[1],0)
update_slide(0,@slot_window,@org_pos_slot[0],0)
update_slide(1,@slot_window,@org_pos_slot[1],0)
update_slide(0,@layout2,0,1)
update_slide(1,@layout2,0,1)
update_slide(0,@layout3,0,1)
update_slide(1,@layout3,0,1)
update_slide(0,@layout4,0,1)
update_slide(1,@layout4,0,1)
end
#--------------------------------------------------------------------------
# ● Update Slide
#--------------------------------------------------------------------------
def update_slide(type,sprite,np,op_type)
if op_type == 0
sprite.contents_opacity += 5
else
sprite.opacity += 5
end
cp = type == 0 ? sprite.x : sprite.y
sp = 3 + ((cp - np).abs / 10)
if cp > np
cp -= sp
cp = np if cp < np
elsif cp < np
cp += sp
cp = np if cp > np
end
sprite.x = cp if type == 0
sprite.y = cp if type == 1
end
#--------------------------------------------------------------------------
# ● Update Actor Status
#--------------------------------------------------------------------------
def update_actor_status
return if @actor_status == nil
@actor_status.update(@actor)
end
#--------------------------------------------------------------------------
# ● Update Background
#--------------------------------------------------------------------------
def update_background
return if @background == nil
@background.ox += @background_scroll[0]
@background.oy += @background_scroll[1]
end
#--------------------------------------------------------------------------
# ● Update Particles
#--------------------------------------------------------------------------
def update_particles
return if @particles_sprite == nil
@particles_sprite.each {|sprite| sprite.update }
end
#--------------------------------------------------------------------------
# ● Update Window
#--------------------------------------------------------------------------
def update_window
@status_window.update
@command_window.update
@slot_window.update
for equip in @equip_window
update_slide(0,equip,@org_pos_equip[0],0)
update_slide(1,equip,@org_pos_equip[1],0)
if equip.windows_index == @slot_window.index
equip.visible = true
equip.update
else
equip.visible = false
end
end
end
end
#==============================================================================
# ■ Scene_Equip现场装备4
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
update_sprites
update_command
end
#--------------------------------------------------------------------------
# ● Command Equip
#--------------------------------------------------------------------------
def command_equip
@slot_window.activate
@slot_window.select(0)
end
#--------------------------------------------------------------------------
# ● Command Optimize指令优化
#--------------------------------------------------------------------------
def command_optimize
Sound.play_equip
@actor.optimize_equipments
@status_window.refresh
@slot_window.refresh
@command_window.activate
end
#--------------------------------------------------------------------------
# ● Command Clear命令清除
#--------------------------------------------------------------------------
def command_clear
Sound.play_equip
@actor.clear_equipments
@status_window.refresh
@slot_window.refresh
@command_window.activate
end
#--------------------------------------------------------------------------
# ● On Slot OK
#--------------------------------------------------------------------------
def on_slot_ok
@equip_window[@slot_window.index].activate
@equip_window[@slot_window.index].select(0)
end
#--------------------------------------------------------------------------
# ● On Slot Cancel
#--------------------------------------------------------------------------
def on_slot_cancel
@slot_window.unselect
@command_window.activate
end
#--------------------------------------------------------------------------
# ● On Item OK
#--------------------------------------------------------------------------
def on_item_ok
Sound.play_equip
@actor.change_equip(@slot_window.index, @equip_window[@slot_window.index].item)
@slot_window.activate
@slot_window.refresh
@equip_window[@slot_window.index].unselect
@equip_window[@slot_window.index].refresh
end
#--------------------------------------------------------------------------
# ● On Item Cancel
#--------------------------------------------------------------------------
def on_item_cancel
@slot_window.activate
@equip_window[@slot_window.index].unselect
end
#--------------------------------------------------------------------------
# ● Return Scene
#--------------------------------------------------------------------------
def return_scene
Sound.play_cancel
SceneManager.return
end
#--------------------------------------------------------------------------
# ● ON Actor Charge
#--------------------------------------------------------------------------
def on_actor_change
$game_temp.actor_menu_temp = @actor
SceneManager.goto(Scene_Equip)
end
end
#==============================================================================
# ■ Scene_Equip现场装备5
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# ● Update Command
#--------------------------------------------------------------------------
def update_command
end
end