Now have the basics of the turn based battle engine with AI rebellion working.

This commit is contained in:
Zed A. Shaw 2025-12-01 00:14:08 -05:00
parent f3b20f30c5
commit c78b2ae75e
8 changed files with 114 additions and 73 deletions

View file

@ -72,11 +72,11 @@ namespace boss {
}
if(result.player_did > 0) {
zoom(boss_is.cell);
zoom("boss14", 1.8);
} else if(result.enemy_did > 0) {
zoom(player_is.cell);
zoom(player_is.cell, 2.0);
} else {
zoom("");
zoom("", 0.0);
}
}
@ -115,14 +115,14 @@ namespace boss {
$arena.play_animations();
}
void UI::zoom(const std::string &cell_name) {
void UI::zoom(const std::string &cell_name, double ratio) {
if(cell_name == "") {
dbc::log("!!!!!!!!! you should add this to guecs");
$camera.reset($view_texture, BOSS_VIEW_WIDTH, BOSS_VIEW_HEIGHT);
} else {
auto& cell = $arena.$ui.cell_for(cell_name);
$camera.resize(BOSS_VIEW_WIDTH/2, BOSS_VIEW_HEIGHT/2);
$camera.resize(double(BOSS_VIEW_WIDTH)/ratio, double(BOSS_VIEW_HEIGHT)/ratio);
$camera.move(float(cell.mid_x), float(cell.mid_y));
$camera.play();
}