diff --git a/boss/fight.cpp b/boss/fight.cpp index b9f8fe8..7504f7f 100644 --- a/boss/fight.cpp +++ b/boss/fight.cpp @@ -89,7 +89,7 @@ namespace boss { break; case COMBAT_START: $ui.status(L"X TURN", L"STEP"); - next_combat_dumb_name(); + next_combat(); break; case COMBAT: do_combat(data); @@ -99,7 +99,11 @@ namespace boss { } } - void Fight::next_combat_dumb_name() { + void Fight::END(game::Event ev, std::any) { + fmt::println("BOSS_FIGHT:END event {}", (int)ev); + } + + void Fight::next_combat() { if(auto action = $battle.next()) { System::combat(*action, $world, $boss_id, 0); } else if(player_dead()) { @@ -143,10 +147,6 @@ namespace boss { } - void Fight::END(game::Event ev, std::any) { - fmt::println("BOSS_FIGHT:END event {}", (int)ev); - } - void Fight::run_systems() { $ui.update_stats(); $battle.set($host, "tough_personality", false); @@ -155,7 +155,6 @@ namespace boss { } void Fight::render(sf::RenderWindow& window) { - $ui.play_animations(); $ui.render(); } diff --git a/boss/fight.hpp b/boss/fight.hpp index 0bf2184..753404a 100644 --- a/boss/fight.hpp +++ b/boss/fight.hpp @@ -51,7 +51,7 @@ namespace boss { void init_fight(); void do_combat(std::any data); - void next_combat_dumb_name(); + void next_combat(); sf::Vector2f mouse_position(); bool handle_keyboard_mouse(); }; diff --git a/boss/system.cpp b/boss/system.cpp index 2e2efea..ed921c6 100644 --- a/boss/system.cpp +++ b/boss/system.cpp @@ -87,7 +87,7 @@ namespace boss { } void System::plan_battle(BattleEngine& battle, std::shared_ptr world, DinkyECS::Entity boss_id) { - // REFACTOR: make this loop the list of entities in the battle then + // BUG: make this loop the list of entities in the battle then // use their world state to configure the plan battle.plan(); } diff --git a/boss/ui.cpp b/boss/ui.cpp index 403eef8..130ed3f 100644 --- a/boss/ui.cpp +++ b/boss/ui.cpp @@ -78,7 +78,9 @@ namespace boss { $actions.render(*$window); $combat_ui.render(*$window); + $arena.play_animations(); $arena.render($view_texture); + $view_texture.display(); $window->draw($view_sprite); } @@ -102,10 +104,6 @@ namespace boss { $arena.animate_actor(actor); } - void UI::play_animations() { - $arena.play_animations(); - } - void UI::damage(const string& actor, const std::string& target, int amount) { if(amount > 0) { $arena.attach_text(target, fmt::format("{}", amount)); diff --git a/boss/ui.hpp b/boss/ui.hpp index f7c703a..1cd615d 100644 --- a/boss/ui.hpp +++ b/boss/ui.hpp @@ -37,7 +37,6 @@ namespace boss { void move_actor(const std::string& actor, const std::string& cell_name); void animate_actor(const std::string& actor); void update_stats(); - void play_animations(); void damage(const std::string& actor, const std::string& target, int amount); void reset_camera(); }; diff --git a/scene.cpp b/scene.cpp index da2e1e7..8474b94 100644 --- a/scene.cpp +++ b/scene.cpp @@ -101,10 +101,6 @@ namespace scene { } for(auto& actor : $actors) { - if(actor.effect != nullptr) { - dbc::log(fmt::format("ACTOR {} SHADER {}", actor.name, (void*)actor.effect.get())); - } - view.draw(*actor.st.sprite, actor.effect.get()); if(actor.anim.playing) view.draw(actor.text); } @@ -172,29 +168,6 @@ namespace scene { $camera.play(); } - std::pair Engine::left_right(const std::string &actor, const std::string &target) { - auto& first = actor_config(actor); - auto& second = actor_config(target); - - if(first.pos.x < second.pos.x) { - // first is left - return {first, second}; - } else if(first.pos.x == second.pos.x) { - auto fb = first.st.sprite->getGlobalBounds(); - auto sb = second.st.sprite->getGlobalBounds(); - - // use the widest one as right - if(fb.size.x >= sb.size.x) { - return {first, second}; - } else { - return {second, first}; - } - } else { - // second is left - return {second, first}; - } - } - void Engine::zoom(const std::string &actor, const std::string& style, float scale) { auto& config = actor_config(actor); auto bounds = config.st.sprite->getGlobalBounds(); diff --git a/scene.hpp b/scene.hpp index a56c503..a18b55e 100644 --- a/scene.hpp +++ b/scene.hpp @@ -56,6 +56,5 @@ namespace scene { void zoom(const std::string& actor, const std::string& style, float scale=0.9f); void zoom(float mid_x, float mid_y, const std::string& style, float scale); void reset(sf::RenderTexture& view); - std::pair left_right(const std::string &actor, const std::string &target); }; }