查看: 1938|回复: 2

[已经解决] 关于怪物图鉴能否手动添加档案?

[复制链接]
梦石
0
星屑
5219
在线时间
1208 小时
注册时间
2011-8-30
回帖
56

开拓者

发表于 2017-5-15 13:32:03 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 Mullice_ 于 2017-5-15 13:44 编辑

一般来说判定是战斗之后会自动添加敌人的档案进去,
那能不能利用事件里的脚本,把xx号敌人添加进怪物图鉴呢?
  1. #================================================================
  2. # 本脚本来自[url]http://www.66rpg.com/[/url],使用和转载请保留此信息
  3. #===================================================================
  4. #——————————————————————————————————————
  5. #魔物图鉴+介绍
  6. #
  7. #战斗终了时自动添加敌人进入图鉴(class Scene_Battle start_phase5 追加。

  8. #目前与各种战斗系统没有发现冲突)
  9. #不想加入图鉴的怪物设置其“不加入图鉴”属性有效度为A即可
  10. #图鉴完成度的表示功能追加
  11. #SHOW_COMPLETE_TYPE 的数值可以设定
  12. #当为1,显示现有个数/总数,当为2,显示完成百分比,当为3,全显示。
  13. #使用方法:$scene = Scene_MonsterBook.new
  14. #数据库中属性里面那些种族特效的位置,建议把默认的“对 不死”之类改成“不死”,

  15. #不然显示会很奇怪
  16. #由于雷达图的设计问题,只支持8项属性
  17. #默认种族特效处理属性中编号9到编号16,

  18. #如果你做了修改请自行改动380行左右的for i in 9..16这一句代码
  19. #显示各种信息位于630行左右,想不显示的话只要删除相应语句
  20. CHARA_INFO=[]#怪物的介绍,对应怪物id,空格为换行,

  21. #同时也会自动换行,没有写介绍的怪物会自动显示“无详细信息”
  22. CHARA_INFO[1] = ""

  23. #没有信息测试,怪物
  24. #=============
  25. #雷达图相关处理部分
  26. #=============
  27. class Bitmap
  28. def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  29. distance = (start_x - end_x).abs + (start_y - end_y).abs
  30. if end_color == start_color
  31. for i in 1..distance
  32. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  33. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  34. if width == 1
  35. self.set_pixel(x, y, start_color)
  36. else
  37. self.fill_rect(x, y, width, width, start_color)
  38. end
  39. end
  40. else
  41. for i in 1..distance
  42. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  43. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  44. r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  45. g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  46. b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  47. a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  48. if width == 1
  49. self.set_pixel(x, y, Color.new(r, g, b, a))
  50. else
  51. self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  52. end
  53. end
  54. end
  55. end
  56. end
  57. #=============
  58. # Graphic_Def_Elem
  59. #=============
  60. class Window_Base
  61. FONT_SIZE = 18
  62. WORD_ELEMENT_GUARD = "属性有效度"
  63. NUMBER_OF_ELEMENTS = 8
  64. ELEMENT_ORDER = [1,3,10,5,2,12,7,6]
  65. GRAPH_SCALINE_COLOR = Color.new(255, 255, 255, 128)
  66. GRAPH_SCALINE_COLOR_SHADOW = Color.new( 0, 0, 0, 192)
  67. GRAPH_LINE_COLOR = Color.new(255, 255, 64, 255)
  68. GRAPH_LINE_COLOR_MINUS = Color.new( 64, 255, 255, 255)
  69. GRAPH_LINE_COLOR_PLUS = Color.new(255, 64, 64, 255)
  70. end

  71. #——————————————————————————————————————
  72. module Enemy_Book_Config
  73. DROP_ITEM_NEED_ANALYZE = true #显示物品
  74. # EVA_NAME = "回避修正"              #回避修正的名称(因为数据库中没有定义)
  75. SHOW_COMPLETE_TYPE = 3         #图鉴完成率表示方法
  76. end
  77. class Data_MonsterBook
  78. #--------------------------------------------------------------------------
  79. # ● 图鉴用ID設定
  80. #--------------------------------------------------------------------------
  81. def enemy_book_id_set
  82.    data = [0]
  83.    data[1] = 2
  84.    data[2] = 1
  85.    data[3] = 15
  86.    data[4] = 25
  87.    data[5] = 18
  88.    data[6] = 30
  89.    return data
  90. end
  91. end
  92. class Game_Temp
  93. attr_accessor :enemy_book_data
  94. alias temp_enemy_book_data_initialize initialize
  95. def initialize
  96.    temp_enemy_book_data_initialize
  97.    @enemy_book_data = Data_MonsterBook.new
  98. end
  99. end

  100. class Game_Party
  101. #==============================================
  102. #--------------------------------------------------------------------------
  103.   # ● 公開インスタンス変数
  104.   #--------------------------------------------------------------------------
  105.   attr_reader   :actors                   # アクター
  106.   attr_reader   :gold                     # ゴールド
  107.   attr_reader   :steps                    # 歩数
  108.   attr_accessor :mission                  # 任务★★★★★★★★★★★★★
  109.   attr_accessor   :pr                  # 当前章节数★★★★★★★★★★★★★
  110.   attr_reader   :prname
  111.   #--------------------------------------------------------------------------
  112.   # ● オブジェクト初期化
  113.   #--------------------------------------------------------------------------
  114.   def initialize
  115.     # アクターの配列を作成
  116.     @actors = []
  117.     # ゴールドと歩数を初期化
  118.     @gold = 0
  119.     @steps = 0
  120.     # アイテム、武器、防具の所持数ハッシュを作成
  121.     @items = {}
  122.     @weapons = {}
  123.     @armors = {}
  124.   end
  125. #==============================================
  126. attr_accessor :enemy_info               # 出会った敵情報(図鑑用)

  127. #--------------------------------------------------------------------------
  128. # ● オブジェクト初期化
  129. #--------------------------------------------------------------------------
  130. alias book_info_initialize initialize
  131. def initialize
  132.    book_info_initialize
  133.    @enemy_info = {}
  134. end

  135. #--------------------------------------------------------------------------
  136. # ● エネミー情報の追加(図鑑用)
  137. #     type : 通常遭遇かアナライズか 0:通常 1:アナライズ -1:情報削除
  138. #     0:無遭遇 1:遭遇済 2:アナライズ済
  139. #--------------------------------------------------------------------------
  140. def add_enemy_info(enemy_id, type = 0)
  141.    case type
  142.    when 0
  143.      if @enemy_info[enemy_id] == 2
  144.        return false
  145.      end
  146.      @enemy_info[enemy_id] = 1
  147.    when 1
  148.      @enemy_info[enemy_id] = 2
  149.    when -1
  150.      @enemy_info[enemy_id] = 0
  151.    end
  152. end
  153. #--------------------------------------------------------------------------
  154. # ● 魔物図鑑の最大登録数を取得
  155. #--------------------------------------------------------------------------
  156. def enemy_book_max
  157.    return $game_temp.enemy_book_data.id_data.size - 1
  158. end
  159. #--------------------------------------------------------------------------
  160. # ● 魔物図鑑の現在登録数を取得
  161. #--------------------------------------------------------------------------
  162. def enemy_book_now
  163.    now_enemy_info = @enemy_info.keys
  164.    # 登録無視の属性IDを取得
  165.    no_add = $game_temp.enemy_book_data.no_add_element
  166.    new_enemy_info = []
  167.    for i in now_enemy_info
  168.      enemy = $data_enemies[i]
  169.      next if enemy.name == ""
  170.      if enemy.element_ranks[no_add] == 1
  171.        next
  172.      end
  173.      new_enemy_info.push(enemy.id)
  174.    end
  175.    return new_enemy_info.size
  176. end
  177. #--------------------------------------------------------------------------
  178. # ● 魔物図鑑の完成率を取得
  179. #--------------------------------------------------------------------------
  180. def enemy_book_complete_percentage
  181.    e_max = enemy_book_max.to_f
  182.    e_now = enemy_book_now.to_f
  183.    comp = e_now / e_max * 100
  184.    return comp.truncate
  185. end
  186. end

  187. class Interpreter
  188. def enemy_book_max
  189.    return $game_party.enemy_book_max
  190. end
  191. def enemy_book_now
  192.    return $game_party.enemy_book_now
  193. end
  194. def enemy_book_comp
  195.    return $game_party.enemy_book_complete_percentage
  196. end
  197. end

  198. class Scene_Battle
  199. alias add_enemy_info_start_phase5 start_phase5
  200. def start_phase5
  201.    for enemy in $game_troop.enemies
  202.      # エネミーが隠れ状態でない場合
  203.      unless enemy.hidden
  204.        # 敵遭遇情報追加
  205.        $game_party.add_enemy_info(enemy.id, 0)
  206.      end
  207.    end
  208.    add_enemy_info_start_phase5
  209. end
  210. end

  211. class Window_Base < Window
  212. #--------------------------------------------------------------------------
  213. # ● エネミーの戦闘後獲得アイテムの描画
  214. #--------------------------------------------------------------------------
  215. def draw_enemy_drop_item(enemy, x, y)
  216.    self.contents.font.color = normal_color
  217.    treasures = []
  218.    if enemy.item_id > 0
  219.      treasures.push($data_items[enemy.item_id])
  220.    end
  221.    if enemy.weapon_id > 0
  222.      treasures.push($data_weapons[enemy.weapon_id])
  223.    end
  224.    if enemy.armor_id > 0
  225.      treasures.push($data_armors[enemy.armor_id])
  226.    end
  227.    # 現状ではとりあえず1つのみ描画
  228.    if treasures.size > 0
  229.      item = treasures[0]
  230.      bitmap = RPG::Cache.icon(item.icon_name)
  231.      opacity = 255
  232.      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  233.      name = treasures[0].name
  234.    else
  235.      self.contents.font.color = disabled_color
  236.      name = "无"
  237.    end
  238.    self.contents.draw_text(x+28, y, 212, 32, name)
  239. end
  240. #--------------------------------------------------------------------------
  241. # ● エネミーの図鑑IDの描画
  242. #--------------------------------------------------------------------------
  243. def draw_enemy_book_id(enemy, x, y)
  244.    self.contents.font.color = normal_color
  245.    id = $game_temp.enemy_book_data.id_data.index(enemy.id)
  246.    self.contents.draw_text(x, y, 32, 32, id.to_s)
  247. end
  248. #--------------------------------------------------------------------------
  249. # ● 敌人简介描绘
  250. #--------------------------------------------------------------------------
  251. def draw_enemy_other(enemy, x, y)
  252.    if CHARA_INFO[enemy.id]==nil
  253.     CHARA_INFO[enemy.id] = "没有相关资料"
  254.   end
  255.    self.contents.font.size=16
  256.    x+=self.contents.text_size("").width
  257.    info = CHARA_INFO[enemy.id]
  258.    s=info.scan(/./)
  259.     #一行显示21个字
  260.     for i in s
  261.       sss = self.contents.text_size(i)
  262.       
  263.       if  i==" "
  264.         y+=16
  265.         x=0
  266.       elsif (x+sss.width)>(width - 32-260)
  267.         y+=16
  268.         x=0
  269.         self.contents.draw_text(x, y, sss.width, sss.height, i)
  270.         x+=sss.width
  271.       else
  272.       self.contents.draw_text(x, y, sss.width, sss.height, i)
  273.       x+=sss.width
  274.       end
  275.     end
  276.   end
  277.    #--------------------------------------------------------------------------
  278. # ● 敌人特技描绘
  279. #--------------------------------------------------------------------------
  280. def draw_enemy_action(enemy, x, y)
  281.    self.contents.font.size=18
  282.    x = 360
  283.    y = 150
  284.    yy=y
  285.    self.contents.font.color = system_color
  286.    self.contents.draw_text(x, yy, 100, 24,"行动列表")
  287.    self.contents.font.color = normal_color
  288.    for action in enemy.actions
  289.      yy+=24
  290.      if action.kind==0
  291.        case action.basic
  292.         when 0
  293.           ac="攻击"
  294.         when 1
  295.           ac="防御"
  296.         when 2
  297.           ac="逃跑"
  298.         when 3
  299.           ac="不行动"
  300.         end
  301.      self.contents.draw_text(x, yy, 160, 24, ac )
  302.      end
  303.      if action.kind==1
  304.      self.contents.draw_text(x, yy, 160, 24, $data_skills[action.skill_id].name )
  305.      end
  306.    end
  307. end
  308. #雷达图描绘
  309.   #===================================================================
  310. #  def draw_actor_element_radar_graph(actor, x, y)
  311. #    radius = 56
  312. #cx = x + radius + FONT_SIZE + 48
  313. #cy = y + radius + FONT_SIZE + 32
  314. #self.contents.font.color = system_color
  315. #self.contents.draw_text(x, y, 104, 32, WORD_ELEMENT_GUARD)
  316. #for loop_i in 0..NUMBER_OF_ELEMENTS
  317. #if loop_i == 0

  318. #else
  319. #@pre_x = @now_x
  320. #@pre_y = @now_y
  321. #@pre_ex = @now_ex
  322. #@pre_ey = @now_ey
  323. #@color1 = @color2
  324. #end
  325. #if loop_i == NUMBER_OF_ELEMENTS
  326. #eo = ELEMENT_ORDER[0]
  327. #else
  328. #eo = ELEMENT_ORDER[loop_i]
  329. #end
  330. #er = actor.element_rate(eo)
  331. #estr = $data_system.elements[eo]
  332. #@color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR
  333. #if er <0
  334. #  then xsh=true
  335. #else xsh=false
  336. #end
  337. #er = er.abs
  338. #th = Math::PI * (0.5 - 2.0 * loop_i / NUMBER_OF_ELEMENTS)
  339. #@now_x = cx + (radius * Math.cos(th)).floor
  340. #@now_y = cy - (radius * Math.sin(th)).floor
  341. #@now_wx = cx + ((radius+FONT_SIZE*2/2) * Math.cos(th)).floor - FONT_SIZE
  342. #@now_wy = cy - ((radius+FONT_SIZE*1/2) * Math.sin(th)).floor - FONT_SIZE/2
  343. #@now_vx = cx + ((radius+FONT_SIZE*6/2) * Math.cos(th)).floor - FONT_SIZE
  344. #@now_vy = cy - ((radius+FONT_SIZE*3/2) * Math.sin(th)).floor - FONT_SIZE/2
  345. #@now_ex = cx + (er*radius/100 * Math.cos(th)).floor
  346. #@now_ey = cy - (er*radius/100 * Math.sin(th)).floor
  347. #if loop_i == 0
  348. #@pre_x = @now_x
  349. #@pre_y = @now_y
  350. #@pre_ex = @now_ex
  351. #@pre_ey = @now_ey
  352. #@color1 = @color2
  353. #else

  354. #end
  355. #next if loop_i == 0
  356. #self.contents.draw_line(cx+1,cy+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
  357. #self.contents.draw_line(@pre_x+1,@pre_y+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
  358. #self.contents.draw_line(cx,cy, @now_x,@now_y, GRAPH_SCALINE_COLOR)
  359. #self.contents.draw_line(@pre_x,@pre_y, @now_x,@now_y, GRAPH_SCALINE_COLOR)
  360. #self.contents.draw_line(@pre_ex,@pre_ey, @now_ex,@now_ey, @color1, 2, @color2)
  361. #self.contents.font.size = FONT_SIZE
  362. #if xsh == true
  363. #  then self.contents.font.color = Color.new(100,255,128,128)
  364. #  sdd="-"
  365. #else self.contents.font.color = system_color
  366. #  sdd=""
  367. #end
  368. #self.contents.draw_text(@now_wx,@now_wy, FONT_SIZE*2, FONT_SIZE, estr, 1)
  369. #self.contents.font.color = Color.new(255,255,255,128)
  370. #self.contents.draw_text(@now_vx,@now_vy, FONT_SIZE*2, FONT_SIZE, sdd+er.to_s + "%", 2)
  371. #end
  372. #end
  373. #_----------------------------------------------
  374. #def draw_race(enemy,x,y)
  375. #      text="无"
  376. #      text2="无"
  377. #      for i in 9..16
  378. #        if enemy.element_rate(i) == 200
  379. #        text = $data_system.elements[i]
  380. #       end
  381. #        if enemy.element_rate(i) == 150
  382. #        text2 =$data_system.elements[i]
  383. #        end
  384. #      end
  385. #      self.contents.font.color = system_color
  386. #      self.contents.draw_text(x, y, 80, 32,"主要种族")
  387. #      self.contents.font.color = normal_color
  388. #      self.contents.draw_text(x+80, y, 76, 32,text,2)
  389. #      self.contents.font.color = system_color
  390. #      self.contents.draw_text(x+160, y, 80, 32,"次要种族")
  391. #      self.contents.font.color = normal_color
  392. #      self.contents.draw_text(x+80+160, y, 76, 32,text2,2)
  393. #end
  394.   
  395. #--------------------------------------------------------------------------
  396. # ● エネミーの名前の描画
  397. #     enemy : エネミー
  398. #     x     : 描画先 X 座標
  399. #     y     : 描画先 Y 座標
  400. #--------------------------------------------------------------------------
  401. def draw_enemy_name(enemy, x, y)
  402.    self.contents.font.color = normal_color
  403.    self.contents.draw_text(x, y, 152, 32, enemy.name)
  404. end
  405. #--------------------------------------------------------------------------
  406. # ● エネミーグラフィックの描画(アナライズ)
  407. #     enemy : エネミー
  408. #     x     : 描画先 X 座標
  409. #     y     : 描画先 Y 座標
  410. #--------------------------------------------------------------------------
  411. def draw_enemy_graphic(enemy, x, y, opacity = 255)

  412. end
  413. #--------------------------------------------------------------------------
  414. # ● エネミーの獲得EXPの描画
  415. #     enemy : エネミー
  416. #     x     : 描画先 X 座標
  417. #     y     : 描画先 Y 座標
  418. #--------------------------------------------------------------------------
  419. def draw_enemy_exp(enemy, x, y)
  420.    self.contents.font.color = system_color
  421.    self.contents.draw_text(x, y, 120, 32, "经验")
  422.    self.contents.font.color = normal_color
  423.    self.contents.draw_text(x + 120, y, 36, 32, enemy.exp.to_s, 2)
  424. end
  425. #--------------------------------------------------------------------------
  426. # ● エネミーの獲得GOLDの描画
  427. #     enemy : エネミー
  428. #     x     : 描画先 X 座標
  429. #     y     : 描画先 Y 座標
  430. #--------------------------------------------------------------------------
  431. def draw_enemy_gold(enemy, x, y)
  432.    self.contents.font.color = system_color
  433.    self.contents.draw_text(x, y, 120, 32, "掉落金钱")
  434.    self.contents.font.color = normal_color
  435.    self.contents.draw_text(x + 120, y, 36, 32, enemy.gold.to_s, 2)
  436. end
  437. end

  438. class Game_Enemy_Book < Game_Enemy
  439. #--------------------------------------------------------------------------
  440. # ● オブジェクト初期化
  441. #--------------------------------------------------------------------------
  442. def initialize(enemy_id)
  443.    super(2, 1)#ダミー
  444.    @enemy_id = enemy_id
  445.    enemy = $data_enemies[@enemy_id]
  446.    @battler_name = enemy.battler_name
  447.    @battler_hue = enemy.battler_hue
  448.    @hp = maxhp
  449.    @sp = maxsp
  450. end
  451.   #--------------------------------------------------------------------------
  452.   # ● 获取名称
  453.   #--------------------------------------------------------------------------
  454.   def name
  455.     return $data_enemies[@enemy_id].name
  456.   end
  457. end

  458. class Data_MonsterBook
  459. attr_reader :id_data
  460. #--------------------------------------------------------------------------
  461. # ● オブジェクト初期化
  462. #--------------------------------------------------------------------------
  463. def initialize
  464.    @id_data = enemy_book_id_set
  465. end
  466. #--------------------------------------------------------------------------
  467. # ● 図鑑用登録無視属性取得
  468. #--------------------------------------------------------------------------
  469. def no_add_element
  470.    no_add = 0
  471.    # 登録無視の属性IDを取得
  472.    for i in 1...$data_system.elements.size
  473.      if $data_system.elements[i] =~ /不加入图鉴/
  474.        no_add = i
  475.        break
  476.      end
  477.    end
  478.    return no_add
  479. end
  480. #--------------------------------------------------------------------------
  481. # ● 図鑑用敵ID設定
  482. #--------------------------------------------------------------------------
  483. def enemy_book_id_set
  484.    data = [0]
  485.    no_add = no_add_element
  486.    # 登録無視の属性IDを取得
  487.    for i in 1...$data_enemies.size
  488.      enemy = $data_enemies[i]
  489.      next if enemy.name == ""
  490.      if enemy.element_ranks[no_add] == 1
  491.        next
  492.      end
  493.      data.push(enemy.id)
  494.    end
  495.    return data
  496. end
  497. end


  498. class Window_MonsterBook < Window_Selectable
  499. attr_reader   :data
  500. #--------------------------------------------------------------------------
  501. # ● オブジェクト初期化
  502. #--------------------------------------------------------------------------
  503. def initialize(index=0)
  504.    super(0, 64, 640, 416)
  505.    @column_max = 2
  506.    @book_data = $game_temp.enemy_book_data
  507.    @data = @book_data.id_data.dup
  508.    @data.shift
  509.    #@data.sort!
  510.    @item_max = @data.size
  511.    self.index = 0
  512.    refresh if @item_max > 0
  513. end
  514. #--------------------------------------------------------------------------
  515. # ● 遭遇データを取得
  516. #--------------------------------------------------------------------------
  517. def data_set
  518.    data = $game_party.enemy_info.keys
  519.    data.sort!
  520.    newdata = []
  521.    for i in data
  522.      next if $game_party.enemy_info[i] == 0
  523.      # 図鑑登録無視を考慮
  524.      if book_id(i) != nil
  525.        newdata.push(i)
  526.      end
  527.    end
  528.    return newdata
  529. end
  530. #--------------------------------------------------------------------------
  531. # ● 表示許可取得
  532. #--------------------------------------------------------------------------
  533. def show?(id)
  534.    if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
  535.      return false
  536.    else
  537.      return true
  538.    end
  539. end
  540. #--------------------------------------------------------------------------
  541. # ● 図鑑用ID取得
  542. #--------------------------------------------------------------------------
  543. def book_id(id)
  544.    return @book_data.index(id)
  545. end
  546. #--------------------------------------------------------------------------
  547. # ● エネミー取得
  548. #--------------------------------------------------------------------------
  549. def item
  550.    return @data[self.index]
  551. end
  552. #--------------------------------------------------------------------------
  553. # ● リフレッシュ
  554. #--------------------------------------------------------------------------
  555. def refresh
  556.    if self.contents != nil
  557.      self.contents.dispose
  558.      self.contents = nil
  559.    end
  560.    self.contents = Bitmap.new(width - 32, row_max * 32)
  561.    #項目数が 0 でなければビットマップを作成し、全項目を描画
  562.    if @item_max > 0
  563.      for i in 0...@item_max
  564.       draw_item(i)
  565.      end
  566.    end
  567. end
  568. #--------------------------------------------------------------------------
  569. # ● 項目の描画
  570. #     index : 項目番号
  571. #--------------------------------------------------------------------------
  572. def draw_item(index)
  573.    enemy = $data_enemies[@data[index]]
  574.    return if enemy == nil
  575.    x = 4 + index % 2 * (288 + 32)
  576.    y = index / 2 * 32
  577.    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  578.    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  579.    self.contents.font.color = normal_color
  580.    draw_enemy_book_id(enemy, x, y)
  581.    if show?(enemy.id)
  582.      self.contents.draw_text(x + 28+16, y, 212, 32, enemy.name, 0)
  583.    else
  584.      self.contents.draw_text(x + 28+16, y, 212, 32, "-----", 0)
  585.      return
  586.    end
  587.    if analyze?(@data[index])
  588.      self.contents.font.color = text_color(3)
  589.      self.contents.draw_text(x + 256, y, 24, 32, "済", 2)
  590.    end
  591. end
  592. #--------------------------------------------------------------------------
  593. # ● アナライズ済かどうか
  594. #--------------------------------------------------------------------------
  595. def analyze?(enemy_id)
  596.    if $game_party.enemy_info[enemy_id] == 2
  597.      return true
  598.    else
  599.      return false
  600.    end
  601. end
  602. end


  603. class Window_MonsterBook_Info < Window_Base
  604. include Enemy_Book_Config
  605. #--------------------------------------------------------------------------
  606. # ● オブジェクト初期化
  607. #--------------------------------------------------------------------------
  608. def initialize
  609.    super(0, 0+64, 640, 480-64)
  610.    self.back_opacity=255
  611.    self.contents = Bitmap.new(width - 32, height - 32)
  612.    
  613. end
  614. #--------------------------------------------------------------------------
  615. # ● リフレッシュ
  616. #--------------------------------------------------------------------------
  617. def refresh(enemy_id)
  618.    self.contents.clear
  619.    self.contents.font.size = 22
  620.    enemy = Game_Enemy_Book.new(enemy_id)
  621.    @gra = Sprite_Enemy_Graphic.new(nil,enemy)
  622.    @gra.z = 120      #怪物图片
  623.    draw_enemy_book_id(enemy, 4, 0)    #各种详细信息
  624.    draw_enemy_name(enemy, 48, 0)
  625.    draw_actor_hp(enemy, 288, 0)
  626.    draw_actor_sp(enemy, 288+160, 0)
  627.    self.contents.font.size=18
  628. #   draw_actor_parameter(enemy, 288    ,  25, 0)
  629.    self.contents.font.color = system_color
  630. #   self.contents.draw_text(288+160, 25, 120, 32, EVA_NAME)
  631.    self.contents.font.color = normal_color
  632. #   self.contents.draw_text(288+160 + 120, 25, 36, 32, enemy.eva.to_s, 2)
  633.    draw_actor_parameter(enemy, 288    ,  40, 3)
  634.    draw_actor_parameter(enemy, 288+160,  40, 4)
  635.    draw_actor_parameter(enemy, 288    ,  65, 5)
  636.    draw_actor_parameter(enemy, 288+160,  65, 6)
  637. #   draw_actor_parameter(enemy, 288    , 100, 1)
  638.    draw_actor_parameter(enemy, 288, 90, 2)
  639.    draw_enemy_exp(enemy, 288, 115)
  640.    draw_enemy_gold(enemy, 288+160, 115)
  641. #   draw_race(enemy, 288, 150)
  642.    #--------------------------------------------------------------------
  643.    draw_enemy_other(enemy, 0, 280)  #简介文字
  644.    draw_enemy_action(enemy,200, 30)  #显示敌人行动
  645. #   draw_actor_element_radar_graph(enemy, 360, 180)#雷达图
  646.    #--------------------------------------------------------------------
  647.    if DROP_ITEM_NEED_ANALYZE==true  #掉落物品
  648.      self.contents.font.color = system_color
  649.         self.contents.font.size=16
  650.      self.contents.draw_text(0, 235, 96, 32, "掉落物品")
  651.      draw_enemy_drop_item(enemy, 128, 235)
  652.      self.contents.font.color = normal_color
  653.         self.contents.font.size=18
  654.       end      
  655.     end
  656. def cl
  657.        @gra.dispose
  658. end
  659. #--------------------------------------------------------------------------
  660. # ● アナライズ済かどうか
  661. #--------------------------------------------------------------------------
  662. def analyze?(enemy_id)
  663.    if $game_party.enemy_info[enemy_id] == 2
  664.      return true
  665.    else
  666.      return false
  667.    end
  668. end
  669. end


  670. class Scene_MonsterBook
  671. include Enemy_Book_Config
  672. #--------------------------------------------------------------------------
  673. # ● メイン処理
  674. #--------------------------------------------------------------------------
  675. def main
  676.    $game_temp.enemy_book_data = Data_MonsterBook.new
  677.    # ウィンドウを作成
  678.    @title_window = Window_Base.new(0, 0, 640, 64)
  679.    @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
  680.    @title_window.contents.draw_text(4, 0, 320, 32, "降妖谱", 0)
  681.    if SHOW_COMPLETE_TYPE != 0
  682.      case SHOW_COMPLETE_TYPE
  683.      when 1
  684.        e_now = $game_party.enemy_book_now
  685.        e_max = $game_party.enemy_book_max
  686.        text = e_now.to_s + "/" + e_max.to_s
  687.      when 2
  688.        comp = $game_party.enemy_book_complete_percentage
  689.        text = comp.to_s + "%"
  690.      when 3
  691.        e_now = $game_party.enemy_book_now
  692.        e_max = $game_party.enemy_book_max
  693.        comp = $game_party.enemy_book_complete_percentage
  694.        text = e_now.to_s + "/" + e_max.to_s + " " + comp.to_s + "%"
  695.      end
  696.      if text != nil
  697.        @title_window.contents.draw_text(320, 0, 288, 32,  text, 2)
  698.      end
  699.    end
  700.    @main_window = Window_MonsterBook.new
  701.    @main_window.active = true
  702.    # インフォウィンドウを作成 (不可視・非アクティブに設定)
  703.    @info_window = Window_MonsterBook_Info.new
  704.    @info_window.z = 110
  705.    @info_window.visible = false
  706.    @info_window.active = false
  707.    @visible_index = 0
  708.    # トランジション実行
  709.    Graphics.transition
  710.    # メインループ
  711.    loop do
  712.      # ゲーム画面を更新
  713.      Graphics.update
  714.      # 入力情報を更新
  715.      Input.update
  716.      # フレーム更新
  717.      update
  718.      # 画面が切り替わったらループを中断
  719.      if $scene != self
  720.        break
  721.      end
  722.    end
  723.    # トランジション準備
  724.    Graphics.freeze
  725.    # ウィンドウを解放
  726.    @main_window.dispose
  727.    @info_window.dispose
  728.    @title_window.dispose
  729. end
  730. #--------------------------------------------------------------------------
  731. # ● フレーム更新
  732. #--------------------------------------------------------------------------
  733. def update
  734.    # ウィンドウを更新
  735.    @main_window.update
  736.    @info_window.update
  737. #   gra.update
  738.    if @info_window.active
  739.      update_info
  740.      return
  741.    end
  742.    # メインウィンドウがアクティブの場合: update_target を呼ぶ
  743.    if @main_window.active
  744.      update_main
  745.      return
  746.    end
  747. end
  748. #--------------------------------------------------------------------------
  749. # ● フレーム更新 (メインウィンドウがアクティブの場合)
  750. #--------------------------------------------------------------------------
  751. def update_main
  752.    # B ボタンが押された場合
  753.    if Input.trigger?(Input::B)
  754.      # キャンセル SE を演奏
  755.      $game_system.se_play($data_system.cancel_se)
  756.      $scene = Scene_Menu.new(4)
  757.      return
  758.    end
  759.    # C ボタンが押された場合
  760.    if Input.trigger?(Input::C)
  761.      if @main_window.item == nil or @main_window.show?(@main_window.item) == false
  762.        # ブザー SE を演奏
  763.        $game_system.se_play($data_system.buzzer_se)
  764.        return
  765.      end
  766.      # 決定 SE を演奏
  767.      $game_system.se_play($data_system.decision_se)
  768.      @main_window.active = false
  769.      @info_window.active = true
  770.      @info_window.visible = true
  771.      @visible_index = @main_window.index
  772.      @info_window.refresh(@main_window.item)
  773.      return
  774.    end
  775. end
  776. #--------------------------------------------------------------------------
  777. # ● フレーム更新 (インフォウィンドウがアクティブの場合)
  778. #--------------------------------------------------------------------------
  779. def update_info
  780.    # B ボタンが押された場合
  781.    if Input.trigger?(Input::B)
  782.      # キャンセル SE を演奏
  783.      $game_system.se_play($data_system.cancel_se)
  784.      @main_window.active = true
  785.      @info_window.active = false
  786.      @info_window.visible = false
  787.      @info_window.cl
  788.      return
  789.    end
  790.    # C ボタンが押された場合
  791.    if Input.trigger?(Input::C)
  792.      # 決定 SE を演奏
  793.      #$game_system.se_play($data_system.decision_se)
  794.      return
  795.    end
  796.    if Input.trigger?(Input::L)
  797.      # 決定 SE を演奏
  798.      $game_system.se_play($data_system.decision_se)
  799.      loop_end = false
  800.      while loop_end == false
  801.        if @visible_index != 0
  802.          @visible_index -= 1
  803.        else
  804.          @visible_index = @main_window.data.size - 1
  805.        end
  806.        loop_end = true if @main_window.show?(@main_window.data[@visible_index])
  807.      end
  808.      id = @main_window.data[@visible_index]
  809.      @info_window.refresh(id)
  810.      return
  811.    end
  812.    if Input.trigger?(Input::R)
  813.      # 決定 SE を演奏
  814.      $game_system.se_play($data_system.decision_se)
  815.      loop_end = false
  816.      while loop_end == false
  817.        if @visible_index != @main_window.data.size - 1
  818.          @visible_index += 1
  819.        else
  820.          @visible_index = 0
  821.        end
  822.        loop_end = true if @main_window.show?(@main_window.data[@visible_index])
  823.      end
  824.      id = @main_window.data[@visible_index]
  825.      @info_window.refresh(id)
  826.      return
  827.    end
  828. end
  829. end
  830. #==================================================================
  831. # 本脚本来自[url]http://www.66rpg.com/[/url],使用和转载请保留此信息
  832. #==================================================================
  833. class Sprite_Enemy_Graphic< Sprite
  834.   attr_accessor :enemy
  835.   #--------------------------------------------------------------------------
  836.   # ● オブジェクト初期化
  837.   #--------------------------------------------------------------------------
  838. def initialize(viewport,enemy)
  839.     super(viewport)
  840.     if @enemy != enemy
  841.       self.bitmap = RPG::Cache.battler(enemy.battler_name + "_2", enemy.battler_hue)
  842.       cw = self.bitmap.width
  843.       ch = self.bitmap.height
  844.     if cw>ch
  845.      self.zoom_x=1
  846.      self.zoom_y=1
  847.    else
  848.      self.zoom_x=1
  849.      self.zoom_y=1     
  850.    end
  851.      self.x=150-cw/2
  852.      self.y=210-ch/2
  853.       @enemy=enemy
  854.     end
  855.   end

  856.   #--------------------------------------------------------------------------
  857.   # ● 解放
  858.   #--------------------------------------------------------------------------
  859.   def dispose
  860.     if self.bitmap != nil
  861.       self.bitmap.dispose
  862.     end
  863.     super
  864.   end
  865.   #--------------------------------------------------------------------------
  866.   # ● フレーム更新
  867.   #--------------------------------------------------------------------------
  868.   def refresh(enemy)
  869.   end
  870. end
复制代码

老黄鸡

梦石
4
星屑
46133
在线时间
7978 小时
注册时间
2009-7-6
回帖
13342

MZ评测员RM创作大赛01组委会开拓者贵宾

发表于 2017-5-15 17:30:38 | 显示全部楼层
216行可以看到的。
$game_party.add_enemy_info(敌人编号, 0)

点评

爆炸 谢谢提醒!  发表于 2017-5-15 20:48

评分

参与人数 1星屑 +150 收起 理由
guoxiaomi + 150 塞糖

查看全部评分

RGDirect - DirectX驱动的RGSS,点我了解.
(排满,暂停)RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部