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

Project1

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

[已经解决] 这个怪物图鉴怎么在菜单添加指令

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
193 小时
注册时间
2014-5-13
帖子
23
跳转到指定楼层
1
发表于 2015-8-11 19:22:48 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
  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.   #名前の表示
  40.   M_name_display          = true
  41.   M_name_display_x        = 84
  42.   M_name_display_y        = 0
  43.   M_name_display_width    = 172

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Lv1.梦旅人

梦石
0
星屑
50
在线时间
193 小时
注册时间
2014-5-13
帖子
23
2
 楼主| 发表于 2015-8-11 19:23:17 | 只看该作者
  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.    

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

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

  110. class Game_Interpreter
  111.   include WD_monsterdictionary
  112. end

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

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

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

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

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

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

  204. class Scene_MonsterDictionary < Scene_ItemBase
  205.   #--------------------------------------------------------------------------
  206.   # ● 開始処理
  207.   #--------------------------------------------------------------------------
  208.   def start
  209.     super
  210.      
  211.     create_status_window
  212.     create_item_window
  213.     create_perfection_window
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # ● アイテムウィンドウの作成
  217.   #--------------------------------------------------------------------------
  218.   def create_item_window
  219.     wy = 0
  220.     wh = Graphics.height - 48
  221.     @item_window = Window_MonsterDictionaryList.new(Graphics.width-172-48, wy, 172+48, wh)
  222.     @item_window.viewport = @viewport
  223.     @item_window.status_window = @status_window
  224.     @item_window.set_handler(:cancel, method(:return_scene))
  225.     @item_window.update_help
  226.   end
  227.   
  228.   def return_scene
  229.     $game_map.autoplay
  230.     SceneManager.return
  231.   end
  232.   
  233.   #--------------------------------------------------------------------------
  234.   # ● アイテムステータスウィンドウの作成
  235.   #--------------------------------------------------------------------------
  236.   def create_status_window
  237.     wy = 0
  238.     wh = Graphics.height
  239.     @status_window = Window_MonsterDictionaryStatus.new(0, wy, Graphics.width-172-48, wh)
  240.     @status_window.viewport = @viewport
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● 図鑑完成度ウィンドウの作成
  244.   #--------------------------------------------------------------------------
  245.   def create_perfection_window
  246.     wy = @item_window.y + @item_window.height
  247.     wh = 48
  248.     @perfection_window = Window_MonsterDictionaryPerfection.new(Graphics.width-172-48, wy, 172+48, wh)
  249.     @perfection_window.viewport = @viewport
  250.   end
  251. end


  252. #==============================================================================
  253. # ■ Window_MonsterDictionaryList
  254. #------------------------------------------------------------------------------
  255. #  魔物図鑑画面で、魔物の一覧を表示するウィンドウです。
  256. #==============================================================================

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

  348. #==============================================================================
  349. # ■ Window_MonsterDictionaryPerfection
  350. #------------------------------------------------------------------------------
  351. #  魔物図鑑画面で、図鑑の完成度を表示するウィンドウです。
  352. #==============================================================================

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


  370. #==============================================================================
  371. # ■ Window_MonsterDictionaryStatus
  372. #------------------------------------------------------------------------------
  373. #  魔物図鑑画面で、エネミーの詳細を表示するウィンドウです。
  374. #==============================================================================

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

  410.     if @print

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

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

  647.     elsif @enemy != nil

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

  664.     end
  665.   end
  666. end
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
193 小时
注册时间
2014-5-13
帖子
23
3
 楼主| 发表于 2015-8-11 19:25:08 | 只看该作者
怎么在菜单添加怪物图鉴这个选项啊
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

4
发表于 2015-8-11 19:49:26 | 只看该作者
灭魂 发表于 2015-8-11 19:25
怎么在菜单添加怪物图鉴这个选项啊

这是VX脚本,VA并不支持。请另找脚本
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
193 小时
注册时间
2014-5-13
帖子
23
5
 楼主| 发表于 2015-8-11 22:04:27 | 只看该作者
taroxd 发表于 2015-8-11 19:49
这是VX脚本,VA并不支持。请另找脚本

可以用  这是用事件调出的  我想在菜单的添加  不知道怎么弄
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

无限の剣制

梦石
0
星屑
10074
在线时间
5020 小时
注册时间
2013-2-28
帖子
5030

开拓者贵宾

6
发表于 2015-8-12 00:12:22 | 只看该作者
灭魂 发表于 2015-8-11 22:04
可以用  这是用事件调出的  我想在菜单的添加  不知道怎么弄

那么请看这里https://rpg.blue/thread-371698-1-1.html
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
179 小时
注册时间
2013-12-8
帖子
100
7
发表于 2015-8-12 09:23:56 | 只看该作者
  1. #==============================================================================
  2. #  菜单画面
  3. #==============================================================================
  4. class Scene_Menu < Scene_MenuBase
  5.   #--------------------------------------------------------------------------
  6.   # alias 给 create_command_window 方法取个别名 尽量命名独特不容易重名
  7.   #--------------------------------------------------------------------------
  8.   alias miao_20150812_create_1 create_command_window
  9.   #--------------------------------------------------------------------------
  10.   # ● 生成指令窗口
  11.   #--------------------------------------------------------------------------
  12.   def create_command_window
  13.     miao_20150812_create_1
  14.     @command_window.set_handler(:neko_commands1,    method(:command_neko1))
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 按钮所执行的内容方法名与上面的 method() 里的符号对应
  18.   #--------------------------------------------------------------------------
  19.   def command_neko1
  20.     #通常指令内容是呼出场景
  21.     SceneManager.call(Scene_MonsterDictionary)
  22.     #但是按钮按下去的效果不一定局限于切换场景
  23.   end
  24. end
  25. #==============================================================================
  26. #  菜单画面中显示指令的窗口
  27. #==============================================================================
  28. class Window_MenuCommand < Window_Command
  29.   alias miao_20150812_aoc add_original_commands
  30.   #--------------------------------------------------------------------------
  31.   # ● 独自添加指令用
  32.   #--------------------------------------------------------------------------
  33.   def add_original_commands
  34.     miao_20150812_aoc
  35.     add_command("怪物图鉴", :neko_commands1, main_commands_enabled)#添加按钮
  36. =begin
  37.     add_command()里的3个参数依次为:
  38.                   ● name:选项的名称,在描绘选项时使用
  39.                   ● symbol:选项的符号,这是一个标志与上面set_handler里对应
  40.                   ● enabled:有效状态,当值为 false 时选项无效且用半透明绘制
  41. =end
  42.   end
  43. end
复制代码
我还是放成品吧,用的弓箭手(删)VIP大大的链接里做的,自己也在用

点评

所以如你所见,如果是普通调用,就使用语句 SceneManager.call(Scene_MonsterDictionary)  发表于 2015-8-12 09:24

评分

参与人数 1梦石 +1 收起 理由
VIPArcher + 1 我很赞同

查看全部评分


全部RM技能点全都点到了做地图和写文本上了,别拦着我我准备去点那个专精点!(大义凛然状
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
193 小时
注册时间
2014-5-13
帖子
23
8
 楼主| 发表于 2015-8-12 14:19:55 | 只看该作者
1181770261 发表于 2015-8-12 09:23
我还是放成品吧,用的弓箭手(删)VIP大大的链接里做的,自己也在用

确实可以了  多谢
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-10-4 07:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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