WIP(NYE): New Year's Cards

This commit is contained in:
Sabe Jones
2014-12-29 20:57:12 -06:00
parent c14285dbd9
commit 9e74d94e48
3 changed files with 21 additions and 3 deletions

View File

@@ -22,5 +22,9 @@
"candycaneSet": "Candy Cane (Mage)",
"skiSet": "Ski-sassin (Rogue)",
"snowflakeSet": "Snowflake (Healer)",
"yetiSet": "Yeti Tamer (Warrior)"
"yetiSet": "Yeti Tamer (Warrior)",
"nyeCard": "New Year's Card",
"seasonalItems": "Seasonal Items",
"auldAcquaintance": "Auld Acquaintance",
"auldAcquaintanceText": "Happy New Year! Sent or received <%= cards %> New Year's cards."
}

View File

@@ -690,6 +690,20 @@ api.spells =
user.stats.buffs.spookDust = false
user.stats.gp -= 5
nye:
text: "New Year's Card"
mana: 0
value: 10
target: 'user'
notes: "Send a New Year's card to a friend."
cast: (user, target) ->
_.each [user,target], (t)->
t.achievements.nye ?= 0
t.achievements.nye++
(target.items.special.nyeReceived ?= []).push user.profile.name
target.markModified? 'items.special.nyeReceived'
user.stats.gp -= 10
# Intercept all spells to reduce user.stats.mp after casting the spell
_.each api.spells, (spellClass) ->
_.each spellClass, (spell, key) ->

View File

@@ -693,8 +693,8 @@ api.wrap = (user, main=true) ->
item = content.special[key]
return cb?({code:401, message: i18n.t('messageNotEnoughGold', req.language)}) if user.stats.gp < item.value
user.stats.gp -= item.value
user.items.special[item.key] ?= 0
user.items.special[item.key]++
user.items.special[key] ?= 0
user.items.special[key]++
user.markModified? 'items.special'
message = i18n.t('messageBought', {itemText: item.text(req.language)}, req.language)
cb? {code:200,message}, _.pick(user,$w 'items stats')