feat(event): Habitoween 2019

This commit is contained in:
Sabe Jones
2019-10-31 15:03:25 -05:00
parent 2ab197745a
commit d79e0b32d2
13 changed files with 113 additions and 40 deletions

View File

@@ -0,0 +1,82 @@
/*
* Award Habitoween ladder items to participants in this month's Habitoween festivities
*/
/* eslint-disable no-console */
const MIGRATION_NAME = '20191031_habitoween_ladder'; // Update when running in future years
import { model as User } from '../../../website/server/models/user';
const progressCount = 1000;
let count = 0;
async function updateUser (user) {
count++;
const set = {};
const inc = {
'items.food.Candy_Skeleton': 1,
'items.food.Candy_Base': 1,
'items.food.Candy_CottonCandyBlue': 1,
'items.food.Candy_CottonCandyPink': 1,
'items.food.Candy_Shade': 1,
'items.food.Candy_White': 1,
'items.food.Candy_Golden': 1,
'items.food.Candy_Zombie': 1,
'items.food.Candy_Desert': 1,
'items.food.Candy_Red': 1,
};
set.migration = MIGRATION_NAME;
if (user && user.items && user.items.pets && user.items.pets['JackOLantern-Glow']) {
set['items.mounts.JackOLantern-Glow'] = true;
} else if (user && user.items && user.items.mounts && user.items.mounts['JackOLantern-Ghost']) {
set['items.pets.JackOLantern-Glow'] = 5;
} else if (user && user.items && user.items.pets && user.items.pets['JackOLantern-Ghost']) {
set['items.mounts.JackOLantern-Ghost'] = true;
} else if (user && user.items && user.items.mounts && user.items.mounts['JackOLantern-Base']) {
set['items.pets.JackOLantern-Ghost'] = 5;
} else if (user && user.items && user.items.pets && user.items.pets['JackOLantern-Base']) {
set['items.mounts.JackOLantern-Base'] = true;
} else {
set['items.pets.JackOLantern-Base'] = 5;
}
if (count % progressCount === 0) console.warn(`${count} ${user._id}`);
return await User.update({_id: user._id}, {$inc: inc, $set: set}).exec();
}
module.exports = async function processUsers () {
let query = {
migration: {$ne: MIGRATION_NAME},
'auth.timestamps.loggedin': {$gt: new Date('2019-10-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],
};
}
await Promise.all(users.map(updateUser)); // eslint-disable-line no-await-in-loop
}
};

View File

@@ -2,8 +2,8 @@
// possible values are: normal, fall, habitoween, thanksgiving, winter, nye, birthday, valentines, spring, summer
// more to be added on future seasons
$npc_market_flavor: 'fall';
$npc_quests_flavor: 'fall';
$npc_seasonal_flavor: 'fall';
$npc_market_flavor: 'habitoween';
$npc_quests_flavor: 'habitoween';
$npc_seasonal_flavor: 'habitoween';
$npc_timetravelers_flavor: 'fall';
$npc_tavern_flavor: 'fall';
$npc_tavern_flavor: 'habitoween';

View File

@@ -123,6 +123,7 @@ const specialMounts = {
'JackOLantern-Ghost': 'ghostJackolantern',
'Hippogriff-Hopeful': 'hopefulHippogriffMount',
'Gryphon-Gryphatrice': 'gryphatrice',
'JackOLantern-Glow': 'glowJackolantern',
};
each(specialPets, (translationString, key) => {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -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 = 'OCTOBER SUBSCRIBER ITEMS AND BLOG POSTS!';
const LAST_ANNOUNCEMENT_TITLE = 'HABITOWEEN! AND LAST CHANCE FOR OCTOBER AND FALL FESTIVAL ITEMS';
const worldDmg = { // @TODO
bailey: false,
};
@@ -31,43 +31,30 @@ api.getNews = {
<div class="mr-3 ${baileyClass}"></div>
<div class="media-body">
<h1 class="align-self-center">${res.t('newStuff')}</h1>
<h2>10/24/2019 - ${LAST_ANNOUNCEMENT_TITLE}</h2>
<h2>10/31/2019 - ${LAST_ANNOUNCEMENT_TITLE}</h2>
</div>
</div>
<hr/>
<div class="promo_mystery_201910 center-block"></div>
<h3>October Subscriber Items Revealed!</h3>
<p>The October Subscriber Item has been revealed: the Cryptic Flame Item Set! You only
have until October 31 to <a href='/user/settings/subscription'>receive the item set when
you subscribe</a>. If you're already an active subscriber, reload the site and then head
to Inventory > Items to claim your gear!</p>
<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>
<h3>Happy Habitoween!</h3>
<p>It's the last day of the Fall Festival, and all the NPCs are looking monstrous. Plus, we have lots of fun things in store...</p>
<div class="promo_habitoween_2019 center-block"></div>
<h3>Jack O' Lantern Pets and Mounts!</h3>
<p>The Flourishing Fields are full of cute carved pumpkins - and it looks like <a href='/inventory/stable'>one has followed you home</a>! What kind of pumpkin? It all depends on how many Habitoweens you've celebrated with us. Each Habitoween, you'll get a new and exciting pumpkin variety!</p>
<div class="small mb-3">by Lemoness and Beffymaroo</div>
<h3>Candy for Everyone!</h3>
<p>It's a feast for your pets and mounts! In honor of the end of the Fall Festival, we've given everyone an assortment of candy. You can feed it to your pets in the <a href='/inventory/stable'>Stable</a>! Enjoy.</p>
<div class="small mb-3">by SabreCat and Lemoness</div>
<div class="promo_fall_festival_2019 center-block"></div>
<h3>Last Chance for Fall Festival Items, Witchy Familiars Pet Quest Bundle, and Cryptic Flame Set</h3>
<p>This is your last chance to get all Fall Festival items before they vanish at the end of October 31st! This includes Limited-Edition Outfits, Seasonal Shop purchases, Seasonal Edition Skins and Hair Colors, and yes, even Glow-in-the-Dark, Spooky, and Shadow Hatching Potions. Grab them all while you still can!</p>
<div class="small mb-3">by gawrone, jjgame83, AnnDeLune, ʂʈєƒąʃųƥągųʂ, Katy133, Lilith of Alfheim, Definitely not a villain, ShoGirlGeek. cataclysms, maxpendragon, Vikte, mariahm, crystalphoenix, AaronTheTwin, tricksy.fox, QuartzFox, Lemoness, Beffymaroo and SabreCat</div>
<p>It's also the last day to get the Witchy Familiars Pet Quest Bundle and receive the Rat, Spider, and Frog 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 <a href='/shops/quests'>Quest Shop</a> before it crawls away!</p>
<div class="small">by Lemoness and SabreCat</div>
<div class="small">Art by Pandah, UncommonCriminal, Arcosine, starsystemic, RosemonkeyCT, Jon Arjinborn, and Breadstrings</div>
<div class="small mb-3">Writing by Token, Arcosine, and Fluitare</div>
<p>Plus, today is the final day to <a href='/user/settings/subscription'>subscribe</a> and receive the Cryptic Flame set along with other rad subscriber perks!</p>
<p>Thanks so much for your supporting the site -- you're helping us keep Habitica alive. Happy Habitoween!</p>
<div class="small mb-3">by Beffymaroo</div>
<div class="scene_arts_crafts center-block"></div>
<h3>Use Case Spotlight: Habitica Events!</h3>
<p>This month's <a href='https://habitica.wordpress.com/2019/10/24/
use-case-spotlight-using-habitican-events-for-motivation/' target='_blank'>Use Case
Spotlight</a> is about Using Habitica Events for Motivation! It features a number of
great suggestions submitted by Habiticans in the
<a href='/groups/guild/1d3a10bf-60aa-4806-a38b-82d1084a59e6'>Use Case Spotlights
Guild</a>. We hope it helps any of you who might be looking for new ways to
incentivize yourselves.</p>
<p>Plus, we're collecting user submissions for the next spotlight! How do you gamify your
tasks? Well 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!</p>
<div class="small mb-3">by shanaqui</div>
<h3>Guild Spotlight: More New and Notable Guilds!</h3>
<p>There's a new <a href='https://habitica.wordpress.com/2019/10/24/
new-and-notable-guild-spotlight-10/' target='_blank'>Guild Spotlight on the blog</a>
that highlights yet another selection 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.</p>
<div class="small mb-3">by shanaqui</div>
<div class="promo_seasonal_shop_fall center-block"></div>
</div>
`,
});

View File

@@ -127,10 +127,13 @@ function _setUpNewUser (user) {
const iterableFlags = user.flags.toObject();
user.items.quests.dustbunnies = 1;
user.markModified('items.quests');
user.purchased.background.violet = true;
user.preferences.background = 'violet';
user.items.pets['JackOLantern-Base'] = 5;
user.items.currentPet = 'JackOLantern-Base';
user.migration = '20191031_habitoween_ladder';
user.markModified('items');
if (user.registeredThrough === 'habitica-web') {
taskTypes = ['habit', 'daily', 'todo', 'reward', 'tag'];