feat(greeting-cards): Thank-You & Greets

This commit is contained in:
Sabe Jones
2015-08-13 16:58:31 -05:00
parent f57e3e69a1
commit 00a212660a
8 changed files with 45 additions and 28 deletions
+4
View File
@@ -928,6 +928,7 @@ api.spells =
if !target.items.special.nyeReceived
target.items.special.nyeReceived = []
target.items.special.nyeReceived.push user.profile.name
target.flags.cardReceived = true
target.markModified? 'items.special.nyeReceived'
user.stats.gp -= 10
@@ -951,6 +952,7 @@ api.spells =
if !target.items.special.valentineReceived
target.items.special.valentineReceived = []
target.items.special.valentineReceived.push user.profile.name
target.flags.cardReceived = true
target.markModified? 'items.special.valentineReceived'
user.stats.gp -= 10
@@ -974,6 +976,7 @@ api.spells =
if !target.items.special.greetingReceived
target.items.special.greetingReceived = []
target.items.special.greetingReceived.push user.profile.name
target.flags.cardReceived = true
target.markModified? 'items.special.greetingReceived'
user.stats.gp -= 10
@@ -997,6 +1000,7 @@ api.spells =
if !target.items.special.thankyouReceived
target.items.special.thankyouReceived = []
target.items.special.thankyouReceived.push user.profile.name
target.flags.cardReceived = true
target.markModified? 'items.special.thankyouReceived'
user.stats.gp -= 10
+2 -1
View File
@@ -1168,7 +1168,8 @@ 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')
readCard: (cardType, cb) ->
readCard: (req, cb) ->
{cardType} = req.params
user.items.special["#{cardType}Received"].shift()
user.markModified? "items.special.#{cardType}Received"
user.flags.cardReceived = false