Did a full code coverage review and improved many of the tests and a bunch of code. I'll do one more final walk through all the code before getting back to work on the new combat system.

This commit is contained in:
Zed A. Shaw 2025-03-17 15:23:47 -04:00
parent 113a4a3b3e
commit d3158291f7
29 changed files with 119 additions and 1218 deletions

View file

@ -178,6 +178,8 @@ void Autowalker::rotate_player(Point current, Point target) {
facing = fsm.$main_ui.$compass_dir;
}
while(fsm.in_state(gui::State::ROTATING)) send_event(gui::Event::TICK);
dbc::check(fsm.$main_ui.$compass_dir == target_facing,
"player isn't facing the correct direction");
}
@ -229,6 +231,14 @@ void Autowalker::handle_player_walk(ai::State& start, ai::State& goal) {
send_event(gui::Event::ATTACK);
} else if(action.name == "kill_enemy") {
status("KILLING ENEMY");
// TODO: find the enemy and then rotate toward them
Point current = get_current_position();
if(fsm.in_state(gui::State::IN_COMBAT)) {
rotate_player(current, {current.x - 1, current.y - 1});
dbc::log("TODO: you should find the enemy and face them instead of THIS GARBAGE!");
}
process_combat();
} else if(action.name == "use_healing") {
status("USING HEALING");
@ -283,7 +293,6 @@ void Autowalker::process_move(Pathing& paths) {
}
rotate_player(current, target);
while(fsm.in_state(gui::State::ROTATING)) send_event(gui::Event::TICK);
send_event(gui::Event::MOVE_FORWARD);
while(fsm.in_state(gui::State::MOVING)) send_event(gui::Event::TICK);