From 72d51f95583fb3da2cbe0a0423bcdcce9f388547 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Thu, 18 Dec 2025 00:50:05 -0500 Subject: [PATCH] Boss and Host now move around the arena based on what happened to them. --- assets/animations.json | 18 +++++++++--------- boss/fight.cpp | 21 ++++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/assets/animations.json b/assets/animations.json index a33e88d..531f6fa 100644 --- a/assets/animations.json +++ b/assets/animations.json @@ -93,17 +93,17 @@ }, "peasant_girl_rear_view": { "_type": "Animation", - "easing": 3, - "motion": 0, - "ease_rate": 0.2, - "min_x": 0.5, - "min_y": 0.5, - "max_x": 0.5, - "max_y": 0.5, + "easing": 6, + "motion": 1, + "ease_rate": 0.05, + "min_x": -20.0, + "min_y": -20.0, + "max_x": 20.0, + "max_y": 20.0, "simple": true, "frames": 1, - "speed": 0.03, - "scaled": true, + "speed": 0.01, + "scaled": false, "stationary": true, "toggled": false, "flipped": false, diff --git a/boss/fight.cpp b/boss/fight.cpp index 0a84a50..2840ed6 100644 --- a/boss/fight.cpp +++ b/boss/fight.cpp @@ -3,6 +3,7 @@ #include "animation.hpp" #include "game_level.hpp" #include +#include "rand.hpp" namespace boss { Fight::Fight(shared_ptr world, Entity boss_id, Entity player_id) : @@ -114,24 +115,27 @@ namespace boss { } void Fight::do_combat(std::any data) { - if(data.type() != typeid(components::CombatResult)) { - std::cout << "!!!!!! INVALID thing do_combat received: {}" << data.type().name() << std::endl; - return; - } + dbc::check(data.type() == typeid(components::CombatResult), + fmt::format("Boss Fight received any data={}", data.type().name())); auto result = std::any_cast(data); + $ui.zoom("", 1.0); + std::string boss_move = Random::uniform(0, 1) == 0 ? "boss5" : "boss6"; + std::string player_move = Random::uniform(0, 1) == 0 ? "player1" : "player3"; + $ui.move_actor("player", player_move); + $ui.move_actor("boss", boss_move); + if(result.enemy_did > 0) { // make boss move - fmt::println("!!!! BOSS MOVE!"); + $ui.animate_actor("boss"); } if(result.player_did > 0) { // make player move - fmt::println("!!!! PLAYER MOVE!"); - + $ui.animate_actor("player"); + $ui.zoom(player_move, 2.0); } - } void Fight::EXEC_PLAN(game::Event ev, std::any data) { @@ -147,7 +151,6 @@ namespace boss { break; case COMBAT: do_combat(data); - next_combat_dumb_name(); break; default: break;