scrom / Experiments

a NodeJS text adventure - deliberately coded badly to re-experience the pain of legacy code
http://mvta.herokuapp.com/
2 stars 0 forks source link

get <liquid> or similar should auto-collect a container if one's available #435

Closed scrom closed 8 years ago

scrom commented 8 years ago

this works for delivered items but not for normal items. the code around get/out is still pretty rotten so there's a lot to be factored out and de-duplicated to resolve this one.

scrom commented 8 years ago

And if the liquid is already in a container, player should automagically get the container it's in if they don't have another container.

There's subtleties here - e.g. if carrying a bowl, "get porridge" should only deliver a single portion.

So I think it's a case of if the player or location has an empty container that is smaller than the existing container, the player gets a smaller quantity into that smaller container.

If there isn't a smaller container available, they get the whole thing (if it's collectable)

scrom commented 8 years ago

this is now done but needs some automated tests written

scrom commented 8 years ago

this is mostly done - good enough for now