Made some notes for the next bit of work.
This commit is contained in:
parent
7b0bac4f59
commit
7db64b73c5
1 changed files with 9 additions and 4 deletions
13
systems.cpp
13
systems.cpp
|
@ -317,8 +317,11 @@ void System::pickup(GameLevel &level, DinkyECS::Entity entity) {
|
||||||
auto player = world.get_the<Player>();
|
auto player = world.get_the<Player>();
|
||||||
|
|
||||||
if(world.has<InventoryItem>(entity)) {
|
if(world.has<InventoryItem>(entity)) {
|
||||||
|
// NOTE: this might need to be a separate system so that people can leave stuff alone
|
||||||
auto item = world.get<InventoryItem>(entity);
|
auto item = world.get<InventoryItem>(entity);
|
||||||
auto& item_pos = world.get<Position>(entity);
|
auto& item_pos = world.get<Position>(entity);
|
||||||
|
level.collision->remove(item_pos.location);
|
||||||
|
world.remove<Tile>(entity);
|
||||||
|
|
||||||
if(world.has<ritual::JunkPile>(entity)) {
|
if(world.has<ritual::JunkPile>(entity)) {
|
||||||
auto& pile = world.get<ritual::JunkPile>(entity);
|
auto& pile = world.get<ritual::JunkPile>(entity);
|
||||||
|
@ -327,11 +330,13 @@ void System::pickup(GameLevel &level, DinkyECS::Entity entity) {
|
||||||
for(auto& junk : pile.contents) {
|
for(auto& junk : pile.contents) {
|
||||||
blanket.add(junk);
|
blanket.add(junk);
|
||||||
}
|
}
|
||||||
}
|
// NOTE: have the gui notify them that some new stuff is in the blanket
|
||||||
|
} else {
|
||||||
level.collision->remove(item_pos.location);
|
// NOTE: chests are different from say a torch, maybe 2 events or the
|
||||||
world.remove<Tile>(entity);
|
// GUI figures out which it is, then when you click either pick it up
|
||||||
|
// and move it or show the loot container UI
|
||||||
world.send<Events::GUI>(Events::GUI::LOOT, entity, item);
|
world.send<Events::GUI>(Events::GUI::LOOT, entity, item);
|
||||||
|
}
|
||||||
} else if(world.has<Device>(entity)) {
|
} else if(world.has<Device>(entity)) {
|
||||||
System::device(world, player.entity, entity);
|
System::device(world, player.entity, entity);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue