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

Project1

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

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

[复制链接]

Lv2.观梦者 (版主)

迷途知返,恍如隔世

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

开拓者

跳转到指定楼层
1
发表于 2015-10-1 19:18:44 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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


选择列表页

选择后(无法消除列表页,造成重叠)


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

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

RUBY 代码复制
  1. #================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #===================================================================
  4. #——————————————————————————————————————
  5. #魔物图鉴+介绍
  6. #
  7. #战斗终了时自动添加敌人进入图鉴(class Scene_Battle start_phase5 追加。
  8.  
  9. #目前与各种战斗系统没有发现冲突)
  10. #不想加入图鉴的怪物设置其“不加入图鉴”属性有效度为A即可
  11. #图鉴完成度的表示功能追加
  12. #SHOW_COMPLETE_TYPE 的数值可以设定
  13. #当为1,显示现有个数/总数,当为2,显示完成百分比,当为3,全显示。
  14. #使用方法:$scene = Scene_MonsterBook.new
  15. #数据库中属性里面那些种族特效的位置,建议把默认的“对 不死”之类改成“不死”,
  16.  
  17. #不然显示会很奇怪
  18. #由于雷达图的设计问题,只支持8项属性
  19. #默认种族特效处理属性中编号9到编号16,
  20.  
  21. #如果你做了修改请自行改动380行左右的for i in 9..16这一句代码
  22. #显示各种信息位于630行左右,想不显示的话只要删除相应语句
  23. CHARA_INFO=[]
  24. CHARA_INFO[1]="我是一号从,测试测试萌萌哒"
  25. CHARA_INFO[2]="我是二号从,测试测试萌萌哒"
  26. CHARA_INFO[3]="我是三号从,测试测试萌萌哒"
  27. CHARA_INFO[4]="我是四号从,测试测试萌萌哒"#怪物的介绍,对应怪物id,空格为换行,
  28.  
  29. #同时也会自动换行,没有写介绍的怪物会自动显示“无详细信息”
  30.  
  31. #没有信息测试,4号怪物
  32. #=============
  33. #雷达图相关处理部分
  34. #=============
  35. class Bitmap
  36. def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  37. distance = (start_x - end_x).abs + (start_y - end_y).abs
  38. if end_color == start_color
  39. for i in 1..distance
  40. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  41. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  42. if width == 1
  43. self.set_pixel(x, y, start_color)
  44. else
  45. self.fill_rect(x, y, width, width, start_color)
  46. end
  47. end
  48. else
  49. for i in 1..distance
  50. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  51. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  52. r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  53. g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  54. b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  55. a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  56. if width == 1
  57. self.set_pixel(x, y, Color.new(r, g, b, a))
  58. else
  59. self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  60. end
  61. end
  62. end
  63. end
  64. end
  65. #=============
  66. # Graphic_Def_Elem
  67. #=============
  68. class Window_Base
  69. FONT_SIZE = 18
  70. WORD_ELEMENT_GUARD = "属性有效度"
  71. NUMBER_OF_ELEMENTS = 8
  72. ELEMENT_ORDER = [1,3,8,5,2,4,7,6]
  73. GRAPH_SCALINE_COLOR = Color.new(255, 255, 255, 128)
  74. GRAPH_SCALINE_COLOR_SHADOW = Color.new( 0, 0, 0, 192)
  75. GRAPH_LINE_COLOR = Color.new(255, 255, 64, 255)
  76. GRAPH_LINE_COLOR_MINUS = Color.new( 64, 255, 255, 255)
  77. GRAPH_LINE_COLOR_PLUS = Color.new(255, 64, 64, 255)
  78. end
  79.  
  80. #——————————————————————————————————————
  81. module Enemy_Book_Config
  82. DROP_ITEM_NEED_ANALYZE = true #显示物品
  83. EVA_NAME = "回避修正"              #回避修正的名称(因为数据库中没有定义)
  84. SHOW_COMPLETE_TYPE = 3         #图鉴完成率表示方法
  85. end
  86. class Data_MonsterBook
  87. #--------------------------------------------------------------------------
  88. # ● 图鉴用ID設定
  89. #--------------------------------------------------------------------------
  90. def enemy_book_id_set
  91.    data = [0]
  92.    data[1] = 2
  93.    data[2] = 1
  94.    data[3] = 15
  95.    data[4] = 25
  96.    data[5] = 18
  97.    data[6] = 30
  98.    return data
  99. end
  100. end
  101. class Game_Temp
  102. attr_accessor :enemy_book_data
  103. alias temp_enemy_book_data_initialize initialize
  104. def initialize
  105.    temp_enemy_book_data_initialize
  106.    @enemy_book_data = Data_MonsterBook.new
  107. end
  108. end
  109.  
  110. class Game_Party
  111. #==============================================
  112. #--------------------------------------------------------------------------
  113.   # ● 公開インスタンス変数
  114.   #--------------------------------------------------------------------------
  115.   attr_reader   :actors                   # アクター
  116.   attr_reader   :gold                     # ゴールド
  117.   attr_reader   :steps                    # 歩数
  118.   attr_accessor :mission                  # 任务★★★★★★★★★★★★★
  119.   attr_accessor   :pr                  # 当前章节数★★★★★★★★★★★★★
  120.   attr_reader   :prname
  121.   #--------------------------------------------------------------------------
  122.   # ● オブジェクト初期化
  123.   #--------------------------------------------------------------------------
  124.   def initialize
  125.     # アクターの配列を作成
  126.     @actors = []
  127.     # ゴールドと歩数を初期化
  128.     @gold = 0
  129.     @steps = 0
  130.     # アイテム、武器、防具の所持数ハッシュを作成
  131.     @items = {}
  132.     @weapons = {}
  133.     @armors = {}
  134.   end
  135. #==============================================
  136. attr_accessor :enemy_info               # 出会った敵情報(図鑑用)
  137.  
  138. #--------------------------------------------------------------------------
  139. # ● オブジェクト初期化
  140. #--------------------------------------------------------------------------
  141. alias book_info_initialize initialize
  142. def initialize
  143.    book_info_initialize
  144.    @enemy_info = {}
  145. end
  146.  
  147. #--------------------------------------------------------------------------
  148. # ● エネミー情報の追加(図鑑用)
  149. #     type : 通常遭遇かアナライズか 0:通常 1:アナライズ -1:情報削除
  150. #     0:無遭遇 1:遭遇済 2:アナライズ済
  151. #--------------------------------------------------------------------------
  152. def add_enemy_info(enemy_id, type = 0)
  153.    case type
  154.    when 0
  155.      if @enemy_info[enemy_id] == 2
  156.        return false
  157.      end
  158.      @enemy_info[enemy_id] = 1
  159.    when 1
  160.      @enemy_info[enemy_id] = 2
  161.    when -1
  162.      @enemy_info[enemy_id] = 0
  163.    end
  164. end
  165. #--------------------------------------------------------------------------
  166. # ● 魔物図鑑の最大登録数を取得
  167. #--------------------------------------------------------------------------
  168. def enemy_book_max
  169.    return $game_temp.enemy_book_data.id_data.size - 1
  170. end
  171. #--------------------------------------------------------------------------
  172. # ● 魔物図鑑の現在登録数を取得
  173. #--------------------------------------------------------------------------
  174. def enemy_book_now
  175.    now_enemy_info = @enemy_info.keys
  176.    # 登録無視の属性IDを取得
  177.    no_add = $game_temp.enemy_book_data.no_add_element
  178.    new_enemy_info = []
  179.    for i in now_enemy_info
  180.      enemy = $data_enemies[i]
  181.      next if enemy.name == ""
  182.      if enemy.element_ranks[no_add] == 1
  183.        next
  184.      end
  185.      new_enemy_info.push(enemy.id)
  186.    end
  187.    return new_enemy_info.size
  188. end
  189. #--------------------------------------------------------------------------
  190. # ● 魔物図鑑の完成率を取得
  191. #--------------------------------------------------------------------------
  192. def enemy_book_complete_percentage
  193.    e_max = enemy_book_max.to_f
  194.    e_now = enemy_book_now.to_f
  195.    comp = e_now / e_max * 100
  196.    return comp.truncate
  197. end
  198. end
  199.  
  200. class Interpreter
  201. def enemy_book_max
  202.    return $game_party.enemy_book_max
  203. end
  204. def enemy_book_now
  205.    return $game_party.enemy_book_now
  206. end
  207. def enemy_book_comp
  208.    return $game_party.enemy_book_complete_percentage
  209. end
  210. end
  211.  
  212. class Scene_Battle
  213. alias add_enemy_info_start_phase5 start_phase5
  214. def start_phase5
  215.    for enemy in $game_troop.enemies
  216.      # エネミーが隠れ状態でない場合
  217.      unless enemy.hidden
  218.        # 敵遭遇情報追加
  219.        $game_party.add_enemy_info(enemy.id, 0)
  220.      end
  221.    end
  222.    add_enemy_info_start_phase5
  223. end
  224. end
  225.  
  226. class Window_Base < Window
  227. #--------------------------------------------------------------------------
  228. # ● エネミーの戦闘後獲得アイテムの描画
  229. #--------------------------------------------------------------------------
  230. def draw_enemy_drop_item(enemy, x, y)
  231.    self.contents.font.color = normal_color
  232.    treasures = []
  233.    if enemy.item_id > 0
  234.      treasures.push($data_items[enemy.item_id])
  235.    end
  236.    if enemy.weapon_id > 0
  237.      treasures.push($data_weapons[enemy.weapon_id])
  238.    end
  239.    if enemy.armor_id > 0
  240.      treasures.push($data_armors[enemy.armor_id])
  241.    end
  242.    # 現状ではとりあえず1つのみ描画
  243.    if treasures.size > 0
  244.      item = treasures[0]
  245.      bitmap = RPG::Cache.icon(item.icon_name)
  246.      opacity = 255
  247.      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  248.      name = treasures[0].name
  249.    else
  250.      self.contents.font.color = disabled_color
  251.      name = "无"
  252.    end
  253.    self.contents.draw_text(x+28, y, 212, 32, name)
  254. end
  255. #--------------------------------------------------------------------------
  256. # ● エネミーの図鑑IDの描画
  257. #--------------------------------------------------------------------------
  258. def draw_enemy_book_id(enemy, x, y)
  259.    self.contents.font.color = normal_color
  260.    id = $game_temp.enemy_book_data.id_data.index(enemy.id)
  261.    self.contents.draw_text(x, y, 32, 32, id.to_s)
  262. end
  263. #--------------------------------------------------------------------------
  264. # ● 敌人简介描绘
  265. #--------------------------------------------------------------------------
  266. def draw_enemy_other(enemy, x, y)
  267.    if CHARA_INFO[enemy.id]==nil
  268.     CHARA_INFO[enemy.id] = "没有相关资料"
  269.   end
  270.    self.contents.font.size=16
  271.    x+=self.contents.text_size("").width
  272.    info = CHARA_INFO[enemy.id]
  273.    s=info.scan(/./)
  274.     #一行显示21个字
  275.     for i in s
  276.       sss = self.contents.text_size(i)
  277.  
  278.       if  i==" "
  279.         y+=16
  280.         x=0
  281.       elsif (x+sss.width)>(width - 32-260)
  282.         y+=16
  283.         x=0
  284.         self.contents.draw_text(x, y, sss.width, sss.height, i)
  285.         x+=sss.width
  286.       else
  287.       self.contents.draw_text(x, y, sss.width, sss.height, i)
  288.       x+=sss.width
  289.       end
  290.     end
  291.   end
  292.    #--------------------------------------------------------------------------
  293. # ● 敌人特技描绘
  294. #--------------------------------------------------------------------------
  295. def draw_enemy_action(enemy, x, y)
  296.    self.contents.font.size=16
  297.    yy=y
  298.    self.contents.font.color = system_color
  299.    self.contents.draw_text(x, yy, 80, 18,"行动列表")
  300.    self.contents.font.color = normal_color
  301.    for action in enemy.actions
  302.      yy+=18
  303.      if action.kind==0
  304.        case action.basic
  305.         when 0
  306.           ac="普通攻击"
  307.         when 1
  308.           ac="防御"
  309.         when 2
  310.           ac="逃跑"
  311.         when 3
  312.           ac="无"
  313.         end
  314.      self.contents.draw_text(x, yy, 160, 18, ac )
  315.      end
  316.      if action.kind==1
  317.      self.contents.draw_text(x, yy, 160, 18, $data_skills[action.skill_id].name )
  318.      end
  319.    end
  320. end
  321. #雷达图描绘
  322.   #===================================================================
  323.   def draw_actor_element_radar_graph(actor, x, y)
  324.     radius = 56
  325. cx = x + radius + FONT_SIZE + 48
  326. cy = y + radius + FONT_SIZE + 32
  327. self.contents.font.color = system_color
  328. self.contents.draw_text(x, y, 104, 32, WORD_ELEMENT_GUARD)
  329. for loop_i in 0..NUMBER_OF_ELEMENTS
  330. if loop_i == 0
  331.  
  332. else
  333. @pre_x = @now_x
  334. @pre_y = @now_y
  335. @pre_ex = @now_ex
  336. @pre_ey = @now_ey
  337. @color1 = @color2
  338. end
  339. if loop_i == NUMBER_OF_ELEMENTS
  340. eo = ELEMENT_ORDER[0]
  341. else
  342. eo = ELEMENT_ORDER[loop_i]
  343. end
  344. er = actor.element_rate(eo)
  345. estr = $data_system.elements[eo]
  346. @color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR
  347. if er <0
  348.   then xsh=true
  349. else xsh=false
  350. end
  351. er = er.abs
  352. th = Math::PI * (0.5 - 2.0 * loop_i / NUMBER_OF_ELEMENTS)
  353. @now_x = cx + (radius * Math.cos(th)).floor
  354. @now_y = cy - (radius * Math.sin(th)).floor
  355. @now_wx = cx + ((radius+FONT_SIZE*2/2) * Math.cos(th)).floor - FONT_SIZE
  356. @now_wy = cy - ((radius+FONT_SIZE*1/2) * Math.sin(th)).floor - FONT_SIZE/2
  357. @now_vx = cx + ((radius+FONT_SIZE*6/2) * Math.cos(th)).floor - FONT_SIZE
  358. @now_vy = cy - ((radius+FONT_SIZE*3/2) * Math.sin(th)).floor - FONT_SIZE/2
  359. @now_ex = cx + (er*radius/100 * Math.cos(th)).floor
  360. @now_ey = cy - (er*radius/100 * Math.sin(th)).floor
  361. if loop_i == 0
  362. @pre_x = @now_x
  363. @pre_y = @now_y
  364. @pre_ex = @now_ex
  365. @pre_ey = @now_ey
  366. @color1 = @color2
  367. else
  368.  
  369. end
  370. next if loop_i == 0
  371. self.contents.draw_line(cx+1,cy+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
  372. self.contents.draw_line(@pre_x+1,@pre_y+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
  373. self.contents.draw_line(cx,cy, @now_x,@now_y, GRAPH_SCALINE_COLOR)
  374. self.contents.draw_line(@pre_x,@pre_y, @now_x,@now_y, GRAPH_SCALINE_COLOR)
  375. self.contents.draw_line(@pre_ex,@pre_ey, @now_ex,@now_ey, @color1, 2, @color2)
  376. self.contents.font.size = FONT_SIZE
  377. if xsh == true
  378.   then self.contents.font.color = Color.new(100,255,128,128)
  379.   sdd="-"
  380. else self.contents.font.color = system_color
  381.   sdd=""
  382. end
  383. self.contents.draw_text(@now_wx,@now_wy, FONT_SIZE*2, FONT_SIZE, estr, 1)
  384. self.contents.font.color = Color.new(255,255,255,128)
  385. self.contents.draw_text(@now_vx,@now_vy, FONT_SIZE*2, FONT_SIZE, sdd+er.to_s + "%", 2)
  386. end
  387. end
  388. #_----------------------------------------------
  389. def draw_race(enemy,x,y)
  390.       text="无"
  391.       text2="无"
  392.       for i in 9..16
  393.         if enemy.element_rate(i) == 200
  394.         text = $data_system.elements[i]
  395.         end
  396.         if enemy.element_rate(i) == 150
  397.         text2 =$data_system.elements[i]
  398.         end
  399.       end
  400.       self.contents.font.color = system_color
  401.       self.contents.draw_text(x, y, 80, 32,"主要种族")
  402.       self.contents.font.color = normal_color
  403.       self.contents.draw_text(x+80, y, 76, 32,text,2)
  404.       self.contents.font.color = system_color
  405.       self.contents.draw_text(x+160, y, 80, 32,"次要种族")
  406.       self.contents.font.color = normal_color
  407.       self.contents.draw_text(x+80+160, y, 76, 32,text2,2)
  408. end
  409.  
  410. #--------------------------------------------------------------------------
  411. # ● エネミーの名前の描画
  412. #     enemy : エネミー
  413. #     x     : 描画先 X 座標
  414. #     y     : 描画先 Y 座標
  415. #--------------------------------------------------------------------------
  416. def draw_enemy_name(enemy, x, y)
  417.    self.contents.font.color = normal_color
  418.    self.contents.draw_text(x, y, 152, 32, enemy.name)
  419. end
  420. #--------------------------------------------------------------------------
  421. # ● エネミーグラフィックの描画(アナライズ)
  422. #     enemy : エネミー
  423. #     x     : 描画先 X 座標
  424. #     y     : 描画先 Y 座標
  425. #--------------------------------------------------------------------------
  426. def draw_enemy_graphic(enemy, x, y, opacity = 255)
  427.  
  428. end
  429. #--------------------------------------------------------------------------
  430. # ● エネミーの獲得EXPの描画
  431. #     enemy : エネミー
  432. #     x     : 描画先 X 座標
  433. #     y     : 描画先 Y 座標
  434. #--------------------------------------------------------------------------
  435. def draw_enemy_exp(enemy, x, y)
  436.    self.contents.font.color = system_color
  437.    self.contents.draw_text(x, y, 120, 32, "EXP")
  438.    self.contents.font.color = normal_color
  439.    self.contents.draw_text(x + 120, y, 36, 32, enemy.exp.to_s, 2)
  440. end
  441. #--------------------------------------------------------------------------
  442. # ● エネミーの獲得GOLDの描画
  443. #     enemy : エネミー
  444. #     x     : 描画先 X 座標
  445. #     y     : 描画先 Y 座標
  446. #--------------------------------------------------------------------------
  447. def draw_enemy_gold(enemy, x, y)
  448.    self.contents.font.color = system_color
  449.    self.contents.draw_text(x, y, 120, 32, "掉落金钱")
  450.    self.contents.font.color = normal_color
  451.    self.contents.draw_text(x + 120, y, 36, 32, enemy.gold.to_s, 2)
  452. end
  453. end
  454.  
  455. class Game_Enemy_Book < Game_Enemy
  456. #--------------------------------------------------------------------------
  457. # ● オブジェクト初期化
  458. #--------------------------------------------------------------------------
  459. def initialize(enemy_id)
  460.    super(2, 1)#ダミー
  461.    @enemy_id = enemy_id
  462.    enemy = $data_enemies[@enemy_id]
  463.    @battler_name = enemy.battler_name
  464.    @battler_hue = enemy.battler_hue
  465.    @hp = maxhp
  466.    @sp = maxsp
  467. end
  468. end
  469.  
  470. class Data_MonsterBook
  471. attr_reader :id_data
  472. #--------------------------------------------------------------------------
  473. # ● オブジェクト初期化
  474. #--------------------------------------------------------------------------
  475. def initialize
  476.    @id_data = enemy_book_id_set
  477. end
  478. #--------------------------------------------------------------------------
  479. # ● 図鑑用登録無視属性取得
  480. #--------------------------------------------------------------------------
  481. def no_add_element
  482.    no_add = 0
  483.    # 登録無視の属性IDを取得
  484.    for i in 1...$data_system.elements.size
  485.      if $data_system.elements[i] =~ /不加入图鉴/
  486.        no_add = i
  487.        break
  488.      end
  489.    end
  490.    return no_add
  491. end
  492. #--------------------------------------------------------------------------
  493. # ● 図鑑用敵ID設定
  494. #--------------------------------------------------------------------------
  495. def enemy_book_id_set
  496.    data = [0]
  497.    no_add = no_add_element
  498.    # 登録無視の属性IDを取得
  499.    for i in 1...$data_enemies.size
  500.      enemy = $data_enemies[i]
  501.      next if enemy.name == ""
  502.      if enemy.element_ranks[no_add] == 1
  503.        next
  504.      end
  505.      data.push(enemy.id)
  506.    end
  507.    return data
  508. end
  509. end
  510.  
  511.  
  512. class Window_MonsterBook < Window_Selectable
  513. attr_reader   :data
  514. #--------------------------------------------------------------------------
  515. # ● オブジェクト初期化
  516. #--------------------------------------------------------------------------
  517. def initialize(index=0)
  518.    super(0, 64, 640, 416)
  519.    self.opacity=0
  520.    @column_max = 2
  521.    @book_data = $game_temp.enemy_book_data
  522.    @data = @book_data.id_data.dup
  523.    @data.shift
  524.    #@data.sort!
  525.    @item_max = @data.size
  526.    self.index = 0
  527.    refresh if @item_max > 0
  528. end
  529. #--------------------------------------------------------------------------
  530. # ● 遭遇データを取得
  531. #--------------------------------------------------------------------------
  532. def data_set
  533.    data = $game_party.enemy_info.keys
  534.    data.sort!
  535.    newdata = []
  536.    for i in data
  537.      next if $game_party.enemy_info[i] == 0
  538.      # 図鑑登録無視を考慮
  539.      if book_id(i) != nil
  540.        newdata.push(i)
  541.      end
  542.    end
  543.    return newdata
  544. end
  545. #--------------------------------------------------------------------------
  546. # ● 表示許可取得
  547. #--------------------------------------------------------------------------
  548. def show?(id)
  549.    if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
  550.      return false
  551.    else
  552.      return true
  553.    end
  554. end
  555. #--------------------------------------------------------------------------
  556. # ● 図鑑用ID取得
  557. #--------------------------------------------------------------------------
  558. def book_id(id)
  559.    return @book_data.index(id)
  560. end
  561. #--------------------------------------------------------------------------
  562. # ● エネミー取得
  563. #--------------------------------------------------------------------------
  564. def item
  565.    return @data[self.index]
  566. end
  567. #--------------------------------------------------------------------------
  568. # ● リフレッシュ
  569. #--------------------------------------------------------------------------
  570. def refresh
  571.    if self.contents != nil
  572.      self.contents.dispose
  573.      self.contents = nil
  574.    end
  575.    self.contents = Bitmap.new(width - 32, row_max * 32)
  576.    #項目数が 0 でなければビットマップを作成し、全項目を描画
  577.    if @item_max > 0
  578.      for i in 0...@item_max
  579.       draw_item(i)
  580.      end
  581.    end
  582. end
  583. #--------------------------------------------------------------------------
  584. # ● 項目の描画
  585. #     index : 項目番号
  586. #--------------------------------------------------------------------------
  587. def draw_item(index)
  588.    enemy = $data_enemies[@data[index]]
  589.    return if enemy == nil
  590.    x = 4 + index % 2 * (288 + 32)
  591.    y = index / 2 * 32
  592.    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  593.    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  594.    self.contents.font.color = normal_color
  595.    draw_enemy_book_id(enemy, x, y)
  596.    if show?(enemy.id)
  597.      self.contents.draw_text(x + 28+16, y, 212, 32, enemy.name, 0)
  598.    else
  599.      self.contents.draw_text(x + 28+16, y, 212, 32, "-----", 0)
  600.      return
  601.    end
  602.    if analyze?(@data[index])
  603.      self.contents.font.color = text_color(3)
  604.      self.contents.draw_text(x + 256, y, 24, 32, "済", 2)
  605.    end
  606. end
  607. #--------------------------------------------------------------------------
  608. # ● アナライズ済かどうか
  609. #--------------------------------------------------------------------------
  610. def analyze?(enemy_id)
  611.    if $game_party.enemy_info[enemy_id] == 2
  612.      return true
  613.    else
  614.      return false
  615.    end
  616. end
  617. end
  618.  
  619.  
  620. class Window_MonsterBook_Info < Window_Base
  621. include Enemy_Book_Config
  622. #--------------------------------------------------------------------------
  623. # ● オブジェクト初期化
  624. #--------------------------------------------------------------------------
  625. def initialize
  626.    super(0, 0+64, 640, 480-64)
  627.    self.back_opacity=0
  628.    self.contents = Bitmap.new(width - 32, height - 32)
  629.  
  630. end
  631. #--------------------------------------------------------------------------
  632. # ● リフレッシュ
  633. #--------------------------------------------------------------------------
  634. def refresh(enemy_id)
  635.    self.contents.clear
  636.    self.contents.font.size = 22
  637.     @handbook = Sprite.new
  638.     @handbook.bitmap = RPG::Cache.picture("handbook2")
  639.    enemy = Game_Enemy_Book.new(enemy_id)
  640.    @gra = Sprite_Enemy_Graphic.new(nil,enemy)
  641.    @gra.z = 120      #怪物图片
  642.    draw_enemy_book_id(enemy, 4, 0)    #各种详细信息
  643.    draw_enemy_name(enemy, 48, 0)
  644.    draw_actor_hp(enemy, 288, 0)
  645.    draw_actor_sp(enemy, 288+160, 0)
  646.    self.contents.font.size=18
  647.    draw_actor_parameter(enemy, 288    ,  25, 0)
  648.    self.contents.font.color = system_color
  649.    self.contents.draw_text(288+160, 25, 120, 32, EVA_NAME)
  650.    self.contents.font.color = normal_color
  651.    self.contents.draw_text(288+160 + 120, 25, 36, 32, enemy.eva.to_s, 2)
  652.    draw_actor_parameter(enemy, 288    ,  50, 3)
  653.    draw_actor_parameter(enemy, 288+160,  50, 4)
  654.    draw_actor_parameter(enemy, 288    ,  75, 5)
  655.    draw_actor_parameter(enemy, 288+160,  75, 6)
  656.    draw_actor_parameter(enemy, 288    , 100, 1)
  657.    draw_actor_parameter(enemy, 288+160, 100, 2)
  658.    draw_enemy_exp(enemy, 288, 125)
  659.    draw_enemy_gold(enemy, 288+160, 125)
  660. #   draw_race(enemy, 288, 150)
  661.    #--------------------------------------------------------------------
  662.    draw_enemy_other(enemy, 0, 280)  #简介文字
  663.    draw_enemy_action(enemy,200, 30)  #显示敌人行动
  664.    draw_actor_element_radar_graph(enemy, 360, 180)#雷达图
  665.    #--------------------------------------------------------------------
  666.    if DROP_ITEM_NEED_ANALYZE==true  #掉落物品
  667.      self.contents.font.color = system_color
  668.         self.contents.font.size=16
  669.      self.contents.draw_text(0, 235, 96, 32, "掉落物品")
  670.      draw_enemy_drop_item(enemy, 128, 235)
  671.      self.contents.font.color = normal_color
  672.         self.contents.font.size=18
  673.       end      
  674.     end
  675. def cl
  676.        @gra.dispose
  677. end
  678. #--------------------------------------------------------------------------
  679. # ● アナライズ済かどうか
  680. #--------------------------------------------------------------------------
  681. def analyze?(enemy_id)
  682.    if $game_party.enemy_info[enemy_id] == 2
  683.      return true
  684.    else
  685.      return false
  686.    end
  687. end
  688. end
  689.  
  690.  
  691. class Scene_MonsterBook
  692. include Enemy_Book_Config
  693. #--------------------------------------------------------------------------
  694. # ● メイン処理
  695. #--------------------------------------------------------------------------
  696. def main
  697.    $game_temp.enemy_book_data = Data_MonsterBook.new
  698.    # ウィンドウを作成
  699.    @title_window = Window_Base.new(0, 0, 640, 64)
  700.    @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
  701.    @title_window.contents.draw_text(4, 0, 320, 32, "", 0)
  702.    @title_window.opacity =0
  703.    if SHOW_COMPLETE_TYPE != 0
  704.      case SHOW_COMPLETE_TYPE
  705.      when 1
  706.        e_now = $game_party.enemy_book_now
  707.        e_max = $game_party.enemy_book_max
  708.        text = e_now.to_s + "/" + e_max.to_s
  709.      when 2
  710.        comp = $game_party.enemy_book_complete_percentage
  711.        text = comp.to_s + "%"
  712.      when 3
  713.        e_now = $game_party.enemy_book_now
  714.        e_max = $game_party.enemy_book_max
  715.        comp = $game_party.enemy_book_complete_percentage
  716.        text = e_now.to_s + "/" + e_max.to_s + " " + comp.to_s + "%"
  717.      end
  718.      if text != nil
  719.        @title_window.contents.draw_text(320, 0, 288, 32,  text, 2)
  720.      end
  721.    end
  722.    @main_window = Window_MonsterBook.new
  723.    @main_window.active = true
  724.    # インフォウィンドウを作成 (不可視・非アクティブに設定)
  725.    @info_window = Window_MonsterBook_Info.new
  726.    @info_window.z = 110
  727.    @info_window.opacity =0
  728.    @info_window.visible = false
  729.    @info_window.active = false
  730.    @visible_index = 0
  731.    # トランジション実行
  732.    Graphics.transition
  733.    # メインループ
  734.    loop do
  735.      # ゲーム画面を更新
  736.      Graphics.update
  737.      # 入力情報を更新
  738.      Input.update
  739.      # フレーム更新
  740.      update
  741.      # 画面が切り替わったらループを中断
  742.      if $scene != self
  743.        break
  744.      end
  745.    end
  746.    # トランジション準備
  747.    Graphics.freeze
  748.    # ウィンドウを解放
  749.    @main_window.dispose
  750.    @info_window.dispose
  751.    @title_window.dispose
  752. end
  753. #--------------------------------------------------------------------------
  754. # ● フレーム更新
  755. #--------------------------------------------------------------------------
  756. def update
  757.    # ウィンドウを更新
  758.    @main_window.update
  759.    @info_window.update
  760. #   gra.update
  761.    if @info_window.active
  762.      update_info
  763.      return
  764.    end
  765.    # メインウィンドウがアクティブの場合: update_target を呼ぶ
  766.    if @main_window.active
  767.      update_main
  768.      return
  769.    end
  770. end
  771. #--------------------------------------------------------------------------
  772. # ● フレーム更新 (メインウィンドウがアクティブの場合)
  773. #--------------------------------------------------------------------------
  774. def update_main
  775.    # B ボタンが押された場合
  776.    if Input.trigger?(Input::B)
  777.      # キャンセル SE を演奏
  778.      $game_system.se_play($data_system.cancel_se)
  779.      $scene = Scene_Menu.new(5)
  780.      return
  781.    end
  782.    # C ボタンが押された場合
  783.    if Input.trigger?(Input::C)
  784.      if @main_window.item == nil or @main_window.show?(@main_window.item) == false
  785.        # ブザー SE を演奏
  786.        $game_system.se_play($data_system.buzzer_se)
  787.        return
  788.      end
  789.      # 決定 SE を演奏
  790.      $game_system.se_play($data_system.decision_se)
  791.      @main_window.active = false
  792.      @info_window.active = true
  793.      @info_window.visible = true
  794.      @visible_index = @main_window.index
  795.      @info_window.refresh(@main_window.item)
  796.      return
  797.    end
  798. end
  799. #--------------------------------------------------------------------------
  800. # ● フレーム更新 (インフォウィンドウがアクティブの場合)
  801. #--------------------------------------------------------------------------
  802. def update_info
  803.    # B ボタンが押された場合
  804.    if Input.trigger?(Input::B)
  805.      # キャンセル SE を演奏
  806.      $game_system.se_play($data_system.cancel_se)
  807.      @main_window.active = true
  808.      @info_window.active = false
  809.      @info_window.visible = false
  810.      @info_window.cl
  811.      return
  812.    end
  813.    # C ボタンが押された場合
  814.    if Input.trigger?(Input::C)
  815.      # 決定 SE を演奏
  816.      #$game_system.se_play($data_system.decision_se)
  817.      return
  818.    end
  819.    if Input.trigger?(Input::L)
  820.      # 決定 SE を演奏
  821.      $game_system.se_play($data_system.decision_se)
  822.      loop_end = false
  823.      while loop_end == false
  824.        if @visible_index != 0
  825.          @visible_index -= 1
  826.        else
  827.          @visible_index = @main_window.data.size - 1
  828.        end
  829.        loop_end = true if @main_window.show?(@main_window.data[@visible_index])
  830.      end
  831.      id = @main_window.data[@visible_index]
  832.      @info_window.refresh(id)
  833.      return
  834.    end
  835.    if Input.trigger?(Input::R)
  836.      # 決定 SE を演奏
  837.      $game_system.se_play($data_system.decision_se)
  838.      loop_end = false
  839.      while loop_end == false
  840.        if @visible_index != @main_window.data.size - 1
  841.          @visible_index += 1
  842.        else
  843.          @visible_index = 0
  844.        end
  845.        loop_end = true if @main_window.show?(@main_window.data[@visible_index])
  846.      end
  847.      id = @main_window.data[@visible_index]
  848.      @info_window.refresh(id)
  849.      return
  850.    end
  851. end
  852. end
  853. #==================================================================
  854. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  855. #==================================================================
  856. class Sprite_Enemy_Graphic< Sprite
  857.   attr_accessor :enemy
  858.   #--------------------------------------------------------------------------
  859.   # ● オブジェクト初期化
  860.   #--------------------------------------------------------------------------
  861.   def initialize(viewport,enemy)
  862.     super(viewport)
  863.     if @enemy != enemy
  864.       self.bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
  865.       cw = self.bitmap.width
  866.       ch = self.bitmap.height
  867.     if cw>ch
  868.      self.zoom_x=200.0/cw
  869.      self.zoom_y=200.0/cw
  870.    else
  871.      self.zoom_x=200.0/ch
  872.      self.zoom_y=200.0/ch     
  873.    end
  874.      self.x=10
  875.      self.y=110
  876.       @enemy=enemy
  877.     end
  878.   end
  879.   #--------------------------------------------------------------------------
  880.   # ● 解放
  881.   #--------------------------------------------------------------------------
  882.   def dispose
  883.     if self.bitmap != nil
  884.       self.bitmap.dispose
  885.     end
  886.     super
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ● フレーム更新
  890.   #--------------------------------------------------------------------------
  891.   def refresh(enemy)
  892.   end
  893. end



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

评分

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

查看全部评分

Lv3.寻梦者

梦石
0
星屑
1358
在线时间
1295 小时
注册时间
2012-8-4
帖子
749
2
发表于 2015-10-1 19:33:47 | 只看该作者
版主发一个模板上来,这样直接看好麻烦,试着在某处加一句 self.contents = nil试试

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1358
在线时间
1295 小时
注册时间
2012-8-4
帖子
749
3
发表于 2015-10-1 22:29:07 | 只看该作者

Project5.rar

518.68 KB, 下载次数: 38

回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1358
在线时间
1295 小时
注册时间
2012-8-4
帖子
749
4
发表于 2015-10-1 22:37:06 | 只看该作者
多了个属性有效度,而且背景图加上后看着不怎么清楚

Project5.rar

518.23 KB, 下载次数: 41

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者 (版主)

迷途知返,恍如隔世

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

开拓者

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

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-23 07:28

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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