|
|
@ -301,10 +301,6 @@ void System::collision(GameLevel &level) { |
|
|
|
combat_count++; |
|
|
|
combat_count++; |
|
|
|
world.send<Events::GUI>(Events::GUI::COMBAT_START, entity, entity); |
|
|
|
world.send<Events::GUI>(Events::GUI::COMBAT_START, entity, entity); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(world.has<InventoryItem>(entity)) { |
|
|
|
|
|
|
|
dbc::log("Hit an inventory item, use Sysem::pickup?"); |
|
|
|
|
|
|
|
} else if(world.has<Device>(entity)) { |
|
|
|
|
|
|
|
System::device(world, player.entity, entity); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
dbc::log(fmt::format("UNKNOWN COLLISION TYPE {}", entity)); |
|
|
|
dbc::log(fmt::format("UNKNOWN COLLISION TYPE {}", entity)); |
|
|
|
} |
|
|
|
} |
|
|
@ -318,6 +314,7 @@ void System::collision(GameLevel &level) { |
|
|
|
|
|
|
|
|
|
|
|
void System::pickup(GameLevel &level, DinkyECS::Entity entity) { |
|
|
|
void System::pickup(GameLevel &level, DinkyECS::Entity entity) { |
|
|
|
auto &world = *level.world; |
|
|
|
auto &world = *level.world; |
|
|
|
|
|
|
|
auto player = world.get_the<Player>(); |
|
|
|
|
|
|
|
|
|
|
|
if(world.has<InventoryItem>(entity)) { |
|
|
|
if(world.has<InventoryItem>(entity)) { |
|
|
|
auto item = world.get<InventoryItem>(entity); |
|
|
|
auto item = world.get<InventoryItem>(entity); |
|
|
@ -335,6 +332,8 @@ void System::pickup(GameLevel &level, DinkyECS::Entity entity) { |
|
|
|
level.collision->remove(item_pos.location); |
|
|
|
level.collision->remove(item_pos.location); |
|
|
|
world.remove<Tile>(entity); |
|
|
|
world.remove<Tile>(entity); |
|
|
|
world.send<Events::GUI>(Events::GUI::LOOT, entity, item); |
|
|
|
world.send<Events::GUI>(Events::GUI::LOOT, entity, item); |
|
|
|
|
|
|
|
} else if(world.has<Device>(entity)) { |
|
|
|
|
|
|
|
System::device(world, player.entity, entity); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|