Justification: For a negative goal like saveThangs, let's say you have 5 thangs on the save list. As things stand, if you don't have a HowMany defined, then the number of needed deaths to fail is numNeeded = _.size(stateThangs) - Math.min((goal.howMany ? 1), _.size stateThangs) + 1 numNeeded = 5 - Math.min(1, 5) + 1 numNeeded = 5 So you would only fail the goal if all 5 thangs you were supposed to save died. This is contrary to the comment right above this line: # saveThangs: by default we would want to save all the Thangs, which means that we would want none of them to be "done" Therefore, I think it should be Math.max rather than Math.min. numNeeded = _.size(stateThangs) - Math.max((goal.howMany ? 1), _.size stateThangs) + 1 numNeeded = 5 - Math.max(1, 5) + 1 numNeeded = 1 So any of the Thangs on the save list dying is enough to fail the goal. As a double check, what if the level designer designated a HowMany of 5? numNeeded = _.size(stateThangs) - Math.max((goal.howMany ? 1), _.size stateThangs) + 1 numNeeded = 5 - Math.max(5, 5) + 1 numNeeded = 1 So this is consistent. |
||
---|---|---|
app | ||
bin | ||
scripts | ||
server | ||
test | ||
vendor | ||
.gitignore | ||
.npmignore | ||
.travis.yml | ||
bower.json | ||
config.coffee | ||
CONTRIBUTING.md | ||
index.js | ||
karma.conf.js | ||
LICENSE | ||
package.json | ||
README.md | ||
server.coffee | ||
server_config.coffee | ||
server_setup.coffee |
CodeCombat
CodeCombat is a multiplayer programming game for learning how to code. See the Archmage developer wiki for a dev setup guide, extensive documentation, and much more.
It's both a startup and a community project, completely open source under the MIT and Creative Commons licenses. It's the largest open source CoffeeScript project by lines of code, and since it's a game (with really cool tech), it's really fun to hack on. Join us in teaching the world to code! Your contribution will go on to show millions of players how cool programming can be.
Getting Started
We've made it easy to fork the project, run a simple script that'll install all the dependencies, and get a local copy of CodeCombat running right away on Mac, Linux, or Windows. See the docs for details.
Getting In Touch
Whether you're novice or pro, the CodeCombat team is ready to help you implement your ideas. Reach out on our forum, our issue tracker, or our developer chat room, or see the docs for more on how to contribute.
License
MIT for the code, and CC-BY for the art and music. Please also sign the CodeCombat contributor license agreement so we can accept your pull requests. It is easy.