Rituals are now taken from the belt and shown in th combat_ui and in the system::combat. They aren't used in combat calcs yet though.
This commit is contained in:
parent
00c28f47eb
commit
ebb69dd589
6 changed files with 27 additions and 19 deletions
|
@ -208,7 +208,12 @@ void System::combat(GameLevel &level, int attack_id) {
|
|||
auto &collider = *level.collision;
|
||||
auto &world = *level.world;
|
||||
auto player = world.get_the<Player>();
|
||||
auto& the_belt = world.get<combat::RitualBelt>(player.entity);
|
||||
|
||||
dbc::check(the_belt.has(attack_id),
|
||||
fmt::format("the_belt does not have an attack with id={}", attack_id));
|
||||
|
||||
auto& ritual = the_belt.get(attack_id);
|
||||
const auto& player_position = world.get<Position>(player.entity);
|
||||
auto& player_combat = world.get<Combat>(player.entity);
|
||||
|
||||
|
@ -238,7 +243,8 @@ void System::combat(GameLevel &level, int attack_id) {
|
|||
};
|
||||
|
||||
if(result.player_did > 0) {
|
||||
auto effect = shaders::get(attack_id == 1 ? "flame" : "lightning");
|
||||
auto effect = shaders::get(
|
||||
ritual.kind == combat::RitualKind::PHYSICAL ? "flame" : "lightning");
|
||||
world.set<SpriteEffect>(enemy.entity, {100, effect});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue