feat(premium): add mystery-item handling

This commit is contained in:
Tyler Renelle 2014-02-22 20:41:48 -08:00
parent cdd59adab9
commit 1a40a52ab5
2 changed files with 2 additions and 2 deletions

View file

@ -210,7 +210,7 @@ api.gear =
flat: {}
_.each gearTypes, (type) ->
_.each classes.concat(['base', 'special']), (klass) ->
_.each classes.concat(['base', 'special', 'mystery']), (klass) ->
# add "type" to each item, so we can reference that as "weapon" or "armor" in the html
_.each gear[type][klass], (item, i) ->
key = "#{type}_#{klass}_#{i}"

View file

@ -129,7 +129,7 @@ api.updateStore = (user) ->
true
# Add special items (contrib gear, backer gear, etc)
changes = changes.concat _.filter content.gear.flat, (v) ->
v.klass is 'special' and !user.items.gear.owned[v.key] and v.canOwn?(user)
v.klass in ['special','mystery'] and !user.items.gear.owned[v.key] and v.canOwn?(user)
changes.push content.potion
# Return sorted store (array)
_.sortBy changes, (item) ->