Refactor how cards are recieved

This commit is contained in:
Blade Barringer
2015-08-12 08:36:57 -05:00
parent 60f92a8997
commit 203a26b6df
7 changed files with 121 additions and 61 deletions
+3 -8
View File
@@ -1168,9 +1168,9 @@ api.wrap = (user, main=true) ->
user.stats.mp++ if stat is 'int' #increase their MP along with their max MP
cb? null, _.pick(user,$w 'stats')
readValentine: (req,cb) ->
user.items.special.valentineReceived.shift()
user.markModified? 'items.special.valentineReceived'
readCard: (cardType, cb) ->
user.items.special["#{cardType}Received"].shift()
user.markModified? "items.special.#{cardType}Received"
cb? null, 'items.special'
openMysteryItem: (req,cb,analytics) ->
@@ -1191,11 +1191,6 @@ api.wrap = (user, main=true) ->
(user._tmp?={}).drop = item if typeof window != 'undefined'
cb? null, user.items.gear.owned
readNYE: (req,cb) ->
user.items.special.nyeReceived.shift()
user.markModified? 'items.special.nyeReceived'
cb? null, 'items.special'
# ------
# Score
# ------