FMBS魔法选择目标的实现..最近才有空研究..
if !@handle_battler.shooting_target.nil? and @handle_battler.motion.shooting_controling @handle_battler.shooting_target.y_pos = @handle_battler.y_min for i in 0..$game_troop.enemies.size-1 break if not $game_troop.enemies[i].dead? [url=home.php?mod=space&uid=188055]@d[/url] += 1 if $game_troop.enemies[i].dead? end @handle_battler.shooting_target.x_pos = $game_troop.enemies[@d].x_pos if Input.trigger?(Input::RIGHT) if @d < $game_troop.enemies.size-1 @d += 1 elsif @d == $game_troop.enemies.size-1 @d = 0 end @handle_battler.shooting_target.x_pos = $game_troop.enemies[@d].x_pos elsif Input.trigger?(Input::LEFT) if @d == 0 @d = $game_troop.enemies.size-1 elsif @d > 0 @d -= 1 end @handle_battler.shooting_target.x_pos = $game_troop.enemies[@d].x_pos end end
if !@handle_battler.shooting_target.nil? and
@handle_battler.motion.shooting_controling
@handle_battler.shooting_target.y_pos = @handle_battler.y_min
for i in 0..$game_troop.enemies.size-1
break if not $game_troop.enemies[i].dead?
[url=home.php?mod=space&uid=188055]@d[/url] += 1 if $game_troop.enemies[i].dead?
end
@handle_battler.shooting_target.x_pos = $game_troop.enemies[@d].x_pos
if Input.trigger?(Input::RIGHT)
if @d < $game_troop.enemies.size-1
@d += 1
elsif @d == $game_troop.enemies.size-1
@d = 0
end
@handle_battler.shooting_target.x_pos = $game_troop.enemies[@d].x_pos
elsif Input.trigger?(Input::LEFT)
if @d == 0
@d = $game_troop.enemies.size-1
elsif @d > 0
@d -= 1
end
@handle_battler.shooting_target.x_pos = $game_troop.enemies[@d].x_pos
end
end
然后往上找初始化加一行@d = 0
alias xrxs_bs1_start_phase1 start_phase1 def start_phase1 # 呼び戻す xrxs_bs1_start_phase1 # モーションや位置を初期化 for battler in $game_party.actors + $game_troop.enemies battler.initialize_positioning end # スプライトセットの影を更新 @spriteset.shadow_update # 初期化 @handle_battler = $game_party.actors[0] #@xcam_watch_battler = @handle_battler @now_attack_frame = false @trigger_duration_key_left = 0 @trigger_duration_key_right= 0 @trigger_duration_key_up = 0 @trigger_duration_key_down = 0 @frames_per_turn = 0 # 逃走時間の初期化 @escape_time_now = 0 @escape_time_max = calc_escape_time_max @escaping = false @escape_done = false @d = 0
alias xrxs_bs1_start_phase1 start_phase1
def start_phase1
# 呼び戻す
xrxs_bs1_start_phase1
# モーションや位置を初期化
for battler in $game_party.actors + $game_troop.enemies
battler.initialize_positioning
end
# スプライトセットの影を更新
@spriteset.shadow_update
# 初期化
@handle_battler = $game_party.actors[0]
#@xcam_watch_battler = @handle_battler
@now_attack_frame = false
@trigger_duration_key_left = 0
@trigger_duration_key_right= 0
@trigger_duration_key_up = 0
@trigger_duration_key_down = 0
@frames_per_turn = 0
# 逃走時間の初期化
@escape_time_now = 0
@escape_time_max = calc_escape_time_max
@escaping = false
@escape_done = false
@d = 0
|