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

Project1

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

[已经解决] 已解决

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1190
在线时间
423 小时
注册时间
2010-12-26
帖子
337
11
 楼主| 发表于 2012-8-1 11:57:53 | 只看该作者
狱冥幻翼 发表于 2012-8-1 11:52
很简单的,第50行和53行改成你想要用的方法就行了,把这个脚本放最下面
其实我不推荐你用这个脚本,因为 ...

我有物品合成与物品怪物图签,地图显示要整合.......自己尝试整合........郁闷的说.......冲突老大的.........不懂啊!脚本盲
摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
491 小时
注册时间
2012-1-27
帖子
421

整合系统大赛RMVA达人

12
发表于 2012-8-1 11:58:50 | 只看该作者
36行把 任务 改成 加点
50行改成$game_party.menu_actor = $game_party.members[0]
             SceneManager.call(Scene_Lvup)
以此类推,剩下的那个位置就不用我说了吧,还有什么脚本自己加上吧
用这个脚本前提是必须只有一名主角,不然有bug
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1190
在线时间
423 小时
注册时间
2010-12-26
帖子
337
13
 楼主| 发表于 2012-8-1 12:05:15 | 只看该作者
狱冥幻翼 发表于 2012-8-1 11:58
36行把 任务 改成 加点
50行改成$game_party.menu_actor = $game_party.members[0]
             SceneMana ...

什么bug啊?看看我的游戏可以包容吧
摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1190
在线时间
423 小时
注册时间
2010-12-26
帖子
337
14
 楼主| 发表于 2012-8-1 12:16:00 | 只看该作者
狱冥幻翼 发表于 2012-8-1 10:50
你菜单里加了地图提示,所以打开不能
该你个菜单脚本,自己改下用吧

我把脚本都删了只剩下战斗脚本按了还是没反应啊



点评

找到Scene_Menu 在 def create_command_window 下方end之前插入 @command_window.set_handler(:lvup, method(:command_lvup)) 少打了俩字母……不好意思  发表于 2012-8-1 12:30
摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1190
在线时间
423 小时
注册时间
2010-12-26
帖子
337
15
 楼主| 发表于 2012-8-1 14:28:20 | 只看该作者
狱冥幻翼 发表于 2012-8-1 11:58
36行把 任务 改成 加点
50行改成$game_party.menu_actor = $game_party.members[0]
             SceneMana ...

可是为什么只能加第一人的点数无法加别人的!(别人无法选择!按加点后总是弹出第一人)



摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
491 小时
注册时间
2012-1-27
帖子
421

整合系统大赛RMVA达人

16
发表于 2012-8-1 14:52:35 | 只看该作者
358429534 发表于 2012-8-1 14:28
可是为什么只能加第一人的点数无法加别人的!(别人无法选择!按加点后总是弹出第一人)

这就是这个脚本的bug,虽然也可以加多人的,但是多人的话会产生乱加点的情况(如果用整队把第一人和第二人换一下会把两人点数互换,所以最好别用多个主角)
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1190
在线时间
423 小时
注册时间
2010-12-26
帖子
337
17
 楼主| 发表于 2012-8-1 17:48:41 | 只看该作者
狱冥幻翼 发表于 2012-8-1 14:52
这就是这个脚本的bug,虽然也可以加多人的,但是多人的话会产生乱加点的情况(如果用整队把第一人和第二 ...

你好!请问有空吗?可以帮忙整合一下6个脚本吗?我整合的老出问题!

点评

其实我身为一名苦逼的高中生,也不咋会脚本,不妨去贵宾区问问  发表于 2012-8-1 18:00
摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1190
在线时间
423 小时
注册时间
2010-12-26
帖子
337
18
 楼主| 发表于 2012-8-1 18:31:40 | 只看该作者
狱冥幻翼 发表于 2012-8-1 14:52
这就是这个脚本的bug,虽然也可以加多人的,但是多人的话会产生乱加点的情况(如果用整队把第一人和第二 ...

请问如何整合这些脚本啊!

1物品合成脚本
  1. #==============================================================================
  2. # ■ RGSS3 アイテム合成 ver 1.02
  3. #------------------------------------------------------------------------------
  4. #  配布元:
  5. #     白の魔 http://izumiwhite.web.fc2.com/
  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[2]  = [10,  ["I",1,2]]
  38.   I_recipe[3]  = [100, ["I",1,1], ["I",2,1]]
  39.   I_recipe[17] = [500, ["I",1,10]]

  40.   #武器の合成レシピ
  41.   W_recipe[3]  = [50,   ["W",1,1], ["W",2,1]]
  42.   W_recipe[6]  = [600,  ["W",3,1], ["I",17,0]]
  43.   
  44.   #防具の合成レシピ  
  45.   A_recipe[2]  = [40,   ["A",1,2]]
  46.   A_recipe[5]  = [400,  ["A",2,1], ["W",2,2], ["I",17,0]]
  47.   
  48. end


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

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

  140. end

  141. class Game_Interpreter
  142.   include WD_itemsynthesis
  143. end

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


  162. #==============================================================================
  163. # ■ Scene_ItemSynthesis
  164. #------------------------------------------------------------------------------
  165. #  合成画面の処理を行うクラスです。
  166. #==============================================================================

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

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


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

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


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

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


  749. #==============================================================================
  750. # ■ Window_ItemSynthesisNumber
  751. #------------------------------------------------------------------------------
  752. #  合成画面で、合成するアイテムの個数を入力するウィンドウです。
  753. #==============================================================================

  754. class Window_ItemSynthesisNumber < Window_ShopNumber
  755.   #--------------------------------------------------------------------------
  756.   # ● リフレッシュ
  757.   #--------------------------------------------------------------------------
  758.   def refresh
  759.     contents.clear
  760.     draw_item_name(@item, 0, item_y)
  761.     draw_number
  762.     draw_total_price if WD_itemsynthesis_ini::Cost_view
  763.   end
  764.   #--------------------------------------------------------------------------
  765.   # ● オブジェクト初期化
  766.   #--------------------------------------------------------------------------
  767.   def material_window=(material_window)
  768.     @material_window = material_window
  769.     call_update_help
  770.   end
  771.   #--------------------------------------------------------------------------
  772.   # ● 作成個数の変更
  773.   #--------------------------------------------------------------------------
  774.   def change_number(amount)
  775.     @number = [[@number + amount, @max].min, 1].max
  776.     call_update_help #追加
  777.   end
  778.   #--------------------------------------------------------------------------
  779.   # ● ヘルプテキスト更新
  780.   #--------------------------------------------------------------------------
  781.   def call_update_help
  782.     @material_window.set_num(@number) if @material_window
  783.   end
  784. end


  785. #==============================================================================
  786. # ■ Window_ItemSynthesisCategory
  787. #------------------------------------------------------------------------------
  788. #  合成画面で、通常アイテムや装備品の分類を選択するウィンドウです。
  789. #==============================================================================

  790. class Window_ItemSynthesisCategory < Window_ItemCategory
  791.   #--------------------------------------------------------------------------
  792.   # ● 桁数の取得
  793.   #--------------------------------------------------------------------------
  794.   def col_max
  795.     i = 0
  796.     i += 1 if WD_itemsynthesis_ini::Category_i
  797.     i += 1 if WD_itemsynthesis_ini::Category_w
  798.     i += 1 if WD_itemsynthesis_ini::Category_a
  799.     i += 1 if WD_itemsynthesis_ini::Category_k
  800.     return i
  801.   end
  802.   #--------------------------------------------------------------------------
  803.   # ● コマンドリストの作成
  804.   #--------------------------------------------------------------------------
  805.   def make_command_list
  806.     add_command(Vocab::item,     :item)     if WD_itemsynthesis_ini::Category_i
  807.     add_command(Vocab::weapon,   :weapon)   if WD_itemsynthesis_ini::Category_w
  808.     add_command(Vocab::armor,    :armor)    if WD_itemsynthesis_ini::Category_a
  809.     add_command(Vocab::key_item, :key_item) if WD_itemsynthesis_ini::Category_k
  810.   end
  811. end


  812. #==============================================================================
  813. # ■ Window_ItemSynthesisNumber
  814. #------------------------------------------------------------------------------
  815. #  合成画面で、切替を表示するウィンドウです。
  816. #==============================================================================

  817. class Window_ItemSynthesisChange < Window_Base
  818.   #--------------------------------------------------------------------------
  819.   # ● オブジェクト初期化
  820.   #--------------------------------------------------------------------------
  821.   def initialize(x, y, width, height)
  822.     super(x, y, width, height)
  823.     refresh
  824.   end
  825.   #--------------------------------------------------------------------------
  826.   # ● リフレッシュ
  827.   #--------------------------------------------------------------------------
  828.   def refresh
  829.     contents.clear
  830.     text = "X Y:表示切り替え"
  831.     draw_text(0, 0, contents_width, line_height, text, 1)
  832.   end
  833. end

复制代码


分割线-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2物品图鉴


物品图鉴


  1. #==============================================================================
  2. # ■ RGSS3 アイテム図鑑 ver 1.00 初期設定
  3. #------------------------------------------------------------------------------
  4. #  配布元:
  5. # 白の魔 http://izumiwhite.web.fc2.com/
  6. #
  7. #  利用規約:
  8. # RPGツクールVXの正規の登録者のみご利用になれます。
  9. # 利用報告・著作権表示とかは必要ありません。
  10. # 改造もご自由にどうぞ。
  11. # 何か問題が発生しても責任は持ちません。
  12. #==============================================================================

  13. #-------------------------------------------------------------------------------
  14. # ★ 初期設定。
  15. #-------------------------------------------------------------------------------
  16. module WD_itemdictionary_layout

  17. #=== 各項目のレイアウト設定項目 ================================================
  18. #
  19. # *_***_display : trueで表示。falseで非表示。
  20. # *_***_display_x : 表示位置のx座標
  21. # *_***_display_y : 表示位置のy座標
  22. # *_***_display_width : 表示テキストの幅
  23. # *_***_display_text* : 表示テキスト
  24. #
  25. #===============================================================================

  26. #===全図鑑共通設定==============================================================

  27. #フォントサイズ
  28. C_font_size = 20

  29. #===道具図鑑設定================================================================

  30. #番号の表示
  31. I_id_display = true
  32. I_id_display_x = 0
  33. I_id_display_y = 0
  34. I_id_display_width = 60
  35. I_id_display_digit = 3 #桁数

  36. #名前の表示
  37. I_name_display = true
  38. I_name_display_x = 84
  39. I_name_display_y = 0
  40. I_name_display_width = 172

  41. #価格の表示
  42. I_price_display = true
  43. I_price_display_x = 150
  44. I_price_display_y = 32
  45. I_price_display_width = 136
  46. I_price_display_text1 = "价格"

  47. #使用可能時の表示
  48. I_occasion_display = true
  49. I_occasion_display_x = 0
  50. I_occasion_display_y = 62
  51. I_occasion_display_width = 140
  52. I_occasion_display_text1 = "使用"
  53. I_occasion_display_text2 = "平时"
  54. I_occasion_display_text3 = "战斗时"
  55. I_occasion_display_text4 = "移动时"
  56. I_occasion_display_text5 = "-"

  57. #消耗の表示
  58. I_consumable_display = true
  59. I_consumable_display_x = 150
  60. I_consumable_display_y = 62
  61. I_consumable_display_width = 140
  62. I_consumable_display_text1 = "消耗"
  63. I_consumable_display_text2 = "需要消耗"
  64. I_consumable_display_text3 = "不用消耗"

  65. #特徴の表示
  66. I_option_display = true
  67. I_option_display_x = 0
  68. I_option_display_y = 92
  69. I_option_display_width = 286
  70. I_option_display_text1 = "功能"
  71. I_option_display_text2 = "无"

  72. #===武器図鑑設定================================================================

  73. #番号の表示
  74. W_id_display = true
  75. W_id_display_x = 0
  76. W_id_display_y = 0
  77. W_id_display_width = 60
  78. W_id_display_digit = 3 #桁数

  79. #名前の表示
  80. W_name_display = true
  81. W_name_display_x = 84
  82. W_name_display_y = 0
  83. W_name_display_width = 172

  84. #タイプの表示
  85. W_type_display = true
  86. W_type_display_x = 0
  87. W_type_display_y = 32
  88. W_type_display_width = 136
  89. W_type_display_text1 = "类型"

  90. #価格の表示
  91. W_price_display = true
  92. W_price_display_x = 150
  93. W_price_display_y = 32
  94. W_price_display_width = 136
  95. W_price_display_text1 = "价格"

  96. #攻撃力の表示
  97. W_atk_display = true
  98. W_atk_display_x = 0
  99. W_atk_display_y = 62
  100. W_atk_display_width = 136

  101. #防御力の表示
  102. W_def_display = true
  103. W_def_display_x = 150
  104. W_def_display_y = 62
  105. W_def_display_width = 136

  106. #魔法力の表示
  107. W_mat_display = true
  108. W_mat_display_x = 0
  109. W_mat_display_y = 82
  110. W_mat_display_width = 136

  111. #魔法防御の表示
  112. W_mdf_display = true
  113. W_mdf_display_x = 150
  114. W_mdf_display_y = 82
  115. W_mdf_display_width = 136

  116. #敏捷性の表示
  117. W_agi_display = true
  118. W_agi_display_x = 0
  119. W_agi_display_y = 102
  120. W_agi_display_width = 136

  121. #運の表示
  122. W_luk_display = true
  123. W_luk_display_x = 150
  124. W_luk_display_y = 102
  125. W_luk_display_width = 136

  126. #最大HPの表示
  127. W_mhp_display = true
  128. W_mhp_display_x = 0
  129. W_mhp_display_y = 122
  130. W_mhp_display_width = 136

  131. #最大MPの表示
  132. W_mmp_display = true
  133. W_mmp_display_x = 150
  134. W_mmp_display_y = 122
  135. W_mmp_display_width = 136

  136. #特徴の表示
  137. W_option_display = true
  138. W_option_display_x = 0
  139. W_option_display_y = 152
  140. W_option_display_width = 286
  141. W_option_display_text1 = "功能"
  142. W_option_display_text2 = "无"


  143. #===防具図鑑設定================================================================

  144. #番号の表示
  145. A_id_display = true
  146. A_id_display_x = 0
  147. A_id_display_y = 0
  148. A_id_display_width = 60
  149. A_id_display_digit = 3 #桁数

  150. #名前の表示
  151. A_name_display = true
  152. A_name_display_x = 84
  153. A_name_display_y = 0
  154. A_name_display_width = 172

  155. #タイプの表示
  156. A_type_display = true
  157. A_type_display_x = 0
  158. A_type_display_y = 32
  159. A_type_display_width = 136
  160. A_type_display_text1 = "类型"

  161. #価格の表示
  162. A_price_display = true
  163. A_price_display_x = 150
  164. A_price_display_y = 32
  165. A_price_display_width = 136
  166. A_price_display_text1 = "价格"

  167. #攻撃力の表示
  168. A_atk_display = true
  169. A_atk_display_x = 0
  170. A_atk_display_y = 62
  171. A_atk_display_width = 136

  172. #防御力の表示
  173. A_def_display = true
  174. A_def_display_x = 150
  175. A_def_display_y = 62
  176. A_def_display_width = 136

  177. #魔法力の表示
  178. A_mat_display = true
  179. A_mat_display_x = 0
  180. A_mat_display_y = 82
  181. A_mat_display_width = 136

  182. #魔法防御の表示
  183. A_mdf_display = true
  184. A_mdf_display_x = 150
  185. A_mdf_display_y = 82
  186. A_mdf_display_width = 136

  187. #敏捷性の表示
  188. A_agi_display = true
  189. A_agi_display_x = 0
  190. A_agi_display_y = 102
  191. A_agi_display_width = 136

  192. #運の表示
  193. A_luk_display = true
  194. A_luk_display_x = 150
  195. A_luk_display_y = 102
  196. A_luk_display_width = 136

  197. #最大HPの表示
  198. A_mhp_display = true
  199. A_mhp_display_x = 0
  200. A_mhp_display_y = 122
  201. A_mhp_display_width = 136

  202. #最大MPの表示
  203. A_mmp_display = true
  204. A_mmp_display_x = 150
  205. A_mmp_display_y = 122
  206. A_mmp_display_width = 136

  207. #特徴の表示
  208. A_option_display = true
  209. A_option_display_x = 0
  210. A_option_display_y = 152
  211. A_option_display_width = 286
  212. A_option_display_text1 = "功能"
  213. A_option_display_text2 = "无"


  214. end
  215. #-------------------------------------------------------------------------------
  216. # ★ 初期設定おわり
  217. #-------------------------------------------------------------------------------
复制代码


物品图鉴本体

  1. #==============================================================================
  2. # ■ RGSS3 アイテム図鑑 ver 1.00 本体プログラム
  3. #------------------------------------------------------------------------------
  4. #  配布元:
  5. # 白の魔 http://izumiwhite.web.fc2.com/
  6. #
  7. #  利用規約:
  8. # RPGツクールVXの正規の登録者のみご利用になれます。
  9. # 利用報告・著作権表示とかは必要ありません。
  10. # 改造もご自由にどうぞ。
  11. # 何か問題が発生しても責任は持ちません。
  12. #==============================================================================

  13. #==============================================================================
  14. # ■ WD_itemdictionary
  15. #------------------------------------------------------------------------------
  16. #  アイテム図鑑用の共通メソッドです。
  17. #==============================================================================

  18. module WD_itemdictionary



  19. def i_dictionary_switch_on(id)
  20. $game_system.i_dic_sw = [] if $game_system.i_dic_sw == nil
  21. $game_system.i_dic_sw[id] = false if $game_system.i_dic_sw[id] == nil
  22. $game_system.i_dic_sw[id] = true
  23. end
  24. def i_dictionary_switch_off(id)
  25. $game_system.i_dic_sw = [] if $game_system.i_dic_sw == nil
  26. $game_system.i_dic_sw[id] = false if $game_system.i_dic_sw[id] == nil
  27. $game_system.i_dic_sw[id] = false
  28. end
  29. def i_dictionary_switch_on?(id)
  30. $game_system.i_dic_sw = [] if $game_system.i_dic_sw == nil
  31. $game_system.i_dic_sw[id] = false if $game_system.i_dic_sw[id] == nil
  32. return $game_system.i_dic_sw[id]
  33. end
  34. def w_dictionary_switch_on(id)
  35. $game_system.w_dic_sw = [] if $game_system.w_dic_sw == nil
  36. $game_system.w_dic_sw[id] = false if $game_system.w_dic_sw[id] == nil
  37. $game_system.w_dic_sw[id] = true
  38. end
  39. def w_dictionary_switch_off(id)
  40. $game_system.w_dic_sw = [] if $game_system.w_dic_sw == nil
  41. $game_system.w_dic_sw[id] = false if $game_system.w_dic_sw[id] == nil
  42. $game_system.w_dic_sw[id] = false
  43. end
  44. def w_dictionary_switch_on?(id)
  45. $game_system.w_dic_sw = [] if $game_system.w_dic_sw == nil
  46. $game_system.w_dic_sw[id] = false if $game_system.w_dic_sw[id] == nil
  47. return $game_system.w_dic_sw[id]
  48. end
  49. def a_dictionary_switch_on(id)
  50. $game_system.a_dic_sw = [] if $game_system.a_dic_sw == nil
  51. $game_system.a_dic_sw[id] = false if $game_system.a_dic_sw[id] == nil
  52. $game_system.a_dic_sw[id] = true
  53. end
  54. def a_dictionary_switch_off(id)
  55. $game_system.a_dic_sw = [] if $game_system.a_dic_sw == nil
  56. $game_system.a_dic_sw[id] = false if $game_system.a_dic_sw[id] == nil
  57. $game_system.a_dic_sw[id] = false
  58. end
  59. def a_dictionary_switch_on?(id)
  60. $game_system.a_dic_sw = [] if $game_system.a_dic_sw == nil
  61. $game_system.a_dic_sw[id] = false if $game_system.a_dic_sw[id] == nil
  62. return $game_system.a_dic_sw[id]
  63. end
  64. def t_dictionary_switch_on(item)
  65. if item.is_a?(RPG::Item)
  66. i_dictionary_switch_on(item.id)
  67. end
  68. if item.is_a?(RPG::Weapon)
  69. w_dictionary_switch_on(item.id)
  70. end
  71. if item.is_a?(RPG::Armor)
  72. a_dictionary_switch_on(item.id)
  73. end
  74. end
  75. def t_dictionary_switch_on?(item)
  76. if item.is_a?(RPG::Item)
  77. return i_dictionary_switch_on?(item.id)
  78. end
  79. if item.is_a?(RPG::Weapon)
  80. return w_dictionary_switch_on?(item.id)
  81. end
  82. if item.is_a?(RPG::Armor)
  83. return a_dictionary_switch_on?(item.id)
  84. end
  85. end
  86. def print_dictionary?(item)
  87. if item != nil
  88. if item.name.size > 0
  89. hantei = /<图鉴无效>/ =~ item.note
  90. if hantei == nil
  91. return true
  92. end
  93. end
  94. end
  95. return false
  96. end
  97. def item_dictionary_perfection
  98. dic_max = 0
  99. dic_num = 0
  100. $data_items.each do |item|
  101. if print_dictionary?(item)
  102. dic_max += 1
  103. if i_dictionary_switch_on?(item.id) == true
  104. dic_num += 1
  105. end
  106. end
  107. end
  108. $data_weapons.each do |item|
  109. if print_dictionary?(item)
  110. dic_max += 1
  111. if w_dictionary_switch_on?(item.id) == true
  112. dic_num += 1
  113. end
  114. end
  115. end
  116. $data_armors.each do |item|
  117. if print_dictionary?(item)
  118. dic_max += 1
  119. if a_dictionary_switch_on?(item.id) == true
  120. dic_num += 1
  121. end
  122. end
  123. end
  124. return (100*dic_num)/dic_max
  125. end
  126. end

  127. class Game_Interpreter
  128. include WD_itemdictionary
  129. end

  130. class Game_System
  131. #--------------------------------------------------------------------------
  132. # ● 公開インスタンス変数
  133. #--------------------------------------------------------------------------
  134. attr_accessor :i_dic_sw
  135. attr_accessor :w_dic_sw
  136. attr_accessor :a_dic_sw
  137. #--------------------------------------------------------------------------
  138. # ● オブジェクト初期化
  139. #--------------------------------------------------------------------------
  140. alias wd_orig_initialize001 initialize
  141. def initialize
  142. wd_orig_initialize001
  143. @i_dic_sw = []
  144. @w_dic_sw = []
  145. @a_dic_sw = []
  146. end
  147. end

  148. class Game_Party < Game_Unit
  149. include WD_itemdictionary
  150. #--------------------------------------------------------------------------
  151. # ● アイテムの増加(減少)
  152. # include_equip : 装備品も含める
  153. #--------------------------------------------------------------------------
  154. alias wd_orig_gain_item001 gain_item
  155. def gain_item(item, amount, include_equip = false)
  156. wd_orig_gain_item001(item, amount, include_equip = false)
  157. if amount > 0
  158. t_dictionary_switch_on(item)
  159. end
  160. end
  161. end


  162. #==============================================================================
  163. # ■ Scene_ItemDictionary
  164. #------------------------------------------------------------------------------
  165. #  アイテム図鑑画面の処理を行うクラスです。
  166. #==============================================================================

  167. class Scene_ItemDictionary < Scene_ItemBase
  168. #--------------------------------------------------------------------------
  169. # ● 開始処理
  170. #--------------------------------------------------------------------------
  171. def start
  172. super

  173. create_help_window
  174. create_category_window
  175. create_status_window
  176. create_item_window
  177. create_perfection_window
  178. end
  179. #--------------------------------------------------------------------------
  180. # ● カテゴリウィンドウの作成
  181. #--------------------------------------------------------------------------
  182. def create_category_window
  183. @category_window = Window_ItemCategory.new
  184. @category_window.viewport = @viewport
  185. @category_window.help_window = @help_window
  186. @category_window.y = @help_window.height
  187. @category_window.set_handler(:ok, method(:on_category_ok))
  188. @category_window.set_handler(:cancel, method(:return_scene))
  189. end

  190. def return_scene
  191. $game_map.autoplay
  192. SceneManager.return
  193. end

  194. #--------------------------------------------------------------------------
  195. # ● アイテムウィンドウの作成
  196. #--------------------------------------------------------------------------
  197. def create_item_window
  198. wy = @category_window.y + @category_window.height
  199. wh = Graphics.height - wy - 48
  200. @item_window = Window_ItemDictionaryList.new(Graphics.width-172-48, wy, 172+48, wh)
  201. @item_window.viewport = @viewport
  202. @item_window.help_window = @help_window
  203. @item_window.status_window = @status_window
  204. @item_window.set_handler(:cancel, method(:on_item_cancel))
  205. @category_window.item_window = @item_window
  206. end
  207. #--------------------------------------------------------------------------
  208. # ● アイテムステータスウィンドウの作成
  209. #--------------------------------------------------------------------------
  210. def create_status_window
  211. wy = @category_window.y + @category_window.height
  212. wh = Graphics.height - wy
  213. @status_window = Window_ItemDictionaryStatus.new(0, wy, Graphics.width-172-48, wh)
  214. @status_window.viewport = @viewport
  215. @status_window.set_item(nil)
  216. end
  217. #--------------------------------------------------------------------------
  218. # ● 図鑑完成度ウィンドウの作成
  219. #--------------------------------------------------------------------------
  220. def create_perfection_window
  221. wy = @item_window.y + @item_window.height
  222. wh = 48
  223. @perfection_window = Window_ItemDictionaryPerfection.new(Graphics.width-172-48, wy, 172+48, wh)
  224. @perfection_window.viewport = @viewport
  225. end
  226. #--------------------------------------------------------------------------
  227. # ● カテゴリ[決定]
  228. #--------------------------------------------------------------------------
  229. def on_category_ok
  230. @item_window.activate
  231. @item_window.select_last
  232. end
  233. #--------------------------------------------------------------------------
  234. # ● アイテム[キャンセル]
  235. #--------------------------------------------------------------------------
  236. def on_item_cancel
  237. @item_window.unselect
  238. @category_window.activate
  239. @status_window.set_item(nil)
  240. end
  241. end



  242. #==============================================================================
  243. # ■ Window_ItemDictionaryList
  244. #------------------------------------------------------------------------------
  245. #  アイテム図鑑画面で、アイテムの一覧を表示するウィンドウです。
  246. #==============================================================================

  247. class Window_ItemDictionaryList < Window_Selectable
  248. include WD_itemdictionary
  249. #--------------------------------------------------------------------------
  250. # ● オブジェクト初期化
  251. #--------------------------------------------------------------------------
  252. def initialize(x, y, width, height)
  253. super
  254. @category = :none
  255. @data = []
  256. end
  257. #--------------------------------------------------------------------------
  258. # ● カテゴリの設定
  259. #--------------------------------------------------------------------------
  260. def category=(category)
  261. return if @category == category
  262. @category = category
  263. refresh
  264. self.oy = 0
  265. end
  266. #--------------------------------------------------------------------------
  267. # ● 桁数の取得
  268. #--------------------------------------------------------------------------
  269. def col_max
  270. return 1
  271. end
  272. #--------------------------------------------------------------------------
  273. # ● 項目数の取得
  274. #--------------------------------------------------------------------------
  275. def item_max
  276. @data ? @data.size : 1
  277. end
  278. #--------------------------------------------------------------------------
  279. # ● アイテムの取得
  280. #--------------------------------------------------------------------------
  281. def item
  282. @data && index >= 0 ? @data[index] : nil
  283. end
  284. #--------------------------------------------------------------------------
  285. # ● 選択項目の有効状態を取得
  286. #--------------------------------------------------------------------------
  287. def current_item_enabled?
  288. enable?(@data[index])
  289. end
  290. #--------------------------------------------------------------------------
  291. # ● アイテムをリストに含めるかどうか
  292. #--------------------------------------------------------------------------
  293. def include?(item)
  294. case @category
  295. when :item
  296. item.is_a?(RPG::Item) && !item.key_item?
  297. when :weapon
  298. item.is_a?(RPG::Weapon)
  299. when :armor
  300. item.is_a?(RPG::Armor)
  301. when :key_item
  302. item.is_a?(RPG::Item) && item.key_item?
  303. else
  304. false
  305. end
  306. end
  307. #--------------------------------------------------------------------------
  308. # ● アイテムリストの作成
  309. #--------------------------------------------------------------------------
  310. def make_item_list
  311. @data = []
  312. $data_items.each do |item|
  313. if print_dictionary?(item)
  314. @data.push(item) if include?(item)
  315. end
  316. end
  317. $data_weapons.each do |item|
  318. if print_dictionary?(item)
  319. @data.push(item) if include?(item)
  320. end
  321. end
  322. $data_armors.each do |item|
  323. if print_dictionary?(item)
  324. @data.push(item) if include?(item)
  325. end
  326. end
  327. @data.push(nil) if include?(nil)
  328. end
  329. #--------------------------------------------------------------------------
  330. # ● 前回の選択位置を復帰
  331. #--------------------------------------------------------------------------
  332. def select_last
  333. select(0)
  334. end
  335. #--------------------------------------------------------------------------
  336. # ● 項目の描画
  337. #--------------------------------------------------------------------------
  338. def draw_item(index)
  339. item = @data[index]
  340. if item
  341. rect = item_rect(index)
  342. rect.width -= 4
  343. if t_dictionary_switch_on?(item)
  344. change_color(normal_color, true)
  345. draw_item_name(item, rect.x, rect.y, true)
  346. else
  347. change_color(normal_color, false)
  348. draw_text(rect.x + 24, rect.y, 172, line_height, "???????")
  349. end
  350. end
  351. end
  352. #--------------------------------------------------------------------------
  353. # ● ヘルプテキスト更新
  354. #--------------------------------------------------------------------------
  355. def update_help
  356. if t_dictionary_switch_on?(item)
  357. @help_window.set_item(item)
  358. @status_window.set_item(item, @index, true)
  359. else
  360. @help_window.set_text("???????")
  361. @status_window.set_item(item, @index, false)
  362. end
  363. end
  364. #--------------------------------------------------------------------------
  365. # ● リフレッシュ
  366. #--------------------------------------------------------------------------
  367. def refresh
  368. make_item_list
  369. create_contents
  370. draw_all_items
  371. end
  372. #--------------------------------------------------------------------------
  373. # ● ステータスウィンドウの設定
  374. #--------------------------------------------------------------------------
  375. def status_window=(status_window)
  376. @status_window = status_window
  377. end
  378. end

  379. #==============================================================================
  380. # ■ Window_ItemDictionaryPerfection
  381. #------------------------------------------------------------------------------
  382. #  アイテム図鑑画面で、図鑑の完成度を表示するウィンドウです。
  383. #==============================================================================

  384. class Window_ItemDictionaryPerfection < Window_Selectable
  385. include WD_itemdictionary
  386. #--------------------------------------------------------------------------
  387. # ● オブジェクト初期化
  388. #--------------------------------------------------------------------------
  389. def initialize(x, y, width, height)
  390. super
  391. refresh(width)
  392. end
  393. #--------------------------------------------------------------------------
  394. # ● リフレッシュ
  395. #--------------------------------------------------------------------------
  396. def refresh(width)
  397. contents.clear
  398. draw_text(0, 0, width-24, line_height, "图鉴完成度: #{item_dictionary_perfection} %", 1)
  399. end
  400. end


  401. #==============================================================================
  402. # ■ Window_ItemDictionaryStatus
  403. #------------------------------------------------------------------------------
  404. #  アイテム図鑑画面で、アイテムの詳細を表示するウィンドウです。
  405. #==============================================================================

  406. class Window_ItemDictionaryStatus < Window_Selectable
  407. include WD_itemdictionary
  408. #--------------------------------------------------------------------------
  409. # ● オブジェクト初期化
  410. #--------------------------------------------------------------------------
  411. def initialize(x, y, width, height)
  412. super
  413. @item = nil
  414. refresh
  415. end
  416. #--------------------------------------------------------------------------
  417. # ● アイテムの設定
  418. #--------------------------------------------------------------------------
  419. def set_item(item, index=-1, print=false)
  420. return if ((@item == item) and (@index == index))
  421. @item = item
  422. @index = index
  423. @print = print
  424. refresh
  425. end
  426. #--------------------------------------------------------------------------
  427. # ● リフレッシュ
  428. #--------------------------------------------------------------------------
  429. def refresh
  430. contents.clear
  431. contents.font.size = 24

  432. if @print

  433. if @item.is_a?(RPG::Item)
  434. if WD_itemdictionary_layout::I_id_display
  435. text1 = sprintf("%0#{WD_itemdictionary_layout::I_id_display_digit}d",@index+1)
  436. x = WD_itemdictionary_layout::I_id_display_x
  437. y = WD_itemdictionary_layout::I_id_display_y
  438. width = WD_itemdictionary_layout::I_id_display_width
  439. height = line_height
  440. draw_text(x, y, width, height, text1, 0)
  441. end
  442. if WD_itemdictionary_layout::I_name_display
  443. x = WD_itemdictionary_layout::I_name_display_x
  444. y = WD_itemdictionary_layout::I_name_display_y
  445. draw_item_name(@item, x, y, true)
  446. end
  447. font_size = WD_itemdictionary_layout::C_font_size
  448. contents.font.size = font_size
  449. if WD_itemdictionary_layout::I_price_display
  450. text1 = WD_itemdictionary_layout::I_price_display_text1
  451. text2 = @item.price
  452. text3 = Vocab::currency_unit
  453. x = WD_itemdictionary_layout::I_price_display_x
  454. y = WD_itemdictionary_layout::I_price_display_y
  455. width = WD_itemdictionary_layout::I_price_display_width
  456. change_color(system_color)
  457. draw_text(x, y, width, font_size, text1, 0)
  458. cx = text_size(Vocab::currency_unit).width
  459. change_color(normal_color)
  460. draw_text(x, y, width - cx - 2, font_size, text2, 2)
  461. change_color(system_color)
  462. draw_text(x, y, width, font_size, text3, 2)
  463. change_color(normal_color)
  464. end
  465. if WD_itemdictionary_layout::I_occasion_display
  466. text1 = WD_itemdictionary_layout::I_occasion_display_text1
  467. text2 = WD_itemdictionary_layout::I_occasion_display_text2
  468. text3 = WD_itemdictionary_layout::I_occasion_display_text3
  469. text4 = WD_itemdictionary_layout::I_occasion_display_text4
  470. text5 = WD_itemdictionary_layout::I_occasion_display_text5
  471. x = WD_itemdictionary_layout::I_occasion_display_x
  472. y = WD_itemdictionary_layout::I_occasion_display_y
  473. width = WD_itemdictionary_layout::I_occasion_display_width
  474. change_color(system_color)
  475. draw_text(x, y, width, font_size, text1, 0)
  476. change_color(normal_color)
  477. case @item.occasion
  478. when 0
  479. draw_text(x, y, width, font_size, text2, 2)
  480. when 1
  481. draw_text(x, y, width, font_size, text3, 2)
  482. when 2
  483. draw_text(x, y, width, font_size, text4, 2)
  484. when 3
  485. draw_text(x, y, width, font_size, text5, 2)
  486. end
  487. end
  488. if WD_itemdictionary_layout::I_consumable_display
  489. text1 = WD_itemdictionary_layout::I_consumable_display_text1
  490. text2 = WD_itemdictionary_layout::I_consumable_display_text2
  491. text3 = WD_itemdictionary_layout::I_consumable_display_text3
  492. x = WD_itemdictionary_layout::I_consumable_display_x
  493. y = WD_itemdictionary_layout::I_consumable_display_y
  494. width = WD_itemdictionary_layout::I_consumable_display_width
  495. change_color(system_color)
  496. draw_text(x, y, width, font_size, text1, 0)
  497. change_color(normal_color)
  498. if @item.consumable
  499. draw_text(x, y, width, font_size, text2, 2)
  500. else
  501. draw_text(x, y, width, font_size, text3, 2)
  502. end
  503. end
  504. if WD_itemdictionary_layout::I_option_display
  505. text1 = WD_itemdictionary_layout::I_option_display_text1
  506. text2 = WD_itemdictionary_layout::I_option_display_text2
  507. x = WD_itemdictionary_layout::I_option_display_x
  508. y = WD_itemdictionary_layout::I_option_display_y
  509. width = WD_itemdictionary_layout::I_option_display_width
  510. change_color(system_color)
  511. draw_text(x, y, width, font_size, text1, 0)
  512. change_color(normal_color)
  513. i = 0
  514. @item.note.scan(/<图鉴功能:(.*)>/){|matched|
  515. i += 1
  516. self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
  517. }
  518. if i == 0
  519. self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  520. end
  521. end

  522. elsif @item.is_a?(RPG::Weapon)
  523. if WD_itemdictionary_layout::W_id_display
  524. text1 = sprintf("%0#{WD_itemdictionary_layout::W_id_display_digit}d",@index+1)
  525. x = WD_itemdictionary_layout::W_id_display_x
  526. y = WD_itemdictionary_layout::W_id_display_y
  527. width = WD_itemdictionary_layout::W_id_display_width
  528. height = line_height
  529. draw_text(x, y, width, height, text1, 0)
  530. end
  531. if WD_itemdictionary_layout::W_name_display
  532. x = WD_itemdictionary_layout::W_name_display_x
  533. y = WD_itemdictionary_layout::W_name_display_y
  534. draw_item_name(@item, x, y, true)
  535. end
  536. font_size = WD_itemdictionary_layout::C_font_size
  537. contents.font.size = font_size
  538. if WD_itemdictionary_layout::W_type_display
  539. text1 = WD_itemdictionary_layout::W_type_display_text1
  540. text2 = $data_system.weapon_types[@item.wtype_id]
  541. x = WD_itemdictionary_layout::W_type_display_x
  542. y = WD_itemdictionary_layout::W_type_display_y
  543. width = WD_itemdictionary_layout::W_type_display_width
  544. change_color(system_color)
  545. draw_text(x, y, width, font_size, text1, 0)
  546. change_color(normal_color)
  547. draw_text(x, y, width, font_size, text2, 2)
  548. end
  549. if WD_itemdictionary_layout::W_price_display
  550. text1 = WD_itemdictionary_layout::W_price_display_text1
  551. text2 = @item.price
  552. text3 = Vocab::currency_unit
  553. x = WD_itemdictionary_layout::W_price_display_x
  554. y = WD_itemdictionary_layout::W_price_display_y
  555. width = WD_itemdictionary_layout::W_price_display_width
  556. change_color(system_color)
  557. draw_text(x, y, width, font_size, text1, 0)
  558. cx = text_size(Vocab::currency_unit).width
  559. change_color(normal_color)
  560. draw_text(x, y, width - cx - 2, font_size, text2, 2)
  561. change_color(system_color)
  562. draw_text(x, y, width, font_size, text3, 2)
  563. change_color(normal_color)
  564. end
  565. if WD_itemdictionary_layout::W_atk_display
  566. text1 = Vocab::param(2)
  567. text2 = @item.params[2]
  568. x = WD_itemdictionary_layout::W_atk_display_x
  569. y = WD_itemdictionary_layout::W_atk_display_y
  570. width = WD_itemdictionary_layout::W_atk_display_width
  571. change_color(system_color)
  572. draw_text(x, y, width, font_size, text1, 0)
  573. change_color(normal_color)
  574. draw_text(x, y, width, font_size, text2, 2)
  575. end
  576. if WD_itemdictionary_layout::W_def_display
  577. text1 = Vocab::param(3)
  578. text2 = @item.params[3]
  579. x = WD_itemdictionary_layout::W_def_display_x
  580. y = WD_itemdictionary_layout::W_def_display_y
  581. width = WD_itemdictionary_layout::W_def_display_width
  582. change_color(system_color)
  583. draw_text(x, y, width, font_size, text1, 0)
  584. change_color(normal_color)
  585. draw_text(x, y, width, font_size, text2, 2)
  586. end
  587. if WD_itemdictionary_layout::W_mat_display
  588. text1 = Vocab::param(4)
  589. text2 = @item.params[4]
  590. x = WD_itemdictionary_layout::W_mat_display_x
  591. y = WD_itemdictionary_layout::W_mat_display_y
  592. width = WD_itemdictionary_layout::W_mat_display_width
  593. change_color(system_color)
  594. draw_text(x, y, width, font_size, text1, 0)
  595. change_color(normal_color)
  596. draw_text(x, y, width, font_size, text2, 2)
  597. end
  598. if WD_itemdictionary_layout::W_mdf_display
  599. text1 = Vocab::param(5)
  600. text2 = @item.params[5]
  601. x = WD_itemdictionary_layout::W_mdf_display_x
  602. y = WD_itemdictionary_layout::W_mdf_display_y
  603. width = WD_itemdictionary_layout::W_mdf_display_width
  604. change_color(system_color)
  605. draw_text(x, y, width, font_size, text1, 0)
  606. change_color(normal_color)
  607. draw_text(x, y, width, font_size, text2, 2)
  608. end
  609. if WD_itemdictionary_layout::W_agi_display
  610. text1 = Vocab::param(6)
  611. text2 = @item.params[6]
  612. x = WD_itemdictionary_layout::W_agi_display_x
  613. y = WD_itemdictionary_layout::W_agi_display_y
  614. width = WD_itemdictionary_layout::W_agi_display_width
  615. change_color(system_color)
  616. draw_text(x, y, width, font_size, text1, 0)
  617. change_color(normal_color)
  618. draw_text(x, y, width, font_size, text2, 2)
  619. end
  620. if WD_itemdictionary_layout::W_luk_display
  621. text1 = Vocab::param(7)
  622. text2 = @item.params[7]
  623. x = WD_itemdictionary_layout::W_luk_display_x
  624. y = WD_itemdictionary_layout::W_luk_display_y
  625. width = WD_itemdictionary_layout::W_luk_display_width
  626. change_color(system_color)
  627. draw_text(x, y, width, font_size, text1, 0)
  628. change_color(normal_color)
  629. draw_text(x, y, width, font_size, text2, 2)
  630. end
  631. if WD_itemdictionary_layout::W_mhp_display
  632. text1 = Vocab::param(0)
  633. text2 = @item.params[0]
  634. x = WD_itemdictionary_layout::W_mhp_display_x
  635. y = WD_itemdictionary_layout::W_mhp_display_y
  636. width = WD_itemdictionary_layout::W_mhp_display_width
  637. change_color(system_color)
  638. draw_text(x, y, width, font_size, text1, 0)
  639. change_color(normal_color)
  640. draw_text(x, y, width, font_size, text2, 2)
  641. end
  642. if WD_itemdictionary_layout::W_mmp_display
  643. text1 = Vocab::param(1)
  644. text2 = @item.params[1]
  645. x = WD_itemdictionary_layout::W_mmp_display_x
  646. y = WD_itemdictionary_layout::W_mmp_display_y
  647. width = WD_itemdictionary_layout::W_mmp_display_width
  648. change_color(system_color)
  649. draw_text(x, y, width, font_size, text1, 0)
  650. change_color(normal_color)
  651. draw_text(x, y, width, font_size, text2, 2)
  652. end
  653. if WD_itemdictionary_layout::W_option_display
  654. text1 = WD_itemdictionary_layout::W_option_display_text1
  655. text2 = WD_itemdictionary_layout::W_option_display_text2
  656. x = WD_itemdictionary_layout::W_option_display_x
  657. y = WD_itemdictionary_layout::W_option_display_y
  658. width = WD_itemdictionary_layout::W_option_display_width
  659. change_color(system_color)
  660. draw_text(x, y, width, font_size, text1, 0)
  661. change_color(normal_color)
  662. i = 0
  663. @item.note.scan(/<图鉴功能:(.*)>/){|matched|
  664. i += 1
  665. self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
  666. }
  667. if i == 0
  668. self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  669. end
  670. end

  671. elsif @item.is_a?(RPG::Armor)
  672. if WD_itemdictionary_layout::A_id_display
  673. text1 = sprintf("%0#{WD_itemdictionary_layout::A_id_display_digit}d",@index+1)
  674. x = WD_itemdictionary_layout::A_id_display_x
  675. y = WD_itemdictionary_layout::A_id_display_y
  676. width = WD_itemdictionary_layout::A_id_display_width
  677. height = line_height
  678. draw_text(x, y, width, height, text1, 0)
  679. end
  680. if WD_itemdictionary_layout::A_name_display
  681. x = WD_itemdictionary_layout::A_name_display_x
  682. y = WD_itemdictionary_layout::A_name_display_y
  683. draw_item_name(@item, x, y, true)
  684. end
  685. font_size = WD_itemdictionary_layout::C_font_size
  686. contents.font.size = font_size
  687. if WD_itemdictionary_layout::A_type_display
  688. text1 = WD_itemdictionary_layout::A_type_display_text1
  689. text2 = $data_system.armor_types[@item.atype_id]
  690. x = WD_itemdictionary_layout::A_type_display_x
  691. y = WD_itemdictionary_layout::A_type_display_y
  692. width = WD_itemdictionary_layout::A_type_display_width
  693. change_color(system_color)
  694. draw_text(x, y, width, font_size, text1, 0)
  695. change_color(normal_color)
  696. draw_text(x, y, width, font_size, text2, 2)
  697. end
  698. if WD_itemdictionary_layout::A_price_display
  699. text1 = WD_itemdictionary_layout::A_price_display_text1
  700. text2 = @item.price
  701. text3 = Vocab::currency_unit
  702. x = WD_itemdictionary_layout::A_price_display_x
  703. y = WD_itemdictionary_layout::A_price_display_y
  704. width = WD_itemdictionary_layout::A_price_display_width
  705. change_color(system_color)
  706. draw_text(x, y, width, font_size, text1, 0)
  707. cx = text_size(Vocab::currency_unit).width
  708. change_color(normal_color)
  709. draw_text(x, y, width - cx - 2, font_size, text2, 2)
  710. change_color(system_color)
  711. draw_text(x, y, width, font_size, text3, 2)
  712. change_color(normal_color)
  713. end
  714. if WD_itemdictionary_layout::A_atk_display
  715. text1 = Vocab::param(2)
  716. text2 = @item.params[2]
  717. x = WD_itemdictionary_layout::A_atk_display_x
  718. y = WD_itemdictionary_layout::A_atk_display_y
  719. width = WD_itemdictionary_layout::A_atk_display_width
  720. change_color(system_color)
  721. draw_text(x, y, width, font_size, text1, 0)
  722. change_color(normal_color)
  723. draw_text(x, y, width, font_size, text2, 2)
  724. end
  725. if WD_itemdictionary_layout::A_def_display
  726. text1 = Vocab::param(3)
  727. text2 = @item.params[3]
  728. x = WD_itemdictionary_layout::A_def_display_x
  729. y = WD_itemdictionary_layout::A_def_display_y
  730. width = WD_itemdictionary_layout::A_def_display_width
  731. change_color(system_color)
  732. draw_text(x, y, width, font_size, text1, 0)
  733. change_color(normal_color)
  734. draw_text(x, y, width, font_size, text2, 2)
  735. end
  736. if WD_itemdictionary_layout::A_mat_display
  737. text1 = Vocab::param(4)
  738. text2 = @item.params[4]
  739. x = WD_itemdictionary_layout::A_mat_display_x
  740. y = WD_itemdictionary_layout::A_mat_display_y
  741. width = WD_itemdictionary_layout::A_mat_display_width
  742. change_color(system_color)
  743. draw_text(x, y, width, font_size, text1, 0)
  744. change_color(normal_color)
  745. draw_text(x, y, width, font_size, text2, 2)
  746. end
  747. if WD_itemdictionary_layout::A_mdf_display
  748. text1 = Vocab::param(5)
  749. text2 = @item.params[5]
  750. x = WD_itemdictionary_layout::A_mdf_display_x
  751. y = WD_itemdictionary_layout::A_mdf_display_y
  752. width = WD_itemdictionary_layout::A_mdf_display_width
  753. change_color(system_color)
  754. draw_text(x, y, width, font_size, text1, 0)
  755. change_color(normal_color)
  756. draw_text(x, y, width, font_size, text2, 2)
  757. end
  758. if WD_itemdictionary_layout::A_agi_display
  759. text1 = Vocab::param(6)
  760. text2 = @item.params[6]
  761. x = WD_itemdictionary_layout::A_agi_display_x
  762. y = WD_itemdictionary_layout::A_agi_display_y
  763. width = WD_itemdictionary_layout::A_agi_display_width
  764. change_color(system_color)
  765. draw_text(x, y, width, font_size, text1, 0)
  766. change_color(normal_color)
  767. draw_text(x, y, width, font_size, text2, 2)
  768. end
  769. if WD_itemdictionary_layout::A_luk_display
  770. text1 = Vocab::param(7)
  771. text2 = @item.params[7]
  772. x = WD_itemdictionary_layout::A_luk_display_x
  773. y = WD_itemdictionary_layout::A_luk_display_y
  774. width = WD_itemdictionary_layout::A_luk_display_width
  775. change_color(system_color)
  776. draw_text(x, y, width, font_size, text1, 0)
  777. change_color(normal_color)
  778. draw_text(x, y, width, font_size, text2, 2)
  779. end
  780. if WD_itemdictionary_layout::A_mhp_display
  781. text1 = Vocab::param(0)
  782. text2 = @item.params[0]
  783. x = WD_itemdictionary_layout::A_mhp_display_x
  784. y = WD_itemdictionary_layout::A_mhp_display_y
  785. width = WD_itemdictionary_layout::A_mhp_display_width
  786. change_color(system_color)
  787. draw_text(x, y, width, font_size, text1, 0)
  788. change_color(normal_color)
  789. draw_text(x, y, width, font_size, text2, 2)
  790. end
  791. if WD_itemdictionary_layout::A_mmp_display
  792. text1 = Vocab::param(1)
  793. text2 = @item.params[1]
  794. x = WD_itemdictionary_layout::A_mmp_display_x
  795. y = WD_itemdictionary_layout::A_mmp_display_y
  796. width = WD_itemdictionary_layout::A_mmp_display_width
  797. change_color(system_color)
  798. draw_text(x, y, width, font_size, text1, 0)
  799. change_color(normal_color)
  800. draw_text(x, y, width, font_size, text2, 2)
  801. end
  802. if WD_itemdictionary_layout::A_option_display
  803. text1 = WD_itemdictionary_layout::A_option_display_text1
  804. text2 = WD_itemdictionary_layout::A_option_display_text2
  805. x = WD_itemdictionary_layout::A_option_display_x
  806. y = WD_itemdictionary_layout::A_option_display_y
  807. width = WD_itemdictionary_layout::A_option_display_width
  808. change_color(system_color)
  809. draw_text(x, y, width, font_size, text1, 0)
  810. change_color(normal_color)
  811. i = 0
  812. @item.note.scan(/<图鉴功能:(.*)>/){|matched|
  813. i += 1
  814. self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
  815. }
  816. if i == 0
  817. self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  818. end
  819. end

  820. end

  821. elsif @item != nil
  822. if @item.is_a?(RPG::Item)
  823. if WD_itemdictionary_layout::I_id_display
  824. text1 = sprintf("%0#{WD_itemdictionary_layout::I_id_display_digit}d",@index+1)
  825. x = WD_itemdictionary_layout::I_id_display_x
  826. y = WD_itemdictionary_layout::I_id_display_y
  827. width = WD_itemdictionary_layout::I_id_display_width
  828. height = line_height
  829. draw_text(x, y, width, height, text1, 0)
  830. end
  831. if WD_itemdictionary_layout::I_name_display
  832. text1 = "- No Data -"
  833. x = WD_itemdictionary_layout::I_name_display_x
  834. y = WD_itemdictionary_layout::I_name_display_y
  835. width = WD_itemdictionary_layout::I_name_display_width
  836. height = line_height
  837. draw_text(x, y, width, height, text1, 0)
  838. end
  839. end
  840. if @item.is_a?(RPG::Weapon)
  841. if WD_itemdictionary_layout::W_id_display
  842. text1 = sprintf("%0#{WD_itemdictionary_layout::W_id_display_digit}d",@index+1)
  843. x = WD_itemdictionary_layout::W_id_display_x
  844. y = WD_itemdictionary_layout::W_id_display_y
  845. width = WD_itemdictionary_layout::W_id_display_width
  846. height = line_height
  847. draw_text(x, y, width, height, text1, 0)
  848. end
  849. if WD_itemdictionary_layout::W_name_display
  850. text1 = "- No Data -"
  851. x = WD_itemdictionary_layout::W_name_display_x
  852. y = WD_itemdictionary_layout::W_name_display_y
  853. width = WD_itemdictionary_layout::W_name_display_width
  854. height = line_height
  855. draw_text(x, y, width, height, text1, 0)
  856. end
  857. end
  858. if @item.is_a?(RPG::Armor)
  859. if WD_itemdictionary_layout::A_id_display
  860. text1 = sprintf("%0#{WD_itemdictionary_layout::A_id_display_digit}d",@index+1)
  861. x = WD_itemdictionary_layout::A_id_display_x
  862. y = WD_itemdictionary_layout::A_id_display_y
  863. width = WD_itemdictionary_layout::A_id_display_width
  864. height = line_height
  865. draw_text(x, y, width, height, text1, 0)
  866. end
  867. if WD_itemdictionary_layout::A_name_display
  868. text1 = "- No Data -"
  869. x = WD_itemdictionary_layout::A_name_display_x
  870. y = WD_itemdictionary_layout::A_name_display_y
  871. width = WD_itemdictionary_layout::A_name_display_width
  872. height = line_height
  873. draw_text(x, y, width, height, text1, 0)
  874. end
  875. end

  876. end
  877. end
  878. end

复制代码


分割线-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

怪物图鉴


  1. #==============================================================================
  2. # ■ RGSS3 魔物図鑑 ver 1.00 初期設定
  3. #------------------------------------------------------------------------------
  4. #  配布元:
  5. # 白の魔 http://izumiwhite.web.fc2.com/
  6. #
  7. #  利用規約:
  8. # RPGツクールVXの正規の登録者のみご利用になれます。
  9. # 利用報告・著作権表示とかは必要ありません。
  10. # 改造もご自由にどうぞ。
  11. # 何か問題が発生しても責任は持ちません。
  12. #==============================================================================

  13. #-------------------------------------------------------------------------------
  14. # ★ 初期設定。
  15. #-------------------------------------------------------------------------------
  16. module WD_monsterdictionary_layout

  17. #=== 各項目のレイアウト設定項目 ================================================
  18. #
  19. # *_***_display : trueで表示。falseで非表示。
  20. # *_***_display_x : 表示位置のx座標
  21. # *_***_display_y : 表示位置のy座標
  22. # *_***_display_width : 表示テキストの幅
  23. # *_***_display_text* : 表示テキスト
  24. #
  25. #===============================================================================

  26. #===全図鑑共通設定==============================================================

  27. #図鑑完成度にどの段階で繁栄するか
  28. Perfection_timing = 1 #1⇒遭遇時、2⇒撃破時

  29. #フォントサイズ
  30. C_font_size = 18

  31. #===魔物図鑑設定================================================================

  32. #番号の表示
  33. M_id_display = true
  34. M_id_display_x = 0
  35. M_id_display_y = 0
  36. M_id_display_width = 60
  37. M_id_display_digit = 3 #桁数

  38. #名前の表示
  39. M_name_display = true
  40. M_name_display_x = 84
  41. M_name_display_y = 0
  42. M_name_display_width = 172

  43. #画像の表示
  44. M_pic_display = true
  45. M_pic_display_x = 140
  46. M_pic_display_y = 380
  47. M_pic_display_opacity = 255 #画像の不透明度

  48. #最大HPの表示
  49. M_mhp_display = true
  50. M_mhp_display_x = 0
  51. M_mhp_display_y = 33
  52. M_mhp_display_width = 136

  53. #最大MPの表示
  54. M_mmp_display = true
  55. M_mmp_display_x = 150
  56. M_mmp_display_y = 33
  57. M_mmp_display_width = 136

  58. #攻撃力の表示
  59. M_atk_display = true
  60. M_atk_display_x = 0
  61. M_atk_display_y = 51
  62. M_atk_display_width = 136

  63. #防御力の表示
  64. M_def_display = true
  65. M_def_display_x = 150
  66. M_def_display_y = 51
  67. M_def_display_width = 136

  68. #魔法力の表示
  69. M_mat_display = true
  70. M_mat_display_x = 0
  71. M_mat_display_y = 69
  72. M_mat_display_width = 136

  73. #魔法防御の表示
  74. M_mdf_display = true
  75. M_mdf_display_x = 150
  76. M_mdf_display_y = 69
  77. M_mdf_display_width = 136

  78. #敏捷性の表示
  79. M_agi_display = true
  80. M_agi_display_x = 0
  81. M_agi_display_y = 87
  82. M_agi_display_width = 136

  83. #運の表示
  84. M_luk_display = true
  85. M_luk_display_x = 150
  86. M_luk_display_y = 87
  87. M_luk_display_width = 136

  88. #特徴の表示
  89. M_feature_display = true
  90. M_feature_display_x = 0
  91. M_feature_display_y = 114
  92. M_feature_display_width = 286
  93. M_feature_display_text1 = "功能"
  94. M_feature_display_text2 = "-"

  95. #経験値の表示
  96. M_exp_display = true
  97. M_exp_display_x = 0
  98. M_exp_display_y = 213
  99. M_exp_display_width = 136
  100. M_exp_display_text1 = "经验值"

  101. #お金の表示
  102. M_gold_display = true
  103. M_gold_display_x = 150
  104. M_gold_display_y = 213
  105. M_gold_display_width = 136
  106. M_gold_display_text1 = "货币"

  107. #ドロップアイテムの表示
  108. M_drop_display = true
  109. M_drop_display_x = 0
  110. M_drop_display_y = 240
  111. M_drop_display_width = 286
  112. M_drop_display_text1 = "掉落物品"
  113. M_drop_display_text2 = "无"

  114. #説明の表示
  115. M_help_display = true
  116. M_help_display_x = 0
  117. M_help_display_y = 321
  118. M_help_display_width = 286
  119. M_help_display_text1 = "说明"
  120. M_help_display_text2 = "-"

  121. #撃破数の表示
  122. M_geno_display = false
  123. M_geno_display_x = 0
  124. M_geno_display_y = 321
  125. M_geno_display_width = 136
  126. M_geno_display_text1 = "击破数"

  127. end
  128. #-------------------------------------------------------------------------------
  129. # ★ 初期設定おわり
  130. #-------------------------------------------------------------------------------
复制代码

怪物图鉴本体


  1. #==============================================================================
  2. # ■ RGSS3 魔物図鑑 ver 1.00 本体プログラム
  3. #------------------------------------------------------------------------------
  4. #  配布元:
  5. # 白の魔 http://izumiwhite.web.fc2.com/
  6. #
  7. #  利用規約:
  8. # RPGツクールVXの正規の登録者のみご利用になれます。
  9. # 利用報告・著作権表示とかは必要ありません。
  10. # 改造もご自由にどうぞ。
  11. # 何か問題が発生しても責任は持ちません。
  12. #==============================================================================

  13. #==============================================================================
  14. # ■ WD_monsterdictionary
  15. #------------------------------------------------------------------------------
  16. #  魔物図鑑用の共通メソッドです。
  17. #==============================================================================

  18. module WD_monsterdictionary



  19. def m_dictionary_encount_switch_on(id)
  20. $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil
  21. $game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil
  22. $game_system.m_dic_encount_sw[id] = true
  23. end
  24. def m_dictionary_encount_switch_off(id)
  25. $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil
  26. $game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil
  27. $game_system.m_dic_encount_sw[id] = false
  28. end
  29. def m_dictionary_encount_switch_on?(id)
  30. $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil
  31. $game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil
  32. return $game_system.m_dic_encount_sw[id]
  33. end
  34. def m_dictionary_victory_switch_on(id)
  35. $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil
  36. $game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil
  37. $game_system.m_dic_victory_sw[id] = true
  38. end
  39. def m_dictionary_victory_switch_off(id)
  40. $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil
  41. $game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil
  42. $game_system.m_dic_victory_sw[id] = false
  43. end
  44. def m_dictionary_victory_switch_on?(id)
  45. $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil
  46. $game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil
  47. return $game_system.m_dic_victory_sw[id]
  48. end
  49. def m_dictionary_drop_switch_on(id, n)
  50. $game_system.m_dic_drop_sw = [] if $game_system.m_dic_drop_sw == nil
  51. $game_system.m_dic_drop_sw[id] = [] if $game_system.m_dic_drop_sw[id] == nil
  52. $game_system.m_dic_drop_sw[id][n] = false if $game_system.m_dic_drop_sw[id][n] == nil
  53. $game_system.m_dic_drop_sw[id][n] = true
  54. end
  55. def m_dictionary_drop_switch_off(id, n)
  56. $game_system.m_dic_drop_sw = [] if $game_system.m_dic_drop_sw == nil
  57. $game_system.m_dic_drop_sw[id] = [] if $game_system.m_dic_drop_sw[id] == nil
  58. $game_system.m_dic_drop_sw[id][n] = false if $game_system.m_dic_drop_sw[id][n] == nil
  59. $game_system.m_dic_drop_sw[id][n] = false
  60. end
  61. def m_dictionary_drop_switch_on?(id, n)
  62. $game_system.m_dic_drop_sw = [] if $game_system.m_dic_drop_sw == nil
  63. $game_system.m_dic_drop_sw[id] = [] if $game_system.m_dic_drop_sw[id] == nil
  64. $game_system.m_dic_drop_sw[id][n] = false if $game_system.m_dic_drop_sw[id][n] == nil
  65. return $game_system.m_dic_drop_sw[id][n]
  66. end
  67. def m_dictionary_genoside_number_add(id, n)
  68. $game_system.m_dic_genoside_num = [] if $game_system.m_dic_genoside_num == nil
  69. $game_system.m_dic_genoside_num[id] = 0 if $game_system.m_dic_genoside_num[id] == nil
  70. $game_system.m_dic_genoside_num[id] += n
  71. end
  72. def m_dictionary_genoside_number(id)
  73. $game_system.m_dic_genoside_num = [] if $game_system.m_dic_genoside_num == nil
  74. $game_system.m_dic_genoside_num[id] = 0 if $game_system.m_dic_genoside_num[id] == nil
  75. return $game_system.m_dic_genoside_num[id]
  76. end

  77. def print_dictionary?(enemy)
  78. if enemy != nil
  79. if enemy.name.size > 0
  80. hantei = /<图鉴无效>/ =~ enemy.note
  81. if hantei == nil
  82. return true
  83. end
  84. end
  85. end
  86. return false
  87. end
  88. def monster_dictionary_perfection
  89. dic_max = 0
  90. dic_num = 0
  91. $data_enemies.each do |enemy|
  92. if print_dictionary?(enemy)
  93. dic_max += 1
  94. if WD_monsterdictionary_layout::Perfection_timing == 1
  95. if m_dictionary_encount_switch_on?(enemy.id) == true
  96. dic_num += 1
  97. end
  98. elsif WD_monsterdictionary_layout::Perfection_timing == 2
  99. if m_dictionary_victory_switch_on?(enemy.id) == true
  100. dic_num += 1
  101. end
  102. end
  103. end
  104. end
  105. return (100*dic_num)/dic_max
  106. end
  107. end

  108. class Game_Interpreter
  109. include WD_monsterdictionary
  110. end

  111. class Game_System
  112. #--------------------------------------------------------------------------
  113. # ● 公開インスタンス変数
  114. #--------------------------------------------------------------------------
  115. attr_accessor :m_dic_encount_sw
  116. attr_accessor :m_dic_victory_sw
  117. attr_accessor :m_dic_drop_sw
  118. attr_accessor :m_dic_genoside_num
  119. #--------------------------------------------------------------------------
  120. # ● オブジェクト初期化
  121. #--------------------------------------------------------------------------
  122. alias wd_orig_initialize002 initialize
  123. def initialize
  124. wd_orig_initialize002
  125. @m_dic_encount_sw = []
  126. @m_dic_victory_sw = []
  127. @m_dic_drop_sw = []
  128. @m_dic_genoside_num = []
  129. end
  130. end

  131. class Game_Troop < Game_Unit
  132. include WD_monsterdictionary
  133. #--------------------------------------------------------------------------
  134. # ● 図鑑への登録(遭遇済み判定)
  135. #--------------------------------------------------------------------------
  136. def dictionary1
  137. for enemy in members
  138. m_dictionary_encount_switch_on(enemy.enemy_id) unless enemy.hidden? #遭遇済み図鑑登録
  139. end
  140. end
  141. #--------------------------------------------------------------------------
  142. # ● 図鑑への登録(撃破済み判定)
  143. #--------------------------------------------------------------------------
  144. def dictionary2
  145. for enemy in dead_members
  146. m_dictionary_victory_switch_on(enemy.enemy_id) unless enemy.hidden? #撃破済み図鑑登録
  147. m_dictionary_genoside_number_add(enemy.enemy_id, 1) unless enemy.hidden? #撃破数カウント
  148. end
  149. end
  150. end

  151. class << BattleManager
  152. #--------------------------------------------------------------------------
  153. # ● 戦闘開始
  154. #--------------------------------------------------------------------------
  155. alias wd_orig_battle_start002 battle_start
  156. def battle_start
  157. wd_orig_battle_start002
  158. $game_troop.dictionary1 #図鑑への登録(遭遇済み判定)
  159. end
  160. #--------------------------------------------------------------------------
  161. # ● 勝利の処理
  162. #--------------------------------------------------------------------------
  163. alias wd_orig_process_victory002 process_victory
  164. def process_victory
  165. $game_troop.dictionary2 #図鑑への登録(撃破済み判定)
  166. wd_orig_process_victory002
  167. end
  168. end

  169. class Game_Interpreter
  170. #--------------------------------------------------------------------------
  171. # ● 敵キャラの出現
  172. #--------------------------------------------------------------------------
  173. alias wd_orig_command_335_002 command_335
  174. def command_335
  175. wd_orig_command_335_002
  176. $game_troop.dictionary1 #図鑑への登録(遭遇済み判定)
  177. end
  178. end

  179. class Game_Enemy < Game_Battler
  180. include WD_monsterdictionary
  181. #--------------------------------------------------------------------------
  182. # ● ドロップアイテムの配列作成(再定義)
  183. #--------------------------------------------------------------------------
  184. def make_drop_items
  185. n = -1
  186. enemy.drop_items.inject([]) do |r, di|
  187. n += 1
  188. if di.kind > 0 && rand * di.denominator < drop_item_rate
  189. m_dictionary_drop_switch_on(@enemy_id, n)
  190. r.push(item_object(di.kind, di.data_id))
  191. else
  192. r
  193. end
  194. end
  195. end
  196. end

  197. #==============================================================================
  198. # ■ Scene_MonsterDictionary
  199. #------------------------------------------------------------------------------
  200. #  魔物図鑑画面の処理を行うクラスです。
  201. #==============================================================================

  202. class Scene_MonsterDictionary < Scene_ItemBase
  203. #--------------------------------------------------------------------------
  204. # ● 開始処理
  205. #--------------------------------------------------------------------------
  206. def start
  207. super

  208. create_status_window
  209. create_item_window
  210. create_perfection_window
  211. end
  212. #--------------------------------------------------------------------------
  213. # ● アイテムウィンドウの作成
  214. #--------------------------------------------------------------------------
  215. def create_item_window
  216. wy = 0
  217. wh = Graphics.height - 48
  218. @item_window = Window_MonsterDictionaryList.new(Graphics.width-172-48, wy, 172+48, wh)
  219. @item_window.viewport = @viewport
  220. @item_window.status_window = @status_window
  221. @item_window.set_handler(:cancel, method(:return_scene))
  222. @item_window.update_help
  223. end

  224. def return_scene
  225. $game_map.autoplay
  226. SceneManager.return
  227. end

  228. #--------------------------------------------------------------------------
  229. # ● アイテムステータスウィンドウの作成
  230. #--------------------------------------------------------------------------
  231. def create_status_window
  232. wy = 0
  233. wh = Graphics.height
  234. @status_window = Window_MonsterDictionaryStatus.new(0, wy, Graphics.width-172-48, wh)
  235. @status_window.viewport = @viewport
  236. end
  237. #--------------------------------------------------------------------------
  238. # ● 図鑑完成度ウィンドウの作成
  239. #--------------------------------------------------------------------------
  240. def create_perfection_window
  241. wy = @item_window.y + @item_window.height
  242. wh = 48
  243. @perfection_window = Window_MonsterDictionaryPerfection.new(Graphics.width-172-48, wy, 172+48, wh)
  244. @perfection_window.viewport = @viewport
  245. end
  246. end


  247. #==============================================================================
  248. # ■ Window_MonsterDictionaryList
  249. #------------------------------------------------------------------------------
  250. #  魔物図鑑画面で、魔物の一覧を表示するウィンドウです。
  251. #==============================================================================

  252. class Window_MonsterDictionaryList < Window_Selectable
  253. include WD_monsterdictionary
  254. #--------------------------------------------------------------------------
  255. # ● オブジェクト初期化
  256. #--------------------------------------------------------------------------
  257. def initialize(x, y, width, height)
  258. super
  259. @data = []
  260. refresh
  261. activate
  262. select(0)
  263. end
  264. #--------------------------------------------------------------------------
  265. # ● 桁数の取得
  266. #--------------------------------------------------------------------------
  267. def col_max
  268. return 1
  269. end
  270. #--------------------------------------------------------------------------
  271. # ● 項目数の取得
  272. #--------------------------------------------------------------------------
  273. def item_max
  274. @data ? @data.size : 1
  275. end
  276. #--------------------------------------------------------------------------
  277. # ● アイテムの取得
  278. #--------------------------------------------------------------------------
  279. def enemy
  280. @data && index >= 0 ? @data[index] : nil
  281. end
  282. #--------------------------------------------------------------------------
  283. # ● アイテムリストの作成
  284. #--------------------------------------------------------------------------
  285. def make_item_list
  286. @data = []
  287. $data_enemies.each do |enemy|
  288. if print_dictionary?(enemy)
  289. @data.push(enemy)
  290. end
  291. end
  292. end
  293. #--------------------------------------------------------------------------
  294. # ● 項目の描画
  295. #--------------------------------------------------------------------------
  296. def draw_item(index)
  297. enemy = @data[index]
  298. if enemy
  299. rect = item_rect(index)
  300. rect.width -= 4
  301. if m_dictionary_encount_switch_on?(enemy.id)
  302. change_color(normal_color, true)
  303. draw_text(rect.x, rect.y, 172, line_height, enemy.name)
  304. else
  305. change_color(normal_color, false)
  306. draw_text(rect.x, rect.y, 172, line_height, "???????")
  307. end
  308. end
  309. end
  310. #--------------------------------------------------------------------------
  311. # ● ヘルプウィンドウ更新メソッドの呼び出し
  312. #--------------------------------------------------------------------------
  313. def call_update_help
  314. update_help if active
  315. end
  316. #--------------------------------------------------------------------------
  317. # ● ヘルプテキスト更新
  318. #--------------------------------------------------------------------------
  319. def update_help
  320. if @status_window
  321. if m_dictionary_encount_switch_on?(enemy.id)
  322. @status_window.set_item(enemy, @index, true)
  323. else
  324. @status_window.set_item(enemy, @index, false)
  325. end
  326. end
  327. end
  328. #--------------------------------------------------------------------------
  329. # ● リフレッシュ
  330. #--------------------------------------------------------------------------
  331. def refresh
  332. make_item_list
  333. create_contents
  334. draw_all_items
  335. end
  336. #--------------------------------------------------------------------------
  337. # ● ステータスウィンドウの設定
  338. #--------------------------------------------------------------------------
  339. def status_window=(status_window)
  340. @status_window = status_window
  341. end
  342. end

  343. #==============================================================================
  344. # ■ Window_MonsterDictionaryPerfection
  345. #------------------------------------------------------------------------------
  346. #  魔物図鑑画面で、図鑑の完成度を表示するウィンドウです。
  347. #==============================================================================

  348. class Window_MonsterDictionaryPerfection < Window_Selectable
  349. include WD_monsterdictionary
  350. #--------------------------------------------------------------------------
  351. # ● オブジェクト初期化
  352. #--------------------------------------------------------------------------
  353. def initialize(x, y, width, height)
  354. super
  355. refresh(width)
  356. end
  357. #--------------------------------------------------------------------------
  358. # ● リフレッシュ
  359. #--------------------------------------------------------------------------
  360. def refresh(width)
  361. contents.clear
  362. draw_text(0, 0, width-24, line_height, "图鉴完成度: #{monster_dictionary_perfection} %", 1)
  363. end
  364. end


  365. #==============================================================================
  366. # ■ Window_MonsterDictionaryStatus
  367. #------------------------------------------------------------------------------
  368. #  魔物図鑑画面で、エネミーの詳細を表示するウィンドウです。
  369. #==============================================================================

  370. class Window_MonsterDictionaryStatus < Window_Selectable
  371. include WD_monsterdictionary
  372. #--------------------------------------------------------------------------
  373. # ● オブジェクト初期化
  374. #--------------------------------------------------------------------------
  375. def initialize(x, y, width, height)
  376. super
  377. @enemy = nil
  378. refresh
  379. end
  380. #--------------------------------------------------------------------------
  381. # ● アイテムの設定
  382. #--------------------------------------------------------------------------
  383. def set_item(enemy, index=-1, print=false)
  384. return if ((@enemy == enemy) and (@index == index))
  385. @enemy = enemy
  386. @index = index
  387. @print = print
  388. refresh
  389. end
  390. #--------------------------------------------------------------------------
  391. # ● アイテムオブジェクトの取得
  392. #--------------------------------------------------------------------------
  393. def item_object(kind, data_id)
  394. return $data_items [data_id] if kind == 1
  395. return $data_weapons[data_id] if kind == 2
  396. return $data_armors [data_id] if kind == 3
  397. return nil
  398. end
  399. #--------------------------------------------------------------------------
  400. # ● リフレッシュ
  401. #--------------------------------------------------------------------------
  402. def refresh
  403. contents.clear
  404. contents.font.size = 24

  405. if @print

  406. if WD_monsterdictionary_layout::M_id_display
  407. text1 = sprintf("%0#{WD_monsterdictionary_layout::M_id_display_digit}d",@index+1)
  408. x = WD_monsterdictionary_layout::M_id_display_x
  409. y = WD_monsterdictionary_layout::M_id_display_y
  410. width = WD_monsterdictionary_layout::M_id_display_width
  411. height = line_height
  412. draw_text(x, y, width, height, text1, 0)
  413. end
  414. if WD_monsterdictionary_layout::M_name_display
  415. text1 = @enemy.name
  416. x = WD_monsterdictionary_layout::M_name_display_x
  417. y = WD_monsterdictionary_layout::M_name_display_y
  418. width = WD_monsterdictionary_layout::M_name_display_width
  419. height = line_height
  420. draw_text(x, y, width, height, text1, 0)
  421. end
  422. if WD_monsterdictionary_layout::M_pic_display
  423. pic_name = @enemy.battler_name
  424. pic_hue = @enemy.battler_hue
  425. x = WD_monsterdictionary_layout::M_pic_display_x
  426. y = WD_monsterdictionary_layout::M_pic_display_y
  427. opacity= WD_monsterdictionary_layout::M_pic_display_opacity
  428. bitmap = Cache.battler(pic_name, pic_hue)
  429. rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  430. contents.blt(x - rect.width/2, y - rect.height, bitmap, rect, opacity)
  431. end

  432. font_size = WD_monsterdictionary_layout::C_font_size
  433. contents.font.size = font_size
  434. if WD_monsterdictionary_layout::M_mhp_display
  435. text1 = Vocab::param(0)
  436. text2 = "?"
  437. text2 = @enemy.params[0] if m_dictionary_victory_switch_on?(@enemy.id)
  438. x = WD_monsterdictionary_layout::M_mhp_display_x
  439. y = WD_monsterdictionary_layout::M_mhp_display_y
  440. width = WD_monsterdictionary_layout::M_mhp_display_width
  441. change_color(system_color)
  442. draw_text(x, y, width, font_size, text1, 0)
  443. change_color(normal_color)
  444. draw_text(x, y, width, font_size, text2, 2)
  445. end
  446. if WD_monsterdictionary_layout::M_mmp_display
  447. text1 = Vocab::param(1)
  448. text2 = "?"
  449. text2 = @enemy.params[1] if m_dictionary_victory_switch_on?(@enemy.id)
  450. x = WD_monsterdictionary_layout::M_mmp_display_x
  451. y = WD_monsterdictionary_layout::M_mmp_display_y
  452. width = WD_monsterdictionary_layout::M_mmp_display_width
  453. change_color(system_color)
  454. draw_text(x, y, width, font_size, text1, 0)
  455. change_color(normal_color)
  456. draw_text(x, y, width, font_size, text2, 2)
  457. end
  458. if WD_monsterdictionary_layout::M_atk_display
  459. text1 = Vocab::param(2)
  460. text2 = "?"
  461. text2 = @enemy.params[2] if m_dictionary_victory_switch_on?(@enemy.id)
  462. x = WD_monsterdictionary_layout::M_atk_display_x
  463. y = WD_monsterdictionary_layout::M_atk_display_y
  464. width = WD_monsterdictionary_layout::M_atk_display_width
  465. change_color(system_color)
  466. draw_text(x, y, width, font_size, text1, 0)
  467. change_color(normal_color)
  468. draw_text(x, y, width, font_size, text2, 2)
  469. end
  470. if WD_monsterdictionary_layout::M_def_display
  471. text1 = Vocab::param(3)
  472. text2 = "?"
  473. text2 = @enemy.params[3] if m_dictionary_victory_switch_on?(@enemy.id)
  474. x = WD_monsterdictionary_layout::M_def_display_x
  475. y = WD_monsterdictionary_layout::M_def_display_y
  476. width = WD_monsterdictionary_layout::M_def_display_width
  477. change_color(system_color)
  478. draw_text(x, y, width, font_size, text1, 0)
  479. change_color(normal_color)
  480. draw_text(x, y, width, font_size, text2, 2)
  481. end
  482. if WD_monsterdictionary_layout::M_mat_display
  483. text1 = Vocab::param(4)
  484. text2 = "?"
  485. text2 = @enemy.params[4] if m_dictionary_victory_switch_on?(@enemy.id)
  486. x = WD_monsterdictionary_layout::M_mat_display_x
  487. y = WD_monsterdictionary_layout::M_mat_display_y
  488. width = WD_monsterdictionary_layout::M_mat_display_width
  489. change_color(system_color)
  490. draw_text(x, y, width, font_size, text1, 0)
  491. change_color(normal_color)
  492. draw_text(x, y, width, font_size, text2, 2)
  493. end
  494. if WD_monsterdictionary_layout::M_mdf_display
  495. text1 = Vocab::param(5)
  496. text2 = "?"
  497. text2 = @enemy.params[5] if m_dictionary_victory_switch_on?(@enemy.id)
  498. x = WD_monsterdictionary_layout::M_mdf_display_x
  499. y = WD_monsterdictionary_layout::M_mdf_display_y
  500. width = WD_monsterdictionary_layout::M_mdf_display_width
  501. change_color(system_color)
  502. draw_text(x, y, width, font_size, text1, 0)
  503. change_color(normal_color)
  504. draw_text(x, y, width, font_size, text2, 2)
  505. end
  506. if WD_monsterdictionary_layout::M_agi_display
  507. text1 = Vocab::param(6)
  508. text2 = "?"
  509. text2 = @enemy.params[6] if m_dictionary_victory_switch_on?(@enemy.id)
  510. x = WD_monsterdictionary_layout::M_agi_display_x
  511. y = WD_monsterdictionary_layout::M_agi_display_y
  512. width = WD_monsterdictionary_layout::M_agi_display_width
  513. change_color(system_color)
  514. draw_text(x, y, width, font_size, text1, 0)
  515. change_color(normal_color)
  516. draw_text(x, y, width, font_size, text2, 2)
  517. end
  518. if WD_monsterdictionary_layout::M_luk_display
  519. text1 = Vocab::param(7)
  520. text2 = "?"
  521. text2 = @enemy.params[7] if m_dictionary_victory_switch_on?(@enemy.id)
  522. x = WD_monsterdictionary_layout::M_luk_display_x
  523. y = WD_monsterdictionary_layout::M_luk_display_y
  524. width = WD_monsterdictionary_layout::M_luk_display_width
  525. change_color(system_color)
  526. draw_text(x, y, width, font_size, text1, 0)
  527. change_color(normal_color)
  528. draw_text(x, y, width, font_size, text2, 2)
  529. end
  530. if WD_monsterdictionary_layout::M_feature_display
  531. text1 = WD_monsterdictionary_layout::M_feature_display_text1
  532. text2 = "?"
  533. text2 = WD_monsterdictionary_layout::M_feature_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
  534. x = WD_monsterdictionary_layout::M_feature_display_x
  535. y = WD_monsterdictionary_layout::M_feature_display_y
  536. width = WD_monsterdictionary_layout::M_feature_display_width
  537. change_color(system_color)
  538. draw_text(x, y, width, font_size, text1, 0)
  539. change_color(normal_color)
  540. i = 0
  541. if m_dictionary_victory_switch_on?(@enemy.id)
  542. @enemy.note.scan(/<图鉴功能:(.*)>/){|matched|
  543. i += 1
  544. self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
  545. }
  546. end
  547. if i == 0
  548. self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  549. end
  550. end
  551. if WD_monsterdictionary_layout::M_exp_display
  552. text1 = WD_monsterdictionary_layout::M_exp_display_text1
  553. text2 = "?"
  554. text2 = @enemy.exp if m_dictionary_victory_switch_on?(@enemy.id)
  555. x = WD_monsterdictionary_layout::M_exp_display_x
  556. y = WD_monsterdictionary_layout::M_exp_display_y
  557. width = WD_monsterdictionary_layout::M_exp_display_width
  558. change_color(system_color)
  559. draw_text(x, y, width, font_size, text1, 0)
  560. change_color(normal_color)
  561. draw_text(x, y, width, font_size, text2, 2)
  562. end
  563. if WD_monsterdictionary_layout::M_gold_display
  564. text1 = WD_monsterdictionary_layout::M_gold_display_text1
  565. text2 = "?"
  566. text2 = @enemy.gold if m_dictionary_victory_switch_on?(@enemy.id)
  567. text3 = Vocab::currency_unit
  568. x = WD_monsterdictionary_layout::M_gold_display_x
  569. y = WD_monsterdictionary_layout::M_gold_display_y
  570. width = WD_monsterdictionary_layout::M_gold_display_width
  571. change_color(system_color)
  572. draw_text(x, y, width, font_size, text1, 0)
  573. cx = text_size(Vocab::currency_unit).width
  574. change_color(normal_color)
  575. draw_text(x, y, width - cx - 2, font_size, text2, 2)
  576. change_color(system_color)
  577. draw_text(x, y, width, font_size, text3, 2)
  578. change_color(normal_color)
  579. end
  580. if WD_monsterdictionary_layout::M_drop_display
  581. text1 = WD_monsterdictionary_layout::M_drop_display_text1
  582. text2 = WD_monsterdictionary_layout::M_drop_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
  583. x = WD_monsterdictionary_layout::M_drop_display_x
  584. y = WD_monsterdictionary_layout::M_drop_display_y
  585. width = WD_monsterdictionary_layout::M_drop_display_width
  586. change_color(system_color)
  587. draw_text(x, y, width, font_size, text1, 0)
  588. change_color(normal_color)
  589. i = 0
  590. @enemy.drop_items.each do |di|
  591. if di.kind > 0
  592. i += 1
  593. item = item_object(di.kind, di.data_id)
  594. n = i -1
  595. if m_dictionary_drop_switch_on?(@enemy.id, n)
  596. text2 = item.name
  597. text3 = "1/#{di.denominator}"
  598. else
  599. text2 = "???????"
  600. text3 = ""
  601. end
  602. self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, text2, 0)
  603. self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, text3, 2)
  604. end
  605. end
  606. if i == 0
  607. self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  608. end
  609. end
  610. if WD_monsterdictionary_layout::M_help_display
  611. text1 = WD_monsterdictionary_layout::M_help_display_text1
  612. text2 = "?"
  613. text2 = WD_monsterdictionary_layout::M_help_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
  614. x = WD_monsterdictionary_layout::M_help_display_x
  615. y = WD_monsterdictionary_layout::M_help_display_y
  616. width = WD_monsterdictionary_layout::M_help_display_width
  617. change_color(system_color)
  618. draw_text(x, y, width, font_size, text1, 0)
  619. change_color(normal_color)
  620. i = 0
  621. if m_dictionary_victory_switch_on?(@enemy.id)
  622. @enemy.note.scan(/<图鉴说明:(.*)>/){|matched|
  623. i += 1
  624. self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
  625. }
  626. end
  627. if i == 0
  628. self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  629. end
  630. end
  631. if WD_monsterdictionary_layout::M_geno_display
  632. text1 = WD_monsterdictionary_layout::M_geno_display_text1
  633. text2 = "#{m_dictionary_genoside_number(@enemy.id)}"
  634. x = WD_monsterdictionary_layout::M_geno_display_x
  635. y = WD_monsterdictionary_layout::M_geno_display_y
  636. width = WD_monsterdictionary_layout::M_geno_display_width
  637. change_color(system_color)
  638. draw_text(x, y, width, font_size, text1, 0)
  639. change_color(normal_color)
  640. draw_text(x, y, width, font_size, text2, 2)
  641. end

  642. elsif @enemy != nil

  643. if WD_monsterdictionary_layout::M_id_display
  644. text1 = sprintf("%0#{WD_monsterdictionary_layout::M_id_display_digit}d",@index+1)
  645. x = WD_monsterdictionary_layout::M_id_display_x
  646. y = WD_monsterdictionary_layout::M_id_display_y
  647. width = WD_monsterdictionary_layout::M_id_display_width
  648. height = line_height
  649. draw_text(x, y, width, height, text1, 0)
  650. end
  651. if WD_monsterdictionary_layout::M_name_display
  652. text1 = "- No Data -"
  653. x = WD_monsterdictionary_layout::M_name_display_x
  654. y = WD_monsterdictionary_layout::M_name_display_y
  655. width = WD_monsterdictionary_layout::M_name_display_width
  656. height = line_height
  657. draw_text(x, y, width, height, text1, 0)
  658. end
  659. end
  660. end
  661. end
复制代码


声音控制


  1. # encoding: utf-8
  2. #===============================================================================
  3. # ¡ Volume Control For RGSS3
  4. #-------------------------------------------------------------------------------
  5. #@2011/12/01@Ru/‚Þ‚Á‚&shy;Ru
  6. #-------------------------------------------------------------------------------
  7. # English Translation By: Elemental Crisis (http://RPGMakerVXAce.com)
  8. #-------------------------------------------------------------------------------
  9. #@Adds the ability to change volume control.
  10. #
  11. #@œ The following methods are added to the Audio Module
  12. #@Audio.volBGM cc Maximum BGM volume setting.
  13. #@Audio.volBGS cc Maximum BGS volume setting.
  14. #@Audio.volSE cc Maximum SE volume setting.
  15. #@Audio.volME cc Maximum ME volume setting.
  16. #@Audio.volBGM=”’l ccSet BGM maximum volume (0-100)
  17. #@Audio.volBGM=”’l cc Set BGS maximum volume (0-100)
  18. #@Audio.volSE=”’l cc Set SE maximum volume (0-100)
  19. #@Audio.volME=”’l cc Set ME maximum volume (0-100)
  20. #
  21. #@œ Volume control is added to the main menu.
  22. #
  23. #-------------------------------------------------------------------------------
  24. # yKnown Issuesz
  25. #@Created before VXAce's official release so unable to properly test.
  26. #-------------------------------------------------------------------------------

  27. #==============================================================================
  28. # œ Settings
  29. #==============================================================================
  30. module HZM_VXA
  31. module AudioVol
  32. # Display Volume Control on Main Menu?
  33. # @true cc Display.
  34. # @false cc Don't Display.
  35. MENU_FLAG = true

  36. # Volume Control Name in Main Menu.
  37. MENU_NAME = "声音控制"

  38. # Volume Control Settings Name.
  39. CONFIG_BGM_NAME = "BGM"
  40. CONFIG_BGS_NAME = "BGS"
  41. CONFIG_SE_NAME = "SE"
  42. CONFIG_ME_NAME = "ME"
  43. CONFIG_EXIT_NAME = "退出"

  44. # Volume Change Variation.
  45. # ADD_VOL_NORMAL cc Variation of Left/Right Keys.
  46. # ADD_VOL_HIGH cc Variation of LR Key.
  47. ADD_VOL_NORMAL = 5
  48. ADD_VOL_HIGH = 25
  49. end
  50. end

  51. #==============================================================================
  52. # ª @ Settings Above @ ª
  53. # « Script Below «
  54. #==============================================================================

  55. # Additonal Methods.
  56. module Audio
  57. def self.volBGM=(vol)
  58. vol=100 if vol>100
  59. vol=0 if vol<0
  60. @hzmVolBGM = vol
  61. end
  62. def self.volBGS=(vol)
  63. vol=100 if vol>100
  64. vol=0 if vol<0
  65. @hzmVolBGS = vol
  66. end
  67. def self.volSE=(vol)
  68. vol=100 if vol>100
  69. vol=0 if vol<0
  70. @hzmVolSE = vol
  71. end
  72. def self.volME=(vol)
  73. vol=100 if vol>100
  74. vol=0 if vol<0
  75. @hzmVolME = vol
  76. end
  77. def self.volBGM
  78. @hzmVolBGM = 100 if @hzmVolBGM == nil
  79. return @hzmVolBGM
  80. end
  81. def self.volBGS
  82. @hzmVolBGS = 100 if @hzmVolBGS == nil
  83. return @hzmVolBGS
  84. end
  85. def self.volSE
  86. @hzmVolSE = 100 if @hzmVolSE == nil
  87. return @hzmVolSE
  88. end
  89. def self.volME
  90. @hzmVolME = 100 if @hzmVolME == nil
  91. return @hzmVolME
  92. end
  93. end

  94. # Playback
  95. class << Audio
  96. alias hzm_Vol_Audio_bgm_play bgm_play
  97. def bgm_play(filename, volume=100, pitch=100, pos=0)
  98. volume = self.volBGM * volume / 100
  99. hzm_Vol_Audio_bgm_play(filename, volume, pitch, pos)
  100. end
  101. alias hzm_Vol_Audio_bgs_play bgs_play
  102. def bgs_play(filename, volume=100, pitch=100)
  103. volume = self.volBGS * volume / 100
  104. hzm_Vol_Audio_bgs_play(filename, volume, pitch)
  105. end
  106. alias hzm_Vol_Audio_se_play se_play
  107. def se_play(filename, volume=100, pitch=100)
  108. volume = self.volSE * volume / 100
  109. hzm_Vol_Audio_se_play(filename, volume, pitch)
  110. end
  111. alias hzm_Vol_Audio_me_play me_play
  112. def me_play(filename, volume=100, pitch=100)
  113. volume = self.volME * volume / 100
  114. hzm_Vol_Audio_me_play(filename, volume, pitch)
  115. end
  116. end

  117. # Add To Menu.
  118. if HZM_VXA::AudioVol::MENU_FLAG
  119. class Window_MenuCommand
  120. alias hzm_Vol_Window_MenuCommand_add_original_commands add_original_commands
  121. def add_original_commands
  122. hzm_Vol_Window_MenuCommand_add_original_commands
  123. add_command(HZM_VXA::AudioVol::MENU_NAME, :hzm_vxa_vol)
  124. end
  125. end

  126. class Scene_Menu
  127. alias hzm_Vol_create_command_window create_command_window
  128. def create_command_window
  129. hzm_Vol_create_command_window
  130. @command_window.set_handler(:hzm_vxa_vol, method(:hzm_vxa_vol))
  131. end
  132. def hzm_vxa_vol
  133. SceneManager.call(HZM_VXA::AudioVol::Scene_VolConfig)
  134. end
  135. end
  136. end

  137. # Volume Chage Window
  138. module HZM_VXA
  139. module AudioVol

  140. class Window_VolConfig < Window_Command
  141. def initialize
  142. super(0, 0)
  143. self.x = (Graphics.width - self.window_width)/2
  144. self.y = (Graphics.height - self.window_height)/2
  145. end
  146. def make_command_list
  147. add_command(HZM_VXA::AudioVol::CONFIG_BGM_NAME, :bgm)
  148. add_command(HZM_VXA::AudioVol::CONFIG_BGS_NAME, :bgs)
  149. add_command(HZM_VXA::AudioVol::CONFIG_SE_NAME, :se)
  150. add_command(HZM_VXA::AudioVol::CONFIG_ME_NAME, :me)
  151. add_command(HZM_VXA::AudioVol::CONFIG_EXIT_NAME, :cancel)
  152. end
  153. def draw_item(index)
  154. super
  155. return unless index < 4
  156. case index
  157. when 0
  158. vol = Audio.volBGM
  159. when 1
  160. vol = Audio.volBGS
  161. when 2
  162. vol = Audio.volSE
  163. when 3
  164. vol = Audio.volME
  165. end
  166. draw_text(item_rect_for_text(index), vol, 2)
  167. end
  168. def volAdd(index, val)
  169. case index
  170. when 0
  171. Audio.volBGM += val
  172. now = RPG::BGM.last
  173. Audio.bgm_play('Audio/BGM/' + now.name, now.volume, now.pitch, now.pos) if now
  174. when 1
  175. Audio.volBGS += val
  176. when 2
  177. Audio.volSE += val
  178. when 3
  179. Audio.volME += val
  180. end
  181. Sound.play_cursor
  182. redraw_item(index)
  183. end
  184. def cursor_left(wrap = false)
  185. volAdd(@index, -HZM_VXA::AudioVol::ADD_VOL_NORMAL)
  186. end
  187. def cursor_right(wrap = false)
  188. volAdd(@index, HZM_VXA::AudioVol::ADD_VOL_NORMAL)
  189. end
  190. def cursor_pageup
  191. volAdd(@index, -HZM_VXA::AudioVol::ADD_VOL_HIGH)
  192. end
  193. def cursor_pagedown
  194. volAdd(@index, HZM_VXA::AudioVol::ADD_VOL_HIGH)
  195. end
  196. end
  197. class Scene_VolConfig < Scene_MenuBase
  198. def start
  199. super
  200. @command_window = Window_VolConfig.new
  201. @command_window.viewport = @viewport
  202. @command_window.set_handler(:cancel, method(:return_scene))
  203. end
  204. def terminate
  205. super
  206. @command_window.dispose
  207. end
  208. end
  209. end
  210. end

  211. # Reading/Saving
  212. class << DataManager
  213. alias hzm_Vol_make_save_contents make_save_contents
  214. def make_save_contents
  215. contents = hzm_Vol_make_save_contents
  216. contents[:hzm_vxa_vol] = {
  217. :bgm => Audio.volBGM,
  218. :bgs => Audio.volBGS,
  219. :se => Audio.volSE,
  220. :me => Audio.volME
  221. }
  222. contents
  223. end
  224. alias hzm_Vol_extract_save_contents extract_save_contents
  225. def extract_save_contents(contents)
  226. hzm_Vol_extract_save_contents(contents)
  227. Audio.volBGM = contents[:hzm_vxa_vol][:bgm]
  228. Audio.volBGS = contents[:hzm_vxa_vol][:bgs]
  229. Audio.volSE = contents[:hzm_vxa_vol][:se]
  230. Audio.volME = contents[:hzm_vxa_vol][:me]
  231. end
  232. end
复制代码



证件


  1. #==============================================================================
  2. # ★ RGSS3_実績メダル Ver1.01
  3. #==============================================================================
  4. =begin

  5. 作者:tomoaky
  6. webサイト:ひきも記 (http://hikimoki.sakura.ne.jp/)

  7. すごい記録を達成したときにポコンッと出るあれです。

  8. イベントコマンド『スクリプト』を使ってメダルを獲得することができます。
  9. 例)gain_medal(0) # 0番のメダルを獲得する
  10. 設定項目にて番号に対応するメダルの内容を設定してください。


  11. 2012.01.25 Ver1.01
  12. メダル獲得表示中のシーン切り替えにより表示がリセットされないように修正

  13. 2012.01.16 Ver1.0
  14. 公開

  15. =end

  16. #==============================================================================
  17. # □ 設定項目
  18. #==============================================================================
  19. module TMMEDAL
  20. COMMAND_MEDAL = "证件" # メニューコマンド名

  21. # メダルが1枚もない状態でメダルコマンドを隠すかどうか(true で隠す)
  22. HIDE_COMMAND = false

  23. # メダル獲得時の効果音
  24. SE_GAIN_MEDAL = RPG::SE.new("Powerup", 90, 140)

  25. # メダル名とアイコンIDと説明文の設定
  26. MEDAL_DATA = {}
  27. MEDAL_DATA[0] = ["ご主人様", 187, "メイドさんと会話をした証"]
  28. MEDAL_DATA[1] = ["禁断の光魔法", 187, "光魔法オメガアツマーレを目撃した証"]
  29. MEDAL_DATA[2] = ["サキュバスファン", 190, "サキュバスと会話をした証"]
  30. end

  31. #==============================================================================
  32. # ■ Game_Party
  33. #==============================================================================
  34. class Game_Party
  35. #--------------------------------------------------------------------------
  36. # ● 公開インスタンス変数
  37. #--------------------------------------------------------------------------
  38. attr_reader :medals # 獲得済みメダル
  39. attr_reader :new_medals # 新規獲得メダル
  40. attr_accessor :medal_info_count # メダル情報表示カウント
  41. attr_accessor :medal_info_opacity # メダル情報表示不透明度
  42. #--------------------------------------------------------------------------
  43. # ● オブジェクト初期化
  44. #--------------------------------------------------------------------------
  45. alias tmmedal_game_party_initialize initialize
  46. def initialize
  47. tmmedal_game_party_initialize
  48. @medals = []
  49. @new_medals = []
  50. @medal_info_count = 0
  51. @medal_info_opacity = 0
  52. end
  53. #--------------------------------------------------------------------------
  54. # ○ メダルの獲得
  55. #--------------------------------------------------------------------------
  56. def gain_medal(medal_id)
  57. return if @medals.any? {|medal| medal[0] == medal_id }
  58. t = Time.now.strftime(" (%Y/%m/%d %H:%M)")
  59. @medals.push([medal_id, t])
  60. @new_medals.push([medal_id, t])
  61. end
  62. #--------------------------------------------------------------------------
  63. # ○ 獲得メダル情報の消去
  64. #--------------------------------------------------------------------------
  65. def delete_new_medal
  66. @new_medals.shift
  67. end
  68. end

  69. #==============================================================================
  70. # ■ Game_Interpreter
  71. #==============================================================================
  72. class Game_Interpreter
  73. #--------------------------------------------------------------------------
  74. # ○ メダルの獲得
  75. #--------------------------------------------------------------------------
  76. def gain_medal(medal_id)
  77. $game_party.gain_medal(medal_id)
  78. end
  79. end

  80. #==============================================================================
  81. # ■ Window_MenuCommand
  82. #==============================================================================
  83. class Window_MenuCommand
  84. #--------------------------------------------------------------------------
  85. # ● 独自コマンドの追加用
  86. #--------------------------------------------------------------------------
  87. alias tmmedal_window_menucommand_add_original_commands add_original_commands
  88. def add_original_commands
  89. tmmedal_window_menucommand_add_original_commands
  90. unless TMMEDAL::HIDE_COMMAND && !medal_enabled
  91. add_command(TMMEDAL::COMMAND_MEDAL, :medal, medal_enabled)
  92. end
  93. end
  94. #--------------------------------------------------------------------------
  95. # ○ メダルの有効状態を取得
  96. #--------------------------------------------------------------------------
  97. def medal_enabled
  98. !$game_party.medals.empty?
  99. end
  100. end

  101. #==============================================================================
  102. # □ Window_MedalInfo
  103. #==============================================================================
  104. class Window_MedalInfo < Window_Base
  105. #--------------------------------------------------------------------------
  106. # ● オブジェクト初期化
  107. #--------------------------------------------------------------------------
  108. def initialize
  109. super(Graphics.width - window_width, 0, window_width, fitting_height(1))
  110. self.opacity = 0
  111. self.contents_opacity = $game_party.medal_info_opacity
  112. refresh
  113. end
  114. #--------------------------------------------------------------------------
  115. # ● ウィンドウ幅の取得
  116. #--------------------------------------------------------------------------
  117. def window_width
  118. return 240
  119. end
  120. #--------------------------------------------------------------------------
  121. # ● フレーム更新
  122. #--------------------------------------------------------------------------
  123. def update
  124. super
  125. if $game_party.medal_info_count > 0
  126. self.contents_opacity += 16
  127. $game_party.medal_info_count -= 1
  128. $game_party.delete_new_medal if $game_party.medal_info_count == 0
  129. else
  130. self.contents_opacity -= 16
  131. if self.contents_opacity == 0
  132. open unless $game_party.new_medals.empty?
  133. end
  134. end
  135. $game_party.medal_info_opacity = self.contents_opacity
  136. end
  137. #--------------------------------------------------------------------------
  138. # ● ウィンドウを開く
  139. #--------------------------------------------------------------------------
  140. def open
  141. refresh
  142. TMMEDAL::SE_GAIN_MEDAL.play
  143. $game_party.medal_info_count = 150
  144. self.contents_opacity = 0
  145. self
  146. end
  147. #--------------------------------------------------------------------------
  148. # ○ リフレッシュ
  149. #--------------------------------------------------------------------------
  150. def refresh
  151. contents.clear
  152. unless $game_party.new_medals.empty?
  153. draw_background(contents.rect)
  154. medal = TMMEDAL::MEDAL_DATA[$game_party.new_medals[0][0]]
  155. rect = contents.rect.clone
  156. draw_icon(medal[1], rect.x, rect.y)
  157. rect.x += 24
  158. rect.width -= 24
  159. draw_text(rect, medal[0])
  160. end
  161. end
  162. #--------------------------------------------------------------------------
  163. # ○ 背景の描画
  164. #--------------------------------------------------------------------------
  165. def draw_background(rect)
  166. temp_rect = rect.clone
  167. temp_rect.width /= 2
  168. contents.gradient_fill_rect(temp_rect, back_color2, back_color1)
  169. temp_rect.x = temp_rect.width
  170. contents.gradient_fill_rect(temp_rect, back_color1, back_color2)
  171. end
  172. #--------------------------------------------------------------------------
  173. # ○ 背景色 1 の取得
  174. #--------------------------------------------------------------------------
  175. def back_color1
  176. Color.new(0, 0, 0, 192)
  177. end
  178. #--------------------------------------------------------------------------
  179. # ○ 背景色 2 の取得
  180. #--------------------------------------------------------------------------
  181. def back_color2
  182. Color.new(0, 0, 0, 0)
  183. end
  184. end

  185. #==============================================================================
  186. # □ Window_Medal
  187. #==============================================================================
  188. class Window_Medal < Window_Selectable
  189. #--------------------------------------------------------------------------
  190. # ● オブジェクト初期化
  191. #--------------------------------------------------------------------------
  192. def initialize(x, y, width, height)
  193. super
  194. refresh
  195. select(0)
  196. activate
  197. end
  198. #--------------------------------------------------------------------------
  199. # ● 桁数の取得
  200. #--------------------------------------------------------------------------
  201. def col_max
  202. return 1
  203. end
  204. #--------------------------------------------------------------------------
  205. # ● 項目数の取得
  206. #--------------------------------------------------------------------------
  207. def item_max
  208. @data ? @data.size : 1
  209. end
  210. #--------------------------------------------------------------------------
  211. # ● アイテムの取得
  212. #--------------------------------------------------------------------------
  213. def item
  214. @data && index >= 0 ? @data[index] : nil
  215. end
  216. #--------------------------------------------------------------------------
  217. # ● アイテムリストの作成
  218. #--------------------------------------------------------------------------
  219. def make_item_list
  220. @data = $game_party.medals
  221. end
  222. #--------------------------------------------------------------------------
  223. # ● 項目の描画
  224. #--------------------------------------------------------------------------
  225. def draw_item(index)
  226. item = @data[index]
  227. medal = TMMEDAL::MEDAL_DATA[item[0]]
  228. rect = item_rect(index)
  229. draw_icon(medal[1], rect.x, rect.y)
  230. rect.x += 24
  231. rect.width -= 216
  232. draw_text(rect, medal[0])
  233. rect.x = contents.width - 192
  234. rect.width = 192
  235. draw_text(rect, item[1], 2)
  236. end
  237. #--------------------------------------------------------------------------
  238. # ● ヘルプテキスト更新
  239. #--------------------------------------------------------------------------
  240. def update_help
  241. if item
  242. medal = TMMEDAL::MEDAL_DATA[item[0]]
  243. text = medal[2]
  244. @help_window.set_text(text)
  245. end
  246. end
  247. #--------------------------------------------------------------------------
  248. # ● リフレッシュ
  249. #--------------------------------------------------------------------------
  250. def refresh
  251. make_item_list
  252. create_contents
  253. draw_all_items
  254. end
  255. end

  256. #==============================================================================
  257. # ■ Scene_Map
  258. #==============================================================================
  259. class Scene_Map
  260. #--------------------------------------------------------------------------
  261. # ● 全ウィンドウの作成
  262. #--------------------------------------------------------------------------
  263. alias tmmedal_scene_map_create_all_windows create_all_windows
  264. def create_all_windows
  265. tmmedal_scene_map_create_all_windows
  266. create_medal_window
  267. end
  268. #--------------------------------------------------------------------------
  269. # ○ メダルウィンドウの作成
  270. #--------------------------------------------------------------------------
  271. def create_medal_window
  272. @medal_window = Window_MedalInfo.new
  273. end
  274. end

  275. #==============================================================================
  276. # ■ Scene_Menu
  277. #==============================================================================
  278. class Scene_Menu
  279. #--------------------------------------------------------------------------
  280. # ● コマンドウィンドウの作成
  281. #--------------------------------------------------------------------------
  282. alias tmmedal_scene_menu_create_command_window create_command_window
  283. def create_command_window
  284. tmmedal_scene_menu_create_command_window
  285. @command_window.set_handler(:medal, method(:command_medal))
  286. end
  287. #--------------------------------------------------------------------------
  288. # ○ コマンド[メダル]
  289. #--------------------------------------------------------------------------
  290. def command_medal
  291. SceneManager.call(Scene_Medal)
  292. end
  293. end

  294. #==============================================================================
  295. # □ Scene_Medal
  296. #==============================================================================
  297. class Scene_Medal < Scene_MenuBase
  298. #--------------------------------------------------------------------------
  299. # ● 開始処理
  300. #--------------------------------------------------------------------------
  301. def start
  302. super
  303. create_help_window
  304. create_item_window
  305. end
  306. #--------------------------------------------------------------------------
  307. # ○ アイテムウィンドウの作成
  308. #--------------------------------------------------------------------------
  309. def create_item_window
  310. wy = @help_window.height
  311. wh = Graphics.height - wy
  312. @item_window = Window_Medal.new(0, wy, Graphics.width, wh)
  313. @item_window.viewport = @viewport
  314. @item_window.help_window = @help_window
  315. @item_window.set_handler(:cancel, method(:return_scene))
  316. end
  317. end


复制代码



无敌分割线--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

以下是菜单,只需要上边的脚本!如何删除多余的啊!


  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Menu Engine v1.07
  4. # -- Last Updated: 2012.01.03
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-AceMenuEngine"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.03 - Compatibility Update: Ace Item Menu
  15. # 2012.01.01 - Compatibility Update: Kread-EX's Synthesis
  16. # - Compatibility Update: Kread-EX's Grathnode Install
  17. # - Compatibility Update: Yami's Slot Battle
  18. # 2011.12.23 - Script efficiency optimized.
  19. # 2011.12.19 - Compatibility Update: Class System
  20. # 2011.12.15 - Updated for better menu MP/TP gauge management.
  21. # 2011.12.13 - Compatibility Update: Ace Equip Engine
  22. # 2011.12.07 - Update to allow for switches to also hide custom commands.
  23. # 2011.12.06 - Started Script and Finished.
  24. #
  25. #==============================================================================
  26. # ▼ Introduction
  27. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  28. # The menu system in RPG Maker VX Ace is great. However, it lacks the user
  29. # customization that RPG Maker 2003 allowed. With this script, you can add,
  30. # remove, and rearrange menu commands as you see fit. In addition to that, you
  31. # can add in menu commands that lead to common events or even custom commands
  32. # provided through other scripts.
  33. #
  34. # This script also provides window appearance management such as setting almost
  35. # all command windows to be center aligned or changing the position of the
  36. # help window. You can also opt to show the TP Gauge in the main menu as well
  37. # as in the skill menu.
  38. #
  39. #==============================================================================
  40. # ▼ Instructions
  41. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  42. # To install this script, open up your script editor and copy/paste this script
  43. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  44. #
  45. # Edit the settings in the module below as you see fit.
  46. #
  47. #==============================================================================
  48. # ▼ Compatibility
  49. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  50. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  51. # it will run with RPG Maker VX without adjusting.
  52. #
  53. #==============================================================================

  54. module YEA
  55. module MENU

  56. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  57. # - General Menu Settings -
  58. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  59. # This changes the way menus appear in your game. You can change their
  60. # alignment, and the location of the help window, Note that any non-Yanfly
  61. # Engine Ace scripts may not conform to these menu styles.
  62. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  63. HELP_WINDOW_LOCATION = 0 # 0-Top, 1-Middle, 2-Bottom.
  64. COMMAND_WINDOW_ALIGN = 1 # 0-Left, 1-Middle, 2-Right.

  65. # These settings below adjust the visual appearance of the main menu.
  66. # Change the settings as you see fit.
  67. MAIN_MENU_ALIGN = 0 # 0-Left, 1-Middle, 2-Right.
  68. MAIN_MENU_RIGHT = false # false-Left, true-Right.
  69. MAIN_MENU_ROWS = 14 # Maximum number of rows for main menu.
  70. DRAW_TP_GAUGE = true # If true, draws TP in the main menu.

  71. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  72. # - Main Menu Settings -
  73. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  74. # These settings adjust the main menu, the order at which commands appear,
  75. # what text is displayed, and what the commands are linked to. Here's a
  76. # list of which commands do what:
  77. #
  78. # -------------------------------------------------------------------------
  79. # :command Description
  80. # -------------------------------------------------------------------------
  81. # :item Opens up the item menu. Default menu item.
  82. # :skill Opens up the skill menu. Default menu item.
  83. # :equip Opens up the equip menu. Default menu item.
  84. # :status Opens up the status menu. Default menu item.
  85. # :formation Lets player manage party. Default menu item.
  86. # :save Opens up the save menu. Default menu item.
  87. # :game_end Opens up the shutdown menu. Default menu item.
  88. #
  89. # :class Requires YEA - Class System
  90. #
  91. # :gogototori Requires Kread-EX's Go Go Totori! Synthesis
  92. # :grathnode Requires Kread-EX's Grathnote Install
  93. # :sslots Requires Yami's YSA - Slot Battle
  94. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  95. COMMANDS =[
  96. :item, # Opens up the item menu. Default menu item.
  97. :skill, # Opens up the skill menu. Default menu item.
  98. :equip, # Opens up the equip menu. Default menu item.
  99. :class, # Requires YEA - Class System.
  100. :guardian,
  101. :status, # Opens up the status menu. Default menu item.
  102. #:formation, # Lets player manage party. Default menu item.
  103. :event_3, # Launches Common Event 3. Common Event Command.
  104. :event_4, # Launches Common Event 4. Common Event Command.
  105. :event_13, # Launches Common Event 13. Common Event Command.
  106. :event_14, # Launches Common Event 14. Common Event Command.
  107. :event_15, # Launches Common Event 15. Common Event Command.
  108. :event_16, # Launches Common Event 16. Common Event Command.
  109. :event_21, # Launches Common Event 16. Common Event Command.
  110. :event_22, # Launches Common Event 16. Common Event Command.
  111. # :debug, # Opens up debug menu. Custom Command.
  112. :shop, # Opens up a shop to pawn items. Custom Command.
  113. :save, # Opens up the save menu. Default menu item.
  114. :game_end, # Opens up the shutdown menu. Default menu item.
  115. ] # Do not remove this.

  116. #--------------------------------------------------------------------------
  117. # - Common Event Commands -
  118. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  119. # If you insert one of the following commands into the COMMANDS array, the
  120. # player can trigger a common event to launch. You can disable certain
  121. # commands in the menu by binding them to a switch. If you don't want to
  122. # disable them, set the switch to 0 and it will always be enabled. The
  123. # ShowSwitch will prevent a command from appear if that switch is false.
  124. # Set it to 0 for it to have no impact.
  125. #--------------------------------------------------------------------------
  126. COMMON_EVENT_COMMANDS ={
  127. # :command => ["Display Name", EnableSwitch, ShowSwitch, Event ID],
  128. :event_3 => [ "事件商店", 0, 0, 3],
  129. :event_4 => [ "情报", 0, 0, 4],
  130. :event_13 => [ "物品图鉴", 0, 0, 13],
  131. :event_14 => [ "怪物图鉴", 0, 0, 14],
  132. :event_15 => [ "睡眠", 0, 0, 15],
  133. :event_16 => [ "合成", 0, 0, 16],
  134. :event_21 => [ "魔法世界", 0, 0, 21],
  135. :event_22 => [ "队伍变更", 0, 0, 22],
  136. } # Do not remove this.

  137. #--------------------------------------------------------------------------
  138. # - Custom Commands -
  139. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  140. # For those who use scripts that may lead to other menu scenes, use this
  141. # hash to manage custom commands that run specific script calls. You can
  142. # disable certain commands in the menu by binding them to a switch. If you
  143. # don't want to disable them, set the switch to 0. The ShowSwitch will
  144. # prevent a command from appear if that switch is false. Set it to 0 for
  145. # it to have no impact.
  146. #--------------------------------------------------------------------------
  147. CUSTOM_COMMANDS ={
  148. # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
  149. :debug => [ "Debug", 0, 0, :command_debug],
  150. :shop => [ "商店", 0, 0, :command_shop],
  151. :gogototori => ["Synthesis", 0, 0, :command_totori],
  152. :grathnode => [ "Grathnode", 0, 0, :command_install],
  153. :guardian => [ "援护", 0, 0, :command_guardian],
  154. } # Do not remove this.

  155. end # MENU
  156. end # YEA

  157. #==============================================================================
  158. # ▼ Editting anything past this point may potentially result in causing
  159. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  160. # halitosis so edit at your own risk.
  161. #==============================================================================

  162. #==============================================================================
  163. # ■ Window_MenuCommand
  164. #------------------------------------------------------------------------------
  165. # This class is kept towards the top of the script to provide easier access.
  166. #==============================================================================

  167. class Window_MenuCommand < Window_Command

  168. #--------------------------------------------------------------------------
  169. # overwrite method: make_command_list
  170. #--------------------------------------------------------------------------
  171. def make_command_list
  172. for command in YEA::MENU::COMMANDS
  173. case command
  174. #--- Default Commands ---
  175. when :item
  176. add_command(Vocab::item, :item, main_commands_enabled)
  177. when :skill
  178. add_command(Vocab::skill, :skill, main_commands_enabled)
  179. when :equip
  180. add_command(Vocab::equip, :equip, main_commands_enabled)
  181. when :status
  182. add_command(Vocab::status, :status, main_commands_enabled)
  183. when :formation
  184. add_formation_command
  185. when :save
  186. add_original_commands
  187. add_save_command
  188. when :game_end
  189. add_game_end_command
  190. #--- Yanfly Engine Ace Commands ---
  191. when :class
  192. next unless $imported["YEA-ClassSystem"]
  193. add_class_command
  194. #--- Imported Commands ---
  195. when :sslots
  196. next unless $imported["YSA-SlotBattle"]
  197. add_sslots_command
  198. when :grathnode
  199. next unless $imported["KRX-GrathnodeInstall"]
  200. process_custom_command(command)
  201. when :gogototori
  202. next unless $imported["KRX-AlchemicSynthesis"]
  203. process_custom_command(command)
  204. #--- Imported Commands ---
  205. else
  206. process_common_event_command(command)
  207. process_custom_command(command)
  208. end
  209. end
  210. end

  211. #--------------------------------------------------------------------------
  212. # new method: process_common_event_command
  213. #--------------------------------------------------------------------------
  214. def process_common_event_command(command)
  215. return unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
  216. show = YEA::MENU::COMMON_EVENT_COMMANDS[command][2]
  217. continue = show <= 0 ? true : $game_switches[show]
  218. return unless continue
  219. text = YEA::MENU::COMMON_EVENT_COMMANDS[command][0]
  220. switch = YEA::MENU::COMMON_EVENT_COMMANDS[command][1]
  221. ext = YEA::MENU::COMMON_EVENT_COMMANDS[command][3]
  222. enabled = switch <= 0 ? true : $game_switches[switch]
  223. add_command(text, command, enabled, ext)
  224. end

  225. #--------------------------------------------------------------------------
  226. # new method: process_custom_command
  227. #--------------------------------------------------------------------------
  228. def process_custom_command(command)
  229. return unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
  230. show = YEA::MENU::CUSTOM_COMMANDS[command][2]
  231. continue = show <= 0 ? true : $game_switches[show]
  232. return unless continue
  233. text = YEA::MENU::CUSTOM_COMMANDS[command][0]
  234. switch = YEA::MENU::CUSTOM_COMMANDS[command][1]
  235. enabled = switch <= 0 ? true : $game_switches[switch]
  236. add_command(text, command, enabled)
  237. end

  238. end # Window_MenuCommand

  239. #==============================================================================
  240. # ■ Menu
  241. #==============================================================================

  242. module Menu

  243. #--------------------------------------------------------------------------
  244. # self.help_window_location
  245. #--------------------------------------------------------------------------
  246. def self.help_window_location
  247. return YEA::MENU::HELP_WINDOW_LOCATION
  248. end

  249. #--------------------------------------------------------------------------
  250. # self.command_window_align
  251. #--------------------------------------------------------------------------
  252. def self.command_window_align
  253. return YEA::MENU::COMMAND_WINDOW_ALIGN
  254. end

  255. #--------------------------------------------------------------------------
  256. # self.main_menu_align
  257. #--------------------------------------------------------------------------
  258. def self.main_menu_align
  259. return YEA::MENU::MAIN_MENU_ALIGN
  260. end

  261. #--------------------------------------------------------------------------
  262. # self.main_menu_right
  263. #--------------------------------------------------------------------------
  264. def self.main_menu_right
  265. return YEA::MENU::MAIN_MENU_RIGHT
  266. end

  267. end # Menu

  268. #==============================================================================
  269. # ■ Game_Actor
  270. #==============================================================================

  271. class Game_Actor < Game_Battler

  272. #--------------------------------------------------------------------------
  273. # new method: draw_mp?
  274. #--------------------------------------------------------------------------
  275. def draw_mp?
  276. return true unless draw_tp?
  277. for skill in skills
  278. next unless added_skill_types.include?(skill.stype_id)
  279. return true if skill.mp_cost > 0
  280. end
  281. return false
  282. end

  283. #--------------------------------------------------------------------------
  284. # new method: draw_tp?
  285. #--------------------------------------------------------------------------
  286. def draw_tp?
  287. return false unless $data_system.opt_display_tp
  288. for skill in skills
  289. next unless added_skill_types.include?(skill.stype_id)
  290. return true if skill.tp_cost > 0
  291. end
  292. return false
  293. end

  294. end # Game_Actor

  295. #==============================================================================
  296. # ■ Window_Base
  297. #==============================================================================

  298. class Window_Base < Window

  299. #--------------------------------------------------------------------------
  300. # overwrite method: draw_actor_simple_status
  301. #--------------------------------------------------------------------------
  302. def draw_actor_simple_status(actor, dx, dy)
  303. dy -= line_height / 2
  304. draw_actor_name(actor, dx, dy)
  305. draw_actor_level(actor, dx, dy + line_height * 1)
  306. draw_actor_icons(actor, dx, dy + line_height * 2)
  307. dw = contents.width - dx - 124
  308. draw_actor_class(actor, dx + 120, dy, dw)
  309. draw_actor_hp(actor, dx + 120, dy + line_height * 1, dw)
  310. if YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && !actor.draw_mp?
  311. draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw)
  312. elsif YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && actor.draw_mp?
  313. if $imported["YEA-BattleEngine"]
  314. draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw/2 + 1)
  315. draw_actor_mp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2)
  316. else
  317. draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw/2 + 1)
  318. draw_actor_tp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2)
  319. end
  320. else
  321. draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw)
  322. end
  323. end

  324. end # Window_Base

  325. #==============================================================================
  326. # ■ Window_Command
  327. #==============================================================================

  328. class Window_Command < Window_Selectable

  329. #--------------------------------------------------------------------------
  330. # overwrite method: alignment
  331. #--------------------------------------------------------------------------
  332. def alignment
  333. return Menu.command_window_align
  334. end

  335. end # Window_Command

  336. #==============================================================================
  337. # ■ Window_MenuCommand
  338. #==============================================================================

  339. class Window_MenuCommand < Window_Command

  340. #--------------------------------------------------------------------------
  341. # alias method: init_command_position
  342. #--------------------------------------------------------------------------
  343. class <<self; alias init_command_position_ame init_command_position; end
  344. def self.init_command_position
  345. init_command_position_ame
  346. @@last_command_oy = nil
  347. end

  348. #--------------------------------------------------------------------------
  349. # overwrite method: visible_line_number
  350. #--------------------------------------------------------------------------
  351. def visible_line_number
  352. return [[item_max, YEA::MENU::MAIN_MENU_ROWS].min, 1].max
  353. end

  354. #--------------------------------------------------------------------------
  355. # overwrite method: alignment
  356. #--------------------------------------------------------------------------
  357. def alignment
  358. return Menu.main_menu_align
  359. end

  360. #--------------------------------------------------------------------------
  361. # alias method: process_ok
  362. #--------------------------------------------------------------------------
  363. alias window_menucommand_process_ok_ame process_ok
  364. def process_ok
  365. @@last_command_oy = self.oy
  366. window_menucommand_process_ok_ame
  367. end

  368. #--------------------------------------------------------------------------
  369. # alias method: select_last
  370. #--------------------------------------------------------------------------
  371. alias window_menucommand_select_last_ame select_last
  372. def select_last
  373. window_menucommand_select_last_ame
  374. self.oy = @@last_command_oy unless @@last_command_oy.nil?
  375. @@last_command_oy = nil
  376. end

  377. end # Window_MenuCommand

  378. #==============================================================================
  379. # ■ Scene_Menu
  380. #==============================================================================

  381. class Scene_Menu < Scene_MenuBase

  382. #--------------------------------------------------------------------------
  383. # alias method: start
  384. #--------------------------------------------------------------------------
  385. alias scene_menu_start_ame start
  386. def start
  387. scene_menu_start_ame
  388. relocate_windows
  389. end

  390. #--------------------------------------------------------------------------
  391. # new method: relocate_windows
  392. #--------------------------------------------------------------------------
  393. def relocate_windows
  394. return unless Menu.main_menu_right
  395. @command_window.x = Graphics.width - @command_window.width
  396. @gold_window.x = Graphics.width - @gold_window.width
  397. @status_window.x = 0
  398. end

  399. def return_scene
  400. $game_map.autoplay
  401. SceneManager.return
  402. end

  403. end # Scene_Menu

  404. #==============================================================================
  405. # ■ Scene_Item
  406. #==============================================================================

  407. class Scene_Item < Scene_ItemBase

  408. #--------------------------------------------------------------------------
  409. # alias method: start
  410. #--------------------------------------------------------------------------
  411. alias scene_item_start_ame start
  412. def start
  413. scene_item_start_ame
  414. return if $imported["YEA-ItemMenu"]
  415. relocate_windows
  416. end

  417. #--------------------------------------------------------------------------
  418. # new method: relocate_windows
  419. #--------------------------------------------------------------------------
  420. def relocate_windows
  421. case Menu.help_window_location
  422. when 0 # Top
  423. @help_window.y = 0
  424. @category_window.y = @help_window.height
  425. @item_window.y = @category_window.y + @category_window.height
  426. when 1 # Middle
  427. @category_window.y = 0
  428. @help_window.y = @category_window.height
  429. @item_window.y = @help_window.y + @help_window.height
  430. else # Bottom
  431. @category_window.y = 0
  432. @item_window.y = @category_window.height
  433. @help_window.y = @item_window.y + @item_window.height
  434. end
  435. if $imported["YEA-ItemMenu"]
  436. @types_window.y = @category_window.y
  437. @status_window.y = @category_window.y
  438. end
  439. end

  440. end # Scene_Item

  441. #==============================================================================
  442. # ■ Scene_Skill
  443. #==============================================================================

  444. class Scene_Skill < Scene_ItemBase

  445. #--------------------------------------------------------------------------
  446. # alias method: start
  447. #--------------------------------------------------------------------------
  448. alias scene_skill_start_ame start
  449. def start
  450. scene_skill_start_ame
  451. relocate_windows
  452. end

  453. #--------------------------------------------------------------------------
  454. # new method: relocate_windows
  455. #--------------------------------------------------------------------------
  456. def relocate_windows
  457. case Menu.help_window_location
  458. when 0 # Top
  459. @help_window.y = 0
  460. @command_window.y = @help_window.height
  461. @status_window.y = @help_window.height
  462. @item_window.y = @status_window.y + @status_window.height
  463. when 1 # Middle
  464. @command_window.y = 0
  465. @status_window.y = 0
  466. @help_window.y = @status_window.y + @status_window.height
  467. @item_window.y = @help_window.y + @help_window.height
  468. else # Bottom
  469. @command_window.y = 0
  470. @status_window.y = 0
  471. @item_window.y = @status_window.y + @status_window.height
  472. @help_window.y = @item_window.y + @item_window.height
  473. end
  474. end

  475. end # Scene_Skill

  476. #==============================================================================
  477. # ■ Scene_Equip
  478. #==============================================================================

  479. class Scene_Equip < Scene_MenuBase

  480. #--------------------------------------------------------------------------
  481. # alias method: start
  482. #--------------------------------------------------------------------------
  483. alias scene_equip_start_ame start
  484. def start
  485. scene_equip_start_ame
  486. relocate_windows
  487. relocate_aee_windows
  488. end

  489. #--------------------------------------------------------------------------
  490. # new method: relocate_windows
  491. #--------------------------------------------------------------------------
  492. def relocate_windows
  493. return if $imported["YEA-AceEquipEngine"]
  494. case Menu.help_window_location
  495. when 0 # Top
  496. @help_window.y = 0
  497. @status_window.y = @help_window.height
  498. @command_window.y = @help_window.height
  499. @slot_window.y = @command_window.y + @command_window.height
  500. @item_window.y = @slot_window.y + @slot_window.height
  501. when 1 # Middle
  502. @status_window.y = 0
  503. @command_window.y = 0
  504. @slot_window.y = @command_window.y + @command_window.height
  505. @help_window.y = @slot_window.y + @slot_window.height
  506. @item_window.y = @help_window.y + @help_window.height
  507. else # Bottom
  508. @status_window.y = 0
  509. @command_window.y = 0
  510. @slot_window.y = @command_window.y + @command_window.height
  511. @item_window.y = @slot_window.y + @slot_window.height
  512. @help_window.y = @item_window.y + @item_window.height
  513. end
  514. end

  515. #--------------------------------------------------------------------------
  516. # new method: relocate_aee_windows
  517. #--------------------------------------------------------------------------
  518. def relocate_aee_windows
  519. return unless $imported["YEA-AceEquipEngine"]
  520. case Menu.help_window_location
  521. when 0 # Top
  522. @help_window.y = 0
  523. @command_window.y = @help_window.height
  524. @slot_window.y = @command_window.y + @command_window.height
  525. when 1 # Middle
  526. @command_window.y = 0
  527. @help_window.y = @command_window.height
  528. @slot_window.y = @help_window.y + @help_window.height
  529. else # Bottom
  530. @command_window.y = 0
  531. @slot_window.y = @command_window.height
  532. @help_window.y = @slot_window.y + @slot_window.height
  533. end
  534. @actor_window.y = @command_window.y
  535. @item_window.y = @slot_window.y
  536. @status_window.y = @slot_window.y
  537. end

  538. end # Scene_Equip

  539. #==============================================================================
  540. # ■ Scene_Menu
  541. #==============================================================================

  542. class Scene_Menu < Scene_MenuBase

  543. #--------------------------------------------------------------------------
  544. # alias method: create_command_window
  545. #--------------------------------------------------------------------------
  546. alias scene_menu_create_command_window_ame create_command_window
  547. def create_command_window
  548. scene_menu_create_command_window_ame
  549. process_common_event_commands
  550. process_custom_commands
  551. end

  552. #--------------------------------------------------------------------------
  553. # new method: process_common_event_commands
  554. #--------------------------------------------------------------------------
  555. def process_common_event_commands
  556. for command in YEA::MENU::COMMANDS
  557. next unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
  558. @command_window.set_handler(command, method(:command_common_event))
  559. end
  560. end

  561. #--------------------------------------------------------------------------
  562. # new method: command_common_event
  563. #--------------------------------------------------------------------------
  564. def command_common_event
  565. event_id = @command_window.current_ext
  566. return return_scene if event_id.nil?
  567. return return_scene if $data_common_events[event_id].nil?
  568. $game_temp.reserve_common_event(event_id)
  569. return_scene
  570. end

  571. #--------------------------------------------------------------------------
  572. # new method: process_custom_commands
  573. #--------------------------------------------------------------------------
  574. def process_custom_commands
  575. for command in YEA::MENU::COMMANDS
  576. next unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
  577. called_method = YEA::MENU::CUSTOM_COMMANDS[command][3]
  578. @command_window.set_handler(command, method(called_method))
  579. end
  580. end

  581. #--------------------------------------------------------------------------
  582. # new method: command_debug
  583. #--------------------------------------------------------------------------
  584. def command_debug
  585. SceneManager.call(Scene_Debug)
  586. end

  587. #--------------------------------------------------------------------------
  588. # new method: command_shop
  589. #--------------------------------------------------------------------------
  590. def command_shop
  591. goods = []
  592. SceneManager.call(Scene_Shop)
  593. SceneManager.scene.prepare(goods, false)
  594. end

  595. #--------------------------------------------------------------------------
  596. # new method: command_totori
  597. #--------------------------------------------------------------------------
  598. def command_totori
  599. return unless $imported['KRX-AlchemicSynthesis']
  600. SceneManager.call(Scene_Alchemy)
  601. end

  602. end # Scene_Menu

  603. #==============================================================================
  604. #
  605. # ▼ End of File
  606. #
  607. #==============================================================================
复制代码


摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1190
在线时间
423 小时
注册时间
2010-12-26
帖子
337
19
 楼主| 发表于 2012-8-1 18:34:46 | 只看该作者
狱冥幻翼 发表于 2012-8-1 14:52
这就是这个脚本的bug,虽然也可以加多人的,但是多人的话会产生乱加点的情况(如果用整队把第一人和第二 ...

活雷锋谢谢你!加点功能解决!到最后才知道这脚本没用.......
摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1190
在线时间
423 小时
注册时间
2010-12-26
帖子
337
20
 楼主| 发表于 2012-8-1 18:47:33 | 只看该作者
狱冥幻翼 发表于 2012-8-1 14:52
这就是这个脚本的bug,虽然也可以加多人的,但是多人的话会产生乱加点的情况(如果用整队把第一人和第二 ...

贵宾区在哪

点评

lz求助的时候最好发个工程,这么多脚本一起上总是显示一半  发表于 2012-8-1 18:54
http://bbs.66rpg.com/forum-359-1.html  发表于 2012-8-1 18:53
摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-6 16:43

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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