Start of V1 combat system where you get locked into combat when in range and have to work the turn system to get out.
This commit is contained in:
parent
d2700d2928
commit
8a6b38c1a4
5 changed files with 51 additions and 18 deletions
|
@ -144,14 +144,7 @@ void System::collision(GameLevel &level) {
|
|||
if(found) {
|
||||
for(auto entity : nearby) {
|
||||
if(world.has<Combat>(entity)) {
|
||||
auto& enemy_combat = world.get<Combat>(entity);
|
||||
|
||||
Events::Combat result {
|
||||
player_combat.attack(enemy_combat),
|
||||
enemy_combat.attack(player_combat)
|
||||
};
|
||||
|
||||
world.send<Events::GUI>(Events::GUI::COMBAT, entity, result);
|
||||
world.send<Events::GUI>(Events::GUI::COMBAT_START, entity, entity);
|
||||
} else if(world.has<InventoryItem>(entity)) {
|
||||
auto item = world.get<InventoryItem>(entity);
|
||||
auto& item_pos = world.get<Position>(entity);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue