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

Project1

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

[已经解决] 请问关于这"魔物图鉴"脚本的批量ID号码设置方式??

[复制链接]

Lv2.观梦者

梦石
0
星屑
552
在线时间
464 小时
注册时间
2009-10-11
帖子
407
跳转到指定楼层
1
发表于 2015-3-6 01:39:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
以下这个魔物图鉴是我使用的代码跟来源网址↓
http://izumiwhite.web.fc2.com/rgss3/rgss3_002.html
01.
RUBY 代码复制下载
  1. #==============================================================================
  2. # ■ RGSS3 魔物図鑑 ver 1.01 初期設定
  3. #------------------------------------------------------------------------------
  4. #  配布元:
  5. #     白の魔 [url]http://izumiwhite.web.fc2.com/[/url]
  6. #
  7. #  利用規約:
  8. #     RPGツクールVX Aceの正規の登録者のみご利用になれます。
  9. #     利用報告・著作権表示とかは必要ありません。
  10. #     改造もご自由にどうぞ。
  11. #     何か問題が発生しても責任は持ちません。
  12. #==============================================================================
  13.  
  14. #-------------------------------------------------------------------------------
  15. # ★ 初期設定。
  16. #-------------------------------------------------------------------------------
  17. module WD_monsterdictionary_layout
  18.  
  19. #=== 各項目のレイアウト設定項目 ================================================
  20. #
  21. #   *_***_display       : trueで表示。falseで非表示。
  22. #   *_***_display_x     : 表示位置のx座標
  23. #   *_***_display_y     : 表示位置のy座標
  24. #   *_***_display_width : 表示テキストの幅
  25. #   *_***_display_text* : 表示テキスト
  26. #
  27. #===============================================================================
  28.  
  29. #===全図鑑共通設定==============================================================
  30.  
  31.   #図鑑完成度にどの段階で繁栄するか
  32.   Perfection_timing = 1 #1⇒遭遇時、2⇒撃破時
  33.  
  34.   #フォントサイズ
  35.   C_font_size = 18
  36.  
  37. #===魔物図鑑設定================================================================
  38.  
  39.   #番号の表示
  40.   M_id_display            = true
  41.   M_id_display_x          = 0
  42.   M_id_display_y          = 0
  43.   M_id_display_width      = 60
  44.   M_id_display_digit      = 3 #桁数
  45.  
  46.   #名前の表示
  47.   M_name_display          = true
  48.   M_name_display_x        = 84
  49.   M_name_display_y        = 0
  50.   M_name_display_width    = 172
  51.  
  52.   #画像の表示
  53.   M_pic_display           = true
  54.   M_pic_display_x         = 140
  55.   M_pic_display_y         = 380
  56.   M_pic_display_opacity   = 255 #画像の不透明度
  57.  
  58.   #最大HPの表示
  59.   M_mhp_display           = true
  60.   M_mhp_display_x         = 0
  61.   M_mhp_display_y         = 33
  62.   M_mhp_display_width     = 136
  63.  
  64.   #最大MPの表示
  65.   M_mmp_display           = true
  66.   M_mmp_display_x         = 150
  67.   M_mmp_display_y         = 33
  68.   M_mmp_display_width     = 136
  69.  
  70.   #攻撃力の表示
  71.   M_atk_display           = true
  72.   M_atk_display_x         = 0
  73.   M_atk_display_y         = 51
  74.   M_atk_display_width     = 136
  75.  
  76.   #防御力の表示
  77.   M_def_display           = true
  78.   M_def_display_x         = 150
  79.   M_def_display_y         = 51
  80.   M_def_display_width     = 136
  81.  
  82.   #魔法力の表示
  83.   M_mat_display           = true
  84.   M_mat_display_x         = 0
  85.   M_mat_display_y         = 69
  86.   M_mat_display_width     = 136
  87.  
  88.   #魔法防御の表示
  89.   M_mdf_display           = true
  90.   M_mdf_display_x         = 150
  91.   M_mdf_display_y         = 69
  92.   M_mdf_display_width     = 136
  93.  
  94.   #敏捷性の表示
  95.   M_agi_display           = true
  96.   M_agi_display_x         = 0
  97.   M_agi_display_y         = 87
  98.   M_agi_display_width     = 136
  99.  
  100.   #運の表示
  101.   M_luk_display           = true
  102.   M_luk_display_x         = 150
  103.   M_luk_display_y         = 87
  104.   M_luk_display_width     = 136
  105.  
  106.   #特徴の表示
  107.   M_feature_display       = true
  108.   M_feature_display_x     = 0
  109.   M_feature_display_y     = 114
  110.   M_feature_display_width = 286
  111.   M_feature_display_text1 = "特徴"
  112.   M_feature_display_text2 = "-"
  113.  
  114.   #経験値の表示
  115.   M_exp_display           = true
  116.   M_exp_display_x         = 0
  117.   M_exp_display_y         = 213
  118.   M_exp_display_width     = 136
  119.   M_exp_display_text1     = "経験値"
  120.  
  121.   #お金の表示
  122.   M_gold_display          = true
  123.   M_gold_display_x        = 150
  124.   M_gold_display_y        = 213
  125.   M_gold_display_width    = 136
  126.   M_gold_display_text1    = "お金"
  127.  
  128.   #ドロップアイテムの表示
  129.   M_drop_display          = true
  130.   M_drop_display_x        = 0
  131.   M_drop_display_y        = 240
  132.   M_drop_display_width    = 286
  133.   M_drop_display_text1    = "ドロップアイテム"
  134.   M_drop_display_text2    = "なし"
  135.  
  136.   #説明の表示
  137.   M_help_display          = true
  138.   M_help_display_x        = 0
  139.   M_help_display_y        = 321
  140.   M_help_display_width    = 286
  141.   M_help_display_text1    = "説明"
  142.   M_help_display_text2    = "-"
  143.  
  144.   #撃破数の表示
  145.   M_geno_display          = false
  146.   M_geno_display_x        = 0
  147.   M_geno_display_y        = 321
  148.   M_geno_display_width    = 136
  149.   M_geno_display_text1    = "撃破数"
  150.  
  151. end
  152. #-------------------------------------------------------------------------------
  153. # ★ 初期設定おわり
  154. #-------------------------------------------------------------------------------


02.
RUBY 代码复制下载
  1. #==============================================================================
  2. # ■ RGSS3 魔物図鑑 ver 1.01 本体プログラム
  3. #------------------------------------------------------------------------------
  4. #  配布元:
  5. #     白の魔 [url]http://izumiwhite.web.fc2.com/[/url]
  6. #
  7. #  利用規約:
  8. #     RPGツクールVX Aceの正規の登録者のみご利用になれます。
  9. #     利用報告・著作権表示とかは必要ありません。
  10. #     改造もご自由にどうぞ。
  11. #     何か問題が発生しても責任は持ちません。
  12. #==============================================================================
  13.  
  14. #==============================================================================
  15. # ■ WD_monsterdictionary
  16. #------------------------------------------------------------------------------
  17. #  魔物図鑑用の共通メソッドです。
  18. #==============================================================================
  19.  
  20. module WD_monsterdictionary
  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.  
  80.   def print_dictionary?(enemy)
  81.     if enemy != nil
  82.       if enemy.name.size > 0
  83.         hantei = /<図鑑無効>/ =~ enemy.note
  84.         if hantei == nil
  85.           return true
  86.         end
  87.       end
  88.     end
  89.     return false
  90.   end
  91.   def monster_dictionary_perfection
  92.     dic_max = 0
  93.     dic_num = 0
  94.     $data_enemies.each do |enemy|
  95.       if print_dictionary?(enemy)
  96.         dic_max += 1
  97.         if WD_monsterdictionary_layout::Perfection_timing == 1
  98.           if m_dictionary_encount_switch_on?(enemy.id) == true
  99.             dic_num += 1
  100.           end
  101.         elsif WD_monsterdictionary_layout::Perfection_timing == 2
  102.           if m_dictionary_victory_switch_on?(enemy.id) == true
  103.             dic_num += 1
  104.           end
  105.         end
  106.       end
  107.     end
  108.     return (100*dic_num)/dic_max
  109.   end
  110. end
  111.  
  112. class Game_Interpreter
  113.   include WD_monsterdictionary
  114. end
  115.  
  116. class Game_System
  117.   #--------------------------------------------------------------------------
  118.   # ● 公開インスタンス変数
  119.   #--------------------------------------------------------------------------
  120.   attr_accessor :m_dic_encount_sw
  121.   attr_accessor :m_dic_victory_sw
  122.   attr_accessor :m_dic_drop_sw
  123.   attr_accessor :m_dic_genoside_num
  124.   #--------------------------------------------------------------------------
  125.   # ● オブジェクト初期化
  126.   #--------------------------------------------------------------------------
  127.   alias wd_orig_initialize002 initialize
  128.   def initialize
  129.     wd_orig_initialize002
  130.     @m_dic_encount_sw = []
  131.     @m_dic_victory_sw = []
  132.     @m_dic_drop_sw = []
  133.     @m_dic_genoside_num = []
  134.   end
  135. end
  136.  
  137. class Game_Troop < Game_Unit
  138.   include WD_monsterdictionary
  139.   #--------------------------------------------------------------------------
  140.   # ● 図鑑への登録(遭遇済み判定)
  141.   #--------------------------------------------------------------------------
  142.   def dictionary1
  143.     for enemy in members
  144.       m_dictionary_encount_switch_on(enemy.enemy_id) unless enemy.hidden? #遭遇済み図鑑登録
  145.     end
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ● 図鑑への登録(撃破済み判定)
  149.   #--------------------------------------------------------------------------
  150.   def dictionary2
  151.     for enemy in dead_members
  152.       m_dictionary_victory_switch_on(enemy.enemy_id) unless enemy.hidden? #撃破済み図鑑登録
  153.       m_dictionary_genoside_number_add(enemy.enemy_id, 1) unless enemy.hidden? #撃破数カウント
  154.     end
  155.   end
  156. end
  157.  
  158. class << BattleManager
  159.   #--------------------------------------------------------------------------
  160.   # ● 戦闘開始
  161.   #--------------------------------------------------------------------------
  162.   alias wd_orig_battle_start002 battle_start
  163.   def battle_start
  164.     wd_orig_battle_start002
  165.     $game_troop.dictionary1 #図鑑への登録(遭遇済み判定)
  166.   end
  167.   #--------------------------------------------------------------------------
  168.   # ● 勝利の処理
  169.   #--------------------------------------------------------------------------
  170.   alias wd_orig_process_victory002 process_victory
  171.   def process_victory
  172.     $game_troop.dictionary2 #図鑑への登録(撃破済み判定)
  173.     wd_orig_process_victory002
  174.   end
  175. end
  176.  
  177. class Game_Interpreter
  178.   #--------------------------------------------------------------------------
  179.   # ● 敵キャラの出現
  180.   #--------------------------------------------------------------------------
  181.   alias wd_orig_command_335_002 command_335
  182.   def command_335
  183.     wd_orig_command_335_002
  184.     $game_troop.dictionary1 #図鑑への登録(遭遇済み判定)
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ● 敵キャラの変身
  188.   #--------------------------------------------------------------------------
  189.   alias wd_orig_command_336_002 command_336
  190.   def command_336
  191.     wd_orig_command_336_002
  192.     $game_troop.dictionary1 #図鑑への登録(遭遇済み判定)
  193.   end
  194. end
  195.  
  196. class Game_Enemy < Game_Battler
  197.   include WD_monsterdictionary
  198.   #--------------------------------------------------------------------------
  199.   # ● ドロップアイテムの配列作成(再定義)
  200.   #--------------------------------------------------------------------------
  201.   def make_drop_items
  202.     n = -1
  203.     enemy.drop_items.inject([]) do |r, di|
  204.       n += 1
  205.       if di.kind > 0 && rand * di.denominator < drop_item_rate
  206.         m_dictionary_drop_switch_on(@enemy_id, n)
  207.         r.push(item_object(di.kind, di.data_id))
  208.       else
  209.         r
  210.       end
  211.     end
  212.   end
  213. end
  214.  
  215. #==============================================================================
  216. # ■ Scene_MonsterDictionary
  217. #------------------------------------------------------------------------------
  218. #  魔物図鑑画面の処理を行うクラスです。
  219. #==============================================================================
  220.  
  221. class Scene_MonsterDictionary < Scene_ItemBase
  222.   #--------------------------------------------------------------------------
  223.   # ● 開始処理
  224.   #--------------------------------------------------------------------------
  225.   def start
  226.     super
  227.     create_status_window
  228.     create_item_window
  229.     create_perfection_window
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ● アイテムウィンドウの作成
  233.   #--------------------------------------------------------------------------
  234.   def create_item_window
  235.     wy = 0
  236.     wh = Graphics.height- 48
  237.     @item_window = Window_MonsterDictionaryList.new(Graphics.width-172-48, wy, 172+48, wh)
  238.     @item_window.viewport = @viewport
  239.     @item_window.status_window = @status_window
  240.     @item_window.set_handler(:cancel, method(:return_scene))
  241.     @item_window.update_help
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # ● アイテムステータスウィンドウの作成
  245.   #--------------------------------------------------------------------------
  246.   def create_status_window
  247.     wy = 0
  248.     wh = Graphics.height
  249.     @status_window = Window_MonsterDictionaryStatus.new(0, wy, Graphics.width-172-48, wh)
  250.     @status_window.viewport = @viewport
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ● 図鑑完成度ウィンドウの作成
  254.   #--------------------------------------------------------------------------
  255.   def create_perfection_window
  256.     wy = @item_window.y + @item_window.height
  257.     wh = 48
  258.     @perfection_window = Window_MonsterDictionaryPerfection.new(Graphics.width-172-48, wy, 172+48, wh)
  259.     @perfection_window.viewport = @viewport
  260.   end
  261. end
  262.  
  263.  
  264. #==============================================================================
  265. # ■ Window_MonsterDictionaryList
  266. #------------------------------------------------------------------------------
  267. #  魔物図鑑画面で、魔物の一覧を表示するウィンドウです。
  268. #==============================================================================
  269.  
  270. class Window_MonsterDictionaryList < Window_Selectable
  271.   include WD_monsterdictionary
  272.   #--------------------------------------------------------------------------
  273.   # ● オブジェクト初期化
  274.   #--------------------------------------------------------------------------
  275.   def initialize(x, y, width, height)
  276.     super
  277.     @data = []
  278.     refresh
  279.     activate
  280.     select(0)
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● 桁数の取得
  284.   #--------------------------------------------------------------------------
  285.   def col_max
  286.     return 1
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● 項目数の取得
  290.   #--------------------------------------------------------------------------
  291.   def item_max
  292.     @data ? @data.size : 1
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● アイテムの取得
  296.   #--------------------------------------------------------------------------
  297.   def enemy
  298.     @data && index >= 0 ? @data[index] : nil
  299.   end
  300.   #--------------------------------------------------------------------------
  301.   # ● アイテムリストの作成
  302.   #--------------------------------------------------------------------------
  303.   def make_item_list
  304.     @data = []
  305.     $data_enemies.each do |enemy|
  306.       if print_dictionary?(enemy)
  307.         @data.push(enemy)
  308.       end
  309.     end
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # ● 項目の描画
  313.   #--------------------------------------------------------------------------
  314.   def draw_item(index)
  315.     enemy = @data[index]
  316.     if enemy
  317.       rect = item_rect(index)
  318.       rect.width -= 4
  319.       if m_dictionary_encount_switch_on?(enemy.id)
  320.         change_color(normal_color, true)
  321.         draw_text(rect.x, rect.y, 172, line_height, enemy.name)
  322.       else
  323.         change_color(normal_color, false)
  324.         draw_text(rect.x, rect.y, 172, line_height, "???????")
  325.       end
  326.     end
  327.   end
  328.   #--------------------------------------------------------------------------
  329.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  330.   #--------------------------------------------------------------------------
  331.   def call_update_help
  332.     update_help if active
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● ヘルプテキスト更新
  336.   #--------------------------------------------------------------------------
  337.   def update_help
  338.     if @status_window
  339.       if m_dictionary_encount_switch_on?(enemy.id)
  340.         @status_window.set_item(enemy, @index, true)
  341.       else
  342.         @status_window.set_item(enemy, @index, false)
  343.       end
  344.     end
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # ● リフレッシュ
  348.   #--------------------------------------------------------------------------
  349.   def refresh
  350.     make_item_list
  351.     create_contents
  352.     draw_all_items
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # ● ステータスウィンドウの設定
  356.   #--------------------------------------------------------------------------
  357.   def status_window=(status_window)
  358.     @status_window = status_window
  359.   end
  360. end
  361.  
  362. #==============================================================================
  363. # ■ Window_MonsterDictionaryPerfection
  364. #------------------------------------------------------------------------------
  365. #  魔物図鑑画面で、図鑑の完成度を表示するウィンドウです。
  366. #==============================================================================
  367.  
  368. class Window_MonsterDictionaryPerfection < Window_Selectable
  369.   include WD_monsterdictionary
  370.   #--------------------------------------------------------------------------
  371.   # ● オブジェクト初期化
  372.   #--------------------------------------------------------------------------
  373.   def initialize(x, y, width, height)
  374.     super
  375.     refresh(width)
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # ● リフレッシュ
  379.   #--------------------------------------------------------------------------
  380.   def refresh(width)
  381.     contents.clear
  382.     draw_text(0, 0, width-24, line_height, "図鑑完成度: #{monster_dictionary_perfection} %", 1)
  383.   end
  384. end
  385.  
  386.  
  387. #==============================================================================
  388. # ■ Window_MonsterDictionaryStatus
  389. #------------------------------------------------------------------------------
  390. #  魔物図鑑画面で、エネミーの詳細を表示するウィンドウです。
  391. #==============================================================================
  392.  
  393. class Window_MonsterDictionaryStatus < Window_Selectable
  394.   include WD_monsterdictionary
  395.   #--------------------------------------------------------------------------
  396.   # ● オブジェクト初期化
  397.   #--------------------------------------------------------------------------
  398.   def initialize(x, y, width, height)
  399.     super
  400.     @enemy = nil
  401.     refresh
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● アイテムの設定
  405.   #--------------------------------------------------------------------------
  406.   def set_item(enemy, index=-1, print=false)
  407.     return if ((@enemy == enemy) and (@index == index))
  408.     @enemy = enemy
  409.     @index = index
  410.     @print = print
  411.     refresh
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ● アイテムオブジェクトの取得
  415.   #--------------------------------------------------------------------------
  416.   def item_object(kind, data_id)
  417.     return $data_items  [data_id] if kind == 1
  418.     return $data_weapons[data_id] if kind == 2
  419.     return $data_armors [data_id] if kind == 3
  420.     return nil
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # ● リフレッシュ
  424.   #--------------------------------------------------------------------------
  425.   def refresh
  426.     contents.clear
  427.     contents.font.size = 24
  428.  
  429.     if @print
  430.  
  431.       if WD_monsterdictionary_layout::M_id_display
  432.         text1  = sprintf("%0#{WD_monsterdictionary_layout::M_id_display_digit}d",@index+1)
  433.         x      = WD_monsterdictionary_layout::M_id_display_x
  434.         y      = WD_monsterdictionary_layout::M_id_display_y
  435.         width  = WD_monsterdictionary_layout::M_id_display_width
  436.         height = line_height
  437.         draw_text(x, y, width, height, text1, 0)
  438.       end
  439.       if WD_monsterdictionary_layout::M_name_display
  440.         text1  = @enemy.name
  441.         x      = WD_monsterdictionary_layout::M_name_display_x
  442.         y      = WD_monsterdictionary_layout::M_name_display_y
  443.         width  = WD_monsterdictionary_layout::M_name_display_width
  444.         height = line_height
  445.         draw_text(x, y, width, height, text1, 0)
  446.       end
  447.       if WD_monsterdictionary_layout::M_pic_display
  448.         pic_name = @enemy.battler_name
  449.         pic_hue  = @enemy.battler_hue
  450.         x      = WD_monsterdictionary_layout::M_pic_display_x
  451.         y      = WD_monsterdictionary_layout::M_pic_display_y
  452.         opacity= WD_monsterdictionary_layout::M_pic_display_opacity
  453.         bitmap = Cache.battler(pic_name, pic_hue)
  454.         rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  455.         contents.blt(x - rect.width/2, y - rect.height, bitmap, rect, opacity)
  456.       end
  457.  
  458.       font_size = WD_monsterdictionary_layout::C_font_size
  459.       contents.font.size = font_size
  460.       if WD_monsterdictionary_layout::M_mhp_display
  461.         text1  = Vocab::param(0)
  462.         text2  = "?"
  463.         text2  = @enemy.params[0] if m_dictionary_victory_switch_on?(@enemy.id)
  464.         x      = WD_monsterdictionary_layout::M_mhp_display_x
  465.         y      = WD_monsterdictionary_layout::M_mhp_display_y
  466.         width  = WD_monsterdictionary_layout::M_mhp_display_width
  467.         change_color(system_color)
  468.         draw_text(x, y, width, font_size, text1, 0)
  469.         change_color(normal_color)
  470.         draw_text(x, y, width, font_size, text2, 2)
  471.       end
  472.       if WD_monsterdictionary_layout::M_mmp_display
  473.         text1  = Vocab::param(1)
  474.         text2  = "?"
  475.         text2  = @enemy.params[1] if m_dictionary_victory_switch_on?(@enemy.id)
  476.         x      = WD_monsterdictionary_layout::M_mmp_display_x
  477.         y      = WD_monsterdictionary_layout::M_mmp_display_y
  478.         width  = WD_monsterdictionary_layout::M_mmp_display_width
  479.         change_color(system_color)
  480.         draw_text(x, y, width, font_size, text1, 0)
  481.         change_color(normal_color)
  482.         draw_text(x, y, width, font_size, text2, 2)
  483.       end
  484.       if WD_monsterdictionary_layout::M_atk_display
  485.         text1  = Vocab::param(2)
  486.         text2  = "?"
  487.         text2  = @enemy.params[2] if m_dictionary_victory_switch_on?(@enemy.id)
  488.         x      = WD_monsterdictionary_layout::M_atk_display_x
  489.         y      = WD_monsterdictionary_layout::M_atk_display_y
  490.         width  = WD_monsterdictionary_layout::M_atk_display_width
  491.         change_color(system_color)
  492.         draw_text(x, y, width, font_size, text1, 0)
  493.         change_color(normal_color)
  494.         draw_text(x, y, width, font_size, text2, 2)
  495.       end
  496.       if WD_monsterdictionary_layout::M_def_display
  497.         text1  = Vocab::param(3)
  498.         text2  = "?"
  499.         text2  = @enemy.params[3] if m_dictionary_victory_switch_on?(@enemy.id)
  500.         x      = WD_monsterdictionary_layout::M_def_display_x
  501.         y      = WD_monsterdictionary_layout::M_def_display_y
  502.         width  = WD_monsterdictionary_layout::M_def_display_width
  503.         change_color(system_color)
  504.         draw_text(x, y, width, font_size, text1, 0)
  505.         change_color(normal_color)
  506.         draw_text(x, y, width, font_size, text2, 2)
  507.       end
  508.       if WD_monsterdictionary_layout::M_mat_display
  509.         text1  = Vocab::param(4)
  510.         text2  = "?"
  511.         text2  = @enemy.params[4] if m_dictionary_victory_switch_on?(@enemy.id)
  512.         x      = WD_monsterdictionary_layout::M_mat_display_x
  513.         y      = WD_monsterdictionary_layout::M_mat_display_y
  514.         width  = WD_monsterdictionary_layout::M_mat_display_width
  515.         change_color(system_color)
  516.         draw_text(x, y, width, font_size, text1, 0)
  517.         change_color(normal_color)
  518.         draw_text(x, y, width, font_size, text2, 2)
  519.       end
  520.       if WD_monsterdictionary_layout::M_mdf_display
  521.         text1  = Vocab::param(5)
  522.         text2  = "?"
  523.         text2  = @enemy.params[5] if m_dictionary_victory_switch_on?(@enemy.id)
  524.         x      = WD_monsterdictionary_layout::M_mdf_display_x
  525.         y      = WD_monsterdictionary_layout::M_mdf_display_y
  526.         width  = WD_monsterdictionary_layout::M_mdf_display_width
  527.         change_color(system_color)
  528.         draw_text(x, y, width, font_size, text1, 0)
  529.         change_color(normal_color)
  530.         draw_text(x, y, width, font_size, text2, 2)
  531.       end
  532.       if WD_monsterdictionary_layout::M_agi_display
  533.         text1  = Vocab::param(6)
  534.         text2  = "?"
  535.         text2  = @enemy.params[6] if m_dictionary_victory_switch_on?(@enemy.id)
  536.         x      = WD_monsterdictionary_layout::M_agi_display_x
  537.         y      = WD_monsterdictionary_layout::M_agi_display_y
  538.         width  = WD_monsterdictionary_layout::M_agi_display_width
  539.         change_color(system_color)
  540.         draw_text(x, y, width, font_size, text1, 0)
  541.         change_color(normal_color)
  542.         draw_text(x, y, width, font_size, text2, 2)
  543.       end
  544.       if WD_monsterdictionary_layout::M_luk_display
  545.         text1  = Vocab::param(7)
  546.         text2  = "?"
  547.         text2  = @enemy.params[7] if m_dictionary_victory_switch_on?(@enemy.id)
  548.         x      = WD_monsterdictionary_layout::M_luk_display_x
  549.         y      = WD_monsterdictionary_layout::M_luk_display_y
  550.         width  = WD_monsterdictionary_layout::M_luk_display_width
  551.         change_color(system_color)
  552.         draw_text(x, y, width, font_size, text1, 0)
  553.         change_color(normal_color)
  554.         draw_text(x, y, width, font_size, text2, 2)
  555.       end
  556.       if WD_monsterdictionary_layout::M_feature_display
  557.         text1  = WD_monsterdictionary_layout::M_feature_display_text1
  558.         text2  = "?"
  559.         text2  = WD_monsterdictionary_layout::M_feature_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
  560.         x      = WD_monsterdictionary_layout::M_feature_display_x
  561.         y      = WD_monsterdictionary_layout::M_feature_display_y
  562.         width  = WD_monsterdictionary_layout::M_feature_display_width
  563.         change_color(system_color)
  564.         draw_text(x, y, width, font_size, text1, 0)
  565.         change_color(normal_color)
  566.         i = 0
  567.         if m_dictionary_victory_switch_on?(@enemy.id)
  568.           @enemy.note.scan(/<図鑑特徴:(.*)>/){|matched|
  569.             i += 1
  570.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
  571.           }
  572.         end
  573.         if i == 0
  574.           self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  575.         end
  576.       end
  577.       if WD_monsterdictionary_layout::M_exp_display
  578.         text1  = WD_monsterdictionary_layout::M_exp_display_text1
  579.         text2  = "?"
  580.         text2  = @enemy.exp if m_dictionary_victory_switch_on?(@enemy.id)
  581.         x      = WD_monsterdictionary_layout::M_exp_display_x
  582.         y      = WD_monsterdictionary_layout::M_exp_display_y
  583.         width  = WD_monsterdictionary_layout::M_exp_display_width
  584.         change_color(system_color)
  585.         draw_text(x, y, width, font_size, text1, 0)
  586.         change_color(normal_color)
  587.         draw_text(x, y, width, font_size, text2, 2)
  588.       end
  589.       if WD_monsterdictionary_layout::M_gold_display
  590.         text1  = WD_monsterdictionary_layout::M_gold_display_text1
  591.         text2  = "?"
  592.         text2  = @enemy.gold if m_dictionary_victory_switch_on?(@enemy.id)
  593.         text3  = Vocab::currency_unit
  594.         x      = WD_monsterdictionary_layout::M_gold_display_x
  595.         y      = WD_monsterdictionary_layout::M_gold_display_y
  596.         width  = WD_monsterdictionary_layout::M_gold_display_width
  597.         change_color(system_color)
  598.         draw_text(x, y, width, font_size, text1, 0)
  599.         cx = text_size(Vocab::currency_unit).width
  600.         change_color(normal_color)
  601.         draw_text(x, y, width - cx - 2, font_size, text2, 2)
  602.         change_color(system_color)
  603.         draw_text(x, y, width, font_size, text3, 2)
  604.         change_color(normal_color)
  605.       end
  606.       if WD_monsterdictionary_layout::M_drop_display
  607.         text1  = WD_monsterdictionary_layout::M_drop_display_text1
  608.         text2  = WD_monsterdictionary_layout::M_drop_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
  609.         x      = WD_monsterdictionary_layout::M_drop_display_x
  610.         y      = WD_monsterdictionary_layout::M_drop_display_y
  611.         width  = WD_monsterdictionary_layout::M_drop_display_width
  612.         change_color(system_color)
  613.         draw_text(x, y, width, font_size, text1, 0)
  614.         change_color(normal_color)
  615.         i = 0
  616.         @enemy.drop_items.each do |di|
  617.           if di.kind > 0
  618.             i += 1
  619.             item = item_object(di.kind, di.data_id)
  620.             n = i -1
  621.             if m_dictionary_drop_switch_on?(@enemy.id, n)
  622.               text2 = item.name
  623.               text3 = "1/#{di.denominator}"
  624.             else
  625.               text2  = "???????"
  626.               text3  = ""
  627.             end
  628.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, text2, 0)
  629.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, text3, 2)
  630.           end
  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_help_display
  637.         text1  = WD_monsterdictionary_layout::M_help_display_text1
  638.         text2  = "?"
  639.         text2  = WD_monsterdictionary_layout::M_help_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
  640.         x      = WD_monsterdictionary_layout::M_help_display_x
  641.         y      = WD_monsterdictionary_layout::M_help_display_y
  642.         width  = WD_monsterdictionary_layout::M_help_display_width
  643.         change_color(system_color)
  644.         draw_text(x, y, width, font_size, text1, 0)
  645.         change_color(normal_color)
  646.         i = 0
  647.         if m_dictionary_victory_switch_on?(@enemy.id)
  648.           @enemy.note.scan(/<図鑑説明:(.*)>/){|matched|
  649.             i += 1
  650.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
  651.           }
  652.         end
  653.         if i == 0
  654.           self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  655.         end
  656.       end
  657.       if WD_monsterdictionary_layout::M_geno_display
  658.         text1  = WD_monsterdictionary_layout::M_geno_display_text1
  659.         text2  = "#{m_dictionary_genoside_number(@enemy.id)}"
  660.         x      = WD_monsterdictionary_layout::M_geno_display_x
  661.         y      = WD_monsterdictionary_layout::M_geno_display_y
  662.         width  = WD_monsterdictionary_layout::M_geno_display_width
  663.         change_color(system_color)
  664.         draw_text(x, y, width, font_size, text1, 0)
  665.         change_color(normal_color)
  666.         draw_text(x, y, width, font_size, text2, 2)
  667.       end
  668.  
  669.     elsif @enemy != nil
  670.  
  671.       if WD_monsterdictionary_layout::M_id_display
  672.         text1  = sprintf("%0#{WD_monsterdictionary_layout::M_id_display_digit}d",@index+1)
  673.         x      = WD_monsterdictionary_layout::M_id_display_x
  674.         y      = WD_monsterdictionary_layout::M_id_display_y
  675.         width  = WD_monsterdictionary_layout::M_id_display_width
  676.         height = line_height
  677.         draw_text(x, y, width, height, text1, 0)
  678.       end
  679.       if WD_monsterdictionary_layout::M_name_display
  680.         text1  = "- No Data -"
  681.         x      = WD_monsterdictionary_layout::M_name_display_x
  682.         y      = WD_monsterdictionary_layout::M_name_display_y
  683.         width  = WD_monsterdictionary_layout::M_name_display_width
  684.         height = line_height
  685.         draw_text(x, y, width, height, text1, 0)
  686.       end
  687.  
  688.     end
  689.   end
  690. end


在这脚本中设定事件内输入指令"m_dictionary_encount_switch_on(1)"就是开启1号敌人资料,
那如果我要开启10,11,12,13.....25这些敌人要怎么写??
我試過m_dictionary_encount_switch_on(10~25),或是(10...25)都沒作用...
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。

Lv3.寻梦者

闇吼者の災悪眷族
不気味存在締造者

梦石
0
星屑
1366
在线时间
2881 小时
注册时间
2014-7-29
帖子
6491
2
发表于 2015-3-6 02:27:48 | 只看该作者
你可以写一个循环,
事件是这样的:
让变量1 = 9
开始循环,让变量1 +1
m_dictionary_encount_switch_on($game_variables[1])
分歧条件:如果变量1 == 25
跳出循环

这样就可以了。

脚本是这么写:
  1. (10..25).each {|i| m_dictionary_encount_switch_on(i)}
复制代码

点评

大感謝!!  发表于 2015-3-6 03:00

评分

参与人数 2星屑 +4 梦石 +1 收起 理由
VIPArcher + 1 认可答案
a000b1745 + 4 认可答案^^

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
552
在线时间
464 小时
注册时间
2009-10-11
帖子
407
3
 楼主| 发表于 2015-3-6 02:34:37 | 只看该作者
三途亚梦 发表于 2015-3-6 02:27
你可以写一个循环,
事件是这样的:
让变量1 = 9

在事件中使用代码(10..25).each {|i| m_dictionary_encount_switch_on(i)}
跳出:
Script 'Game_INterpreter' line 1412: ArgumentError occurred.
wrong number of arguments (0 for 1)

点评

你确认下事件脚本是否有换行问题,我建议你在 |i| 的后面进行换行。  发表于 2015-3-6 02:55
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
416 小时
注册时间
2012-11-30
帖子
162
4
发表于 2015-3-6 22:33:47 | 只看该作者
  1. for i in 10...25
  2. m_dictionary_encount_switch_on(i)
复制代码
以前看到一个范例的事件里有一个
  1. for i in
复制代码
的格式,不知行不行

评分

参与人数 1星屑 +2 收起 理由
a000b1745 + 2 感謝幫助

查看全部评分


<object width="630" height="500" align="middle" id="reader" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-44455354000
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

无限の剣制

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

开拓者贵宾

5
发表于 2015-3-6 23:16:08 | 只看该作者
本帖最后由 VIPArcher 于 2015-3-6 23:17 编辑

有一个比较好用的方法就是把这个方法写到 class Game_Interpreter 里去调用
例如可以这样写
  1. class Game_Interpreter
  2.   def encount_switch_on(*args)
  3.     args.each { |id| m_dictionary_encount_switch_on(id) }
  4.   end
  5. end
复制代码
未测试
然后事件指令里调用 事件脚本 例如
  1. encount_switch_on(1,2,3,5,7,9)
复制代码
打开1.2.3.5.7.9敌人的资料啥的

评分

参与人数 1星屑 +2 收起 理由
a000b1745 + 2 感謝幫助

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-2-20 19:01

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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