unlock pets feature

This commit is contained in:
Tyler Renelle
2013-02-11 01:55:45 -05:00
parent ec86c98e6b
commit 8d920a7ea1
3 changed files with 87 additions and 63 deletions
+15
View File
@@ -182,6 +182,21 @@ module.exports.app = (appExports, model) ->
content: html
$('ul.items').popover 'show'
user.on 'set', 'flags.petsEnabled', (captures, args) ->
return unless captures == true
html = """
<img src='/img/BrowserQuest/habitrpg_mods/wolf_border.png' style='width:30px;height:30px;float:left;padding-right:5px' />
You have unlocked Pets! You can now buy buy pets with tokens (note, you replenish tokens with real-life money - so chose your pets wisely!)
<a href='#' onClick="$('#rewardsTabs').popover('hide');return false;">[Close]</a>
"""
$('#rewardsTabs').popover
title: "Pets Unlocked"
placement: 'left'
trigger: 'manual'
html: true
content: html
$('#rewardsTabs').popover 'show'
###
update store
###
+3
View File
@@ -96,6 +96,9 @@ updateStats = (newStats, batch) ->
if !obj.flags.partyEnabled and obj.stats.lvl >= 3
batch.set 'flags.partyEnabled', true
obj.flags.partyEnabled = true
if !obj.flags.petsEnabled and obj.stats.lvl >= 4
batch.set 'flags.petsEnabled', true
obj.flags.petsEnabled = true
if newStats.gp?
#FIXME what was I doing here? I can't remember, gp isn't defined