diff --git a/assets/enemies.json b/assets/enemies.json index 10f8c6b..34817f5 100644 --- a/assets/enemies.json +++ b/assets/enemies.json @@ -6,7 +6,7 @@ "foreground": "enemies/fg:player", "background": "color:transparent" }, - {"_type": "Combat", "hp": 200, "max_hp": 200, "ap": 0, "max_ap": 12, "ap_delta": 6, "damage": 10, "dead": false}, + {"_type": "Combat", "hp": 200, "max_hp": 200, "ap": 0, "max_ap": 12, "ap_delta": 6, "damage": 1000, "dead": false}, {"_type": "Motion", "dx": 0, "dy": 0, "random": false}, {"_type": "Collision", "has": true}, {"_type": "EnemyConfig", "ai_script": "Host::actions", "ai_start_name": "Host::initial_state", "ai_goal_name": "Host::final_state"}, diff --git a/components.hpp b/components.hpp index 6232463..e40fb0a 100644 --- a/components.hpp +++ b/components.hpp @@ -19,8 +19,8 @@ namespace components { using namespace nlohmann; struct CombatResult { - int player_did; - int enemy_did; + int player_did = 0; + int enemy_did = 0; }; struct InventoryItem { diff --git a/systems.cpp b/systems.cpp index cc98b78..f6820e2 100644 --- a/systems.cpp +++ b/systems.cpp @@ -22,6 +22,7 @@ using std::string; using namespace fmt; +using namespace combat; using namespace components; using namespace DinkyECS; using lighting::LightSource; @@ -261,6 +262,7 @@ void System::combat(int attack_id) { while(auto act = battle.next()) { auto [enemy, enemy_action, cost, host_state] = *act; + if(host_state != BattleHostState::not_host) continue; components::CombatResult result { player_combat.attack(*enemy.combat), 0