feat(content): July Subscriber Items and Summer Splash Orcas
@@ -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 });
|
||||
|
||||
99
migrations/users/summer-splash-orcas.js
Normal 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;
|
||||
@@ -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",
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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',
|
||||
|
||||
|
After Width: | Height: | Size: 947 B |
|
After Width: | Height: | Size: 875 B |
|
After Width: | Height: | Size: 841 B |
|
After Width: | Height: | Size: 776 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 965 B |
|
Before Width: | Height: | Size: 1.8 KiB |
BIN
website/raw_sprites/spritesmith_large/promo_mystery_201807.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
website/raw_sprites/spritesmith_large/promo_orcas.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
@@ -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 = {
|
||||
<div class="mr-3 ${baileyClass}"></div>
|
||||
<div class="media-body">
|
||||
<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>
|
||||
<hr/>
|
||||
<div class="media align-items-center">
|
||||
<div class="media-body">
|
||||
<h3>Habitica at San Diego Comic Con!</h3>
|
||||
<p>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!).</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. Can’t wait to meet you :)</p>
|
||||
<h3>Orcas for Everyone!</h3>
|
||||
<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>
|
||||
<div class="small mb-3">by Beffymaroo and UncommonCriminal</div>
|
||||
</div>
|
||||
<div class="promo_unconventional_armor ml-3 mb-3"></div>
|
||||
<div class="promo_orcas ml-3 mb-3"></div>
|
||||
</div>
|
||||
<div class="media align-items-center">
|
||||
<div class="scene_pomodoro mr-3"></div>
|
||||
<div class="promo_mystery_201807"></div>
|
||||
<div class="media-body">
|
||||
<h3>Wiki Spotlight: The Pomodoro Technique</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>
|
||||
<div class="small mb-3">by shanaqui and the Wiki Wizards</div>
|
||||
<h3>July Subscriber Items Revealed!</h3>
|
||||
<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>
|
||||
</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>
|
||||
`,
|
||||
});
|
||||
|
||||