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

Mission reward enhancement - modifyCreatures #417

Closed scrom closed 8 years ago

scrom commented 8 years ago

In particular, completing a mission should change a given attribute or set of attributes for all the creatures in a location.

With the bus explosion mission, any creatures on the bus should have health set to a certain level and bleeding set - needing the player to heal them before they die. (another no death toll mission).

scrom commented 8 years ago

ok - this is looking good. modifyLocationCreatures reward attribute with a json object of "name" for location name and set of possible modifications is now supported.

Modifications are: "health" (either a whole number or a decimal and either +ve or -ve). Decimals will be converted to %. "teleport" - send to different named location "maxHealth" - set new max health "carryWeight" - set new carryweight "money" - increase/decrease money by x "repairSkills" - an array of repair skills to add "inventory" - an array of inventory items to (force) add. "contagion" - an array of possible contagion to add.

inventory and contagion aren't yet tested but the rest are working well.

scrom commented 8 years ago

see "Reward" trait tests for examples.

scrom commented 8 years ago

I'd like to add affinity modification in future but this intersects with "processAffinityModifiers so needs some alternate work.