mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 16:17:57 -05:00
939509849c
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. |
||
---|---|---|
.. | ||
scripts | ||
simulator | ||
sprites | ||
surface | ||
world | ||
AsyncCloner.coffee | ||
AudioPlayer.coffee | ||
auth.coffee | ||
Bus.coffee | ||
CocoClass.coffee | ||
contact.coffee | ||
deltas.coffee | ||
errors.coffee | ||
FacebookHandler.coffee | ||
forms.coffee | ||
God.coffee | ||
GPlusHandler.coffee | ||
image_filter.coffee | ||
LevelBus.coffee | ||
LevelLoader.coffee | ||
LinkedInHandler.coffee | ||
NameLoader.coffee | ||
Router.coffee | ||
storage.coffee | ||
SystemNameLoader.coffee | ||
Tracker.coffee | ||
utils.coffee |