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

wasting liquids / adding milk to coffee/latte should be handled better #312

Closed scrom closed 9 years ago

scrom commented 9 years ago

at the moment this "pours over" - wastes. This is wrong.

The latte should simply be refused, the sweet coffee should make sweet white coffee.

In general "wasting" something should ask the user to confirm first - just to be sure (cinfirmAction) - this will need some work to fix up the "put"/"place" actions with a transactional question but we've done it before for "repair" so definitely worth a try.

scrom commented 9 years ago

Partially improved this - handling "get coffee" when cup is already full now handles failure better. The code added for this probably needs porting to a standalone method and cleaning up.

scrom commented 9 years ago

add milk to coffee works nicely now after a rework to liquid handling. (player ends up with white coffee)

however - adding sugar to white coffee responds: "Sorry, the white coffee can't hold the sugar." so there's still an issue there.

scrom commented 9 years ago

It turns out this whole area was still a bit buggy after some recent rework on "put" such that "put"ting sugar in a cup was duplicating it and putting sugar in milk was consuming it but telling the player it wasn't possible.

These should both now be sorted.

scrom commented 9 years ago

this is mostly working although adding milk to latte now says "Sorry, the latte can't hold the milk."

Ideally this should be something along the lines of the 2 liquids not combining. Chances are it's that the latte has filled the cup. (in which case the message should be that the cup is too full to add any more.)

scrom commented 9 years ago

This is now improved... if a cup contains latte, a player entering "add milk to cup" receives the message: "There isn't enough room in the cup for the milk." - nice and clear.

if a player enters "add milk to latte" of "put milk in latte" they receive the message: "You try and try but can't find a satisfactory way to make it fit." - it's not great but this is because we don't have a reference for the milk to its container. No plans to take this further for now.