Can now run the full AI for all combatants and then sort by the action costs to make the action queue.
This commit is contained in:
parent
d244106981
commit
b48df3f4db
10 changed files with 104 additions and 59 deletions
|
|
@ -33,11 +33,10 @@ namespace boss {
|
|||
switch(ev) {
|
||||
case MOUSE_CLICK: {
|
||||
$ui.mouse(mouse_pos.x, mouse_pos.y, guecs::NO_MODS);
|
||||
} break;
|
||||
} break;
|
||||
case MOUSE_MOVE: {
|
||||
$ui.mouse(mouse_pos.x, mouse_pos.y, {1 << guecs::ModBit::hover});
|
||||
}
|
||||
break;
|
||||
$ui.mouse(mouse_pos.x, mouse_pos.y, {1 << guecs::ModBit::hover});
|
||||
} break;
|
||||
case MOUSE_DRAG:
|
||||
dbc::log("mouse drag");
|
||||
break;
|
||||
|
|
@ -64,12 +63,15 @@ namespace boss {
|
|||
case BOSS_START:
|
||||
state(State::END);
|
||||
break;
|
||||
case KEY_PRESS:
|
||||
fmt::println("KEY_PRESS");
|
||||
break;
|
||||
case ATTACK:
|
||||
$ui.status(L"PLAYER TURN");
|
||||
state(State::PLAYER_TURN);
|
||||
break;
|
||||
default:
|
||||
// fmt::println("BOSS_FIGHT unknown event {}", (int)ev);
|
||||
fmt::println("BOSS_FIGHT:START unknown event {}", (int)ev);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -82,11 +84,16 @@ namespace boss {
|
|||
case BOSS_START:
|
||||
state(State::END);
|
||||
break;
|
||||
case KEY_PRESS:
|
||||
fmt::println("KEY_PRESS");
|
||||
break;
|
||||
case ATTACK: {
|
||||
int attack_id = std::any_cast<int>(data);
|
||||
fmt::println("Player attack: {}", attack_id);
|
||||
|
||||
$ui.status(L"PLAYER TURN");
|
||||
const std::string& player_pos = run % 10 < 5 ? "player1" : "player2";
|
||||
$ui.move_actor("player", player_pos);
|
||||
int attack_id = std::any_cast<int>(data);
|
||||
boss::System::combat($world, $boss_id, attack_id);
|
||||
$ui.update_stats();
|
||||
state(State::PLAYER_TURN);
|
||||
|
|
@ -105,6 +112,9 @@ namespace boss {
|
|||
case BOSS_START:
|
||||
state(State::END);
|
||||
break;
|
||||
case KEY_PRESS:
|
||||
fmt::println("KEY_PRESS");
|
||||
break;
|
||||
case ATTACK: {
|
||||
$ui.status(L"BOSS TURN");
|
||||
const std::string &boss_at = run % 10 < 5 ? "boss5" : "boss6";
|
||||
|
|
@ -120,10 +130,8 @@ namespace boss {
|
|||
}
|
||||
}
|
||||
|
||||
void Fight::END(gui::Event ev, std::any data) {
|
||||
// We need to clean up that world I think, but not sure how
|
||||
(void)ev;
|
||||
(void)data;
|
||||
void Fight::END(gui::Event ev, std::any) {
|
||||
fmt::println("BOSS_FIGHT:END event {}", (int)ev);
|
||||
}
|
||||
|
||||
void Fight::run_systems() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue