diff --git a/systems.cpp b/systems.cpp index 2b0883e..8e2ea3b 100644 --- a/systems.cpp +++ b/systems.cpp @@ -265,7 +265,7 @@ void System::combat(int attack_id) { }; if(result.player_did > 0) { - spawn_attack(world, attack_id); + spawn_attack(world, attack_id, enemy.entity); } if(enemy_action == combat::BattleAction::ATTACK) { @@ -660,7 +660,7 @@ void System::clear_attack() { } } -void System::spawn_attack(World& world, int attack_id) { +void System::spawn_attack(World& world, int attack_id, DinkyECS::Entity enemy) { using enum ritual::Element; // for FIRE vs LIGHTNING auto& the_belt = world.get_the(); @@ -677,6 +677,9 @@ void System::spawn_attack(World& world, int attack_id) { auto shader = shaders::get(ritual.element == FIRE ? "flame" : "lightning"); world.set(effect_id, {100, shader}); + // also add the same effect to the enemy + world.set(enemy, {50, shader}); + auto anim = animation::load(effect); anim.play(); world.set(effect_id, anim); diff --git a/systems.hpp b/systems.hpp index 41198a8..15e4740 100644 --- a/systems.hpp +++ b/systems.hpp @@ -73,5 +73,5 @@ namespace System { } void clear_attack(); - void spawn_attack(World& world, int attack_id); + void spawn_attack(World& world, int attack_id, DinkyECS::Entity enemy); }