feat(content): July Subscriber Items and Summer Splash Orcas

This commit is contained in:
Sabe Jones
2018-07-24 14:59:49 -05:00
parent f31a82c8f2
commit 48a92e77be
15 changed files with 132 additions and 12 deletions

View File

@@ -1,14 +1,14 @@
import monk from 'monk'; import monk from 'monk';
import nconf from 'nconf'; 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 authorName = 'Sabe'; // in case script author needs to know when their ...
const authorUuid = '7f14ed62-5408-4e1b-be83-ada62d504931'; // ... own data is done const authorUuid = '7f14ed62-5408-4e1b-be83-ada62d504931'; // ... own data is done
/* /*
* Award this month's mystery items to subscribers * 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'); const CONNECTION_STRING = nconf.get('MIGRATION_CONNECT_STRING');
let dbUsers = monk(CONNECTION_STRING).get('users', { castIds: false }); let dbUsers = monk(CONNECTION_STRING).get('users', { castIds: false });

View File

@@ -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;

View File

@@ -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.", "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", "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.", "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", "armorMystery301404Text": "Steampunk Suit",
"armorMystery301404Notes": "Dapper and dashing, wot! Confers no benefit. February 3015 Subscriber Item.", "armorMystery301404Notes": "Dapper and dashing, wot! Confers no benefit. February 3015 Subscriber Item.",
"armorMystery301703Text": "Steampunk Peacock Gown", "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.", "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", "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.", "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", "headMystery301404Text": "Fancy Top Hat",
"headMystery301404Notes": "A fancy top hat for the finest of gentlefolk! January 3015 Subscriber Item. Confers no benefit.", "headMystery301404Notes": "A fancy top hat for the finest of gentlefolk! January 3015 Subscriber Item. Confers no benefit.",
"headMystery301405Text": "Basic Top Hat", "headMystery301405Text": "Basic Top Hat",

View File

@@ -199,6 +199,12 @@ let armor = {
mystery: '201806', mystery: '201806',
value: 0, value: 0,
}, },
201807: {
text: t('armorMystery201807Text'),
notes: t('armorMystery201807Notes'),
mystery: '201807',
value: 0,
},
301404: { 301404: {
text: t('armorMystery301404Text'), text: t('armorMystery301404Text'),
notes: t('armorMystery301404Notes'), notes: t('armorMystery301404Notes'),
@@ -595,6 +601,12 @@ let head = {
mystery: '201806', mystery: '201806',
value: 0, value: 0,
}, },
201807: {
text: t('headMystery201807Text'),
notes: t('headMystery201807Notes'),
mystery: '201807',
value: 0,
},
301404: { 301404: {
text: t('headMystery301404Text'), text: t('headMystery301404Text'),
notes: t('headMystery301404Notes'), notes: t('headMystery301404Notes'),

View File

@@ -214,6 +214,10 @@ let mysterySets = {
start: '2018-06-21', start: '2018-06-21',
end: '2018-07-02', end: '2018-07-02',
}, },
201807: {
start: '2018-07-24',
end: '2018-08-02',
},
301404: { 301404: {
start: '3014-03-24', start: '3014-03-24',
end: '3014-04-02', end: '3014-04-02',

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 965 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -3,7 +3,7 @@ import { authWithHeaders } from '../../middlewares/auth';
let api = {}; let api = {};
// @TODO export this const, cannot export it from here because only routes are exported from controllers // @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 const worldDmg = { // @TODO
bailey: false, bailey: false,
}; };
@@ -30,26 +30,27 @@ api.getNews = {
<div class="mr-3 ${baileyClass}"></div> <div class="mr-3 ${baileyClass}"></div>
<div class="media-body"> <div class="media-body">
<h1 class="align-self-center">${res.t('newStuff')}</h1> <h1 class="align-self-center">${res.t('newStuff')}</h1>
<h2>7/19/2018 - ${LAST_ANNOUNCEMENT_TITLE}</h2> <h2>7/24/2018 - ${LAST_ANNOUNCEMENT_TITLE}</h2>
</div> </div>
</div> </div>
<hr/> <hr/>
<div class="media align-items-center"> <div class="media align-items-center">
<div class="media-body"> <div class="media-body">
<h3>Habitica at San Diego Comic Con!</h3> <h3>Orcas for Everyone!</h3>
<p>Beffymaroo will be representing Habitica at San Diego Comic Con this year. If youd 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!).</p> <p>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!</p>
<p>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. Cant wait to meet you :)</p> <div class="small mb-3">by Beffymaroo and UncommonCriminal</div>
</div> </div>
<div class="promo_unconventional_armor ml-3 mb-3"></div> <div class="promo_orcas ml-3 mb-3"></div>
</div> </div>
<div class="media align-items-center"> <div class="media align-items-center">
<div class="scene_pomodoro mr-3"></div> <div class="promo_mystery_201807"></div>
<div class="media-body"> <div class="media-body">
<h3>Wiki Spotlight: The Pomodoro Technique</h3> <h3>July Subscriber Items Revealed!</h3>
<p>This month's <a href='https://habitica.wordpress.com/2018/07/18/pomodoro/' target='_blank'>featured Wiki article</a> 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 <a href='https://twitter.com/habitica' target='_blank'>Twitter</a>, <a href='http://blog.habitrpg.com' target='_blank'>Tumblr</a>, and <a href='https://facebook.com/habitica' target='_blank'>Facebook</a>.</p> <p>The July Subscriber Items have been revealed: the Sea Serpent Set! You only have eight days to receive the item set when you <a href='/user/settings/subscription' target="_blank">subscribe</a>. If you're already an active subscriber, reload the site and then head to Inventory > Items to claim your gear!</p>
<div class="small mb-3">by shanaqui and the Wiki Wizards</div>
</div> </div>
</div> </div>
<p>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.</p>
<div class="small mb-3">by Beffymaroo</div>
</div> </div>
`, `,
}); });