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

smash isn't fully implemented. Requires refactoring of player.hit in order to complete #387

Closed scrom closed 8 years ago

scrom commented 8 years ago

Player.hit is almost as complex and overloaded as creature.tick. It handles about 10 assorted violent verbs along with weapon handling etc.

It needs breaking out into component functions for each major section of logic and potentially assembling differently depending on verb, recipient and weapon

specific examples that aren't fully implemented are:

"shake" and "rattle" translate as bare knuckle fights These need more explicit handling as "bash" items in some way. Perhaps implementing shake or rattle as its own action that (like drop) occasionally bashes an item. If the item is collectible wording would be that you pick it up, shake it and drop it (or similar).

scrom commented 8 years ago

furthermore, "smash bottle on floor" responds with "You attack the bottle. Unfortunately you can't move the floor to use as a weapon."

need to fix the case where smash/break "on" X checks the thing you're trying to smash is movable, not the destination.

scrom commented 8 years ago

specific test cases to examine: UsingLiquidContainerAsWeaponTwiceLosesLiquidContents and SmashLiquidContainerLosesContents

the use of wording in the response to the player is also pretty poor as it's assembled from break/destroy + drain/empty and its own actions to produce awful grammar.

scrom commented 8 years ago

it turns out throwing breakable things (once broken already) also has "interesting results". throwing a broken bottle at the wall returns with: "Oh dear. You destroyed the wreckage that was once some wreckage that was once a bottle. It's not the most durable of weapons."

thing there's some issues there around use of name after being damaged

scrom commented 8 years ago

decision:

scrom commented 8 years ago

Simpler fix implemented and tested for "smash". "Throw" also fixed - easier than expected.