查看: 2752|回复: 0

[已经解决] 白の魔的魔物图鉴 脚本修改

[复制链接]
梦石
1
星屑
22078
在线时间
4885 小时
注册时间
2014-12-22
回帖
1509

开拓者

发表于 2015-9-5 12:11:33 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 shencao 于 2016-3-24 00:31 编辑

不好意思我又来了wwwwww

我用了“白の魔”的怪物图鉴,想要在掉落物名称前加上物品图标!
自己只会改改坐标窗口大小这种的,要添加内容就不会了……求帮忙_(:з」∠)_

----------------------
自己通过曲折的方式解决了_(:з」∠)_
因为同时也使用了关键字替换的脚本,所以把描画物品列表时候的draw_text改成draw_text_ex就可以搭配着显示物品图标了嗯。
思路比较蠢,反正能用就行了~

原脚本折叠一下吧
[fold=脚本]

初期設定

  1. #==============================================================================

  2. # ■ RGSS3 魔物図鑑 ver 1.01 初期設定

  3. #------------------------------------------------------------------------------

  4. #  配布元:

  5. #     白の魔 http://izumiwhite.web.fc2.com/

  6. #

  7. #  利用規約:

  8. #     RPGツクールVX Aceの正規の登録者のみご利用になれます。

  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. #-------------------------------------------------------------------------------
复制代码
本体

  1. #==============================================================================

  2. # ■ RGSS3 魔物図鑑 ver 1.01 本体プログラム

  3. #------------------------------------------------------------------------------

  4. #  配布元:

  5. #     白の魔 http://izumiwhite.web.fc2.com/

  6. #

  7. #  利用規約:

  8. #     RPGツクールVX Aceの正規の登録者のみご利用になれます。

  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.   #--------------------------------------------------------------------------

  179.   # ● 敵キャラの変身

  180.   #--------------------------------------------------------------------------

  181.   alias wd_orig_command_336_002 command_336

  182.   def command_336

  183.     wd_orig_command_336_002

  184.     $game_troop.dictionary1 #図鑑への登録(遭遇済み判定)

  185.   end

  186. end




  187. class Game_Enemy < Game_Battler

  188.   include WD_monsterdictionary

  189.   #--------------------------------------------------------------------------

  190.   # ● ドロップアイテムの配列作成(再定義)

  191.   #--------------------------------------------------------------------------

  192.   def make_drop_items

  193.     n = -1

  194.     enemy.drop_items.inject([]) do |r, di|

  195.       n += 1

  196.       if di.kind > 0 && rand * di.denominator < drop_item_rate

  197.         m_dictionary_drop_switch_on(@enemy_id, n)

  198.         r.push(item_object(di.kind, di.data_id))

  199.       else

  200.         r

  201.       end

  202.     end

  203.   end

  204. end




  205. #==============================================================================

  206. # ■ Scene_MonsterDictionary

  207. #------------------------------------------------------------------------------

  208. #  魔物図鑑画面の処理を行うクラスです。

  209. #==============================================================================




  210. class Scene_MonsterDictionary < Scene_ItemBase

  211.   #--------------------------------------------------------------------------

  212.   # ● 開始処理

  213.   #--------------------------------------------------------------------------

  214.   def start

  215.     super

  216.     create_status_window

  217.     create_item_window

  218.     create_perfection_window

  219.   end

  220.   #--------------------------------------------------------------------------

  221.   # ● アイテムウィンドウの作成

  222.   #--------------------------------------------------------------------------

  223.   def create_item_window

  224.     wy = 0

  225.     wh = Graphics.height- 48

  226.     @item_window = Window_MonsterDictionaryList.new(Graphics.width-172-48, wy, 172+48, wh)

  227.     @item_window.viewport = @viewport

  228.     @item_window.status_window = @status_window

  229.     @item_window.set_handler(:cancel, method(:return_scene))

  230.     @item_window.update_help

  231.   end

  232.   #--------------------------------------------------------------------------

  233.   # ● アイテムステータスウィンドウの作成

  234.   #--------------------------------------------------------------------------

  235.   def create_status_window

  236.     wy = 0

  237.     wh = Graphics.height

  238.     @status_window = Window_MonsterDictionaryStatus.new(0, wy, Graphics.width-172-48, wh)

  239.     @status_window.viewport = @viewport

  240.   end

  241.   #--------------------------------------------------------------------------

  242.   # ● 図鑑完成度ウィンドウの作成

  243.   #--------------------------------------------------------------------------

  244.   def create_perfection_window

  245.     wy = @item_window.y + @item_window.height

  246.     wh = 48

  247.     @perfection_window = Window_MonsterDictionaryPerfection.new(Graphics.width-172-48, wy, 172+48, wh)

  248.     @perfection_window.viewport = @viewport

  249.   end

  250. end







  251. #==============================================================================

  252. # ■ Window_MonsterDictionaryList

  253. #------------------------------------------------------------------------------

  254. #  魔物図鑑画面で、魔物の一覧を表示するウィンドウです。

  255. #==============================================================================




  256. class Window_MonsterDictionaryList < Window_Selectable

  257.   include WD_monsterdictionary

  258.   #--------------------------------------------------------------------------

  259.   # ● オブジェクト初期化

  260.   #--------------------------------------------------------------------------

  261.   def initialize(x, y, width, height)

  262.     super

  263.     @data = []

  264.     refresh

  265.     activate

  266.     select(0)

  267.   end

  268.   #--------------------------------------------------------------------------

  269.   # ● 桁数の取得

  270.   #--------------------------------------------------------------------------

  271.   def col_max

  272.     return 1

  273.   end

  274.   #--------------------------------------------------------------------------

  275.   # ● 項目数の取得

  276.   #--------------------------------------------------------------------------

  277.   def item_max

  278.     @data ? @data.size : 1

  279.   end

  280.   #--------------------------------------------------------------------------

  281.   # ● アイテムの取得

  282.   #--------------------------------------------------------------------------

  283.   def enemy

  284.     @data && index >= 0 ? @data[index] : nil

  285.   end

  286.   #--------------------------------------------------------------------------

  287.   # ● アイテムリストの作成

  288.   #--------------------------------------------------------------------------

  289.   def make_item_list

  290.     @data = []

  291.     $data_enemies.each do |enemy|

  292.       if print_dictionary?(enemy)

  293.         @data.push(enemy)

  294.       end

  295.     end

  296.   end

  297.   #--------------------------------------------------------------------------

  298.   # ● 項目の描画

  299.   #--------------------------------------------------------------------------

  300.   def draw_item(index)

  301.     enemy = @data[index]

  302.     if enemy

  303.       rect = item_rect(index)

  304.       rect.width -= 4

  305.       if m_dictionary_encount_switch_on?(enemy.id)

  306.         change_color(normal_color, true)

  307.         draw_text(rect.x, rect.y, 172, line_height, enemy.name)

  308.       else

  309.         change_color(normal_color, false)

  310.         draw_text(rect.x, rect.y, 172, line_height, "???????")

  311.       end

  312.     end

  313.   end

  314.   #--------------------------------------------------------------------------

  315.   # ● ヘルプウィンドウ更新メソッドの呼び出し

  316.   #--------------------------------------------------------------------------

  317.   def call_update_help

  318.     update_help if active

  319.   end

  320.   #--------------------------------------------------------------------------

  321.   # ● ヘルプテキスト更新

  322.   #--------------------------------------------------------------------------

  323.   def update_help

  324.     if @status_window

  325.       if m_dictionary_encount_switch_on?(enemy.id)

  326.         @status_window.set_item(enemy, @index, true)

  327.       else

  328.         @status_window.set_item(enemy, @index, false)

  329.       end

  330.     end

  331.   end

  332.   #--------------------------------------------------------------------------

  333.   # ● リフレッシュ

  334.   #--------------------------------------------------------------------------

  335.   def refresh

  336.     make_item_list

  337.     create_contents

  338.     draw_all_items

  339.   end

  340.   #--------------------------------------------------------------------------

  341.   # ● ステータスウィンドウの設定

  342.   #--------------------------------------------------------------------------

  343.   def status_window=(status_window)

  344.     @status_window = status_window

  345.   end

  346. end




  347. #==============================================================================

  348. # ■ Window_MonsterDictionaryPerfection

  349. #------------------------------------------------------------------------------

  350. #  魔物図鑑画面で、図鑑の完成度を表示するウィンドウです。

  351. #==============================================================================




  352. class Window_MonsterDictionaryPerfection < Window_Selectable

  353.   include WD_monsterdictionary

  354.   #--------------------------------------------------------------------------

  355.   # ● オブジェクト初期化

  356.   #--------------------------------------------------------------------------

  357.   def initialize(x, y, width, height)

  358.     super

  359.     refresh(width)

  360.   end

  361.   #--------------------------------------------------------------------------

  362.   # ● リフレッシュ

  363.   #--------------------------------------------------------------------------

  364.   def refresh(width)

  365.     contents.clear

  366.     draw_text(0, 0, width-24, line_height, "図鑑完成度: #{monster_dictionary_perfection} %", 1)

  367.   end

  368. end







  369. #==============================================================================

  370. # ■ Window_MonsterDictionaryStatus

  371. #------------------------------------------------------------------------------

  372. #  魔物図鑑画面で、エネミーの詳細を表示するウィンドウです。

  373. #==============================================================================




  374. class Window_MonsterDictionaryStatus < Window_Selectable

  375.   include WD_monsterdictionary

  376.   #--------------------------------------------------------------------------

  377.   # ● オブジェクト初期化

  378.   #--------------------------------------------------------------------------

  379.   def initialize(x, y, width, height)

  380.     super

  381.     @enemy = nil

  382.     refresh

  383.   end

  384.   #--------------------------------------------------------------------------

  385.   # ● アイテムの設定

  386.   #--------------------------------------------------------------------------

  387.   def set_item(enemy, index=-1, print=false)

  388.     return if ((@enemy == enemy) and (@index == index))

  389.     @enemy = enemy

  390.     @index = index

  391.     @print = print

  392.     refresh

  393.   end

  394.   #--------------------------------------------------------------------------

  395.   # ● アイテムオブジェクトの取得

  396.   #--------------------------------------------------------------------------

  397.   def item_object(kind, data_id)

  398.     return $data_items  [data_id] if kind == 1

  399.     return $data_weapons[data_id] if kind == 2

  400.     return $data_armors [data_id] if kind == 3

  401.     return nil

  402.   end

  403.   #--------------------------------------------------------------------------

  404.   # ● リフレッシュ

  405.   #--------------------------------------------------------------------------

  406.   def refresh

  407.     contents.clear

  408.     contents.font.size = 24




  409.     if @print




  410.       if WD_monsterdictionary_layout::M_id_display

  411.         text1  = sprintf("%0#{WD_monsterdictionary_layout::M_id_display_digit}d",@index+1)

  412.         x      = WD_monsterdictionary_layout::M_id_display_x

  413.         y      = WD_monsterdictionary_layout::M_id_display_y

  414.         width  = WD_monsterdictionary_layout::M_id_display_width

  415.         height = line_height

  416.         draw_text(x, y, width, height, text1, 0)

  417.       end

  418.       if WD_monsterdictionary_layout::M_name_display

  419.         text1  = @enemy.name

  420.         x      = WD_monsterdictionary_layout::M_name_display_x

  421.         y      = WD_monsterdictionary_layout::M_name_display_y

  422.         width  = WD_monsterdictionary_layout::M_name_display_width

  423.         height = line_height

  424.         draw_text(x, y, width, height, text1, 0)

  425.       end

  426.       if WD_monsterdictionary_layout::M_pic_display

  427.         pic_name = @enemy.battler_name

  428.         pic_hue  = @enemy.battler_hue

  429.         x      = WD_monsterdictionary_layout::M_pic_display_x

  430.         y      = WD_monsterdictionary_layout::M_pic_display_y

  431.         opacity= WD_monsterdictionary_layout::M_pic_display_opacity

  432.         bitmap = Cache.battler(pic_name, pic_hue)

  433.         rect = Rect.new(0, 0, bitmap.width, bitmap.height)

  434.         contents.blt(x - rect.width/2, y - rect.height, bitmap, rect, opacity)

  435.       end




  436.       font_size = WD_monsterdictionary_layout::C_font_size

  437.       contents.font.size = font_size

  438.       if WD_monsterdictionary_layout::M_mhp_display

  439.         text1  = Vocab::param(0)

  440.         text2  = "?"

  441.         text2  = @enemy.params[0] if m_dictionary_victory_switch_on?(@enemy.id)

  442.         x      = WD_monsterdictionary_layout::M_mhp_display_x

  443.         y      = WD_monsterdictionary_layout::M_mhp_display_y

  444.         width  = WD_monsterdictionary_layout::M_mhp_display_width

  445.         change_color(system_color)

  446.         draw_text(x, y, width, font_size, text1, 0)

  447.         change_color(normal_color)

  448.         draw_text(x, y, width, font_size, text2, 2)

  449.       end

  450.       if WD_monsterdictionary_layout::M_mmp_display

  451.         text1  = Vocab::param(1)

  452.         text2  = "?"

  453.         text2  = @enemy.params[1] if m_dictionary_victory_switch_on?(@enemy.id)

  454.         x      = WD_monsterdictionary_layout::M_mmp_display_x

  455.         y      = WD_monsterdictionary_layout::M_mmp_display_y

  456.         width  = WD_monsterdictionary_layout::M_mmp_display_width

  457.         change_color(system_color)

  458.         draw_text(x, y, width, font_size, text1, 0)

  459.         change_color(normal_color)

  460.         draw_text(x, y, width, font_size, text2, 2)

  461.       end

  462.       if WD_monsterdictionary_layout::M_atk_display

  463.         text1  = Vocab::param(2)

  464.         text2  = "?"

  465.         text2  = @enemy.params[2] if m_dictionary_victory_switch_on?(@enemy.id)

  466.         x      = WD_monsterdictionary_layout::M_atk_display_x

  467.         y      = WD_monsterdictionary_layout::M_atk_display_y

  468.         width  = WD_monsterdictionary_layout::M_atk_display_width

  469.         change_color(system_color)

  470.         draw_text(x, y, width, font_size, text1, 0)

  471.         change_color(normal_color)

  472.         draw_text(x, y, width, font_size, text2, 2)

  473.       end

  474.       if WD_monsterdictionary_layout::M_def_display

  475.         text1  = Vocab::param(3)

  476.         text2  = "?"

  477.         text2  = @enemy.params[3] if m_dictionary_victory_switch_on?(@enemy.id)

  478.         x      = WD_monsterdictionary_layout::M_def_display_x

  479.         y      = WD_monsterdictionary_layout::M_def_display_y

  480.         width  = WD_monsterdictionary_layout::M_def_display_width

  481.         change_color(system_color)

  482.         draw_text(x, y, width, font_size, text1, 0)

  483.         change_color(normal_color)

  484.         draw_text(x, y, width, font_size, text2, 2)

  485.       end

  486.       if WD_monsterdictionary_layout::M_mat_display

  487.         text1  = Vocab::param(4)

  488.         text2  = "?"

  489.         text2  = @enemy.params[4] if m_dictionary_victory_switch_on?(@enemy.id)

  490.         x      = WD_monsterdictionary_layout::M_mat_display_x

  491.         y      = WD_monsterdictionary_layout::M_mat_display_y

  492.         width  = WD_monsterdictionary_layout::M_mat_display_width

  493.         change_color(system_color)

  494.         draw_text(x, y, width, font_size, text1, 0)

  495.         change_color(normal_color)

  496.         draw_text(x, y, width, font_size, text2, 2)

  497.       end

  498.       if WD_monsterdictionary_layout::M_mdf_display

  499.         text1  = Vocab::param(5)

  500.         text2  = "?"

  501.         text2  = @enemy.params[5] if m_dictionary_victory_switch_on?(@enemy.id)

  502.         x      = WD_monsterdictionary_layout::M_mdf_display_x

  503.         y      = WD_monsterdictionary_layout::M_mdf_display_y

  504.         width  = WD_monsterdictionary_layout::M_mdf_display_width

  505.         change_color(system_color)

  506.         draw_text(x, y, width, font_size, text1, 0)

  507.         change_color(normal_color)

  508.         draw_text(x, y, width, font_size, text2, 2)

  509.       end

  510.       if WD_monsterdictionary_layout::M_agi_display

  511.         text1  = Vocab::param(6)

  512.         text2  = "?"

  513.         text2  = @enemy.params[6] if m_dictionary_victory_switch_on?(@enemy.id)

  514.         x      = WD_monsterdictionary_layout::M_agi_display_x

  515.         y      = WD_monsterdictionary_layout::M_agi_display_y

  516.         width  = WD_monsterdictionary_layout::M_agi_display_width

  517.         change_color(system_color)

  518.         draw_text(x, y, width, font_size, text1, 0)

  519.         change_color(normal_color)

  520.         draw_text(x, y, width, font_size, text2, 2)

  521.       end

  522.       if WD_monsterdictionary_layout::M_luk_display

  523.         text1  = Vocab::param(7)

  524.         text2  = "?"

  525.         text2  = @enemy.params[7] if m_dictionary_victory_switch_on?(@enemy.id)

  526.         x      = WD_monsterdictionary_layout::M_luk_display_x

  527.         y      = WD_monsterdictionary_layout::M_luk_display_y

  528.         width  = WD_monsterdictionary_layout::M_luk_display_width

  529.         change_color(system_color)

  530.         draw_text(x, y, width, font_size, text1, 0)

  531.         change_color(normal_color)

  532.         draw_text(x, y, width, font_size, text2, 2)

  533.       end

  534.       if WD_monsterdictionary_layout::M_feature_display

  535.         text1  = WD_monsterdictionary_layout::M_feature_display_text1

  536.         text2  = "?"

  537.         text2  = WD_monsterdictionary_layout::M_feature_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)

  538.         x      = WD_monsterdictionary_layout::M_feature_display_x

  539.         y      = WD_monsterdictionary_layout::M_feature_display_y

  540.         width  = WD_monsterdictionary_layout::M_feature_display_width

  541.         change_color(system_color)

  542.         draw_text(x, y, width, font_size, text1, 0)

  543.         change_color(normal_color)

  544.         i = 0

  545.         if m_dictionary_victory_switch_on?(@enemy.id)

  546.           @enemy.note.scan(/<図鑑特徴:(.*)>/){|matched|

  547.             i += 1

  548.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)

  549.           }

  550.         end

  551.         if i == 0

  552.           self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)

  553.         end

  554.       end

  555.       if WD_monsterdictionary_layout::M_exp_display

  556.         text1  = WD_monsterdictionary_layout::M_exp_display_text1

  557.         text2  = "?"

  558.         text2  = @enemy.exp if m_dictionary_victory_switch_on?(@enemy.id)

  559.         x      = WD_monsterdictionary_layout::M_exp_display_x

  560.         y      = WD_monsterdictionary_layout::M_exp_display_y

  561.         width  = WD_monsterdictionary_layout::M_exp_display_width

  562.         change_color(system_color)

  563.         draw_text(x, y, width, font_size, text1, 0)

  564.         change_color(normal_color)

  565.         draw_text(x, y, width, font_size, text2, 2)

  566.       end

  567.       if WD_monsterdictionary_layout::M_gold_display

  568.         text1  = WD_monsterdictionary_layout::M_gold_display_text1

  569.         text2  = "?"

  570.         text2  = @enemy.gold if m_dictionary_victory_switch_on?(@enemy.id)

  571.         text3  = Vocab::currency_unit

  572.         x      = WD_monsterdictionary_layout::M_gold_display_x

  573.         y      = WD_monsterdictionary_layout::M_gold_display_y

  574.         width  = WD_monsterdictionary_layout::M_gold_display_width

  575.         change_color(system_color)

  576.         draw_text(x, y, width, font_size, text1, 0)

  577.         cx = text_size(Vocab::currency_unit).width

  578.         change_color(normal_color)

  579.         draw_text(x, y, width - cx - 2, font_size, text2, 2)

  580.         change_color(system_color)

  581.         draw_text(x, y, width, font_size, text3, 2)

  582.         change_color(normal_color)

  583.       end

  584.       if WD_monsterdictionary_layout::M_drop_display

  585.         text1  = WD_monsterdictionary_layout::M_drop_display_text1

  586.         text2  = WD_monsterdictionary_layout::M_drop_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)

  587.         x      = WD_monsterdictionary_layout::M_drop_display_x

  588.         y      = WD_monsterdictionary_layout::M_drop_display_y

  589.         width  = WD_monsterdictionary_layout::M_drop_display_width

  590.         change_color(system_color)

  591.         draw_text(x, y, width, font_size, text1, 0)

  592.         change_color(normal_color)

  593.         i = 0

  594.         @enemy.drop_items.each do |di|

  595.           if di.kind > 0

  596.             i += 1

  597.             item = item_object(di.kind, di.data_id)

  598.             n = i -1

  599.             if m_dictionary_drop_switch_on?(@enemy.id, n)

  600.               text2 = item.name

  601.               text3 = "1/#{di.denominator}"

  602.             else

  603.               text2  = "???????"

  604.               text3  = ""

  605.             end

  606.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, text2, 0)

  607.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, text3, 2)

  608.           end

  609.         end

  610.         if i == 0

  611.           self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)

  612.         end

  613.       end

  614.       if WD_monsterdictionary_layout::M_help_display

  615.         text1  = WD_monsterdictionary_layout::M_help_display_text1

  616.         text2  = "?"

  617.         text2  = WD_monsterdictionary_layout::M_help_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)

  618.         x      = WD_monsterdictionary_layout::M_help_display_x

  619.         y      = WD_monsterdictionary_layout::M_help_display_y

  620.         width  = WD_monsterdictionary_layout::M_help_display_width

  621.         change_color(system_color)

  622.         draw_text(x, y, width, font_size, text1, 0)

  623.         change_color(normal_color)

  624.         i = 0

  625.         if m_dictionary_victory_switch_on?(@enemy.id)

  626.           @enemy.note.scan(/<図鑑説明:(.*)>/){|matched|

  627.             i += 1

  628.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)

  629.           }

  630.         end

  631.         if i == 0

  632.           self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)

  633.         end

  634.       end

  635.       if WD_monsterdictionary_layout::M_geno_display

  636.         text1  = WD_monsterdictionary_layout::M_geno_display_text1

  637.         text2  = "#{m_dictionary_genoside_number(@enemy.id)}"

  638.         x      = WD_monsterdictionary_layout::M_geno_display_x

  639.         y      = WD_monsterdictionary_layout::M_geno_display_y

  640.         width  = WD_monsterdictionary_layout::M_geno_display_width

  641.         change_color(system_color)

  642.         draw_text(x, y, width, font_size, text1, 0)

  643.         change_color(normal_color)

  644.         draw_text(x, y, width, font_size, text2, 2)

  645.       end



  646.     elsif @enemy != nil



  647.       if WD_monsterdictionary_layout::M_id_display

  648.         text1  = sprintf("%0#{WD_monsterdictionary_layout::M_id_display_digit}d",@index+1)

  649.         x      = WD_monsterdictionary_layout::M_id_display_x

  650.         y      = WD_monsterdictionary_layout::M_id_display_y

  651.         width  = WD_monsterdictionary_layout::M_id_display_width

  652.         height = line_height

  653.         draw_text(x, y, width, height, text1, 0)

  654.       end

  655.       if WD_monsterdictionary_layout::M_name_display

  656.         text1  = "- No Data -"

  657.         x      = WD_monsterdictionary_layout::M_name_display_x

  658.         y      = WD_monsterdictionary_layout::M_name_display_y

  659.         width  = WD_monsterdictionary_layout::M_name_display_width

  660.         height = line_height

  661.         draw_text(x, y, width, height, text1, 0)

  662.       end




  663.     end

  664.   end

  665. end
复制代码
[/fold]
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部