From 676112c1b5437165dfab56e16e29b0cba7c65359 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Fri, 20 Dec 2013 10:25:23 -0700 Subject: [PATCH] winter event! npcs, snowball=>snowman, new hairs/beards. Fixes to beard/chin overlays. move Fortify Service => "Fortify Potion" Special. @sabrecat let me know what you think: http://gyazo.com/55cd424f104b8f3acb557b99d918cb4b). Sorry for mixing concerns in this commit, some rebase difficulties --- locales/en/app.json | 2 +- public/css/inventory.styl | 2 +- src/controllers/user.js | 3 ++- src/models/user.js | 11 +++++--- views/options/inventory/inventory.jade | 24 ++++++++++++------ views/options/profile.jade | 16 ++++++++---- views/shared/header/avatar.jade | 35 ++++++++++++++------------ views/shared/tasks/lists.jade | 15 +++++++++++ 8 files changed, 73 insertions(+), 35 deletions(-) diff --git a/locales/en/app.json b/locales/en/app.json index c45eaf02b0..0c0fa858bb 100644 --- a/locales/en/app.json +++ b/locales/en/app.json @@ -302,7 +302,7 @@ "_commentitemsother" : "OTHER ITEMS", "healthPotionName" : "Health Potion", "healthPotionNotes" : "Recover 15 HP Instantly", - "rerollName" : "Fortify", + "rerollName" : "Fortify Potion", "rerollNotes" : "Resets your task values back to yellow. Useful when everything's red and it's hard to stay alive.", "rerollModelHeader" : "Reset Your Tasks", "rerollModelText1" : "Highly discouraged because red tasks provide good incentive to improve", diff --git a/public/css/inventory.styl b/public/css/inventory.styl index 50df7c71ab..cf7e917846 100644 --- a/public/css/inventory.styl +++ b/public/css/inventory.styl @@ -84,7 +84,7 @@ menu.pets div margin-top:1em p text-align:center - width:6em + //width:6em margin-top:-.5em .hatchingPotion-menu > div display:inline-block diff --git a/src/controllers/user.js b/src/controllers/user.js index b23e601ba2..818df8db90 100644 --- a/src/controllers/user.js +++ b/src/controllers/user.js @@ -299,7 +299,8 @@ api.buyGemsPaypalIPN = function(req, res) { api.cast = function(req, res) { var user = res.locals.user; var type = req.body.type, target = req.body.target; - var spell = shared.content.spells[user.stats.class][req.params.spell]; + var klass = req.params.spell == 'snowball' ? 'special' : user.stats.class + var spell = shared.content.spells[klass][req.params.spell]; var done = function(){ var err = arguments[0]; diff --git a/src/models/user.js b/src/models/user.js index 8a183b4b56..e17de59cac 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -62,9 +62,7 @@ var UserSchema = new Schema({ backer: { tier: Number, - //admin: Boolean, // FIXME migrate to contributor.admin npc: String, - //contributor: String, // FIXME migrate to contributor.text tokensApplied: Boolean }, @@ -82,7 +80,7 @@ var UserSchema = new Schema({ ads: {type: Boolean, 'default': false}, skin: {type: Schema.Types.Mixed, 'default': {}}, // eg, {skeleton: true, pumpkin: true, eb052b: true} hair: {type: Schema.Types.Mixed, 'default': {}}, - shirt: {type: Schema.Types.Mixed, 'default': {}} + shirt: {type: Schema.Types.Mixed, 'default': {}}, }, flags: { @@ -128,6 +126,10 @@ var UserSchema = new Schema({ }, }, + special:{ + snowball: {type: Number, 'default': 0} + }, + // -------------- Animals ------------------- // Complex bit here. The result looks like: // pets: { @@ -245,7 +247,8 @@ var UserSchema = new Schema({ per: Number, con: Number, stealth: Number, - streaks: Boolean + streaks: Boolean, + snowball: Boolean } }, tags: [ diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index 3bf6c9db29..ef8f4c040e 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -47,6 +47,12 @@ script(type='text/ng-template', id='partials/options.inventory.drops.html') .badge.badge-info.stack-count {{points}} //-p {{food}} + li.customize-menu(ng-if='user.items.special.snowball') + menu.pets-menu(label='Special') + div + button.customize-option(popover='{{Content.special.snowball.notes}}', popover-title='{{Content.special.snowball.text}}', popover-trigger='mouseenter', popover-placement='right', ng-click='castStart(Content.special.snowball)', class='inventory_special_snowball') + .badge.badge-info.stack-count {{user.items.special.snowball}} + .span6 h2 Market .row-fluid @@ -94,17 +100,21 @@ script(type='text/ng-template', id='partials/options.inventory.drops.html') p | {{food.value}} span.Pet_Currency_Gem1x.inline-gems - menu.pets-menu(label='Saddle') + + li.customize-menu + menu.pets-menu(label='Special') div button.customize-option(popover='{{Content.food.Saddle.notes}}', popover-title='{{Content.food.Saddle.text}}', popover-trigger='mouseenter', popover-placement='left', ng-click='purchase("food", Content.food.Saddle)', class='Pet_Food_{{Content.food.Saddle.name}}') p | {{Content.food.Saddle.value}} span.Pet_Currency_Gem1x.inline-gems - - li.customize-menu - menu.pets-menu(label='Services') div - // Once grunt-spritesmith is merged, let's use https://github.com/browserquest/BrowserQuest/blob/master/client/img/1/item-firepotion.png - button.btn(popover='Return all tasks to neutral value (yellow color), and restore all lost Health.', popover-title=env.t('rerollName'), popover-trigger='mouseenter', popover-placement='left', ng-click='modals.reroll = true') - | Fortify 4 + button.customize-option(popover='Return all tasks to neutral value (yellow color), and restore all lost Health.', popover-title=env.t('rerollName'), popover-trigger='mouseenter', popover-placement='left', ng-click='modals.reroll = true', class='inventory_special_fortify') + p + | 4 + span.Pet_Currency_Gem1x.inline-gems + div + button.customize-option(popover='{{Content.spells.special.snowball.notes}}', popover-title='{{Content.spells.special.snowball.text}}', popover-trigger='mouseenter', popover-placement='left', ng-click='purchase("special", Content.spells.special.snowball)', class='inventory_special_snowball') + p + | {{Content.spells.special.snowball.value}} span.Pet_Currency_Gem1x.inline-gems diff --git a/views/options/profile.jade b/views/options/profile.jade index 13640cc4de..e0b3d9eb48 100644 --- a/views/options/profile.jade +++ b/views/options/profile.jade @@ -36,13 +36,19 @@ script(id='partials/options.profile.avatar.html', type='text/ng-template') button(type='button', class='customize-option', style='width: 40px; height: 40px; background-color:#cfb853;', ng-click='set({"preferences.hair.color": "blond"})') button(type='button', class='customize-option', style='width: 40px; height: 40px; background-color:#ec720f;', ng-click='set({"preferences.hair.color": "red" })') button(type='button', class='customize-option', style='width: 40px; height: 40px; background-color:#2e2e2e;', ng-click='set({"preferences.hair.color": "black"})') - + li.customize-menu + menu(label='Winter Colors') + button(type='button', ng-class='{locked: !user.purchased.hair.color.candycane}', class='customize-option hair_bangs_1_candycane', style='width: 40px; height: 40px;', ng-click='unlock("hair.color.candycane")') + button(type='button', ng-class='{locked: !user.purchased.hair.color.frost}', class='customize-option hair_bangs_1_frost', style='width: 40px; height: 40px;', ng-click='unlock("hair.color.frost")') + button(type='button', ng-class='{locked: !user.purchased.hair.color.winternight}', class='customize-option hair_bangs_1_winternight', style='width: 40px; height: 40px;', ng-click='unlock("hair.color.winternight")') + button(type='button', ng-class='{locked: !user.purchased.hair.color.holly}', class='customize-option hair_bangs_1_holly', style='width: 40px; height: 40px;', ng-click='unlock("hair.color.holly")') + button.btn.btn-small.btn-primary(ng-hide='user.purchased.hair.color.candycane && user.purchased.hair.color.frost && user.purchased.hair.color.winternight && user.purchased.hair.color.holly', ng-click='unlock("hair.color.candycane,hair.color.frost,hair.color.winternight,hair.color.holly")') Unlock Set - 5 h5 Hair // Bangs li.customize-menu menu(label='Bangs') - button(class='head_base_0 customize-option', type='button', ng-click='set({"preferences.hair.bangs":0})') + button(class='head_0 customize-option', type='button', ng-click='set({"preferences.hair.bangs":0})') button(class='hair_bangs_1_{{user.preferences.hair.color}} customize-option', type='button', ng-click='set({"preferences.hair.bangs":1})') button(class='hair_bangs_2_{{user.preferences.hair.color}} customize-option', type='button', ng-click='set({"preferences.hair.bangs":2})') button(class='hair_bangs_3_{{user.preferences.hair.color}} customize-option', type='button', ng-click='set({"preferences.hair.bangs":3})') @@ -50,7 +56,7 @@ script(id='partials/options.profile.avatar.html', type='text/ng-template') // Base li.customize-menu menu(label='Base') - button(class='head_base_0 customize-option', type='button', ng-click='set({"preferences.hair.base":0})') + button(class='head_0 customize-option', type='button', ng-click='set({"preferences.hair.base":0})') button(class='hair_base_1_{{user.preferences.hair.color}} customize-option', type='button', ng-click='set({"preferences.hair.base":1})') button(class='hair_base_2_{{user.preferences.hair.color}} customize-option', type='button', ng-class='{locked: !user.purchased.hair.base.2}', ng-click='unlock("hair.base.2")') button(class='hair_base_3_{{user.preferences.hair.color}} customize-option', type='button', ng-click='set({"preferences.hair.base":3})') @@ -67,7 +73,7 @@ script(id='partials/options.profile.avatar.html', type='text/ng-template') // Beard li.customize-menu menu(label='Beard') - button(class='head_base_0 customize-option', type='button', ng-click='set({"preferences.hair.beard":0})') + button(class='head_0 customize-option', type='button', ng-click='set({"preferences.hair.beard":0})') button(class='hair_beard_1_{{user.preferences.hair.color}} customize-option', type='button', ng-class='{locked: !user.purchased.hair.beard.1}', ng-click='unlock("hair.beard.1")') button(class='hair_beard_2_{{user.preferences.hair.color}} customize-option', type='button', ng-class='{locked: !user.purchased.hair.beard.2}', ng-click='unlock("hair.beard.2")') button(class='hair_beard_3_{{user.preferences.hair.color}} customize-option', type='button', ng-class='{locked: !user.purchased.hair.beard.3}', ng-click='unlock("hair.beard.3")') @@ -75,7 +81,7 @@ script(id='partials/options.profile.avatar.html', type='text/ng-template') // Mustache li.customize-menu menu(label='Mustache') - button(class='head_base_0 customize-option', type='button', ng-click='set({"preferences.hair.mustache":0})') + button(class='head_0 customize-option', type='button', ng-click='set({"preferences.hair.mustache":0})') button(class='hair_mustache_1_{{user.preferences.hair.color}} customize-option', type='button', ng-class='{locked: !user.purchased.hair.mustache.1}', ng-click='unlock("hair.mustache.1")') button(class='hair_mustache_2_{{user.preferences.hair.color}} customize-option', type='button', ng-class='{locked: !user.purchased.hair.mustache.2}', ng-click='unlock("hair.mustache.2")') diff --git a/views/shared/header/avatar.jade b/views/shared/header/avatar.jade index 572a31cf37..fd9ed71529 100644 --- a/views/shared/header/avatar.jade +++ b/views/shared/header/avatar.jade @@ -8,29 +8,32 @@ figure.herobox(ng-click='spell ? castEnd(profile, "user", $event) : clickMember( // Mount Body span(ng-if='profile.items.currentMount', class='Mount_Body_{{profile.items.currentMount}}') - // Avatar - span(class='skin_{{profile.preferences.skin}}') + span(ng-if='profile.stats.buffs.snowball') + span.snowman + span(ng-if='!profile.stats.buffs.snowball') + // Avatar + span(class='skin_{{profile.preferences.skin}}') - span(class='{{profile.preferences.size}}_shirt_{{profile.preferences.shirt}}') - span(class='{{profile.preferences.size}}_{{profile.items.gear.equipped.armor}}', ng-if='!profile.preferences.costume') - span(class='{{profile.preferences.size}}_{{profile.items.gear.costume.armor}}', ng-if='profile.preferences.costume') + span(class='{{profile.preferences.size}}_shirt_{{profile.preferences.shirt}}') + span(class='{{profile.preferences.size}}_{{profile.items.gear.equipped.armor}}', ng-if='!profile.preferences.costume') + span(class='{{profile.preferences.size}}_{{profile.items.gear.costume.armor}}', ng-if='profile.preferences.costume') - span(class='head_base_0') - span(class='hair_base_{{profile.preferences.hair.base}}_{{profile.preferences.hair.color}}') - span(class='hair_bangs_{{profile.preferences.hair.bangs}}_{{profile.preferences.hair.color}}') + span(class='head_0') + span(class='hair_base_{{profile.preferences.hair.base}}_{{profile.preferences.hair.color}}') + span(class='hair_bangs_{{profile.preferences.hair.bangs}}_{{profile.preferences.hair.color}}') - span(class='hair_beard_{{profile.preferences.hair.beard}}_{{profile.preferences.hair.color}}') - span(class='hair_mustache_{{profile.preferences.hair.mustache}}_{{profile.preferences.hair.color}}') + span(class='hair_mustache_{{profile.preferences.hair.mustache}}_{{profile.preferences.hair.color}}') + span(class='hair_beard_{{profile.preferences.hair.beard}}_{{profile.preferences.hair.color}}') - span(class='{{profile.items.gear.equipped.head}}', ng-if='!profile.preferences.costume') - span(class='{{profile.items.gear.costume.head}}', ng-if='profile.preferences.costume') + span(class='{{profile.items.gear.equipped.head}}', ng-if='!profile.preferences.costume') + span(class='{{profile.items.gear.costume.head}}', ng-if='profile.preferences.costume') - span(class='{{profile.items.gear.equipped.shield}}', ng-if='!profile.preferences.costume') - span(class='{{profile.items.gear.costume.shield}}', ng-if='profile.preferences.costume') + span(class='{{profile.items.gear.equipped.shield}}', ng-if='!profile.preferences.costume') + span(class='{{profile.items.gear.costume.shield}}', ng-if='profile.preferences.costume') - span(class='{{profile.items.gear.equipped.weapon}}', ng-if='!profile.preferences.costume') - span(class='{{profile.items.gear.costume.weapon}}', ng-if='profile.preferences.costume') + span(class='{{profile.items.gear.equipped.weapon}}', ng-if='!profile.preferences.costume') + span(class='{{profile.items.gear.costume.weapon}}', ng-if='profile.preferences.costume') // Mount Head diff --git a/views/shared/tasks/lists.jade b/views/shared/tasks/lists.jade index 99677d4012..11d6e061b6 100644 --- a/views/shared/tasks/lists.jade +++ b/views/shared/tasks/lists.jade @@ -60,6 +60,21 @@ script(id='templates/habitrpg-tasks.html', type="text/ng-template") span(bo-class='{"shop_{{item.key}} shop-sprite item-img": true}') p.task-text {{item.text}} + // Snowball (event spells?) + ul.items.rewards(ng-if='main && list.type=="reward" && user.items.special.snowball>0') + li.task.reward-item + .task-meta-controls + span.task-notes(popover-trigger='mouseenter', popover-placement='left', popover='{{Content.spells.special.snowball.notes}}', popover-title='{{Content.spells.special.snowball.text}}') + i.icon-comment + //left-hand size commands + .task-controls + a.money.btn-buy.item-btn(ng-click='castStart(Content.spells.special.snowball)') + span.reward-cost + strong {{user.items.special.snowball}} + // main content + span.shop_snowball.shop-sprite.item-img + p.task-text {{Content.spells.special.snowball.text}} + // Spells ul.items(ng-if='main && list.type=="reward" && user.stats.class && !user.preferences.disableClasses') li.task.reward-item(ng-repeat='(k,spell) in Content.spells[user.stats.class]', ng-show='user.stats.lvl >= spell.lvl')