赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 3 |
经验 | 3788 |
最后登录 | 2023-9-11 |
在线时间 | 85 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 316
- 在线时间
- 85 小时
- 注册时间
- 2012-4-13
- 帖子
- 39
|
3楼
楼主 |
发表于 2014-11-2 00:59:36
|
只看该作者
- ==============================================================================
- # ■ Survival Engine's Scene_Menu
- #------------------------------------------------------------------------------
- # サバイバルホラー風のメニュースクリプトです
- #==============================================================================
- class Scene_Menu < Scene_Base
-
- ###################################################################
-
- CMENU_S1 = "档案"
- CMENU_S2 = "使用"
- CMENU_S3 = "装备"
- CMENU_S4 = "合成"
- CMENU_S5 = "排列/丢弃"
- CMENU_S6 = "状态"
- CMENU_S8 = "保存"
- CMENU_S9 = "退出"
-
- CMENU_COM1 = "浏览目前为止登记的档案"
- CMENU_COM2 = "使用背包里的物品"
- CMENU_COM3 = "装备背包里的物品"
- CMENU_COM4 = "组合背包里的物品"
- CMENU_COM5 = "对背包的物品进行排列/丢弃"
- CMENU_COM6 = "确认目前所引发的症状"
-
- CMENU_COM8 = "保存进度"
- CMENU_COM9 = "结束游戏"
- ###################################################################
- #--------------------------------------------------------------------------
- # ● 初期化処理
- #--------------------------------------------------------------------------
- def initialize(dind = 0, aflg = false)
- @animflg = aflg
- @defind = dind
- end
- #--------------------------------------------------------------------------
- # ● 初期openness処理
- #--------------------------------------------------------------------------
- def get_openness
- if ( @animflg == false )
- return 0
- else
- return 255
- end
- end
- #--------------------------------------------------------------------------
- # ● 開始処理
- #--------------------------------------------------------------------------
- def start
- create_menu_background
- @info_window = Window_Help.new()
- @info_window.openness = get_openness
- @info_window.open
- create_mainmenu_window
- @mainmenu_window.openness = get_openness
- @mainmenu_window.open
- create_itemmenu_window
- @itemmenu_window.openness = get_openness
- @itemmenu_window.open
- @menumode = 0
- @getval_message_window = -1
- @selecting_message_window = false
- create_status_window
-
- @window_oppoint = [0, -3, -6, -9, -12, -15, -18]
- end
- #--------------------------------------------------------------------------
- # ● 終了処理
- #--------------------------------------------------------------------------
- def terminate
- dispose_menu_background
- @mainmenu_window.dispose
- @itemmenu_window.dispose
- @info_window.dispose
- dispose_status_window
- end
- #--------------------------------------------------------------------------
- # ● 背景作成
- #--------------------------------------------------------------------------
- def create_menu_background
- super
- end
- #--------------------------------------------------------------------------
- # ● メインメニューウィンドウ作成
- #--------------------------------------------------------------------------
- def create_mainmenu_window
- @mainmenucolumn = [0, 0]
- @mainmenucolumn_description = [CMENU_COM1, CMENU_COM2, CMENU_COM3, CMENU_COM4, CMENU_COM5, CMENU_COM6, CMENU_COM8, CMENU_COM9]
- @mainmenu_window = Window_Command.new(140, [CMENU_S1, CMENU_S2, CMENU_S3, CMENU_S4, CMENU_S5, CMENU_S6, CMENU_S8, CMENU_S9], 1, 0, 32, 1)
- @mainmenu_window.height = 416 - @info_window.height - 132
- @mainmenu_window.x = 0
- @mainmenu_window.y = @info_window.height
- @mainmenu_window.index = @defind
- if $game_system.save_disabled # セーブ禁止の場合
- @mainmenu_window.draw_item(6, false) # セーブを無効化
- end
- end
- #--------------------------------------------------------------------------
- # ● アイテムウィンドウ作成
- #--------------------------------------------------------------------------
- def create_itemmenu_window
- itemmenucolumn_name = [0, 0]
- for i in 0..$se_gs.get_item_capacity - 1
- itemmenucolumn_name[i] = $se_gs.get_item(i, "name")
- end
- @itemmenu_window = Window_Command.new(544 - @mainmenu_window.width, itemmenucolumn_name, 2, 0, 32)
- @itemmenu_window.x = @mainmenu_window.width
- @itemmenu_window.y = @info_window.height
- @itemmenu_window.index = -1
- @itemmenu_window.height = @mainmenu_window.height
- end
- #--------------------------------------------------------------------------
- # ● アイテムウィンドウ再絵画
- #--------------------------------------------------------------------------
- def redraw_itemmenu_window
- tempindex = @itemmenu_window.index
- itemmenucolumn_name = [0, 0]
- for i in 0..$se_gs.get_item_capacity - 1
- itemmenucolumn_name[i] = $se_gs.get_item(i, "name")
- end
- @itemmenu_window.redraw(itemmenucolumn_name)
- disabling_unselectable_item
- end
- #--------------------------------------------------------------------------
- # ● ステータスウィンドウ作成
- #--------------------------------------------------------------------------
- def create_status_window
- @hp_window = Window_Base.new(544 - 132 - 99, 416 - 132, 132, 132)
- @hp_window.openness = get_openness
- @hp_window.open
- @stamina_window = Window_Base.new(544 - 132 - 132 - 99, 416 - 132, 132, 132)
- @stamina_window.openness = get_openness
- @stamina_window.open
- @profile_window = Window_Base.new(0, 416 - 132, 544 - 132 - 132 - 99, 132)
- @profile_window.openness = get_openness
- @profile_window.open
- @status_window = Window_Command.new(99, $se_gs.get_visible_state_list("name"), 1, 0, 32, 1)
- @status_window.x = 544 - 99
- @status_window.y = @itemmenu_window.y + @itemmenu_window.height
- @status_window.height = 416 - @info_window.height - @itemmenu_window.height
- @status_window.openness = get_openness
- @status_window.open
- @status_window.index = -1
-
- redraw_status_window
- end
- #--------------------------------------------------------------------------
- # ● ステータスウィンドウ開放
- #--------------------------------------------------------------------------
- def dispose_status_window
- @hp_window.dispose
- @stamina_window.dispose
- @profile_window.dispose
- @status_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● ステータスウィンドウ再絵画
- #--------------------------------------------------------------------------
- def redraw_status_window
- @hp_window.contents.clear
- hpper = $se_gs.get_state_hp * 100 / $se_gs.get_state_hpmax
- if 80 < hpper
- hpbmp = Cache.picture("life_fine")
- elsif 60 < hpper
- hpbmp = Cache.picture("life_good")
- elsif 40 < hpper
- hpbmp = Cache.picture("life_passable")
- elsif 20 < hpper
- hpbmp = Cache.picture("life_bad")
- else
- hpbmp = Cache.picture("life_danger")
- end
- rect = Rect.new(0, 0, hpbmp.width, hpbmp.height )
- @hp_window.contents.blt(0, 0, hpbmp, rect)
- @hp_window.contents.draw_text(0, 0, 100, 24 , "LIFE")
- if $game_switches[1] == true
- @hp_window.contents.draw_text(0, 100 - 24, 100, 24, sprintf("%d/%d", $se_gs.get_state_hp, $se_gs.get_state_hpmax), 2)
- end
-
- @stamina_window.contents.clear
- staminaper = $se_gs.get_state_stamina * 100 / $se_gs.get_state_staminamax
- if 80 < staminaper
- staminabmp = Cache.picture("stamina_fine")
- elsif 60 < staminaper
- staminabmp = Cache.picture("stamina_good")
- elsif 40 < staminaper
- staminabmp = Cache.picture("stamina_passable")
- elsif 20 < staminaper
- staminabmp = Cache.picture("stamina_bad")
- else
- staminabmp = Cache.picture("stamina_danger")
- end
- rect = Rect.new(0, 0, staminabmp.width, staminabmp.height )
- @stamina_window.contents.blt(0, 0, staminabmp, rect)
- @stamina_window.contents.draw_text(0, 0, 100, 24 , "STAMINA")
- if $game_switches[1] == true
- @stamina_window.contents.draw_text(0, 100 - 24, 100, 24, sprintf("%d/%d", $se_gs.get_state_stamina, $se_gs.get_state_staminamax), 2)
- end
-
- @profile_window.contents.clear
- @profile_window.contents.draw_text(0, 0, @profile_window.width - 32, 24, "P.N:" + $game_actors[1].name, 0)
- @profile_window.contents.draw_text(0, 24, 200, 24, "第" + $se_gs.get_time_day.to_s + "天", 0)
- @profile_window.contents.draw_text(0, 48, 200, 24, $se_gs.get_time_hou.to_s + ":" + $se_gs.get_time_min.to_s + ":" + $se_gs.get_time_sec.to_s, 0)
-
- equipname = $se_gs.get_equip.name
-
- @profile_window.contents.draw_text(0, @profile_window.height - 32 - 24, @profile_window.width - 32, 24, "EQ[" + equipname + "]", 0)
-
- @status_window.contents.clear
- @status_window.redraw($se_gs.get_visible_state_list("name"))
- @status_window.index = -1
- end
- #--------------------------------------------------------------------------
- # ● 更新処理
- #--------------------------------------------------------------------------
- def update
- super
- returnflg = false
- if ( @mainmenu_window.opening? )
- if ( @window_oppoint[0] >= 0 )
- @mainmenu_window.update
- else
- @window_oppoint[0] += 1
- end
- returnflg = true
- end
- if ( @itemmenu_window.opening? )
- if ( @window_oppoint[1] >= 0 )
- @itemmenu_window.update
- else
- @window_oppoint[1] += 1
- end
- returnflg = true
- end
- if ( @info_window.opening? )
- if ( @window_oppoint[2] >= 0 )
- @info_window.update
- else
- @window_oppoint[2] += 1
- end
- returnflg = true
- end
- if ( @hp_window.opening? )
- if ( @window_oppoint[3] >= 0 )
- @hp_window.update
- else
- @window_oppoint[3] += 1
- end
- returnflg = true
- end
- if ( @stamina_window.opening? )
- if ( @window_oppoint[4] >= 0 )
- @stamina_window.update
- else
- @window_oppoint[4] += 1
- end
- returnflg = true
- end
- if ( @profile_window.opening? )
- if ( @window_oppoint[5] >= 0 )
- @profile_window.update
- else
- @window_oppoint[5] += 1
- end
- returnflg = true
- end
- if ( @status_window.opening? )
- if ( @window_oppoint[6] >= 0 )
- @status_window.update
- else
- @window_oppoint[6] += 1
- end
- returnflg = true
- end
-
- if ( returnflg == true )
- return
- end
-
-
- if ( @selecting_message_window == true )
- @message_window.update
- @getval_message_window = @message_window.get_retval
- if ( @getval_message_window != -1 )
- dispose_message_window
- end
- else
- case @menumode
- when 0 #メインメニュー選択状態の場合
- @mainmenu_window.update
- update_mainmenu_selection
- when 1, 2, 3, 4 #アイテムメニュー選択状態の場合
- update_item_selection
- when 5
- @status_window.update
- update_state_selection
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● メニュー選択処理
- #--------------------------------------------------------------------------
- def update_mainmenu_selection
- #ヘルプウィンドウを更新する
- @info_window.set_text(@mainmenucolumn_description[@mainmenu_window.index])
- #決定、キャンセルの処理
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- Sound.play_decision
- case @mainmenu_window.index
- when 0 # RESUME
- $scene = Scene_Menu_Files.new
- when 1,2,3,4 # USE,EQUIP,COMBINE,SORT/DISPOSE
- start_item_selection
- when 5
- start_state_selection
- #~ when 6 # OPTION
- #~ start_option
- when 6 # SAVE
- if ( $game_system.save_disabled ) #セーブ禁止の場合
- Sound.play_buzzer
- else
- $scene = Scene_File.new(true, false, false)
- end
- when 7 # QUIT
- $scene = Scene_End.new
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● アイテム選択開始処理
- #--------------------------------------------------------------------------
- def start_item_selection
- @menumode = @mainmenu_window.index
- @itemmenu_window.index = 0
- @mainmenu_window.index = -1
- case @menumode
- when 1, 2 #USE,EQUIP
- #Nothing
- when 3, 4 #COMBINE,SORT/DISPOSE
- create_seconditemmenu_window
- end
- @itemselect_phase = 0
- disabling_unselectable_item
- end
- #--------------------------------------------------------------------------
- # ● 選択不可能のアイテム名を半透明化させる
- #--------------------------------------------------------------------------
- def disabling_unselectable_item
- @itemmenucolumn_selectable = [0, 0]
- for i in 0..$se_gs.get_item_capacity - 1
- disablefragg = false
- #アイテム選択を開始した時のメインメニューのインデックスで半透明化を判断
- case @menumode
- when 1 #USE
- if /<使用可能>/ === $se_gs.get_item(i, "note")
- disablefragg = false
- else
- disablefragg = true
- end
- when 2 #EQUIP
- if /<装備可能>/ === $se_gs.get_item(i, "note") or ( $se_gs.get_equip.id != 0 and $se_gs.get_item(i, "id" ) == 0 )
- disablefragg = false
- else
- disablefragg = true
- end
- when 3 #COMBINE
- if ( $se_gs.get_item(i, "id") == 0 )
- disablefragg = true
- else
- disablefragg = false
- end
- when 4 #SORT/DISPOSE
- disablefragg = false
- end
- #絵画&フラグ設定
- if ( disablefragg == true )
- @itemmenu_window.draw_item(i, false)
- @itemmenucolumn_selectable[i] = false
- else
- @itemmenucolumn_selectable[i] = true
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 全アイテムの透明を解除する
- #--------------------------------------------------------------------------
- def enabling_all_items
- for i in 0..$se_gs.get_item_capacity - 1
- @itemmenu_window.draw_item(i, true)
- end
- end
- #--------------------------------------------------------------------------
- # ● アイテム更新処理
- #--------------------------------------------------------------------------
- def update_item_selection
- if ( @getval_message_window != -1 )
- process_item_action
- @getval_message_window = -1
- @itemselect_phase = 0
- return
- end
-
- if ( @itemselect_phase == 1 )
- @seconditemmenu_window.update
- else
- @itemmenu_window.update
- end
- #ヘルプウィンドウを更新する
- if ( @itemselect_phase == 0 )
- @info_window.set_text($se_gs.get_item(@itemmenu_window.index, "description"))
- elsif ( @itemselect_phase == 1 )
- @info_window.set_text($se_gs.get_item(@seconditemmenu_window.index, "description"))
- end
-
- #決定、キャンセルの処理
- if Input.trigger?(Input::B) #キャンセルの場合
- Sound.play_cancel
- if ( @itemselect_phase == 0 ) #第一アイテム選択時
- start_mainmenu_selection
- elsif ( @itemselect_phase == 1 ) #第二アイテム選択時
- @itemmenu_window.index = @seconditemmenu_window.index
- @seconditemmenu_window.index = -1
- @itemmenu_window.active = true
- @itemselect_phase = 0
- end
- elsif Input.trigger?(Input::C) #決定の場合
- Sound.play_decision
- case @menumode
- when 1, 2 #USE,EQUIPの場合
- process_item_select
- when 3, 4 #CONBINE,SORT/DISPOSEの場合
- if ( @itemselect_phase == 0 )
- if ( @itemmenucolumn_selectable[@itemmenu_window.index] == true )
- @itemmenu_window.active = false
- @seconditemmenu_window.index = @itemmenu_window.index
- @itemselect_phase = 1
- else
- Sound.play_buzzer
- end
- elsif ( @itemselect_phase == 1 )
- if ( @itemmenucolumn_selectable[@seconditemmenu_window.index] == true )
- process_item_select
- @itemmenu_window.index = @seconditemmenu_window.index
- @seconditemmenu_window.index = -1
- @itemmenu_window.active = true
- @itemselect_phase = 0
- else
- Sound.play_buzzer
- end
- end
- end
- end
-
- end
- #--------------------------------------------------------------------------
- # ● アイテム選択終了処理
- #--------------------------------------------------------------------------
- def start_mainmenu_selection
- @mainmenu_window.index = @menumode
- @menumode = 0
- @itemmenu_window.index = -1
- case @menumode
- when 1, 2 #USE,EQUIP
- #Nothing
- when 3, 4 #COMBINE,SORT/DISPOSE
- @seconditemmenu_window.dispose
- end
- enabling_all_items
- end
- #--------------------------------------------------------------------------
- # ● 第二アイテム選択用のウィンドウを作成
- #--------------------------------------------------------------------------
- def create_seconditemmenu_window
- menucolumn_name = [0, 0]
- for i in 0..$se_gs.get_item_capacity - 1
- menucolumn_name[i] = ""
- end
- @seconditemmenu_window = Window_Command.new(@itemmenu_window.width, menucolumn_name, 2, 0, 32)
- @seconditemmenu_window.x = @mainmenu_window.width
- @seconditemmenu_window.y = @info_window.height
- @seconditemmenu_window.opacity = 0
- @seconditemmenu_window.index = -1
- end
- #--------------------------------------------------------------------------
- # ● アイテム選択完了時の処理を実行
- #--------------------------------------------------------------------------
- def process_item_select
- #選択不能アイテムを選択した時に処理を終了する
- returnflg = false
- case @menumode
- when 1, 2 #USE,EQUIP
- if ( @itemmenucolumn_selectable[@itemmenu_window.index] == false )
- returnflg = true
- end
- when 3, 4 #COMBINE,SORT/DISPOSE
- if ( @itemselect_phase == 0 )
- if ( @itemmenucolumn_selectable[@itemmenu_window.index] == false )
- returnflg = true
- end
- elsif ( @itemselect_phase == 1 )
- if ( @itemmenucolumn_selectable[@seconditemmenu_window.index] == false )
- returnflg = true
- end
- end
- end
- if ( returnflg == true )
- Sound.play_buzzer
- return
- end
-
- #ここから
- case @menumode
- when 1 #USE
- @getval_message_window = 1
- when 2 #EQUIP
- $se_gs.set_equip_equiping(@itemmenu_window.index)
- $se_gs.gd_equip_activate = false
- Audio.se_play("Audio/SE/Equip", 80, 100)
- redraw_status_window
- redraw_itemmenu_window
- when 3 #COMBINE
- #同じアイテムを選択したらエラー
- if ( @itemmenu_window.index == @seconditemmenu_window.index )
- Sound.play_buzzer
- create_message_window("选择了相同的物品", "okonly")
- else
- #合成できるかどうかの判定
- combineflg = false
- combinedid = 0
- dcombinedid = 0
-
-
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成1 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成1 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成2 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成2 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成3 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成3 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成4 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成4 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成5 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成5 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成6 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成6 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成7 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成7 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成8 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成8 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成9 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成9 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成10 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成10 (\d+),(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = true
- combinedid = $2.to_i
- end
- end
-
-
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成1 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成1 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成2 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成2 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成3 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成3 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成4 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成4 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成5 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成5 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成6 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成6 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成7 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成7 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成8 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成8 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成9 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成9 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@itemmenu_window.index, "note")
- if /<合成10 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@seconditemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
- nt = $se_gs.get_item(@seconditemmenu_window.index, "note")
- if /<合成10 (\d+),(\d+)and(\d+)>/ =~ nt
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == $1.to_i )
- combineflg = "double"
- combinedid = $2.to_i
- dcombinedid = $3.to_i
- end
- end
-
-
-
- if ( combineflg == "double" )
- Sound.play_use_skill
- $se_gs.set_item(@seconditemmenu_window.index, combinedid)
- $se_gs.set_item(@itemmenu_window.index, dcombinedid)
- create_message_window("[" + $data_items[combinedid].name + "]、[" + $data_items[dcombinedid].name + "]が完成しました", "okonly")
- elsif ( combineflg == true )
- Sound.play_use_skill
- $se_gs.set_item(@seconditemmenu_window.index, combinedid)
- $se_gs.set_item(@itemmenu_window.index, 0)
- create_message_window("[" + $data_items[combinedid].name + "]已合成完毕", "okonly")
- else
- Sound.play_buzzer
- create_message_window("无法进行组合", "okonly")
- end
-
-
- end
- when 4 #SORT/DISPOSE
- #同じアイテムを二度選択したら捨てるコマンド、それ以外なら並べ替え
- if ( @itemmenu_window.index == @seconditemmenu_window.index )
- if ( $se_gs.get_item(@itemmenu_window.index, "id") == 0 )
- #処理なし
- else
- if /<破棄許可/ === $se_gs.get_item(@itemmenu_window.index, "note")
- /<破棄許可 (\d+)>/ =~ $se_gs.get_item(@itemmenu_window.index, "note")
- getval = $1
- getval = getval.to_i
- if ( $game_switches[getval] == true )
- create_message_window("[" + $se_gs.get_item(@itemmenu_window.index, "name") + "]将被丢弃,可以吗?", "okcancel")
- else
- Sound.play_buzzer
- create_message_window("现阶段作为重要的物品而无法丢弃", "okonly")
- end
- else
- create_message_window("[" + $se_gs.get_item(@itemmenu_window.index, "name") + "]将被丢弃,可以吗?", "okcancel")
- end
- end
- else
- $se_gs.change_item(@itemmenu_window.index, @seconditemmenu_window.index )
- redraw_itemmenu_window
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 実際にアイテムへのアクションを実行する処理
- #--------------------------------------------------------------------------
- def process_item_action
- case @menumode
- when 1 #USE
- if ( @getval_message_window == 1 )#OKを選択した場合
- nt = $se_gs.get_item( @itemmenu_window.index, "note" )
- appedret = $se_gs.application_note(nt, "mustlive")
- if ( $se_gs.get_item(@itemmenu_window.index, "all").delete_one == true )
- if /<使用変化 (\d+)>/ =~ nt
- nxtget = $1.to_i
- else
- nxtget = 0
- end
- $se_gs.set_item( @itemmenu_window.index, nxtget )
- end
- Sound.play_use_item
- redraw_itemmenu_window
- redraw_status_window
- if ( appedret == "menuend" )
- $scene = Scene_Map.new
- end
- end
- when 2 #EQUIP
- #アイテムを装備する処理(ここでは必要ない)
- when 3 #COMBINE
- #アイテムを合成する処理
- #合成等の処理はここではおこなわれない。ここではウィンドウ更新のみ
- redraw_itemmenu_window
- when 4 #SORT/DISPOSE
- #アイテムを破棄する処理
- #入れ替えの場合(異なる二つのアイテムを選択した場合)はこの処理は実行されない
- if ( @getval_message_window == 1 ) #OKを選択した場合
-
- nt = $se_gs.get_item( @itemmenu_window.index, "note" )
- nxtget = 0
- if /<破棄時使用変化連動>/ =~ nt
- if /<使用変化 (\d+)>/ =~ nt
- nxtget = $1.to_i
- end
- end
- $se_gs.set_item( @itemmenu_window.index, nxtget )
- Audio.se_play("Audio/SE/Key", 80, 50)
- redraw_itemmenu_window
- end
- end
-
- end
- #--------------------------------------------------------------------------
- # ● 簡易メッセージウィンドウを作成する
- #--------------------------------------------------------------------------
- def create_message_window(message, type)
- @message_window = Window_Msg.new(message, type)
- @selecting_message_window = true
- end
- #--------------------------------------------------------------------------
- # ● 簡易メッセージウィンドウを削除する
- #--------------------------------------------------------------------------
- def dispose_message_window
- @message_window.dispose
- @selecting_message_window = false
- end
- #--------------------------------------------------------------------------
- # ● ステート選択関連全般
- #--------------------------------------------------------------------------
- def start_state_selection
- @status_window.index = 0
- @mainmenu_window.index = -1
- @menumode = 5
- @status_window_stateidlist = $se_gs.get_visible_state_list("id")
- end
- def update_state_selection
- stat = $se_gs.search_state_name(@status_window.commands[@status_window.index])
- ser = $se_gs.gd_state[stat].get_seriousery
- case ser
- when 0
- com = ""
- when 1
- com = "<軽>"
- when 2
- com = "<中>"
- when 3
- com = "<重>"
- else
- com = ""
- end
- if ( $se_gs.gd_state[stat].get_serious_exist == false )
- com = ""
- end
- if $game_switches[1] == true
- i = $se_gs.search_state(@status_window_stateidlist[@status_window.index])
- ev = $se_gs.gd_state[i].get_eval
- @info_window.set_text(com + "[" + ev.to_s + "]" + $se_gs.gd_state[stat].get_name + $data_states[@status_window_stateidlist[@status_window.index]].message1)
- else
- @info_window.set_text(com + $data_states[@status_window_stateidlist[@status_window.index]].message1)
- end
- if Input.trigger?(Input::B) #キャンセルの場合
- Sound.play_cancel
- end_state_selection
- return
- end
- end
- def end_state_selection
- @status_window.index = -1
- @mainmenu_window.index = 5
- @menumode = 0
- end
- #--------------------------------------------------------------------------
- # ● オプション開始処理
- #--------------------------------------------------------------------------
- def start_option
- end
-
- end
复制代码 对了,这个是很久之前忘了从哪保存的一个黑暗研究所版本的菜单脚本
但是使用起来会报错
wrong number of arguments(6 for 5)
哪位研究脚本的大大帮忙改一下这个也可以
|
|