feat(content): Turkey Day 2018

This commit is contained in:
Sabe Jones
2018-11-22 15:05:03 -06:00
parent 1b7a705bf9
commit 9cea86f4e0
16 changed files with 149 additions and 11 deletions

View File

@@ -0,0 +1,110 @@
/* eslint-disable no-console */
const MIGRATION_NAME = '20181122_turkey_day';
import mongoose from 'mongoose';
import { model as User } from '../../website/server/models/user';
const progressCount = 1000;
let count = 0;
async function updateUser (user) {
count++;
const set = {};
let push;
set.migration = MIGRATION_NAME;
if (typeof user.items.gear.owned.armor_special_turkeyArmorBase !== 'undefined') {
set['items.gear.owned.head_special_turkeyHelmGilded'] = false;
set['items.gear.owned.armor_special_turkeyArmorGilded'] = false;
set['items.gear.owned.back_special_turkeyTailGilded'] = false;
push = [
{
type: 'marketGear',
path: 'gear.flat.head_special_turkeyHelmGilded',
_id: new mongoose.Types.ObjectId(),
},
{
type: 'marketGear',
path: 'gear.flat.armor_special_turkeyArmorGilded',
_id: new mongoose.Types.ObjectId(),
},
{
type: 'marketGear',
path: 'gear.flat.back_special_turkeyTailGilded',
_id: new mongoose.Types.ObjectId(),
},
];
} else if (user.items && user.items.mounts && user.items.mounts['Turkey-Gilded']) {
set['items.gear.owned.head_special_turkeyHelmBase'] = false;
set['items.gear.owned.armor_special_turkeyArmorBase'] = false;
set['items.gear.owned.back_special_turkeyTailBase'] = false;
push = [
{
type: 'marketGear',
path: 'gear.flat.head_special_turkeyHelmBase',
_id: new mongoose.Types.ObjectId(),
},
{
type: 'marketGear',
path: 'gear.flat.armor_special_turkeyArmorBase',
_id: new mongoose.Types.ObjectId(),
},
{
type: 'marketGear',
path: 'gear.flat.back_special_turkeyTailBase',
_id: new mongoose.Types.ObjectId(),
},
];
} else if (user.items && user.items.pets && user.items.pets['Turkey-Gilded']) {
set['items.mounts.Turkey-Gilded'] = true;
} else if (user.items && user.items.mounts && user.items.mounts['Turkey-Base']) {
set['items.pets.Turkey-Gilded'] = 5;
} else if (user.items && user.items.pets && user.items.pets['Turkey-Base']) {
set['items.mounts.Turkey-Base'] = true;
} else {
set['items.pets.Turkey-Base'] = 5;
}
if (count % progressCount === 0) console.warn(`${count} ${user._id}`);
if (push) {
return await User.update({_id: user._id}, {$set: set, $push: {pinnedItems: {$each: push}}}).exec();
} else {
return await User.update({_id: user._id}, {$set: set}).exec();
}
}
module.exports = async function processUsers () {
let query = {
migration: {$ne: MIGRATION_NAME},
'auth.timestamps.loggedin': {$gt: new Date('2018-11-07')},
};
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 // possible values are: normal, fall, habitoween, thanksgiving, winter, nye, birthday, valentines, spring, summer
// more to be added on future seasons // more to be added on future seasons
$npc_market_flavor: 'normal'; $npc_market_flavor: 'thanksgiving';
$npc_quests_flavor: 'normal'; $npc_quests_flavor: 'thanksgiving';
$npc_seasonal_flavor: 'normal'; $npc_seasonal_flavor: 'thanksgiving';
$npc_timetravelers_flavor: 'normal'; $npc_timetravelers_flavor: 'normal';
$npc_tavern_flavor: 'normal'; $npc_tavern_flavor: 'thanksgiving';

View File

@@ -477,6 +477,8 @@
"armorSpecialSamuraiArmorNotes": "This strong, scaled armor is held together by elegant silk cords. Increases Perception by <%= per %>.", "armorSpecialSamuraiArmorNotes": "This strong, scaled armor is held together by elegant silk cords. Increases Perception by <%= per %>.",
"armorSpecialTurkeyArmorBaseText": "Turkey Armor", "armorSpecialTurkeyArmorBaseText": "Turkey Armor",
"armorSpecialTurkeyArmorBaseNotes": "Keep your drumsticks warm and cozy in this feathery armor! Confers no benefit.", "armorSpecialTurkeyArmorBaseNotes": "Keep your drumsticks warm and cozy in this feathery armor! Confers no benefit.",
"armorSpecialTurkeyArmorGildedText": "Gilded Turkey Armor",
"armorSpecialTurkeyArmorGildedNotes": "Strut your stuff in this seasonally shiny armor! Confers no benefit.",
"armorSpecialYetiText": "Yeti-Tamer Robe", "armorSpecialYetiText": "Yeti-Tamer Robe",
"armorSpecialYetiNotes": "Fuzzy and fierce. Increases Constitution by <%= con %>. Limited Edition 2013-2014 Winter Gear.", "armorSpecialYetiNotes": "Fuzzy and fierce. Increases Constitution by <%= con %>. Limited Edition 2013-2014 Winter Gear.",
@@ -933,6 +935,8 @@
"headSpecialNamingDay2017Notes": "Happy Naming Day! Wear this fierce and feathery helm as you celebrate Habitica. Confers no benefit.", "headSpecialNamingDay2017Notes": "Happy Naming Day! Wear this fierce and feathery helm as you celebrate Habitica. Confers no benefit.",
"headSpecialTurkeyHelmBaseText": "Turkey Helm", "headSpecialTurkeyHelmBaseText": "Turkey Helm",
"headSpecialTurkeyHelmBaseNotes": "Your Turkey Day look will be complete when you don this beaked helm! Confers no benefit.", "headSpecialTurkeyHelmBaseNotes": "Your Turkey Day look will be complete when you don this beaked helm! Confers no benefit.",
"headSpecialTurkeyHelmGildedText": "Gilded Turkey Helm",
"headSpecialTurkeyHelmGildedNotes": "Gobble gobble! Bling bling! Confers no benefit.",
"headSpecialNyeText": "Absurd Party Hat", "headSpecialNyeText": "Absurd Party Hat",
"headSpecialNyeNotes": "You've received an Absurd Party Hat! Wear it with pride while ringing in the New Year! Confers no benefit.", "headSpecialNyeNotes": "You've received an Absurd Party Hat! Wear it with pride while ringing in the New Year! Confers no benefit.",
@@ -1617,6 +1621,8 @@
"backSpecialAetherCloakNotes": "This cloak once belonged to the Lost Masterclasser herself. Increases Perception by <%= per %>.", "backSpecialAetherCloakNotes": "This cloak once belonged to the Lost Masterclasser herself. Increases Perception by <%= per %>.",
"backSpecialTurkeyTailBaseText": "Turkey Tail", "backSpecialTurkeyTailBaseText": "Turkey Tail",
"backSpecialTurkeyTailBaseNotes": "Wear your noble Turkey Tail with pride while you celebrate! Confers no benefit.", "backSpecialTurkeyTailBaseNotes": "Wear your noble Turkey Tail with pride while you celebrate! Confers no benefit.",
"backSpecialTurkeyTailGildedText": "Gilded Turkey Tail",
"backSpecialTurkeyTailGildedNotes": "Plumage fit for a parade! Confers no benefit.",
"backBearTailText": "Bear Tail", "backBearTailText": "Bear Tail",
"backBearTailNotes": "This tail makes you look like a brave bear! Confers no benefit.", "backBearTailNotes": "This tail makes you look like a brave bear! Confers no benefit.",
"backCactusTailText": "Cactus Tail", "backCactusTailText": "Cactus Tail",

View File

@@ -1053,6 +1053,12 @@ let armor = {
value: 90, value: 90,
con: 15, con: 15,
}, },
turkeyArmorGilded: {
text: t('armorSpecialTurkeyArmorGildedText'),
notes: t('armorSpecialTurkeyArmorGildedNotes'),
value: 0,
canOwn: ownsItem('armor_special_turkeyArmorGilded'),
},
}; };
let back = { let back = {
@@ -1157,6 +1163,12 @@ let back = {
return true; return true;
}, },
}, },
turkeyTailGilded: {
text: t('backSpecialTurkeyTailGildedText'),
notes: t('backSpecialTurkeyTailGildedNotes'),
value: 0,
canOwn: ownsItem('back_special_turkeyTailGilded'),
},
}; };
let body = { let body = {
@@ -2380,6 +2392,12 @@ let head = {
value: 60, value: 60,
int: 7, int: 7,
}, },
turkeyHelmGilded: {
text: t('headSpecialTurkeyHelmGildedText'),
notes: t('headSpecialTurkeyHelmGildedNotes'),
value: 0,
canOwn: ownsItem('head_special_turkeyHelmGilded'),
},
}; };
let headAccessory = { let headAccessory = {

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 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 = 'THUNDERSTORM AND FROST HATCHING POTIONS'; const LAST_ANNOUNCEMENT_TITLE = 'HAPPY THANKSGIVING!';
const worldDmg = { // @TODO const worldDmg = { // @TODO
bailey: false, bailey: false,
}; };
@@ -30,14 +30,17 @@ 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>11/20/2018 - ${LAST_ANNOUNCEMENT_TITLE}</h2> <h2>11/22/2018 - ${LAST_ANNOUNCEMENT_TITLE}</h2>
</div> </div>
</div> </div>
<hr/> <hr/>
<div class="promo_frost_potions center-block"></div> <div class="npc_matt center-block"></div>
<p>We've brought back Thunderstorm Potions, and added a brand-new Magic Hatching Potion: Frost! Between now and November 30, you can buy these Hatching Potions from <a href='/shops/market' target='_blank'>the Market</a> and use them to hatch any standard pet egg. (Magic Hatching Potions do not work on Quest Pet eggs.) Magic Hatching Potion Pets aren't picky, so they'll happily eat any kind of food that you feed them!</p> <p>It's Thanksgiving in Habitica! On this day Habiticans celebrate by spending time with loved ones, giving thanks, and riding their glorious turkeys into the magnificent sunset. Some of the NPCs are celebrating the occasion!</p>
<p>After they're gone, it will be at least a year before the Thunderstorm or Frost Hatching Potions are available again, so be sure to get them now!</p> <h3>Turkey Pet, Mount, and Costumes!</h3>
<div class="small mb-3">by Balduranne and SabreCat</div> <p>In celebration of Turkey Day, everyone has received an adorable Turkey! What kind of Turkey? It all depends on how many Habitica Thanksgivings you've celebrated with us. Each Thanksgiving, you'll get a new and exciting Turkey variety!</p>
<p>Thank you for using Habitica - we really love you all <3</p>
<div class="small mb-3">by Lemoness and Beffymaroo</div>
<div class="promo_turkey_day_2018 center-block"></div>
</div> </div>
`, `,
}); });

View File

@@ -125,7 +125,8 @@ function _setUpNewUser (user) {
let iterableFlags = user.flags.toObject(); let iterableFlags = user.flags.toObject();
user.items.quests.dustbunnies = 1; user.items.quests.dustbunnies = 1;
user.items.pets['Wolf-Veteran'] = 5; // Thank-you for users joining during username upheaval user.items.pets['Turkey-Base'] = 5;
user.items.currentPet = 'Turkey-Base';
user.purchased.background.violet = true; user.purchased.background.violet = true;
user.preferences.background = 'violet'; user.preferences.background = 'violet';