查看: 1485|回复: 2

[已经解决] 求助!怎么做出ESC菜单离队的效果

[复制链接]
梦石
0
星屑
50
在线时间
274 小时
注册时间
2014-2-22
回帖
260
发表于 2014-3-16 14:25:23 | 显示全部楼层 |阅读模式

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

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

×
就是在ESC菜单里选择让队友离队,但不可以让主角离队的这种效果怎么做
梦石
0
星屑
1261
在线时间
423 小时
注册时间
2011-6-30
回帖
470
发表于 2014-3-19 11:13:18 来自手机 | 显示全部楼层
本帖最后由 0newing 于 2014-3-20 00:44 编辑

在菜单的脚本里新增一个整队的选项……然后增加相应的指令
思路就是这样,给出代码如下……(复制粘贴到Scene_Menu下)
感觉最后两行不太完善……请大神再做修改
  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::skill
  55.     s3 = Vocab::equip
  56.     s4 = Vocab::status
  57.     s5 = Vocab::save
  58.     s6 = "整队"
  59.     s7 = Vocab::game_end
  60.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
  61.     @command_window.index = @menu_index
  62.     if $game_party.members.size == 0          # 如果队伍为空
  63.       @command_window.draw_item(0, false)     # 无效化物品选项
  64.       @command_window.draw_item(1, false)     # 无效化技能选项
  65.       @command_window.draw_item(2, false)     # 无效化装备选项
  66.       @command_window.draw_item(3, false)     # 无效化状态选项
  67.     end
  68.     if $game_system.save_disabled             # 如果禁止存档
  69.       @command_window.draw_item(4, false)     # 无效化存档选项
  70.     end
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # ● 更新命令窗口
  74.   #--------------------------------------------------------------------------
  75.   def update_command_selection
  76.     if Input.trigger?(Input::B)
  77.       Sound.play_cancel
  78.       $scene = Scene_Map.new
  79.     elsif Input.trigger?(Input::C)
  80.       if $game_party.members.size == 0 and @command_window.index < 4
  81.         Sound.play_buzzer
  82.         return
  83.       elsif $game_system.save_disabled and @command_window.index == 4
  84.         Sound.play_buzzer
  85.         return
  86.       end
  87.       Sound.play_decision
  88.       case @command_window.index
  89.       when 0      # 物品
  90.         $scene = Scene_Item.new
  91.       when 1,2,3  # 技能、装备、状态
  92.         start_actor_selection
  93.       when 4      # 存档
  94.         $scene = Scene_File.new(true, false, false)
  95.       when 5      # 整队
  96.         start_actor_selection
  97.       when 6      # 结束游戏
  98.         $scene = Scene_End.new
  99.       end
  100.     end
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● 角色选择开始
  104.   #--------------------------------------------------------------------------
  105.   def start_actor_selection
  106.     @command_window.active = false
  107.     @status_window.active = true
  108.     if $game_party.last_actor_index < @status_window.item_max
  109.       @status_window.index = $game_party.last_actor_index
  110.     else
  111.       @status_window.index = 0
  112.     end
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● 角色选择结束
  116.   #--------------------------------------------------------------------------
  117.   def end_actor_selection
  118.     @command_window.active = true
  119.     @status_window.active = false
  120.     @status_window.index = -1
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● 角色选择更新
  124.   #--------------------------------------------------------------------------
  125.   def update_actor_selection
  126.     if Input.trigger?(Input::B)
  127.       Sound.play_cancel
  128.       end_actor_selection
  129.     elsif Input.trigger?(Input::C)
  130.       $game_party.last_actor_index = @status_window.index
  131.       Sound.play_decision
  132.       case @command_window.index
  133.       when 1  # 技能
  134.         $scene = Scene_Skill.new(@status_window.index)
  135.       when 2  # 装备
  136.         $scene = Scene_Equip.new(@status_window.index)
  137.       when 3  # 状态
  138.         $scene = Scene_Status.new(@status_window.index)
  139.       when 5  # 整队
  140.         if @status_window.index == 0
  141.           Sound.play_buzzer
  142.         else
  143.           [url=home.php?mod=space&uid=95897]@actor[/url] = $game_party.members[@status_window.index]
  144.           $game_party.remove_actor(@actor.id)
  145.           @status_window.refresh
  146.           start_actor_selection
  147.         end
  148.       end
  149.     end
  150.   end
  151. end
复制代码

评分

参与人数 1星屑 +80 收起 理由
丿梁丶小柒 + 80 我很赞同

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部