mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -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. |
||
---|---|---|
.. | ||
systems | ||
box2d.coffee | ||
component.coffee | ||
errors.coffee | ||
GoalManager.coffee | ||
Grid.coffee | ||
names.coffee | ||
rand.coffee | ||
rectangle.coffee | ||
script_event_prereqs.coffee | ||
system.coffee | ||
thang.coffee | ||
thang_state.coffee | ||
vector.coffee | ||
world.coffee | ||
world_frame.coffee | ||
world_script_note.coffee | ||
world_utils.coffee |