=end
module Control_Enemys
OLD_ENEMYS = [1,2]
RANGS = [
[1,[0,3],[0,3]],
[4,[16,19],[0,3]]
]
TYPE = 0
end
class Game_Player
attr_writer :encounter_count
end
class Game_Map
attr_writer :encounter_list
end
class Scene_Map
def update
loop do
$game_map.update
$game_system.map_interpreter.update
$game_player.update
$game_system.update
$game_screen.update
unless $game_temp.player_transferring
break
end
transfer_player
if $game_temp.transition_processing
break
end
end
@spriteset.update
@message_window.update
if $game_temp.gameover
$scene = Scene_Gameover.new
return
end
if $game_temp.to_title
$scene = Scene_Title.new
return
end
if $game_temp.transition_processing
$game_temp.transition_processing = false
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
if $game_temp.message_window_showing
return
end
if Control_Enemys::TYPE == 1
if $game_player.encounter_count == 0 and Control_Enemys::OLD_ENEMYS != []
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
n = rand(Control_Enemys::OLD_ENEMYS.size)
troop_id = Control_Enemys::OLD_ENEMYS[n]
if $data_troops[troop_id] != nil
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
end
else
for i in Control_Enemys::RANGS
if $game_player.x >= i[1][0] and $game_player.x <= i[1][1] and
$game_player.y >= i[2][0] and $game_player.y <= i[2][1]
if $game_player.encounter_count == 0 and i[0] != []
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
enemys = []
enemys.push(i[0])
n = rand(enemys.size)
troop_id = enemys[n]
if $data_troops[troop_id] != nil
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
end
end
if Control_Enemys::TYPE == 2
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
if $data_troops[troop_id] != nil
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
end
if Input.trigger?(Input::B)
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
if $DEBUG and Input.press?(Input::F9)
$game_temp.debug_calling = true
end
unless $game_player.moving?
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
end>作者: 小白玩家 时间: 2011-12-22 11:38 本帖最后由 小白玩家 于 2011-12-22 11:43 编辑