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

Project1

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

如何屏蔽菜单中的某一项

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-27
帖子
12
跳转到指定楼层
1
发表于 2008-5-29 22:40:52 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv1.梦旅人

很傻很天真

梦石
0
星屑
55
在线时间
3 小时
注册时间
2007-3-13
帖子
3667
8
发表于 2008-6-7 03:26:34 | 只看该作者
修改Scene_Menu
    s1 = Vocab::item =物品选项
    s2 = Vocab::skill =技能选项 技能就是要去掉这行
    s3 = Vocab::equip =装备选项
    s4 = Vocab::status =状态选项
    s5 = Vocab::save =存档选项
    s6 = Vocab::game_end =游戏结束选项
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])

也就是改成
    s1 = Vocab::item
    s2 = Vocab::equip
    s3 = Vocab::status
    s4 = Vocab::save
    s5 = "图鉴"
    s6 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5,s6])

然后下面

      case @command_window.index
      when 0      # 物品
        $scene = Scene_Item.new
      when 1,2,3  # 技能、装备、状态
        start_actor_selection
      when 4      # 存档
        $scene = Scene_File.new(true, false, false)
      when 5      # 结束游戏
        $scene = Scene_End.new
改成
      case @command_window.index
      when 0      # 物品
        $scene = Scene_Item.new
      when 100,2,3  # 技能、装备、状态  100是把技能选项的命令扔掉
      case @command_window.index
      when 4      # 存档
        $scene = Scene_File.new(true, false, false)
      when 5      # 图鉴    添加的图鉴命令!
        $scene = Scene_EnemyDex.new
      when 6      # 结束游戏
        $scene = Scene_End.new

如果你想偷懒
直接用这个:
  1. #==============================================================================
  2. # ■ Scene_Menu
  3. #------------------------------------------------------------------------------
  4. #  处理菜单画面的类。
  5. #==============================================================================

  6. class Scene_Menu < Scene_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     menu_index : 命令窗口光标初始位置
  10.   #--------------------------------------------------------------------------
  11.   def initialize(menu_index = 0)
  12.     @menu_index = menu_index
  13.   end
  14.   #--------------------------------------------------------------------------
  15.   # ● 开始处理
  16.   #--------------------------------------------------------------------------
  17.   def start
  18.     super
  19.     create_menu_background
  20.     create_command_window
  21.     @gold_window = Window_Gold.new(0, 360)
  22.     @status_window = Window_MenuStatus.new(160, 0)
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 结束处理
  26.   #--------------------------------------------------------------------------
  27.   def terminate
  28.     super
  29.     dispose_menu_background
  30.     @command_window.dispose
  31.     @gold_window.dispose
  32.     @status_window.dispose
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # ● 更新画面
  36.   #--------------------------------------------------------------------------
  37.   def update
  38.     super
  39.     update_menu_background
  40.     @command_window.update
  41.     @gold_window.update
  42.     @status_window.update
  43.     if @command_window.active
  44.       update_command_selection
  45.     elsif @status_window.active
  46.       update_actor_selection
  47.     end
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● 生成命令窗口
  51.   #--------------------------------------------------------------------------
  52.   def create_command_window
  53.     s1 = Vocab::item
  54.     s2 = Vocab::equip
  55.     s3 = Vocab::status
  56.     s4 = Vocab::save
  57.     s5 = "图鉴"
  58.     s6 = Vocab::game_end
  59.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5,s6])
  60.     @command_window.index = @menu_index
  61.     if $game_party.members.size == 0          # 如果队伍为空
  62.       @command_window.draw_item(0, false)     # 无效化物品选项
  63.       @command_window.draw_item(1, false)     # 无效化技能选项
  64.       @command_window.draw_item(2, false)     # 无效化装备选项
  65.       @command_window.draw_item(3, false)     # 无效化状态选项
  66.     end
  67.     if $game_system.save_disabled             # 如果禁止存档
  68.       @command_window.draw_item(4, false)     # 无效化存档选项
  69.     end
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● 更新命令窗口
  73.   #--------------------------------------------------------------------------
  74.   def update_command_selection
  75.     if Input.trigger?(Input::B)
  76.       Sound.play_cancel
  77.       $scene = Scene_Map.new
  78.     elsif Input.trigger?(Input::C)
  79.       if $game_party.members.size == 0 and @command_window.index < 4
  80.         Sound.play_buzzer
  81.         return
  82.       elsif $game_system.save_disabled and @command_window.index == 4
  83.         Sound.play_buzzer
  84.         return
  85.       end
  86.       Sound.play_decision
  87.       case @command_window.index
  88.       when 0      # 物品
  89.         $scene = Scene_Item.new
  90.       when 100,1,2  # 技能、装备、状态
  91.         start_actor_selection
  92.       when 3      # 存档
  93.         $scene = Scene_File.new(true, false, false)
  94.       when 4      # 图鉴
  95.         $scene = Scene_EnemyDex.new
  96.       when 5      # 结束游戏
  97.         $scene = Scene_End.new
  98.       end
  99.     end
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● 角色选择开始
  103.   #--------------------------------------------------------------------------
  104.   def start_actor_selection
  105.     @command_window.active = false
  106.     @status_window.active = true
  107.     if $game_party.last_actor_index < @status_window.item_max
  108.       @status_window.index = $game_party.last_actor_index
  109.     else
  110.       @status_window.index = 0
  111.     end
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   # ● 角色选择结束
  115.   #--------------------------------------------------------------------------
  116.   def end_actor_selection
  117.     @command_window.active = true
  118.     @status_window.active = false
  119.     @status_window.index = -1
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # ● 角色选择更新
  123.   #--------------------------------------------------------------------------
  124.   def update_actor_selection
  125.     if Input.trigger?(Input::B)
  126.       Sound.play_cancel
  127.       end_actor_selection
  128.     elsif Input.trigger?(Input::C)
  129.       $game_party.last_actor_index = @status_window.index
  130.       Sound.play_decision
  131.       case @command_window.index
  132.       when 1  # 技能
  133.         $scene = Scene_Skill.new(@status_window.index)
  134.       when 2  # 装备
  135.         $scene = Scene_Equip.new(@status_window.index)
  136.       when 3  # 状态
  137.         $scene = Scene_Status.new(@status_window.index)
  138.       end
  139.     end
  140.   end
  141. end
复制代码

覆盖你的Scene_Menu即可..{/cy}

注意....:
图鉴脚本也要插入到脚本编辑器!否者出错!
脚本很明显..就在2楼...
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-27
帖子
12
7
 楼主| 发表于 2008-6-7 02:29:40 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

神隐的主犯

梦石
0
星屑
289
在线时间
271 小时
注册时间
2008-2-22
帖子
7691

贵宾

6
发表于 2008-5-31 23:23:47 | 只看该作者
可以使用公共事件 来呼出

《天空之城 —— 破碎的命运》
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2005-12-19
帖子
43
5
发表于 2008-5-31 23:19:30 | 只看该作者
那怎么做在呼出菜单上呢
回复 支持 反对

使用道具 举报

Lv2.观梦者

神隐的主犯

梦石
0
星屑
289
在线时间
271 小时
注册时间
2008-2-22
帖子
7691

贵宾

4
发表于 2008-5-31 19:34:57 | 只看该作者
# 一、将想显示的属性设定好,是一个数组,最多六个
# 二、设定不显示的怪物编号
# 四、在数据库里设置备注成为怪物说明
# 三、在事件上使用脚本:$scene = Scene_EnemyDex.new 进入图鉴


基本不要什么设定,在事件上使用脚本:$scene = Scene_EnemyDex.new 就可以了。

《天空之城 —— 破碎的命运》
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-27
帖子
12
3
 楼主| 发表于 2008-5-31 19:33:12 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

神隐的主犯

梦石
0
星屑
289
在线时间
271 小时
注册时间
2008-2-22
帖子
7691

贵宾

2
发表于 2008-5-29 22:47:04 | 只看该作者
屏蔽菜单中的“技能”一项??是都不用的吗?


图鉴的话,用这个好了:

  1. #===========================================================================
  2. # 一、将想显示的属性设定好,是一个数组,最多六个
  3. # 二、设定不显示的怪物编号
  4. # 四、在数据库里设置备注成为怪物说明
  5. # 三、在事件上使用脚本:$scene = Scene_EnemyDex.new 进入图鉴
  6. #===========================================================================

  7. $属性显示 = [9,10,11,12,13,14]
  8. $不显示的怪物 = []
  9. $enemy_id= []
  10. #---------------------------------------------------------------------------
  11. # 对Game_Party添加新的定义
  12. #---------------------------------------------------------------------------
  13. class Game_Party
  14.   #-------------------------------------------------------------------------
  15.   # 出示化实例变量
  16.   #-------------------------------------------------------------------------
  17.   attr_accessor :enemy_view
  18.   attr_reader   :enemy_id
  19.   #-------------------------------------------------------------------------
  20.   # 初始化
  21.   #-------------------------------------------------------------------------
  22.   alias new_initialize initialize
  23.   def initialize
  24.     new_initialize
  25.     @enemy_view = []
  26.     for i in 1...$data_enemies.size
  27.       @enemy_view[i] = 0
  28.     end
  29.   end
  30.   #-------------------------------------------------------------------------
  31.   # 打开图鉴
  32.   #-------------------------------------------------------------------------
  33.   def add_enemy_view(n)
  34.     if n == "all"
  35.       for i in 1...$data_enemies.size
  36.         @enemy_view[i] += 1
  37.       end
  38.     else
  39.       @enemy_view[n] += 1
  40.     end
  41.   end
  42. end

  43. #---------------------------------------------------------------------------
  44. # 新建图鉴窗口
  45. #---------------------------------------------------------------------------
  46. class Window_EnemyDex_Info < Window_Base
  47.   #-------------------------------------------------------------------------
  48.   # 初始化
  49.   #-------------------------------------------------------------------------
  50.   def initialize(id)
  51.     super(0,56,544,360)
  52.     @id = id
  53.     @now_id = 0
  54.     @element = $属性显示
  55.     $data_enemy = $enemy_id
  56.     refresh
  57.   end
  58.   #-------------------------------------------------------------------------
  59.   # 刷新
  60.   #-------------------------------------------------------------------------
  61.   def refresh
  62.     if @now_id != @id
  63.       self.contents.clear
  64.       draw_enemy_name(@id)
  65.       draw_enemy_hp(@id)
  66.       draw_enemy_mp(@id)
  67.       draw_enemy_atk(@id)
  68.       draw_enemy_def(@id)
  69.       draw_enemy_spi(@id)
  70.       draw_enemy_agi(@id)
  71.       draw_enemy_hit(@id)
  72.       draw_enemy_eva(@id)
  73.       draw_enemy_exp(@id)
  74.       draw_enemy_gold(@id)
  75.       draw_enemy_item1(@id)
  76.       draw_enemy_item2(@id)
  77.       draw_enemy_levitate(@id)
  78.       draw_enemy_has_critical(@id)
  79.       draw_enemy_element_ranks(@id)
  80.       draw_enemy_action(@id)
  81.     end
  82.     @now_id = @id
  83.   end
  84.   #-------------------------------------------------------------------------
  85.   # 名字
  86.   #-------------------------------------------------------------------------
  87.   def draw_enemy_name(id)
  88.     self.contents.font.color = Color.new(255,255,0,255)
  89.     self.contents.draw_text(0,0,160,24,$data_enemies[id].name)
  90.   end
  91.   #-------------------------------------------------------------------------
  92.   # 生命
  93.   #-------------------------------------------------------------------------
  94.   def draw_enemy_hp(id)
  95.     self.contents.font.color = system_color
  96.     self.contents.draw_text(0,24,40,24,"HP")
  97.     self.contents.font.color = normal_color
  98.     self.contents.draw_text(40,24,80,24,$data_enemies[id].maxhp)
  99.   end
  100.   #-------------------------------------------------------------------------
  101.   # 精神
  102.   #-------------------------------------------------------------------------
  103.   def draw_enemy_mp(id)
  104.     self.contents.font.color = system_color
  105.     self.contents.draw_text(0,48,40,24,"MP")
  106.     self.contents.font.color = normal_color
  107.     self.contents.draw_text(40,48,80,24,$data_enemies[id].maxmp)
  108.   end
  109.   #-------------------------------------------------------------------------
  110.   # 图像
  111.   #-------------------------------------------------------------------------
  112.   def draw_enemy_picture(id)
  113.     bitmap = Cache.battler($data_enemies[id].battler_name,$data_enemies[id].battler_hue)
  114.     src_rect = Rect.new(0,0,bitmap.width,bitmap.height)
  115.     self.contents.blt(((self.width-32)-bitmap.width)/2,((self.height-32)-bitmap.height)/2,bitmap,src_rect)
  116.   end
  117.   #-------------------------------------------------------------------------
  118.   # 攻击
  119.   #-------------------------------------------------------------------------
  120.   def draw_enemy_atk(id)
  121.     self.contents.font.color = Color.new(255,128,128,255)
  122.     self.contents.draw_text(0,72,60,24,"攻击力")
  123.     self.contents.font.color = normal_color
  124.     self.contents.draw_text(80,72,80,24,$data_enemies[id].atk,2)
  125.   end
  126.   #-------------------------------------------------------------------------
  127.   # 防御
  128.   #-------------------------------------------------------------------------
  129.   def draw_enemy_def(id)
  130.     self.contents.font.color = Color.new(255,128,128,255)
  131.     self.contents.draw_text(0,96,60,24,"防御力")
  132.     self.contents.font.color = normal_color
  133.     self.contents.draw_text(80,96,80,24,$data_enemies[id].def,2)
  134.   end
  135.   #-------------------------------------------------------------------------
  136.   # 精神
  137.   #-------------------------------------------------------------------------
  138.   def draw_enemy_spi(id)
  139.     self.contents.font.color = Color.new(255,128,128,255)
  140.     self.contents.draw_text(0,120,60,24,"精神力")
  141.     self.contents.font.color = normal_color
  142.     self.contents.draw_text(80,120,80,24,$data_enemies[id].spi,2)
  143.   end
  144.   #-------------------------------------------------------------------------
  145.   # 敏捷
  146.   #-------------------------------------------------------------------------
  147.   def draw_enemy_agi(id)
  148.     self.contents.font.color = Color.new(255,128,128,255)
  149.     self.contents.draw_text(0,144,60,24,"敏捷力")
  150.     self.contents.font.color = normal_color
  151.     self.contents.draw_text(80,144,80,24,$data_enemies[id].agi,2)
  152.   end
  153.   #-------------------------------------------------------------------------
  154.   # 命中
  155.   #-------------------------------------------------------------------------
  156.   def draw_enemy_hit(id)
  157.     self.contents.font.color = Color.new(255,128,255,255)
  158.     self.contents.draw_text(0,168,60,24,"命中率")
  159.     self.contents.font.color = normal_color
  160.     self.contents.draw_text(80,168,80,24,$data_enemies[id].hit,2)
  161.   end
  162.   #-------------------------------------------------------------------------
  163.   # 回避
  164.   #-------------------------------------------------------------------------
  165.   def draw_enemy_eva(id)
  166.     self.contents.font.color = Color.new(255,128,255,255)
  167.     self.contents.draw_text(0,192,60,24,"回避率")
  168.     self.contents.font.color = normal_color
  169.     self.contents.draw_text(80,192,80,24,$data_enemies[id].eva,2)
  170.   end
  171.   #-------------------------------------------------------------------------
  172.   # 经验
  173.   #-------------------------------------------------------------------------
  174.   def draw_enemy_exp(id)
  175.     self.contents.font.color = Color.new(240,255,130,255)
  176.     self.contents.draw_text(0,216,60,24,"经验值")
  177.     self.contents.font.color = normal_color
  178.     self.contents.draw_text(80,216,80,24,$data_enemies[id].exp,2)
  179.   end
  180.   #-------------------------------------------------------------------------
  181.   # 金钱
  182.   #-------------------------------------------------------------------------
  183.   def draw_enemy_gold(id)
  184.     self.contents.font.color = Color.new(240,255,130,255)
  185.     self.contents.draw_text(0,240,60,24,"金钱")
  186.     self.contents.font.color = normal_color
  187.     self.contents.draw_text(80,240,80,24,$data_enemies[id].gold,2)
  188.   end
  189.   #-------------------------------------------------------------------------
  190.   # 物品1
  191.   #-------------------------------------------------------------------------
  192.   def draw_enemy_item1(id)
  193.     self.contents.font.color = Color.new(128,255,128,255)
  194.     self.contents.draw_text(0,264,60,24,"物品一")
  195.     self.contents.font.color = normal_color
  196.     case $data_enemies[id].drop_item1.kind
  197.     when 0
  198.       self.contents.draw_text(80,264,80,24,"无",2)
  199.     when 1
  200.       self.contents.draw_text(80,264,80,24,$data_items[$data_enemies[id].drop_item1.item_id].name,2)
  201.     when 2
  202.       self.contents.draw_text(80,264,80,24,$data_weapons[$data_enemies[id].drop_item1.weapon_id].name,2)
  203.     when 3
  204.       self.contents.draw_text(80,264,80,24,$data_armors[$data_enemies[id].drop_item1.armor_id].name,2)
  205.     end
  206.   end
  207.   #-------------------------------------------------------------------------
  208.   # 物品2
  209.   #-------------------------------------------------------------------------
  210.   def draw_enemy_item2(id)
  211.     self.contents.font.color = Color.new(128,255,128,255)
  212.     self.contents.draw_text(0,288,60,24,"物品二")
  213.     self.contents.font.color = normal_color
  214.     case $data_enemies[id].drop_item1.kind
  215.     when 0
  216.       self.contents.draw_text(80,288,80,24,"无",2)
  217.     when 1
  218.       self.contents.draw_text(80,288,80,24,$data_items[$data_enemies[id].drop_item2.item_id].name,2)
  219.     when 2
  220.       self.contents.draw_text(80,288,80,24,$data_weapons[$data_enemies[id].drop_item2.weapon_id].name,2)
  221.     when 3
  222.       self.contents.draw_text(80,288,80,24,$data_armors[$data_enemies[id].drop_item2.armor_id].name,2)
  223.     end
  224.   end
  225.   #-------------------------------------------------------------------------
  226.   # 空中
  227.   #-------------------------------------------------------------------------
  228.   def draw_enemy_levitate(id)
  229.     self.contents.font.color = $data_enemies[id].levitate == true ? Color.new(255,255,0,255) : Color.new(150,150,150,255)
  230.     self.contents.draw_text(200,264,160,24,"配置在空中")
  231.   end
  232.   #-------------------------------------------------------------------------
  233.   # 重击
  234.   #-------------------------------------------------------------------------
  235.   def draw_enemy_has_critical(id)
  236.     self.contents.font.color = $data_enemies[id].has_critical == true ? Color.new(255,255,0,255) : Color.new(150,150,150,255)
  237.     self.contents.draw_text(200,288,160,24,"有会心一击")
  238.   end
  239.   #-------------------------------------------------------------------------
  240.   # 属性
  241.   #-------------------------------------------------------------------------
  242.   def draw_enemy_element_ranks(id)
  243.     self.contents.font.color = Color.new(255,180,255,255)
  244.     self.contents.draw_text(380,0,60,24,"属性")
  245.     self.contents.font.color = normal_color
  246.     x = 0
  247.     for i in @element
  248.       self.contents.draw_text(380,x*48+24,80,24,$data_system.elements[i])
  249.       case $data_enemies[id].element_ranks[i]
  250.       when 1
  251.         percent = "200%"
  252.         width = 100
  253.         c1 = Color.new(255,255,64,255)
  254.         c2 = Color.new(255,128,128,255)
  255.       when 2
  256.         percent = "150%"
  257.         width = 75
  258.         c1 = Color.new(255,255,64,255)
  259.         c2 = Color.new(255,128,128,255)
  260.       when 3
  261.         percent = "100%"
  262.         width = 50
  263.         c1 = Color.new(255,255,64,255)
  264.         c2 = Color.new(128,255,128,255)
  265.       when 4
  266.         percent = "50%"
  267.         width = 25
  268.         c1 = Color.new(255,128,128,255)
  269.         c2 = Color.new(255,255,64,255)
  270.       when 5
  271.         percent = "0%"
  272.         width = 0
  273.         c1 = Color.new(255,128,128,255)
  274.         c2 = Color.new(255,255,64,255)
  275.       when 6
  276.         percent = "-100%"
  277.         width = 100
  278.         c1 = Color.new(255,128,255,255)
  279.         c2 = Color.new(128,255,128,255)
  280.       end
  281.       a = 380
  282.       b = 6
  283.       for i in 0...12
  284.         self.contents.fill_rect(a,x*48+48+b,100,1,Color.new(0,0,0,200))
  285.         a += 0.5
  286.         b += 1
  287.       end
  288.       self.contents.gradient_fill_rect(380,x*48+48+6,width,1,c1,c2)
  289.       self.contents.gradient_fill_rect(380.5,x*48+48+7,width,1,c1,c2)
  290.       self.contents.gradient_fill_rect(381,x*48+48+8,width,1,c1,c2)
  291.       self.contents.gradient_fill_rect(381.5,x*48+48+9,width,1,c1,c2)
  292.       self.contents.gradient_fill_rect(382,x*48+48+10,width,1,c1,c2)
  293.       self.contents.gradient_fill_rect(382.5,x*48+48+11,width,1,c1,c2)
  294.       self.contents.gradient_fill_rect(383,x*48+48+12,width,1,c1,c2)
  295.       self.contents.gradient_fill_rect(383.5,x*48+48+13,width,1,c1,c2)
  296.       self.contents.gradient_fill_rect(384,x*48+48+14,width,1,c1,c2)
  297.       self.contents.gradient_fill_rect(384.5,x*48+48+15,width,1,c1,c2)
  298.       self.contents.gradient_fill_rect(385,x*48+48+16,width,1,c1,c2)
  299.       self.contents.gradient_fill_rect(385.5,x*48+48+17,width,1,c1,c2)
  300.       self.contents.draw_text(380,x*48+40,100,24,percent,2)
  301.       x += 1
  302.       break if x >= 6
  303.     end
  304.   end
  305.   #-------------------------------------------------------------------------
  306.   # 行动
  307.   #-------------------------------------------------------------------------
  308.   def draw_enemy_action(id)
  309.     self.contents.font.color = Color.new(0,255,255,255)
  310.     self.contents.draw_text(200,0,60,24,"行动")
  311.     self.contents.font.color = normal_color
  312.     x = 1
  313.     for action in $data_enemies[id].actions
  314.       if action.kind == 0
  315.         case action.basic
  316.         when 0
  317.           self.contents.draw_text(200,x*24,160,24,"#{x}. "+"攻击")
  318.         when 1
  319.           self.contents.draw_text(200,x*24,160,24,"#{x}. "+"防御")
  320.         when 2
  321.           self.contents.draw_text(200,x*24,160,24,"#{x}. "+"逃跑")
  322.         when 3
  323.           self.contents.draw_text(200,x*24,160,24,"#{x}. "+"待机")
  324.         end
  325.       else
  326.         self.contents.draw_text(200,x*24,160,24,"#{x}. "+$data_skills[action.skill_id].name)
  327.       end
  328.       x += 1
  329.       break if x >= 11
  330.     end
  331.   end
  332. end

  333. #---------------------------------------------------------------------------
  334. # 新建图鉴窗口
  335. #---------------------------------------------------------------------------
  336. class Window_EnemyDex_Intro < Window_Base
  337.   #-------------------------------------------------------------------------
  338.   # 初始化
  339.   #-------------------------------------------------------------------------
  340.   def initialize(id)
  341.     super(0,56,544,360)
  342.     @id = id
  343.     @now_id = 0
  344.     refresh
  345.   end
  346.   #-------------------------------------------------------------------------
  347.   # 刷新
  348.   #-------------------------------------------------------------------------
  349.   def refresh
  350.     if @now_id != @id
  351.       self.contents.clear
  352.       draw_enemy_picture(@id)
  353.     end
  354.     @now_id = @id
  355.   end
  356.   #-------------------------------------------------------------------------
  357.   # 图像
  358.   #-------------------------------------------------------------------------
  359.   def draw_enemy_picture(id)
  360.     bitmap = Cache.battler($data_enemies[id].battler_name,$data_enemies[id].battler_hue)
  361.     src_rect = Rect.new(0,0,bitmap.width,bitmap.height)
  362.     self.contents.blt(((self.width-32)-bitmap.width)/2,((self.height-32)-bitmap.height)/2,bitmap,src_rect)
  363.   end
  364. end

  365. #---------------------------------------------------------------------------
  366. # 选择窗口
  367. #---------------------------------------------------------------------------
  368. class Window_EnemyDex < Window_Selectable
  369.   #-------------------------------------------------------------------------
  370.   # 初始化
  371.   #-------------------------------------------------------------------------
  372.   def initialize
  373.     super(0,56,544,360)
  374.     @column_max = 2
  375.     self.index = 0
  376.     refresh
  377.   end
  378.   #-------------------------------------------------------------------------
  379.   # 获取敌人
  380.   #-------------------------------------------------------------------------
  381.   def enemy
  382.     return @data[self.index]
  383.   end
  384.   #-------------------------------------------------------------------------
  385.   # 刷新
  386.   #-------------------------------------------------------------------------
  387.   def refresh
  388.     @data = []
  389.     for i in 1...$data_enemies.size
  390.       if !$不显示的怪物.include?(i)
  391.         @data.push($data_enemies[i])
  392.       end
  393.     end
  394.     @item_max = @data.size
  395.     create_contents
  396.     for i in 0...@item_max
  397.       draw_item(i)
  398.     end
  399.   end
  400.   #-------------------------------------------------------------------------
  401.   # 显示
  402.   #-------------------------------------------------------------------------
  403.   def draw_item(index)
  404.     rect = item_rect(index)
  405.     self.contents.clear_rect(rect)
  406.     enemy = @data[index]
  407.     if $game_party.enemy_view[enemy.id] > 0
  408.       rect.width -= 4
  409.       self.contents.draw_text(rect.x+4,rect.y,(self.width-32)/2,24,enemy.name)
  410.     else
  411.       rect.width -= 4
  412.       self.contents.draw_text(rect.x+4,rect.y,(self.width-32)/2,24,"----------------")
  413.     end
  414.   end
  415.   #-------------------------------------------------------------------------
  416.   # 帮助
  417.   #-------------------------------------------------------------------------
  418.   def update_help
  419.     view = $game_party.enemy_view[enemy.id]
  420.     @help_window.set_text(view > 0 ? "编号 #{enemy.id}" : "----------------")
  421.   end
  422. end

  423. #---------------------------------------------------------------------------
  424. # 图鉴
  425. #---------------------------------------------------------------------------
  426. class Scene_EnemyDex < Scene_Base
  427.   #-------------------------------------------------------------------------
  428.   # 处理
  429.   #-------------------------------------------------------------------------
  430.   def start
  431.     create_menu_background
  432.     @help_window = Window_Help.new
  433.     @enemydex_window = Window_EnemyDex.new
  434.     @enemydex_window.help_window = @help_window
  435.     @enemydex_window.active = true
  436.     @enemydex_info_window = Window_EnemyDex_Info.new(@enemydex_window.enemy.id)
  437.     @enemydex_info_window.visible = false
  438.     @enemydex_intro_window = Window_EnemyDex_Intro.new(@enemydex_window.enemy.id)
  439.     @enemydex_intro_window.visible = false
  440.     @enemydex_command_window = Window_Command.new(160,["预览图片","察看详情"])
  441.     @enemydex_command_window.active = false
  442.     @enemydex_command_window.visible = false
  443.     @enemydex_command_window.x = (544-160)/2
  444.     @enemydex_command_window.y = (416-80)/2
  445.   end
  446.   #--------------------------------------------------------------------------
  447.   # ● 结束处理
  448.   #--------------------------------------------------------------------------
  449.   def terminate
  450.     super
  451.     dispose_menu_background
  452.     @help_window.dispose
  453.     @enemydex_window.dispose
  454.     @enemydex_info_window.dispose
  455.     @enemydex_intro_window.dispose
  456.     @enemydex_command_window.dispose
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # ● 更新画面
  460.   #--------------------------------------------------------------------------
  461.   def update
  462.     super
  463.     update_menu_background
  464.     @help_window.update
  465.     @enemydex_window.update
  466.     @enemydex_info_window.update
  467.     @enemydex_intro_window.update
  468.     @enemydex_command_window.update
  469.     return select_enemy if @enemydex_window.active
  470.     return select_command if @enemydex_command_window.active
  471.     return in_info if @enemydex_info_window.visible
  472.     return in_intro if @enemydex_intro_window.visible
  473.   end
  474.   #--------------------------------------------------------------------------
  475.   # 选择敌人
  476.   #--------------------------------------------------------------------------
  477.   def select_enemy
  478.     if Input.trigger?(Input::B)
  479.       Sound.play_cancel
  480.       $scene = Scene_Map.new
  481.     end
  482.     if Input.trigger?(Input::C)
  483.       if $game_party.enemy_view[@enemydex_window.enemy.id] > 0
  484.         Sound.play_decision
  485.         @enemydex_window.active = false
  486.         @enemydex_command_window.visible = true
  487.         @enemydex_command_window.active = true
  488.       else
  489.         Sound.play_buzzer
  490.       end
  491.     end
  492.   end
  493.   #--------------------------------------------------------------------------
  494.   # 选择察看内容
  495.   #--------------------------------------------------------------------------
  496.   def select_command
  497.     if Input.trigger?(Input::B)
  498.       Sound.play_cancel
  499.       @enemydex_command_window.active = false
  500.       @enemydex_command_window.visible = false
  501.       @enemydex_window.active = true
  502.     end
  503.     if Input.trigger?(Input::C)
  504.       case @enemydex_command_window.index
  505.       when 0
  506.         @enemydex_window.visible = false
  507.         @enemydex_command_window.active = false
  508.         @enemydex_command_window.visible = false
  509.         @enemydex_intro_window = Window_EnemyDex_Intro.new(@enemydex_window.enemy.id)
  510.         @enemydex_intro_window.visible = true
  511.       when 1
  512.         @enemydex_window.visible = false
  513.         @enemydex_command_window.active = false
  514.         @enemydex_command_window.visible = false
  515.         @enemydex_info_window = Window_EnemyDex_Info.new(@enemydex_window.enemy.id)
  516.         @enemydex_info_window.visible = true
  517.       end
  518.     end
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # 详情察看
  522.   #--------------------------------------------------------------------------
  523.   def in_info
  524.     view = $game_party.enemy_view[@enemydex_window.enemy.id]
  525.     @help_window.set_text("发现数:#{view}")
  526.     if Input.trigger?(Input::B) or Input.trigger?(Input::C)
  527.       Sound.play_cancel
  528.       @enemydex_window.visible = true
  529.       @enemydex_command_window.active = true
  530.       @enemydex_command_window.visible = true
  531.       @enemydex_info_window.visible = false
  532.       @help_window.set_text(view > 0 ? "编号 #{@enemydex_window.enemy.id}" : "----------------")
  533.     end
  534.   end
  535.   #--------------------------------------------------------------------------
  536.   # 详情察看
  537.   #--------------------------------------------------------------------------
  538.   def in_intro
  539.     if Input.trigger?(Input::B) or Input.trigger?(Input::C)
  540.       Sound.play_cancel
  541.       @enemydex_window.visible = true
  542.       @enemydex_command_window.active = true
  543.       @enemydex_command_window.visible = true
  544.       @enemydex_intro_window.visible = false
  545.       view = $game_party.enemy_view[@enemydex_window.enemy.id]
  546.       @help_window.set_text(view > 0 ? "编号 #{@enemydex_window.enemy.id}" : "----------------")
  547.     end
  548.   end
  549. end

  550. #----------------------------------------------------------------------------
  551. # 追加定义
  552. #----------------------------------------------------------------------------
  553. class Scene_Battle
  554.   alias new_battle_end battle_end
  555.   def battle_end(result)
  556.     if result == 0
  557.       for enemy in $game_troop.members
  558.         $game_party.add_enemy_view(enemy.enemy_id)
  559.       end
  560.     end
  561.     new_battle_end(result)
  562.   end
  563. end
复制代码

《天空之城 —— 破碎的命运》
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-25 21:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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