Project1

标题: 怎样固定所有人(包括敌我)的攻击顺序? [打印本页]

作者: 黑舞嗜    时间: 2011-10-15 15:55
标题: 怎样固定所有人(包括敌我)的攻击顺序?
本帖最后由 黑舞嗜 于 2011-10-15 16:06 编辑

战斗时,我方选择完所有指令以后,执行命令(无视任何相关属性)的顺序按照“角色1”→“敌人1”→“角色2”→“敌人2”→“角色3”→“敌人3”→“角色4”→“敌人4”这样固定执行?dsu_plus_rewardpost_czw
作者: 盈盈    时间: 2011-10-15 16:11
亲,这样不是不需要攻击选敌人了吗,按了攻击就下一人了,因为都固定了,选人没有意义了。
亲,你还有好多条件没有说呢。
1.我方人数大于敌方人数时,多出来的人打谁?(同理反方也一样)
2.我方的被攻击者死亡后让他打谁?(同理反方也一样)
作者: 烁灵    时间: 2011-10-15 16:13
Scene_Battle 49行
  1.   #--------------------------------------------------------------------------
  2.   # ● 生成行动循序
  3.   #--------------------------------------------------------------------------
  4.   def make_action_orders
  5.     # 初始化序列 @action_battlers
  6.     @action_battlers = []
  7.     # 添加敌人到 @action_battlers 序列
  8.     for enemy in $game_troop.enemies
  9.       @action_battlers.push(enemy)
  10.     end
  11.     # 添加角色到 @action_battlers 序列
  12.     for actor in $game_party.actors
  13.       @action_battlers.push(actor)
  14.     end
  15.     # 确定全体的行动速度
  16.     for battler in @action_battlers
  17.       battler.make_action_speed
  18.     end
  19.     # 按照行动速度从大到小排列
  20.     @action_battlers.sort! {|a,b|
  21.       b.current_action.speed - a.current_action.speed }
  22.   end
复制代码
改成
  1.   #--------------------------------------------------------------------------
  2.   # ● 生成行动循序
  3.   #--------------------------------------------------------------------------
  4.   def make_action_orders
  5.     # 初始化序列 @action_battlers
  6.     @action_battlers = []   
  7.     # 添加角色到 @action_battlers 序列
  8.     for actor in $game_party.actors
  9.       @action_battlers.push(actor)
  10.     end
  11.     # 添加敌人到 @action_battlers 序列
  12.     for enemy in $game_troop.enemies
  13.       @action_battlers.push(enemy)
  14.     end
  15.   end
复制代码


烁灵于2011-10-15 16:49补充以下内容:
乃用了点评于是请允许我连个贴。。。。。
  1.   #--------------------------------------------------------------------------
  2.   # ● 生成行动循序
  3.   #--------------------------------------------------------------------------
  4.   def make_action_orders
  5.     # 初始化序列 @action_battlers
  6.     @action_battlers = []   
  7.     # 添加角色到 @action_battlers 序列
  8.     for index in 0...[$game_party.actors.size, $game_troop.enemies.size].max
  9.       @action_battlers.push($game_party.actors[index]) if index < $game_party.actors.size
  10.       @action_battlers.push($game_troop.enemies[index]) if index < $game_troop.enemies.size
  11.     end
  12.   end
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1