Very basic attack system.

This commit is contained in:
Zed A. Shaw 2025-02-10 14:06:38 -05:00
parent 6bca6d021e
commit abd843d5ec
5 changed files with 40 additions and 11 deletions

View file

@ -235,7 +235,10 @@ void WorldBuilder::randomize_entities(DinkyECS::World &world, GameConfig &config
int rand_entity = Random::uniform<int>(0, keys.size() - 1);
std::string key = keys[rand_entity];
// BUG: this may crash if PLAYER_TILE isn't first
if(key == "PLAYER_TITLE") key = keys[rand_entity + 1];
if(key == "PLAYER_TITLE") {
key = keys[rand_entity + 1];
fmt::println("SKIPPING PLAYER and using {} instead", key);
}
auto entity_data = entity_db[key];
// pass that to the config as it'll be a generic json