#encoding:utf-8
#==============================================================================
# ■ Scene_Item
#------------------------------------------------------------------------------
# 物品画面
#==============================================================================
class Scene_Item < Scene_ItemBase
#--------------------------------------------------------------------------
# ● 开始处理
#--------------------------------------------------------------------------
alias scene_item_start_lx start
def start #更新了
if $game_switches[1] == true
super
create_help_window
create_category1_window
create_item1_window
else
scene_item_start_lx
end
end
#--------------------------------------------------------------------------
# ● 生成分类窗口
#--------------------------------------------------------------------------
def create_category1_window #新的分类
@category_window = Window_ItemCategory.new
@category_window.viewport = @viewport
@category_window.help_window = @help_window
@category_window.y = @help_window.height
@category_window.set_handler(:ok, method(:on_category1_ok))
@category_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# ● 生成物品窗口
#--------------------------------------------------------------------------
def create_item1_window #新的物品
wy = @category_window.y + @category_window.height
wh = Graphics.height - wy
@item_window = Window_ItemList.new(0, wy, Graphics.width, wh)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.set_handler(:ok, method(:on_item1_ok))
@item_window.set_handler(:cancel, method(:on_item1_cancel))
@category_window.item_window = @item_window
end
def on_category1_ok #新的分类“确定”
@item_window.activate
@item_window.select_last
end
def on_item1_ok #新的物品“确定”
$game_party.last_item.object = item
determine_item
end
def on_item1_cancel #新的物品“取消”
@item_window.unselect
@category_window.activate
end
end
class Window_ItemList < Window_Selectable
alias enable_hc? enable?
def enable?(item) #1号开关打开时所有装备都可以使用
if $game_switches[1] == true
return true
else
enable_hc?(item)
end
end
end
class Scene_ItemBase < Scene_MenuBase
alias determine_item_hc determine_item
def determine_item #确定物品
if $game_switches[1] == true
if item.note =~ /<合成 (\d+)>/
$game_variables[3] += $1.to_i
end
p item
if item.is_a?(RPG::item) #道具判定
SceneManager.goto(Scene_Map);$game_temp.reserve_common_event(2);end
if item.is_a?(RPG::weapon) #武器判定
SceneManager.goto(Scene_Map);$game_temp.reserve_common_event(3);end
if item.is_a?(RPG::Armor) #防具判定
SceneManager.goto(Scene_Map);$game_temp.reserve_common_event(4);end
else
determine_item_hc
end
end
end