diff --git a/migrations/archive/2019/20190731_naming_day.js b/migrations/archive/2019/20190731_naming_day.js new file mode 100644 index 0000000000..677f241d98 --- /dev/null +++ b/migrations/archive/2019/20190731_naming_day.js @@ -0,0 +1,84 @@ +/* eslint-disable no-console */ +const MIGRATION_NAME = '20190731_naming_day'; +import { v4 as uuid } from 'uuid'; + +import { model as User } from '../../../website/server/models/user'; + +const progressCount = 1000; +let count = 0; + +async function updateUser (user) { + count++; + + let set; + let push; + const inc = { + 'items.food.Cake_Base': 1, + 'items.food.Cake_CottonCandyBlue': 1, + 'items.food.Cake_CottonCandyPink': 1, + 'items.food.Cake_Desert': 1, + 'items.food.Cake_Golden': 1, + 'items.food.Cake_Red': 1, + 'items.food.Cake_Shade': 1, + 'items.food.Cake_Skeleton': 1, + 'items.food.Cake_White': 1, + 'items.food.Cake_Zombie': 1, + 'achievements.habiticaDays': 1, + }; + + if (user && user.items && user.items.gear && user.items.gear.owned && typeof user.items.gear.owned.body_special_namingDay2018 !== 'undefined') { + set = { migration: MIGRATION_NAME }; + } else if (user && user.items && user.items.gear && user.items.gear.owned && typeof user.items.gear.owned.head_special_namingDay2017 !== 'undefined') { + set = { migration: MIGRATION_NAME, 'items.gear.owned.body_special_namingDay2018': false }; + push = { pinnedItems: { type: 'marketGear', path: 'gear.flat.body_special_namingDay2018', _id: uuid() }}; + } else if (user && user.items && user.items.pets && typeof user.items.pets['Gryphon-RoyalPurple'] !== 'undefined') { + set = { migration: MIGRATION_NAME, 'items.gear.owned.head_special_namingDay2017': false }; + push = { pinnedItems: { type: 'marketGear', path: 'gear.flat.head_special_namingDay2017', _id: uuid() }}; + } else if (user && user.items && user.items.mounts && typeof user.items.mounts['Gryphon-RoyalPurple'] !== 'undefined') { + set = { migration: MIGRATION_NAME, 'items.pets.Gryphon-RoyalPurple': 5 }; + } else { + set = { migration: MIGRATION_NAME, 'items.mounts.Gryphon-RoyalPurple': true }; + } + + if (count % progressCount === 0) console.warn(`${count} ${user._id}`); + + if (push) { + return await User.update({ _id: user._id }, { $set: set, $inc: inc, $push: push }).exec(); + } else { + return await User.update({ _id: user._id }, { $set: set, $inc: inc }).exec(); + } +} + +module.exports = async function processUsers () { + let query = { + migration: { $ne: MIGRATION_NAME }, + 'auth.timestamps.loggedin': { $gt: new Date('2019-07-01') }, + }; + + const fields = { + _id: 1, + items: 1, + }; + + while (true) { // eslint-disable-line no-constant-condition + const users = await User // eslint-disable-line no-await-in-loop + .find(query) + .limit(250) + .sort({_id: 1}) + .select(fields) + .lean() + .exec(); + + if (users.length === 0) { + console.warn('All appropriate users found and modified.'); + console.warn(`\n${count} users processed\n`); + break; + } else { + query._id = { + $gt: users[users.length - 1]._id, + }; + } + + await Promise.all(users.map(updateUser)); // eslint-disable-line no-await-in-loop + } +}; diff --git a/website/client/assets/css/sprites/spritesmith-largeSprites-0.css b/website/client/assets/css/sprites/spritesmith-largeSprites-0.css index d4110b3f6c..c4bd6a473f 100644 --- a/website/client/assets/css/sprites/spritesmith-largeSprites-0.css +++ b/website/client/assets/css/sprites/spritesmith-largeSprites-0.css @@ -12,13 +12,19 @@ } .promo_mystery_201907 { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -776px -444px; + background-position: -376px -286px; width: 282px; height: 144px; } +.promo_naming_day_2018 { + background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); + background-position: -776px -444px; + width: 285px; + height: 162px; +} .promo_orcas { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -376px -286px; + background-position: 0px -696px; width: 219px; height: 147px; } @@ -30,7 +36,7 @@ } .promo_seasonal_shop { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -596px -286px; + background-position: -220px -696px; width: 162px; height: 132px; } @@ -60,7 +66,7 @@ } .promo_take_this { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -1059px -444px; + background-position: -1062px -444px; width: 96px; height: 69px; } diff --git a/website/client/assets/images/sprites/spritesmith-largeSprites-0.png b/website/client/assets/images/sprites/spritesmith-largeSprites-0.png index 954ce1b997..6f0addac03 100644 Binary files a/website/client/assets/images/sprites/spritesmith-largeSprites-0.png and b/website/client/assets/images/sprites/spritesmith-largeSprites-0.png differ diff --git a/website/raw_sprites/spritesmith_large/promo_naming_day_2018.png b/website/raw_sprites/spritesmith_large/promo_naming_day_2018.png new file mode 100644 index 0000000000..61440313fa Binary files /dev/null and b/website/raw_sprites/spritesmith_large/promo_naming_day_2018.png differ diff --git a/website/server/controllers/api-v3/news.js b/website/server/controllers/api-v3/news.js index 21b16e1702..fb9699c2b2 100644 --- a/website/server/controllers/api-v3/news.js +++ b/website/server/controllers/api-v3/news.js @@ -3,7 +3,7 @@ import { authWithHeaders } from '../../middlewares/auth'; let api = {}; // @TODO export this const, cannot export it from here because only routes are exported from controllers -const LAST_ANNOUNCEMENT_TITLE = 'JULY SUBSCRIBER ITEMS AND HABITICA BLOG POSTS'; +const LAST_ANNOUNCEMENT_TITLE = 'HABITICA NAMING DAY! AND LAST CHANCE FOR SUMMER LIMITED ITEMS'; const worldDmg = { // @TODO bailey: false, }; @@ -30,25 +30,29 @@ api.getNews = {
Happy Habitica Naming Day! In honor of the day when we changed the name of the app from HabitRPG to Habitica, we've given everyone an achievement, as well as some delicious cake for your pets and mounts. Everyone has also received Royal Purple Gryphon rewards! Depending on how many Naming Days you've celebrated with us, you've received Melior (a Purple Gryphon mount), his little sister Meliora (a Purple Gryphon pet), a Purple Gryphon Helm, or the Purple Gryphon Wing Cloak!
+Thanks for being a Habitica user -- you all mean so much to us. We hope that you enjoy your presents!
+The July Subscriber Items have been revealed: the extra-special 3-piece Beach Buddy Item Set! You only have until July 31 to receive the item set when you subscribe.
-If you're already an active subscriber, reload the site or app and then head to Inventory > Items to claim your gear!
-Subscribers also receive the ability to buy Gems for Gold -- the longer you subscribe, the more Gems you can buy per month! There are other perks as well, such as longer access to uncompressed data and a cute Jackalope pet. Best of all, subscriptions let us keep Habitica running. Thank you very much for your support -- it means a lot to us.
+Reminder: this is the final day to subscribe and receive the three-piece Beach Buddy Set! Subscribing also lets you buy Gems for Gold. The longer your subscription, the more Gems you get!
+Thanks so much for your support! You help keep Habitica running.
This month's featured Wiki article and Use Case Spotlight are about the Healer Class! We hope that they will help you as you choose the best class for your Habitica play style. Be sure to check them out, and let us know what you think by reaching out on Twitter, Tumblr, and Facebook.
-Plus, we're collecting user submissions for the next spotlight! We want to hear your best tricks and strategies for playing the Rogue class to its full advantage. We’ll be featuring player-submitted examples in Use Case Spotlights on the Habitica Blog next month, so post your suggestions in the Use Case Spotlight Guild now. We look forward to learning more about how you use Habitica to improve your life and get things done!
-There's a new Guild Spotlight on the blog that highlights more of the upcoming Guilds in Habitica dedicated to a variety of topics! Check it out now to find some of Habitica's best new communities.
-This is also your last chance to get all Summer Splash goodies before they vanish at the end of July 31st! This includes Limited-Edition Outfits, Seasonal Shop purchases, Seasonal Edition Skins, and yes, even Watery and Glass Hatching Potions. Grab them all while you still can!
+ +This is also the final day to buy the discounted Splashy Pals Pet Quest Bundle, featuring the Seahorse, Sea Turtle, and Whale quests all for seven gems! Be sure to catch it in the Quest Shop before it swims away!
+