设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 6776|回复: 20
打印 上一主题 下一主题

[已经解决] 使用了合成商店脚本以后里面一片空白(=゚Д゚=)

[复制链接]

Lv1.梦旅人

梦石
0
星屑
70
在线时间
5 小时
注册时间
2018-3-23
帖子
8
跳转到指定楼层
1
发表于 2018-3-24 12:41:28 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
现在是这个状态(´·ω·`) ……
使用的是白の魔大大的脚本,

比如说W_recipe[66] = [300, ["W",23,1], ["I",28,15]]
这个配方,里面的道具编号该从哪里看?就是数据库里道具前面的编号吗?(=゚Д゚=)

Lv3.寻梦者

梦石
0
星屑
3614
在线时间
898 小时
注册时间
2017-10-30
帖子
347
2
发表于 2018-3-24 12:49:04 | 只看该作者
添加配方:事件→高级→脚本
  1. W_recipe[66] = [300, ["W",23,1], ["I",28,15]]
复制代码

点评

这个只能添加配方,是不开启的。楼主没错,就是没开这个配方而已  发表于 2018-3-24 13:04
啥都会,啥都不擅长
一个VA群:679174724 欢迎来玩
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1345
在线时间
378 小时
注册时间
2015-6-16
帖子
571
3
发表于 2018-3-24 13:05:38 | 只看该作者
本帖最后由 300英雄 于 2018-3-24 13:09 编辑

i_recipe_switch_on(2) i_中的i可以改成aw表示防具和武器的开启 2是配方的ID
i_recipe_switch_on(2)开启2号物品配方
a_recipe_switch_on(3)开启3号防具配方
w_recipe_switch_on(4)开启4号武器配方

i_recipe_switch_off(2)关闭2号物品配方
a_recipe_switch_off(3)关闭3号防具配方
w_recipe_switch_off(4)关闭4号武器配方

i_recipe_switch_on?(2)开启了2号物品配方?
a_recipe_switch_on?(3)开启了3号防具配方?
w_recipe_switch_on?(4)开启了4号武器配方?

i_recipe_all_switch_on 开启所有物品配方
a_recipe_all_switch_on开启所有防具配方
w_recipe_all_switch_on开启所有武器配方



recipe_all_switch_on开启所有配方
recipe_all_switch_off 关闭所有配方

点评

星屑666留念  发表于 2018-3-25 02:28
P1不太上了,有问题加个Q1286124843,不管是脚本还是游戏问题都可以来找我
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
5 小时
注册时间
2018-3-23
帖子
8
4
 楼主| 发表于 2018-3-24 13:19:04 | 只看该作者
MireniamuYuki 发表于 2018-3-24 12:49
添加配方:事件→高级→脚本

谢谢指教(´·ω·`) 丿!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
5 小时
注册时间
2018-3-23
帖子
8
5
 楼主| 发表于 2018-3-24 13:20:42 | 只看该作者
300英雄 发表于 2018-3-24 13:05
i_recipe_switch_on(2)  i_中的i可以改成a和w表示防具和武器的开启 2是配方的ID
i_recipe_switch_on(2)开启 ...

感谢大大的帮助(´·ω·`) 丿!

点评

这个加配方,其实就是加了一个数组进去,可以自己改的  发表于 2018-3-24 13:21
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1550
在线时间
241 小时
注册时间
2017-11-11
帖子
33
6
发表于 2018-3-24 15:02:05 手机端发表。 | 只看该作者
脚本里面设置的id你的软件里面必须要有已创建的id我之前也碰到过这种情况
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
5 小时
注册时间
2018-3-23
帖子
8
7
 楼主| 发表于 2018-3-24 15:46:38 | 只看该作者
q1140038 发表于 2018-3-24 15:02
脚本里面设置的id你的软件里面必须要有已创建的id我之前也碰到过这种情况

请问一下这个ID从哪里看呢?设置了几次都提示错误

点评

ID是你数据库的ID:默认来讲恢复剂左边有个001他就是1号,就看名字左边的编号,你看獠牙写着020他就是20,獠牙2写着021他就是21  发表于 2018-3-25 14:03
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
5 小时
注册时间
2018-3-23
帖子
8
8
 楼主| 发表于 2018-3-24 15:57:09 | 只看该作者
300英雄 发表于 2018-3-24 13:05
i_recipe_switch_on(2)  i_中的i可以改成a和w表示防具和武器的开启 2是配方的ID
i_recipe_switch_on(2)开启 ...


大佬,比如说我用这三个物品要合成数据库里30号的武器
公式是不是这样就可以了?


还有这里原本是ID,我填上1或者30都是提示脚本错误,大佬能指教一下是什么原因吗(´·ω·`) ?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1550
在线时间
241 小时
注册时间
2017-11-11
帖子
33
9
发表于 2018-3-24 17:56:28 | 只看该作者
鈴白瑞樹 发表于 2018-3-24 15:57
大佬,比如说我用这三个物品要合成数据库里30号的武器
公式是不是这样就可以了?

应该是了吧,但是你数据库里30号就要设置一个如獠牙4的物品,如果没设置就显示不出来的。

点评

错了,def是方法而且不需要这样改,脚本别去动  发表于 2018-3-25 11:22
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
5 小时
注册时间
2018-3-23
帖子
8
10
 楼主| 发表于 2018-3-24 22:47:06 | 只看该作者
q1140038 发表于 2018-3-24 17:56
应该是了吧,但是你数据库里30号就要设置一个如獠牙4的物品,如果没设置就显示不出来的。 ...

dalao我现在的代码是这样:
RUBY 代码复制
  1. #==============================================================================
  2. # ■ RGSS3 アイテム合成 ver 1.02
  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. #    合成レシピ等の設定
  18. #--------------------------------------------------------------------------
  19. module WD_itemsynthesis_ini
  20.  
  21.   Cost_view =  true #費用(G)の表示(合成の費用が全て0Gの場合はfalseを推奨)
  22.  
  23.   Category_i = true #カテゴリウィンドウに「アイテム」の項目を表示
  24.   Category_w = true #カテゴリウィンドウに「武器」の項目を表示
  25.   Category_a = true #カテゴリウィンドウに「防具」の項目を表示
  26.   Category_k = true #カテゴリウィンドウに「大事なもの」の項目を表示
  27.  
  28.   I_recipe = [] #この行は削除しないこと
  29.   W_recipe = [] #この行は削除しないこと
  30.   A_recipe = [] #この行は削除しないこと
  31.  
  32.   #以下、合成レシピ。
  33.   #例: I_recipe[3]  = [100, ["I",1,1], ["W",2,1], ["A",2,2], ["A",3,1]]
  34.   #と記載した場合、ID3のアイテムの合成必要は、100G。
  35.   #必要な素材は、ID1のアイテム1個、ID2の武器1個、ID2の防具2個、ID3の防具1個
  36.   #となる。
  37.   #I代表物品 W代表武器 A代表防具
  38.   #  [合成物品ID],[需要多少钱],[]
  39.   I_recipe[2]  = [50,  ["I",1,2]]#合成2号物品需要1号物品2个和50G金币
  40.   I_recipe[3]  = [100, ["I",1,1], ["I",2,1]]
  41.   I_recipe[8]  = [200, ["I",1,2], ["I",4,1], ["I",5,1]]
  42.   I_recipe[34]  = [400, ["I",7,2], ["I",8,2], ["I",33,3], ["I",35,3]]
  43.   I_recipe[32]  = [400, ["I",17,6], ["I",18,7], ["I",19,8]]
  44.   I_recipe[40]  = [400, ["I",7,2], ["I",8,2]]
  45.   I_recipe[41]  = [400, ["I",1,1], ["I",4,1]]
  46.   I_recipe[42]  = [500, ["I",8,2], ["I",33,5], ["I",35,5]]
  47.   I_recipe[71]  = [500, ["I",53,4], ["I",54,3], ["I",55,2]]
  48.   I_recipe[72]  = [1500, ["I",53,4], ["I",54,3], ["I",55,2]]
  49.   I_recipe[45]  = [1500, ["I",22,1], ["I",23,1], ["I",24,1], ["I",25,1], ["I",26,1], ["I",27,1], ["I",28,1], ["I",29,1]]
  50.   I_recipe[53]  = [1500, ["I",1,5], ["I",4,3]]
  51.   #米德辛合成表
  52.     I_recipe[48]  = [50, ["I",2,1], ["I",2,1], ["I",6,1]]
  53. I_recipe[86]  = [50, ["I",1,2], ["I",2,4]]
  54. I_recipe[120]  = [50, ["I",30,3], ["I",31,5]]
  55. I_recipe[119]  = [50, ["I",5,2], ["I",6,3], ["I",7,3]]
  56. I_recipe[118]  = [50, ["I",17,2], ["I",18,2], ["I",19,3]]
  57. I_recipe[114]  = [50, ["I",8,3]]
  58.  
  59.  
  60.  
  61.  
  62.  
  63.   I_recipe[54]  = [600, ["I",5,2], ["I",6,3], ["I",8,1]]
  64.   I_recipe[55]  = [600, ["I",5,2], ["I",6,3], ["I",8,1]]
  65.   I_recipe[56]  = [600, ["I",55,1], ["I",54,1], ["I",53,1]]
  66.   I_recipe[156]  = [50, ["I",9,15], ["I",10,15], ["I",11,15], ["I",12,15], ["I",13,15], ["I",14,15], ["I",15,15], ["I",16,15]]
  67.  
  68.   #武器の合成レシピ
  69.   W_recipe[3]  = [500,   ["I",18,1], ["I",17,1]]
  70.   W_recipe[65]  = [200,   ["I",36,1], ["I",37,1]]
  71.   W_recipe[72]  = [2000,   ["I",70,6], ["I",72,6]]
  72.   W_recipe[73]  = [2000,   ["I",70,6], ["I",72,6]]
  73.   W_recipe[74]  = [2000,   ["I",70,6], ["I",72,6]]
  74.   W_recipe[75]  = [2000,   ["I",70,6], ["I",72,6]]
  75.   W_recipe[77]  = [2500,   ["I",36,10], ["I",83,4], ["I",80,2], ["I",34,3]]
  76.   #W_recipe[6]  = [600,  ["W",3,1], ["I",17,0]]
  77.  
  78.   #防具の合成レシピ  
  79.   A_recipe[62]  = [500,   ["I",34,20]]
  80.   A_recipe[61]  = [500,   ["I",33,5], ["I",35,5]]
  81.   A_recipe[82]  = [2000,   ["I",33,8], ["I",70,6]]
  82.   A_recipe[83]  = [2000,   ["I",71,6], ["I",70,6]]
  83.   A_recipe[86]  = [2000,   ["I",33,8], ["I",70,6], ["I",34,8]]
  84.   A_recipe[87]  = [2000,   ["I",36,8], ["I",70,6], ["I",34,8]]
  85.   A_recipe[84]  = [2000,   ["I",71,5], ["I",70,6]]
  86.   A_recipe[85]  = [2000,   ["I",33,8], ["I",70,6], ["I",34,8]]
  87.   A_recipe[88]  = [2000,   ["I",34,8], ["I",70,6], ["W",54,2]]
  88.   A_recipe[89]  = [2000,   ["I",33,8], ["I",70,6], ["I",34,8], ["I",36,8]]
  89.   A_recipe[75]  = [2200,   ["I",36,6], ["I",37,8], ["I",21,10]]
  90.   A_recipe[100]  = [1800,   ["I",79,85], ["I",53,62], ["I",54,30], ["I",55,45]]
  91.    A_recipe[101]  = [3200,   ["I",45,15], ["I",34,55], ["I",72,50]]
  92.   #A_recipe[5]  = [400,  ["A",2,1], ["W",2,2], ["I",17,0]]
  93.  
  94. end
  95.  
  96.  
  97. #==============================================================================
  98. # ■ WD_itemsynthesis
  99. #------------------------------------------------------------------------------
  100. #  アイテム合成用の共通メソッドです。
  101. #==============================================================================
  102.  
  103. module WD_itemsynthesis
  104.   def i_recipe_switch_on(id)
  105.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  106.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  107.     $game_system.i_rcp_sw[id] = true
  108.   end
  109.   def i_recipe_switch_off(id)
  110.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  111.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  112.     $game_system.i_rcp_sw[id] = false
  113.   end
  114.   def i_recipe_switch_on?(id)
  115.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  116.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  117.     return $game_system.i_rcp_sw[id]
  118.   end
  119.   def i_recipe_all_switch_on
  120.     for i in 1..$data_items.size
  121.       i_recipe_switch_on(i)
  122.     end
  123.   end
  124.   def i_recipe_all_switch_off
  125.     for i in 1..$data_items.size
  126.       i_recipe_switch_off(i)
  127.     end
  128.   end
  129.   def w_recipe_switch_on(w)
  130.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  131.     $game_system.w_rcp_sw[1] = true if $game_system.w_rcp_sw[1] == nil
  132.     $game_system.w_rcp_sw[1] = true
  133.   end
  134.   def w_recipe_switch_off(id)
  135.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  136.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  137.     $game_system.w_rcp_sw[id] = false
  138.   end
  139.   def w_recipe_switch_on?(id)
  140.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  141.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  142.     return $game_system.w_rcp_sw[id]
  143.   end
  144.   def w_recipe_all_switch_on
  145.     for i in 1..$data_weapons.size
  146.       w_recipe_switch_on(i)
  147.     end
  148.   end
  149.   def w_recipe_all_switch_off
  150.     for i in 1..$data_weapons.size
  151.       w_recipe_switch_off(i)
  152.     end
  153.   end
  154.   def a_recipe_switch_on(id)
  155.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  156.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  157.     $game_system.a_rcp_sw[id] = true
  158.   end
  159.   def a_recipe_switch_off(id)
  160.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  161.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  162.     $game_system.a_rcp_sw[id] = false
  163.   end
  164.   def a_recipe_switch_on?(id)
  165.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  166.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  167.     return $game_system.a_rcp_sw[id]
  168.   end
  169.   def a_recipe_all_switch_on
  170.     for i in 1..$data_armors.size
  171.       a_recipe_switch_on(i)
  172.     end
  173.   end
  174.   def a_recipe_all_switch_off
  175.     for i in 1..$data_armors.size
  176.       a_recipe_switch_off(i)
  177.     end
  178.   end
  179.   def recipe_all_switch_on
  180.     i_recipe_all_switch_on
  181.     w_recipe_all_switch_on
  182.     a_recipe_all_switch_on
  183.   end
  184.   def recipe_all_switch_off
  185.     i_recipe_all_switch_off
  186.     w_recipe_all_switch_off
  187.     a_recipe_all_switch_off
  188.   end
  189.  
  190. end
  191.  
  192. class Game_Interpreter
  193.   include WD_itemsynthesis
  194. end
  195.  
  196. class Game_System
  197.   #--------------------------------------------------------------------------
  198.   # ● 公開インスタンス変数
  199.   #--------------------------------------------------------------------------
  200.   attr_accessor :i_rcp_sw
  201.   attr_accessor :w_rcp_sw
  202.   attr_accessor :a_rcp_sw
  203.   #--------------------------------------------------------------------------
  204.   # ● オブジェクト初期化
  205.   #--------------------------------------------------------------------------
  206.   alias wd_orig_initialize004 initialize
  207.   def initialize
  208.     wd_orig_initialize004
  209.     @i_rcp_sw = []
  210.     @w_rcp_sw = []
  211.     @a_rcp_sw = []
  212.   end
  213. end
  214.  
  215.  
  216. #==============================================================================
  217. # ■ Scene_ItemSynthesis
  218. #------------------------------------------------------------------------------
  219. #  合成画面の処理を行うクラスです。
  220. #==============================================================================
  221.  
  222. class Scene_ItemSynthesis < Scene_MenuBase
  223.   #--------------------------------------------------------------------------
  224.   # ● 開始処理
  225.   #--------------------------------------------------------------------------
  226.   def start
  227.     super
  228.     create_help_window
  229.     create_dummy_window
  230.     create_number_window
  231.     create_status_window
  232.     create_material_window
  233.     create_list_window
  234.     create_category_window
  235.     create_gold_window
  236.     create_change_window
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ● ゴールドウィンドウの作成
  240.   #--------------------------------------------------------------------------
  241.   def create_gold_window
  242.     @gold_window = Window_Gold.new
  243.     @gold_window.viewport = @viewport
  244.     @gold_window.x = Graphics.width - @gold_window.width
  245.     @gold_window.y = @help_window.height
  246.     @gold_window.hide
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # ● 切り替え表示ウィンドウの作成
  250.   #--------------------------------------------------------------------------
  251.   def create_change_window
  252.     wx = 0
  253.     wy = @gold_window.y
  254.     ww = Graphics.width - @gold_window.width
  255.     wh = @gold_window.height
  256.     @change_window = Window_ItemSynthesisChange.new(wx, wy, ww, wh)
  257.     @change_window.viewport = @viewport
  258.     @change_window.hide
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # ● ダミーウィンドウの作成
  262.   #--------------------------------------------------------------------------
  263.   def create_dummy_window
  264.     wy = @help_window.y + @help_window.height + 48
  265.     wh = Graphics.height - wy
  266.     @dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
  267.     @dummy_window.viewport = @viewport
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ● 個数入力ウィンドウの作成
  271.   #--------------------------------------------------------------------------
  272.   def create_number_window
  273.     wy = @dummy_window.y
  274.     wh = @dummy_window.height
  275.     @number_window = Window_ItemSynthesisNumber.new(0, wy, wh)
  276.     @number_window.viewport = @viewport
  277.     @number_window.hide
  278.     @number_window.set_handler(:ok,     method(:on_number_ok))
  279.     @number_window.set_handler(:cancel, method(:on_number_cancel))
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● ステータスウィンドウの作成
  283.   #--------------------------------------------------------------------------
  284.   def create_status_window
  285.     wx = @number_window.width
  286.     wy = @dummy_window.y
  287.     ww = Graphics.width - wx
  288.     wh = @dummy_window.height
  289.     @status_window = Window_ShopStatus.new(wx, wy, ww, wh)
  290.     @status_window.viewport = @viewport
  291.     @status_window.hide
  292.   end
  293.   #--------------------------------------------------------------------------
  294.   # ● 素材ウィンドウの作成
  295.   #--------------------------------------------------------------------------
  296.   def create_material_window
  297.     wx = @number_window.width
  298.     wy = @dummy_window.y
  299.     ww = Graphics.width - wx
  300.     wh = @dummy_window.height
  301.     @material_window = Window_ItemSynthesisMaterial.new(wx, wy, ww, wh)
  302.     @material_window.viewport = @viewport
  303.     @material_window.hide
  304.     @number_window.material_window = @material_window
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # ● 合成アイテムリストウィンドウの作成
  308.   #--------------------------------------------------------------------------
  309.   def create_list_window
  310.     wy = @dummy_window.y
  311.     wh = @dummy_window.height
  312.     @list_window = Window_ItemSynthesisList.new(0, wy, wh)
  313.     @list_window.viewport = @viewport
  314.     @list_window.help_window = @help_window
  315.     @list_window.status_window = @status_window
  316.     @list_window.material_window = @material_window
  317.     @list_window.hide
  318.     @list_window.set_handler(:ok,     method(:on_list_ok))
  319.     @list_window.set_handler(:cancel, method(:on_list_cancel))
  320.     @list_window.set_handler(:change_window, method(:on_change_window))   
  321.   end
  322.   #--------------------------------------------------------------------------
  323.   # ● カテゴリウィンドウの作成
  324.   #--------------------------------------------------------------------------
  325.   def create_category_window
  326.     @category_window = Window_ItemSynthesisCategory.new
  327.     @category_window.viewport = @viewport
  328.     @category_window.help_window = @help_window
  329.     @category_window.y = @help_window.height
  330.     @category_window.activate
  331.     @category_window.item_window = @list_window
  332.     @category_window.set_handler(:ok,     method(:on_category_ok))
  333.     @category_window.set_handler(:cancel, method(:return_scene))
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● 合成アイテムリストウィンドウのアクティブ化
  337.   #--------------------------------------------------------------------------
  338.   def activate_list_window
  339.     @list_window.money = money
  340.     @list_window.show.activate
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # ● 合成[決定]
  344.   #--------------------------------------------------------------------------
  345.   def on_list_ok
  346.     @item = @list_window.item
  347.     @list_window.hide
  348.     @number_window.set(@item, max_buy, buying_price, currency_unit)
  349.     @number_window.show.activate
  350.   end
  351.   #--------------------------------------------------------------------------
  352.   # ● 合成[キャンセル]
  353.   #--------------------------------------------------------------------------
  354.   def on_list_cancel
  355.     @category_window.activate
  356.     @category_window.show
  357.     @dummy_window.show
  358.     @list_window.hide
  359.     @status_window.hide
  360.     @status_window.item = nil
  361.     @material_window.hide
  362.     @material_window.set(nil, nil)
  363.     @gold_window.hide
  364.     @change_window.hide
  365.     @help_window.clear
  366.   end
  367.   #--------------------------------------------------------------------------
  368.   # ● 表示切替
  369.   #--------------------------------------------------------------------------
  370.   def on_change_window
  371.     if @status_window.visible
  372.       @status_window.hide
  373.       @material_window.show
  374.     else
  375.       @status_window.show
  376.       @material_window.hide
  377.     end
  378.   end
  379.   #--------------------------------------------------------------------------
  380.   # ● カテゴリ[決定]
  381.   #--------------------------------------------------------------------------
  382.   def on_category_ok
  383.     activate_list_window
  384.     @gold_window.show
  385.     @change_window.show
  386.     @material_window.show
  387.     @category_window.hide
  388.     @list_window.select(0)
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # ● 個数入力[決定]
  392.   #--------------------------------------------------------------------------
  393.   def on_number_ok
  394.     Sound.play_shop
  395.     do_syntetic(@number_window.number)
  396.     end_number_input
  397.     @gold_window.refresh
  398.   end
  399.   #--------------------------------------------------------------------------
  400.   # ● 個数入力[キャンセル]
  401.   #--------------------------------------------------------------------------
  402.   def on_number_cancel
  403.     Sound.play_cancel
  404.     end_number_input
  405.   end
  406.   #--------------------------------------------------------------------------
  407.   # ● 合成の実行
  408.   #--------------------------------------------------------------------------
  409.   def do_syntetic(number)
  410.     $game_party.lose_gold(number * buying_price)
  411.     $game_party.gain_item(@item, number)
  412.  
  413.       @recipe = @list_window.recipe(@item)
  414.       for i in 1...@recipe.size
  415.         kind = @recipe[i][0]
  416.         id   = @recipe[i][1]
  417.         num  = @recipe[i][2]
  418.         if kind == "I"
  419.           item = $data_items[id]
  420.         elsif kind == "W"
  421.           item = $data_weapons[id]
  422.         elsif kind == "A"
  423.           item = $data_armors[id]
  424.         end
  425.         $game_party.lose_item(item, num*number)
  426.       end
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ● 個数入力の終了
  430.   #--------------------------------------------------------------------------
  431.   def end_number_input
  432.     @number_window.hide
  433.     activate_list_window
  434.   end
  435.   #--------------------------------------------------------------------------
  436.   # ● 最大購入可能個数の取得
  437.   #--------------------------------------------------------------------------
  438.   def max_buy
  439.     max = $game_party.max_item_number(@item) - $game_party.item_number(@item)
  440.  
  441.     @recipe = @list_window.recipe(@item)
  442.       for i in 1...@recipe.size
  443.         kind = @recipe[i][0]
  444.         id   = @recipe[i][1]
  445.         num  = @recipe[i][2]
  446.         if kind == "I"
  447.           item = $data_items[id]
  448.         elsif kind == "W"
  449.           item = $data_weapons[id]
  450.         elsif kind == "A"
  451.           item = $data_armors[id]
  452.         end
  453.         if num > 0
  454.           max_buf = $game_party.item_number(item)/num
  455.         else
  456.           max_buf = 999
  457.         end
  458.         max = [max, max_buf].min
  459.       end
  460.  
  461.     buying_price == 0 ? max : [max, money / buying_price].min
  462.  
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # ● 所持金の取得
  466.   #--------------------------------------------------------------------------
  467.   def money
  468.     @gold_window.value
  469.   end
  470.   #--------------------------------------------------------------------------
  471.   # ● 通貨単位の取得
  472.   #--------------------------------------------------------------------------
  473.   def currency_unit
  474.     @gold_window.currency_unit
  475.   end
  476.   #--------------------------------------------------------------------------
  477.   # ● 合成費用の取得
  478.   #--------------------------------------------------------------------------
  479.   def buying_price
  480.     @list_window.price(@item)
  481.   end
  482. end
  483.  
  484.  
  485. #==============================================================================
  486. # ■ Window_ItemSynthesisList
  487. #------------------------------------------------------------------------------
  488. #  合成画面で、合成可能なアイテムの一覧を表示するウィンドウです。
  489. #==============================================================================
  490.  
  491. class Window_ItemSynthesisList < Window_Selectable
  492.   include WD_itemsynthesis
  493.   #--------------------------------------------------------------------------
  494.   # ● 公開インスタンス変数
  495.   #--------------------------------------------------------------------------
  496.   attr_reader   :status_window            # ステータスウィンドウ
  497.   #--------------------------------------------------------------------------
  498.   # ● オブジェクト初期化
  499.   #--------------------------------------------------------------------------
  500.   def initialize(x, y, height)
  501.     super(x, y, window_width, height)
  502.  
  503.     @shop_goods = []
  504.     @shop_recipes = []
  505.  
  506.     for i in 1..WD_itemsynthesis_ini::I_recipe.size
  507.       recipe = WD_itemsynthesis_ini::I_recipe[i]
  508.       if recipe
  509.         good = [0, i, recipe[0]]
  510.         if i_recipe_switch_on?(i)
  511.           @shop_goods.push(good)
  512.           @shop_recipes.push(recipe)
  513.         end
  514.       end
  515.     end
  516.     for i in 1..WD_itemsynthesis_ini::W_recipe.size
  517.       recipe = WD_itemsynthesis_ini::W_recipe[i]
  518.       if recipe
  519.         good = [1, i, recipe[0]]
  520.         if w_recipe_switch_on?(i)
  521.           @shop_goods.push(good)
  522.           @shop_recipes.push(recipe)
  523.         end
  524.       end
  525.     end
  526.     for i in 1..WD_itemsynthesis_ini::A_recipe.size
  527.       recipe = WD_itemsynthesis_ini::A_recipe[i]
  528.       if recipe
  529.         good = [2, i, recipe[0]]
  530.         if a_recipe_switch_on?(i)
  531.           @shop_goods.push(good)
  532.           @shop_recipes.push(recipe)
  533.         end
  534.       end
  535.     end
  536.  
  537.     @Money = 0
  538.     refresh
  539.     select(0)
  540.   end
  541.   #--------------------------------------------------------------------------
  542.   # ● ウィンドウ幅の取得
  543.   #--------------------------------------------------------------------------
  544.   def window_width
  545.     return 304
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # ● 項目数の取得
  549.   #--------------------------------------------------------------------------
  550.   def item_max
  551.     @data ? @data.size : 1
  552.   end
  553.   #--------------------------------------------------------------------------
  554.   # ● アイテムの取得
  555.   #--------------------------------------------------------------------------
  556.   def item
  557.     @data[index]
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # ● 所持金の設定
  561.   #--------------------------------------------------------------------------
  562.   def money=(money)
  563.     @money = money
  564.     refresh
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ● 選択項目の有効状態を取得
  568.   #--------------------------------------------------------------------------
  569.   def current_item_enabled?
  570.     enable?(@data[index])
  571.   end
  572.   #--------------------------------------------------------------------------
  573.   # ● 合成費用を取得
  574.   #--------------------------------------------------------------------------
  575.   def price(item)
  576.     @price[item]
  577.   end
  578.   #--------------------------------------------------------------------------
  579.   # ● 合成可否を取得
  580.   #--------------------------------------------------------------------------
  581.   def enable?(item)
  582.     @makable[item]
  583.   end
  584.   #--------------------------------------------------------------------------
  585.   # ● レシピを取得
  586.   #--------------------------------------------------------------------------
  587.   def recipe(item)
  588.     @recipe[item]
  589.   end
  590.   #--------------------------------------------------------------------------
  591.   # ● アイテムを許可状態で表示するかどうか
  592.   #--------------------------------------------------------------------------
  593.   def have_mat?(recipe)
  594.     flag = true
  595.     if @money >= recipe[0]
  596.       for i in 1...recipe.size
  597.         kind = recipe[i][0]
  598.         id   = recipe[i][1]
  599.         num  = recipe[i][2]
  600.         if kind == "I"
  601.           item = $data_items[id]
  602.         elsif kind == "W"
  603.           item = $data_weapons[id]
  604.         elsif kind == "A"
  605.           item = $data_armors[id]
  606.         end
  607.         if $game_party.item_number(item) < [num, 1].max
  608.           flag = false
  609.         end
  610.       end
  611.     else
  612.       flag = false
  613.     end
  614.     return flag
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ● カテゴリの設定
  618.   #--------------------------------------------------------------------------
  619.   def category=(category)
  620.     return if @category == category
  621.     @category = category
  622.     refresh
  623.   end
  624.   #--------------------------------------------------------------------------
  625.   # ● リフレッシュ
  626.   #--------------------------------------------------------------------------
  627.   def refresh
  628.     make_item_list
  629.     create_contents
  630.     draw_all_items
  631.   end
  632.   #--------------------------------------------------------------------------
  633.   # ● アイテムをリストに含めるかどうか
  634.   #--------------------------------------------------------------------------
  635.   def include?(item)
  636.     case @category
  637.     when :item
  638.       item.is_a?(RPG::Item) && !item.key_item?
  639.     when :weapon
  640.       item.is_a?(RPG::Weapon)
  641.     when :armor
  642.       item.is_a?(RPG::Armor)
  643.     when :key_item
  644.       item.is_a?(RPG::Item) && item.key_item?
  645.     else
  646.       false
  647.     end
  648.   end
  649.   #--------------------------------------------------------------------------
  650.   # ● アイテムリストの作成
  651.   #--------------------------------------------------------------------------
  652.   def make_item_list
  653.     @data = []
  654.     @price = {}
  655.     @makable = {}
  656.     @recipe = {}
  657.     for i in 0...@shop_goods.size
  658.       goods = @shop_goods[i]
  659.       recipe = @shop_recipes[i]
  660.       case goods[0]
  661.       when 0;  item = $data_items[goods[1]]
  662.       when 1;  item = $data_weapons[goods[1]]
  663.       when 2;  item = $data_armors[goods[1]]
  664.       end
  665.       if item
  666.         if include?(item)
  667.           @data.push(item)
  668.           @price[item] = goods[2]
  669.           @makable[item] = have_mat?(recipe)
  670.           @recipe[item] = recipe
  671.         end
  672.       end
  673.     end
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # ● 項目の描画
  677.   #--------------------------------------------------------------------------
  678.   def draw_item(index)
  679.     item = @data[index]
  680.     rect = item_rect(index)
  681.     draw_item_name(item, rect.x, rect.y, enable?(item))
  682.     rect.width -= 4
  683.     draw_text(rect, price(item), 2)  if WD_itemsynthesis_ini::Cost_view
  684.   end
  685.   #--------------------------------------------------------------------------
  686.   # ● ステータスウィンドウの設定
  687.   #--------------------------------------------------------------------------
  688.   def status_window=(status_window)
  689.     @status_window = status_window
  690.     call_update_help
  691.   end
  692.   #--------------------------------------------------------------------------
  693.   # ● 素材ウィンドウの設定
  694.   #--------------------------------------------------------------------------
  695.   def material_window=(material_window)
  696.     @material_window = material_window
  697.     call_update_help
  698.   end
  699.   #--------------------------------------------------------------------------
  700.   # ● ヘルプテキスト更新
  701.   #--------------------------------------------------------------------------
  702.   def update_help
  703.     @help_window.set_item(item) if @help_window
  704.     @status_window.item = item if @status_window
  705.     @material_window.set(item, recipe(item)) if @material_window
  706.   end
  707.   #--------------------------------------------------------------------------
  708.   # ● ←→ ボタン(表示切替)が押されたときの処理
  709.   #--------------------------------------------------------------------------
  710.   def process_change_window
  711.     Sound.play_cursor
  712.     Input.update
  713.     call_handler(:change_window)
  714.   end
  715.   #--------------------------------------------------------------------------
  716.   # ● 決定やキャンセルなどのハンドリング処理
  717.   #--------------------------------------------------------------------------
  718.   def process_handling
  719.     super
  720.     if active
  721.       return process_change_window if handle?(:change_window) && Input.trigger?(:X)
  722.       return process_change_window if handle?(:change_window) && Input.trigger?(:Y)
  723.     end
  724.   end
  725. end
  726.  
  727.  
  728. #==============================================================================
  729. # ■ Window_ItemSynthesisMaterial
  730. #------------------------------------------------------------------------------
  731. #  合成画面で、合成に必要な素材を表示するウィンドウです。
  732. #==============================================================================
  733.  
  734. class Window_ItemSynthesisMaterial < Window_Base
  735.   #--------------------------------------------------------------------------
  736.   # ● オブジェクト初期化
  737.   #--------------------------------------------------------------------------
  738.   def initialize(x, y, width, height)
  739.     super(x, y, width, height)
  740.     @item = nil
  741.     refresh
  742.   end
  743.   #--------------------------------------------------------------------------
  744.   # ● リフレッシュ
  745.   #--------------------------------------------------------------------------
  746.   def refresh
  747.     contents.clear
  748.     draw_possession(4, 0)
  749.     draw_material_info(0, line_height * 2)
  750.   end
  751.   #--------------------------------------------------------------------------
  752.   # ● アイテムの設定
  753.   #--------------------------------------------------------------------------
  754.   def set(item, recipe)
  755.     @item = item
  756.     @recipe = recipe
  757.     @make_number = 1
  758.     refresh
  759.   end
  760.   #--------------------------------------------------------------------------
  761.   # ● 作成個数の設定
  762.   #--------------------------------------------------------------------------
  763.   def set_num(make_number)
  764.     @make_number = make_number
  765.     refresh
  766.   end
  767.   #--------------------------------------------------------------------------
  768.   # ● 所持数の描画
  769.   #--------------------------------------------------------------------------
  770.   def draw_possession(x, y)
  771.     rect = Rect.new(x, y, contents.width - 4 - x, line_height + 20)
  772.     change_color(system_color)
  773.     draw_text(rect, Vocab::Possession)
  774.     change_color(normal_color)
  775.     draw_text(rect, $game_party.item_number(@item), 2)
  776.   end
  777.   #--------------------------------------------------------------------------
  778.   # ● 素材情報の描画
  779.   #--------------------------------------------------------------------------
  780.   def draw_material_info(x, y)
  781.     rect = Rect.new(x, y, contents.width, line_height)
  782.     change_color(system_color)
  783.     contents.font.size = 18
  784.     draw_text(rect, "必要素材", 0)
  785.     if @recipe
  786.       for i in 1...@recipe.size
  787.         kind = @recipe[i][0]
  788.         id   = @recipe[i][1]
  789.         num  = @recipe[i][2]
  790.         if kind == "I"
  791.           item = $data_items[id]
  792.         elsif kind == "W"
  793.           item = $data_weapons[id]
  794.         elsif kind == "A"
  795.           item = $data_armors[id]
  796.         end
  797.         rect = Rect.new(x, y + line_height*i, contents.width, line_height)
  798.         enabled = true
  799.         enabled = false if [num*@make_number, 1].max  > $game_party.item_number(item)
  800.         draw_item_name(item, rect.x, rect.y, enabled)
  801.         change_color(normal_color, enabled)
  802.         if num > 0
  803.           draw_text(rect, "#{num*@make_number}/#{$game_party.item_number(item)}", 2)
  804.         end
  805.       end
  806.     end
  807.     change_color(normal_color)
  808.     contents.font.size = 24
  809.   end
  810. end
  811.  
  812.  
  813. #==============================================================================
  814. # ■ Window_ItemSynthesisNumber
  815. #------------------------------------------------------------------------------
  816. #  合成画面で、合成するアイテムの個数を入力するウィンドウです。
  817. #==============================================================================
  818.  
  819. class Window_ItemSynthesisNumber < Window_ShopNumber
  820.   #--------------------------------------------------------------------------
  821.   # ● リフレッシュ
  822.   #--------------------------------------------------------------------------
  823.   def refresh
  824.     contents.clear
  825.     draw_item_name(@item, 0, item_y)
  826.     draw_number
  827.     draw_total_price if WD_itemsynthesis_ini::Cost_view
  828.   end
  829.   #--------------------------------------------------------------------------
  830.   # ● オブジェクト初期化
  831.   #--------------------------------------------------------------------------
  832.   def material_window=(material_window)
  833.     @material_window = material_window
  834.     call_update_help
  835.   end
  836.   #--------------------------------------------------------------------------
  837.   # ● 作成個数の変更
  838.   #--------------------------------------------------------------------------
  839.   def change_number(amount)
  840.     @number = [[@number + amount, @max].min, 1].max
  841.     call_update_help #追加
  842.   end
  843.   #--------------------------------------------------------------------------
  844.   # ● ヘルプテキスト更新
  845.   #--------------------------------------------------------------------------
  846.   def call_update_help
  847.     @material_window.set_num(@number) if @material_window
  848.   end
  849. end
  850.  
  851.  
  852. #==============================================================================
  853. # ■ Window_ItemSynthesisCategory
  854. #------------------------------------------------------------------------------
  855. #  合成画面で、通常アイテムや装備品の分類を選択するウィンドウです。
  856. #==============================================================================
  857.  
  858. class Window_ItemSynthesisCategory < Window_ItemCategory
  859.   #--------------------------------------------------------------------------
  860.   # ● 桁数の取得
  861.   #--------------------------------------------------------------------------
  862.   def col_max
  863.     i = 0
  864.     i += 1 if WD_itemsynthesis_ini::Category_i
  865.     i += 1 if WD_itemsynthesis_ini::Category_w
  866.     i += 1 if WD_itemsynthesis_ini::Category_a
  867.     i += 1 if WD_itemsynthesis_ini::Category_k
  868.     return i
  869.   end
  870.   #--------------------------------------------------------------------------
  871.   # ● コマンドリストの作成
  872.   #--------------------------------------------------------------------------
  873.   def make_command_list
  874.     add_command(Vocab::item,     :item)     if WD_itemsynthesis_ini::Category_i
  875.     add_command(Vocab::weapon,   :weapon)   if WD_itemsynthesis_ini::Category_w
  876.     add_command(Vocab::armor,    :armor)    if WD_itemsynthesis_ini::Category_a
  877.     add_command(Vocab::key_item, :key_item) if WD_itemsynthesis_ini::Category_k
  878.   end
  879. end
  880.  
  881.  
  882. #==============================================================================
  883. # ■ Window_ItemSynthesisNumber
  884. #------------------------------------------------------------------------------
  885. #  合成画面で、切替を表示するウィンドウです。
  886. #==============================================================================
  887.  
  888. class Window_ItemSynthesisChange < Window_Base
  889.   #--------------------------------------------------------------------------
  890.   # ● オブジェクト初期化
  891.   #--------------------------------------------------------------------------
  892.   def initialize(x, y, width, height)
  893.     super(x, y, width, height)
  894.     refresh
  895.   end
  896.   #--------------------------------------------------------------------------
  897.   # ● リフレッシュ
  898.   #--------------------------------------------------------------------------
  899.   def refresh
  900.     contents.clear
  901.     text = "合成准备=3=!"
  902.     draw_text(0, 0, contents_width, line_height, text, 1)
  903.   end
  904. end

点评

我和你说的办法都是编辑器:脚本这个功能,我从来都没和你说def w_recipe_switch_on?(id)那种地方改  发表于 2018-3-25 11:24
恭喜你将脚本全部弄乱,而且我和你说的那个方法:事件——高级——脚本,不是直接在脚本改  发表于 2018-3-25 11:22
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-19 23:48

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表