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

Project1

 找回密码
 注册会员
搜索
楼主: 小天
打印 上一主题 下一主题

30VIP悬赏一个烹饪系统

 关闭 [复制链接]

Lv1.梦旅人

邪恶小龙包

梦石
0
星屑
55
在线时间
17 小时
注册时间
2006-5-22
帖子
7006

第2届短篇游戏比赛冠军第3届短篇游戏大赛小游戏及其他组冠军RMVX自由创作大赛冠军

21
发表于 2007-8-24 09:08:45 | 只看该作者
- -虽然很感兴趣,但是貌似很麻烦,期待神思大人的
版主对此帖的评论:『无关回复』,积分『-200』。这些被扣积分的一半会用于对本帖正确答案的悬赏。
虚无  堕落
回复 支持 反对

使用道具 举报

Lv1.梦旅人

吟游诗人

梦石
0
星屑
50
在线时间
82 小时
注册时间
2006-6-20
帖子
1086
22
 楼主| 发表于 2007-8-24 21:12:53 | 只看该作者
大家可以这么做.
完全自己想一个菜色.然后自己定义一个游戏过程,包括调料,火候,动作等.然后发来看看
自定义可以先放到一边.
要低调。。。低调。。。点我进入小天的作坊近期关注http://www.lothings.com/
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (暗夜天使)

名侦探小柯

梦石
10
星屑
4248
在线时间
3732 小时
注册时间
2006-9-6
帖子
37430

极短27获奖MZ评测员开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

23
发表于 2007-8-24 22:15:42 | 只看该作者
就像小贝帮我写的那个脚本一样……

材料的话,
在那个材料什么的里注释里写一些相关的东西。

那么按照这个原理来做那些火侯什么的要求就不难了……
[LINE]1,#dddddd[/LINE]
PS。因为这个用事件的话,不可能完成我上面说的效果……
所以我还是闪一边……
不定期回归 ~ 游戏开发之旅
———————————————————————————————
回复 支持 反对

使用道具 举报

Lv1.梦旅人

传奇

梦石
0
星屑
50
在线时间
4 小时
注册时间
2007-4-10
帖子
427
24
发表于 2007-8-24 23:12:13 | 只看该作者
  1. #料理システム
  2. #
  3. #いままでに増して、設定箇所が多いです(汗)
  4. #とりあえず最低限やらなければならない事を書いてみます。
  5. #
  6. #最初に下の基本設定を設定してください。
  7. module Cooking_System_Config

  8.   COOK_BATTLE_COUNT = 0       # 次に料理できるまでの戦闘回数(0で制限無し)
  9.   COOK_TYPE_SELECT = 1        # 料理タイプ、1で料理する人を選択、0で選択なし
  10.   USE_COOK_MASTERY = true     # 料理熟練度機能を使用するかどうか
  11.   MAX_COOK_MASTERY = 5        # 熟練度の最大値
  12.   COOK_SUCCESS_REVISE = 5     # 熟練度1毎の料理成功確率補正値
  13.   USE_COOK_MATE_ADD = true    # 追加食材機能を使用するかどうか
  14.   USE_ACTOR_MATE_ADD = true   # 追加食材をアクター毎に設定するかどうか
  15.   ADD_MATE_SHOW = true        # 追加食材を表示するかどうか
  16.   
  17. end
  18. #分かり難そうな所を補足しておくと、
  19. #上から2つ目の COOK_TYPE_SELECT は
  20. #1にすると、料理するときパーティーメンバーから1人料理する人を選択します。
  21. #0にすると、料理するとき誰かを選択するわけでなく、パーティー全員で料理します。
  22. #
  23. #上から3つ目の USE_COOK_MASTERY は
  24. #trueにすると、何回か料理すると
  25. #その料理を作った時の回復量が上昇するようになります。
  26. #falseにすると、熟練度関係の機能が働かなくなります。
  27. #
  28. #上から5つ目の COOK_SUCCESS_REVISE は
  29. #熟練度が1上がった時の料理の成功率増加値です。
  30. #(熟練度)×(増加値)が料理の基本成功率に加算されます。
  31. #
  32. #
  33. #
  34. #ここまで設定したら、いったんデータベースでの設定に移ります。
  35. #この料理システムでは、食材はもちろんですが、作る料理の設定も
  36. #データベースのアイテムの項目で設定します。
  37. #とりあえず、適当に料理の名前でアイテムを作ってください。
  38. #名前、説明文、HPSPの回復量、アイコン、ステート変化、はそのまま反映されます。
  39. #
  40. #ちょっと利用法が違うものとして、
  41. #
  42. #命中率…料理の基本成功率
  43. #アイテム使用時SE…料理時に鳴るSE
  44. #コモンイベントID…料理時に起動するコモンイベントID
  45. #物理防御F…料理難度(何回料理したら熟練度が上がるかの基本値)
  46. #魔法防御F…回復値熟練度補正(熟練度1毎の回復量増加値)
  47. #
  48. #があります。
  49. #
  50. #ちなみに、熟練度を使用しないつもりならば、
  51. #熟練度関係の項目は設定しなくてもかまいません。
  52. #
  53. #あと、料理失敗時の「失敗料理」を1つ作っておいてください。
  54. #料理失敗時に使います。
  55. #
  56. #
  57. #
  58. #次にすぐ下のset_cookidを設定します。
  59. #先程データベースで設定した料理のIDを
  60. #下の@cookidset[1] = 51
  61. #                    ↑この部分
  62. #に入れてください。
  63. #料理一覧画面でこの順番で表示されます。
  64. #
  65. #
  66. #
  67. #次に料理のレシピ設定です。
  68. #set_cookidのすぐ下にset_cook_recipeがあります。
  69. #
  70. #レシピ設定のやり方は、
  71. #
  72. #1.食材のアイテムIDを直接入力
  73. #  @recipe[1] = {41=>1, 43=>1}
  74. #  のように、{}の部分に{アイテムID=>必要個数}
  75. #  と入力してください。
  76. #
  77. #2.分類で指定
  78. #  @recipe[2] = {"ごはん系"=>1, "のり系"=>2}
  79. #  のように、{}の部分に{"分類名"=>必要個数}  
  80. #  と入力してください。
  81. #  分類指定は、その分類名の属性がついたアイテム全てを対象にします。
  82. #  食材を消費するときは、その中からランダムで消費されます。
  83. #
  84. #また、
  85. #@recipe[3] = {"やさい系"=>2, 41=>1}
  86. #のように、直接指定と分類指定を同時に使用することも可能です。
  87. #
  88. #
  89. #
  90. #失敗時の料理指定。
  91. #set_fail_food_idを設定します。
  92. #基本的に
  93. #@fail_food_id[0] = 50   # デフォルト値
  94. #の右側の数字部分に先程作っておいた失敗料理のアイテムIDを入れてくれればいいです。
  95. #
  96. #@fail_food_id[1] = 49
  97. #とかやれば、料理毎に失敗料理の設定が可能です。
  98. #
  99. #
  100. #
  101. #最後です。
  102. #やっぱり、先程のすぐ下のset_visible_Switcheを設定です。
  103. #これは、料理を表示するかどうかの判定用のゲームスイッチナンバーの設定です。
  104. #
  105. #@visible_Switche[3] = 20
  106. #
  107. #この右側の数字がゲームスイッチナンバーです。
  108. #上の例では、3つ目に表示する料理はゲームスイッチ20番がONの時
  109. #表示されるようになっています。
  110. #
  111. #
  112. #基本的な設定は以上です。
  113. #
  114. #
  115. #
  116. #○アクター個別の料理難度補正
  117. #これは、ムリにやらなくても良いですが、
  118. #アクター毎に料理できるように設定しているなら、設定しておいた方が良いと思います。
  119. #というよりも、せっかくアクター毎に料理できるのに
  120. #全員同じ性能だったら、全くの無意味ですよね(汗)
  121. #パーティー全員で料理する設定の場合は、無視して結構です。
  122. #設定しても、意味ありません。
  123. #
  124. #・設定の仕方
  125. ##--------------------------------------------------------------------------
  126. ## ● アクター別の熟練難度補正の設定
  127. ##--------------------------------------------------------------------------
  128. # def set_actor_cook_difficulty
  129. #↑ここです。さっきのすぐ下。
  130. #
  131. #設定した値が、料理難度(何回料理したら熟練度が上がるかの基本値)に加算されます。
  132. #マイナス指定も可能です。
  133. #
  134. #when 1 # おむすび
  135. # @actor_cook_difficulty[1] = 0   #アルシェス
  136. # @actor_cook_difficulty[2] = 1   #バジル
  137. # @actor_cook_difficulty[7] = 0   #グロリア
  138. # @actor_cook_difficulty[8] = 2   #ヒルダ
  139. #
  140. #見てもらえれば分かると思いますが、[]の中の数字がアクターIDで
  141. #右の数字が、料理難度に加算される値です。
  142. #
  143. #
  144. #○追加食材について
  145. #追加食材とは、いわゆるトッピングみたいなモノです。
  146. #知っている人は、某「君と響きあうRPG 」のアレを想像してください。
  147. #というか、この料理システム自体アレを参考にしてたりします(汗)
  148. #追加食材を持っていなくても料理はできます。
  149. #使えば、料理の効果に追加食材の効果が上乗せされます。
  150. #設定は set_add_mate で行っています。
  151. #最大で 最大熟練度 + 1 個まで追加食材を設定できますが、
  152. #問答無用で食材を消費してしまうので、あまり多く設定すると
  153. #逆に使い難い料理になってしまうかもしれません。
  154. #
  155. #2005.8.29 バグ修正
  156. #戦闘不能状態でも料理可能なのを修正。
  157. #料理でHP回復時、戦闘不能者にも効果があるのを修正。

  158. class Cook_Data
  159.   #--------------------------------------------------------------------------
  160.   # ● 参照アイテムIDの設定
  161.   #--------------------------------------------------------------------------
  162.   def set_cookid
  163.     # ↓以下、設定用
  164.    
  165.     @cookidset[1] = 51
  166.     @cookidset[2] = 52
  167.     @cookidset[3] = 53
  168.     @cookidset[4] = 54
  169.    
  170.     # ↑ここまで
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● 料理レシピの設定
  174.   #--------------------------------------------------------------------------
  175.   def set_cook_recipe
  176.     @recipe[0] = {}   # デフォルト値(いじらないように)
  177.    
  178.     # ↓以下、設定用
  179.    
  180.     @recipe[1] = {41=>1, 43=>1}
  181.     @recipe[2] = {"ごはん系"=>1, "のり系"=>2}
  182.     @recipe[3] = {"やさい系"=>2, 41=>1}
  183.     @recipe[4] = {46=>3}
  184.    
  185.     # ↑ここまで
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # ● 失敗時の料理の設定
  189.   #--------------------------------------------------------------------------
  190.   def set_fail_food_id
  191.     # ↓以下、設定用
  192.    
  193.     @fail_food_id[0] = 50   # デフォルト値
  194.    
  195.     # ↑ここまで
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ● 料理可否判定用スイッチナンバーの設定
  199.   #--------------------------------------------------------------------------
  200.   def set_visible_Switche
  201.     @visible_Switche[0] = 0 # デフォルト値(いじらないように)
  202.    
  203.     # ↓以下、設定用
  204.    
  205.     @visible_Switche[3] = 20
  206.    
  207.     # ↑ここまで
  208.   end
  209. end

  210. class FoodData
  211.   #--------------------------------------------------------------------------
  212.   # ● アクター別の熟練難度補正の設定
  213.   #--------------------------------------------------------------------------
  214.   def set_actor_cook_difficulty
  215.     @actor_cook_difficulty = []
  216.     @actor_cook_difficulty[0] = 0 # デフォ値(いじらないように)
  217.    
  218.     # ↓以下、設定用
  219.    
  220.     case @id # 料理ID
  221.     when 1 # おむすび
  222.       @actor_cook_difficulty[1] = 0   #アルシェス
  223.       @actor_cook_difficulty[2] = 1   #バジル
  224.       @actor_cook_difficulty[7] = 0   #グロリア
  225.       @actor_cook_difficulty[8] = 2   #ヒルダ
  226.     when 2 # 超むすび
  227.       @actor_cook_difficulty[1] = 0   #アルシェス
  228.       @actor_cook_difficulty[2] = 1   #バジル
  229.       @actor_cook_difficulty[7] = -1  #グロリア
  230.       @actor_cook_difficulty[8] = 2   #ヒルダ
  231.     when 3 # 野菜炒め
  232.       @actor_cook_difficulty[1] = -1  #アルシェス
  233.       @actor_cook_difficulty[2] = 1   #バジル
  234.       @actor_cook_difficulty[7] = 0   #グロリア
  235.       @actor_cook_difficulty[8] = 2   #ヒルダ
  236.     when 4 # フルーツポンチ
  237.       @actor_cook_difficulty[1] = -1  #アルシェス
  238.       @actor_cook_difficulty[2] = 1   #バジル
  239.       @actor_cook_difficulty[7] = 3   #グロリア
  240.       @actor_cook_difficulty[8] = -3  #ヒルダ
  241.     end
  242.    
  243.     # ↑ここまで
  244.    
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● 追加食材の設定
  248.   #--------------------------------------------------------------------------
  249.   def set_add_mate
  250.     @add_mate = []
  251.     @add_mate[0] = [nil, nil, nil, nil, nil, nil] #デフォ値(こっちはいじらない)
  252.     #デフォ値は、アクター別に追加食材を設定しない場合に使用されます。
  253.     #よって、その場合は @add_mate[0] だけ設定すればいいです。
  254.     #[nil, nil, nil, 45, nil, nil]の部分には食材のアイテムIDを入れます。
  255.     #左から熟練度が0,1,2,3,4,5の時に追加されるアイテムIDを入れてください。
  256.     #なにも追加したくないときは nil を入れてください。
  257.     #熟練度機能を使用していない時は熟練度0として判定されるので、
  258.     #熟練度機能は使用しないけど、アクター別に追加食材を使いたい
  259.     #という場合は、熟練度0の場所(一番左側)に追加食材のアイテムIDを入れてください。
  260.     #
  261.     #追加食材が使われた場合は、
  262.     #食材のHPSP回復率、HPSP回復値、プラスステート、マイナスステート
  263.     #がそのまま料理の効果に上乗せされます。
  264.     case @id # 料理ID
  265.     when 1 # おむすび
  266.       @add_mate[0] = [44, nil, nil, nil, nil, nil] #デフォ値
  267.       @add_mate[1] = [45, nil, nil, nil, nil, 46] #アルシェス
  268.       @add_mate[2] = [43, nil, nil, nil, nil, nil] #バジル
  269.       @add_mate[7] = [nil, nil, nil, nil, nil, nil] #グロリア
  270.       @add_mate[8] = [46, nil, nil, nil, nil, nil] #ヒルダ
  271.     when 2 # 超むすび
  272.       @add_mate[0] = [41, 42, 43, 44, 45, 46] #デフォ値
  273.       @add_mate[1] = [41, 42, 43, 44, 45, 46] #アルシェス
  274.       @add_mate[2] = [nil, nil, nil, nil, nil, 42] #バジル
  275.       @add_mate[7] = [nil, nil, nil, nil, nil, nil] #グロリア
  276.       @add_mate[8] = [46, 46, nil, nil, nil, 46] #ヒルダ
  277.     when 3 # やさいいため
  278.       @add_mate[0] = [41, 42, 43, 44, 45, 46] #デフォ値
  279.       @add_mate[1] = [41, 42, 43, 44, 45, 46] #アルシェス
  280.       @add_mate[2] = [nil, nil, nil, nil, nil, 42] #バジル
  281.       @add_mate[7] = [nil, nil, nil, nil, nil, nil] #グロリア
  282.       @add_mate[8] = [46, nil, nil, nil, 46, 46] #ヒルダ
  283.     when 4 # ふるーつぽんち
  284.       @add_mate[0] = [nil, nil, 43, 44, 45, 46] #デフォ値
  285.       @add_mate[1] = [nil, nil, 46, nil, nil, nil] #アルシェス
  286.       @add_mate[2] = [nil, nil, nil, nil, nil, 42] #バジル
  287.       @add_mate[7] = [nil, nil, nil, nil, nil, nil] #グロリア
  288.       @add_mate[8] = [nil, 46, 46, 46, 46, 46] #ヒルダ
  289.     end
  290.   end
  291. end


  292. class Cook_Data
  293.   attr_reader :cookidset
  294.   attr_reader :recipe
  295.   attr_reader :cookmastery_revise
  296.   attr_reader :cook_difficulty
  297.   attr_reader :fail_food_id
  298.   attr_reader :visible_Switche
  299.   #--------------------------------------------------------------------------
  300.   # ● オブジェクト初期化
  301.   #--------------------------------------------------------------------------
  302.   def initialize
  303.     @cookidset = [0]
  304.     @recipe = []
  305.     @fail_food_id = []
  306.     @visible_Switche = []
  307.     set_cookid
  308.     set_cook_recipe
  309.     set_fail_food_id
  310.     set_visible_Switche
  311.   end
  312. end

  313. class FoodData
  314.   include Cooking_System_Config
  315.   attr_reader :id
  316.   attr_reader :item_id
  317.   attr_reader :name
  318.   attr_reader :icon_name
  319.   attr_reader :description
  320.   attr_reader :recover_hp
  321.   attr_reader :recover_hp_rate
  322.   attr_reader :recover_sp
  323.   attr_reader :recover_sp_rate
  324.   attr_reader :plus_state_set
  325.   attr_reader :minus_state_set
  326.   attr_reader :base_success
  327.   attr_reader :cook_se
  328.   attr_reader :common_event
  329.   attr_reader :recipe
  330.   attr_reader :cookmastery_revise
  331.   attr_reader :cook_difficulty
  332.   attr_reader :fail_food_id
  333.   attr_reader :visible_Switche
  334.   attr_reader :actor_cook_difficulty
  335.   attr_reader :add_mate
  336.   #--------------------------------------------------------------------------
  337.   # ● オブジェクト初期化
  338.   #--------------------------------------------------------------------------
  339.   def initialize(item_id)
  340.     @item_id = item_id               #参照アイテムID
  341.     @id = set_id                     #料理ID
  342.     @name = ""                       #料理名
  343.     @icon_name = ""                  #料理アイコンネーム
  344.     @description = ""                #料理説明
  345.     @recover_hp = 0                  #HP回復値
  346.     @recover_hp_rate = 0             #HP回復%
  347.     @recover_sp = 0                  #SP回復値
  348.     @recover_sp_rate = 0             #SP回復%
  349.     @plus_state_set = []             #追加ステート
  350.     @minus_state_set = []            #除去ステート
  351.     @base_success = 100              #基本成功率
  352.     @cook_se = nil                   #料理時SE
  353.     @common_event = 0                #料理時起動コモンイベントID
  354.     @cookmastery_revise = []         #回復値熟練度補正
  355.     @cook_difficulty = []            #料理難度
  356.    
  357.     @recipe = {}                     #料理レシピ
  358.     @fail_food_id = []               #失敗時のアイテムID
  359.     @visible_Switche = []            #表示スイッチナンバー
  360.     @actor_cook_difficulty = []
  361.     @add_mate = []
  362.     #@need_item = {}                 #
  363.     set_up
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # ● IDをセット
  367.   #--------------------------------------------------------------------------
  368.   def set_id
  369.     id = $game_temp.cook_system_data.cookidset.index(@item_id)
  370.     return @id = 0 if id == nil
  371.     return id
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   # ● 各情報のセットアップ
  375.   #--------------------------------------------------------------------------
  376.   def set_up
  377.     item = $data_items[@item_id]
  378.     @name = item.name
  379.     @icon_name = item.icon_name
  380.     @description = item.description
  381.     @recover_hp = item.recover_hp
  382.     @recover_hp_rate = item.recover_hp_rate
  383.     @recover_sp = item.recover_sp
  384.     @recover_sp_rate = item.recover_sp_rate
  385.     @plus_state_set = item.plus_state_set
  386.     @minus_state_set = item.minus_state_set
  387.     @base_success = item.hit
  388.     @cook_se = item.menu_se
  389.     @common_event = item.common_event_id
  390.     @cook_difficulty = item.pdef_f
  391.     @cookmastery_revise = item.mdef_f
  392.     @recipe = $game_temp.cook_system_data.recipe[@id]
  393.     if @recipe == nil
  394.       @recipe = {}
  395.     end
  396.     @fail_food_id = $game_temp.cook_system_data.fail_food_id[@id]
  397.     if @fail_food_id == nil
  398.       @fail_food_id = $game_temp.cook_system_data.fail_food_id[0]
  399.     end
  400.     @visible_Switche = $game_temp.cook_system_data.visible_Switche[@id]
  401.     if @visible_Switche == nil
  402.       @visible_Switche = $game_temp.cook_system_data.visible_Switche[0]
  403.     end
  404.     set_actor_cook_difficulty
  405.     set_add_mate
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # ● 料理の表示可否判定
  409.   #--------------------------------------------------------------------------
  410.   def show?
  411.     return true if @visible_Switche == 0
  412.     return $game_switches[@visible_Switche]
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● 料理実行可否判定
  416.   #--------------------------------------------------------------------------
  417.   def cook_ok?
  418.     need_item = @recipe.keys
  419.     for id in need_item
  420.       if id.is_a?(Numeric)
  421.         return false if $game_party.item_number(id) < @recipe[id]
  422.       elsif id.is_a?(String)
  423.         item_set = food_category(id)
  424.         return false if cook_need_item_number(item_set) < @recipe[id]
  425.       end
  426.     end
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ● 料理のカテゴリ名から必要食材を判定し食材IDの配列を返す
  430.   #--------------------------------------------------------------------------
  431.   def food_category(str)
  432.     haveitem = $game_party.items.keys
  433.     #haveitem.sort!
  434.     need_item = []
  435.     for id in haveitem
  436.       next if $game_party.item_number(id) <= 0
  437.       item = $data_items[id]
  438.       for i in 0...item.element_set.size
  439.         if $data_system.elements[item.element_set[i]] == str
  440.           need_item.push(id)
  441.           break
  442.         end
  443.       end
  444.     end
  445.     return need_item
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # ● 必要食材数を返す
  449.   #--------------------------------------------------------------------------
  450.   def cook_need_item_number(item_set)
  451.     if item_set.is_a?(Numeric)
  452.       return $game_party.item_number(item_set)
  453.     end
  454.     number = 0
  455.     for id in item_set
  456.       number += $game_party.item_number(id)
  457.     end
  458.     return number
  459.   end
  460.   #--------------------------------------------------------------------------
  461.   # ● 食材消費処理
  462.   #--------------------------------------------------------------------------
  463.   def lose_item
  464.     used_item = []
  465.     need_item = @recipe.keys
  466.     for id in need_item
  467.       if id.is_a?(Numeric)
  468.         $game_party.lose_item(id, @recipe[id])
  469.         count = @recipe[id]
  470.         for i in 0...count
  471.           used_item.push(id)
  472.         end
  473.       elsif id.is_a?(String)
  474.         item_set = []
  475.         count = @recipe[id]
  476.         for i in 0...count
  477.           item_set = food_category(id)
  478.           ran = rand(item_set.size)
  479.           $game_party.lose_item(item_set[ran], 1)
  480.           used_item.push(item_set[ran])
  481.         end
  482.       end
  483.     end
  484.     return used_item
  485.   end
  486.   #--------------------------------------------------------------------------
  487.   # ● 料理効果
  488.   #--------------------------------------------------------------------------
  489.   def cook_effect(cook_actor, fail=false, add_food=[])
  490.     cm = cook_actor.cookmastery[@id]
  491.     if cm == nil
  492.       cook_actor.cookmastery[@id] = 0
  493.       cm = 0
  494.     end
  495.     cm_r = cm * @cookmastery_revise
  496.     success = @base_success + cm * COOK_SUCCESS_REVISE
  497.     if fail == false
  498.       return false if rand(100) > success
  499.     end
  500.    
  501.     for actor in $game_party.actors
  502.       actor.states_plus(@plus_state_set)
  503.       actor.states_minus(@minus_state_set)
  504.       recover_hp = actor.maxhp * (@recover_hp_rate + cm_r) / 100 + @recover_hp
  505.       recover_sp = actor.maxsp * (@recover_sp_rate + cm_r) / 100 + @recover_sp
  506.       for id in add_food
  507.         item = $data_items[id]
  508.         actor.states_plus(item.plus_state_set)
  509.         actor.states_minus(item.minus_state_set)
  510.         recover_hp += actor.maxhp * item.recover_hp_rate / 100 + item.recover_hp
  511.         recover_sp += actor.maxsp * item.recover_sp_rate / 100 + item.recover_sp
  512.       end
  513.       unless actor.dead?
  514.         actor.hp += recover_hp
  515.         actor.sp += recover_sp
  516.       end
  517.     end
  518.     add_recover_hp_rate = 0
  519.     add_recover_sp_rate = 0
  520.     add_recover_hp = 0
  521.     add_recover_sp = 0
  522.     for id in add_food
  523.       item = $data_items[id]
  524.       add_recover_hp_rate += item.recover_hp_rate
  525.       add_recover_sp_rate += item.recover_sp_rate
  526.       add_recover_hp += item.recover_hp
  527.       add_recover_sp += item.recover_sp
  528.     end
  529.     $game_temp.temp_recover_hp_rate = @recover_hp_rate + cm_r + add_recover_hp_rate
  530.     $game_temp.temp_recover_sp_rate = @recover_sp_rate + cm_r + add_recover_sp_rate
  531.     $game_temp.temp_recover_hp = @recover_hp + add_recover_hp
  532.     $game_temp.temp_recover_sp = @recover_sp + add_recover_sp
  533.    
  534.     # 以下熟練度上昇処理
  535.     if USE_COOK_MASTERY and fail == false
  536.       if cook_actor.cookmastery[@id] < MAX_COOK_MASTERY
  537.         if cook_actor.cookmastery_exp[@id] == nil
  538.           cook_actor.cookmastery_exp[@id] = 1
  539.         else
  540.           cook_actor.cookmastery_exp[@id] += 1
  541.         end
  542.         if COOK_TYPE_SELECT == 1
  543.           actor_difficulty = @actor_cook_difficulty[cook_actor.id]
  544.         else
  545.           actor_difficulty = 0
  546.         end
  547.         if actor_difficulty == nil
  548.           actor_difficulty = @actor_cook_difficulty[0]
  549.         end
  550.         if cook_actor.cookmastery_exp[@id] >= @cook_difficulty + actor_difficulty
  551.           cook_actor.cookmastery[@id] += 1
  552.           cook_actor.cookmastery_exp[@id] = 0
  553.         end
  554.       end
  555.     end
  556.    
  557.     # コモンイベント ID が有効の場合
  558.     if @common_event > 0
  559.       # コモンイベント呼び出し予約
  560.       $game_temp.common_event_id = @common_event
  561.     end
  562.     return true
  563.   end
  564. end

  565. class Game_Temp
  566.   attr_reader :food_data
  567.   attr_reader :cook_system_data
  568.   attr_accessor :temp_recover_hp
  569.   attr_accessor :temp_recover_hp_rate
  570.   attr_accessor :temp_recover_sp
  571.   attr_accessor :temp_recover_sp_rate
  572.   attr_accessor :cookmastery
  573.   alias temp_cook_system_data_initialize initialize
  574.   def initialize
  575.     temp_cook_system_data_initialize
  576.     @cook_system_data = Cook_Data.new
  577.     @food_data = nil
  578.     @temp_recover_hp = 0
  579.     @temp_recover_hp_rate = 0
  580.     @temp_recover_sp = 0
  581.     @temp_recover_sp_rate = 0
  582.     #set_food_data
  583.   end
  584.   def set_food_data
  585.     @food_data = []
  586.     for i in 1...@cook_system_data.cookidset.size
  587.       @food_data[i] = FoodData.new(@cook_system_data.cookidset[i])
  588.     end
  589.   end
  590. end

  591. class Game_Party
  592.   attr_accessor :cookmastery
  593.   attr_accessor :cookmastery_exp
  594.   attr_accessor :cook_battle_count
  595.   attr_reader :items
  596.   #--------------------------------------------------------------------------
  597.   # ● オブジェクト初期化
  598.   #--------------------------------------------------------------------------
  599.   alias cook_system_game_party_initialize initialize
  600.   def initialize
  601.     cook_system_game_party_initialize
  602.     @cookmastery = {}
  603.     @cookmastery_exp = {}
  604.     @cook_battle_count = 0
  605.   end
  606. end

  607. class Game_Actor < Game_Battler
  608.   attr_accessor :cookmastery
  609.   attr_accessor :cookmastery_exp
  610.   #--------------------------------------------------------------------------
  611.   # ● オブジェクト初期化
  612.   #     actor_id : アクター ID
  613.   #--------------------------------------------------------------------------
  614.   alias cook_system_game_actor_initialize initialize
  615.   def initialize(actor_id)
  616.     cook_system_game_actor_initialize(actor_id)
  617.     @cookmastery = {}
  618.     @cookmastery_exp = {}
  619.   end
  620. end

  621. class Scene_Map
  622.   #--------------------------------------------------------------------------
  623.   # ● バトルの呼び出し
  624.   #--------------------------------------------------------------------------
  625.   alias cook_system_call_battle call_battle
  626.   def call_battle
  627.     # 料理可能までのカウント減少
  628.     if $game_party.cook_battle_count != 0
  629.       $game_party.cook_battle_count -= 1
  630.     end
  631.     cook_system_call_battle
  632.   end
  633. end

  634. class Window_CookMenu < Window_Selectable
  635.   attr_reader :data
复制代码


腳本太長一次發不了  分兩次發
回复 支持 反对

使用道具 举报

Lv1.梦旅人

传奇

梦石
0
星屑
50
在线时间
4 小时
注册时间
2007-4-10
帖子
427
25
发表于 2007-8-24 23:12:44 | 只看该作者
  1.   #--------------------------------------------------------------------------
  2.   # ● オブジェクト初期化
  3.   #--------------------------------------------------------------------------
  4.   def initialize
  5.     super(0, 288, 640, 192)
  6.     @column_max = 2
  7.     refresh
  8.     self.index = 0
  9.   end
  10.   #--------------------------------------------------------------------------
  11.   # ● アイテムの取得
  12.   #--------------------------------------------------------------------------
  13.   def item
  14.     return @data[self.index]
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● リフレッシュ
  18.   #--------------------------------------------------------------------------
  19.   def refresh
  20.     if self.contents != nil
  21.       self.contents.dispose
  22.       self.contents = nil
  23.     end
  24.     @data = $game_temp.food_data.dup
  25.     @data.shift
  26.     # 項目数が 0 でなければビットマップを作成し、全項目を描画
  27.     @item_max = @data.size
  28.     if @item_max > 0
  29.       self.contents = Bitmap.new(width - 32, row_max * 32)
  30.       for i in 0...@item_max
  31.         draw_item(i)
  32.       end
  33.     end
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● 項目の描画
  37.   #     index : 項目番号
  38.   #--------------------------------------------------------------------------
  39.   def draw_item(index)
  40.     item = @data[index]
  41.     if item.cook_ok?
  42.       self.contents.font.color = normal_color
  43.     else
  44.       self.contents.font.color = disabled_color
  45.     end
  46.     x = 4 + index % 2 * (288 + 32)
  47.     y = index / 2 * 32
  48.     if item.show?
  49.       rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  50.       self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  51.       bitmap = RPG::Cache.icon(item.icon_name)
  52.       opacity = self.contents.font.color == normal_color ? 255 : 128
  53.       self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  54.       self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  55.     else
  56.       self.contents.draw_text(x + 28, y, 212, 32, "-----", 0)
  57.     end
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● ヘルプテキスト更新
  61.   #--------------------------------------------------------------------------
  62.   def update_help
  63.     if self.item.show?
  64.       @help_window.set_text(self.item == nil ? "" : self.item.description)
  65.     else
  66.       @help_window.set_text("")
  67.     end
  68.   end
  69. end

  70. class Window_FoodInfo < Window_Base
  71.   #--------------------------------------------------------------------------
  72.   # ● オブジェクト初期化
  73.   #--------------------------------------------------------------------------
  74.   def initialize
  75.     super(0, 128, 640, 160)
  76.     self.contents = Bitmap.new(width - 32, height - 32)
  77.     @item = nil
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● リフレッシュ
  81.   #--------------------------------------------------------------------------
  82.   def refresh
  83.     self.contents.clear
  84.     if @item == nil
  85.       return
  86.     end
  87.     if @item.show? == false
  88.       return
  89.     end
  90.     item_set = @item.recipe.keys
  91.     need_number = []
  92.     for i in item_set
  93.       if i.is_a?(String)
  94.         temp = @item.food_category(i)
  95.         need_number.push(@item.cook_need_item_number(temp))
  96.       else
  97.         need_number.push(@item.cook_need_item_number(i))
  98.       end
  99.     end
  100.     for i in 0...item_set.size
  101.       x = 4 + i % 2 * (288 + 32)
  102.       y = i / 2 * 32
  103.       if item_set[i].is_a?(Numeric)
  104.         now_num = $game_party.item_number(item_set[i])
  105.         max_num = @item.recipe[item_set[i]]
  106.         if now_num < max_num
  107.           self.contents.font.color = disabled_color
  108.           opacity = 128
  109.         else
  110.           self.contents.font.color = normal_color
  111.           opacity = 255
  112.         end
  113.         item = $data_items[item_set[i]]
  114.         name = item.name
  115.         rect = Rect.new(x, y, self.width / 2 - 32, 32)
  116.         self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  117.         bitmap = RPG::Cache.icon(item.icon_name)
  118.         self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  119.         self.contents.draw_text(x + 28, y, 212, 32, name, 0)
  120.       elsif item_set[i].is_a?(String)
  121.         now_num = need_number[i]
  122.         max_num = @item.recipe[item_set[i]]
  123.         if now_num < max_num
  124.           self.contents.font.color = disabled_color
  125.         else
  126.           self.contents.font.color = normal_color
  127.         end
  128.         name = item_set[i].to_s
  129.         self.contents.draw_text(x + 28, y, 212, 32, name, 0)
  130.       end
  131.       self.contents.draw_text(x + 212, y, 24, 32, max_num.to_s, 2)
  132.       self.contents.font.color = normal_color
  133.       self.contents.draw_text(x + 240, y, 16, 32, "/", 1)
  134.       self.contents.draw_text(x + 256, y, 24, 32, now_num.to_s, 2)
  135.     end
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ● アイテムの設定
  139.   #     item : 新しいアイテム
  140.   #--------------------------------------------------------------------------
  141.   def item=(item)
  142.     if @item != item
  143.       @item = item
  144.       refresh
  145.     end
  146.   end
  147. end

  148. class Window_CookSelect < Window_Selectable
  149.   include Cooking_System_Config
  150.   #--------------------------------------------------------------------------
  151.   # ● オブジェクト初期化
  152.   #--------------------------------------------------------------------------
  153.   def initialize
  154.     super(0, 288, 640, 192)
  155.     @column_max = 2
  156.     self.contents = Bitmap.new(width - 32, height - 32)
  157.     if COOK_TYPE_SELECT == 1
  158.       @data = $game_party.actors
  159.     else
  160.       @data = [$game_party]
  161.     end
  162.     @item_max = @data.size
  163.     @cookitem = nil
  164.     self.index = 0
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ● アクター取得
  168.   #--------------------------------------------------------------------------
  169.   def actor
  170.     return @data[self.index]
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● リフレッシュ
  174.   #--------------------------------------------------------------------------
  175.   def refresh
  176.     self.contents.clear
  177.     if @cookitem == nil
  178.       return
  179.     end
  180.     for i in [email protected]
  181.       actor = @data[i]
  182.       x = 4 + i % 2 * (288 + 32)
  183.       y = i / 2 * 64
  184.       self.contents.font.color = normal_color
  185.       if COOK_TYPE_SELECT == 1
  186.         self.contents.draw_text(x, y, 160, 32, actor.name, 0)
  187.       else
  188.         self.contents.draw_text(x, y, 160, 32, "料理実行", 0)
  189.       end
  190.       if USE_COOK_MASTERY
  191.         cm = actor.cookmastery[@cookitem.id]
  192.         cm = 0 if cm == nil
  193.         hosi = "★" * cm
  194.         hosi2= "☆" * (MAX_COOK_MASTERY - cm)
  195.         self.contents.draw_text(x, y+32, 320, 32, hosi+hosi2, 0)
  196.       end
  197.     end
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # ● アイテムの設定
  201.   #     item : 新しいアイテム
  202.   #--------------------------------------------------------------------------
  203.   def item=(item)
  204.     if @cookitem != item
  205.       @cookitem = item
  206.       refresh
  207.     end
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ● カーソルの矩形更新
  211.   #--------------------------------------------------------------------------
  212.   def update_cursor_rect
  213.     if @index < 0
  214.       self.cursor_rect.empty
  215.     else
  216.       x = @index % @column_max * 320
  217.       y = @index / @column_max * 64
  218.       self.cursor_rect.set(x, y, 160, 32)
  219.     end
  220.   end
  221. end

  222. class Window_CookResult < Window_Base
  223.   #--------------------------------------------------------------------------
  224.   # ● オブジェクト初期化
  225.   #--------------------------------------------------------------------------
  226.   def initialize
  227.     super(80, 60, 480, 160)
  228.     self.contents = Bitmap.new(width - 32, height - 32)
  229.   end
  230.   #--------------------------------------------------------------------------
  231.   # ● リフレッシュ
  232.   #--------------------------------------------------------------------------
  233.   def refresh(item, success)
  234.     self.contents.clear
  235.     self.contents.font.color = normal_color
  236.     self.contents.draw_text(4, 0, 64, 32, "料理", 0)
  237.     if success
  238.       self.contents.font.color = system_color
  239.       str = "成功!"
  240.     else
  241.       self.contents.font.color = text_color(2)
  242.       str = "失敗…"
  243.     end
  244.     self.contents.draw_text(4+64, 0, 96, 32, str, 0)
  245.     self.contents.font.color = normal_color
  246.     rect = Rect.new(4, 32, self.width - 32, 32)
  247.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  248.     bitmap = RPG::Cache.icon(item.icon_name)
  249.     opacity = 255
  250.     hprate = $game_temp.temp_recover_hp_rate
  251.     sprate = $game_temp.temp_recover_sp_rate
  252.     hp = $game_temp.temp_recover_hp
  253.     sp = $game_temp.temp_recover_sp
  254.     self.contents.blt(4, 32 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  255.     self.contents.draw_text(4 + 28, 32, 212, 32, item.name, 0)
  256.     self.contents.draw_text(4 + 240, 32, 96, 32, "が完成!", 0)
  257.     self.contents.draw_text(4, 64, 64, 32, $data_system.words.hp, 0)
  258.     self.contents.draw_text(4 + 96, 64, 64, 32, hprate.to_s+"%", 2)
  259.     self.contents.draw_text(4 + 160, 64, 32, 32, "+", 1)
  260.     self.contents.draw_text(4 + 224, 64, 64, 32, hp.to_s, 2)
  261.     self.contents.draw_text(4, 96, 64, 32, $data_system.words.sp, 0)
  262.     self.contents.draw_text(4 + 96, 96, 64, 32, sprate.to_s+"%", 2)
  263.     self.contents.draw_text(4 + 160, 96, 32, 32, "+", 1)
  264.     self.contents.draw_text(4 + 224, 96, 64, 32, sp.to_s, 2)
  265.   end
  266. end

  267. class Window_Use_CookItem < Window_Base
  268.   #--------------------------------------------------------------------------
  269.   # ● オブジェクト初期化
  270.   #--------------------------------------------------------------------------
  271.   def initialize
  272.     super(80, 220, 480, 192)
  273.     self.contents = Bitmap.new(width - 32, height - 32)
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ● リフレッシュ
  277.   #--------------------------------------------------------------------------
  278.   def refresh(useitem, use_add_food)
  279.     self.contents.clear
  280.     self.contents.font.color = normal_color
  281.     self.contents.draw_text(4, 0, 160, 32, "使用した食材", 0)
  282.     total_food = useitem + use_add_food
  283.     for i in 0...total_food.size
  284.       item = $data_items[total_food[i]]
  285.       x = 4  + i % 2 * 240
  286.       y = 32 + i / 2 * 32
  287.       rect = Rect.new(x, y, self.width - 32, 32)
  288.       self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  289.       bitmap = RPG::Cache.icon(item.icon_name)
  290.       opacity = 255
  291.       self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  292.       if i < useitem.size
  293.         self.contents.font.color = normal_color
  294.       else
  295.         self.contents.font.color = text_color(3)
  296.       end
  297.       self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  298.     end
  299.   end
  300. end

  301. class Window_Add_Mate < Window_Base
  302.   #--------------------------------------------------------------------------
  303.   # ● オブジェクト初期化
  304.   #--------------------------------------------------------------------------
  305.   def initialize
  306.     super(0, 128, 640, 160)
  307.     self.contents = Bitmap.new(width - 32, height - 32)
  308.   end
  309.   
  310.   #--------------------------------------------------------------------------
  311.   # ● リフレッシュ
  312.   #--------------------------------------------------------------------------
  313.   def refresh(useitem)
  314.     self.contents.clear
  315.     self.contents.font.color = normal_color
  316.     self.contents.draw_text(4, 0, 160, 32, "追加食材", 0)
  317.     for i in 0...useitem.size
  318.       item = $data_items[useitem[i]]
  319.       x = 4  + i % 2 * 240
  320.       y = 32 + i / 2 * 32
  321.       rect = Rect.new(x, y, self.width - 32, 32)
  322.       self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  323.       bitmap = RPG::Cache.icon(item.icon_name)
  324.       opacity = 255
  325.       self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  326.       self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  327.     end
  328.   end
  329. end

  330. class Scene_Cooking
  331.   include Cooking_System_Config
  332.   #--------------------------------------------------------------------------
  333.   # ● メイン処理
  334.   #--------------------------------------------------------------------------
  335.   def main
  336.     $game_temp.set_food_data if $game_temp.food_data == nil
  337.     # ウィンドウを作成
  338.     @title_window = Window_Base.new(0, 0, 640, 64)
  339.     @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
  340.     @title_window.contents.draw_text(4, 0, 320, 32, "料理", 0)
  341.     @main_window = Window_CookMenu.new
  342.     @main_window.active = true
  343.     @help_window = Window_Help.new
  344.     @help_window.z = 110
  345.     @help_window.y = 64
  346.     @help_window.visible = true
  347.     s1 = "料理実行"
  348.     s2 = "やめる"
  349.     command = [s1, s2]
  350.     @select_window = Window_CookSelect.new #Window_Command.new(160, command)
  351.     @select_window.z = 110
  352.     @select_window.active = false
  353.     @select_window.visible = false
  354.     @add_mate_window = Window_Add_Mate.new
  355.     @add_mate_window.z = 120
  356.     @add_mate_window.visible = false
  357.     # インフォウィンドウを作成
  358.     @info_window = Window_FoodInfo.new
  359.     # ヘルプウィンドウを関連付け
  360.     @main_window.help_window = @help_window
  361.     # トランジション実行
  362.     Graphics.transition
  363.     # メインループ
  364.     loop do
  365.       # ゲーム画面を更新
  366.       Graphics.update
  367.       # 入力情報を更新
  368.       Input.update
  369.       # フレーム更新
  370.       update
  371.       # 画面が切り替わったらループを中断
  372.       if $scene != self
  373.         break
  374.       end
  375.     end
  376.     # トランジション準備
  377.     Graphics.freeze
  378.     # ウィンドウを解放
  379.     @title_window.dispose
  380.     @help_window.dispose
  381.     @main_window.dispose
  382.     @select_window.dispose
  383.     @info_window.dispose
  384.     @add_mate_window.dispose
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ● フレーム更新
  388.   #--------------------------------------------------------------------------
  389.   def update
  390.     # ウィンドウを更新
  391.     @help_window.update
  392.     @main_window.update
  393.     @select_window.update
  394.     @info_window.update
  395.     @add_mate_window.update
  396.     if @result_window != nil
  397.       update_result
  398.       return
  399.     end
  400.     # メインウィンドウがアクティブの場合: update_target を呼ぶ
  401.     if @main_window.active
  402.       update_main
  403.       return
  404.     end
  405.     # 種類ウィンドウがアクティブの場合: update_kind を呼ぶ
  406.     if @select_window.active
  407.       update_select
  408.       return
  409.     end
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● フレーム更新 (選択ウィンドウがアクティブの場合)
  413.   #--------------------------------------------------------------------------
  414.   def update_select
  415.     if USE_COOK_MATE_ADD and ADD_MATE_SHOW
  416.       #追加食材ウィンドウを表示
  417.       if @select_window.index != @select_w_last_index
  418.         @add_mate_window.visible = true
  419.         @select_w_last_index = @select_window.index
  420.         add_food = actor_add_mate(@main_window.item, @select_window.actor)
  421.         @add_mate_window.refresh(add_food)
  422.       end
  423.     end
  424.     # C ボタンが押された場合
  425.     if Input.trigger?(Input::C)
  426.       if $game_party.cook_battle_count > 0 or
  427.          (COOK_TYPE_SELECT == 1 and @select_window.actor.dead?)
  428.         # ブザー SE を演奏
  429.         $game_system.se_play($data_system.buzzer_se)
  430.         return
  431.       end
  432.       use_item = @main_window.item.lose_item
  433.       
  434.       if USE_COOK_MATE_ADD
  435.         add_food = actor_add_mate(@main_window.item, @select_window.actor)
  436.         have_add_food = []
  437.         for food_id in add_food
  438.           if $game_party.item_number(food_id) > 0
  439.             have_add_food.push(food_id)
  440.             $game_party.lose_item(food_id, 1)
  441.           end
  442.         end
  443.         result = @main_window.item.cook_effect(@select_window.actor, false, have_add_food)
  444.       else
  445.         result = @main_window.item.cook_effect(@select_window.actor)
  446.       end
  447.       if result
  448.         $game_system.se_play(@main_window.item.cook_se)
  449.         @result_window = Window_CookResult.new
  450.         @result_window.refresh(@main_window.item, result)
  451.       else
  452.         @fail_food = FoodData.new(@main_window.item.fail_food_id)
  453.         @fail_food.cook_effect(@select_window.actor, true)
  454.         $game_system.se_play(@fail_food.cook_se)
  455.         @result_window = Window_CookResult.new
  456.         @result_window.refresh(@fail_food, result)
  457.       end
  458.       use_add_food = []
  459.       if USE_COOK_MATE_ADD
  460.         use_add_food = have_add_food
  461.       end
  462.       if use_item.size != 0 or use_add_food.size != 0
  463.         @useitem_window = Window_Use_CookItem.new
  464.         @useitem_window.refresh(use_item, use_add_food)
  465.         @useitem_window.z = 130
  466.       end
  467.       @info_window.refresh
  468.       @result_window.z = 130
  469.       return
  470.     end
  471.     # B ボタンが押された場合
  472.     if Input.trigger?(Input::B)
  473.       # キャンセル SE を演奏
  474.       $game_system.se_play($data_system.cancel_se)
  475.       @main_window.active = true
  476.       @select_window.active = false
  477.       @select_window.visible = false
  478.       @add_mate_window.visible = false
  479.       @select_w_last_index = nil
  480.       return
  481.     end
  482.     if USE_COOK_MATE_ADD and ADD_MATE_SHOW
  483.       # A ボタンが押された場合
  484.       if Input.trigger?(Input::A)
  485.         # 決定 SE を演奏
  486.         $game_system.se_play($data_system.decision_se)
  487.         if @add_mate_window.visible
  488.           @add_mate_window.visible = false
  489.         else
  490.           @add_mate_window.visible = true
  491.         end
  492.         return
  493.       end
  494.     end
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # ● フレーム更新 (メインウィンドウがアクティブの場合)
  498.   #--------------------------------------------------------------------------
  499.   def update_main
  500.     @info_window.item = @main_window.data[@main_window.index]
  501.     # B ボタンが押された場合
  502.     if Input.trigger?(Input::B)
  503.       # キャンセル SE を演奏
  504.       $game_system.se_play($data_system.cancel_se)
  505.       $scene = Scene_Map.new
  506.       return
  507.     end
  508.     # C ボタンが押された場合
  509.     if Input.trigger?(Input::C)
  510.       if @main_window.item == nil or
  511.          @main_window.item.show? == false or
  512.          @main_window.item.cook_ok? == false
  513.         # ブザー SE を演奏
  514.         $game_system.se_play($data_system.buzzer_se)
  515.         return
  516.       end
  517.       # 決定 SE を演奏
  518.       $game_system.se_play($data_system.decision_se)
  519.       @main_window.active = false
  520.       @select_window.active = true
  521.       @select_window.visible = true
  522.       @select_window.item = @main_window.data[@main_window.index]
  523.       @select_window.refresh
  524.       return
  525.     end
  526.   end
  527.   #--------------------------------------------------------------------------
  528.   # ● フレーム更新 (リザルトウィンドウがアクティブの場合)
  529.   #--------------------------------------------------------------------------
  530.   def update_result
  531.     # C ボタンが押された場合
  532.     if Input.trigger?(Input::C)
  533.       # 決定 SE を演奏
  534.       $game_system.se_play($data_system.decision_se)
  535.       @result_window.dispose
  536.       @result_window = nil
  537.       if @useitem_window != nil
  538.         @useitem_window.dispose
  539.         @useitem_window = nil
  540.       end
  541.       @main_window.active = true
  542.       @main_window.refresh
  543.       @select_window.active = false
  544.       @select_window.visible = false
  545.       @add_mate_window.visible = false
  546.       @select_w_last_index = nil
  547.       $game_party.cook_battle_count = COOK_BATTLE_COUNT
  548.       if $game_temp.common_event_id > 0
  549.         # マップ画面に切り替え
  550.         $scene = Scene_Map.new
  551.         return
  552.       end
  553.     end
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ● 追加食材を返す
  557.   #--------------------------------------------------------------------------
  558.   def actor_add_mate(food, actor=nil)
  559.     #追加素材を取得
  560.     if COOK_TYPE_SELECT == 1
  561.       if USE_ACTOR_MATE_ADD
  562.         useitem = food.add_mate[actor.id]
  563.       else
  564.         useitem = food.add_mate[0]
  565.       end  
  566.     else
  567.       useitem = food.add_mate[0]
  568.     end
  569.     return [] if useitem == nil
  570.     return [] if useitem.size == 0
  571.     #熟練度機能が使用されているなら熟練度を取得
  572.     if USE_COOK_MASTERY
  573.       cm = actor.cookmastery[food.id]
  574.       cm = 0 if cm == nil
  575.     else
  576.       cm = 0
  577.     end
  578.     temp_item = []
  579.     for i in 0..cm
  580.       next if useitem[i] == nil
  581.       temp_item.push(useitem[i])
  582.     end
  583.     return temp_item
  584.   end
  585. end

复制代码


這個是我從外網找到的  我不知道怎么用
你們這些高手試下能用不  不能用就54我

使用方法[用翻譯工具從外網一字不漏粘貼到這 ]:
请自用法
Scene_Debug自下,Main上面粘贴。
后边,用活动指令的「脚本」

$scene = Scene_Cooking.new
转移到条款菜的景色。
对到现在没有设定项目多。
详细的说明在调味汁上写了,不过,如果因为清楚地说长在(汗)
样品的项目也准备了把那边做为参考可以。因为

…真的说明长注意。要是
momomo一定不读吧(笑)

返回
回复 支持 反对

使用道具 举报

Lv1.梦旅人

传奇

梦石
0
星屑
50
在线时间
4 小时
注册时间
2007-4-10
帖子
427
26
发表于 2007-8-24 23:39:22 | 只看该作者
范例整合了好多東西得  里面就有料理的
http://rpg.blue/upload_program/files/test10.rar
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (暗夜天使)

名侦探小柯

梦石
10
星屑
4248
在线时间
3732 小时
注册时间
2006-9-6
帖子
37430

极短27获奖MZ评测员开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

27
发表于 2007-8-24 23:42:17 | 只看该作者
下来看看。 [LINE]1,#dddddd[/LINE]版主对此帖的评论:『无关回复』,积分『-300』。这些被扣积分的一半会用于对本帖正确答案的悬赏。
不定期回归 ~ 游戏开发之旅
———————————————————————————————
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (暗夜天使)

名侦探小柯

梦石
10
星屑
4248
在线时间
3732 小时
注册时间
2006-9-6
帖子
37430

极短27获奖MZ评测员开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

28
发表于 2007-8-24 23:42:52 | 只看该作者
MS全日文的…… [LINE]1,#dddddd[/LINE]版主对此帖的评论:『无关回复』,积分『-500』。这些被扣积分的一半会用于对本帖正确答案的悬赏。
不定期回归 ~ 游戏开发之旅
———————————————————————————————
回复 支持 反对

使用道具 举报

Lv1.梦旅人

传奇

梦石
0
星屑
50
在线时间
4 小时
注册时间
2007-4-10
帖子
427
29
发表于 2007-8-24 23:52:26 | 只看该作者
我都說是從外網找到滴{/cy}
版主对此帖的评论:『无关回复』,积分『-200』。这些被扣积分的一半会用于对本帖正确答案的悬赏。
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (暗夜天使)

名侦探小柯

梦石
10
星屑
4248
在线时间
3732 小时
注册时间
2006-9-6
帖子
37430

极短27获奖MZ评测员开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

30
发表于 2007-8-25 00:00:33 | 只看该作者
MS不大好用……

也没什么复杂的运算……
不定期回归 ~ 游戏开发之旅
———————————————————————————————
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-6-22 01:47

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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