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

Project1

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

[已经过期] 【悬赏200EXP】真诚请较修改一个道具图鉴脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
8 小时
注册时间
2008-5-8
帖子
430
跳转到指定楼层
1
发表于 2010-10-20 10:50:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
不知道悬赏是不是用这种格式,看到了别人这么用的我就这么发了。如果不对,劳烦版主
告知我一定及时更改。
我用了一个物品图鉴的脚本,链接是:
http://rpg.blue/web/htm/news191.htm
就是那个使用相对复杂的脚本,脚本调用方式:$scene = Scene_ItemBook.new
使用后经常在得到物品,购买物品,使用物品时报错:
stack level too deep
报错的时候弹道这里(得到道具时,得到武器时弹到weapon_count()哪里,有些废话了)
def add_item_count(item_id, type = 0)
    if type == -1
      @item_count[item_id] = 0
    else
      @item_count[item_id] = 1
    end
  end
而且吐血的是并非是新道具而是不管是不是新得的似乎只要进行到脚本这里就有一定几率报错
还是只一定几率,这个几率还不高……:dizzy:
我仔细看了看其他脚本,把一个怪物图鉴的脚本删了就没事了。
可是我不想删那个怪物脚本。怪物脚本是用的那个带雷达图的那个。我盯着看了好久也没有
看出有命名重复的地方,自己整合了一下也没成功。听别人说雷达图冲突多,把雷达图的信息全删了照样如此。我实在是无语了。
请教各位大大有什么办法啊?
或者告诉我有没有别的物品图鉴啊(也需要道具入手时再入图鉴的那种)
或者是怪物图鉴和道具图鉴的整合脚本夜行。
或者,能否把道具入图鉴的时机更改一下,比方说改成打开某个开关在判断是否有道具入库
,我就可以设计出一个npc,和他对话打开一个开关或者一个脚本后,在判断此刻角色身上的道具来调入道具图鉴也行啊。
请各位不吝赐教!
最后,还是发上脚本请各位看看:
道具图鉴的:
  1. # 脚本内容

  2. #==============================================================================
  3. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  4. #==============================================================================

  5. # ——————————————————————————————————
  6. # 66RPG说明:
  7. # 这是一个使用相对复杂的脚本,脚本调用方式:$scene = Scene_ItemBook.new
  8. #
  9. # 设置方式:
  10. # 首先进行物品分类,对于恢复类的物品,给物品添加上属性:“恢复”
  11. # 对于贵重类的物品,给物品添加属性:“贵重”
  12. #
  13. # 然后武器分类,默认情况下武器会全部加入图鉴,如果只想让一部分武器加入图鉴
  14. # 可以在@weapon_kind_element_name = []中添加武器属性名
  15. #
  16. # 然后是防具分类,对于想入图鉴的防具,盾类添加属性"盾",铠类添加属性"铠"
  17. # 其他类添加属性"其他"
  18. #
  19. # 由于属性中多了一些莫名其妙的东西,所以不能在图鉴的时候把所有属性显示出来
  20. # (显然,属性的作用很多,不能这么简单),所以需要手动设置
  21. # 在整个脚本中搜索elem_temp.push("炎") if elem == "炎" 这样的东西,把“炎”改为
  22. # 你需要显示的属性。至此全部完结。即可使用了。
  23. #
  24. # 其他,请最好仔细看一遍脚本,所有有用的地方都加了注释,而程序性的注释都删除了
  25. # 想来对于能够看懂这个脚本的人,一点点注释也是无关紧要的。
  26. #
  27. # ————————————————————————————————————


  28. module Item_Book_Config
  29.   SHOW_COMPLETE_TYPE = 1         # 图鉴完成率显示方法,一般不要动了
  30. end
  31. class Data_ItemBook
  32.   attr_reader :item_kind_name
  33.   attr_reader :weapon_kind_name
  34.   attr_reader :armor_kind_name
  35.   attr_reader :kind_row
  36.   attr_reader :item_id_data
  37.   attr_reader :weapon_id_data
  38.   attr_reader :armor_id_data
  39.   attr_reader :item_kind_element_name
  40.   attr_reader :weapon_kind_element_name
  41.   attr_reader :armor_kind_element_name
  42.   def initialize
  43.     @item_kind_name = ["普通物品", "贵重物品"]  #——物品分类的显示名,可以更改
  44.     @weapon_kind_name = ["武器"]                #——武器显示名
  45.     @armor_kind_name = ["防具", "徽章", "称号"]   #——防具显示名
  46.     @kind_row = ["普通物品",
  47.                  "武器",
  48.                  "防具",
  49.                  "徽章",
  50.                  "称号",
  51.                  "贵重物品"]                    #——程序用的显示名,无特殊要求
  52.                                                 #——和上面设置相同即可。
  53.     @item_kind_element_name = ["1类道具", "2类道具"]  #——物品用的分类属性名
  54.     @weapon_kind_element_name = []              #——武器用的属性名,留空则全入鉴
  55.     @armor_kind_element_name = ["防具", "徽章", "称号"]#-防具用的属性名
  56.     @item_id_data = item_book_id_set
  57.     @weapon_id_data = weapon_book_id_set
  58.     @armor_id_data = armor_book_id_set
  59.   end
  60.   def kind_search(name)
  61.     if @item_kind_name.include?(name)
  62.       return [0, @item_kind_name.index(name)]
  63.     elsif @weapon_kind_name.include?(name)
  64.       return [1, @weapon_kind_name.index(name)]
  65.     elsif @armor_kind_name.include?(name)
  66.       return [2, @armor_kind_name.index(name)]
  67.     end
  68.   end
  69.   ###############################################
  70.   def no_add_element
  71.     no_add = 0
  72.     for i in 1...$data_system.elements.size
  73.       if $data_system.elements[i] =~ /不加入图鉴/ #——不加入图鉴用的属性名
  74.         no_add = i                                #——建议在上面设置不要在这里
  75.         break
  76.       end
  77.     end
  78.     return no_add
  79.   end
  80.   #######################################
  81.   def element_search(element_name)
  82.     return nil if element_name == nil
  83.     for i in 1...$data_system.elements.size
  84.       if $data_system.elements[i] =~ /^#{element_name}/
  85.         return i
  86.       end
  87.     end
  88.   end
  89.   def item_book_id_set
  90.     data = []
  91.     no_add = no_add_element
  92.     if @item_kind_element_name.size == 0
  93.       data[0] = [0]
  94.       for i in 1...$data_items.size
  95.         item = $data_items[i]
  96.         next if item.name == ""
  97.         next if item.element_set.include?(no_add)
  98.         data[0].push(item.id)
  99.       end
  100.     else
  101.       for i in 0...@item_kind_element_name.size
  102.         data[i] = [0]
  103.         element_id = element_search(@item_kind_element_name[i])
  104.         for j in 1...$data_items.size
  105.           item = $data_items[j]
  106.           next if item.name == ""
  107.           next if item.element_set.include?(no_add)
  108.           if item.element_set.include?(element_id)
  109.             data[i].push(item.id)
  110.           end
  111.         end
  112.       end
  113.     end
  114.     return data
  115.   end
  116.   def weapon_book_id_set
  117.     data = []
  118.     no_add = no_add_element
  119.     if @weapon_kind_element_name.size == 0
  120.       data[0] = [0]
  121.       for i in 1...$data_weapons.size
  122.         item = $data_weapons[i]
  123.         next if item.name == ""
  124.         next if item.element_set.include?(no_add)
  125.         data[0].push(item.id)
  126.       end
  127.     else
  128.       for i in 0...@weapon_kind_element_name.size
  129.         data[i] = [0]
  130.         element_id = element_search(@weapon_kind_element_name[i])
  131.         for j in 1...$data_weapons.size
  132.           item = $data_weapons[j]
  133.           next if item.name == ""
  134.           next if item.element_set.include?(no_add)
  135.           if item.element_set.include?(element_id)
  136.             data[i].push(item.id)
  137.           end
  138.         end
  139.       end
  140.     end
  141.     return data
  142.   end
  143.   def armor_book_id_set
  144.     data = []
  145.     no_add = no_add_element
  146.     if @armor_kind_element_name.size == 0
  147.       data[0] = [0]
  148.       for i in 1...$data_armors.size
  149.         item = $data_armors[i]
  150.         next if item.name == ""
  151.         next if item.guard_element_set.include?(no_add)
  152.         data[0].push(item.id)
  153.       end
  154.     else
  155.       for i in 0...@armor_kind_element_name.size
  156.         data[i] = [0]
  157.         element_id = element_search(@armor_kind_element_name[i])
  158.         for j in 1...$data_armors.size
  159.           item = $data_armors[j]
  160.           next if item.name == ""
  161.           next if item.guard_element_set.include?(no_add)
  162.           if item.guard_element_set.include?(element_id)
  163.             data[i].push(item.id)
  164.           end
  165.         end
  166.       end
  167.     end
  168.     return data
  169.   end
  170. end
  171. class Window_Base < Window
  172.   def draw_attack_element(x, y, element_set)
  173.     elem_temp = []
  174.     for i in element_set
  175.       elem = $data_system.elements[i]       #——这些是基本属性设置
  176.       elem_temp.push("斩击") if elem == "斩击"  #——需要显示的属性在这里添加
  177.       elem_temp.push("冲击") if elem == "冲击"
  178.       elem_temp.push("射击") if elem == "射击"
  179.       elem_temp.push("圣光") if elem == "圣光"
  180.       elem_temp.push("高热") if elem == "高热"
  181.          elem_temp.push("吹雪") if elem == "吹雪"
  182.       elem_temp.push("电击") if elem == "电击"
  183.       elem_temp.push("暗黑") if elem == "暗黑"
  184.     end
  185.     if elem_temp.size == 0
  186.       self.contents.draw_text(x, y, 64, 32, "无属性")
  187.       return
  188.     end
  189.     ox = 0
  190.     for name in elem_temp
  191.       cx = self.contents.text_size(name).width
  192.       self.contents.draw_text(x+ox, y, cx, 32, name)
  193.       ox += cx+8
  194.     end
  195.   end
  196.   #--------------------------------------------------------------------------
  197.   # ● 武器属性表示
  198.   #--------------------------------------------------------------------------
  199. # def draw_attack_wp_element(x, y, element_set)
  200.   #  elem_temp = []
  201.    # for i in element_set
  202.     #  elem = $data_system.elements[i]      #——这里是武器的属性设置
  203.      # elem_temp.push("斬") if elem == "斬" #——可以自行添加
  204.      # elem_temp.push("打") if elem == "打"
  205.      # elem_temp.push("突") if elem == "突"
  206.      # elem_temp.push("射") if elem == "射"
  207.      # elem_temp.push("魔") if elem == "魔"
  208.    # end
  209.    # if elem_temp.size == 0
  210.    #   self.contents.draw_text(x, y, 64, 32, "无属性")
  211.    #   return
  212.    # end
  213.    # ox = 0
  214.    # for name in elem_temp
  215.    #   cx = self.contents.text_size(name).width
  216.    #   self.contents.draw_text(x+ox, y, cx, 32, name)
  217.     #  ox += cx+8
  218.    # end
  219.   #end
  220.   #--------------------------------------------------------------------------
  221.   # ● 特技属性表示
  222.   #--------------------------------------------------------------------------
  223.   def draw_attack_weak_element(x, y, element_set)
  224.     elem_temp = []
  225.     for i in element_set
  226.       elem = $data_system.elements[i]
  227.       elem_temp.push("水栖") if elem == "水栖"  #——这些是特技的属性设置
  228.       elem_temp.push("飞行")   if elem == "飞行"    #——也可以添加
  229.       elem_temp.push("软体") if elem == "软体"  #——注意这里用的是日文而不是
  230.       elem_temp.push("植物")   if elem == "植物"    #——中文,默认工程不认
  231.       elem_temp.push("人族")   if elem == "人族"
  232.       elem_temp.push("神族")   if elem == "神族"
  233.       elem_temp.push("龙族") if elem == "龙族"
  234.       elem_temp.push("恶魔") if elem == "対 恶魔"
  235.        elem_temp.push("不死") if elem == "不死"
  236.         elem_temp.push("机械") if elem == "机械"
  237.          elem_temp.push("百兽") if elem == "百兽"
  238.           elem_temp.push("元素") if elem == "元素"
  239.     end
  240.     if elem_temp.size == 0
  241.       self.contents.draw_text(x, y, 64, 32, "无属性")
  242.       return
  243.     end
  244.     ox = 0
  245.     for name in elem_temp
  246.       cx = self.contents.text_size(name).width
  247.       self.contents.draw_text(x+ox, y, cx, 32, name)
  248.       ox += cx+8
  249.     end
  250.   end
  251.   def draw_attack_add_state(x, y, plus_state_set)
  252.     state_temp = []
  253.     for i in plus_state_set
  254.       state = $data_states[i]
  255.       state_temp.push(state.name) if state.name != ""
  256.     end
  257.     if state_temp.size == 0
  258.       self.contents.draw_text(x, y, 64, 32, "无状态")
  259.       return
  260.     end
  261.     ox = 0
  262.     oy = 0
  263.     for name in state_temp
  264.       cx = self.contents.text_size(name).width
  265.       if ox + cx + 4 >= self.contents.width - 128
  266.         ox = 0
  267.         oy += 1
  268.       end
  269.       self.contents.draw_text(x+ox, y+oy*32, cx, 32, name)
  270.       ox += cx+8
  271.     end
  272.   end
  273.   def draw_scope(scope)
  274.     case scope
  275.     when 0
  276.       return "不能使用"
  277.     when 1
  278.       return "敌方单体"
  279.     when 2
  280.       return "敌方全体"
  281.     when 3
  282.       return "我方单体"
  283.     when 4
  284.       return "我方全体"
  285.     when 5
  286.       return "我方单体(HP 0)"
  287.     when 6
  288.       return "我方全体(HP 0)"
  289.     when 7
  290.       return "使用者"
  291.     end
  292.   end
  293. end
  294. #####################################################
  295. class Game_Temp
  296.   attr_accessor :item_book_data
  297.   alias temp_item_book_data_initialize initialize
  298.   def initialize
  299.     temp_item_book_data_initialize
  300.     @item_book_data = Data_ItemBook.new
  301.   end
  302. end
  303. #++++++++++++++++++++++++++++++++++++
  304. ############################################3
  305. ##########################################
  306. class Game_Party
  307.   attr_accessor :item_count              
  308.   attr_accessor :weapon_count           
  309.   attr_accessor :armor_count            
  310.   alias item_book_info_initialize initialize
  311.   def initialize
  312.     item_book_info_initialize
  313.     @item_count = {}
  314.     @weapon_count = {}
  315.     @armor_count = {}
  316.   end
  317.   alias item_book_gain_item gain_item
  318.   def gain_item(item_id, n)
  319.     add_item_count(item_id, 0) if n > 0
  320.     item_book_gain_item(item_id, n)
  321.   end
  322.   alias item_book_gain_weapon gain_weapon
  323.   def gain_weapon(item_id, n)
  324.     add_weapon_count(item_id, 0) if n > 0
  325.     item_book_gain_weapon(item_id, n)
  326.   end
  327.   alias item_book_gain_armor gain_armor
  328.   def gain_armor(item_id, n)
  329.     add_armor_count(item_id, 0) if n > 0
  330.     item_book_gain_armor(item_id, n)
  331.   end
  332.   def add_item_count(item_id, type = 0)
  333.    if type == -1
  334.       @item_count[item_id] = 0
  335.     else
  336.       @item_count[item_id] = 1
  337.     end
  338.   end
  339.   def add_weapon_count(weapon_id, type = 0)
  340.     if type == -1
  341.       @weapon_count[weapon_id] = 0
  342.     else
  343.       @weapon_count[weapon_id] = 1
  344.     end
  345.   end
  346.   def add_armor_count(armor_id, type = 0)
  347.     if type == -1
  348.       @armor_count[armor_id] = 0
  349.     else
  350.       @armor_count[armor_id] = 1
  351.     end
  352.   end
  353. ############################################3
  354. #####################################

  355.   #--------------------------------------------------------------------------
  356.   # ● 这里是图鉴最大登陆数,上面的内容是获得物品的时候加入图鉴
  357.   #--------------------------------------------------------------------------
  358.   def item_book_max
  359.     kind_data = []
  360.     kind_data[0] = $game_temp.item_book_data.item_kind_name
  361.     kind_data[1] = $game_temp.item_book_data.weapon_kind_name
  362.     kind_data[2] = $game_temp.item_book_data.armor_kind_name
  363.     size = 0
  364.     for i in 0..2
  365.       for kind in kind_data[i]
  366.         size += item_book_category_max(kind)
  367.       end
  368.     end
  369.     return size
  370.   end
  371.   def item_book_now
  372.     kind_data = []
  373.     kind_data[0] = $game_temp.item_book_data.item_kind_name
  374.     kind_data[1] = $game_temp.item_book_data.weapon_kind_name
  375.     kind_data[2] = $game_temp.item_book_data.armor_kind_name
  376.     size = 0
  377.     for i in 0..2
  378.       for kind in kind_data[i]
  379.         size += item_book_category_now(kind)
  380.       end
  381.     end
  382.     return size
  383.   end
  384.   def item_book_complete_percentage
  385.     i_max = item_book_max.to_f
  386.     i_now = item_book_now.to_f
  387.     comp = i_now / i_max * 100
  388.     return comp.truncate
  389.   end
  390.   def item_book_category_max(category)
  391.     kind_data = $game_temp.item_book_data.kind_search(category)
  392.     case kind_data[0]
  393.     when 0
  394.       id_data = $game_temp.item_book_data.item_id_data.dup
  395.     when 1
  396.       id_data = $game_temp.item_book_data.weapon_id_data.dup
  397.     when 2
  398.       id_data = $game_temp.item_book_data.armor_id_data.dup
  399.     end
  400.     index = kind_data[1]
  401.     size = id_data[index].size - 1
  402.     return size
  403.   end
  404.   def item_book_category_now(category)
  405.     kind_data = $game_temp.item_book_data.kind_search(category)
  406.     index = kind_data[1]
  407.     case kind_data[0]
  408.     when 0
  409.       now_item_info = @item_count.keys
  410.       elename = $game_temp.item_book_data.item_kind_element_name[index]
  411.       item_set = $data_items
  412.     when 1
  413.       now_item_info = @weapon_count.keys
  414.       elename = $game_temp.item_book_data.weapon_kind_element_name[index]
  415.       item_set = $data_weapons
  416.     when 2
  417.       now_item_info = @armor_count.keys
  418.       elename = $game_temp.item_book_data.armor_kind_element_name[index]
  419.       item_set = $data_armors
  420.     end
  421.     no_add = $game_temp.item_book_data.no_add_element
  422.     element_id = $game_temp.item_book_data.element_search(elename)
  423.     new_item_info = []
  424.     for i in now_item_info
  425.       item = item_set[i]
  426.       next if item == nil
  427.       next if item.name == ""  #——数据库中名称为空白的物品不添加
  428.       case item
  429.       when RPG::Item
  430.         ele_set = item.element_set
  431.       when RPG::Weapon
  432.         ele_set = item.element_set
  433.       when RPG::Armor
  434.         ele_set = item.guard_element_set
  435.       end
  436.       next if ele_set.include?(no_add)
  437.       if element_id == nil or ele_set.include?(element_id)
  438.         new_item_info.push(item.id)
  439.       end
  440.     end
  441.     return new_item_info.size
  442.   end
  443.   def item_book_category_complete_percentage(category)
  444.     i_max = item_book_category_max(category).to_f
  445.     i_now = item_book_category_now(category).to_f
  446.     comp = i_now / i_max * 100
  447.     return comp#.truncate
  448.   end
  449. end
  450. ####################
  451. class Interpreter
  452.   def item_book_max(category=nil)
  453.     if category == nil
  454.       return $game_party.item_book_max
  455.     else
  456.       return $game_party.item_book_category_max(category)
  457.     end
  458.   end
  459.   def item_book_now(category=nil)
  460.     if category == nil
  461.       return $game_party.item_book_now
  462.     else
  463.       return $game_party.item_book_category_now(category)
  464.     end
  465.   end
  466.   def item_book_comp(category=nil)
  467.     if category == nil
  468.       return $game_party.item_book_complete_percentage
  469.     else
  470.       return $game_party.item_book_category_complete_percentage(category)
  471.     end
  472.   end
  473. end
  474. #####################################################
  475. class Window_ItemBook < Window_Selectable
  476.   attr_reader   :data
  477.   attr_reader   :item_kind
  478.   attr_reader   :item_index
  479.   def initialize(index=0)
  480.     super(0, 64, 640, 416)
  481.     @column_max = 2
  482.     @book_data = $game_temp.item_book_data
  483.     @data = data_set(index)
  484.     @data.shift
  485.     #@data.sort!
  486.     @item_max = @data.size
  487.     @item_kind = index
  488.     self.index = 0
  489.     #refresh
  490.   end
  491.   def new_data_set(index)
  492.     @data = data_set(index)
  493.     @data.shift
  494.     #@data.sort!
  495.     @item_max = @data.size
  496.   end
  497.   def data_set(index)
  498.     kind_row_data = @book_data.kind_search(@book_data.kind_row[index])
  499.     @item_kind = kind_row_data[0]
  500.     @item_index = kind_row_data[1]
  501.     data = []
  502.     case @item_kind
  503.     when 0
  504.       data = @book_data.item_id_data[@item_index].dup
  505.     when 1
  506.       data = @book_data.weapon_id_data[@item_index].dup
  507.     when 2
  508.       data = @book_data.armor_id_data[@item_index].dup
  509.     end
  510.     return data
  511.   end
  512.   def show?(kind, id)
  513.     case kind
  514.     when 0
  515.       if $game_party.item_count[id] == 0 or $game_party.item_count[id] == nil
  516.         return false
  517.       else
  518.         return true
  519.       end
  520.     when 1
  521.       if $game_party.weapon_count[id] == 0 or $game_party.weapon_count[id] == nil
  522.         return false
  523.       else
  524.         return true
  525.       end
  526.     when 2
  527.       if $game_party.armor_count[id] == 0 or $game_party.armor_count[id] == nil
  528.         return false
  529.       else
  530.         return true
  531.       end
  532.     end
  533.   end
  534.   def item
  535.     return @data[self.index]
  536.   end
  537.   ############################
  538.   ##########################3
  539.   def refresh
  540.     if self.contents != nil
  541.       self.contents.dispose
  542.       self.contents = nil
  543.     end
  544.     ##############################33
  545.     return if @item_max == 0
  546.     self.contents = Bitmap.new(width - 32, row_max * 32)
  547.     for i in 0...@item_max
  548.       draw_item(i)
  549.     end
  550.   end
  551.   ############################################
  552.   def draw_item(index)
  553.     case @item_kind
  554.     when 0
  555.       item = $data_items[@data[index]]
  556.       id = @book_data.item_id_data[@item_index].index(item.id)
  557.     when 1
  558.       item = $data_weapons[@data[index]]
  559.       id = @book_data.weapon_id_data[@item_index].index(item.id)
  560.     when 2
  561.       item = $data_armors[@data[index]]
  562.       id = @book_data.armor_id_data[@item_index].index(item.id)
  563.     end
  564.     return if item == nil
  565.     x = 4 + index % 2 * (288 + 32)
  566.     y = index / 2 * 32
  567.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  568.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  569.     self.contents.font.color = normal_color
  570.     self.contents.draw_text(x, y, 32, 32, id.to_s)
  571.     if show?(@item_kind, item.id)
  572.       bitmap = RPG::Cache.icon(item.icon_name)
  573.       opacity = 255
  574.       self.contents.blt(x+48, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  575.       self.contents.draw_text(x+48 + 28, y, 212, 32, item.name, 0)
  576.     else
  577.       self.contents.draw_text(x+48 + 28, y, 212, 32, "-----", 0)
  578.       return
  579.     end
  580.   end
  581. end
  582. class Window_ItemBook_Info < Window_Selectable
  583.   def initialize
  584.     super(0, 0+64+64, 640, 480-64-64)
  585.     @book_data = $game_temp.item_book_data
  586.     self.contents = Bitmap.new(width - 32, height - 32)
  587.     self.index = -1
  588.   end
  589.   def refresh(item_id, item_kind, item_index)
  590.     self.contents.clear
  591.     self.contents.font.size = 22
  592.     case item_kind
  593.     when 0
  594.       draw_item_info(item_id, item_index)
  595.     when 1
  596.       draw_weapon_info(item_id, item_index)
  597.     when 2
  598.       draw_armor_info(item_id, item_index)
  599.     end
  600.   end
  601.   def draw_item_info(item_id, item_index)
  602.     item = $data_items[item_id]
  603.     rect = Rect.new(4, 0, 160, 32)
  604.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  605.     bitmap = RPG::Cache.icon(item.icon_name)
  606.     opacity = 255
  607.     self.contents.blt(4+48, 0 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  608.     self.contents.font.color = normal_color
  609.     id = @book_data.item_id_data[item_index].index(item.id)
  610.     self.contents.draw_text(4, 0, 32, 32, id.to_s)
  611.     self.contents.draw_text(4+48 + 28, 0, 212, 32, item.name, 0)
  612.     self.contents.draw_text(640-128-88-4, 0, 88, 32, item.price.to_s, 2)
  613.     self.contents.font.color = system_color
  614.     self.contents.draw_text(640-128, 0, 128, 32, $data_system.words.gold, 0)
  615.     self.contents.font.color = normal_color
  616.     @help_window.set_text(item.description)
  617.   end
  618.   def draw_weapon_info(item_id, item_index)
  619.     item = $data_weapons[item_id]
  620.     rect = Rect.new(4, 0, 160, 32)
  621.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  622.     bitmap = RPG::Cache.icon(item.icon_name)
  623.     opacity = 255
  624.     self.contents.blt(4+48, 0 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  625.     self.contents.font.color = normal_color
  626.     id = @book_data.weapon_id_data[item_index].index(item.id)
  627.     self.contents.draw_text(4, 0, 32, 32, id.to_s)
  628.     self.contents.draw_text(4+48 + 28, 0, 212, 32, item.name, 0)
  629.     self.contents.draw_text(640-128-88-4, 0, 88, 32, item.price.to_s, 2)
  630.     self.contents.font.color = system_color
  631.     self.contents.draw_text(640-128, 0, 128, 32, $data_system.words.gold, 0)
  632.     self.contents.font.color = text_color(2)
  633.     self.contents.draw_text(4, 32, 48, 32, "ATK", 0)
  634.     self.contents.font.color = text_color(4)
  635.     self.contents.draw_text(4+128, 32, 48, 32, "DEF", 0)
  636.     self.contents.font.color = text_color(6)
  637.     self.contents.draw_text(4+256, 32, 48, 32, "MDF", 0)
  638.     self.contents.font.color = normal_color
  639.     self.contents.draw_text(4+48, 32, 48, 32, item.atk.to_s, 2)
  640.     self.contents.draw_text(4+48+128, 32, 48, 32, item.pdef.to_s, 2)
  641.     self.contents.draw_text(4+48+256, 32, 48, 32, item.mdef.to_s, 2)
  642.     self.contents.font.color = system_color
  643.     self.contents.draw_text(4, 64, 48, 32, "STR", 0)
  644.     self.contents.draw_text(4+128, 64, 48, 32, "DEX", 0)
  645.     self.contents.draw_text(4+256, 64, 48, 32, "SPD", 0)
  646.     self.contents.draw_text(4+384, 64, 48, 32, "MAT", 0)
  647.     self.contents.font.color = normal_color
  648.     self.contents.draw_text(4+48, 64, 48, 32, item.str_plus.to_s, 2)
  649.     self.contents.draw_text(4+48+128, 64, 48, 32, item.dex_plus.to_s, 2)
  650.     self.contents.draw_text(4+48+256, 64, 48, 32, item.agi_plus.to_s, 2)
  651.     self.contents.draw_text(4+48+384, 64, 48, 32, item.int_plus.to_s, 2)
  652.     self.contents.font.color = system_color
  653.     self.contents.draw_text(4, 128, 96, 32, "属性攻击")
  654.     self.contents.draw_text(4, 192, 96, 32, "种族特效")
  655.     self.contents.draw_text(4, 160, 96, 32, "附加状态")
  656.     #self.contents.draw_text(4, 128, 96, 32, "武器属性")
  657.     self.contents.font.color = normal_color
  658.     draw_attack_element(4+96+16, 128, item.element_set)
  659.     draw_attack_weak_element(4+96+16, 192, item.element_set)
  660.     draw_attack_add_state(4+96+16, 160, item.plus_state_set)
  661.     #draw_attack_wp_element(4+96+16, 128, item.element_set)
  662.     @help_window.set_text(item.description)
  663.   end
  664.   def draw_armor_info(item_id, item_index)
  665.     item = $data_armors[item_id]
  666.     rect = Rect.new(4, 0, 160, 32)
  667.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  668.     bitmap = RPG::Cache.icon(item.icon_name)
  669.     opacity = 255
  670.     self.contents.blt(4+48, 0 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  671.     self.contents.font.color = normal_color
  672.     id = @book_data.armor_id_data[item_index].index(item.id)
  673.     self.contents.draw_text(4, 0, 32, 32, id.to_s)
  674.     self.contents.draw_text(4+48 + 28, 0, 212, 32, item.name, 0)
  675.     self.contents.draw_text(640-128-88-4, 0, 88, 32, item.price.to_s, 2)
  676.     self.contents.font.color = system_color
  677.     self.contents.draw_text(640-128, 0, 128, 32, $data_system.words.gold, 0)
  678.     self.contents.font.color = text_color(4)
  679.     self.contents.draw_text(4, 32, 48, 32, "DEF", 0)
  680.     self.contents.font.color = text_color(6)
  681.     self.contents.draw_text(4+128, 32, 48, 32, "MDF", 0)
  682.     self.contents.font.color = system_color
  683.     self.contents.draw_text(4+256, 32, 48, 32, "回避", 0)
  684.     self.contents.font.color = normal_color
  685.     self.contents.draw_text(4+48, 32, 48, 32, item.pdef.to_s, 2)
  686.     self.contents.draw_text(4+48+128, 32, 48, 32, item.mdef.to_s, 2)
  687.     self.contents.draw_text(4+48+256, 32, 48, 32, item.eva.to_s, 2)
  688.     self.contents.font.color = system_color
  689.     self.contents.draw_text(4, 64, 48, 32, "STR", 0)
  690.     self.contents.draw_text(4+128, 64, 48, 32, "DEX", 0)
  691.     self.contents.draw_text(4+256, 64, 48, 32, "SPD", 0)
  692.     self.contents.draw_text(4+384, 64, 48, 32, "MAT", 0)
  693.     self.contents.font.color = normal_color
  694.     self.contents.draw_text(4+48, 64, 48, 32, item.str_plus.to_s, 2)
  695.     self.contents.draw_text(4+48+128, 64, 48, 32, item.dex_plus.to_s, 2)
  696.     self.contents.draw_text(4+48+256, 64, 48, 32, item.agi_plus.to_s, 2)
  697.     self.contents.draw_text(4+48+384, 64, 48, 32, item.int_plus.to_s, 2)
  698.     self.contents.font.color = system_color
  699.     self.contents.draw_text(4, 128, 96, 32, "属性攻击")
  700.     #self.contents.draw_text(4, 128, 96, 32, "属性防御")
  701.     self.contents.draw_text(4, 160, 96, 32, "附加状态")
  702.     #self.contents.draw_text(4, 128, 96, 32, "武器耐性")
  703.     self.contents.font.color = normal_color
  704.     draw_attack_element(4+96+16, 128, item.guard_element_set)
  705.     #draw_attack_weak_element(4+96+16, 128, item.guard_element_set)
  706.     draw_attack_add_state(4+96+16, 160, item.guard_state_set)
  707.     #draw_attack_wp_element(4+96+16, 128, item.guard_element_set)
  708.    
  709.     @help_window.set_text(item.description)
  710.   end
  711.   def update_help
  712.   end
  713. end

  714. ###################################3
  715. ######################################
  716. ##################################
  717. class Scene_ItemBook
  718.   include Item_Book_Config
  719.   def main
  720.     # ウィンドウを作成
  721.     @title_window = Window_Base.new(0, 0, 640, 64)
  722.     @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
  723.     @title_window.contents.draw_text(4, 0, 320, 32, "物品图鉴", 0)
  724.     draw_comp
  725.     @main_window = Window_ItemBook.new
  726.     @main_window.active = false
  727.     @main_window.index = -1
  728.     @help_window = Window_Help.new
  729.     @help_window.z = 110
  730.     @help_window.y = 64
  731.     @help_window.visible = false
  732.     command = $game_temp.item_book_data.kind_row
  733.     @kind_window = Window_Command.new(160, command)
  734.     @kind_window.z = 110
  735.     @kind_window.x = 320 - @kind_window.width / 2
  736.     @kind_window.y = 240 - @kind_window.height / 2
  737.     @kind_window.active = true
  738.     @info_window = Window_ItemBook_Info.new
  739.     @info_window.z = 110
  740.     @info_window.visible = false
  741.     @info_window.active = false
  742.     @info_window.help_window = @help_window
  743.     @visible_index = 0
  744.     @now_kind = nil
  745.     Graphics.transition
  746.     loop do
  747.       Graphics.update
  748.       Input.update
  749.       update
  750.       if $scene != self
  751.         break
  752.       end
  753.     end
  754.     Graphics.freeze
  755.     @title_window.dispose
  756.     @help_window.dispose
  757.     @main_window.dispose
  758.     @kind_window.dispose
  759.     @info_window.dispose
  760.   end
  761.   def update
  762.     @main_window.update
  763.     @kind_window.update
  764.     @info_window.update
  765.     if @info_window.active
  766.       update_info
  767.       return
  768.     end
  769.     if @main_window.active
  770.       update_main
  771.       return
  772.     end
  773.     if @kind_window.active
  774.       update_kind
  775.       return
  776.     end
  777.   end
  778.   def update_kind
  779.     if Input.trigger?(Input::C)
  780.       $game_system.se_play($data_system.decision_se)
  781.       if @now_kind != @kind_window.index
  782.         @main_window.new_data_set(@kind_window.index)
  783.         @main_window.refresh
  784.         @now_kind = @kind_window.index
  785.       end
  786.       subtitle = $game_temp.item_book_data.kind_row[@kind_window.index]
  787.       title = "物品图鉴:"+subtitle
  788.       @title_window.contents.clear
  789.       @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
  790.       @title_window.contents.draw_text(4, 0, 320, 32, title, 0)
  791.       draw_comp(subtitle)
  792.       @kind_window.active = false
  793.       @kind_window.visible = false
  794.       @main_window.active = true
  795.       @main_window.index = 0
  796.       return
  797.     end
  798.     if Input.trigger?(Input::B)
  799.       $game_system.se_play($data_system.cancel_se)
  800.       $scene = Scene_Map.new
  801.       return
  802.     end
  803.   end
  804.   def update_main
  805.     if Input.trigger?(Input::B)
  806.       $game_system.se_play($data_system.cancel_se)
  807.       @main_window.active = false
  808.       @kind_window.active = true
  809.       @kind_window.visible = true
  810.       @main_window.index = -1
  811.       @title_window.contents.clear
  812.       @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
  813.       @title_window.contents.draw_text(4, 0, 320, 32, "物品图鉴", 0)
  814.       draw_comp
  815.       return
  816.     end
  817.     if Input.trigger?(Input::C)
  818.       if @main_window.item == nil or
  819.          @main_window.show?(@main_window.item_kind, @main_window.item) == false
  820.         $game_system.se_play($data_system.buzzer_se)
  821.         return
  822.       end
  823.       $game_system.se_play($data_system.decision_se)
  824.       @main_window.active = false
  825.       @info_window.active = true
  826.       @info_window.visible = true
  827.       @visible_index = @main_window.index
  828.       @info_window.refresh(@main_window.item, @main_window.item_kind, @main_window.item_index)
  829.       return
  830.     end
  831.   end
  832.   def update_info
  833.     if Input.trigger?(Input::B)
  834.       $game_system.se_play($data_system.cancel_se)
  835.       @main_window.active = true
  836.       @info_window.active = false
  837.       @info_window.visible = false
  838.       @help_window.visible = false
  839.       return
  840.     end
  841.     if Input.trigger?(Input::C)
  842.       $game_system.se_play($data_system.decision_se)
  843.       return
  844.     end
  845.     if Input.trigger?(Input::L)
  846.       $game_system.se_play($data_system.decision_se)
  847.       loop_end = false
  848.       while loop_end == false
  849.         if @visible_index != 0
  850.           @visible_index -= 1
  851.         else
  852.           @visible_index = @main_window.data.size - 1
  853.         end
  854.         loop_end = true if @main_window.show?(@main_window.item_kind,@main_window.data[@visible_index])
  855.       end
  856.       id = @main_window.data[@visible_index]
  857.       @info_window.refresh(id, @main_window.item_kind, @main_window.item_index)
  858.       return
  859.     end
  860.     if Input.trigger?(Input::R)
  861.       $game_system.se_play($data_system.decision_se)
  862.       loop_end = false
  863.       while loop_end == false
  864.         if @visible_index != @main_window.data.size - 1
  865.           @visible_index += 1
  866.         else
  867.          @visible_index = 0
  868.         end
  869.         loop_end = true if @main_window.show?(@main_window.item_kind,@main_window.data[@visible_index])
  870.       end
  871.       id = @main_window.data[@visible_index]
  872.       @info_window.refresh(id, @main_window.item_kind, @main_window.item_index)
  873.       return
  874.     end
  875.   end
  876.   def draw_comp(category=nil)
  877.     if SHOW_COMPLETE_TYPE != 0
  878.       if category == nil
  879.         case SHOW_COMPLETE_TYPE
  880.         when 1
  881.           i_now = $game_party.item_book_now
  882.           i_max = $game_party.item_book_max
  883.           text = i_now.to_s + "/" + i_max.to_s
  884.         when 2
  885.           comp = $game_party.item_book_complete_percentage
  886.           text = comp.to_s + "%"
  887.         when 3
  888.           i_now = $game_party.item_book_now
  889.           i_max = $game_party.item_book_max
  890.           comp = $game_party.item_book_complete_percentage
  891.           text = i_now.to_s + "/" + i_max.to_s + " " + comp.to_s + "%"
  892.         end
  893.       else
  894.         case SHOW_COMPLETE_TYPE
  895.         when 1
  896.           i_now = $game_party.item_book_category_now(category)
  897.           i_max = $game_party.item_book_category_max(category)
  898.           text = i_now.to_s + "/" + i_max.to_s
  899.         when 2
  900.           comp = $game_party.item_book_category_complete_percentage(category)
  901.           text = comp.to_s + "%"
  902.         when 3
  903.           i_now = $game_party.item_book_category_now(category)
  904.           i_max = $game_party.item_book_category_max(category)
  905.           comp = $game_party.item_book_category_complete_percentage(category)
  906.           text = i_now.to_s + "/" + i_max.to_s + " " + comp.to_s + "%"
  907.         end
  908.       end
  909.       if text != nil
  910.         @title_window.contents.draw_text(320, 0, 288, 32,  text, 2)
  911.       end
  912.     end
  913.   end
  914. end


  915. #==============================================================================
  916. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  917. #==============================================================================

复制代码
怪物图鉴的
  1. #自动显示各种能力参数
  2. #显示各种信息位于630行左右,想不显示某些信息的话只要删除相应语句就可以罗!
  3. #雷达式元素属性有效度图
  4. #自动显示怪物种族(由9到16号属性有效度得出,支持一个主要种族和一个次要种族)
  5. #允许自写怪物介绍(缩小了字体,一般都够写了......)
  6. #自动显示敌方行动列表
  7. #图鉴显示完成度
  8. #允许怪物不加入图鉴中
  9. #怪物图象自动缩放适合窗口大小
  10. #使用方法:直接加入可以,尽量靠近main(下面)
  11. #调用方法:$scene = Scene_MonsterBook.new
  12. #冲突报告:较少,不过有class Game_Party,对于其他动了这里的脚本可能需要整合
  13. #(其实这所谓整合只要复制粘贴就可以......)
  14. #================================================================
  15. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  16. #===================================================================
  17. #——————————————————————————————————————
  18. #魔物图鉴+介绍
  19. #
  20. #战斗终了时自动添加敌人进入图鉴(class Scene_Battle start_phase5 追加。

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

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

  31. #如果你做了修改请自行改动380行左右的for i in 9..16这一句代码
  32. #显示各种信息位于630行左右,想不显示的话只要删除相应语句
  33. CHARA_INFO=[]#怪物的介绍,对应怪物id,空格为换行,
  34. ############################################################3
  35. ###############################################################
  36. #注意!务必要把数据库中队伍2的任务塞满,否则会报错
  37. #############################################################
  38. #####################################################
  39. #同时也会自动换行,没有写介绍的怪物会自动显示“无详细信息”
  40. CHARA_INFO[1] = "免疫:咒杀;石化;病气 抵抗:全部(效果大) "
  41. CHARA_INFO[2] = "免疫:无 抵抗:无"
  42. CHARA_INFO[3] = "免疫:无 抵抗:无"
  43. CHARA_INFO[4] = "免疫:毒;病气 抵抗:无"
  44. CHARA_INFO[5] = "免疫:无 抵抗:无"
  45. CHARA_INFO[6] = "免疫:无 抵抗:石化;失明"
  46. CHARA_INFO[7] = "免疫:无 抵抗:无"
  47. CHARA_INFO[8] = "免疫:无 抵抗:无"
  48. CHARA_INFO[9] = "免疫:无 抵抗:无"
  49. CHARA_INFO[10] = "免疫:钝足 抵抗:无"
  50. CHARA_INFO[11] = "免疫:无 抵抗:无"
  51. CHARA_INFO[12] = "免疫:石化;猛毒;狂乱;病气;麻痹;睡眠 抵抗:无"
  52. CHARA_INFO[13] = "免疫:无 抵抗:石化;失明"
  53. CHARA_INFO[14] = "免疫:钝足;猛毒 抵抗:无"
  54. CHARA_INFO[15] = "免疫:无 抵抗:无"
  55. CHARA_INFO[16] = "免疫:无 抵抗:无"
  56. CHARA_INFO[17] = "免疫:无 抵抗:石化;失明"
  57. CHARA_INFO[18] = "免疫:无 抵抗:无"
  58. CHARA_INFO[19] = "免疫:无 抵抗:无"
  59. CHARA_INFO[20] = "免疫:钝足;魅惑 抵抗:无"
  60. CHARA_INFO[21] = "免疫:钝足;魅惑 抵抗:无"
  61. CHARA_INFO[22] = "免疫:咒杀;病气 抵抗:全部(效果小)"
  62. CHARA_INFO[23] = "免疫:无 抵抗:无"
  63. CHARA_INFO[24] = "免疫:无 抵抗:无"
  64. CHARA_INFO[25] = "免疫:无 抵抗:无"
  65. CHARA_INFO[25] = "免疫:无 抵抗:无"
  66. CHARA_INFO[26] = "免疫:无 抵抗:无"
  67. CHARA_INFO[27] = "免疫:无 抵抗:无"
  68. CHARA_INFO[29] = "免疫:全部(咒杀 石化除外) 抵抗:咒杀 石化"
  69. CHARA_INFO[31] = "免疫:无 抵抗:全部(效果小)"
  70. CHARA_INFO[32] = "免疫:无 抵抗:钝足 失明"
  71. CHARA_INFO[33] = "免疫:猛毒 钝足 抵抗:无"
  72. CHARA_INFO[34] = "免疫:全部(咒杀 石化除外) 抵抗:无"
  73. CHARA_INFO[35] = "免疫:无 抵抗:无"
  74. CHARA_INFO[36] = "免疫:猛毒 病气 抵抗:无"
  75. CHARA_INFO[37] = "免疫:无 抵抗:无"
  76. CHARA_INFO[38] = "免疫:无 抵抗:无"
  77. CHARA_INFO[39] = "免疫:无 抵抗:无"
  78. CHARA_INFO[40] = "免疫:无 抵抗:无"
  79. CHARA_INFO[41] = "免疫:无 抵抗:无"
  80. CHARA_INFO[42] = "免疫:无 抵抗:无"
  81. CHARA_INFO[43] = "免疫:无 抵抗:失明 狂战士 石化"
  82. CHARA_INFO[44] = "免疫:全部(咒杀 石化除外) 抵抗:无"
  83. CHARA_INFO[45] = "免疫:猛毒 病气 虚弱 狂战士 抵抗:麻痹 狂乱"
  84. CHARA_INFO[46] = "免疫:无 抵抗:钝足 失明"
  85. CHARA_INFO[47] = "免疫:无 抵抗:无"
  86. CHARA_INFO[48] = "免疫:无 抵抗:全部(猛毒除外)"
  87. CHARA_INFO[49] = "免疫:无 抵抗:全部(猛毒除外)"
  88. CHARA_INFO[50] = "免疫:全部(猛毒 失明除外) 抵抗:无"
  89. CHARA_INFO[51] = "免疫:咒杀 石化 虚弱 抵抗:全部(猛毒除外)"
  90. CHARA_INFO[52] = "免疫:全部 抵抗:"
  91. CHARA_INFO[53] = "免疫:石化 失明 虚弱 抵抗:无"
  92. CHARA_INFO[54] = "免疫:病气 虚弱 抵抗:全部(效果大)"
  93. CHARA_INFO[55] = "免疫:狂乱 睡眠 麻痹 抵抗:无"
  94. CHARA_INFO[56] = "免疫:狂乱 睡眠 麻痹 抵抗:无"
  95. CHARA_INFO[57] = "免疫:狂乱 睡眠 麻痹 抵抗:全部(效果大)"
  96. CHARA_INFO[58] = "免疫:行动系 钝足 失明 睡眠 抵抗:无"
  97. CHARA_INFO[59] = "免疫:失明 石化 抵抗:全部(效果小)"
  98. CHARA_INFO[60] = "免疫:无   抵抗:行动系,沉默(效果大)"
  99. CHARA_INFO[61] = "免疫:全部 抵抗:无"
  100. CHARA_INFO[62] = "免疫:猛毒 病气 失明 咒杀  抵抗:无"
  101. CHARA_INFO[63] = "免疫:咒杀 石化  抵抗:全部(效果大)"


  102. #没有信息测试,4号怪物
  103. #=============
  104. #雷达图相关处理部分
  105. #=============
  106. class Bitmap
  107. def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  108. distance = (start_x - end_x).abs + (start_y - end_y).abs
  109. if end_color == start_color
  110. for i in 1..distance
  111. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  112. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  113. if width == 1
  114. self.set_pixel(x, y, start_color)
  115. else
  116. self.fill_rect(x, y, width, width, start_color)
  117. end
  118. end
  119. else
  120. for i in 1..distance
  121. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  122. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  123. r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  124. g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  125. b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  126. a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  127. if width == 1
  128. self.set_pixel(x, y, Color.new(r, g, b, a))
  129. else
  130. self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  131. end
  132. end
  133. end
  134. end
  135. end
  136. #=============
  137. # Graphic_Def_Elem
  138. #=============
  139. class Window_Base
  140. FONT_SIZE = 18
  141. WORD_ELEMENT_GUARD = "属性有效度"
  142. NUMBER_OF_ELEMENTS = 8
  143. ELEMENT_ORDER = [1,3,8,5,2,4,7,6]
  144. GRAPH_SCALINE_COLOR = Color.new(255, 255, 255, 128)
  145. GRAPH_SCALINE_COLOR_SHADOW = Color.new( 0, 0, 0, 192)
  146. GRAPH_LINE_COLOR = Color.new(255, 255, 64, 255)
  147. GRAPH_LINE_COLOR_MINUS = Color.new( 64, 255, 255, 255)
  148. GRAPH_LINE_COLOR_PLUS = Color.new(255, 64, 64, 255)
  149. end

  150. #——————————————————————————————————————
  151. module Enemy_Book_Config
  152. DROP_ITEM_NEED_ANALYZE = true #显示物品
  153. EVA_NAME = "回避修正"              #回避修正的名称(因为数据库中没有定义)
  154. SHOW_COMPLETE_TYPE = 3         #图鉴完成率表示方法
  155. end
  156. class Data_MonsterBook
  157. #--------------------------------------------------------------------------
  158. # ● 图鉴用ID設定
  159. #--------------------------------------------------------------------------
  160. def enemy_book_id_set
  161.    data = [0]
  162.    data[1] = 2
  163.    data[2] = 1
  164.    data[3] = 15
  165.    data[4] = 25
  166.    data[5] = 18
  167.    data[6] = 30
  168.    return data
  169. end
  170. end
  171. class Game_Temp
  172. attr_accessor :enemy_book_data
  173. alias temp_enemy_book_data_initialize initialize
  174. def initialize
  175.    temp_enemy_book_data_initialize
  176.    @enemy_book_data = Data_MonsterBook.new
  177. end
  178. end

  179. class Game_Party
  180. #==============================================
  181. #--------------------------------------------------------------------------
  182.   # ● 公開インスタンス変数
  183.   #--------------------------------------------------------------------------
  184.   #attr_reader   :actors                   # アクター
  185. # attr_reader   :gold                     # ゴールド
  186. # attr_reader   :steps                    # 歩数
  187. # attr_accessor :mission                  # 任务★★★★★★★★★★★★★
  188.   #attr_accessor   :pr                  # 当前章节数★★★★★★★★★★★★★
  189.   #attr_reader   :prname
  190.   #--------------------------------------------------------------------------
  191.   # ● オブジェクト初期化
  192.   #--------------------------------------------------------------------------
  193.   #def initialize
  194.     # アクターの配列を作成
  195.    # @actors = []
  196.     # ゴールドと歩数を初期化
  197.    # @gold = 0
  198.    # @steps = 0
  199.     # アイテム、武器、防具の所持数ハッシュを作成
  200.    # @items = {}
  201.    # @weapons = {}
  202.    #@armors = {}
  203.   #end
  204. #==============================================
  205. attr_accessor :enemy_info               # 出会った敵情報(図鑑用)

  206. #--------------------------------------------------------------------------
  207. # ● オブジェクト初期化
  208. #--------------------------------------------------------------------------
  209. alias book_info_initialize initialize
  210. def initialize
  211.    book_info_initialize
  212.    @enemy_info = {}
  213. end

  214. #--------------------------------------------------------------------------
  215. # ● エネミー情報の追加(図鑑用)
  216. #     type : 通常遭遇かアナライズか 0:通常 1:アナライズ -1:情報削除
  217. #     0:無遭遇 1:遭遇済 2:アナライズ済
  218. #--------------------------------------------------------------------------
  219. def add_enemy_info(enemy_id, type = 0)
  220.    case type
  221.    when 0
  222.      if @enemy_info[enemy_id] == 2
  223.        return false
  224.      end
  225.      @enemy_info[enemy_id] = 1
  226.    when 1
  227.      @enemy_info[enemy_id] = 2
  228.    when -1
  229.      @enemy_info[enemy_id] = 0
  230.    end
  231. end
  232. #--------------------------------------------------------------------------
  233. # ● 魔物図鑑の最大登録数を取得
  234. #--------------------------------------------------------------------------
  235. def enemy_book_max
  236.    return $game_temp.enemy_book_data.id_data.size - 1
  237. end
  238. #--------------------------------------------------------------------------
  239. # ● 魔物図鑑の現在登録数を取得
  240. #--------------------------------------------------------------------------
  241. def enemy_book_now
  242. now_enemy_info = @enemy_info.keys
  243. #    登録無視の属性IDを取得
  244.   no_add = $game_temp.enemy_book_data.no_add_element
  245.    new_enemy_info = []
  246.    for i in now_enemy_info
  247.      enemy = $data_enemies[i]
  248.      next if enemy.name == ""
  249.    if enemy.element_ranks[no_add] == 1
  250.        next
  251.      end
  252.      new_enemy_info.push(enemy.id)
  253.    end
  254.    return new_enemy_info.size
  255. end
  256. #--------------------------------------------------------------------------
  257. # ● 魔物図鑑の完成率を取得
  258. #--------------------------------------------------------------------------
  259. def enemy_book_complete_percentage
  260.    e_max = enemy_book_max.to_f
  261.    e_now = enemy_book_now.to_f
  262.    comp = e_now / e_max * 100
  263.    return comp.truncate
  264. end
  265. end

  266. class Interpreter
  267. def enemy_book_max
  268.    return $game_party.enemy_book_max
  269. end
  270. def enemy_book_now
  271.    return $game_party.enemy_book_now
  272. end
  273. def enemy_book_comp
  274.    return $game_party.enemy_book_complete_percentage
  275. end
  276. end

  277. class Scene_Battle
  278. alias add_enemy_info_start_phase5 start_phase5
  279. def start_phase5
  280.    for enemy in $game_troop.enemies
  281.      # エネミーが隠れ状態でない場合
  282.      unless enemy.hidden
  283.        # 敵遭遇情報追加
  284.        $game_party.add_enemy_info(enemy.id, 0)
  285.      end
  286.    end
  287.    add_enemy_info_start_phase5
  288. end
  289. end

  290. class Window_Base < Window
  291. #--------------------------------------------------------------------------
  292. # ● エネミーの戦闘後獲得アイテムの描画
  293. #--------------------------------------------------------------------------
  294. def draw_enemy_drop_item(enemy, x, y)
  295.    self.contents.font.color = normal_color
  296.    treasures = []
  297.    if enemy.item_id > 0
  298.      treasures.push($data_items[enemy.item_id])
  299.    end
  300.    if enemy.weapon_id > 0
  301.      treasures.push($data_weapons[enemy.weapon_id])
  302.    end
  303.    if enemy.armor_id > 0
  304.      treasures.push($data_armors[enemy.armor_id])
  305.    end
  306.    # 現状ではとりあえず1つのみ描画
  307.    if treasures.size > 0
  308.      item = treasures[0]
  309.      bitmap = RPG::Cache.icon(item.icon_name)
  310.      opacity = 255
  311.      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  312.      name = treasures[0].name
  313.    else
  314.      self.contents.font.color = disabled_color
  315.      name = "无"
  316.    end
  317.    self.contents.draw_text(x+28, y, 212, 32, name)
  318. end
  319. #--------------------------------------------------------------------------
  320. # ● エネミーの図鑑IDの描画
  321. #--------------------------------------------------------------------------
  322. def draw_enemy_book_id(enemy, x, y)
  323.    self.contents.font.color = normal_color
  324.    id = $game_temp.enemy_book_data.id_data.index(enemy.id)
  325.    self.contents.draw_text(x, y, 32, 32, id.to_s)
  326. end
  327. #--------------------------------------------------------------------------
  328. # ● 敌人简介描绘
  329. #--------------------------------------------------------------------------
  330. def draw_enemy_other(enemy, x, y)
  331.    if CHARA_INFO[enemy.id]==nil
  332.     CHARA_INFO[enemy.id] = "没有相关资料"
  333.   end
  334.    self.contents.font.size=16
  335.    x+=self.contents.text_size("").width
  336.    info = CHARA_INFO[enemy.id]
  337.    s=info.scan(/./)
  338.     #一行显示21个字
  339.     for i in s
  340.       sss = self.contents.text_size(i)
  341.       
  342.       if  i==" "
  343.         y+=16
  344.         x=0
  345.       elsif (x+sss.width)>(width - 32-260)
  346.         y+=16
  347.         x=0
  348.         self.contents.draw_text(x, y, sss.width, sss.height, i)
  349.         x+=sss.width
  350.       else
  351.       self.contents.draw_text(x, y, sss.width, sss.height, i)
  352.       x+=sss.width
  353.       end
  354.     end
  355.   end
  356.    #--------------------------------------------------------------------------
  357. # ● 敌人特技描绘
  358. #--------------------------------------------------------------------------
  359. def draw_enemy_action(enemy, x, y)
  360.    self.contents.font.size=16
  361.    yy=y
  362.    self.contents.font.color = system_color
  363.    self.contents.draw_text(x, yy, 80, 18,"行动列表")
  364.    self.contents.font.color = normal_color
  365.    for action in enemy.actions
  366.      yy+=18
  367.      if action.kind==0
  368.        case action.basic
  369.         when 0
  370.           ac="普通攻击"
  371.         when 1
  372.           ac="防御"
  373.         when 2
  374.           ac="逃跑"
  375.         when 3
  376.           ac="无"
  377.         end
  378.      self.contents.draw_text(x, yy, 160, 18, ac )
  379.      end
  380.      if action.kind==1
  381.      self.contents.draw_text(x, yy, 160, 18, $data_skills[action.skill_id].name )
  382.      end
  383.    end
  384. end
  385. #雷达图描绘
  386.   #===================================================================
  387.   def draw_actor_element_radar_graph(actor, x, y)
  388.     radius = 56
  389. cx = x + radius + FONT_SIZE + 48
  390. cy = y + radius + FONT_SIZE + 32
  391. self.contents.font.color = system_color
  392. self.contents.draw_text(x, y, 104, 32, WORD_ELEMENT_GUARD)
  393. for loop_i in 0..NUMBER_OF_ELEMENTS
  394. if loop_i == 0

  395. else
  396. @pre_x = @now_x
  397. @pre_y = @now_y
  398. @pre_ex = @now_ex
  399. @pre_ey = @now_ey
  400. @color1 = @color2
  401. end
  402. if loop_i == NUMBER_OF_ELEMENTS
  403. eo = ELEMENT_ORDER[0]
  404. else
  405. eo = ELEMENT_ORDER[loop_i]
  406. end
  407. er = actor.element_rate(eo)
  408. estr = $data_system.elements[eo]
  409. @color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR
  410. if er <0
  411.   then xsh=true
  412. else xsh=false
  413. end
  414. er = er.abs
  415. th = Math::PI * (0.5 - 2.0 * loop_i / NUMBER_OF_ELEMENTS)
  416. @now_x = cx + (radius * Math.cos(th)).floor
  417. @now_y = cy - (radius * Math.sin(th)).floor
  418. @now_wx = cx + ((radius+FONT_SIZE*2/2) * Math.cos(th)).floor - FONT_SIZE
  419. @now_wy = cy - ((radius+FONT_SIZE*1/2) * Math.sin(th)).floor - FONT_SIZE/2
  420. @now_vx = cx + ((radius+FONT_SIZE*6/2) * Math.cos(th)).floor - FONT_SIZE
  421. @now_vy = cy - ((radius+FONT_SIZE*3/2) * Math.sin(th)).floor - FONT_SIZE/2
  422. @now_ex = cx + (er*radius/100 * Math.cos(th)).floor
  423. @now_ey = cy - (er*radius/100 * Math.sin(th)).floor
  424. if loop_i == 0
  425. @pre_x = @now_x
  426. @pre_y = @now_y
  427. @pre_ex = @now_ex
  428. @pre_ey = @now_ey
  429. @color1 = @color2
  430. else

  431. end
  432. next if loop_i == 0
  433. self.contents.draw_line(cx+1,cy+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
  434. self.contents.draw_line(@pre_x+1,@pre_y+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
  435. self.contents.draw_line(cx,cy, @now_x,@now_y, GRAPH_SCALINE_COLOR)
  436. self.contents.draw_line(@pre_x,@pre_y, @now_x,@now_y, GRAPH_SCALINE_COLOR)
  437. self.contents.draw_line(@pre_ex,@pre_ey, @now_ex,@now_ey, @color1, 2, @color2)
  438. self.contents.font.size = FONT_SIZE
  439. if xsh == true
  440.   then self.contents.font.color = Color.new(100,255,128,128)
  441.   sdd="-"
  442. else self.contents.font.color = system_color
  443.   sdd=""
  444. end
  445. self.contents.draw_text(@now_wx,@now_wy, FONT_SIZE*2, FONT_SIZE, estr, 1)
  446. self.contents.font.color = Color.new(255,255,255,128)
  447. self.contents.draw_text(@now_vx,@now_vy, FONT_SIZE*2, FONT_SIZE, sdd+er.to_s + "%", 2)
  448. end
  449. end
  450. #_----------------------------------------------
  451. def draw_race(enemy,x,y)
  452.       text="无"
  453.       text2="无"
  454.       for i in 9..20
  455.         if enemy.element_rate(i) == 200
  456.         text = $data_system.elements[i]
  457.         end
  458.         if enemy.element_rate(i) == 150
  459.         text2 =$data_system.elements[i]
  460.         end
  461.       end
  462.       self.contents.font.color = system_color
  463.       self.contents.draw_text(x, y, 80, 32,"种族")
  464.       self.contents.font.color = normal_color
  465.       self.contents.draw_text(x+80, y, 76, 32,text,2)
  466.       self.contents.font.color = system_color
  467.       self.contents.draw_text(x+160, y, 80, 32,"拟态种族")
  468.       self.contents.font.color = normal_color
  469.       self.contents.draw_text(x+80+160, y, 76, 32,text2,2)
  470. end
  471.   
  472. #--------------------------------------------------------------------------
  473. # ● エネミーの名前の描画
  474. #     enemy : エネミー
  475. #     x     : 描画先 X 座標
  476. #     y     : 描画先 Y 座標
  477. #--------------------------------------------------------------------------
  478. def draw_enemy_name(enemy, x, y)
  479.    self.contents.font.color = normal_color
  480.    self.contents.draw_text(x, y, 152, 32, enemy.name)
  481. end
  482. #--------------------------------------------------------------------------
  483. # ● エネミーグラフィックの描画(アナライズ)
  484. #     enemy : エネミー
  485. #     x     : 描画先 X 座標
  486. #     y     : 描画先 Y 座標
  487. #--------------------------------------------------------------------------
  488. def draw_enemy_graphic(enemy, x, y, opacity = 255)

  489. end
  490. #--------------------------------------------------------------------------
  491. # ● エネミーの獲得EXPの描画
  492. #     enemy : エネミー
  493. #     x     : 描画先 X 座標
  494. #     y     : 描画先 Y 座標
  495. #--------------------------------------------------------------------------
  496. def draw_enemy_exp(enemy, x, y)
  497.    self.contents.font.color = system_color
  498.    self.contents.draw_text(x, y, 120, 32, "EXP")
  499.    self.contents.font.color = normal_color
  500.    self.contents.draw_text(x + 120, y, 36, 32, enemy.exp.to_s, 2)
  501. end
  502. #--------------------------------------------------------------------------
  503. # ● エネミーの獲得GOLDの描画
  504. #     enemy : エネミー
  505. #     x     : 描画先 X 座標
  506. #     y     : 描画先 Y 座標
  507. #--------------------------------------------------------------------------
  508. def draw_enemy_gold(enemy, x, y)
  509.    self.contents.font.color = system_color
  510.    self.contents.draw_text(x, y, 120, 32, "掉落金钱")
  511.    self.contents.font.color = normal_color
  512.    self.contents.draw_text(x + 120, y, 36, 32, enemy.gold.to_s, 2)
  513. end
  514. end

  515. class Game_Enemy_Book < Game_Enemy
  516. #--------------------------------------------------------------------------
  517. # ● オブジェクト初期化
  518. #--------------------------------------------------------------------------
  519. def initialize(enemy_id)
  520.    super(2, 1)#ダミー
  521.    @enemy_id = enemy_id
  522.    enemy = $data_enemies[@enemy_id]
  523.    @battler_name = enemy.battler_name
  524.    @battler_hue = enemy.battler_hue
  525.    @hp = maxhp
  526.    @sp = maxsp
  527. end
  528. end

  529. class Data_MonsterBook
  530. attr_reader :id_data
  531. #--------------------------------------------------------------------------
  532. # ● オブジェクト初期化
  533. #--------------------------------------------------------------------------
  534. def initialize
  535.    @id_data = enemy_book_id_set
  536. end
  537. #--------------------------------------------------------------------------
  538. # ● 図鑑用登録無視属性取得
  539. #--------------------------------------------------------------------------
  540. def no_add_element
  541.   no_add = 0
  542. #    登録無視の属性IDを取得
  543.    for i in 1...$data_system.elements.size
  544.      if $data_system.elements[i] =~ /不加入图鉴/
  545.        no_add = i
  546.        break
  547.      end
  548.    end
  549.    return no_add
  550. end
  551. #--------------------------------------------------------------------------
  552. # ● 図鑑用敵ID設定
  553. #有不加入属性或者没有名称的不加入图鉴
  554. #--------------------------------------------------------------------------
  555. def enemy_book_id_set
  556.    data = [0]
  557.    no_add = no_add_element
  558. #   登録無視の属性IDを取得
  559.    for i in 1...$data_enemies.size
  560.      enemy = $data_enemies[i]
  561.      next if enemy.name == ""
  562.      if enemy.element_ranks[no_add] == 1
  563.        next
  564.      end
  565.      data.push(enemy.id)
  566.    end
  567.    return data
  568. end
  569. end


  570. class Window_MonsterBook < Window_Selectable
  571.   ####################################
  572. attr_reader   :data
  573. ##########################################3
  574. #--------------------------------------------------------------------------
  575. # ● オブジェクト初期化
  576. #--------------------------------------------------------------------------
  577. def initialize(index=0)
  578.    super(0, 64, 640, 416)
  579.    @column_max = 2
  580.    @book_data = $game_temp.enemy_book_data
  581.    @data = @book_data.id_data.dup########################
  582.    @data.shift
  583.    #@data.sort!
  584.    @item_max = @data.size
  585.    self.index = 0
  586.    refresh if @item_max > 0
  587. end
  588. #--------------------------------------------------------------------------
  589. # ● 遭遇データを取得
  590. #--------------------------------------------------------------------------
  591. def data_set
  592.    data = $game_party.enemy_info.keys
  593.    data.sort!
  594.    newdata = []
  595.    for i in data
  596.      next if $game_party.enemy_info[i] == 0
  597.      # 図鑑登録無視を考慮
  598.      if book_id(i) != nil
  599.        newdata.push(i)
  600.      end
  601.    end
  602.    return newdata
  603. end
  604. #--------------------------------------------------------------------------
  605. # ● 表示許可取得
  606. #--------------------------------------------------------------------------
  607. def show?(id)
  608.    if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
  609.      return false
  610.    else
  611.      return true
  612.    end
  613. end
  614. #--------------------------------------------------------------------------
  615. # ● 図鑑用ID取得
  616. #--------------------------------------------------------------------------
  617. def book_id(id)
  618.    return @book_data.index(id)
  619. end
  620. #--------------------------------------------------------------------------
  621. # ● エネミー取得
  622. #--------------------------------------------------------------------------
  623. def item
  624.    return @data[self.index]
  625. end
  626. #--------------------------------------------------------------------------
  627. # ● リフレッシュ
  628. #--------------------------------------------------------------------------
  629. def refresh
  630.    if self.contents != nil
  631.      self.contents.dispose
  632.      self.contents = nil
  633.    end
  634.    self.contents = Bitmap.new(width - 32, row_max * 32)
  635.    #項目数が 0 でなければビットマップを作成し、全項目を描画
  636.    if @item_max > 0
  637.      for i in 0...@item_max
  638.       draw_item(i)
  639.      end
  640.    end
  641. end
  642. #--------------------------------------------------------------------------
  643. # ● 項目の描画
  644. #     index : 項目番号
  645. #--------------------------------------------------------------------------
  646. def draw_item(index)
  647.    enemy = $data_enemies[@data[index]]
  648.    return if enemy == nil
  649.    x = 4 + index % 2 * (288 + 32)
  650.    y = index / 2 * 32
  651.    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  652.    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  653.    self.contents.font.color = normal_color
  654.    draw_enemy_book_id(enemy, x, y)
  655.    if show?(enemy.id)
  656.      self.contents.draw_text(x + 28+16, y, 212, 32, enemy.name, 0)
  657.    else
  658.      self.contents.draw_text(x + 28+16, y, 212, 32, "-----", 0)
  659.      return
  660.    end
  661.    if analyze?(@data[index])
  662.      self.contents.font.color = text_color(3)
  663.      self.contents.draw_text(x + 256, y, 24, 32, "済", 2)
  664.    end
  665. end
  666. #--------------------------------------------------------------------------
  667. # ● アナライズ済かどうか
  668. #--------------------------------------------------------------------------
  669. def analyze?(enemy_id)
  670.    if $game_party.enemy_info[enemy_id] == 2
  671.      return true
  672.    else
  673.      return false
  674.    end
  675. end
  676. end


  677. class Window_MonsterBook_Info < Window_Base
  678. include Enemy_Book_Config
  679. #--------------------------------------------------------------------------
  680. # ● オブジェクト初期化
  681. #--------------------------------------------------------------------------
  682. def initialize
  683.    super(0, 0+64, 640, 480-64)
  684.    self.back_opacity=255
  685.    self.contents = Bitmap.new(width - 32, height - 32)
  686.    
  687. end
  688. #--------------------------------------------------------------------------
  689. # ● リフレッシュ
  690. #--------------------------------------------------------------------------
  691. def refresh(enemy_id)
  692.    self.contents.clear
  693.    self.contents.font.size = 22
  694.    enemy = Game_Enemy_Book.new(enemy_id)
  695.    @gra = Sprite_Enemy_Graphic.new(nil,enemy)
  696.    @gra.z = 120      #怪物图片
  697.    draw_enemy_book_id(enemy, 4, 0)    #各种详细信息
  698.    draw_enemy_name(enemy, 48, 0)
  699.    draw_actor_hp(enemy, 288, 0)
  700.    draw_actor_sp(enemy, 288+160, 0)
  701.    self.contents.font.size=18
  702.    draw_actor_parameter(enemy, 288    ,  25, 0)
  703.    ########################################
  704.     self.contents.font.color.set(255, 255,50)
  705.    self.contents.draw_text(288+160, 25, 120, 32, EVA_NAME)
  706.    self.contents.font.color = normal_color
  707.    self.contents.draw_text(288+160 + 120, 25, 36, 32, enemy.eva.to_s, 2)
  708.    draw_actor_parameter(enemy, 288    ,  50, 3)
  709.    draw_actor_parameter(enemy, 288+160,  50, 4)
  710.    draw_actor_parameter(enemy, 288    ,  75, 5)
  711.    draw_actor_parameter(enemy, 288+160,  75, 6)
  712.    draw_actor_parameter(enemy, 288    , 100, 1)
  713.    draw_actor_parameter(enemy, 288+160, 100, 2)
  714.    draw_enemy_exp(enemy, 288, 125)
  715.    draw_enemy_gold(enemy, 288+160, 125)
  716.    draw_race(enemy, 288, 150)
  717.    #--------------------------------------------------------------------
  718.    draw_enemy_other(enemy, 0, 280)  #简介文字
  719.    draw_enemy_action(enemy,200, 30)  #显示敌人行动
  720.    draw_actor_element_radar_graph(enemy, 360, 180)#雷达图
  721.    #--------------------------------------------------------------------
  722.    if DROP_ITEM_NEED_ANALYZE==true  #掉落物品
  723.      self.contents.font.color = system_color
  724.         self.contents.font.size=16
  725.      self.contents.draw_text(0, 235, 96, 32, "掉落物品")
  726.      draw_enemy_drop_item(enemy, 128, 235)
  727.      self.contents.font.color = normal_color
  728.         self.contents.font.size=18
  729.       end      
  730.     end
  731. def cl
  732.        @gra.dispose
  733. end
  734. #--------------------------------------------------------------------------
  735. # ● アナライズ済かどうか
  736. #--------------------------------------------------------------------------
  737. def analyze?(enemy_id)
  738.    if $game_party.enemy_info[enemy_id] == 2
  739.      return true
  740.    else
  741.      return false
  742.    end
  743. end
  744. end


  745. class Scene_MonsterBook
  746. include Enemy_Book_Config
  747. #--------------------------------------------------------------------------
  748. # ● メイン処理
  749. #--------------------------------------------------------------------------
  750. def main
  751.    $game_temp.enemy_book_data = Data_MonsterBook.new
  752.    # ウィンドウを作成
  753.    @title_window = Window_Base.new(0, 0, 640, 64)
  754.    @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
  755.    @title_window.contents.draw_text(4, 0, 320, 32, "魔物图鉴", 0)
  756.    if SHOW_COMPLETE_TYPE != 0
  757.      case SHOW_COMPLETE_TYPE
  758.      when 1
  759.        e_now = $game_party.enemy_book_now
  760.        e_max = $game_party.enemy_book_max
  761.        text = e_now.to_s + "/" + e_max.to_s
  762.      when 2
  763.        comp = $game_party.enemy_book_complete_percentage
  764.        text = comp.to_s + "%"
  765.      when 3
  766.        e_now = $game_party.enemy_book_now
  767.        e_max = $game_party.enemy_book_max
  768.        comp = $game_party.enemy_book_complete_percentage
  769.        text = e_now.to_s + "/" + e_max.to_s + " " + comp.to_s + "%"
  770.      end
  771.      if text != nil
  772.        @title_window.contents.draw_text(320, 0, 288, 32,  text, 2)
  773.      end
  774.    end
  775.    @main_window = Window_MonsterBook.new
  776.    @main_window.active = true
  777.    # インフォウィンドウを作成 (不可視?非アクティブに設定)
  778.    @info_window = Window_MonsterBook_Info.new
  779.    @info_window.z = 110
  780.    @info_window.visible = false
  781.    @info_window.active = false
  782.    @visible_index = 0
  783.    # トランジション実行
  784.    Graphics.transition
  785.    # メインループ
  786.    loop do
  787.      # ゲーム画面を更新
  788.      Graphics.update
  789.      # 入力情報を更新
  790.      Input.update
  791.      # フレーム更新
  792.      update
  793.      # 画面が切り替わったらループを中断
  794.      if $scene != self
  795.        break
  796.      end
  797.    end
  798.    # トランジション準備
  799.    Graphics.freeze
  800.    # ウィンドウを解放
  801.    @main_window.dispose
  802.    @info_window.dispose
  803.    @title_window.dispose
  804. end
  805. #--------------------------------------------------------------------------
  806. # ● フレーム更新
  807. #--------------------------------------------------------------------------
  808. def update
  809.    # ウィンドウを更新
  810.    @main_window.update
  811.    @info_window.update
  812. #   gra.update
  813.    if @info_window.active
  814.      update_info
  815.      return
  816.    end
  817.    # メインウィンドウがアクティブの場合: update_target を呼ぶ
  818.    if @main_window.active
  819.      update_main
  820.      return
  821.    end
  822. end
  823. #--------------------------------------------------------------------------
  824. # ● フレーム更新 (メインウィンドウがアクティブの場合)
  825. #--------------------------------------------------------------------------
  826. def update_main
  827.    # B ボタンが押された場合
  828.    if Input.trigger?(Input::B)
  829.      # キャンセル SE を演奏
  830.      $game_system.se_play($data_system.cancel_se)
  831.      $scene = Scene_Menu.new(7)
  832.      return
  833.    end
  834.    # C ボタンが押された場合
  835.    if Input.trigger?(Input::C)
  836.      if @main_window.item == nil or @main_window.show?(@main_window.item) == false
  837.        # ブザー SE を演奏
  838.        $game_system.se_play($data_system.buzzer_se)
  839.        return
  840.      end
  841.      # 決定 SE を演奏
  842.      $game_system.se_play($data_system.decision_se)
  843.      @main_window.active = false
  844.      @info_window.active = true
  845.      @info_window.visible = true
  846.      @visible_index = @main_window.index
  847.      @info_window.refresh(@main_window.item)
  848.      return
  849.    end
  850. end
  851. #--------------------------------------------------------------------------
  852. # ● フレーム更新 (インフォウィンドウがアクティブの場合)
  853. #--------------------------------------------------------------------------
  854. def update_info
  855.    # B ボタンが押された場合
  856.    if Input.trigger?(Input::B)
  857.      # キャンセル SE を演奏
  858.      $game_system.se_play($data_system.cancel_se)
  859.      @main_window.active = true
  860.      @info_window.active = false
  861.      @info_window.visible = false
  862.      @info_window.cl
  863.      return
  864.    end
  865.    # C ボタンが押された場合
  866.    if Input.trigger?(Input::C)
  867.      # 決定 SE を演奏
  868.      #$game_system.se_play($data_system.decision_se)
  869.      return
  870.    end
  871.    if Input.trigger?(Input::L)
  872.      # 決定 SE を演奏
  873.      $game_system.se_play($data_system.decision_se)
  874.      loop_end = false
  875.      while loop_end == false
  876.        if @visible_index != 0
  877.          @visible_index -= 1
  878.        else
  879.          @visible_index = @main_window.data.size - 1
  880.        end
  881.        loop_end = true if @main_window.show?(@main_window.data[@visible_index])
  882.      end
  883.      id = @main_window.data[@visible_index]
  884.      @info_window.refresh(id)
  885.      return
  886.    end
  887.    if Input.trigger?(Input::R)
  888.      # 決定 SE を演奏
  889.      $game_system.se_play($data_system.decision_se)
  890.      loop_end = false
  891.      while loop_end == false
  892.        if @visible_index != @main_window.data.size - 1
  893.          @visible_index += 1
  894.        else
  895.          @visible_index = 0
  896.        end
  897.        loop_end = true if @main_window.show?(@main_window.data[@visible_index])
  898.      end
  899.      id = @main_window.data[@visible_index]
  900.      @info_window.refresh(id)
  901.      return
  902.    end
  903. end
  904. end
  905. #==================================================================
  906. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  907. #==================================================================
  908. class Sprite_Enemy_Graphic< Sprite
  909.   attr_accessor :enemy
  910.   #--------------------------------------------------------------------------
  911.   # ● オブジェクト初期化
  912.   #--------------------------------------------------------------------------
  913.   def initialize(viewport,enemy)
  914.     super(viewport)
  915.     if @enemy != enemy
  916.    #  self.bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
  917.   self.bitmap = RPG::Cache.battler(enemy.battler_name+"_1", enemy.battler_hue)
  918.       cw = self.bitmap.width
  919.       ch = self.bitmap.height
  920.     if cw>ch
  921.      self.zoom_x=150.0/cw
  922.      self.zoom_y=150.0/cw
  923.    else
  924.      self.zoom_x=150.0/ch
  925.      self.zoom_y=150.0/ch     
  926.    end
  927.      self.x=10
  928.      self.y=110
  929.       @enemy=enemy
  930.     end
  931.   end
  932.   #--------------------------------------------------------------------------
  933.   # ● 解放
  934.   #--------------------------------------------------------------------------
  935.   def dispose
  936.     if self.bitmap != nil
  937.       self.bitmap.dispose
  938.     end
  939.     super
  940.   end
  941.   #--------------------------------------------------------------------------
  942.   # ● フレーム更新
  943.   #--------------------------------------------------------------------------
  944.   def refresh(enemy)
  945.   end
  946. end
复制代码

点评

已过期,收回悬赏分  发表于 2010-11-10 12:19

Lv3.寻梦者

酱油的

梦石
0
星屑
970
在线时间
2161 小时
注册时间
2007-12-22
帖子
3271

贵宾

2
发表于 2010-10-28 07:18:47 | 只看该作者
我突然間想說看找錯活動的第七樓啊~

点评

……  发表于 2010-10-28 07:51
不做頭像做簽名,看我囧冏有神(多謝山人有情提供 )
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 15:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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