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

"throw book down" says "you're not carrying any book down" #388

Closed scrom closed 8 years ago

scrom commented 8 years ago

tricky to handle but needs fixing

scrom commented 8 years ago

throw X south also fails for the same reasons.

basically "throw" needs to check the last word in a string if an artefact isn't found. If it's a direction, retry the find without the direction and then throw the book in that direction. If the direction has an open exit, the item should end up in that different location. If there's an exit with a door, it should bounce off of the door. If there's no exit, it should bounce off of the wall.

scrom commented 8 years ago

"throw up" (with no object) is a different thing though :)

scrom commented 8 years ago

To keep things simple - if there's an open exit, it'll get thrown through that. If not, it'll get thrown in the current location (less descriptive but works)

scrom commented 8 years ago

throw bottle at x will be handled in a different issue though as that's related to player.hit rather than player.drop