|
|
@ -223,7 +223,6 @@ void Autowalker::handle_player_walk(ai::State& start, ai::State& goal) { |
|
|
|
auto action = a_plan.script.front(); |
|
|
|
auto action = a_plan.script.front(); |
|
|
|
|
|
|
|
|
|
|
|
if(action.name == "find_enemy") { |
|
|
|
if(action.name == "find_enemy") { |
|
|
|
// this is where to test if enemy found and update state
|
|
|
|
|
|
|
|
status(L"FINDING ENEMY"); |
|
|
|
status(L"FINDING ENEMY"); |
|
|
|
auto paths = path_to_enemies(); |
|
|
|
auto paths = path_to_enemies(); |
|
|
|
process_move(paths); |
|
|
|
process_move(paths); |
|
|
@ -267,11 +266,17 @@ void Autowalker::autowalk() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int move_attempts = 0; |
|
|
|
int move_attempts = 0; |
|
|
|
|
|
|
|
bool map_opened_once = false; |
|
|
|
|
|
|
|
|
|
|
|
auto start = ai::load_state("Host::initial_state"); |
|
|
|
auto start = ai::load_state("Host::initial_state"); |
|
|
|
auto goal = ai::load_state("Host::final_state"); |
|
|
|
auto goal = ai::load_state("Host::final_state"); |
|
|
|
|
|
|
|
|
|
|
|
do { |
|
|
|
do { |
|
|
|
|
|
|
|
if(!fsm.$map_open && !map_opened_once) { |
|
|
|
|
|
|
|
send_event(gui::Event::MAP_OPEN); |
|
|
|
|
|
|
|
map_opened_once = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
handle_window_events(); |
|
|
|
handle_window_events(); |
|
|
|
handle_boss_fight(); |
|
|
|
handle_boss_fight(); |
|
|
|
handle_player_walk(start, goal); |
|
|
|
handle_player_walk(start, goal); |
|
|
|