diff --git a/migrations/users/mystery-items.js b/migrations/users/mystery-items.js index b1e0b818e6..d03cd8ceec 100644 --- a/migrations/users/mystery-items.js +++ b/migrations/users/mystery-items.js @@ -1,14 +1,14 @@ import monk from 'monk'; import nconf from 'nconf'; -const migrationName = 'mystery-items-201806.js'; // Update per month +const migrationName = 'mystery-items-201807.js'; // Update per month const authorName = 'Sabe'; // in case script author needs to know when their ... const authorUuid = '7f14ed62-5408-4e1b-be83-ada62d504931'; // ... own data is done /* * Award this month's mystery items to subscribers */ -const MYSTERY_ITEMS = ['armor_mystery_201806', 'head_mystery_201806']; +const MYSTERY_ITEMS = ['armor_mystery_201807', 'head_mystery_201807']; const CONNECTION_STRING = nconf.get('MIGRATION_CONNECT_STRING'); let dbUsers = monk(CONNECTION_STRING).get('users', { castIds: false }); diff --git a/migrations/users/summer-splash-orcas.js b/migrations/users/summer-splash-orcas.js new file mode 100644 index 0000000000..58373fe147 --- /dev/null +++ b/migrations/users/summer-splash-orcas.js @@ -0,0 +1,99 @@ +let migrationName = '20180724_summer-splash-orcas.js'; // Update per month +let authorName = 'Sabe'; // in case script author needs to know when their ... +let authorUuid = '7f14ed62-5408-4e1b-be83-ada62d504931'; // ... own data is done + +/* + * Award ladder items to participants in this year's Summer Splash festivities + */ + +import monk from 'monk'; +import nconf from 'nconf'; +const CONNECTION_STRING = nconf.get('MIGRATION_CONNECT_STRING'); +let dbUsers = monk(CONNECTION_STRING).get('users', { castIds: false }); + +function processUsers (lastId) { + // specify a query to limit the affected users (empty for all users): + let query = { + migration: {$ne: migrationName}, + 'auth.timestamps.loggedin': {$gt: new Date('2018-07-01')}, // rerun without date restriction after initial run + }; + + if (lastId) { + query._id = { + $gt: lastId, + }; + } + + dbUsers.find(query, { + sort: {_id: 1}, + limit: 250, + fields: [ + 'items.mounts', + ], // specify fields we are interested in to limit retrieved data (empty if we're not reading data): + }) + .then(updateUsers) + .catch((err) => { + console.log(err); + return exiting(1, `ERROR! ${ err}`); + }); +} + +let progressCount = 1000; +let count = 0; + +function updateUsers (users) { + if (!users || users.length === 0) { + console.warn('All appropriate users found and modified.'); + displayData(); + return; + } + + let userPromises = users.map(updateUser); + let lastUser = users[users.length - 1]; + + return Promise.all(userPromises) + .then(() => { + processUsers(lastUser._id); + }); +} + +function updateUser (user) { + count++; + + let set = {}; + + if (user && user.items && user.items.pets && typeof user.items.pets['Orca-Base'] !== 'undefined') { + set = {migration: migrationName}; + } else if (user && user.items && user.items.mounts && typeof user.items.mounts['Orca-Base'] !== 'undefined') { + set = {migration: migrationName, 'items.pets.Orca-Base': 5}; + } else { + set = {migration: migrationName, 'items.mounts.Orca-Base': true}; + } + + dbUsers.update({_id: user._id}, {$set: set}); + + if (count % progressCount === 0) console.warn(`${count } ${ user._id}`); + if (user._id === authorUuid) console.warn(`${authorName } processed`); +} + +function displayData () { + console.warn(`\n${ count } users processed\n`); + return exiting(0); +} + +function exiting (code, msg) { + code = code || 0; // 0 = success + if (code && !msg) { + msg = 'ERROR!'; + } + if (msg) { + if (code) { + console.error(msg); + } else { + console.log(msg); + } + } + process.exit(code); +} + +module.exports = processUsers; diff --git a/website/common/locales/en/gear.json b/website/common/locales/en/gear.json index c5c040eaf5..cce33a6f68 100644 --- a/website/common/locales/en/gear.json +++ b/website/common/locales/en/gear.json @@ -713,6 +713,8 @@ "armorMystery201802Notes": "This shiny armor reflects your strength of heart and infuses it into any Habiticans nearby who may need encouragement! Confers no benefit. February 2018 Subscriber Item.", "armorMystery201806Text": "Alluring Anglerfish Tail", "armorMystery201806Notes": "This sinuous tail features glowing spots to light your way through the deep. Confers no benefit. June 2018 Subscriber Item.", + "armorMystery201807Text": "Sea Serpent Tail", + "armorMystery201807Notes": "This powerful tail will propel you through the sea at incredible speeds! Confers no benefit. July 2018 Subscriber Item.", "armorMystery301404Text": "Steampunk Suit", "armorMystery301404Notes": "Dapper and dashing, wot! Confers no benefit. February 3015 Subscriber Item.", "armorMystery301703Text": "Steampunk Peacock Gown", @@ -1148,6 +1150,8 @@ "headMystery201805Notes": "This helm will make you the proudest and prettiest (possibly also the loudest) bird in town. Confers no benefit. May 2018 Subscriber Item.", "headMystery201806Text": "Alluring Anglerfish Helm", "headMystery201806Notes": "The mesmerizing light atop this helm will call all the creatures of the sea to your side. We urge you to use your glowy powers of attraction for good! Confers no benefit. June 2018 Subscriber Item.", + "headMystery201807Text": "Sea Serpent Helm", + "headMystery201807Notes": "The strong scales on this helm will protect you from any manner of oceanic foe. Confers no benefit. July 2018 Subscriber Item.", "headMystery301404Text": "Fancy Top Hat", "headMystery301404Notes": "A fancy top hat for the finest of gentlefolk! January 3015 Subscriber Item. Confers no benefit.", "headMystery301405Text": "Basic Top Hat", diff --git a/website/common/script/content/gear/sets/mystery.js b/website/common/script/content/gear/sets/mystery.js index 7f4d6b2a47..f4fb51452e 100644 --- a/website/common/script/content/gear/sets/mystery.js +++ b/website/common/script/content/gear/sets/mystery.js @@ -199,6 +199,12 @@ let armor = { mystery: '201806', value: 0, }, + 201807: { + text: t('armorMystery201807Text'), + notes: t('armorMystery201807Notes'), + mystery: '201807', + value: 0, + }, 301404: { text: t('armorMystery301404Text'), notes: t('armorMystery301404Notes'), @@ -595,6 +601,12 @@ let head = { mystery: '201806', value: 0, }, + 201807: { + text: t('headMystery201807Text'), + notes: t('headMystery201807Notes'), + mystery: '201807', + value: 0, + }, 301404: { text: t('headMystery301404Text'), notes: t('headMystery301404Notes'), diff --git a/website/common/script/content/mystery-sets.js b/website/common/script/content/mystery-sets.js index b7b294f7b3..b5105b04be 100644 --- a/website/common/script/content/mystery-sets.js +++ b/website/common/script/content/mystery-sets.js @@ -214,6 +214,10 @@ let mysterySets = { start: '2018-06-21', end: '2018-07-02', }, + 201807: { + start: '2018-07-24', + end: '2018-08-02', + }, 301404: { start: '3014-03-24', end: '3014-04-02', diff --git a/website/raw_sprites/spritesmith/gear/events/mystery_201807/broad_armor_mystery_201807.png b/website/raw_sprites/spritesmith/gear/events/mystery_201807/broad_armor_mystery_201807.png new file mode 100644 index 0000000000..1961ae82f5 Binary files /dev/null and b/website/raw_sprites/spritesmith/gear/events/mystery_201807/broad_armor_mystery_201807.png differ diff --git a/website/raw_sprites/spritesmith/gear/events/mystery_201807/head_mystery_201807.png b/website/raw_sprites/spritesmith/gear/events/mystery_201807/head_mystery_201807.png new file mode 100644 index 0000000000..04a73e4f53 Binary files /dev/null and b/website/raw_sprites/spritesmith/gear/events/mystery_201807/head_mystery_201807.png differ diff --git a/website/raw_sprites/spritesmith/gear/events/mystery_201807/shop_armor_mystery_201807.png b/website/raw_sprites/spritesmith/gear/events/mystery_201807/shop_armor_mystery_201807.png new file mode 100644 index 0000000000..5f82349d01 Binary files /dev/null and b/website/raw_sprites/spritesmith/gear/events/mystery_201807/shop_armor_mystery_201807.png differ diff --git a/website/raw_sprites/spritesmith/gear/events/mystery_201807/shop_head_mystery_201807.png b/website/raw_sprites/spritesmith/gear/events/mystery_201807/shop_head_mystery_201807.png new file mode 100644 index 0000000000..bda8f137a9 Binary files /dev/null and b/website/raw_sprites/spritesmith/gear/events/mystery_201807/shop_head_mystery_201807.png differ diff --git a/website/raw_sprites/spritesmith/gear/events/mystery_201807/shop_set_mystery_201807.png b/website/raw_sprites/spritesmith/gear/events/mystery_201807/shop_set_mystery_201807.png new file mode 100644 index 0000000000..6ee74a43a7 Binary files /dev/null and b/website/raw_sprites/spritesmith/gear/events/mystery_201807/shop_set_mystery_201807.png differ diff --git a/website/raw_sprites/spritesmith/gear/events/mystery_201807/slim_armor_mystery_201807.png b/website/raw_sprites/spritesmith/gear/events/mystery_201807/slim_armor_mystery_201807.png new file mode 100644 index 0000000000..f43df8cfe0 Binary files /dev/null and b/website/raw_sprites/spritesmith/gear/events/mystery_201807/slim_armor_mystery_201807.png differ diff --git a/website/raw_sprites/spritesmith_large/promo_mystery_201806.png b/website/raw_sprites/spritesmith_large/promo_mystery_201806.png deleted file mode 100644 index 4b6d6a12b7..0000000000 Binary files a/website/raw_sprites/spritesmith_large/promo_mystery_201806.png and /dev/null differ diff --git a/website/raw_sprites/spritesmith_large/promo_mystery_201807.png b/website/raw_sprites/spritesmith_large/promo_mystery_201807.png new file mode 100644 index 0000000000..8ce6b07fd3 Binary files /dev/null and b/website/raw_sprites/spritesmith_large/promo_mystery_201807.png differ diff --git a/website/raw_sprites/spritesmith_large/promo_orcas.png b/website/raw_sprites/spritesmith_large/promo_orcas.png new file mode 100644 index 0000000000..9a116b589c Binary files /dev/null and b/website/raw_sprites/spritesmith_large/promo_orcas.png differ diff --git a/website/server/controllers/api-v3/news.js b/website/server/controllers/api-v3/news.js index 0e0bc8593c..aef4ec6855 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 = 'HABITICA COMIC-CON MEETUP AND WIKI SPOTLIGHT ON THE POMODORO TECHNIQUE'; +const LAST_ANNOUNCEMENT_TITLE = 'ORCAS FOR SUMMER SPLASH AND JULY SUBSCRIBER ITEMS'; const worldDmg = { // @TODO bailey: false, }; @@ -30,26 +30,27 @@ api.getNews = {
Beffymaroo will be representing Habitica at San Diego Comic Con this year. If you’d like to meet her, along with other fellow Habiticans, join us at the Habitica SDCC Meetup! Beffymaroo will be handing out Habitica stickers, promo codes for the Unconventional Armor set, and other exciting special swag (quantities limited!).
-You can find the meetup on Saturday, July 21, at the San Diego Bayfront Hilton lobby from 12:00-1:00 PM! Look for the purple Gryphon banner. Can’t wait to meet you :)
+Sea Serpents aren't the only animals riding the waves around the city of Dilatory: it looks like some friendly Orcas are swimming into Habiticans' stables! In honor of the Summer Splash event, everyone who didn't already have both Orcas gets either the mount or the pet. Enjoy!
+This month's featured Wiki article is about the Pomodoro Technique! We hope that it will help you as you look for new productivity strategies. Be sure to check it out, and let us know what you think by reaching out on Twitter, Tumblr, and Facebook.
-The July Subscriber Items have been revealed: the Sea Serpent Set! You only have eight days to receive the item set when you subscribe. If you're already an active subscriber, reload the site 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.
+