diff --git a/migrations/users/pi-day.js b/migrations/users/pi-day.js index d1c9ed972f..9adc78da91 100644 --- a/migrations/users/pi-day.js +++ b/migrations/users/pi-day.js @@ -3,7 +3,7 @@ import { v4 as uuid } from 'uuid'; import { model as User } from '../../website/server/models/user'; -const MIGRATION_NAME = '20190314_pi_day'; +const MIGRATION_NAME = '20200314_pi_day'; const progressCount = 1000; let count = 0; @@ -24,27 +24,37 @@ async function updateUser (user) { 'items.food.Pie_Red': 1, }; const set = {}; + let push; set.migration = MIGRATION_NAME; - set['items.gear.owned.head_special_piDay'] = false; - set['items.gear.owned.shield_special_piDay'] = false; - const push = [ - { type: 'marketGear', path: 'gear.flat.head_special_piDay', _id: uuid() }, - { type: 'marketGear', path: 'gear.flat.shield_special_piDay', _id: uuid() }, - ]; + if (typeof user.items.gear.owned.head_special_piDay !== 'undefined') { + push = false; + } else { + set['items.gear.owned.head_special_piDay'] = false; + set['items.gear.owned.shield_special_piDay'] = false; + push = [ + { type: 'marketGear', path: 'gear.flat.head_special_piDay', _id: uuid() }, + { type: 'marketGear', path: 'gear.flat.shield_special_piDay', _id: uuid() }, + ]; + } if (count % progressCount === 0) console.warn(`${count} ${user._id}`); + if (push) { + return User + .update({ _id: user._id }, { $inc: inc, $set: set, $push: { pinnedItems: { $each: push } } }) + .exec(); + } return User - .update({ _id: user._id }, { $inc: inc, $set: set, $push: { pinnedItems: { $each: push } } }) + .update({ _id: user._id }, { $inc: inc, $set: set }) .exec(); } export default async function processUsers () { const query = { migration: { $ne: MIGRATION_NAME }, - 'auth.timestamps.loggedin': { $gt: new Date('2019-02-15') }, + 'auth.timestamps.loggedin': { $gt: new Date('2020-02-15') }, }; const fields = { diff --git a/website/client/src/assets/css/sprites/spritesmith-largeSprites-0.css b/website/client/src/assets/css/sprites/spritesmith-largeSprites-0.css index 398c92a46d..0123c9bc4d 100644 --- a/website/client/src/assets/css/sprites/spritesmith-largeSprites-0.css +++ b/website/client/src/assets/css/sprites/spritesmith-largeSprites-0.css @@ -1,6 +1,6 @@ .promo_achievement_CottonCandyPink { background-image: url('~@/assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -668px -296px; + background-position: -668px -444px; width: 204px; height: 102px; } @@ -22,9 +22,15 @@ width: 282px; height: 147px; } +.promo_pi_day { + background-image: url('~@/assets/images/sprites/spritesmith-largeSprites-0.png'); + background-position: -668px -296px; + width: 273px; + height: 147px; +} .promo_take_this { background-image: url('~@/assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -668px -399px; + background-position: -424px -277px; width: 96px; height: 69px; } diff --git a/website/client/src/assets/images/sprites/spritesmith-largeSprites-0.png b/website/client/src/assets/images/sprites/spritesmith-largeSprites-0.png index 21480feb75..5c61c797f5 100644 Binary files a/website/client/src/assets/images/sprites/spritesmith-largeSprites-0.png and b/website/client/src/assets/images/sprites/spritesmith-largeSprites-0.png differ diff --git a/website/common/script/content/index.js b/website/common/script/content/index.js index 1e7666625a..3bf23c2996 100644 --- a/website/common/script/content/index.js +++ b/website/common/script/content/index.js @@ -195,7 +195,7 @@ api.mountInfo = stable.mountInfo; // For seasonal events, change this constant: -const FOOD_SEASON = 'Normal'; +const FOOD_SEASON = 'Pie'; api.food = { Meat: { diff --git a/website/raw_sprites/spritesmith_large/promo_pi_day.png b/website/raw_sprites/spritesmith_large/promo_pi_day.png new file mode 100644 index 0000000000..294b4c6a4e Binary files /dev/null and b/website/raw_sprites/spritesmith_large/promo_pi_day.png differ diff --git a/website/server/controllers/api-v3/news.js b/website/server/controllers/api-v3/news.js index 2bd5c7774b..01ef12c320 100644 --- a/website/server/controllers/api-v3/news.js +++ b/website/server/controllers/api-v3/news.js @@ -4,7 +4,7 @@ const api = {}; // @TODO export this const, cannot export it from here because only routes are exported from // controllers -const LAST_ANNOUNCEMENT_TITLE = 'DISCOUNTED QUEST BUNDLE: HUG A BUG!'; +const LAST_ANNOUNCEMENT_TITLE = 'CELEBRATE PI DAY WITH HABITICA!'; const worldDmg = { // @TODO bailey: false, }; @@ -31,29 +31,21 @@ api.getNews = {

${res.t('newStuff')}

-

3/10/2020 - ${LAST_ANNOUNCEMENT_TITLE}

+

3/14/2020 - ${LAST_ANNOUNCEMENT_TITLE}


-
+

- If you're looking to add some insect friends to your Habitica stable, you're in luck! - From now until March 31, you can purchase the Hug a Bug Pet Quest Bundle and receive the - Snail, Beetle, and Butterfly quests, all for only 7 Gems! That's a discount of 5 Gems - from the price of purchasing them separately. Check it out in the Quest Shop today! + Hello Habiticans! In celebration of Pi Day on March 14, we've gifted everyone delicious + slices of pie for you all to feed to your pets.

- If you’d prefer not to see bugs in Habitica due to a phobia, check out the Phobia - Protection Extension and enable the option for hiding "Beetles"! + If you weren't with us for last year's Pi Day, we've also given you a festive Pi Hat and + Shield so you can celebrate in style. Enjoy them, and thanks for being a part of our + community!

-
By Lemoness, SabreCat, and Beffymaroo
-
- Art by Pfeffernusse, Megan, Pocketmole, overomega, Misceo, UncommonCriminal, Zorella, - Anna Glassman, Leephon, Lilith of Alfheim, Ac, starsystemic, and Karithina -
-
Writing by arachnidstardis, emiausti, and AnnDeLune
+
by Beffymaroo and SabreCat
`, });