diff --git a/assets/bosses.json b/assets/bosses.json index cf1e708..9e1bfa8 100644 --- a/assets/bosses.json +++ b/assets/bosses.json @@ -7,7 +7,15 @@ "weapon_sound": "Sword_Hit_2" }, {"_type": "Combat", "hp": 20, "max_hp": 20, "damage": 20, "dead": false}, - {"_type": "Animation", "easing": 3, "ease_rate": 0.2, "simple": false, "frames": 2, "speed": 0.02, "scale": 0.2}, + {"_type": "Animation", + "easing": 3, + "ease_rate": 0.2, + "simple": false, + "frames": 2, + "speed": 0.02, + "scale": 0.2, + "stationary": false + }, {"_type": "Sprite", "name": "rat_king_boss", "width": 720, "height": 720, "scale": 0.8, "stationary": false}, {"_type": "Sound", "attack": "Marmot_Scream_1", "death": "Creature_Death_1"} ] diff --git a/combat_ui.cpp b/combat_ui.cpp index beb943d..2f1b9f6 100644 --- a/combat_ui.cpp +++ b/combat_ui.cpp @@ -9,7 +9,7 @@ namespace gui { CombatUI::CombatUI(GameLevel level) : $level(level) { - $gui.position(RAY_VIEW_X, RAY_VIEW_HEIGHT, RAY_VIEW_WIDTH, SCREEN_HEIGHT - RAY_VIEW_HEIGHT); + $gui.position(COMBAT_UI_X, COMBAT_UI_Y, COMBAT_UI_WIDTH, COMBAT_UI_HEIGHT); $gui.layout( "[*%(100,150)button_attack1 | *%(100,150)button_attack2 | *%(100,150)button_attack3 | *%(100,150)button_heal]" "[ >.%(100,50)label_hp | *%.(198,50)bar_hp | _ ]"); diff --git a/config.cpp b/config.cpp index c349ccc..755abb7 100644 --- a/config.cpp +++ b/config.cpp @@ -30,3 +30,13 @@ std::wstring Config::wstring(const std::string main_key, const std::string sub_k std::wstring_convert> $converter; return $converter.from_bytes(str_val); } + +std::vector Config::keys() { + std::vector the_fucking_keys; + + for(auto& [key, value] : $config.items()) { + the_fucking_keys.push_back(key); + } + + return the_fucking_keys; +} diff --git a/config.hpp b/config.hpp index 2c2e295..39dd917 100644 --- a/config.hpp +++ b/config.hpp @@ -16,4 +16,5 @@ struct Config { nlohmann::json &json() { return $config; }; std::wstring wstring(const std::string main_key); std::wstring wstring(const std::string main_key, const std::string sub_key); + std::vector keys(); }; diff --git a/constants.hpp b/constants.hpp index 5a7d1c4..b7331dd 100644 --- a/constants.hpp +++ b/constants.hpp @@ -52,15 +52,18 @@ constexpr int BASE_MAP_FONT_SIZE=80; constexpr int GAME_MAP_PIXEL_POS = 600; constexpr int MAX_FONT_SIZE = 140; constexpr int MIN_FONT_SIZE = 20; -constexpr int STATUS_UI_WIDTH = SCREEN_WIDTH - RAY_VIEW_WIDTH; -constexpr int STATUS_UI_HEIGHT = SCREEN_HEIGHT; + +constexpr float PERCENT = 0.01f; + constexpr int STATUS_UI_X = 0; constexpr int STATUS_UI_Y = 0; -constexpr float PERCENT = 0.01f; -constexpr int COMBAT_UI_WIDTH = 89; -constexpr int COMBAT_UI_HEIGHT = 6; +constexpr int STATUS_UI_WIDTH = SCREEN_WIDTH - RAY_VIEW_WIDTH; +constexpr int STATUS_UI_HEIGHT = SCREEN_HEIGHT; + constexpr int COMBAT_UI_X = RAY_VIEW_X; constexpr int COMBAT_UI_Y = RAY_VIEW_HEIGHT; +constexpr int COMBAT_UI_WIDTH = RAY_VIEW_WIDTH ; +constexpr int COMBAT_UI_HEIGHT = SCREEN_HEIGHT - RAY_VIEW_HEIGHT; // for the panels/renderer diff --git a/levelmanager.cpp b/levelmanager.cpp index 5b72929..ded7ed3 100644 --- a/levelmanager.cpp +++ b/levelmanager.cpp @@ -39,7 +39,12 @@ shared_ptr LevelManager::create_bossfight(shared_ptrget_the(); - auto& boss_data = config.bosses["DEVILS_FINGERS"]; + + // BUG: the jank is too strong here + auto boss_names = config.bosses.keys(); + auto& level_name = boss_names[$current_level % boss_names.size()]; + auto& boss_data = config.bosses[level_name]; + auto boss_id = world->entity(); components::configure_entity($components, *world, boss_id, boss_data["components"]);