查看: 1606|回复: 8

[已经过期] 请问有方法把这两个脚本整合吗?

[复制链接]
梦石
0
星屑
80
在线时间
91 小时
注册时间
2017-2-4
回帖
15
发表于 2017-2-11 20:11:02 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 uoar 于 2017-2-11 20:23 编辑

这个是合成系统介面的脚本
点击展开/收起
  1. #==============================================================================
  2. # ■ RGSS3 アイテム合成 ver 1.04
  3. #------------------------------------------------------------------------------
  4. #  配布元:
  5. #     白の魔 [url]http://izumiwhite.web.fc2.com/[/url]
  6. #
  7. #  利用規約:
  8. #     RPGツクールVX Aceの正規の登錄者のみご利用になれます。
  9. #     利用報告・著作権表示とかは必要ありません。
  10. #     改造もご自由にどうぞ。
  11. #     何か問題が発生しても責任は持ちません。
  12. #==============================================================================


  13. #--------------------------------------------------------------------------
  14. # ★ 初期設定。
  15. #    合成レシピ等の設定
  16. #--------------------------------------------------------------------------
  17. module WD_itemsynthesis_ini
  18.   
  19.   Cost_view =  true #費用(G)の表示(合成の費用が全て0Gの場合はfalseを推奨)
  20.   
  21.   Category_i = true #カテゴリウィンドウに「アイテム」の項目を表示
  22.   Category_w = true #カテゴリウィンドウに「武器」の項目を表示
  23.   Category_a = true #カテゴリウィンドウに「防具」の項目を表示
  24.   Category_k = true #カテゴリウィンドウに「大事なもの」の項目を表示
  25.   
  26.   I_recipe = [] #この行は削除しないこと
  27.   W_recipe = [] #この行は削除しないこと
  28.   A_recipe = [] #この行は削除しないこと
  29.   
  30.   #以下、合成レシピ。
  31.   #例: I_recipe[3]  = [100, ["I",1,1], ["W",2,1], ["A",2,2], ["A",3,1]]
  32.   #と記載した場合、ID3のアイテムの合成必要は、100G。
  33.   #必要な素材は、ID1のアイテム1個、ID2の武器1個、ID2の防具2個、ID3の防具1個
  34.   #となる。
  35.   
  36.   #アイテムの合成レシピ
  37.   I_recipe[9]  = [1000, ["I",40,1], ["I",48,2]]

  38.   #武器の合成レシピ
  39.   W_recipe[3]  = [50,   ["W",1,1], ["W",2,1]]
  40.   W_recipe[6]  = [600,  ["W",3,1], ["I",17,0]]
  41.   
  42.   #防具の合成レシピ  
  43.   A_recipe[68] = [1000, ["I",39,20], ["A",1,1]]
  44.   
  45. end


  46. #==============================================================================
  47. # ■ WD_itemsynthesis
  48. #------------------------------------------------------------------------------
  49. #  アイテム合成用の共通メソッドです。
  50. #==============================================================================

  51. module WD_itemsynthesis
  52.   def i_recipe_switch_on(id)
  53.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  54.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  55.     $game_system.i_rcp_sw[id] = true
  56.   end
  57.   def i_recipe_switch_off(id)
  58.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  59.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  60.     $game_system.i_rcp_sw[id] = false
  61.   end
  62.   def i_recipe_switch_on?(id)
  63.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  64.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  65.     return $game_system.i_rcp_sw[id]
  66.   end
  67.   def i_recipe_all_switch_on
  68.     for i in 1..$data_items.size
  69.       i_recipe_switch_on(i)
  70.     end
  71.   end
  72.   def i_recipe_all_switch_off
  73.     for i in 1..$data_items.size
  74.       i_recipe_switch_off(i)
  75.     end
  76.   end
  77.   def w_recipe_switch_on(id)
  78.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  79.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  80.     $game_system.w_rcp_sw[id] = true
  81.   end
  82.   def w_recipe_switch_off(id)
  83.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  84.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  85.     $game_system.w_rcp_sw[id] = false
  86.   end
  87.   def w_recipe_switch_on?(id)
  88.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  89.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  90.     return $game_system.w_rcp_sw[id]
  91.   end
  92.   def w_recipe_all_switch_on
  93.     for i in 1..$data_weapons.size
  94.       w_recipe_switch_on(i)
  95.     end
  96.   end
  97.   def w_recipe_all_switch_off
  98.     for i in 1..$data_weapons.size
  99.       w_recipe_switch_off(i)
  100.     end
  101.   end
  102.   def a_recipe_switch_on(id)
  103.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  104.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  105.     $game_system.a_rcp_sw[id] = true
  106.   end
  107.   def a_recipe_switch_off(id)
  108.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  109.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  110.     $game_system.a_rcp_sw[id] = false
  111.   end
  112.   def a_recipe_switch_on?(id)
  113.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  114.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  115.     return $game_system.a_rcp_sw[id]
  116.   end
  117.   def a_recipe_all_switch_on
  118.     for i in 1..$data_armors.size
  119.       a_recipe_switch_on(i)
  120.     end
  121.   end
  122.   def a_recipe_all_switch_off
  123.     for i in 1..$data_armors.size
  124.       a_recipe_switch_off(i)
  125.     end
  126.   end
  127.   def recipe_all_switch_on
  128.     i_recipe_all_switch_on
  129.     w_recipe_all_switch_on
  130.     a_recipe_all_switch_on
  131.   end
  132.   def recipe_all_switch_off
  133.     i_recipe_all_switch_off
  134.     w_recipe_all_switch_off
  135.     a_recipe_all_switch_off
  136.   end

  137. end

  138. class Game_Interpreter
  139.   include WD_itemsynthesis
  140. end

  141. class Game_System
  142.   #--------------------------------------------------------------------------
  143.   # ● 公開インスタンス変數
  144.   #--------------------------------------------------------------------------
  145.   attr_accessor :i_rcp_sw
  146.   attr_accessor :w_rcp_sw
  147.   attr_accessor :a_rcp_sw
  148.   #--------------------------------------------------------------------------
  149.   # ● オブジェクト初期化
  150.   #--------------------------------------------------------------------------
  151.   alias wd_orig_initialize004 initialize
  152.   def initialize
  153.     wd_orig_initialize004
  154.     @i_rcp_sw = []
  155.     @w_rcp_sw = []
  156.     @a_rcp_sw = []
  157.   end
  158. end


  159. #==============================================================================
  160. # ■ Scene_ItemSynthesis
  161. #------------------------------------------------------------------------------
  162. #  合成畫面の處理を行うクラスです。
  163. #==============================================================================

  164. class Scene_ItemSynthesis < Scene_MenuBase
  165.   #--------------------------------------------------------------------------
  166.   # ● 開始處理
  167.   #--------------------------------------------------------------------------
  168.   def start
  169.     super
  170.     create_help_window
  171.     create_dummy_window
  172.     create_number_window
  173.     create_status_window
  174.     create_material_window
  175.     create_list_window
  176.     create_category_window
  177.     create_gold_window
  178.     create_change_window
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ● ゴールドウィンドウの作成
  182.   #--------------------------------------------------------------------------
  183.   def create_gold_window
  184.     @gold_window = Window_Gold.new
  185.     @gold_window.viewport = @viewport
  186.     @gold_window.x = Graphics.width - @gold_window.width
  187.     @gold_window.y = @help_window.height
  188.     @gold_window.hide
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● 切り替え表示ウィンドウの作成
  192.   #--------------------------------------------------------------------------
  193.   def create_change_window
  194.     wx = 0
  195.     wy = @gold_window.y
  196.     ww = Graphics.width - @gold_window.width
  197.     wh = @gold_window.height
  198.     @change_window = Window_ItemSynthesisChange.new(wx, wy, ww, wh)
  199.     @change_window.viewport = @viewport
  200.     @change_window.hide
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● ダミーウィンドウの作成
  204.   #--------------------------------------------------------------------------
  205.   def create_dummy_window
  206.     wy = @help_window.y + @help_window.height + 48
  207.     wh = Graphics.height - wy
  208.     @dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
  209.     @dummy_window.viewport = @viewport
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # ● 個數入力ウィンドウの作成
  213.   #--------------------------------------------------------------------------
  214.   def create_number_window
  215.     wy = @dummy_window.y
  216.     wh = @dummy_window.height
  217.     @number_window = Window_ItemSynthesisNumber.new(0, wy, wh)
  218.     @number_window.viewport = @viewport
  219.     @number_window.hide
  220.     @number_window.set_handler(:ok,     method(:on_number_ok))
  221.     @number_window.set_handler(:cancel, method(:on_number_cancel))
  222.     @number_window.set_handler(:change_window, method(:on_change_window))   
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ● ステータスウィンドウの作成
  226.   #--------------------------------------------------------------------------
  227.   def create_status_window
  228.     wx = @number_window.width
  229.     wy = @dummy_window.y
  230.     ww = Graphics.width - wx
  231.     wh = @dummy_window.height
  232.     @status_window = Window_ShopStatus.new(wx, wy, ww, wh)
  233.     @status_window.viewport = @viewport
  234.     @status_window.hide
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● 素材ウィンドウの作成
  238.   #--------------------------------------------------------------------------
  239.   def create_material_window
  240.     wx = @number_window.width
  241.     wy = @dummy_window.y
  242.     ww = Graphics.width - wx
  243.     wh = @dummy_window.height
  244.     @material_window = Window_ItemSynthesisMaterial.new(wx, wy, ww, wh)
  245.     @material_window.viewport = @viewport
  246.     @material_window.hide
  247.     @number_window.material_window = @material_window
  248.   end
  249.   #--------------------------------------------------------------------------
  250.   # ● 合成アイテムリストウィンドウの作成
  251.   #--------------------------------------------------------------------------
  252.   def create_list_window
  253.     wy = @dummy_window.y
  254.     wh = @dummy_window.height
  255.     @list_window = Window_ItemSynthesisList.new(0, wy, wh)
  256.     @list_window.viewport = @viewport
  257.     @list_window.help_window = @help_window
  258.     @list_window.status_window = @status_window
  259.     @list_window.material_window = @material_window
  260.     @list_window.hide
  261.     @list_window.set_handler(:ok,     method(:on_list_ok))
  262.     @list_window.set_handler(:cancel, method(:on_list_cancel))
  263.     @list_window.set_handler(:change_window, method(:on_change_window))   
  264.   end
  265.   #--------------------------------------------------------------------------
  266.   # ● カテゴリウィンドウの作成
  267.   #--------------------------------------------------------------------------
  268.   def create_category_window
  269.     @category_window = Window_ItemSynthesisCategory.new
  270.     @category_window.viewport = @viewport
  271.     @category_window.help_window = @help_window
  272.     @category_window.y = @help_window.height
  273.     @category_window.activate
  274.     @category_window.item_window = @list_window
  275.     @category_window.set_handler(:ok,     method(:on_category_ok))
  276.     @category_window.set_handler(:cancel, method(:return_scene))
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● 合成アイテムリストウィンドウのアクティブ化
  280.   #--------------------------------------------------------------------------
  281.   def activate_list_window
  282.     @list_window.money = money
  283.     @list_window.show.activate
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # ● 合成[決定]
  287.   #--------------------------------------------------------------------------
  288.   def on_list_ok
  289.     @item = @list_window.item
  290.     @list_window.hide
  291.     @number_window.set(@item, max_buy, buying_price, currency_unit)
  292.     @number_window.show.activate
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● 合成[キャンセル]
  296.   #--------------------------------------------------------------------------
  297.   def on_list_cancel
  298.     @category_window.activate
  299.     @category_window.show
  300.     @dummy_window.show
  301.     @list_window.hide
  302.     @status_window.hide
  303.     @status_window.item = nil
  304.     @material_window.hide
  305.     @material_window.set(nil, nil)
  306.     @gold_window.hide
  307.     @change_window.hide
  308.     @help_window.clear
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● 表示切替
  312.   #--------------------------------------------------------------------------
  313.   def on_change_window
  314.     if @status_window.visible
  315.       @status_window.hide
  316.       @material_window.show
  317.     else
  318.       @status_window.show
  319.       @material_window.hide
  320.     end
  321.   end
  322.   #--------------------------------------------------------------------------
  323.   # ● カテゴリ[決定]
  324.   #--------------------------------------------------------------------------
  325.   def on_category_ok
  326.     activate_list_window
  327.     @gold_window.show
  328.     @change_window.show
  329.     @material_window.show
  330.     @category_window.hide
  331.     @list_window.select(0)
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # ● 個數入力[決定]
  335.   #--------------------------------------------------------------------------
  336.   def on_number_ok
  337.     Sound.play_shop
  338.     do_syntetic(@number_window.number)
  339.     end_number_input
  340.     @gold_window.refresh
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # ● 個數入力[キャンセル]
  344.   #--------------------------------------------------------------------------
  345.   def on_number_cancel
  346.     Sound.play_cancel
  347.     end_number_input
  348.   end
  349.   #--------------------------------------------------------------------------
  350.   # ● 合成の実行
  351.   #--------------------------------------------------------------------------
  352.   def do_syntetic(number)
  353.     $game_party.lose_gold(number * buying_price)
  354.     $game_party.gain_item(@item, number)
  355.    
  356.       [url=home.php?mod=space&uid=2564094]@recipe[/url] = @list_window.recipe(@item)
  357.       for i in [email]1...@recipe.size[/email]
  358.         kind = @recipe[i][0]
  359.         id   = @recipe[i][1]
  360.         num  = @recipe[i][2]
  361.         if kind == "I"
  362.           item = $data_items[id]
  363.         elsif kind == "W"
  364.           item = $data_weapons[id]
  365.         elsif kind == "A"
  366.           item = $data_armors[id]
  367.         end
  368.         $game_party.lose_item(item, num*number)
  369.       end
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # ● 個數入力の終了
  373.   #--------------------------------------------------------------------------
  374.   def end_number_input
  375.     @number_window.hide
  376.     activate_list_window
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # ● 最大購入可能個數の取得
  380.   #--------------------------------------------------------------------------
  381.   def max_buy
  382.     max = $game_party.max_item_number(@item) - $game_party.item_number(@item)
  383.    
  384.     @recipe = @list_window.recipe(@item)
  385.       for i in [email]1...@recipe.size[/email]
  386.         kind = @recipe[i][0]
  387.         id   = @recipe[i][1]
  388.         num  = @recipe[i][2]
  389.         if kind == "I"
  390.           item = $data_items[id]
  391.         elsif kind == "W"
  392.           item = $data_weapons[id]
  393.         elsif kind == "A"
  394.           item = $data_armors[id]
  395.         end
  396.         if num > 0
  397.           max_buf = $game_party.item_number(item)/num
  398.         else
  399.           max_buf = 999
  400.         end
  401.         max = [max, max_buf].min
  402.       end
  403.       
  404.     buying_price == 0 ? max : [max, money / buying_price].min

  405.   end
  406.   #--------------------------------------------------------------------------
  407.   # ● 所持金の取得
  408.   #--------------------------------------------------------------------------
  409.   def money
  410.     @gold_window.value
  411.   end
  412.   #--------------------------------------------------------------------------
  413.   # ● 通貨単位の取得
  414.   #--------------------------------------------------------------------------
  415.   def currency_unit
  416.     @gold_window.currency_unit
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # ● 合成費用の取得
  420.   #--------------------------------------------------------------------------
  421.   def buying_price
  422.     @list_window.price(@item)
  423.   end
  424. end


  425. #==============================================================================
  426. # ■ Window_ItemSynthesisList
  427. #------------------------------------------------------------------------------
  428. #  合成畫面で、合成可能なアイテムの一覧を表示するウィンドウです。
  429. #==============================================================================

  430. class Window_ItemSynthesisList < Window_Selectable
  431.   include WD_itemsynthesis
  432.   #--------------------------------------------------------------------------
  433.   # ● 公開インスタンス変數
  434.   #--------------------------------------------------------------------------
  435.   attr_reader   :status_window            # ステータスウィンドウ
  436.   #--------------------------------------------------------------------------
  437.   # ● オブジェクト初期化
  438.   #--------------------------------------------------------------------------
  439.   def initialize(x, y, height)
  440.     super(x, y, window_width, height)
  441.    
  442.     @shop_goods = []
  443.     @shop_recipes = []
  444.    
  445.     for i in 1..WD_itemsynthesis_ini::I_recipe.size
  446.       recipe = WD_itemsynthesis_ini::I_recipe[i]
  447.       if recipe
  448.         good = [0, i, recipe[0]]
  449.         if i_recipe_switch_on?(i)
  450.           @shop_goods.push(good)
  451.           @shop_recipes.push(recipe)
  452.         end
  453.       end
  454.     end
  455.     for i in 1..WD_itemsynthesis_ini::W_recipe.size
  456.       recipe = WD_itemsynthesis_ini::W_recipe[i]
  457.       if recipe
  458.         good = [1, i, recipe[0]]
  459.         if w_recipe_switch_on?(i)
  460.           @shop_goods.push(good)
  461.           @shop_recipes.push(recipe)
  462.         end
  463.       end
  464.     end
  465.     for i in 1..WD_itemsynthesis_ini::A_recipe.size
  466.       recipe = WD_itemsynthesis_ini::A_recipe[i]
  467.       if recipe
  468.         good = [2, i, recipe[0]]
  469.         if a_recipe_switch_on?(i)
  470.           @shop_goods.push(good)
  471.           @shop_recipes.push(recipe)
  472.         end
  473.       end
  474.     end
  475.    
  476.     [url=home.php?mod=space&uid=26101]@Money[/url] = 0
  477.     refresh
  478.     select(0)
  479.   end
  480.   #--------------------------------------------------------------------------
  481.   # ● ウィンドウ幅の取得
  482.   #--------------------------------------------------------------------------
  483.   def window_width
  484.     return 304
  485.   end
  486.   #--------------------------------------------------------------------------
  487.   # ● 項目數の取得
  488.   #--------------------------------------------------------------------------
  489.   def item_max
  490.     @data ? @data.size : 1
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● アイテムの取得
  494.   #--------------------------------------------------------------------------
  495.   def item
  496.     @data[index]
  497.   end
  498.   #--------------------------------------------------------------------------
  499.   # ● 所持金の設定
  500.   #--------------------------------------------------------------------------
  501.   def money=(money)
  502.     @money = money
  503.     refresh
  504.   end
  505.   #--------------------------------------------------------------------------
  506.   # ● 選択項目の有効狀態を取得
  507.   #--------------------------------------------------------------------------
  508.   def current_item_enabled?
  509.     enable?(@data[index])
  510.   end
  511.   #--------------------------------------------------------------------------
  512.   # ● 合成費用を取得
  513.   #--------------------------------------------------------------------------
  514.   def price(item)
  515.     @price[item]
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # ● 合成可否を取得
  519.   #--------------------------------------------------------------------------
  520.   def enable?(item)
  521.     @makable[item]
  522.   end
  523.   #--------------------------------------------------------------------------
  524.   # ● レシピを取得
  525.   #--------------------------------------------------------------------------
  526.   def recipe(item)
  527.     @recipe[item]
  528.   end
  529.   #--------------------------------------------------------------------------
  530.   # ● アイテムを許可狀態で表示するかどうか
  531.   #--------------------------------------------------------------------------
  532.   def have_mat?(recipe)
  533.     flag = true
  534.     if @money >= recipe[0]
  535.       for i in 1...recipe.size
  536.         kind = recipe[i][0]
  537.         id   = recipe[i][1]
  538.         num  = recipe[i][2]
  539.         if kind == "I"
  540.           item = $data_items[id]
  541.         elsif kind == "W"
  542.           item = $data_weapons[id]
  543.         elsif kind == "A"
  544.           item = $data_armors[id]
  545.         end
  546.         if $game_party.item_number(item) < [num, 1].max
  547.           flag = false
  548.         end
  549.       end
  550.     else
  551.       flag = false
  552.     end
  553.     return flag
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ● カテゴリの設定
  557.   #--------------------------------------------------------------------------
  558.   def category=(category)
  559.     return if @category == category
  560.     @category = category
  561.     refresh
  562.   end
  563.   #--------------------------------------------------------------------------
  564.   # ● リフレッシュ
  565.   #--------------------------------------------------------------------------
  566.   def refresh
  567.     make_item_list
  568.     create_contents
  569.     draw_all_items
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # ● アイテムをリストに含めるかどうか
  573.   #--------------------------------------------------------------------------
  574.   def include?(item)
  575.     case @category
  576.     when :item
  577.       item.is_a?(RPG::Item) && !item.key_item?
  578.     when :weapon
  579.       item.is_a?(RPG::Weapon)
  580.     when :armor
  581.       item.is_a?(RPG::Armor)
  582.     when :key_item
  583.       item.is_a?(RPG::Item) && item.key_item?
  584.     else
  585.       false
  586.     end
  587.   end
  588.   #--------------------------------------------------------------------------
  589.   # ● アイテムリストの作成
  590.   #--------------------------------------------------------------------------
  591.   def make_item_list
  592.     @data = []
  593.     @price = {}
  594.     @makable = {}
  595.     @recipe = {}
  596.     for i in [email]0...@shop_goods.size[/email]
  597.       goods = @shop_goods[i]
  598.       recipe = @shop_recipes[i]
  599.       case goods[0]
  600.       when 0;  item = $data_items[goods[1]]
  601.       when 1;  item = $data_weapons[goods[1]]
  602.       when 2;  item = $data_armors[goods[1]]
  603.       end
  604.       if item
  605.         if include?(item)
  606.           @data.push(item)
  607.           @price[item] = goods[2]
  608.           @makable[item] = have_mat?(recipe) && $game_party.item_number(item) < $game_party.max_item_number(item)
  609.           @recipe[item] = recipe
  610.         end
  611.       end
  612.     end
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # ● 項目の描畫
  616.   #--------------------------------------------------------------------------
  617.   def draw_item(index)
  618.     item = @data[index]
  619.     rect = item_rect(index)
  620.     draw_item_name(item, rect.x, rect.y, enable?(item))
  621.     rect.width -= 4
  622.     draw_text(rect, price(item), 2)  if WD_itemsynthesis_ini::Cost_view
  623.   end
  624.   #--------------------------------------------------------------------------
  625.   # ● ステータスウィンドウの設定
  626.   #--------------------------------------------------------------------------
  627.   def status_window=(status_window)
  628.     @status_window = status_window
  629.     call_update_help
  630.   end
  631.   #--------------------------------------------------------------------------
  632.   # ● 素材ウィンドウの設定
  633.   #--------------------------------------------------------------------------
  634.   def material_window=(material_window)
  635.     @material_window = material_window
  636.     call_update_help
  637.   end
  638.   #--------------------------------------------------------------------------
  639.   # ● ヘルプテキスト更新
  640.   #--------------------------------------------------------------------------
  641.   def update_help
  642.     @help_window.set_item(item) if @help_window
  643.     @status_window.item = item if @status_window
  644.     @material_window.set(item, recipe(item)) if @material_window
  645.   end
  646.   #--------------------------------------------------------------------------
  647.   # ● Z ボタン(表示切替)が押されたときの處理
  648.   #--------------------------------------------------------------------------
  649.   def process_change_window
  650.     Sound.play_cursor
  651.     Input.update
  652.     call_handler(:change_window)
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # ● 決定やキャンセルなどのハンドリング處理
  656.   #--------------------------------------------------------------------------
  657.   def process_handling
  658.     super
  659.     if active
  660.       return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
  661. #      return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
  662.     end
  663.   end
  664. end


  665. #==============================================================================
  666. # ■ Window_ItemSynthesisMaterial
  667. #------------------------------------------------------------------------------
  668. #  合成畫面で、合成に必要な素材を表示するウィンドウです。
  669. #==============================================================================

  670. class Window_ItemSynthesisMaterial < Window_Base
  671.   #--------------------------------------------------------------------------
  672.   # ● オブジェクト初期化
  673.   #--------------------------------------------------------------------------
  674.   def initialize(x, y, width, height)
  675.     super(x, y, width, height)
  676.     @item = nil
  677.     refresh
  678.   end
  679.   #--------------------------------------------------------------------------
  680.   # ● リフレッシュ
  681.   #--------------------------------------------------------------------------
  682.   def refresh
  683.     contents.clear
  684.     draw_possession(4, 0)
  685.     draw_material_info(0, line_height * 2)
  686.   end
  687.   #--------------------------------------------------------------------------
  688.   # ● アイテムの設定
  689.   #--------------------------------------------------------------------------
  690.   def set(item, recipe)
  691.     @item = item
  692.     @recipe = recipe
  693.     @make_number = 1
  694.     refresh
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # ● 作成個數の設定
  698.   #--------------------------------------------------------------------------
  699.   def set_num(make_number)
  700.     @make_number = make_number
  701.     refresh
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # ● 所持數の描畫
  705.   #--------------------------------------------------------------------------
  706.   def draw_possession(x, y)
  707.     rect = Rect.new(x, y, contents.width - 4 - x, line_height)
  708.     change_color(system_color)
  709.     draw_text(rect, Vocab::Possession)
  710.     change_color(normal_color)
  711.     draw_text(rect, $game_party.item_number(@item), 2)
  712.   end
  713.   #--------------------------------------------------------------------------
  714.   # ● 素材情報の描畫
  715.   #--------------------------------------------------------------------------
  716.   def draw_material_info(x, y)
  717.     rect = Rect.new(x, y, contents.width, line_height)
  718.     change_color(system_color)
  719.     contents.font.size = 18
  720.     draw_text(rect, "必要素材", 0)
  721.     if @recipe
  722.       for i in [email]1...@recipe.size[/email]
  723.         kind = @recipe[i][0]
  724.         id   = @recipe[i][1]
  725.         num  = @recipe[i][2]
  726.         if kind == "I"
  727.           item = $data_items[id]
  728.         elsif kind == "W"
  729.           item = $data_weapons[id]
  730.         elsif kind == "A"
  731.           item = $data_armors[id]
  732.         end
  733.         rect = Rect.new(x, y + line_height*i, contents.width, line_height)
  734.         enabled = true
  735.         enabled = false if [num*@make_number, 1].max  > $game_party.item_number(item)
  736.         draw_item_name(item, rect.x, rect.y, enabled)
  737.         change_color(normal_color, enabled)
  738.         if num > 0
  739.           draw_text(rect, "#{num*@make_number}/#{$game_party.item_number(item)}", 2)
  740.         end
  741.       end
  742.     end
  743.     change_color(normal_color)
  744.     contents.font.size = 24
  745.   end
  746. end


  747. #==============================================================================
  748. # ■ Window_ItemSynthesisNumber
  749. #------------------------------------------------------------------------------
  750. #  合成畫面で、合成するアイテムの個數を入力するウィンドウです。
  751. #==============================================================================

  752. class Window_ItemSynthesisNumber < Window_ShopNumber
  753.   #--------------------------------------------------------------------------
  754.   # ● リフレッシュ
  755.   #--------------------------------------------------------------------------
  756.   def refresh
  757.     contents.clear
  758.     draw_item_name(@item, 0, item_y)
  759.     draw_number
  760.     draw_total_price if WD_itemsynthesis_ini::Cost_view
  761.   end
  762.   #--------------------------------------------------------------------------
  763.   # ● オブジェクト初期化
  764.   #--------------------------------------------------------------------------
  765.   def material_window=(material_window)
  766.     @material_window = material_window
  767.     call_update_help
  768.   end
  769.   #--------------------------------------------------------------------------
  770.   # ● 作成個數の変更
  771.   #--------------------------------------------------------------------------
  772.   def change_number(amount)
  773.     @number = [[@number + amount, @max].min, 1].max
  774.     call_update_help #追加
  775.   end
  776.   #--------------------------------------------------------------------------
  777.   # ● ヘルプテキスト更新
  778.   #--------------------------------------------------------------------------
  779.   def call_update_help
  780.     @material_window.set_num(@number) if @material_window
  781.   end
  782.   #--------------------------------------------------------------------------
  783.   # ● Z ボタン(表示切替)が押されたときの處理
  784.   #--------------------------------------------------------------------------
  785.   def process_change_window
  786.     Sound.play_cursor
  787.     Input.update
  788.     call_handler(:change_window)
  789.   end
  790.   #--------------------------------------------------------------------------
  791.   # ● 決定やキャンセルなどのハンドリング處理
  792.   #--------------------------------------------------------------------------
  793.   def process_handling
  794.     super
  795.     if active
  796.       return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
  797. #      return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
  798.     end
  799.   end
  800. end


  801. #==============================================================================
  802. # ■ Window_ItemSynthesisCategory
  803. #------------------------------------------------------------------------------
  804. #  合成畫面で、通常アイテムや裝備品の分類を選択するウィンドウです。
  805. #==============================================================================

  806. class Window_ItemSynthesisCategory < Window_ItemCategory
  807.   #--------------------------------------------------------------------------
  808.   # ● 桁數の取得
  809.   #--------------------------------------------------------------------------
  810.   def col_max
  811.     i = 0
  812.     i += 1 if WD_itemsynthesis_ini::Category_i
  813.     i += 1 if WD_itemsynthesis_ini::Category_w
  814.     i += 1 if WD_itemsynthesis_ini::Category_a
  815.     i += 1 if WD_itemsynthesis_ini::Category_k
  816.     return i
  817.   end
  818.   #--------------------------------------------------------------------------
  819.   # ● コマンドリストの作成
  820.   #--------------------------------------------------------------------------
  821.   def make_command_list
  822.     add_command(Vocab::item,     :item)     if WD_itemsynthesis_ini::Category_i
  823.     add_command(Vocab::weapon,   :weapon)   if WD_itemsynthesis_ini::Category_w
  824.     add_command(Vocab::armor,    :armor)    if WD_itemsynthesis_ini::Category_a
  825.     add_command(Vocab::key_item, :key_item) if WD_itemsynthesis_ini::Category_k
  826.   end
  827. end


  828. #==============================================================================
  829. # ■ Window_ItemSynthesisNumber
  830. #------------------------------------------------------------------------------
  831. #  合成畫面で、切替を表示するウィンドウです。
  832. #==============================================================================

  833. class Window_ItemSynthesisChange < Window_Base
  834.   #--------------------------------------------------------------------------
  835.   # ● オブジェクト初期化
  836.   #--------------------------------------------------------------------------
  837.   def initialize(x, y, width, height)
  838.     super(x, y, width, height)
  839.     refresh
  840.   end
  841.   #--------------------------------------------------------------------------
  842.   # ● リフレッシュ
  843.   #--------------------------------------------------------------------------
  844.   def refresh
  845.     contents.clear
  846.     text = "素材 ⇔ 合成物品 切換"
  847.     draw_text(0, 0, contents_width, line_height, text, 1)
  848.   end
  849. end
复制代码


这个是商店显示机能扩张的脚本
点击展开/收起
  1. #******************************************************************************
  2. #
  3. #    * <拡張> ショップステータス
  4. #
  5. #  --------------------------------------------------------------------------
  6. #    バージョン :  1.0.0
  7. #    対      応 :  RPGツクールVX Ace : RGSS3
  8. #    制  作  者 :  CACAO
  9. #    配  布  元 :  [url]http://cacaosoft.web.fc2.com/[/url]
  10. #  --------------------------------------------------------------------------
  11. #   == 概    要 ==
  12. #
  13. #   : ショップ画面で回復量やパラメータの変化量を表示します。
  14. #
  15. #  --------------------------------------------------------------------------
  16. #   == 注意事項 ==
  17. #
  18. #    ※ エイリアスを用いない再定義を多用しています。
  19. #       なるべく上の方に導入してください。
  20. #   
  21. #
  22. #******************************************************************************


  23. #==============================================================================
  24. # ◆ 設定項目
  25. #==============================================================================
  26. module CAO
  27. module ShopStatus
  28.   #--------------------------------------------------------------------------
  29.   # ◇ 効果範囲を表示する
  30.   #--------------------------------------------------------------------------
  31.   SHOW_EFFECT_SCOPE = true
  32.   #--------------------------------------------------------------------------
  33.   # ◇ 戦闘中使用を表示する
  34.   #--------------------------------------------------------------------------
  35.   SHOW_USABLE_OCCASION = true
  36.   
  37.   #--------------------------------------------------------------------------
  38.   # ◇ HP・MP回復量を表示する
  39.   #--------------------------------------------------------------------------
  40.   SHOW_ITEM_EFFECTS = true
  41.   #--------------------------------------------------------------------------
  42.   # ◇ TP増加量を表示する
  43.   #--------------------------------------------------------------------------
  44.   SHOW_GAIN_TP = true
  45.   
  46.   #--------------------------------------------------------------------------
  47.   # ◇ ステート変化を表示する
  48.   #--------------------------------------------------------------------------
  49.   SHOW_STATES = true
  50.   #--------------------------------------------------------------------------
  51.   # ◇ 付加ステートも表示する
  52.   #--------------------------------------------------------------------------
  53.   SHOW_ADD_STATES = true
  54.   #--------------------------------------------------------------------------
  55.   # ◇ 解除ステートの上に描画するアイコン
  56.   #--------------------------------------------------------------------------
  57.   ICON_REMOVE_STATES = 141
  58.   #--------------------------------------------------------------------------
  59.   # ◇ 付加ステートの上に描画するアイコン
  60.   #--------------------------------------------------------------------------
  61.   ICON_ADD_STATES = 142
  62.   
  63.   #--------------------------------------------------------------------------
  64.   # ◇ 装備品時に表示するパラメータ
  65.   #--------------------------------------------------------------------------
  66.   PARAMS = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
  67.   #--------------------------------------------------------------------------
  68.   # ◇ 装備可能なアクターのみ表示
  69.   #--------------------------------------------------------------------------
  70.   SHOW_EQUIPPABLE_ACTOR = false
  71.   #--------------------------------------------------------------------------
  72.   # ◇ 装備可能なアクターのパラメータのみ表示
  73.   #--------------------------------------------------------------------------
  74.   SHOW_EQUIPPABLE_PARAMS = true
  75.   #--------------------------------------------------------------------------
  76.   # ◇ 装備中マークの設定
  77.   #--------------------------------------------------------------------------
  78.   ICON_EQUIPPED_MARK = ["E", 14]
  79.   #--------------------------------------------------------------------------
  80.   # ◇ 装備中マークをアクターに重ねる
  81.   #--------------------------------------------------------------------------
  82.   ON_EQUIPPED_MARK = true
  83.   
  84.   #--------------------------------------------------------------------------
  85.   # ◇ テキスト
  86.   #--------------------------------------------------------------------------
  87.   VOCAB_EFFECT_SCOPE = ["效果範圍", "無", "單人", "複數隨機", "全體"]
  88.   VOCAB_USABLE_OCCASION =
  89.     ["使用限制", "時常", "戰鬥中", "選單中", "不能使用"]
  90.   VOCAB_EFFECT_HP = "HP恢復量"
  91.   VOCAB_EFFECT_MP = "MP恢復量"
  92.   VOCAB_EFFECT_TP = "TP增加量"
  93.   VOCAB_CHANGE_STATE = "附加/解除狀態"
  94.   
  95.   VOCAB_RATE_UNIT = "%"
  96.   VOCAB_POINT_UNIT = ""
  97.   
  98.   VOCAB_PARAMS = {}
  99.   VOCAB_PARAMS[:mhp] = "最大HP"
  100.   VOCAB_PARAMS[:mmp] = "最大MP"
  101.   VOCAB_PARAMS[:atk] = "攻擊力"
  102.   VOCAB_PARAMS[:def] = "防禦力"
  103.   VOCAB_PARAMS[:mat] = "魔法攻撃"
  104.   VOCAB_PARAMS[:mdf] = "魔法防禦"
  105.   VOCAB_PARAMS[:agi] = "敏捷力"
  106.   VOCAB_PARAMS[:luk] = "幸運值"
  107. end # module ShopStatus
  108. end # module CAO


  109. #/////////////////////////////////////////////////////////////////////////////#
  110. #                                                                             #
  111. #                下記のスクリプトを変更する必要はありません。                 #
  112. #                                                                             #
  113. #/////////////////////////////////////////////////////////////////////////////#


  114. class Game_Actor
  115.   #--------------------------------------------------------------------------
  116.   # ● 公開インスタンス変数
  117.   #--------------------------------------------------------------------------
  118.   attr_accessor :icon_index               # アイコン インデックス
  119.   #--------------------------------------------------------------------------
  120.   # ● グラフィックの初期化
  121.   #--------------------------------------------------------------------------
  122.   alias cao_shopstatus_init_graphics init_graphics
  123.   def init_graphics
  124.     cao_shopstatus_init_graphics
  125.     @icon_index = 0
  126.   end
  127. end

  128. class Window_Base
  129.   #--------------------------------------------------------------------------
  130.   # ● 定数 (歩行アイコンの背景色)
  131.   #--------------------------------------------------------------------------
  132.   COLOR_AIB_1 = Color.new(0, 0, 0)          # アイコンの縁の色
  133.   COLOR_AIB_2 = Color.new(255, 255, 255)    # アイコンの背景色
  134.   #--------------------------------------------------------------------------
  135.   # ● 歩行アイコンの描画
  136.   #     enabled : 有効フラグ。false のとき半透明で描画
  137.   #--------------------------------------------------------------------------
  138.   def draw_character_icon(character_name, character_index, x, y, enabled = true)
  139.     self.contents.fill_rect(x, y, 24, 24, COLOR_AIB_1)
  140.     self.contents.fill_rect(x + 1, y + 1, 22, 22, COLOR_AIB_2)
  141.     if character_name
  142.       bitmap = Cache.character(character_name)
  143.       sign = character_name[/^[\!\$]./]
  144.       if sign != nil and sign.include?('$')
  145.         cw = bitmap.width / 3
  146.         ch = bitmap.height / 4
  147.       else
  148.         cw = bitmap.width / 12
  149.         ch = bitmap.height / 8
  150.       end
  151.       n = character_index
  152.       src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, 20, 20)
  153.       src_rect.x += (cw - src_rect.width) / 2
  154.       src_rect.y += (ch - src_rect.height) / 4
  155.       opacity = (enabled ? 255 : translucent_alpha)
  156.       self.contents.blt(x + 2, y + 2, bitmap, src_rect, opacity)
  157.     end
  158.   end
  159. end

  160. class Window_ShopStatus
  161.   include CAO::ShopStatus
  162.   #--------------------------------------------------------------------------
  163.   # ○ リフレッシュ
  164.   #--------------------------------------------------------------------------
  165.   def refresh
  166.     self.contents.clear
  167.     return unless @item
  168.     @param_y = 0        # 項目の描画位置
  169.     draw_possession(4, 0)
  170.     if @item.kind_of?(RPG::Item)
  171.       @item_effects = {}
  172.       @item.effects.each do |e|
  173.         @item_effects[e.code] ||= []
  174.         @item_effects[e.code] << e
  175.       end
  176.       draw_item_info(4, line_height * 1.5)
  177.     elsif @item.kind_of?(RPG::EquipItem)
  178.       draw_equip_info(4, line_height * 1.5 + 8)
  179.     end
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # ● アイテム情報の描画
  183.   #--------------------------------------------------------------------------
  184.   def draw_item_info(x, y)
  185.     @param_y = y
  186.     draw_item_scope(x, @param_y)
  187.     draw_item_occasion(x, @param_y)
  188.     @param_y += (line_height / 2) if SHOW_EFFECT_SCOPE || SHOW_USABLE_OCCASION
  189.     draw_item_effects(x, @param_y)
  190.     draw_item_states(x, @param_y)
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ● 効果範囲の描画
  194.   #--------------------------------------------------------------------------
  195.   def draw_item_scope(x, y)
  196.     return unless SHOW_EFFECT_SCOPE
  197.     dr = Rect.new(x, y, contents_width - 4 - x, line_height)
  198.     change_color(system_color)
  199.     draw_text(dr, VOCAB_EFFECT_SCOPE[0])
  200.     change_color(normal_color)
  201.     case @item.scope
  202.     when 0
  203.       draw_text(dr, VOCAB_EFFECT_SCOPE[1], 2)
  204.     when 1,3,7,9,11
  205.       draw_text(dr, VOCAB_EFFECT_SCOPE[2], 2)
  206.     when 4,5,6
  207.       draw_text(dr, VOCAB_EFFECT_SCOPE[3], 2)
  208.     when 2,8,10
  209.       draw_text(dr, VOCAB_EFFECT_SCOPE[4], 2)
  210.     else
  211.       raise "must not happen"
  212.     end
  213.     @param_y += line_height
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # ● 使用可能時の描画
  217.   #--------------------------------------------------------------------------
  218.   def draw_item_occasion(x, y)
  219.     return unless SHOW_USABLE_OCCASION
  220.     dr = Rect.new(x, y, contents_width - 4 - x, line_height)
  221.     change_color(system_color)
  222.     draw_text(dr, VOCAB_USABLE_OCCASION[0])
  223.     change_color(normal_color)
  224.     draw_text(dr, VOCAB_USABLE_OCCASION[@item.occasion + 1], 2)
  225.     @param_y += line_height
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # ● HP・MP・TPの回復量の描画
  229.   #--------------------------------------------------------------------------
  230.   def draw_item_effects(x, y)
  231.     return unless SHOW_ITEM_EFFECTS
  232.     ehp = @item_effects[Game_Battler::EFFECT_RECOVER_HP]
  233.     emp = @item_effects[Game_Battler::EFFECT_RECOVER_MP]
  234.    
  235.     dr = Rect.new(x, y, contents_width - 4 - x, line_height)
  236.     change_color(system_color)
  237.     draw_text(dr, VOCAB_EFFECT_HP)
  238.     dr.y += line_height
  239.     draw_text(dr, VOCAB_EFFECT_MP)
  240.    
  241.     dr.y = y
  242.     change_color(normal_color)
  243.     draw_text(dr, text_recovery_amount(ehp), 2)
  244.     dr.y += line_height
  245.     draw_text(dr, text_recovery_amount(emp), 2)
  246.    
  247.     if SHOW_GAIN_TP
  248.       etp = @item_effects[Game_Battler::EFFECT_GAIN_TP]
  249.       dr.y = y + line_height * 2
  250.       change_color(system_color)
  251.       draw_text(dr, VOCAB_EFFECT_TP)
  252.       change_color(normal_color)
  253.       text = "#{etp ? etp[0].value1.to_i : 0}#{VOCAB_RATE_UNIT}"
  254.       draw_text(dr, text, 2)
  255.     end
  256.     @param_y = dr.y + line_height * 1.5
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● HP・MP回復量をテキストで取得
  260.   #--------------------------------------------------------------------------
  261.   def text_recovery_amount(effects)
  262.     if effects
  263.       value1 = (effects[0].value1.to_f * 100).to_i
  264.       value2 = effects[0].value2.to_i
  265.     else
  266.       value1 = 0
  267.       value2 = 0
  268.     end
  269.     return "#{value2}#{VOCAB_POINT_UNIT}" if value1 == 0
  270.     return "#{value1}#{VOCAB_RATE_UNIT}" if value2 == 0
  271.     return "#{value1}#{VOCAB_RATE_UNIT} + #{value2}#{VOCAB_POINT_UNIT}"
  272.   end
  273.   #--------------------------------------------------------------------------
  274.   # ● ステートの描画
  275.   #--------------------------------------------------------------------------
  276.   def draw_item_states(x, y)
  277.     return unless SHOW_STATES
  278.    
  279.     change_color(system_color)
  280.     draw_text(x, y, contents_width - 4 - x, line_height, VOCAB_CHANGE_STATE)
  281.     x += (contents_width - 4 - x) % 24
  282.     y += line_height
  283.     erss = @item_effects[Game_Battler::EFFECT_REMOVE_STATE] || []
  284.     draw_states_icon(x, y, erss, 0, ICON_REMOVE_STATES)
  285.     eass = @item_effects[Game_Battler::EFFECT_ADD_STATE] || []
  286.     draw_states_icon(x, y, eass, erss.size, ICON_ADD_STATES) if SHOW_ADD_STATES
  287.     unless !erss.empty? || (SHOW_ADD_STATES && !eass.empty?)
  288.       change_color(normal_color)
  289.       draw_text(x, y, contents_width - 4 - x, line_height, "無")
  290.     end
  291.     icon_line_max = (contents_width - 4 - x) / 24   # 1行に表示できる数
  292.     @param_y = y + line_height / 2
  293.     @param_y += ((erss.size + eass.size) / icon_line_max + 1) * line_height
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # ● ステートアイコンの描画
  297.   #     super_icon_index : 重ねるアイコンの番号
  298.   #--------------------------------------------------------------------------
  299.   def draw_states_icon(x, y, effects, index, super_icon_index)
  300.     icon_line_max = (contents_width - 4 - x) / 24
  301.     effects.each do |e|
  302.       next if e.data_id == 0
  303.       draw_state_icon(
  304.         x + (index % icon_line_max) * 24,
  305.         y + (index / icon_line_max) * line_height,
  306.         $data_states[e.data_id].icon_index, super_icon_index)
  307.       index += 1
  308.     end
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● ステートアイコンの描画
  312.   #     state_icon_index : ステートアイコンの番号
  313.   #     super_icon_index : 重ねるアイコンの番号
  314.   #--------------------------------------------------------------------------
  315.   def draw_state_icon(x, y, state_icon_index, super_icon_index)
  316.     draw_icon(state_icon_index, x, y)
  317.     case super_icon_index
  318.     when nil
  319.       return
  320.     when String
  321.       bitmap = Cache.system(super_icon_index)
  322.       self.contents.blt(x, y, bitmap, bitmap.rect)
  323.     else
  324.       draw_icon(super_icon_index, x, y)
  325.     end
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● 能力強化/弱体化の描画
  329.   #--------------------------------------------------------------------------
  330.   def draw_item_buff(x, y)
  331.   end
  332.   def draw_item_buffs(x, y)
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● 成長パラメータの描画
  336.   #--------------------------------------------------------------------------
  337.   def draw_item_grows(x, y)
  338.   end
  339. end

  340. class Window_ShopStatus
  341.   #--------------------------------------------------------------------------
  342.   # ● 定数
  343.   #--------------------------------------------------------------------------
  344.   ACTOR_WIDTH = 36                        # 各アクターの横幅
  345.   PARAM_WIDTH_MAX = 96                    # パラメータ名の最大横幅
  346.   #--------------------------------------------------------------------------
  347.   # ● 定数(IDへの変換用)
  348.   #--------------------------------------------------------------------------
  349.   PARAM_ID = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk, :hit]
  350.   #--------------------------------------------------------------------------
  351.   # ○ 装備情報を描画するアクターの配列
  352.   #--------------------------------------------------------------------------
  353.   def status_members
  354.     if SHOW_EQUIPPABLE_ACTOR
  355.       member = $game_party.members.select {|actor| actor.equippable?(@item) }
  356.       return member[@page_index * page_size, page_size]
  357.     else
  358.       return $game_party.members[@page_index * page_size, page_size]
  359.     end
  360.   end
  361.   #--------------------------------------------------------------------------
  362.   # ○ アイテムの設定
  363.   #--------------------------------------------------------------------------
  364.   def item=(item)
  365.     @page_index = 0 if SHOW_EQUIPPABLE_ACTOR
  366.     @item = item
  367.     refresh
  368.   end
  369.   #--------------------------------------------------------------------------
  370.   # ○ 一度に表示できるアクターの人数
  371.   #--------------------------------------------------------------------------
  372.   def page_size
  373.     [4, (contents_width - PARAM_WIDTH_MAX) / ACTOR_WIDTH].max
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ○ 最大ページ数の取得
  377.   #--------------------------------------------------------------------------
  378.   def page_max
  379.     if SHOW_EQUIPPABLE_ACTOR
  380.       member = $game_party.members.select {|actor| actor.equippable?(@item) }
  381.       return (member.size + page_size - 1) / page_size
  382.     else
  383.       return ($game_party.members.size + page_size - 1) / page_size
  384.     end
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ●
  388.   #--------------------------------------------------------------------------
  389.   def actor_icon_margin
  390.     return (ACTOR_WIDTH - 24) / 2
  391.   end
  392.   #--------------------------------------------------------------------------
  393.   # ● パラメータ名の横幅
  394.   #--------------------------------------------------------------------------
  395.   def param_width
  396.     return [PARAM_WIDTH_MAX, contents_width - page_size * ACTOR_WIDTH].min
  397.   end
  398.   #--------------------------------------------------------------------------
  399.   # ○ 装備情報の描画
  400.   #--------------------------------------------------------------------------
  401.   def draw_equip_info(x, y)
  402.     icon_y = y
  403.     param_y = y + line_height * 1.5
  404.     unless ON_EQUIPPED_MARK
  405.       icon_y += line_height
  406.       param_y += line_height
  407.     end
  408.     draw_parameters_name(x, param_y)
  409.     x = param_width
  410.     status_members.each_with_index do |actor, i|
  411.       draw_actor_icon(x + actor_icon_margin, y, actor)
  412.       draw_actor_equipped_mark(x, icon_y, actor)
  413.       draw_actor_equip_info(x, param_y, actor)
  414.       x += ACTOR_WIDTH
  415.     end
  416.   end
  417.   #--------------------------------------------------------------------------
  418.   # ● パラメータ名の描画
  419.   #--------------------------------------------------------------------------
  420.   def draw_parameters_name(x, y)
  421.     width = param_width
  422.     change_color(system_color)
  423.     PARAMS.each_with_index do |param, i|
  424.       draw_text(x, y, width, line_height, VOCAB_PARAMS[param])
  425.       y += line_height
  426.     end
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ● アクターアイコンの描画
  430.   #--------------------------------------------------------------------------
  431.   def draw_actor_icon(x, y, actor)
  432.     enabled = actor.equippable?(@item)
  433.     if actor.icon_index > 0
  434.       bitmap = Cache.system("ActorIconSet")
  435.       rect = Rect.new(actor.icon_index%16*24, actor.icon_index/16*24, 24, 24)
  436.       self.contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  437.     else
  438.       draw_character_icon(
  439.         actor.character_name, actor.character_index, x, y, enabled)
  440.     end
  441.   end
  442.   #--------------------------------------------------------------------------
  443.   # ● 装備中マークの描画
  444.   #--------------------------------------------------------------------------
  445.   def draw_actor_equipped_mark(x, y, actor)
  446.     return unless actor.equips.include?(@item)
  447.     case ICON_EQUIPPED_MARK
  448.     when nil
  449.       return
  450.     when String
  451.       x += actor_icon_margin
  452.       bitmap = Cache.system(ICON_EQUIPPED_MARK)
  453.       self.contents.blt(x, y, bitmap, bitmap.rect)
  454.     when Integer
  455.       x += actor_icon_margin
  456.       draw_icon(ICON_EQUIPPED_MARK, x, y)
  457.     when Array
  458.       change_color(text_color(ICON_EQUIPPED_MARK[1]))
  459.       if ON_EQUIPPED_MARK
  460.         self.contents.font.size = 16
  461.         draw_text(x, y + 12, ACTOR_WIDTH, 16, ICON_EQUIPPED_MARK[0], 2)
  462.         self.contents.font.size = Font.default_size
  463.       else
  464.         draw_text(x, y + 4, ACTOR_WIDTH, line_height, ICON_EQUIPPED_MARK[0], 1)
  465.       end
  466.     end
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # ○ アクターの装備情報の描画
  470.   #--------------------------------------------------------------------------
  471.   def draw_actor_equip_info(x, y, actor)
  472.     enabled = actor.equippable?(@item)
  473.     change_color(normal_color, enabled)
  474.     item1 = current_equipped_item(actor, @item.etype_id)
  475.     if !SHOW_EQUIPPABLE_PARAMS || enabled
  476.       draw_actor_param_change(x, y, actor, item1)
  477.     end
  478.   end
  479.   #--------------------------------------------------------------------------
  480.   # ○ アクターの能力値変化の描画
  481.   #--------------------------------------------------------------------------
  482.   def draw_actor_param_change(x, y, actor, item1)
  483.     self.contents.font.size = 18
  484.     rect = Rect.new(x, y, ACTOR_WIDTH, line_height)
  485.     if actor.equippable?(@item)
  486.       PARAMS.each_with_index do |param,i|
  487.         param_id = PARAM_ID.index(param)
  488.         change = @item.params[param_id] - (item1 ? item1.params[param_id] : 0)
  489.         change_color(param_change_color(change))
  490.         rect.y = y + line_height * i
  491.         draw_text(rect, (change.zero? ? "-" : sprintf("%+d", change)), 1)
  492.       end
  493.     else
  494.       change_color(normal_color, false)
  495.       PARAMS.size.times do |i|
  496.         rect.y = y + line_height * i
  497.         draw_text(rect, "-", 1)
  498.       end
  499.     end
  500.     self.contents.font.size = Font.default_size
  501.   end
  502. end
复制代码


想请问有方法能整合两个脚本吗?
我想"商店显示机能扩张"这个脚本也能套用在"合成系统介面"脚本中 求各位大神帮忙
梦石
0
星屑
2116
在线时间
950 小时
注册时间
2015-7-16
回帖
692

开拓者

发表于 2017-2-11 20:40:28 | 显示全部楼层
樓主是想合成系統的顯示機能也能擴張嗎?
(先卡個樓

点评

大神能详细吗  发表于 2017-2-11 22:24
那你快答吧,改一下窗口就可以了  发表于 2017-2-11 21:12
我也挺感興趣的XD 貌似很有趣的樣子w  发表于 2017-2-11 21:01
卡甚麼卡,你是要答題還是在做死w  发表于 2017-2-11 20:46

评分

参与人数 1星屑 -1 收起 理由
RaidenInfinity -1 版规B-5-a

查看全部评分

[神性领域扩张:扩张神性领域]
说了等于没说.
回复

使用道具 举报

梦石
0
星屑
80
在线时间
91 小时
注册时间
2017-2-4
回帖
15
 楼主| 发表于 2017-2-11 20:43:18 | 显示全部楼层
duzine 发表于 2017-2-11 20:40
樓主是想合成系統的顯示機能也能擴張嗎?
(先卡個樓

对 就是这样了 请问有方法吗?
回复

使用道具 举报

梦石
0
星屑
80
在线时间
91 小时
注册时间
2017-2-4
回帖
15
 楼主| 发表于 2017-2-12 21:50:40 | 显示全部楼层
在还没过期前再求救一下。 。 。谢谢
回复

使用道具 举报

梦石
0
星屑
80
在线时间
91 小时
注册时间
2017-2-4
回帖
15
 楼主| 发表于 2017-2-18 11:33:28 | 显示全部楼层
求救一下。 。 。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部