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行
#--------------------------------------------------------------------------
# ● 生成行动循序
#--------------------------------------------------------------------------
def make_action_orders
# 初始化序列 @action_battlers
@action_battlers = []
# 添加敌人到 @action_battlers 序列
for enemy in $game_troop.enemies
@action_battlers.push(enemy)
end
# 添加角色到 @action_battlers 序列
for actor in $game_party.actors
@action_battlers.push(actor)
end
# 确定全体的行动速度
for battler in @action_battlers
battler.make_action_speed
end
# 按照行动速度从大到小排列
@action_battlers.sort! {|a,b|
b.current_action.speed - a.current_action.speed }
end
复制代码
改成
#--------------------------------------------------------------------------
# ● 生成行动循序
#--------------------------------------------------------------------------
def make_action_orders
# 初始化序列 @action_battlers
@action_battlers = []
# 添加角色到 @action_battlers 序列
for actor in $game_party.actors
@action_battlers.push(actor)
end
# 添加敌人到 @action_battlers 序列
for enemy in $game_troop.enemies
@action_battlers.push(enemy)
end
end
复制代码
烁灵于2011-10-15 16:49补充以下内容:
乃用了点评于是请允许我连个贴。。。。。
#--------------------------------------------------------------------------
# ● 生成行动循序
#--------------------------------------------------------------------------
def make_action_orders
# 初始化序列 @action_battlers
@action_battlers = []
# 添加角色到 @action_battlers 序列
for index in 0...[$game_party.actors.size, $game_troop.enemies.size].max
@action_battlers.push($game_party.actors[index]) if index < $game_party.actors.size
@action_battlers.push($game_troop.enemies[index]) if index < $game_troop.enemies.size
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1