A quick fix for the dungeon combat.
This commit is contained in:
parent
6e35ff3d6d
commit
4958f24c1d
3 changed files with 5 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
"foreground": "enemies/fg:player",
|
"foreground": "enemies/fg:player",
|
||||||
"background": "color:transparent"
|
"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": "Motion", "dx": 0, "dy": 0, "random": false},
|
||||||
{"_type": "Collision", "has": true},
|
{"_type": "Collision", "has": true},
|
||||||
{"_type": "EnemyConfig", "ai_script": "Host::actions", "ai_start_name": "Host::initial_state", "ai_goal_name": "Host::final_state"},
|
{"_type": "EnemyConfig", "ai_script": "Host::actions", "ai_start_name": "Host::initial_state", "ai_goal_name": "Host::final_state"},
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ namespace components {
|
||||||
using namespace nlohmann;
|
using namespace nlohmann;
|
||||||
|
|
||||||
struct CombatResult {
|
struct CombatResult {
|
||||||
int player_did;
|
int player_did = 0;
|
||||||
int enemy_did;
|
int enemy_did = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct InventoryItem {
|
struct InventoryItem {
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
using namespace fmt;
|
using namespace fmt;
|
||||||
|
using namespace combat;
|
||||||
using namespace components;
|
using namespace components;
|
||||||
using namespace DinkyECS;
|
using namespace DinkyECS;
|
||||||
using lighting::LightSource;
|
using lighting::LightSource;
|
||||||
|
|
@ -261,6 +262,7 @@ void System::combat(int attack_id) {
|
||||||
|
|
||||||
while(auto act = battle.next()) {
|
while(auto act = battle.next()) {
|
||||||
auto [enemy, enemy_action, cost, host_state] = *act;
|
auto [enemy, enemy_action, cost, host_state] = *act;
|
||||||
|
if(host_state != BattleHostState::not_host) continue;
|
||||||
|
|
||||||
components::CombatResult result {
|
components::CombatResult result {
|
||||||
player_combat.attack(*enemy.combat), 0
|
player_combat.attack(*enemy.combat), 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue