赞 | 1 |
VIP | 171 |
好人卡 | 21 |
积分 | 4 |
经验 | 59678 |
最后登录 | 2024-7-30 |
在线时间 | 1292 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 362
- 在线时间
- 1292 小时
- 注册时间
- 2013-1-12
- 帖子
- 3590
|
2楼
楼主 |
发表于 2013-1-23 08:08:50
|
只看该作者
- ==============================================================================
- # 仭 RGSS3 傾僀僥儉崌惉 ver 1.03
- #------------------------------------------------------------------------------
- # 丂攝晍尦:
- # 敀偺杺 http://izumiwhite.web.fc2.com/
- #
- 怎麼變這樣了?
- # 丂棙梡婯栺:
- # RPG僣僋乕儖VX Ace偺惓婯偺搊榐幰偺傒偛棙梡偵側傟傑偡丅
- # 棙梡曬崘丒挊嶌尃昞帵偲偐偼昁梫偁傝傑偣傫丅
- # 夵憿傕偛帺桼偵偳偆偧丅
- # 壗偐栤戣偑敪惗偟偰傕愑擟偼帩偪傑偣傫丅
- #==============================================================================
- #--------------------------------------------------------------------------
- # 仛 弶婜愝掕丅
- # 崌惉儗僔僺摍偺愝掕
- #--------------------------------------------------------------------------
- module WD_itemsynthesis_ini
-
- Cost_view = true #旓梡(俧)偺昞帵(崌惉偺旓梡偑慡偰0G偺応崌偼false傪悇彠)
-
- Category_i = true #僇僥僑儕僂傿儞僪僂偵乽傾僀僥儉乿偺崁栚傪昞帵
- Category_w = true #僇僥僑儕僂傿儞僪僂偵乽晲婍乿偺崁栚傪昞帵
- Category_a = true #僇僥僑儕僂傿儞僪僂偵乽杊嬶乿偺崁栚傪昞帵
- Category_k = true #僇僥僑儕僂傿儞僪僂偵乽戝帠側傕偺乿偺崁栚傪昞帵
-
- I_recipe = [] #偙偺峴偼嶍彍偟側偄偙偲
- W_recipe = [] #偙偺峴偼嶍彍偟側偄偙偲
- A_recipe = [] #偙偺峴偼嶍彍偟側偄偙偲
-
- #埲壓丄崌惉儗僔僺丅
- #椺: I_recipe[3] = [100, ["I",1,1], ["W",2,1], ["A",2,2], ["A",3,1]]
- #偲婰嵹偟偨応崌丄ID3偺傾僀僥儉偺崌惉昁梫偼丄100俧丅
- #昁梫側慺嵽偼丄ID1偺傾僀僥儉1屄丄ID2偺晲婍1屄丄ID2偺杊嬶2屄丄ID3偺杊嬶1屄
- #偲側傞丅
-
- #傾僀僥儉偺崌惉儗僔僺
- I_recipe[2] = [10, ["I",1,2]]
- I_recipe[3] = [100, ["I",1,1], ["I",2,1]]
- I_recipe[17] = [500, ["I",1,10]]
- #晲婍偺崌惉儗僔僺
- W_recipe[3] = [50, ["W",1,1], ["W",2,1]]
- W_recipe[6] = [600, ["W",3,1], ["I",17,0]]
-
- #杊嬶偺崌惉儗僔僺
- A_recipe[2] = [40, ["A",1,2]]
- A_recipe[5] = [400, ["A",2,1], ["W",2,2], ["I",17,0]]
-
- end
- #==============================================================================
- # 仭 WD_itemsynthesis
- #------------------------------------------------------------------------------
- # 丂傾僀僥儉崌惉梡偺嫟捠儊僜僢僪偱偡丅
- #==============================================================================
- module WD_itemsynthesis
- def i_recipe_switch_on(id)
- $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
- $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
- $game_system.i_rcp_sw[id] = true
- end
- def i_recipe_switch_off(id)
- $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
- $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
- $game_system.i_rcp_sw[id] = false
- end
- def i_recipe_switch_on?(id)
- $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
- $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
- return $game_system.i_rcp_sw[id]
- end
- def i_recipe_all_switch_on
- for i in 1..$data_items.size
- i_recipe_switch_on(i)
- end
- end
- def i_recipe_all_switch_off
- for i in 1..$data_items.size
- i_recipe_switch_off(i)
- end
- end
- def w_recipe_switch_on(id)
- $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
- $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
- $game_system.w_rcp_sw[id] = true
- end
- def w_recipe_switch_off(id)
- $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
- $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
- $game_system.w_rcp_sw[id] = false
- end
- def w_recipe_switch_on?(id)
- $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
- $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
- return $game_system.w_rcp_sw[id]
- end
- def w_recipe_all_switch_on
- for i in 1..$data_weapons.size
- w_recipe_switch_on(i)
- end
- end
- def w_recipe_all_switch_off
- for i in 1..$data_weapons.size
- w_recipe_switch_off(i)
- end
- end
- def a_recipe_switch_on(id)
- $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
- $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
- $game_system.a_rcp_sw[id] = true
- end
- def a_recipe_switch_off(id)
- $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
- $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
- $game_system.a_rcp_sw[id] = false
- end
- def a_recipe_switch_on?(id)
- $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
- $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
- return $game_system.a_rcp_sw[id]
- end
- def a_recipe_all_switch_on
- for i in 1..$data_armors.size
- a_recipe_switch_on(i)
- end
- end
- def a_recipe_all_switch_off
- for i in 1..$data_armors.size
- a_recipe_switch_off(i)
- end
- end
- def recipe_all_switch_on
- i_recipe_all_switch_on
- w_recipe_all_switch_on
- a_recipe_all_switch_on
- end
- def recipe_all_switch_off
- i_recipe_all_switch_off
- w_recipe_all_switch_off
- a_recipe_all_switch_off
- end
- end
- class Game_Interpreter
- include WD_itemsynthesis
- end
- class Game_System
- #--------------------------------------------------------------------------
- # 仠 岞奐僀儞僗僞儞僗曄悢
- #--------------------------------------------------------------------------
- attr_accessor :i_rcp_sw
- attr_accessor :w_rcp_sw
- attr_accessor :a_rcp_sw
- #--------------------------------------------------------------------------
- # 仠 僆僽僕僃僋僩弶婜壔
- #--------------------------------------------------------------------------
- alias wd_orig_initialize004 initialize
- def initialize
- wd_orig_initialize004
- @i_rcp_sw = []
- @w_rcp_sw = []
- @a_rcp_sw = []
- end
- end
- #==============================================================================
- # 仭 Scene_ItemSynthesis
- #------------------------------------------------------------------------------
- # 丂崌惉夋柺偺張棟傪峴偆僋儔僗偱偡丅
- #==============================================================================
- class Scene_ItemSynthesis < Scene_MenuBase
- #--------------------------------------------------------------------------
- # 仠 奐巒張棟
- #--------------------------------------------------------------------------
- def start
- super
- create_help_window
- create_dummy_window
- create_number_window
- create_status_window
- create_material_window
- create_list_window
- create_category_window
- create_gold_window
- create_change_window
- end
- #--------------------------------------------------------------------------
- # 仠 僑乕儖僪僂傿儞僪僂偺嶌惉
- #--------------------------------------------------------------------------
- def create_gold_window
- @gold_window = Window_Gold.new
- @gold_window.viewport = @viewport
- @gold_window.x = Graphics.width - @gold_window.width
- @gold_window.y = @help_window.height
- @gold_window.hide
- end
- #--------------------------------------------------------------------------
- # 仠 愗傝懼偊昞帵僂傿儞僪僂偺嶌惉
- #--------------------------------------------------------------------------
- def create_change_window
- wx = 0
- wy = @gold_window.y
- ww = Graphics.width - @gold_window.width
- wh = @gold_window.height
- @change_window = Window_ItemSynthesisChange.new(wx, wy, ww, wh)
- @change_window.viewport = @viewport
- @change_window.hide
- end
- #--------------------------------------------------------------------------
- # 仠 僟儈乕僂傿儞僪僂偺嶌惉
- #--------------------------------------------------------------------------
- def create_dummy_window
- wy = @help_window.y + @help_window.height + 48
- wh = Graphics.height - wy
- @dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
- @dummy_window.viewport = @viewport
- end
- #--------------------------------------------------------------------------
- # 仠 屄悢擖椡僂傿儞僪僂偺嶌惉
- #--------------------------------------------------------------------------
- def create_number_window
- wy = @dummy_window.y
- wh = @dummy_window.height
- @number_window = Window_ItemSynthesisNumber.new(0, wy, wh)
- @number_window.viewport = @viewport
- @number_window.hide
- @number_window.set_handler(:ok, method(:on_number_ok))
- @number_window.set_handler(:cancel, method(:on_number_cancel))
- @number_window.set_handler(:change_window, method(:on_change_window))
- end
- #--------------------------------------------------------------------------
- # 仠 僗僥乕僞僗僂傿儞僪僂偺嶌惉
- #--------------------------------------------------------------------------
- def create_status_window
- wx = @number_window.width
- wy = @dummy_window.y
- ww = Graphics.width - wx
- wh = @dummy_window.height
- @status_window = Window_ShopStatus.new(wx, wy, ww, wh)
- @status_window.viewport = @viewport
- @status_window.hide
- end
- #--------------------------------------------------------------------------
- # 仠 慺嵽僂傿儞僪僂偺嶌惉
- #--------------------------------------------------------------------------
- def create_material_window
- wx = @number_window.width
- wy = @dummy_window.y
- ww = Graphics.width - wx
- wh = @dummy_window.height
- @material_window = Window_ItemSynthesisMaterial.new(wx, wy, ww, wh)
- @material_window.viewport = @viewport
- @material_window.hide
- @number_window.material_window = @material_window
- end
- #--------------------------------------------------------------------------
- # 仠 崌惉傾僀僥儉儕僗僩僂傿儞僪僂偺嶌惉
- #--------------------------------------------------------------------------
- def create_list_window
- wy = @dummy_window.y
- wh = @dummy_window.height
- @list_window = Window_ItemSynthesisList.new(0, wy, wh)
- @list_window.viewport = @viewport
- @list_window.help_window = @help_window
- @list_window.status_window = @status_window
- @list_window.material_window = @material_window
- @list_window.hide
- @list_window.set_handler(:ok, method(:on_list_ok))
- @list_window.set_handler(:cancel, method(:on_list_cancel))
- @list_window.set_handler(:change_window, method(:on_change_window))
- end
- #--------------------------------------------------------------------------
- # 仠 僇僥僑儕僂傿儞僪僂偺嶌惉
- #--------------------------------------------------------------------------
- def create_category_window
- @category_window = Window_ItemSynthesisCategory.new
- @category_window.viewport = @viewport
- @category_window.help_window = @help_window
- @category_window.y = @help_window.height
- @category_window.activate
- @category_window.item_window = @list_window
- @category_window.set_handler(:ok, method(:on_category_ok))
- @category_window.set_handler(:cancel, method(:return_scene))
- end
- #--------------------------------------------------------------------------
- # 仠 崌惉傾僀僥儉儕僗僩僂傿儞僪僂偺傾僋僥傿僽壔
- #--------------------------------------------------------------------------
- def activate_list_window
- @list_window.money = money
- @list_window.show.activate
- end
- #--------------------------------------------------------------------------
- # 仠 崌惉乵寛掕乶
- #--------------------------------------------------------------------------
- def on_list_ok
- @item = @list_window.item
- @list_window.hide
- @number_window.set(@item, max_buy, buying_price, currency_unit)
- @number_window.show.activate
- end
- #--------------------------------------------------------------------------
- # 仠 崌惉乵僉儍儞僙儖乶
- #--------------------------------------------------------------------------
- def on_list_cancel
- @category_window.activate
- @category_window.show
- @dummy_window.show
- @list_window.hide
- @status_window.hide
- @status_window.item = nil
- @material_window.hide
- @material_window.set(nil, nil)
- @gold_window.hide
- @change_window.hide
- @help_window.clear
- end
- #--------------------------------------------------------------------------
- # 仠 昞帵愗懼
- #--------------------------------------------------------------------------
- def on_change_window
- if @status_window.visible
- @status_window.hide
- @material_window.show
- else
- @status_window.show
- @material_window.hide
- end
- end
- #--------------------------------------------------------------------------
- # 仠 僇僥僑儕乵寛掕乶
- #--------------------------------------------------------------------------
- def on_category_ok
- activate_list_window
- @gold_window.show
- @change_window.show
- @material_window.show
- @category_window.hide
- @list_window.select(0)
- end
- #--------------------------------------------------------------------------
- # 仠 屄悢擖椡乵寛掕乶
- #--------------------------------------------------------------------------
- def on_number_ok
- Sound.play_shop
- do_syntetic(@number_window.number)
- end_number_input
- @gold_window.refresh
- end
- #--------------------------------------------------------------------------
- # 仠 屄悢擖椡乵僉儍儞僙儖乶
- #--------------------------------------------------------------------------
- def on_number_cancel
- Sound.play_cancel
- end_number_input
- end
- #--------------------------------------------------------------------------
- # 仠 崌惉偺幚峴
- #--------------------------------------------------------------------------
- def do_syntetic(number)
- $game_party.lose_gold(number * buying_price)
- $game_party.gain_item(@item, number)
-
- @recipe = @list_window.recipe(@item)
- for i in [email protected]
- kind = @recipe[i][0]
- id = @recipe[i][1]
- num = @recipe[i][2]
- if kind == "I"
- item = $data_items[id]
- elsif kind == "W"
- item = $data_weapons[id]
- elsif kind == "A"
- item = $data_armors[id]
- end
- $game_party.lose_item(item, num*number)
- end
- end
- #--------------------------------------------------------------------------
- # 仠 屄悢擖椡偺廔椆
- #--------------------------------------------------------------------------
- def end_number_input
- @number_window.hide
- activate_list_window
- end
- #--------------------------------------------------------------------------
- # 仠 嵟戝峸擖壜擻屄悢偺庢摼
- #--------------------------------------------------------------------------
- def max_buy
- max = $game_party.max_item_number(@item) - $game_party.item_number(@item)
-
- @recipe = @list_window.recipe(@item)
- for i in [email protected]
- kind = @recipe[i][0]
- id = @recipe[i][1]
- num = @recipe[i][2]
- if kind == "I"
- item = $data_items[id]
- elsif kind == "W"
- item = $data_weapons[id]
- elsif kind == "A"
- item = $data_armors[id]
- end
- if num > 0
- max_buf = $game_party.item_number(item)/num
- else
- max_buf = 999
- end
- max = [max, max_buf].min
- end
-
- buying_price == 0 ? max : [max, money / buying_price].min
- end
- #--------------------------------------------------------------------------
- # 仠 強帩嬥偺庢摼
- #--------------------------------------------------------------------------
- def money
- @gold_window.value
- end
- #--------------------------------------------------------------------------
- # 仠 捠壿扨埵偺庢摼
- #--------------------------------------------------------------------------
- def currency_unit
- @gold_window.currency_unit
- end
- #--------------------------------------------------------------------------
- # 仠 崌惉旓梡偺庢摼
- #--------------------------------------------------------------------------
- def buying_price
- @list_window.price(@item)
- end
- end
- #==============================================================================
- # 仭 Window_ItemSynthesisList
- #------------------------------------------------------------------------------
- # 丂崌惉夋柺偱丄崌惉壜擻側傾僀僥儉偺堦棗傪昞帵偡傞僂傿儞僪僂偱偡丅
- #==============================================================================
- class Window_ItemSynthesisList < Window_Selectable
- include WD_itemsynthesis
- #--------------------------------------------------------------------------
- # 仠 岞奐僀儞僗僞儞僗曄悢
- #--------------------------------------------------------------------------
- attr_reader :status_window # 僗僥乕僞僗僂傿儞僪僂
- #--------------------------------------------------------------------------
- # 仠 僆僽僕僃僋僩弶婜壔
- #--------------------------------------------------------------------------
- def initialize(x, y, height)
- super(x, y, window_width, height)
-
- @shop_goods = []
- @shop_recipes = []
-
- for i in 1..WD_itemsynthesis_ini::I_recipe.size
- recipe = WD_itemsynthesis_ini::I_recipe[i]
- if recipe
- good = [0, i, recipe[0]]
- if i_recipe_switch_on?(i)
- @shop_goods.push(good)
- @shop_recipes.push(recipe)
- end
- end
- end
- for i in 1..WD_itemsynthesis_ini::W_recipe.size
- recipe = WD_itemsynthesis_ini::W_recipe[i]
- if recipe
- good = [1, i, recipe[0]]
- if w_recipe_switch_on?(i)
- @shop_goods.push(good)
- @shop_recipes.push(recipe)
- end
- end
- end
- for i in 1..WD_itemsynthesis_ini::A_recipe.size
- recipe = WD_itemsynthesis_ini::A_recipe[i]
- if recipe
- good = [2, i, recipe[0]]
- if a_recipe_switch_on?(i)
- @shop_goods.push(good)
- @shop_recipes.push(recipe)
- end
- end
- end
-
- [url=home.php?mod=space&uid=26101]@Money[/url] = 0
- refresh
- select(0)
- end
- #--------------------------------------------------------------------------
- # 仠 僂傿儞僪僂暆偺庢摼
- #--------------------------------------------------------------------------
- def window_width
- return 304
- end
- #--------------------------------------------------------------------------
- # 仠 崁栚悢偺庢摼
- #--------------------------------------------------------------------------
- def item_max
- @data ? @data.size : 1
- end
- #--------------------------------------------------------------------------
- # 仠 傾僀僥儉偺庢摼
- #--------------------------------------------------------------------------
- def item
- @data[index]
- end
- #--------------------------------------------------------------------------
- # 仠 強帩嬥偺愝掕
- #--------------------------------------------------------------------------
- def money=(money)
- @money = money
- refresh
- end
- #--------------------------------------------------------------------------
- # 仠 慖戰崁栚偺桳岠忬懺傪庢摼
- #--------------------------------------------------------------------------
- def current_item_enabled?
- enable?(@data[index])
- end
- #--------------------------------------------------------------------------
- # 仠 崌惉旓梡傪庢摼
- #--------------------------------------------------------------------------
- def price(item)
- @price[item]
- end
- #--------------------------------------------------------------------------
- # 仠 崌惉壜斲傪庢摼
- #--------------------------------------------------------------------------
- def enable?(item)
- @makable[item]
- end
- #--------------------------------------------------------------------------
- # 仠 儗僔僺傪庢摼
- #--------------------------------------------------------------------------
- def recipe(item)
- @recipe[item]
- end
- #--------------------------------------------------------------------------
- # 仠 傾僀僥儉傪嫋壜忬懺偱昞帵偡傞偐偳偆偐
- #--------------------------------------------------------------------------
- def have_mat?(recipe)
- flag = true
- if @money >= recipe[0]
- for i in 1...recipe.size
- kind = recipe[i][0]
- id = recipe[i][1]
- num = recipe[i][2]
- if kind == "I"
- item = $data_items[id]
- elsif kind == "W"
- item = $data_weapons[id]
- elsif kind == "A"
- item = $data_armors[id]
- end
- if $game_party.item_number(item) < [num, 1].max
- flag = false
- end
- end
- else
- flag = false
- end
- return flag
- end
- #--------------------------------------------------------------------------
- # 仠 僇僥僑儕偺愝掕
- #--------------------------------------------------------------------------
- def category=(category)
- return if @category == category
- @category = category
- refresh
- end
- #--------------------------------------------------------------------------
- # 仠 儕僼儗僢僔儏
- #--------------------------------------------------------------------------
- def refresh
- make_item_list
- create_contents
- draw_all_items
- end
- #--------------------------------------------------------------------------
- # 仠 傾僀僥儉傪儕僗僩偵娷傔傞偐偳偆偐
- #--------------------------------------------------------------------------
- def include?(item)
- case @category
- when :item
- item.is_a?(RPG::Item) && !item.key_item?
- when :weapon
- item.is_a?(RPG::Weapon)
- when :armor
- item.is_a?(RPG::Armor)
- when :key_item
- item.is_a?(RPG::Item) && item.key_item?
- else
- false
- end
- end
- #--------------------------------------------------------------------------
- # 仠 傾僀僥儉儕僗僩偺嶌惉
- #--------------------------------------------------------------------------
- def make_item_list
- @data = []
- @price = {}
- @makable = {}
- @recipe = {}
- for i in 0...@shop_goods.size
- goods = @shop_goods[i]
- recipe = @shop_recipes[i]
- case goods[0]
- when 0; item = $data_items[goods[1]]
- when 1; item = $data_weapons[goods[1]]
- when 2; item = $data_armors[goods[1]]
- end
- if item
- if include?(item)
- @data.push(item)
- @price[item] = goods[2]
- @makable[item] = have_mat?(recipe)
- @recipe[item] = recipe
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # 仠 崁栚偺昤夋
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- rect = item_rect(index)
- draw_item_name(item, rect.x, rect.y, enable?(item))
- rect.width -= 4
- draw_text(rect, price(item), 2) if WD_itemsynthesis_ini::Cost_view
- end
- #--------------------------------------------------------------------------
- # 仠 僗僥乕僞僗僂傿儞僪僂偺愝掕
- #--------------------------------------------------------------------------
- def status_window=(status_window)
- @status_window = status_window
- call_update_help
- end
- #--------------------------------------------------------------------------
- # 仠 慺嵽僂傿儞僪僂偺愝掕
- #--------------------------------------------------------------------------
- def material_window=(material_window)
- @material_window = material_window
- call_update_help
- end
- #--------------------------------------------------------------------------
- # 仠 僿儖僾僥僉僗僩峏怴
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_item(item) if @help_window
- @status_window.item = item if @status_window
- @material_window.set(item, recipe(item)) if @material_window
- end
- #--------------------------------------------------------------------------
- # 仠 Z 儃僞儞乮昞帵愗懼乯偑墴偝傟偨偲偒偺張棟
- #--------------------------------------------------------------------------
- def process_change_window
- Sound.play_cursor
- Input.update
- call_handler(:change_window)
- end
- #--------------------------------------------------------------------------
- # 仠 寛掕傗僉儍儞僙儖側偳偺僴儞僪儕儞僌張棟
- #--------------------------------------------------------------------------
- def process_handling
- super
- if active
- return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
- # return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
- end
- end
- end
- #==============================================================================
- # 仭 Window_ItemSynthesisMaterial
- #------------------------------------------------------------------------------
- # 丂崌惉夋柺偱丄崌惉偵昁梫側慺嵽傪昞帵偡傞僂傿儞僪僂偱偡丅
- #==============================================================================
- class Window_ItemSynthesisMaterial < Window_Base
- #--------------------------------------------------------------------------
- # 仠 僆僽僕僃僋僩弶婜壔
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super(x, y, width, height)
- @item = nil
- refresh
- end
- #--------------------------------------------------------------------------
- # 仠 儕僼儗僢僔儏
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_possession(4, 0)
- draw_material_info(0, line_height * 2)
- end
- #--------------------------------------------------------------------------
- # 仠 傾僀僥儉偺愝掕
- #--------------------------------------------------------------------------
- def set(item, recipe)
- @item = item
- @recipe = recipe
- @make_number = 1
- refresh
- end
- #--------------------------------------------------------------------------
- # 仠 嶌惉屄悢偺愝掕
- #--------------------------------------------------------------------------
- def set_num(make_number)
- @make_number = make_number
- refresh
- end
- #--------------------------------------------------------------------------
- # 仠 強帩悢偺昤夋
- #--------------------------------------------------------------------------
- def draw_possession(x, y)
- rect = Rect.new(x, y, contents.width - 4 - x, line_height)
- change_color(system_color)
- draw_text(rect, Vocab::Possession)
- change_color(normal_color)
- draw_text(rect, $game_party.item_number(@item), 2)
- end
- #--------------------------------------------------------------------------
- # 仠 慺嵽忣曬偺昤夋
- #--------------------------------------------------------------------------
- def draw_material_info(x, y)
- rect = Rect.new(x, y, contents.width, line_height)
- change_color(system_color)
- contents.font.size = 18
- draw_text(rect, "昁梫慺嵽", 0)
- if @recipe
- for i in [email protected]
- kind = @recipe[i][0]
- id = @recipe[i][1]
- num = @recipe[i][2]
- if kind == "I"
- item = $data_items[id]
- elsif kind == "W"
- item = $data_weapons[id]
- elsif kind == "A"
- item = $data_armors[id]
- end
- rect = Rect.new(x, y + line_height*i, contents.width, line_height)
- enabled = true
- enabled = false if [num*@make_number, 1].max > $game_party.item_number(item)
- draw_item_name(item, rect.x, rect.y, enabled)
- change_color(normal_color, enabled)
- if num > 0
- draw_text(rect, "#{num*@make_number}/#{$game_party.item_number(item)}", 2)
- end
- end
- end
- change_color(normal_color)
- contents.font.size = 24
- end
- end
- #==============================================================================
- # 仭 Window_ItemSynthesisNumber
- # 仭 Window_ItemSynthesisNumber
- #------------------------------------------------------------------------------
- # 丂崌惉夋柺偱丄崌惉偡傞傾僀僥儉偺屄悢傪擖椡偡傞僂傿儞僪僂偱偡丅
- #==============================================================================
- class Window_ItemSynthesisNumber < Window_ShopNumber
- #--------------------------------------------------------------------------
- # 仠 儕僼儗僢僔儏
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_item_name(@item, 0, item_y)
- draw_number
- draw_total_price if WD_itemsynthesis_ini::Cost_view
- end
- #--------------------------------------------------------------------------
- # 仠 僆僽僕僃僋僩弶婜壔
- #--------------------------------------------------------------------------
- def material_window=(material_window)
- @material_window = material_window
- call_update_help
- end
- #--------------------------------------------------------------------------
- # 仠 嶌惉屄悢偺曄峏
- #--------------------------------------------------------------------------
- def change_number(amount)
- @number = [[@number + amount, @max].min, 1].max
- call_update_help #捛壛
- end
- #--------------------------------------------------------------------------
- # 仠 僿儖僾僥僉僗僩峏怴
- #--------------------------------------------------------------------------
- def call_update_help
- @material_window.set_num(@number) if @material_window
- end
- #--------------------------------------------------------------------------
- # 仠 Z 儃僞儞乮昞帵愗懼乯偑墴偝傟偨偲偒偺張棟
- #--------------------------------------------------------------------------
- def process_change_window
- Sound.play_cursor
- Input.update
- call_handler(:change_window)
- end
- #--------------------------------------------------------------------------
- # 仠 寛掕傗僉儍儞僙儖側偳偺僴儞僪儕儞僌張棟
- #--------------------------------------------------------------------------
- def process_handling
- super
- if active
- return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
- # return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
- end
- end
- end
- #==============================================================================
- # 仭 Window_ItemSynthesisCategory
- #------------------------------------------------------------------------------
- # 丂崌惉夋柺偱丄捠忢傾僀僥儉傗憰旛昳偺暘椶傪慖戰偡傞僂傿儞僪僂偱偡丅
- #==============================================================================
- class Window_ItemSynthesisCategory < Window_ItemCategory
- #--------------------------------------------------------------------------
- # 仠 寘悢偺庢摼
- #--------------------------------------------------------------------------
- def col_max
- i = 0
- i += 1 if WD_itemsynthesis_ini::Category_i
- i += 1 if WD_itemsynthesis_ini::Category_w
- i += 1 if WD_itemsynthesis_ini::Category_a
- i += 1 if WD_itemsynthesis_ini::Category_k
- return i
- end
- #--------------------------------------------------------------------------
- # 仠 僐儅儞僪儕僗僩偺嶌惉
- #--------------------------------------------------------------------------
- def make_command_list
- add_command(Vocab::item, :item) if WD_itemsynthesis_ini::Category_i
- add_command(Vocab::weapon, :weapon) if WD_itemsynthesis_ini::Category_w
- add_command(Vocab::armor, :armor) if WD_itemsynthesis_ini::Category_a
- add_command(Vocab::key_item, :key_item) if WD_itemsynthesis_ini::Category_k
- end
- end
- #==============================================================================
- # 仭 Window_ItemSynthesisNumber
- #------------------------------------------------------------------------------
- # 丂崌惉夋柺偱丄愗懼傪昞帵偡傞僂傿儞僪僂偱偡丅
- #==============================================================================
- class Window_ItemSynthesisChange < Window_Base
- #--------------------------------------------------------------------------
- # 仠 僆僽僕僃僋僩弶婜壔
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super(x, y, width, height)
- refresh
- end
- #--------------------------------------------------------------------------
- # 仠 儕僼儗僢僔儏
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- text = "Z: 慺嵽 佁 僗僥乕僞僗 昞帵愗傝懼偊"
- draw_text(0, 0, contents_width, line_height, text, 1)
- end
- end
复制代码 |
|