def encounter
return false if @encounter_count > 0 # 检查步数
return false if $game_map.interpreter.running? # 判断是否有事件正在执行
return false if $game_system.encounter_disabled # 判断是否禁止遇敌
troop_id = make_encounter_troop_id # 判断敌人队伍
return false if $data_troops[troop_id] == nil # 判断队伍是否无效
if $game_switches[troop_id + 20] == true # 判断敌人队伍是否遇到过
return false # 返回 ↖敌人队伍ID
else # 不是的话
$game_switches[troop_id + 20] = true #标记已经遇到过此队伍
# ↑指定标记开关ID
end
BattleManager.setup(troop_id)
BattleManager.on_encounter
return true
end
def encounter
return false if @encounter_count > 0 # 检查步数
return false if $game_map.interpreter.running? # 判断是否有事件正在执行
return false if $game_system.encounter_disabled # 判断是否禁止遇敌
troop_id = make_encounter_troop_id # 判断敌人队伍
return false if $data_troops[troop_id] == nil # 判断队伍是否无效
if $game_switches[troop_id + 20] == true # 判断敌人队伍是否遇到过
return false # 返回 ↖敌人队伍ID
else # 不是的话
$game_switches[troop_id + 20] = true #标记已经遇到过此队伍
# ↑指定标记开关ID
end
BattleManager.setup(troop_id)
BattleManager.on_encounter
return true
end