查看: 2080|回复: 4

[已经解决] 依旧是背景显示的问题……

[复制链接]

迷途知返,恍如隔世

梦石
0
星屑
488
在线时间
1355 小时
注册时间
2011-2-17
回帖
1173

开拓者

发表于 2015-10-1 19:18:44 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 Anson 于 2015-10-1 20:09 编辑

QQ截图20151001191231.png
选择列表页
QQ截图20151001191410.png
选择后(无法消除列表页,造成重叠)


使用的是魔物图鉴加强,出现了如图的问题,希望列表页有列表页的背景“handbook1.jpg”

然后点选一个怪物进入详情页之后显示背景“handbook2.jpg”(已实现),并且消除列表页显示。

  1. #================================================================
  2. # 本脚本来自[url]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=[]
  21. CHARA_INFO[1]="我是一号从,测试测试萌萌哒"
  22. CHARA_INFO[2]="我是二号从,测试测试萌萌哒"
  23. CHARA_INFO[3]="我是三号从,测试测试萌萌哒"
  24. CHARA_INFO[4]="我是四号从,测试测试萌萌哒"#怪物的介绍,对应怪物id,空格为换行,

  25. #同时也会自动换行,没有写介绍的怪物会自动显示“无详细信息”

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

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

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

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

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

  190. class Interpreter
  191. def enemy_book_max
  192.    return $game_party.enemy_book_max
  193. end
  194. def enemy_book_now
  195.    return $game_party.enemy_book_now
  196. end
  197. def enemy_book_comp
  198.    return $game_party.enemy_book_complete_percentage
  199. end
  200. end

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

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

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

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

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

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

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


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


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


  668. class Scene_MonsterBook
  669. include Enemy_Book_Config
  670. #--------------------------------------------------------------------------
  671. # ● メイン処理
  672. #--------------------------------------------------------------------------
  673. def main
  674.    $game_temp.enemy_book_data = Data_MonsterBook.new
  675.    # ウィンドウを作成
  676.    @title_window = Window_Base.new(0, 0, 640, 64)
  677.    @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
  678.    @title_window.contents.draw_text(4, 0, 320, 32, "", 0)
  679.    @title_window.opacity =0
  680.    if SHOW_COMPLETE_TYPE != 0
  681.      case SHOW_COMPLETE_TYPE
  682.      when 1
  683.        e_now = $game_party.enemy_book_now
  684.        e_max = $game_party.enemy_book_max
  685.        text = e_now.to_s + "/" + e_max.to_s
  686.      when 2
  687.        comp = $game_party.enemy_book_complete_percentage
  688.        text = comp.to_s + "%"
  689.      when 3
  690.        e_now = $game_party.enemy_book_now
  691.        e_max = $game_party.enemy_book_max
  692.        comp = $game_party.enemy_book_complete_percentage
  693.        text = e_now.to_s + "/" + e_max.to_s + " " + comp.to_s + "%"
  694.      end
  695.      if text != nil
  696.        @title_window.contents.draw_text(320, 0, 288, 32,  text, 2)
  697.      end
  698.    end
  699.    @main_window = Window_MonsterBook.new
  700.    @main_window.active = true
  701.    # インフォウィンドウを作成 (不可視・非アクティブに設定)
  702.    @info_window = Window_MonsterBook_Info.new
  703.    @info_window.z = 110
  704.    @info_window.opacity =0
  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(5)
  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]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, enemy.battler_hue)
  842.       cw = self.bitmap.width
  843.       ch = self.bitmap.height
  844.     if cw>ch
  845.      self.zoom_x=200.0/cw
  846.      self.zoom_y=200.0/cw
  847.    else
  848.      self.zoom_x=200.0/ch
  849.      self.zoom_y=200.0/ch     
  850.    end
  851.      self.x=10
  852.      self.y=110
  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
复制代码



工程文件: Project5.rar (513.45 KB, 下载次数: 50)

评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

梦石
0
星屑
1788
在线时间
1313 小时
注册时间
2012-8-4
回帖
724
发表于 2015-10-1 19:33:47 | 显示全部楼层
版主发一个模板上来,这样直接看好麻烦,试着在某处加一句 self.contents = nil试试

评分

参与人数 1星屑 +1 收起 理由
Anson + 1 已传

查看全部评分

回复

使用道具 举报

梦石
0
星屑
1788
在线时间
1313 小时
注册时间
2012-8-4
回帖
724
发表于 2015-10-1 22:29:07 | 显示全部楼层
1.png 2.png 3.png 4.png

Project5.rar

518.68 KB, 下载次数: 38

回复

使用道具 举报

梦石
0
星屑
1788
在线时间
1313 小时
注册时间
2012-8-4
回帖
724
发表于 2015-10-1 22:37:06 | 显示全部楼层
1.png 多了个属性有效度,而且背景图加上后看着不怎么清楚 2.png

Project5.rar

518.23 KB, 下载次数: 41

评分

参与人数 2星屑 +100 梦石 +1 收起 理由
RyanBern + 1 认可答案
Anson + 100 我很赞同

查看全部评分

回复

使用道具 举报

迷途知返,恍如隔世

梦石
0
星屑
488
在线时间
1355 小时
注册时间
2011-2-17
回帖
1173

开拓者

 楼主| 发表于 2015-10-1 23:53:03 | 显示全部楼层
夜狠简单 发表于 2015-10-1 22:37
多了个属性有效度,而且背景图加上后看着不怎么清楚

非常感谢!已经完美达成需要的效果(+ω+)
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部