以下引用Eclair于2007-12-27 20:32:21的发言:
嗯...说说偶滴感觉...
不是单纯的为了仿VX的话,做成外部可以设定的目标数量效果很可能会更好,敌一体敌二体敌三体的占用了不少属性,而且还不一定全会被用到呢。= =|||
3.times do
index = rand($game_troop.enemies.size) while lastindex == index
@target_battlers.push($game_troop.smooth_target_enemy(index))
lastindex = index
end
以下引用veal于2007-12-27 22:54:23的发言:
3.times do
index = rand($game_troop.enemies.size) while lastindex == index
@target_battlers.push($game_troop.smooth_target_enemy(index))
lastindex = index
end
假如只有1个敌人岂不是无限循环了?
[本贴由作者于 2007-12-27 22:55:57 最后编辑]
以下引用3535于2007-12-28 14:03:17的发言:
when 11 # 敵2體隨機
if $game_troop.enemies.size > 2
lastindex = nil
2.times do
index = rand($game_troop.enemies.size) while lastindex == index
@target_battlers.push($game_troop.smooth_target_enemy(index))
lastindex = index
end
else
for enemy in $game_troop.enemies
if enemy.exist?
@target_battlers.push(enemy)
end
end
end
when 12 # 敵3體隨機
if $game_troop.enemies.size > 3
lastindex = nil
3.times do
index = rand($game_troop.enemies.size) while lastindex == index
@target_battlers.push($game_troop.smooth_target_enemy(index))
lastindex = index
end
else
for enemy in $game_troop.enemies
if enemy.exist?
@target_battlers.push(enemy)
end
end
end
以下引用veal于2007-12-28 15:17:48的发言:
以下引用3535于2007-12-28 14:03:17的发言:
when 11 # 敵2體隨機
if $game_troop.enemies.size > 2
lastindex = nil
2.times do
index = rand($game_troop.enemies.size) while lastindex == index
@target_battlers.push($game_troop.smooth_target_enemy(index))
lastindex = index
end
else
for enemy in $game_troop.enemies
if enemy.exist?
@target_battlers.push(enemy)
end
end
end
when 12 # 敵3體隨機
if $game_troop.enemies.size > 3
lastindex = nil
3.times do
index = rand($game_troop.enemies.size) while lastindex == index
@target_battlers.push($game_troop.smooth_target_enemy(index))
lastindex = index
end
else
for enemy in $game_troop.enemies
if enemy.exist?
@target_battlers.push(enemy)
end
end
end
死人也会算进enemies.size的..
可以判断一下敌人队伍中还有多少活人再确定目标
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |