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

Project1

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

[已经解决] 这个脚本怎么用?

[复制链接]

Lv4.逐梦者

【欧皇】

梦石
3
星屑
2035
在线时间
1004 小时
注册时间
2013-8-19
帖子
3486

开拓者

跳转到指定楼层
1
发表于 2015-3-25 20:43:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 欧买歌 于 2015-3-26 17:26 编辑
  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. 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. #-------------------------------------------------------------------------------
  132. #==============================================================================
  133. # ■ RGSS3 魔物図鑑 ver 1.01 本体プログラム
  134. #------------------------------------------------------------------------------
  135. #  配布元:
  136. #     白の魔 [url]http://izumiwhite.web.fc2.com/[/url]
  137. #
  138. #  利用規約:
  139. #     RPGツクールVX Aceの正規の登録者のみご利用になれます。
  140. #     利用報告・著作権表示とかは必要ありません。
  141. #     改造もご自由にどうぞ。
  142. #     何か問題が発生しても責任は持ちません。
  143. #==============================================================================

  144. #==============================================================================
  145. # ■ WD_monsterdictionary
  146. #------------------------------------------------------------------------------
  147. #  魔物図鑑用の共通メソッドです。
  148. #==============================================================================

  149. module WD_monsterdictionary
  150.   def m_dictionary_encount_switch_on(id)
  151.     $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil
  152.     $game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil
  153.     $game_system.m_dic_encount_sw[id] = true
  154.   end
  155.   def m_dictionary_encount_switch_off(id)
  156.     $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil
  157.     $game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil
  158.     $game_system.m_dic_encount_sw[id] = false
  159.   end
  160.   def m_dictionary_encount_switch_on?(id)
  161.     $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil
  162.     $game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil
  163.     return $game_system.m_dic_encount_sw[id]
  164.   end
  165.   def m_dictionary_victory_switch_on(id)
  166.     $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil
  167.     $game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil
  168.     $game_system.m_dic_victory_sw[id] = true
  169.   end
  170.   def m_dictionary_victory_switch_off(id)
  171.     $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil
  172.     $game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil
  173.     $game_system.m_dic_victory_sw[id] = false
  174.   end
  175.   def m_dictionary_victory_switch_on?(id)
  176.     $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil
  177.     $game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil
  178.     return $game_system.m_dic_victory_sw[id]
  179.   end
  180.   def m_dictionary_drop_switch_on(id, n)
  181.     $game_system.m_dic_drop_sw = [] if $game_system.m_dic_drop_sw == nil
  182.     $game_system.m_dic_drop_sw[id] = [] if $game_system.m_dic_drop_sw[id] == nil
  183.     $game_system.m_dic_drop_sw[id][n] = false if $game_system.m_dic_drop_sw[id][n] == nil
  184.     $game_system.m_dic_drop_sw[id][n] = true
  185.   end
  186.   def m_dictionary_drop_switch_off(id, n)
  187.     $game_system.m_dic_drop_sw = [] if $game_system.m_dic_drop_sw == nil
  188.     $game_system.m_dic_drop_sw[id] = [] if $game_system.m_dic_drop_sw[id] == nil
  189.     $game_system.m_dic_drop_sw[id][n] = false if $game_system.m_dic_drop_sw[id][n] == nil
  190.     $game_system.m_dic_drop_sw[id][n] = false
  191.   end
  192.   def m_dictionary_drop_switch_on?(id, n)
  193.     $game_system.m_dic_drop_sw = [] if $game_system.m_dic_drop_sw == nil
  194.     $game_system.m_dic_drop_sw[id] = [] if $game_system.m_dic_drop_sw[id] == nil
  195.     $game_system.m_dic_drop_sw[id][n] = false if $game_system.m_dic_drop_sw[id][n] == nil
  196.     return $game_system.m_dic_drop_sw[id][n]
  197.   end
  198.   def m_dictionary_genoside_number_add(id, n)
  199.     $game_system.m_dic_genoside_num = [] if $game_system.m_dic_genoside_num == nil
  200.     $game_system.m_dic_genoside_num[id] = 0 if $game_system.m_dic_genoside_num[id] == nil
  201.     $game_system.m_dic_genoside_num[id] += n
  202.   end
  203.   def m_dictionary_genoside_number(id)
  204.     $game_system.m_dic_genoside_num = [] if $game_system.m_dic_genoside_num == nil
  205.     $game_system.m_dic_genoside_num[id] = 0 if $game_system.m_dic_genoside_num[id] == nil
  206.     return $game_system.m_dic_genoside_num[id]
  207.   end

  208.   def print_dictionary?(enemy)
  209.     if enemy != nil
  210.       if enemy.name.size > 0
  211.         hantei = /<图鉴无效>/ =~ enemy.note
  212.         if hantei == nil
  213.           return true
  214.         end
  215.       end
  216.     end
  217.     return false
  218.   end
  219.   def monster_dictionary_perfection
  220.     dic_max = 0
  221.     dic_num = 0
  222.     $data_enemies.each do |enemy|
  223.       if print_dictionary?(enemy)
  224.         dic_max += 1
  225.         if WD_monsterdictionary_layout::Perfection_timing == 1
  226.           if m_dictionary_encount_switch_on?(enemy.id) == true
  227.             dic_num += 1
  228.           end
  229.         elsif WD_monsterdictionary_layout::Perfection_timing == 2
  230.           if m_dictionary_victory_switch_on?(enemy.id) == true
  231.             dic_num += 1
  232.           end
  233.         end
  234.       end
  235.     end
  236.     return (100*dic_num)/dic_max
  237.   end
  238. end

  239. class Game_Interpreter
  240.   include WD_monsterdictionary
  241. end

  242. class Game_System
  243.   #--------------------------------------------------------------------------
  244.   # ● 公開インスタンス変数
  245.   #--------------------------------------------------------------------------
  246.   attr_accessor :m_dic_encount_sw
  247.   attr_accessor :m_dic_victory_sw
  248.   attr_accessor :m_dic_drop_sw
  249.   attr_accessor :m_dic_genoside_num
  250.   #--------------------------------------------------------------------------
  251.   # ● オブジェクト初期化
  252.   #--------------------------------------------------------------------------
  253.   alias wd_orig_initialize002 initialize
  254.   def initialize
  255.     wd_orig_initialize002
  256.     @m_dic_encount_sw = []
  257.     @m_dic_victory_sw = []
  258.     @m_dic_drop_sw = []
  259.     @m_dic_genoside_num = []
  260.   end
  261. end

  262. class Game_Troop < Game_Unit
  263.   include WD_monsterdictionary
  264.   #--------------------------------------------------------------------------
  265.   # ● 図鑑への登録(遭遇済み判定)
  266.   #--------------------------------------------------------------------------
  267.   def dictionary1
  268.     for enemy in members
  269.       m_dictionary_encount_switch_on(enemy.enemy_id) unless enemy.hidden? #遭遇済み図鑑登録
  270.     end
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # ● 図鑑への登録(撃破済み判定)
  274.   #--------------------------------------------------------------------------
  275.   def dictionary2
  276.     for enemy in dead_members
  277.       m_dictionary_victory_switch_on(enemy.enemy_id) unless enemy.hidden? #撃破済み図鑑登録
  278.       m_dictionary_genoside_number_add(enemy.enemy_id, 1) unless enemy.hidden? #撃破数カウント
  279.     end
  280.   end
  281. end

  282. class << BattleManager
  283.   #--------------------------------------------------------------------------
  284.   # ● 戦闘開始
  285.   #--------------------------------------------------------------------------
  286.   alias wd_orig_battle_start002 battle_start
  287.   def battle_start
  288.     wd_orig_battle_start002
  289.     $game_troop.dictionary1 #図鑑への登録(遭遇済み判定)
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ● 勝利の処理
  293.   #--------------------------------------------------------------------------
  294.   alias wd_orig_process_victory002 process_victory
  295.   def process_victory
  296.     $game_troop.dictionary2 #図鑑への登録(撃破済み判定)
  297.     wd_orig_process_victory002
  298.   end
  299. end

  300. class Game_Interpreter
  301.   #--------------------------------------------------------------------------
  302.   # ● 敵キャラの出現
  303.   #--------------------------------------------------------------------------
  304.   alias wd_orig_command_335_002 command_335
  305.   def command_335
  306.     wd_orig_command_335_002
  307.     $game_troop.dictionary1 #図鑑への登録(遭遇済み判定)
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● 敵キャラの変身
  311.   #--------------------------------------------------------------------------
  312.   alias wd_orig_command_336_002 command_336
  313.   def command_336
  314.     wd_orig_command_336_002
  315.     $game_troop.dictionary1 #図鑑への登録(遭遇済み判定)
  316.   end
  317. end

  318. class Game_Enemy < Game_Battler
  319.   include WD_monsterdictionary
  320.   #--------------------------------------------------------------------------
  321.   # ● ドロップアイテムの配列作成(再定義)
  322.   #--------------------------------------------------------------------------
  323.   def make_drop_items
  324.     n = -1
  325.     enemy.drop_items.inject([]) do |r, di|
  326.       n += 1
  327.       if di.kind > 0 && rand * di.denominator < drop_item_rate
  328.         m_dictionary_drop_switch_on(@enemy_id, n)
  329.         r.push(item_object(di.kind, di.data_id))
  330.       else
  331.         r
  332.       end
  333.     end
  334.   end
  335. end

  336. #==============================================================================
  337. # ■ Scene_MonsterDictionary
  338. #------------------------------------------------------------------------------
  339. #  魔物図鑑画面の処理を行うクラスです。
  340. #==============================================================================

  341. class Scene_MonsterDictionary < Scene_ItemBase
  342.   #--------------------------------------------------------------------------
  343.   # ● 開始処理
  344.   #--------------------------------------------------------------------------
  345.   def start
  346.     super
  347.     create_status_window
  348.     create_item_window
  349.     create_perfection_window
  350.   end
  351.   #--------------------------------------------------------------------------
  352.   # ● アイテムウィンドウの作成
  353.   #--------------------------------------------------------------------------
  354.   def create_item_window
  355.     wy = 0
  356.     wh = Graphics.height- 48
  357.     @item_window = Window_MonsterDictionaryList.new(Graphics.width-172-48, wy, 172+48, wh)
  358.     @item_window.viewport = @viewport
  359.     @item_window.status_window = @status_window
  360.     @item_window.set_handler(:cancel, method(:return_scene))
  361.     @item_window.update_help
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # ● アイテムステータスウィンドウの作成
  365.   #--------------------------------------------------------------------------
  366.   def create_status_window
  367.     wy = 0
  368.     wh = Graphics.height
  369.     @status_window = Window_MonsterDictionaryStatus.new(0, wy, Graphics.width-172-48, wh)
  370.     @status_window.viewport = @viewport
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● 図鑑完成度ウィンドウの作成
  374.   #--------------------------------------------------------------------------
  375.   def create_perfection_window
  376.     wy = @item_window.y + @item_window.height
  377.     wh = 48
  378.     @perfection_window = Window_MonsterDictionaryPerfection.new(Graphics.width-172-48, wy, 172+48, wh)
  379.     @perfection_window.viewport = @viewport
  380.   end
  381. end


  382. #==============================================================================
  383. # ■ Window_MonsterDictionaryList
  384. #------------------------------------------------------------------------------
  385. #  魔物図鑑画面で、魔物の一覧を表示するウィンドウです。
  386. #==============================================================================

  387. class Window_MonsterDictionaryList < Window_Selectable
  388.   include WD_monsterdictionary
  389.   #--------------------------------------------------------------------------
  390.   # ● オブジェクト初期化
  391.   #--------------------------------------------------------------------------
  392.   def initialize(x, y, width, height)
  393.     super
  394.     @data = []
  395.     refresh
  396.     activate
  397.     select(0)
  398.   end
  399.   #--------------------------------------------------------------------------
  400.   # ● 桁数の取得
  401.   #--------------------------------------------------------------------------
  402.   def col_max
  403.     return 1
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● 項目数の取得
  407.   #--------------------------------------------------------------------------
  408.   def item_max
  409.     @data ? @data.size : 1
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● アイテムの取得
  413.   #--------------------------------------------------------------------------
  414.   def enemy
  415.     @data && index >= 0 ? @data[index] : nil
  416.   end
  417.   #--------------------------------------------------------------------------
  418.   # ● アイテムリストの作成
  419.   #--------------------------------------------------------------------------
  420.   def make_item_list
  421.     @data = []
  422.     $data_enemies.each do |enemy|
  423.       if print_dictionary?(enemy)
  424.         @data.push(enemy)
  425.       end
  426.     end
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ● 項目の描画
  430.   #--------------------------------------------------------------------------
  431.   def draw_item(index)
  432.     enemy = @data[index]
  433.     if enemy
  434.       rect = item_rect(index)
  435.       rect.width -= 4
  436.       if m_dictionary_encount_switch_on?(enemy.id)
  437.         change_color(normal_color, true)
  438.         draw_text(rect.x, rect.y, 172, line_height, enemy.name)
  439.       else
  440.         change_color(normal_color, false)
  441.         draw_text(rect.x, rect.y, 172, line_height, "???????")
  442.       end
  443.     end
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  447.   #--------------------------------------------------------------------------
  448.   def call_update_help
  449.     update_help if active
  450.   end
  451.   #--------------------------------------------------------------------------
  452.   # ● ヘルプテキスト更新
  453.   #--------------------------------------------------------------------------
  454.   def update_help
  455.     if @status_window
  456.       if m_dictionary_encount_switch_on?(enemy.id)
  457.         @status_window.set_item(enemy, @index, true)
  458.       else
  459.         @status_window.set_item(enemy, @index, false)
  460.       end
  461.     end
  462.   end
  463.   #--------------------------------------------------------------------------
  464.   # ● リフレッシュ
  465.   #--------------------------------------------------------------------------
  466.   def refresh
  467.     make_item_list
  468.     create_contents
  469.     draw_all_items
  470.   end
  471.   #--------------------------------------------------------------------------
  472.   # ● ステータスウィンドウの設定
  473.   #--------------------------------------------------------------------------
  474.   def status_window=(status_window)
  475.     @status_window = status_window
  476.   end
  477. end

  478. #==============================================================================
  479. # ■ Window_MonsterDictionaryPerfection
  480. #------------------------------------------------------------------------------
  481. #  魔物図鑑画面で、図鑑の完成度を表示するウィンドウです。
  482. #==============================================================================

  483. class Window_MonsterDictionaryPerfection < Window_Selectable
  484.   include WD_monsterdictionary
  485.   #--------------------------------------------------------------------------
  486.   # ● オブジェクト初期化
  487.   #--------------------------------------------------------------------------
  488.   def initialize(x, y, width, height)
  489.     super
  490.     refresh(width)
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● リフレッシュ
  494.   #--------------------------------------------------------------------------
  495.   def refresh(width)
  496.     contents.clear
  497.     draw_text(0, 0, width-24, line_height, "图鉴完成度: #{monster_dictionary_perfection} %", 1)
  498.   end
  499. end


  500. #==============================================================================
  501. # ■ Window_MonsterDictionaryStatus
  502. #------------------------------------------------------------------------------
  503. #  魔物図鑑画面で、エネミーの詳細を表示するウィンドウです。
  504. #==============================================================================

  505. class Window_MonsterDictionaryStatus < Window_Selectable
  506.   include WD_monsterdictionary
  507.   #--------------------------------------------------------------------------
  508.   # ● オブジェクト初期化
  509.   #--------------------------------------------------------------------------
  510.   def initialize(x, y, width, height)
  511.     super
  512.     @enemy = nil
  513.     refresh
  514.   end
  515.   #--------------------------------------------------------------------------
  516.   # ● アイテムの設定
  517.   #--------------------------------------------------------------------------
  518.   def set_item(enemy, index=-1, print=false)
  519.     return if ((@enemy == enemy) and (@index == index))
  520.     @enemy = enemy
  521.     @index = index
  522.     @print = print
  523.     refresh
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ● アイテムオブジェクトの取得
  527.   #--------------------------------------------------------------------------
  528.   def item_object(kind, data_id)
  529.     return $data_items  [data_id] if kind == 1
  530.     return $data_weapons[data_id] if kind == 2
  531.     return $data_armors [data_id] if kind == 3
  532.     return nil
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # ● リフレッシュ
  536.   #--------------------------------------------------------------------------
  537.   def refresh
  538.     contents.clear
  539.     contents.font.size = 24

  540.     if @print

  541.       if WD_monsterdictionary_layout::M_id_display
  542.         text1  = sprintf("%0#{WD_monsterdictionary_layout::M_id_display_digit}d",@index+1)
  543.         x      = WD_monsterdictionary_layout::M_id_display_x
  544.         y      = WD_monsterdictionary_layout::M_id_display_y
  545.         width  = WD_monsterdictionary_layout::M_id_display_width
  546.         height = line_height
  547.         draw_text(x, y, width, height, text1, 0)
  548.       end
  549.       if WD_monsterdictionary_layout::M_name_display
  550.         text1  = @enemy.name
  551.         x      = WD_monsterdictionary_layout::M_name_display_x
  552.         y      = WD_monsterdictionary_layout::M_name_display_y
  553.         width  = WD_monsterdictionary_layout::M_name_display_width
  554.         height = line_height
  555.         draw_text(x, y, width, height, text1, 0)
  556.       end
  557.       if WD_monsterdictionary_layout::M_pic_display
  558.         pic_name = @enemy.battler_name
  559.         pic_hue  = @enemy.battler_hue
  560.         x      = WD_monsterdictionary_layout::M_pic_display_x
  561.         y      = WD_monsterdictionary_layout::M_pic_display_y
  562.         opacity= WD_monsterdictionary_layout::M_pic_display_opacity
  563.         bitmap = Cache.battler(pic_name, pic_hue)
  564.         rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  565.         contents.blt(x - rect.width/2, y - rect.height, bitmap, rect, opacity)
  566.       end

  567.       font_size = WD_monsterdictionary_layout::C_font_size
  568.       contents.font.size = font_size
  569.       if WD_monsterdictionary_layout::M_mhp_display
  570.         text1  = Vocab::param(0)
  571.         text2  = "?"
  572.         text2  = @enemy.params[0] if m_dictionary_victory_switch_on?(@enemy.id)
  573.         x      = WD_monsterdictionary_layout::M_mhp_display_x
  574.         y      = WD_monsterdictionary_layout::M_mhp_display_y
  575.         width  = WD_monsterdictionary_layout::M_mhp_display_width
  576.         change_color(system_color)
  577.         draw_text(x, y, width, font_size, text1, 0)
  578.         change_color(normal_color)
  579.         draw_text(x, y, width, font_size, text2, 2)
  580.       end
  581.       if WD_monsterdictionary_layout::M_mmp_display
  582.         text1  = Vocab::param(1)
  583.         text2  = "?"
  584.         text2  = @enemy.params[1] if m_dictionary_victory_switch_on?(@enemy.id)
  585.         x      = WD_monsterdictionary_layout::M_mmp_display_x
  586.         y      = WD_monsterdictionary_layout::M_mmp_display_y
  587.         width  = WD_monsterdictionary_layout::M_mmp_display_width
  588.         change_color(system_color)
  589.         draw_text(x, y, width, font_size, text1, 0)
  590.         change_color(normal_color)
  591.         draw_text(x, y, width, font_size, text2, 2)
  592.       end
  593.       if WD_monsterdictionary_layout::M_atk_display
  594.         text1  = Vocab::param(2)
  595.         text2  = "?"
  596.         text2  = @enemy.params[2] if m_dictionary_victory_switch_on?(@enemy.id)
  597.         x      = WD_monsterdictionary_layout::M_atk_display_x
  598.         y      = WD_monsterdictionary_layout::M_atk_display_y
  599.         width  = WD_monsterdictionary_layout::M_atk_display_width
  600.         change_color(system_color)
  601.         draw_text(x, y, width, font_size, text1, 0)
  602.         change_color(normal_color)
  603.         draw_text(x, y, width, font_size, text2, 2)
  604.       end
  605.       if WD_monsterdictionary_layout::M_def_display
  606.         text1  = Vocab::param(3)
  607.         text2  = "?"
  608.         text2  = @enemy.params[3] if m_dictionary_victory_switch_on?(@enemy.id)
  609.         x      = WD_monsterdictionary_layout::M_def_display_x
  610.         y      = WD_monsterdictionary_layout::M_def_display_y
  611.         width  = WD_monsterdictionary_layout::M_def_display_width
  612.         change_color(system_color)
  613.         draw_text(x, y, width, font_size, text1, 0)
  614.         change_color(normal_color)
  615.         draw_text(x, y, width, font_size, text2, 2)
  616.       end
  617.       if WD_monsterdictionary_layout::M_mat_display
  618.         text1  = Vocab::param(4)
  619.         text2  = "?"
  620.         text2  = @enemy.params[4] if m_dictionary_victory_switch_on?(@enemy.id)
  621.         x      = WD_monsterdictionary_layout::M_mat_display_x
  622.         y      = WD_monsterdictionary_layout::M_mat_display_y
  623.         width  = WD_monsterdictionary_layout::M_mat_display_width
  624.         change_color(system_color)
  625.         draw_text(x, y, width, font_size, text1, 0)
  626.         change_color(normal_color)
  627.         draw_text(x, y, width, font_size, text2, 2)
  628.       end
  629.       if WD_monsterdictionary_layout::M_mdf_display
  630.         text1  = Vocab::param(5)
  631.         text2  = "?"
  632.         text2  = @enemy.params[5] if m_dictionary_victory_switch_on?(@enemy.id)
  633.         x      = WD_monsterdictionary_layout::M_mdf_display_x
  634.         y      = WD_monsterdictionary_layout::M_mdf_display_y
  635.         width  = WD_monsterdictionary_layout::M_mdf_display_width
  636.         change_color(system_color)
  637.         draw_text(x, y, width, font_size, text1, 0)
  638.         change_color(normal_color)
  639.         draw_text(x, y, width, font_size, text2, 2)
  640.       end
  641.       if WD_monsterdictionary_layout::M_agi_display
  642.         text1  = Vocab::param(6)
  643.         text2  = "?"
  644.         text2  = @enemy.params[6] if m_dictionary_victory_switch_on?(@enemy.id)
  645.         x      = WD_monsterdictionary_layout::M_agi_display_x
  646.         y      = WD_monsterdictionary_layout::M_agi_display_y
  647.         width  = WD_monsterdictionary_layout::M_agi_display_width
  648.         change_color(system_color)
  649.         draw_text(x, y, width, font_size, text1, 0)
  650.         change_color(normal_color)
  651.         draw_text(x, y, width, font_size, text2, 2)
  652.       end
  653.       if WD_monsterdictionary_layout::M_luk_display
  654.         text1  = Vocab::param(7)
  655.         text2  = "?"
  656.         text2  = @enemy.params[7] if m_dictionary_victory_switch_on?(@enemy.id)
  657.         x      = WD_monsterdictionary_layout::M_luk_display_x
  658.         y      = WD_monsterdictionary_layout::M_luk_display_y
  659.         width  = WD_monsterdictionary_layout::M_luk_display_width
  660.         change_color(system_color)
  661.         draw_text(x, y, width, font_size, text1, 0)
  662.         change_color(normal_color)
  663.         draw_text(x, y, width, font_size, text2, 2)
  664.       end
  665.       if WD_monsterdictionary_layout::M_feature_display
  666.         text1  = WD_monsterdictionary_layout::M_feature_display_text1
  667.         text2  = "?"
  668.         text2  = WD_monsterdictionary_layout::M_feature_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
  669.         x      = WD_monsterdictionary_layout::M_feature_display_x
  670.         y      = WD_monsterdictionary_layout::M_feature_display_y
  671.         width  = WD_monsterdictionary_layout::M_feature_display_width
  672.         change_color(system_color)
  673.         draw_text(x, y, width, font_size, text1, 0)
  674.         change_color(normal_color)
  675.         i = 0
  676.         if m_dictionary_victory_switch_on?(@enemy.id)
  677.           @enemy.note.scan(/<图鉴特征:(.*)>/){|matched|
  678.             i += 1
  679.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
  680.           }
  681.         end
  682.         if i == 0
  683.           self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  684.         end
  685.       end
  686.       if WD_monsterdictionary_layout::M_exp_display
  687.         text1  = WD_monsterdictionary_layout::M_exp_display_text1
  688.         text2  = "?"
  689.         text2  = @enemy.exp if m_dictionary_victory_switch_on?(@enemy.id)
  690.         x      = WD_monsterdictionary_layout::M_exp_display_x
  691.         y      = WD_monsterdictionary_layout::M_exp_display_y
  692.         width  = WD_monsterdictionary_layout::M_exp_display_width
  693.         change_color(system_color)
  694.         draw_text(x, y, width, font_size, text1, 0)
  695.         change_color(normal_color)
  696.         draw_text(x, y, width, font_size, text2, 2)
  697.       end
  698.       if WD_monsterdictionary_layout::M_gold_display
  699.         text1  = WD_monsterdictionary_layout::M_gold_display_text1
  700.         text2  = "?"
  701.         text2  = @enemy.gold if m_dictionary_victory_switch_on?(@enemy.id)
  702.         text3  = Vocab::currency_unit
  703.         x      = WD_monsterdictionary_layout::M_gold_display_x
  704.         y      = WD_monsterdictionary_layout::M_gold_display_y
  705.         width  = WD_monsterdictionary_layout::M_gold_display_width
  706.         change_color(system_color)
  707.         draw_text(x, y, width, font_size, text1, 0)
  708.         cx = text_size(Vocab::currency_unit).width
  709.         change_color(normal_color)
  710.         draw_text(x, y, width - cx - 2, font_size, text2, 2)
  711.         change_color(system_color)
  712.         draw_text(x, y, width, font_size, text3, 2)
  713.         change_color(normal_color)
  714.       end
  715.       if WD_monsterdictionary_layout::M_drop_display
  716.         text1  = WD_monsterdictionary_layout::M_drop_display_text1
  717.         text2  = WD_monsterdictionary_layout::M_drop_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
  718.         x      = WD_monsterdictionary_layout::M_drop_display_x
  719.         y      = WD_monsterdictionary_layout::M_drop_display_y
  720.         width  = WD_monsterdictionary_layout::M_drop_display_width
  721.         change_color(system_color)
  722.         draw_text(x, y, width, font_size, text1, 0)
  723.         change_color(normal_color)
  724.         i = 0
  725.         @enemy.drop_items.each do |di|
  726.           if di.kind > 0
  727.             i += 1
  728.             item = item_object(di.kind, di.data_id)
  729.             n = i -1
  730.             if m_dictionary_drop_switch_on?(@enemy.id, n)
  731.               text2 = item.name
  732.               text3 = "1/#{di.denominator}"
  733.             else
  734.               text2  = "???????"
  735.               text3  = ""
  736.             end
  737.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, text2, 0)
  738.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, text3, 2)
  739.           end
  740.         end
  741.         if i == 0
  742.           self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  743.         end
  744.       end
  745.       if WD_monsterdictionary_layout::M_help_display
  746.         text1  = WD_monsterdictionary_layout::M_help_display_text1
  747.         text2  = "?"
  748.         text2  = WD_monsterdictionary_layout::M_help_display_text2 if m_dictionary_victory_switch_on?(@enemy.id)
  749.         x      = WD_monsterdictionary_layout::M_help_display_x
  750.         y      = WD_monsterdictionary_layout::M_help_display_y
  751.         width  = WD_monsterdictionary_layout::M_help_display_width
  752.         change_color(system_color)
  753.         draw_text(x, y, width, font_size, text1, 0)
  754.         change_color(normal_color)
  755.         i = 0
  756.         if m_dictionary_victory_switch_on?(@enemy.id)
  757.           @enemy.note.scan(/<图鉴说明:(.*)>/){|matched|
  758.             i += 1
  759.             self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
  760.           }
  761.         end
  762.         if i == 0
  763.           self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
  764.         end
  765.       end
  766.       if WD_monsterdictionary_layout::M_geno_display
  767.         text1  = WD_monsterdictionary_layout::M_geno_display_text1
  768.         text2  = "#{m_dictionary_genoside_number(@enemy.id)}"
  769.         x      = WD_monsterdictionary_layout::M_geno_display_x
  770.         y      = WD_monsterdictionary_layout::M_geno_display_y
  771.         width  = WD_monsterdictionary_layout::M_geno_display_width
  772.         change_color(system_color)
  773.         draw_text(x, y, width, font_size, text1, 0)
  774.         change_color(normal_color)
  775.         draw_text(x, y, width, font_size, text2, 2)
  776.       end

  777.     elsif @enemy != nil

  778.       if WD_monsterdictionary_layout::M_id_display
  779.         text1  = sprintf("%0#{WD_monsterdictionary_layout::M_id_display_digit}d",@index+1)
  780.         x      = WD_monsterdictionary_layout::M_id_display_x
  781.         y      = WD_monsterdictionary_layout::M_id_display_y
  782.         width  = WD_monsterdictionary_layout::M_id_display_width
  783.         height = line_height
  784.         draw_text(x, y, width, height, text1, 0)
  785.       end
  786.       if WD_monsterdictionary_layout::M_name_display
  787.         text1  = "- No Data -"
  788.         x      = WD_monsterdictionary_layout::M_name_display_x
  789.         y      = WD_monsterdictionary_layout::M_name_display_y
  790.         width  = WD_monsterdictionary_layout::M_name_display_width
  791.         height = line_height
  792.         draw_text(x, y, width, height, text1, 0)
  793.       end

  794.     end
  795.   end
  796. end
复制代码
怪物图鉴脚本,如何召唤出图鉴界面?

点评

我剛建了一个rmva討論区,現誠邀你的加入,網址:rmva.moreforum.com  发表于 2015-5-8 12:51
QQ:2223942063
Q群:365819625
贪吃方1.4
david_ng223 该用户已被删除
2
发表于 2015-3-25 21:27:40 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-15 10:43

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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