--- id: 5dbabb746ef5fe3a704f848d title: Part 119 challengeType: 0 dashedName: part-119 --- # --description-- The game could be complete now, but let's make it more interesting. Inside the `attack` function, change the line `health -= monsters[fighting].level;` to `health -= getMonsterAttackValue(monsters[fighting].level);` This sets `health` to equal `health` minus the return value of the `getMonsterAttackValue` function. Also, pass the level of the monster to `getMonsterAttackValue` as an argument. # --hints-- See description above for instructions. ```js assert( attack .toString() .replace(/\s/g, '') .includes('health-=getMonsterAttackValue(monsters[fighting].level') ); ``` # --seed-- ## --before-user-code-- ```html RPG - Dragon Repeller
XP: 0 Health: 100 Gold: 50
Monster Name: Health:
Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
``` ## --after-user-code-- ```html ``` ## --seed-contents-- ```html ``` # --solutions-- ```html ```