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

Project1

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

[已经过期] 怎么增加伙伴和替补功能?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
996
在线时间
25 小时
注册时间
2013-11-26
帖子
4
跳转到指定楼层
1
发表于 2014-4-12 17:50:34 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
不知道大家有没有这样一个脚本,就是突破四个人的限制,多余的人放在替补整容中,战斗的时候也是四个人战斗,在不战斗时可以随时把主力放替补里,也可以把替补里的角色放到主力里,可以随意调整,有的话给我一个,好急啊!

Lv1.梦旅人

梦石
0
星屑
50
在线时间
105 小时
注册时间
2013-2-7
帖子
82
2
发表于 2014-4-13 08:46:47 | 只看该作者
你是rm什么的,如果是xp的,记得修改最大人数,换人脚本其实就可以实现
RUBY 代码复制
  1. module LimBattlePlug
  2.  
  3. # 队伍最大人数
  4. MaxPartySize = 8      #自己修改最大人数
  5.  
  6. # 出战人数
  7. MaxBattlerSize = 4
  8.  
  9. # 换人语句
  10. WordChangeBattler = "换人"
  11.  
  12. # 换人时播放的动画
  13. AnimationChangeBattler = 26
  14.  
  15. end
  16.  
  17. class Game_BattleAction
  18.   attr_accessor :change_to_battler
  19.   # 初始化
  20.   alias lbp_initialize initialize
  21.   def initialize
  22.     lbp_initialize
  23.     @change_to_battler = 0
  24.   end
  25.   # 欲更换角色编号
  26.   def set_change_battler
  27.     @kind = 3
  28.   end
  29.   # 判断行动是否为更换角色
  30.   def is_change_battler?
  31.     return (@kind == 3)
  32.   end
  33. end
  34.  
  35. class Game_Party
  36.   include LimBattlePlug
  37.   attr_reader :actors2
  38.   alias lpb_initialize initialize
  39.   def initialize
  40.     lpb_initialize
  41.     @actors2 = []
  42.   end
  43.   # 角色加入
  44.   def add_actor(actor_id)
  45.     actor = $game_actors[actor_id]
  46.     if @actors.size < MaxPartySize and not @actors.include?(actor)
  47.       @actors.push(actor)
  48.       $game_player.refresh
  49.     end
  50.   end
  51.   # 设置战斗的角色
  52.   def set_actor_to_battle
  53.     @actors2 = []
  54.     @actors.each do |actor|
  55.       @actors2.push(actor)
  56.     end
  57.     @actors = []
  58.     @actors2.each do |actor|
  59.       @actors.push(actor)
  60.       break if @actors.size == MaxBattlerSize
  61.     end
  62.   end
  63.   # 还原战斗的角色
  64.   def set_actor_to_normal
  65.     @actors = []
  66.     @actors2.each do |actor|
  67.       @actors.push(actor)
  68.     end
  69.   end
  70.   # 获取角色id数组
  71.   def get_actors_id
  72.     id = []
  73.     @actors.each{|actor|id.push(actor.id)}
  74.     return id
  75.   end
  76.   # 获取角色id数组
  77.   def get_actors2_id
  78.     id = []
  79.     @actors2.each{|actor|id.push(actor.id)}
  80.     return id
  81.   end
  82.   # 兑换角色
  83.   def change_actor(index,id)
  84.     @actors[index] = $game_actors[id]
  85.   end
  86.   # 全灭判定
  87.   def all_dead?
  88.     # 同伴人数为 0 的情况下
  89.     if $game_party.actors.size == 0
  90.       return false
  91.     end
  92.     # 同伴中无人 HP 在 0 以上
  93.     for actor in @actors2
  94.       if actor.hp > 0
  95.         return false
  96.       end
  97.     end
  98.     for actor in @actors
  99.       if actor.hp > 0
  100.         return false
  101.       end
  102.     end
  103.     # 全灭
  104.     return true
  105.   end
  106.   # 其他角色
  107.   def other_actors
  108.     actors = []
  109.     @actors2.each{|actor|actors.push(actor) if !@actors.include?(actor)}
  110.     return actors
  111.   end
  112.   # 角色位置互换
  113.   def change_actor_pos(id1,id2)
  114.     actor_id = []
  115.     @actors.each do |actor|
  116.       actor_id.push(actor.id)
  117.     end
  118.     return if !actor_id.include?(id1) and !actor_id.include?(id2)
  119.     id1_index = id2_index = -1
  120.     (0...actor_id.size).each do |i|
  121.       if actor_id[i] == id1
  122.         id1_index = i
  123.       elsif actor_id[i] == id2
  124.         id2_index = i
  125.       end
  126.     end
  127.     temp_actor = @actors[id1_index]
  128.     @actors[id1_index] = @actors[id2_index]
  129.     @actors[id2_index] = temp_actor
  130.   end
  131. end
  132.  
  133. class Window_Actor < Window_Selectable
  134.   # 初始化
  135.   def initialize
  136.     super(0,64,640,256)
  137.     self.back_opacity = 160
  138.     refresh
  139.     self.index = -1
  140.     self.active = false
  141.   end
  142.   # 刷新
  143.   def refresh
  144.     @item_max = $game_party.actors2.size
  145.     @data = []
  146.     $game_party.actors.each do |actor|
  147.       @data.push(actor)
  148.     end
  149.     $game_party.actors2.each do |actor|
  150.       @data.push(actor) if !@data.include?(actor)
  151.     end
  152.     if self.contents != nil
  153.       self.contents.clear
  154.       self.contents = nil
  155.     end
  156.     self.contents = Bitmap.new(608,@data.size*32)
  157.     x = 4
  158.     y = 0
  159.     @data.each do |actor|
  160.       bitmap = RPG::Cache.character(actor.character_name,actor.character_hue)
  161.       rect = Rect.new(0,0,bitmap.width/4,31)
  162.       self.contents.blt(x+16-bitmap.width/8,y,bitmap,rect)
  163.       draw_actor_name(actor,x+36,y)
  164.       draw_actor_state(actor,156,y)
  165.       draw_actor_hp(actor,x+256,y,96)
  166.       draw_actor_sp(actor,x+376,y,96)
  167.       if $game_party.actors.include?(actor)
  168.         self.contents.font.color = text_color(1)
  169.         cword = "出战"
  170.       else
  171.         self.contents.font.color = text_color(0)
  172.         cword = "待战"
  173.       end
  174.       self.contents.draw_text(x+496,y,60,32,cword)
  175.       y += 32
  176.     end
  177.   end
  178.   # 获取当前角色编号
  179.   def actor_id
  180.     return @data[self.index].id
  181.   end
  182.   # 刷新帮助
  183.   def update_help
  184.     @help_window.set_text(@data[self.index] == nil ?\
  185.                           "" : @data[self.index].name)
  186.   end
  187. end
  188.  
  189. class Scene_Battle
  190.   include LimBattlePlug
  191.   # 初始化
  192.   def initialize
  193.     $game_party.set_actor_to_battle
  194.   end
  195.   # 主处理
  196.   def main
  197.     # 初始化战斗用的各种暂时数据
  198.     $game_temp.in_battle = true
  199.     $game_temp.battle_turn = 0
  200.     $game_temp.battle_event_flags.clear
  201.     $game_temp.battle_abort = false
  202.     $game_temp.battle_main_phase = false
  203.     $game_temp.battleback_name = $game_map.battleback_name
  204.     $game_temp.forcing_battler = nil
  205.     # 初始化战斗用事件解释器
  206.     $game_system.battle_interpreter.setup(nil, 0)
  207.     # 准备队伍
  208.     @troop_id = $game_temp.battle_troop_id
  209.     $game_troop.setup(@troop_id)
  210.     # 生成角色命令窗口
  211.     s1 = $data_system.words.attack
  212.     s2 = $data_system.words.skill
  213.     s3 = $data_system.words.guard
  214.     s4 = $data_system.words.item
  215.     s5 = WordChangeBattler
  216.     @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4,s5])
  217.     @actor_command_window.y = 128
  218.     @actor_command_window.back_opacity = 160
  219.     @actor_command_window.active = false
  220.     @actor_command_window.visible = false
  221.     # 生成其它窗口
  222.     @party_command_window = Window_PartyCommand.new
  223.     @help_window = Window_Help.new
  224.     @help_window.back_opacity = 160
  225.     @help_window.visible = false
  226.     @status_window = Window_BattleStatus.new
  227.     @message_window = Window_Message.new
  228.     # 生成活动块
  229.     @spriteset = Spriteset_Battle.new
  230.     # 初始化等待计数
  231.     @wait_count = 0
  232.     # 执行过渡
  233.     if $data_system.battle_transition == ""
  234.       Graphics.transition(20)
  235.     else
  236.       Graphics.transition(40, "Graphics/Transitions/" +
  237.         $data_system.battle_transition)
  238.     end
  239.     # 开始自由战斗回合
  240.     start_phase1
  241.     # 主循环
  242.     loop do
  243.       # 刷新游戏画面
  244.       Graphics.update
  245.       # 刷新输入信息
  246.       Input.update
  247.       # 刷新画面
  248.       update
  249.       # 如果画面切换的话就中断循环
  250.       if $scene != self
  251.         break
  252.       end
  253.     end
  254.     # 刷新地图
  255.     $game_map.refresh
  256.     # 准备过渡
  257.     Graphics.freeze
  258.     # 释放窗口
  259.     @actor_command_window.dispose
  260.     @party_command_window.dispose
  261.     @help_window.dispose
  262.     @status_window.dispose
  263.     @message_window.dispose
  264.     if @skill_window != nil
  265.       @skill_window.dispose
  266.     end
  267.     if @item_window != nil
  268.       @item_window.dispose
  269.     end
  270.     if @actor_window != nil
  271.       @actor_window.dispose
  272.     end
  273.     if @result_window != nil
  274.       @result_window.dispose
  275.     end
  276.     # 释放活动块
  277.     @spriteset.dispose
  278.     # 标题画面切换中的情况
  279.     if $scene.is_a?(Scene_Title)
  280.       # 淡入淡出画面
  281.       Graphics.transition
  282.       Graphics.freeze
  283.     end
  284.     # 战斗测试或者游戏结束以外的画面切换中的情况
  285.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  286.       $scene = nil
  287.     end
  288.   end
  289.   # 战斗结束
  290.   alias lpb_battle_end battle_end
  291.   def battle_end(n)
  292.     lpb_battle_end(n)
  293.     $game_party.set_actor_to_normal
  294.   end
  295.   # 开始回合3
  296.   alias lbp_start_phase3 start_phase3
  297.   def start_phase3
  298.     @changed_battler_id = []
  299.     lbp_start_phase3
  300.   end
  301.   # 刷新角色命令回合画面
  302.   def update_phase3
  303.     # 敌人光标有效的情况下
  304.     if @enemy_arrow != nil
  305.       update_phase3_enemy_select
  306.     # 角色光标有效的情况下
  307.     elsif @actor_arrow != nil
  308.       update_phase3_actor_select
  309.     # 特技窗口有效的情况下
  310.     elsif @skill_window != nil
  311.       update_phase3_skill_select
  312.     # 物品窗口有效的情况下
  313.     elsif @item_window != nil
  314.       update_phase3_item_select
  315.     elsif @actor_window != nil
  316.       update_phase3_battler_select
  317.     # 角色指令窗口有效的情况下
  318.     elsif @actor_command_window.active
  319.       update_phase3_basic_command
  320.     end
  321.   end
  322.   # 角色基本命令
  323.   def update_phase3_basic_command
  324.     # 按下 B 键的情况下
  325.     if Input.trigger?(Input::B)
  326.       # 演奏取消 SE
  327.       $game_system.se_play($data_system.cancel_se)
  328.       # 转向前一个角色的指令输入
  329.       phase3_prior_actor
  330.       return
  331.     end
  332.     # 按下 C 键的情况下
  333.     if Input.trigger?(Input::C)
  334.       # 角色指令窗口光标位置分之
  335.       case @actor_command_window.index
  336.       when 0  # 攻击
  337.         # 演奏确定 SE
  338.         $game_system.se_play($data_system.decision_se)
  339.         # 设置行动
  340.         @active_battler.current_action.kind = 0
  341.         @active_battler.current_action.basic = 0
  342.         # 开始选择敌人
  343.         start_enemy_select
  344.       when 1  # 特技
  345.         # 演奏确定 SE
  346.         $game_system.se_play($data_system.decision_se)
  347.         # 设置行动
  348.         @active_battler.current_action.kind = 1
  349.         # 开始选择特技
  350.         start_skill_select
  351.       when 2  # 防御
  352.         # 演奏确定 SE
  353.         $game_system.se_play($data_system.decision_se)
  354.         # 设置行动
  355.         @active_battler.current_action.kind = 0
  356.         @active_battler.current_action.basic = 1
  357.         # 转向下一位角色的指令输入
  358.         phase3_next_actor
  359.       when 3  # 物品
  360.         # 演奏确定 SE
  361.         $game_system.se_play($data_system.decision_se)
  362.         # 设置行动
  363.         @active_battler.current_action.kind = 2
  364.         # 开始选择物品
  365.         start_item_select
  366.       when 4 # 换人
  367.         $game_system.se_play($data_system.decision_se)
  368.         @active_battler.current_action.set_change_battler
  369.         start_battler_select
  370.       end
  371.       return
  372.     end
  373.   end
  374.   # 开始角色选择
  375.   def start_battler_select
  376.     @actor_window = Window_Actor.new
  377.     @actor_window.active = true
  378.     @actor_window.index = 0
  379.     @actor_window.help_window = @help_window
  380.     @actor_command_window.active = false
  381.     @actor_command_window.visible = false
  382.   end
  383.   # 结束角色选择
  384.   def end_battler_select
  385.     @actor_window.dispose
  386.     @actor_window = nil
  387.     @help_window.visible = false
  388.     @actor_command_window.active = true
  389.     @actor_command_window.visible = true
  390.   end
  391.   # 刷新角色选择
  392.   def update_phase3_battler_select
  393.     @actor_window.visible = true
  394.     @actor_window.update
  395.     if Input.trigger?(Input::B)
  396.       $game_system.se_play($data_system.cancel_se)
  397.       end_battler_select
  398.       return
  399.     end
  400.     if Input.trigger?(Input::C)
  401.       actor_id = @actor_window.actor_id
  402.       if $game_party.get_actors_id.include?(actor_id) or
  403.          $game_actors[actor_id].dead? or
  404.          @changed_battler_id.include?(actor_id)
  405.         $game_system.se_play($data_system.buzzer_se)
  406.         return
  407.       end
  408.       $game_system.se_play($data_system.decision_se)
  409.       @active_battler.current_action.change_to_battler = actor_id
  410.       @changed_battler_id.push(actor_id)
  411.       end_battler_select
  412.       phase3_next_actor
  413.       return
  414.     end
  415.   end
  416.   # 行动方动画
  417.   def update_phase4_step3
  418.     if @active_battler.current_action.is_change_battler?
  419.       @animation1_id = AnimationChangeBattler
  420.       @target_battlers = []
  421.     end
  422.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  423.     if @animation1_id == 0
  424.       @active_battler.white_flash = true
  425.     else
  426.       @active_battler.animation_id = @animation1_id
  427.       @active_battler.animation_hit = true
  428.     end
  429.     # 移至步骤 4
  430.     @phase4_step = 4
  431.   end
  432.   # 对象方动画
  433.   def update_phase4_step4
  434.     if @active_battler.current_action.is_change_battler?
  435.       actor1_id = @active_battler.current_action.change_to_battler
  436.       actor2_id = @active_battler.id
  437.       (0...$game_party.actors.size).each do |i|
  438.         if $game_party.actors[i].id == actor2_id
  439.           $game_party.change_actor(i,actor1_id)
  440.           @active_battler = $game_actors[actor1_id]
  441.           @status_window.refresh
  442.         end
  443.       end
  444.     end
  445.     # 对像方动画
  446.     for target in @target_battlers
  447.       target.animation_id = @animation2_id
  448.       target.animation_hit = (target.damage != "Miss")
  449.     end
  450.     # 限制动画长度、最低 8 帧
  451.     @wait_count = 8
  452.     # 移至步骤 5
  453.     @phase4_step = 5
  454.   end
  455.   # 公共事件
  456.   def update_phase4_step6
  457.     @target_battlers.each do |target|
  458.       if target.is_a?(Game_Actor) and target.dead? and
  459.          !$game_party.other_actors.all?{|actor|actor.dead?}
  460.         @actor_window = Window_Actor.new
  461.         @actor_window.index = 0
  462.         @actor_window.active = true
  463.         @actor_window.help_window = @help_window
  464.         actor_id = -1
  465.         loop do
  466.           Graphics.update
  467.           Input.update
  468.           @actor_window.update
  469.           if Input.trigger?(Input::C)
  470.             actor = $game_actors[@actor_window.actor_id]
  471.             if actor.dead? or
  472.                (@changed_battler_id.include?(actor.id) and
  473.                 target.current_action.change_to_battler != actor.id) or
  474.                $game_party.actors.include?(actor)
  475.               $game_system.se_play($data_system.buzzer_se)
  476.             else
  477.               actor_id = actor.id
  478.             end
  479.           end
  480.           break if actor_id >= 0
  481.         end
  482.         @actor_window.visible = false
  483.         @actor_window.dispose
  484.         @actor_window = nil
  485.         @help_window.visible = false
  486.         (0...$game_party.actors.size).each do |i|
  487.           if $game_party.actors[i].id == target.id
  488.             $game_party.change_actor(i,actor_id)
  489.             @status_window.refresh
  490.           end
  491.         end
  492.       end
  493.     end
  494.     # 清除强制行动对像的战斗者
  495.     $game_temp.forcing_battler = nil
  496.     # 公共事件 ID 有效的情况下
  497.     if @common_event_id > 0
  498.       # 设置事件
  499.       common_event = $data_common_events[@common_event_id]
  500.       $game_system.battle_interpreter.setup(common_event.list, 0)
  501.     end
  502.     # 移至步骤 1
  503.     @phase4_step = 1
  504.   end
  505. end
  506.  
  507. class Window_MenuStatus
  508.   def refresh
  509.     self.contents.clear
  510.     @item_max = $game_party.actors.size
  511.     for i in 0...$game_party.actors.size
  512.       x = 4
  513.       y = i * 32
  514.       actor = $game_party.actors[i]
  515.       bitmap = RPG::Cache.character(actor.character_name,actor.character_hue)
  516.       rect = Rect.new(0,0,bitmap.width/4,31)
  517.       self.contents.blt(x+16-bitmap.width/8,y,bitmap,rect)
  518.       draw_actor_name(actor, x+36, y)
  519.       draw_actor_state(actor, x + 136,y)
  520.       draw_actor_hp(actor, x + 236, y,96)
  521.       draw_actor_sp(actor, x + 336, y,96)
  522.     end
  523.   end
  524.   def update_cursor_rect
  525.     super
  526.   end
  527. end
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
996
在线时间
25 小时
注册时间
2013-11-26
帖子
4
3
 楼主| 发表于 2014-4-13 09:22:36 | 只看该作者
jilei 发表于 2014-4-13 08:46
你是rm什么的,如果是xp的,记得修改最大人数,换人脚本其实就可以实现module LimBattlePlug

# 队伍最大人 ...

太感谢了,我去试试!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
439 小时
注册时间
2013-3-2
帖子
710
4
发表于 2014-4-13 12:33:47 | 只看该作者
  1. #-----------------------------------------------------------------------------
  2. # 队伍系统 Ver 1.0 (附带整合游戏主菜单)
  3. #-----------------------------------------------------------------------------
  4. # 类似于Aveyond的队伍系统(根据阿月系列的游戏产生的灵感)
  5. # 作者:RyanBern
  6. #-----------------------------------------------------------------------------
  7. # 功能特色:
  8. #-----------------------------------------------------------------------------
  9. # 1.更改队伍中成员的最大数量,有四名出战队员,但是替补队员可以有很多个。
  10. # 2.改编自默认脚本,极大程度上和原来脚本兼容,应该没有很严重的冲突。
  11. # 3.为队伍增加“领队”角色,作为“领队”的成员在地图上显示他的图形,“领队”必须出战。
  12. # 4.只有出战队员才能获得经验奖励,替补队员不能获得作战奖励。
  13. # 5.如果队伍的出战队员全部阵亡,则直接判定玩家全灭,不管有无替补队员。
  14. # 6.事件编译器中,对全体同伴的处理均包括对替补队员的处理。
  15. #-----------------------------------------------------------------------------
  16. # 使用方法:
  17. #-----------------------------------------------------------------------------
  18. # 1.粘贴到默认脚本后面,Main组前面即可。
  19. # 2.作为leader的成员必须是作战队员,如果想替换下该队员,请先改变leader。
  20. # 3.被换下的成员会自动成为替补队员名单的最后一名。
  21. # 4.游戏系统因人而异,如果你改过Scene_Menu,可能会和你更改的脚本冲突。
  22. #   这个我没有办法做成放到每一个游戏系统都合适的脚本,还请自行修改。
  23. #   如果没改过太多的脚本,没有问题。
  24. #-----------------------------------------------------------------------------
  25. class Game_Party
  26.   attr_accessor :leader
  27.   attr_accessor :reserved_actors
  28.   alias old_ini initialize
  29.   def initialize
  30.     @leader = nil
  31.     @reserved_actors = []
  32.     old_ini
  33.   end
  34.   # 重置@reserved_actors
  35.   def adjust
  36.     if @reserved_actors == nil
  37.       @reserved_actors = []
  38.     end
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # 设置领队
  42.   #   index : 角色在@actors中的序号,注意并非角色在数据库中的id
  43.   #--------------------------------------------------------------------------
  44.   def set_leader(index)
  45.     @leader = @actors[index]
  46.   end
  47.   #--------------------------------------------------------------------------
  48.   # 获取领队在@actors的index
  49.   #--------------------------------------------------------------------------
  50.   def leader_judge
  51.     for i in [email protected]
  52.       if @leader.id == @actors[i].id
  53.         return i
  54.       end
  55.     end
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● 加入同伴
  59.   #     actor_id : 角色 ID
  60.   #--------------------------------------------------------------------------
  61.   def add_actor(actor_id)
  62.     adjust
  63.     # 获取角色
  64.     actor = $game_actors[actor_id]
  65.     # 除非本角色不在队伍中
  66.     unless @actors.include?(actor) or @reserved_actors.include?(actor)
  67.       # 添加角色
  68.       if @actors.size < 4
  69.         # 人数未满就放到@actors中
  70.         @actors.push(actor)
  71.       else
  72.         # 人数满了就放到@reserved_actors中
  73.         @reserved_actors.push(actor)
  74.       end
  75.       # 设置领队(队伍从无人变有人)
  76.       if @actors.size == 1
  77.         @leader = @actors[0]
  78.       end
  79.       # 还原主角
  80.       $game_player.refresh
  81.     end
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● 角色离开
  85.   #     actor_id : 角色 ID
  86.   #--------------------------------------------------------------------------
  87.   def remove_actor(actor_id)
  88.     adjust
  89.     # 判定角色是否是领队
  90.     lead = $game_party.leader_judge
  91.     flag = false
  92.     if $game_party.actors[lead].id == actor_id
  93.       flag = true
  94.     end
  95.     # 删除角色
  96.     @actors.delete($game_actors[actor_id])
  97.     # 如果领队离开
  98.     if flag
  99.       # 如果删除之后出现无人出战的情况
  100.       if @actors.size == 0
  101.         # 替补队员名单有人的情况下
  102.         if @reserved_actors.size > 0
  103.           # 将@reserved_actors中的第一个移动到@actors中
  104.           @actors.push(@reserved_actors.shift)
  105.           # 设置领队
  106.           @leader = @actors[0]
  107.         else
  108.           @leader = nil
  109.         end
  110.       else
  111.         @leader = @actors[0]
  112.       end
  113.     end
  114.     # 还原主角
  115.     $game_player.refresh
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # ● 设置初期同伴
  119.   #--------------------------------------------------------------------------
  120.   def setup_starting_members
  121.     @actors = []
  122.     for i in $data_system.party_members
  123.       @actors.push($game_actors[i])
  124.     end
  125.     unless @actors.empty?
  126.       set_leader(0)
  127.     end
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # ● 全灭判定
  131.   #--------------------------------------------------------------------------
  132.   def all_dead?
  133.     # 同伴人数为 0 的情况下
  134.     if $game_party.actors.size == 0
  135.       return false
  136.     end
  137.     # 同伴中无人 HP 在 0 以上
  138.     for actor in @actors
  139.       if actor.hp > 0
  140.         return false
  141.       end
  142.     end
  143.     # 全灭
  144.     return true
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ● 检查连续伤害 (地图用)
  148.   #--------------------------------------------------------------------------
  149.   def check_map_slip_damage
  150.     for actor in @actors + @reserved_actors
  151.       if actor.hp > 0 and actor.slip_damage?
  152.         actor.hp -= [actor.maxhp / 100, 1].max
  153.         if actor.hp == 0
  154.           $game_system.se_play($data_system.actor_collapse_se)
  155.         end
  156.         $game_screen.start_flash(Color.new(255,0,0,128), 4)
  157.         $game_temp.gameover = $game_party.all_dead?
  158.       end
  159.     end
  160.   end
  161. end

  162. class Game_Player
  163.   #--------------------------------------------------------------------------
  164.   # ● 刷新
  165.   #--------------------------------------------------------------------------
  166.   def refresh
  167.     # 同伴人数为 0 的情况下
  168.     if $game_party.actors.size == 0 or $game_party.leader == nil
  169.       # 清除角色的文件名及对像
  170.       @character_name = ""
  171.       @character_hue = 0
  172.       # 分支结束
  173.       return
  174.     end
  175.     # 获取带头的角色
  176.     if $game_party.leader != nil
  177.       actor = $game_party.leader
  178.       # 设置角色的文件名及对像
  179.       @character_name = actor.character_name
  180.       @character_hue = actor.character_hue
  181.       # 初始化不透明度和合成方式子
  182.       [url=home.php?mod=space&uid=316553]@opacity[/url] = 255
  183.       @blend_type = 0
  184.     end
  185.   end
  186. end

  187. class Window_Base < Window
  188.   def draw_actor_leader(x, y)
  189.     if $game_party.leader == nil
  190.       return
  191.     end
  192.     a = $game_party.leader_judge
  193.     self.contents.font.color = normal_color
  194.     self.contents.draw_text(x-50, y + a * 116, 64, 32, "领队",2)
  195.   end
  196. end

  197. class Window_MenuStatus < Window_Selectable
  198.   alias old_refresh refresh
  199.   def refresh
  200.     old_refresh
  201.     draw_actor_leader(384,0)
  202.   end
  203. end

  204. #==============================================================================
  205. # ■ Window_Selectable
  206. #------------------------------------------------------------------------------
  207. #  拥有光标的移动以及滚动功能的窗口类。
  208. #==============================================================================

  209. class Window_Selectable < Window_Base
  210.   #--------------------------------------------------------------------------
  211.   # ● 定义实例变量
  212.   #--------------------------------------------------------------------------
  213.   attr_reader   :index                    # 光标位置
  214.   attr_reader   :help_window              # 帮助窗口
  215.   attr_accessor :row_height               # 行高
  216.   #--------------------------------------------------------------------------
  217.   # ● 初始画对像
  218.   #     x      : 窗口的 X 坐标
  219.   #     y      : 窗口的 Y 坐标
  220.   #     width  : 窗口的宽
  221.   #     height : 窗口的高
  222.   #     row_height : 行高 默认是32
  223.   #--------------------------------------------------------------------------
  224.   def initialize(x, y, width, height, row_height=32)
  225.     super(x, y, width, height)
  226.     @item_max = 1
  227.     @column_max = 1
  228.     [url=home.php?mod=space&uid=370741]@Index[/url] = -1
  229.     @row_height = row_height
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ● 设置光标的位置
  233.   #     index : 新的光标位置
  234.   #--------------------------------------------------------------------------
  235.   def index=(index)
  236.     @index = index
  237.     # 刷新帮助文本 (update_help 定义了继承目标)
  238.     if self.active and @help_window != nil
  239.       update_help
  240.     end
  241.     # 刷新光标矩形
  242.     update_cursor_rect
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # ● 获取行数
  246.   #--------------------------------------------------------------------------
  247.   def row_max
  248.     # 由项目数和列数计算出行数
  249.     return (@item_max + @column_max - 1) / @column_max
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ● 获取开头行
  253.   #--------------------------------------------------------------------------
  254.   def top_row
  255.     # 将窗口内容的传送源 Y 坐标、1 行的高 row_height 等分
  256.     return self.oy / @row_height
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● 设置开头行
  260.   #     row : 显示开头的行
  261.   #--------------------------------------------------------------------------
  262.   def top_row=(row)
  263.     # row 未满 0 的场合更正为 0
  264.     if row < 0
  265.       row = 0
  266.     end
  267.     # row 超过 row_max - 1 的情况下更正为 row_max - 1
  268.     if row > row_max - 1
  269.       row = row_max - 1
  270.     end
  271.     # row 1 行高的 32 倍、窗口内容的传送源 Y 坐标
  272.     self.oy = row * @row_height
  273.   end
  274.   #--------------------------------------------------------------------------
  275.   # ● 获取 1 页可以显示的行数
  276.   #--------------------------------------------------------------------------
  277.   def page_row_max
  278.     # 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 row_height
  279.     return (self.height - 32) / @row_height
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● 获取 1 页可以显示的项目数
  283.   #--------------------------------------------------------------------------
  284.   def page_item_max
  285.     # 将行数 page_row_max 乘上列数 @column_max
  286.     return page_row_max * @column_max
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● 帮助窗口的设置
  290.   #     help_window : 新的帮助窗口
  291.   #--------------------------------------------------------------------------
  292.   def help_window=(help_window)
  293.     @help_window = help_window
  294.     # 刷新帮助文本 (update_help 定义了继承目标)
  295.     if self.active and @help_window != nil
  296.       update_help
  297.     end
  298.   end
  299.   #--------------------------------------------------------------------------
  300.   # ● 更新光标举行
  301.   #--------------------------------------------------------------------------
  302.   def update_cursor_rect
  303.     # 光标位置不满 0 的情况下
  304.     if @index < 0
  305.       self.cursor_rect.empty
  306.       return
  307.     end
  308.     # 获取当前的行
  309.     row = @index / @column_max
  310.     # 当前行被显示开头行前面的情况下
  311.     if row < self.top_row
  312.       # 从当前行向开头行滚动
  313.       self.top_row = row
  314.     end
  315.     # 当前行被显示末尾行之后的情况下
  316.     if row > self.top_row + (self.page_row_max - 1)
  317.       # 从当前行向末尾滚动
  318.       self.top_row = row - (self.page_row_max - 1)
  319.     end
  320.     # 计算光标的宽
  321.     cursor_width = self.width / @column_max - 32
  322.     # 计算光标坐标
  323.     x = @index % @column_max * (cursor_width + 32)
  324.     y = @index / @column_max * @row_height - self.oy
  325.     # 更新国标矩形
  326.     self.cursor_rect.set(x, y, cursor_width, @row_height)
  327.   end
  328.   #--------------------------------------------------------------------------
  329.   # ● 刷新画面
  330.   #--------------------------------------------------------------------------
  331.   def update
  332.     super
  333.     # 可以移动光标的情况下
  334.     if self.active and @item_max > 0 and @index >= 0
  335.       # 方向键下被按下的情况下
  336.       if Input.repeat?(Input::DOWN)
  337.         # 列数不是 1 并且方向键的下的按下状态不是重复的情况、
  338.         # 或光标位置在(项目数-列数)之前的情况下
  339.         if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
  340.            @index < @item_max - @column_max
  341.           # 光标向下移动
  342.           $game_system.se_play($data_system.cursor_se)
  343.           @index = (@index + @column_max) % @item_max
  344.         end
  345.       end
  346.       # 方向键上被按下的情况下
  347.       if Input.repeat?(Input::UP)
  348.         # 列数不是 1 并且方向键的下的按下状态不是重复的情况、
  349.         # 或光标位置在列之后的情况下
  350.         if (@column_max == 1 and Input.trigger?(Input::UP)) or
  351.            @index >= @column_max
  352.           # 光标向上移动
  353.           $game_system.se_play($data_system.cursor_se)
  354.           @index = (@index - @column_max + @item_max) % @item_max
  355.         end
  356.       end
  357.       # 方向键右被按下的情况下
  358.       if Input.repeat?(Input::RIGHT)
  359.         # 列数为 2 以上并且、光标位置在(项目数 - 1)之前的情况下
  360.         if @column_max >= 2 and @index < @item_max - 1
  361.           # 光标向右移动
  362.           $game_system.se_play($data_system.cursor_se)
  363.           @index += 1
  364.         end
  365.       end
  366.       # 方向键左被按下的情况下
  367.       if Input.repeat?(Input::LEFT)
  368.         # 列数为 2 以上并且、光标位置在 0 之后的情况下
  369.         if @column_max >= 2 and @index > 0
  370.           # 光标向左移动
  371.           $game_system.se_play($data_system.cursor_se)
  372.           @index -= 1
  373.         end
  374.       end
  375.       # R 键被按下的情况下
  376.       if Input.repeat?(Input::R)
  377.         # 显示的最后行在数据中最后行上方的情况下
  378.         if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
  379.           # 光标向后移动一页
  380.           $game_system.se_play($data_system.cursor_se)
  381.           @index = [@index + self.page_item_max, @item_max - 1].min
  382.           self.top_row += self.page_row_max
  383.         end
  384.       end
  385.       # L 键被按下的情况下
  386.       if Input.repeat?(Input::L)
  387.         # 显示的开头行在位置 0 之后的情况下
  388.         if self.top_row > 0
  389.           # 光标向前移动一页
  390.           $game_system.se_play($data_system.cursor_se)
  391.           @index = [@index - self.page_item_max, 0].max
  392.           self.top_row -= self.page_row_max
  393.         end
  394.       end
  395.     end
  396.     # 刷新帮助文本 (update_help 定义了继承目标)
  397.     if self.active and @help_window != nil
  398.       update_help
  399.     end
  400.     # 刷新光标矩形
  401.     update_cursor_rect
  402.   end
  403. end
  404. #==============================================================================
  405. # ■ Window_PartyMembers
  406. #------------------------------------------------------------------------------
  407. #  显示非领队队员概况的窗口。
  408. #==============================================================================

  409. class Window_PartyMembers < Window_Selectable
  410.   #--------------------------------------------------------------------------
  411.   # ● 初始化目标
  412.   #--------------------------------------------------------------------------
  413.   def initialize
  414.     super(80, 0, 480, 480, 112)
  415.     $game_party.adjust
  416.     @item_max = $game_party.actors.size + $game_party.reserved_actors.size - 1
  417.     @column_max  = 1
  418.     self.contents = Bitmap.new(width - 32, @item_max == 0 ? height - 32 : @item_max * 112)
  419.     self.contents.clear
  420.     @data = $game_party.actors + $game_party.reserved_actors
  421.     @data.sort!{ |a,b| a.id - b.id }
  422.     a = $game_party.leader_judge
  423.     @data.delete($game_party.actors[a])
  424.     refresh
  425.     self.index = 0
  426.   end
  427.   #--------------------------------------------------------------------------
  428.   # ● 刷新
  429.   #--------------------------------------------------------------------------
  430.   def refresh
  431.     self.contents.clear
  432.     for i in 0...@item_max
  433.       x = 64
  434.       y = i * 112
  435.       actor = @data[i]
  436.       if $game_party.actors.include?(actor)
  437.         self.contents.font.color = normal_color
  438.         self.contents.draw_text(280, y, 128, 32, "战斗", 2)
  439.       else
  440.         self.contents.font.color = disabled_color
  441.         self.contents.draw_text(280, y, 128, 32, "休战", 2)
  442.       end
  443.      # draw_actor_graphic(actor, x - 40, y + 80)
  444.     bitmap = Bitmap.new("Graphics/Faces/" + actor.id. to_s + "_Z")#RPG::Cache.character(actor.character_name, actor.character_hue)
  445.     cw = bitmap.width
  446.     ch = bitmap.height
  447.     src_rect = Rect.new(0, 0, cw, ch)
  448.     self.contents.blt(x-60, y+30, bitmap, src_rect)
  449.       draw_actor_name(actor, x, y)
  450.       draw_actor_class(actor, x, y+25)
  451.       draw_actor_level(actor, x+100, y)
  452.       draw_actor_state(actor, x + 90, y + 95)
  453.       draw_actor_exp(actor, x, y + 64)
  454.       draw_actor_hp(actor, x + 236, y + 32)
  455.       draw_actor_sp(actor, x + 236, y + 64)
  456.     end
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # 获取当前光标所指的角色
  460.   #--------------------------------------------------------------------------
  461.   def current_actor
  462.     return @data[@index]
  463.   end
  464. end

  465. class Interpreter
  466.   #--------------------------------------------------------------------------
  467.   # ● 角色用 iterate (考虑全体同伴)
  468.   #     parameter : 1 以上为 ID、0 为全体
  469.   #--------------------------------------------------------------------------
  470.   def iterate_actor(parameter)
  471.     # 全体同伴的情况下
  472.     if parameter == 0
  473.       # 同伴全体循环
  474.       for actor in $game_party.actors + $game_party.reserved_actors
  475.         # 评价块
  476.         yield actor
  477.       end
  478.     # 单体角色的情况下
  479.     else
  480.       # 获取角色
  481.       actor = $game_actors[parameter]
  482.       # 获取角色
  483.       yield actor if actor != nil
  484.     end
  485.   end
  486. end

  487. class Scene_Party
  488.   def main
  489.     $game_party.adjust
  490.     @members_window = Window_PartyMembers.new
  491.     # 执行过渡
  492.     Graphics.transition
  493.     # 主循环
  494.     loop do
  495.       # 刷新游戏画面
  496.       Graphics.update
  497.       # 刷新输入情报
  498.       Input.update
  499.       # 刷新画面
  500.       update
  501.       # 如果画面切换的话就中断循环
  502.       if $scene != self
  503.         break
  504.       end
  505.     end
  506.     # 准备过渡
  507.     Graphics.freeze
  508.     # 释放窗口
  509.     @members_window.dispose
  510.   end
  511.   
  512.   def update
  513.     @members_window.update
  514.     if Input.trigger?(Input::B)
  515.       # 演奏取消 SE
  516.       $game_system.se_play($data_system.cancel_se)
  517.       $scene = Scene_Menu.new(3)
  518.       return
  519.     end
  520.     if Input.trigger?(Input::C)
  521.       cur_actor = @members_window.current_actor
  522.       if cur_actor == nil
  523.         $game_system.se_play($data_system.buzzer_se)
  524.         return
  525.       end
  526.       if($game_party.actors.include?(cur_actor))
  527.         $game_system.se_play($data_system.decision_se)
  528.         $game_party.reserved_actors.push(cur_actor)
  529.         $game_party.actors.delete(cur_actor)
  530.         @members_window.refresh
  531.       else
  532.         if $game_party.actors.size < 4
  533.           $game_system.se_play($data_system.decision_se)
  534.           $game_party.actors.push(cur_actor)
  535.           $game_party.reserved_actors.delete(cur_actor)
  536.           @members_window.refresh
  537.         else
  538.           $game_system.se_play($data_system.buzzer_se)
  539.         end
  540.       end
  541.     end
  542.   end
  543. end

  544. #==============================================================================
  545. # ■ Scene_Menu
  546. #------------------------------------------------------------------------------
  547. #  处理菜单画面的类。
  548. #==============================================================================

  549. class Scene_Menu
  550.   #--------------------------------------------------------------------------
  551.   # ● 初始化对像
  552.   #     menu_index : 命令光标的初期位置
  553.   #--------------------------------------------------------------------------
  554.   def initialize(menu_index = 0)
  555.     @menu_index = menu_index
  556.   end
  557.   #--------------------------------------------------------------------------
  558.   # ● 主处理
  559.   #--------------------------------------------------------------------------
  560.   def main
  561.     # 生成命令窗口
  562.     s1 = $data_system.words.item
  563.     s2 = $data_system.words.skill
  564.     s3 = $data_system.words.equip
  565.     s4 = "队伍"
  566.     s5 = "领队"
  567.     s6 = "状态"
  568.     s7 = "存档"
  569.     s8 = "读档"
  570.     s9 = "退出"
  571.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8, s9])
  572.     @command_window.index = @menu_index
  573.     # 同伴人数为 0 的情况下
  574.     if $game_party.actors.size == 0
  575.       # 物品、特技、装备、状态无效化
  576.       @command_window.disable_item(0)
  577.       @command_window.disable_item(1)
  578.       @command_window.disable_item(2)
  579.       @command_window.disable_item(3)      
  580.       @command_window.disable_item(4)
  581.       @command_window.disable_item(5)
  582.     end
  583.     # 禁止存档的情况下
  584.     if $game_system.save_disabled
  585.       # 存档无效
  586.       @command_window.disable_item(6)
  587.     end
  588.     # 生成游戏时间窗口
  589.     #@playtime_window = Window_PlayTime.new
  590.     #@playtime_window.x = 0
  591.     #@playtime_window.y = 430
  592.     # 生成步数窗口
  593.     @steps_window = Window_Steps.new
  594.     @steps_window.x = 0
  595.     @steps_window.y = 320
  596.     # 生成金钱窗口
  597.     @gold_window = Window_Gold.new
  598.     @gold_window.x = 0
  599.     @gold_window.y = 422
  600.     # 生成状态窗口
  601.     @status_window = Window_MenuStatus.new
  602.     @status_window.x = 160
  603.     @status_window.y = 0
  604.     # 生成坐标窗口
  605.     #@xy_window = Window_xy.new
  606.     #@xy_window.x = 0
  607.     #@xy_window.y = 380
  608.     # 执行过渡
  609.     Graphics.transition
  610.     # 主循环
  611.     loop do
  612.       # 刷新游戏画面
  613.       Graphics.update
  614.       # 刷新输入信息
  615.       Input.update
  616.       # 刷新画面
  617.       update
  618.       # 如果切换画面就中断循环
  619.       if $scene != self
  620.         break
  621.       end
  622.     end
  623.     # 准备过渡
  624.     Graphics.freeze
  625.     # 释放窗口
  626.     @command_window.dispose
  627. #    @playtime_window.dispose
  628.     @steps_window.dispose
  629.     @gold_window.dispose
  630.     #@xy_window.dispose
  631.     @status_window.dispose
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # ● 刷新画面
  635.   #--------------------------------------------------------------------------
  636.   def update
  637.     # 刷新窗口
  638.     @command_window.update
  639. #    @playtime_window.update
  640.     @steps_window.update
  641.     @gold_window.update
  642.     #@xy_window.update
  643.     @status_window.update
  644.     # 命令窗口被激活的情况下: 调用 update_command
  645.     if @command_window.active
  646.       update_command
  647.       return
  648.     end
  649.     # 状态窗口被激活的情况下: 调用 update_status
  650.     if @status_window.active
  651.       update_status
  652.       return
  653.     end
  654.   end
  655.   #--------------------------------------------------------------------------
  656.   # ● 刷新画面 (命令窗口被激活的情况下)
  657.   #--------------------------------------------------------------------------
  658.   def update_command
  659.     # 按下 B 键的情况下
  660.     if Input.trigger?(Input::B)
  661.       # 演奏取消 SE
  662.       $game_system.se_play($data_system.cancel_se)
  663.       # 切换的地图画面############
  664.       $scene = Scene_Map.new
  665.       return
  666.     end
  667.     # 按下 C 键的情况下
  668.     if Input.trigger?(Input::C)
  669.       # 同伴人数为 0、存档、游戏结束以外的场合
  670.       if $game_party.actors.size == 0 and @command_window.index < 4
  671.         # 演奏冻结 SE
  672.         $game_system.se_play($data_system.buzzer_se)
  673.         return
  674.       end
  675.       # 命令窗口的光标位置分支(修改)
  676.       case @command_window.index
  677.       when 0  # 物品
  678.         # 演奏确定 SE
  679.         $game_system.se_play($data_system.decision_se)
  680.         # 切换到物品画面
  681.         $scene = Scene_Item.new
  682.       when 1  # 特技
  683.         # 演奏确定 SE
  684.         $game_system.se_play($data_system.decision_se)
  685.         # 激活状态窗口
  686.         @command_window.active = false
  687.         @status_window.active = true
  688.         @status_window.index = 0
  689.       when 2  # 装备
  690.         # 演奏确定 SE
  691.         $game_system.se_play($data_system.decision_se)
  692.         # 激活状态窗口
  693.         @command_window.active = false
  694.         @status_window.active = true
  695.         @status_window.index = 0
  696.       when 4  # 领队
  697.         # 演奏确定 SE
  698.         $game_system.se_play($data_system.decision_se)
  699.         # 激活状态窗口
  700.         @command_window.active = false
  701.         @status_window.active = true
  702.         @status_window.index = 0
  703.        when 3  # 队伍
  704.         # 演奏确定 SE
  705.         $game_system.se_play($data_system.decision_se)
  706.         # 切换到队员画面
  707.         $scene = Scene_Party.new
  708.        when 5  # 状态
  709.         # 演奏确定 SE
  710.         $game_system.se_play($data_system.decision_se)
  711.         # 激活状态窗口
  712.         @command_window.active = false
  713.         @status_window.active = true
  714.         @status_window.index = 0
  715.        when 6  # 存档
  716.          #禁止存档的情况下
  717.         if $game_system.save_disabled
  718.            #演奏冻结 SE
  719.           $game_system.se_play($data_system.buzzer_se)
  720.           return
  721.        end
  722.          #演奏确定 SE
  723.         $game_system.se_play($data_system.decision_se)
  724.          #切换到存档画面
  725.         $scene = Scene_Loadsave.new#$scene = Scene_Save.new
  726.        when 7  # 读档
  727.         #演奏确定 SE
  728.         $game_system.se_play($data_system.decision_se)
  729.         $load_calling = true
  730.         #切换到读档画面
  731.         $scene = Scene_Load.new
  732.        when 8  # 游戏结束
  733.         # 演奏确定 SE
  734.         $game_system.se_play($data_system.decision_se)
  735.         # 切换到游戏结束画面
  736.         $scene = Scene_End.new
  737.       end
  738.       return
  739.     end
  740.   end
  741.   #--------------------------------------------------------------------------
  742.   # ● 刷新画面 (状态窗口被激活的情况下)
  743.   #--------------------------------------------------------------------------
  744.   def update_status
  745.     # 按下 B 键的情况下
  746.     if Input.trigger?(Input::B)
  747.       # 演奏取消 SE
  748.       $game_system.se_play($data_system.cancel_se)
  749.       # 激活命令窗口
  750.       @command_window.active = true
  751.       @status_window.active = false
  752.       @status_window.index = -1
  753.       return
  754.     end
  755.     # 按下 C 键的情况下
  756.     if Input.trigger?(Input::C)
  757.       # 命令窗口的光标位置分支
  758.       case @command_window.index
  759.       when 1  # 特技
  760.         # 本角色的行动限制在 2 以上的情况下
  761.         if $game_party.actors[@status_window.index].restriction >= 2
  762.           # 演奏冻结 SE
  763.           $game_system.se_play($data_system.buzzer_se)
  764.           return
  765.         end
  766.         # 演奏确定 SE
  767.         $game_system.se_play($data_system.decision_se)
  768.         # 切换到特技画面
  769.         $scene = Scene_Skill.new(@status_window.index)
  770.       when 2  # 装备
  771.         # 演奏确定 SE
  772.         $game_system.se_play($data_system.decision_se)
  773.         # 切换的装备画面
  774.         $scene = Scene_Equip.new(@status_window.index)
  775.       when 4  # 领队
  776.         # 演奏确定 SE
  777.         $game_system.se_play($data_system.decision_se)
  778.         $game_party.set_leader(@status_window.index)
  779.         $game_player.refresh
  780.         @status_window.refresh
  781.       when 5  # 状态
  782.         # 演奏确定 SE
  783.         $game_system.se_play($data_system.decision_se)
  784.         # 切换到状态画面
  785.         $scene = Scene_Status.new(@status_window.index)
  786.       end
  787.       return
  788.     end
  789.   end
  790. end

  791. class Scene_Status
  792.   #--------------------------------------------------------------------------
  793.   # ● 刷新画面
  794.   #--------------------------------------------------------------------------
  795.   def update
  796.     # 按下 B 键的情况下
  797.     if Input.trigger?(Input::B)
  798.       # 演奏取消 SE
  799.       $game_system.se_play($data_system.cancel_se)
  800.       # 切换到菜单画面
  801.       $scene = Scene_Menu.new(5)
  802.       return
  803.     end
  804.     # 按下 R 键的情况下
  805.     if Input.trigger?(Input::R)
  806.       # 演奏光标 SE
  807.       $game_system.se_play($data_system.cursor_se)
  808.       # 移至下一位角色
  809.       @actor_index += 1
  810.       @actor_index %= $game_party.actors.size
  811.       # 切换到别的状态画面
  812.       $scene = Scene_Status.new(@actor_index)
  813.       return
  814.     end
  815.     # 按下 L 键的情况下
  816.     if Input.trigger?(Input::L)
  817.       # 演奏光标 SE
  818.       $game_system.se_play($data_system.cursor_se)
  819.       # 移至上一位角色
  820.       @actor_index += $game_party.actors.size - 1
  821.       @actor_index %= $game_party.actors.size
  822.       # 切换到别的状态画面
  823.       $scene = Scene_Status.new(@actor_index)
  824.       return
  825.     end
  826.   end
  827. end

  828. class Scene_Save
  829.   #--------------------------------------------------------------------------
  830.   # ● 取消时的处理
  831.   #--------------------------------------------------------------------------
  832.   def on_cancel
  833.     # 演奏取消 SE
  834.     $game_system.se_play($data_system.cancel_se)
  835.     # 如果被事件调用
  836.     if $game_temp.save_calling
  837.       # 清除存档调用标志
  838.       $game_temp.save_calling = false
  839.       # 切换到地图画面
  840.       $scene = Scene_Map.new
  841.       return
  842.     end
  843.     # 切换到菜单画面
  844.     $scene = Scene_Menu.new(6)
  845.   end
  846. end

  847. class Scene_Load
  848.   #--------------------------------------------------------------------------
  849.   # ● 取消时的处理
  850.   #--------------------------------------------------------------------------
  851.   def on_cancel
  852.     # 演奏取消 SE
  853.     $game_system.se_play($data_system.cancel_se)
  854.     # 切换到标题画面
  855.     if $load_calling == true
  856.       $load_calling = false
  857.       $scene = Scene_Menu.new(7)
  858.     else
  859.       $scene = Scene_Title.new
  860.     end
  861.   end
  862. end

  863. class Scene_End
  864.   #--------------------------------------------------------------------------
  865.   # ● 刷新画面
  866.   #--------------------------------------------------------------------------
  867.   def update
  868.     # 刷新命令窗口
  869.     @command_window.update
  870.     # 按下 B 键的情况下
  871.     if Input.trigger?(Input::B)
  872.       # 演奏取消 SE
  873.       $game_system.se_play($data_system.cancel_se)
  874.       # 切换到菜单画面
  875.       $scene = Scene_Menu.new(8)
  876.       return
  877.     end
  878.     # 按下 C 键的场合下
  879.     if Input.trigger?(Input::C)
  880.       # 命令窗口光标位置分支
  881.       case @command_window.index
  882.       when 0  # 返回标题画面
  883.         command_to_title
  884.       when 1  # 退出
  885.         command_shutdown
  886.       when 2  # 取消
  887.         command_cancel
  888.       end
  889.       return
  890.     end
  891.   end
  892.   #--------------------------------------------------------------------------
  893.   # ● 选择命令 [取消] 时的处理
  894.   #--------------------------------------------------------------------------
  895.   def command_cancel
  896.     # 演奏确定 SE
  897.     $game_system.se_play($data_system.decision_se)
  898.     # 切换到菜单画面
  899.     $scene = Scene_Menu.new(8)
  900.   end
  901. end
复制代码

   
【RMXP共享】50个脚本整合的系统
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
996
在线时间
25 小时
注册时间
2013-11-26
帖子
4
5
 楼主| 发表于 2014-4-14 23:11:50 | 只看该作者
jilei 发表于 2014-4-13 08:46
你是rm什么的,如果是xp的,记得修改最大人数,换人脚本其实就可以实现module LimBattlePlug

# 队伍最大人 ...

我想请问一下,怎样可以调整默认出战的角色,就是怎样把队伍中后面的角色调到前面来?需要脚本吗?

点评

产生歧义了,请问具体是要什么样子的呢,是否仅仅更换出场顺序?,而不是替换储备队员上场?  发表于 2014-4-17 16:58
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
105 小时
注册时间
2013-2-7
帖子
82
6
发表于 2014-4-15 18:14:16 | 只看该作者
lcj582856013 发表于 2014-4-14 23:11
我想请问一下,怎样可以调整默认出战的角色,就是怎样把队伍中后面的角色调到前面来?需要脚本吗? ...

表示需要脚本,不过不是电脑上网,发脚本不方便,还有似乎不可以一帖多问的哦
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
12157
在线时间
4435 小时
注册时间
2014-4-11
帖子
5955

开拓者

7
发表于 2014-4-15 20:03:56 | 只看该作者
用事件就能实现了啊,设置选项,设置替换队员

点评

你确定?他说的是更换队员出场顺序!不是替换队员!  发表于 2014-4-16 19:34
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
105 小时
注册时间
2013-2-7
帖子
82
8
发表于 2014-4-16 19:41:06 | 只看该作者
偷偷上电脑,给你弄来了脚本,你看看,替换队员位置在x键菜单里
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================
  4. class Scene_Menu
  5. # --------------------------------
  6.   def initialize(menu_index = 0)
  7.     @menu_index = menu_index
  8.     @changer = 0
  9.     @where = 0
  10.     @checker = 0
  11.   end
  12. # --------------------------------
  13.   def main
  14.     s1 = $data_system.words.item
  15.     s2 = $data_system.words.skill
  16.     s3 = $data_system.words.equip
  17.     s4 = "状态"
  18.     s5 = "储存进度"
  19.     s6 = "离开游戏"
  20.     s7 = "调整队伍"
  21.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
  22.     @command_window.index = @menu_index
  23.     if $game_party.actors.size == 0
  24.       @command_window.disable_item(0)
  25.       @command_window.disable_item(1)
  26.       @command_window.disable_item(2)
  27.       @command_window.disable_item(3)
  28.     end
  29.     if $game_system.save_disabled
  30.       @command_window.disable_item(4)
  31.     end
  32.     if $game_party.actors.size == 1
  33.       @command_window.disable_item(6)
  34.     end
  35.     @playtime_window = Window_PlayTime.new
  36.     @playtime_window.x = 0
  37.     @playtime_window.y = 256
  38.     @gold_window = Window_Gold.new
  39.     @gold_window.x = 0
  40.     @gold_window.y = 416
  41.     @status_window = Window_MenuStatus.new
  42.     @status_window.x = 160
  43.     @status_window.y = 0
  44.     Graphics.transition
  45.     loop do
  46.       Graphics.update
  47.       Input.update
  48.       update
  49.       if $scene != self
  50.         break
  51.       end
  52.     end
  53.     Graphics.freeze
  54.     @command_window.dispose
  55.     @playtime_window.dispose
  56.     @gold_window.dispose
  57.     @status_window.dispose
  58.   end
  59. # --------------------------------
  60.   def update
  61.     @command_window.update
  62.     @playtime_window.update
  63.     @gold_window.update
  64.     @status_window.update
  65.     if @command_window.active
  66.       update_command
  67.       return
  68.     end
  69.     if @status_window.active
  70.       update_status
  71.       return
  72.     end
  73.   end
  74. # --------------------------------
  75.   def update_command
  76.     if Input.trigger?(Input::B)
  77.       $game_system.se_play($data_system.cancel_se)
  78.       $scene = Scene_Map.new
  79.       return
  80.     end
  81.     if Input.trigger?(Input::C)
  82.       if $game_party.actors.size == 0 and @command_window.index < 4
  83.         $game_system.se_play($data_system.buzzer_se)
  84.         return
  85.       end
  86.       if $game_party.actors.size == 1 and @command_window.index ==6
  87.         $game_system.se_play($data_system.buzzer_se)
  88.         return
  89.       end
  90.       case @command_window.index
  91.       when 0
  92.         $game_system.se_play($data_system.decision_se)
  93.         $scene = Scene_Item.new
  94.       when 1
  95.         $game_system.se_play($data_system.decision_se)
  96.         @command_window.active = false
  97.         @status_window.active = true
  98.         @status_window.index = 0
  99.       when 2
  100.         $game_system.se_play($data_system.decision_se)
  101.         @command_window.active = false
  102.         @status_window.active = true
  103.         @status_window.index = 0
  104.       when 3
  105.         $game_system.se_play($data_system.decision_se)
  106.         @command_window.active = false
  107.         @status_window.active = true
  108.         @status_window.index = 0
  109.       when 4
  110.         if $game_system.save_disabled
  111.           $game_system.se_play($data_system.buzzer_se)
  112.           return
  113.         end
  114.         $game_system.se_play($data_system.decision_se)
  115.         $scene = Scene_Save.new
  116.       when 5
  117.         $game_system.se_play($data_system.decision_se)
  118.         $scene = Scene_End.new
  119.       when 6
  120.         $game_system.se_play($data_system.decision_se)
  121.         @checker = 0
  122.         @command_window.active = false
  123.         @status_window.active = true
  124.         @status_window.index = 0
  125.       end
  126.       return
  127.     end
  128.   end
  129. # --------------------------------
  130.   def update_status
  131.     if Input.trigger?(Input::B)
  132.       $game_system.se_play($data_system.cancel_se)
  133.       @command_window.active = true
  134.       @status_window.active = false
  135.       @status_window.index = -1
  136.       return
  137.     end
  138.     if Input.trigger?(Input::C)
  139.       case @command_window.index
  140.       when 1
  141.         if $game_party.actors[@status_window.index].restriction >= 2
  142.           $game_system.se_play($data_system.buzzer_se)
  143.           return
  144.         end
  145.         $game_system.se_play($data_system.decision_se)
  146.         $scene = Scene_Skill.new(@status_window.index)
  147.       when 2
  148.         $game_system.se_play($data_system.decision_se)
  149.         $scene = Scene_Equip.new(@status_window.index)
  150.       when 3
  151.         $game_system.se_play($data_system.decision_se)
  152.         $scene = Scene_Status.new(@status_window.index)
  153.       when 6
  154.         $game_system.se_play($data_system.decision_se)
  155.         if @checker == 0
  156.           @changer = $game_party.actors[@status_window.index]
  157.           @where = @status_window.index
  158.           @checker = 1
  159.         else
  160.           $game_party.actors[@where] = $game_party.actors[@status_window.index]
  161.           $game_party.actors[@status_window.index] = @changer
  162.           @checker = 0
  163.           @status_window.refresh
  164.         end
  165.       end
  166.       return
  167.     end
  168.   end
  169. end
  170. #==============================================================================
  171. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  172. #==============================================================================
复制代码
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
12157
在线时间
4435 小时
注册时间
2014-4-11
帖子
5955

开拓者

9
发表于 2014-4-16 20:43:34 | 只看该作者
yang1zhi 发表于 2014-4-15 20:03
用事件就能实现了啊,设置选项,设置替换队员

他说的是像空轨那样,不战斗的人集中在一个点,4个人出来剧情,想换人就回去那个点换人,再4个人出来剧情。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
12157
在线时间
4435 小时
注册时间
2014-4-11
帖子
5955

开拓者

10
发表于 2014-4-16 21:04:21 | 只看该作者
想随时都能换的话就用这个图的效果。在每张地图上放上这样的事件,就有你想要的效果。
https://rpg.blue/forum.php?mod=attachment&aid=MjM5NjU4fGJjNzg2ZGIzODc3OTU4NzU1NzMzMDYwY2Y3NTM5ZGEyfDE3Mjc2OTU1Nzg%3D&request=yes&_f=.jpg

121.jpg (95.31 KB, 下载次数: 9)

121.jpg

点评

想要在那个人出现后才在替换里出现,那就要用到开关。他出现后设置开关NO,在这里事件里新建个事件页,然后当开关NO的时候出现有他选择的这样的  发表于 2014-4-16 21:10
按键Z对应键盘D  发表于 2014-4-16 21:05
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-30 19:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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