feat(event): Habitoween

This commit is contained in:
SabreCat 2017-10-30 20:40:29 +00:00
parent b31268fbc2
commit d5cedaa925
22 changed files with 138 additions and 13 deletions

View file

@ -0,0 +1,111 @@
var migrationName = '20171030_jackolanterns.js';
var authorName = 'Sabe'; // in case script author needs to know when their ...
var authorUuid = '7f14ed62-5408-4e1b-be83-ada62d504931'; //... own data is done
/*
* Award the Jack-O'-Lantern ladder:
* Ghost Jack-O-Lantern Mount to owners of Ghost Jack-O-Lantern Pet
* Ghost Jack-O-Lantern Pet to owners of Jack-O-Lantern Mount
* Jack-O-Lantern Mount to owners of Jack-O-Lantern Pet
* Jack-O-Lantern Pet to everyone else
*/
var monk = require('monk');
var connectionString = 'mongodb://localhost:27017/habitrpg?auto_reconnect=true'; // FOR TEST DATABASE
var dbUsers = monk(connectionString).get('users', { castIds: false });
function processUsers(lastId) {
// specify a query to limit the affected users (empty for all users):
var query = {
'migration':{$ne:migrationName},
};
if (lastId) {
query._id = {
$gt: lastId
}
}
dbUsers.find(query, {
sort: {_id: 1},
limit: 250,
fields: [
'items.pets',
'items.mounts',
] // specify fields we are interested in to limit retrieved data (empty if we're not reading data):
})
.then(updateUsers)
.catch(function (err) {
console.log(err);
return exiting(1, 'ERROR! ' + err);
});
}
var progressCount = 1000;
var count = 0;
function updateUsers (users) {
if (!users || users.length === 0) {
console.warn('All appropriate users found and modified.');
displayData();
return;
}
var userPromises = users.map(updateUser);
var lastUser = users[users.length - 1];
return Promise.all(userPromises)
.then(function () {
processUsers(lastUser._id);
});
}
function updateUser (user) {
count++;
var set = {};
var 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,
};
if (user && user.items && user.items.pets && user.items.pets['JackOLantern-Ghost']) {
set = {'migration':migrationName, 'items.mounts.JackOLantern-Ghost': true};
} else if (user && user.items && user.items.mounts && user.items.mounts['JackOLantern-Base']) {
set = {'migration':migrationName, 'items.pets.JackOLantern-Ghost': 5};
} else if (user && user.items && user.items.pets && user.items.pets['JackOLantern-Base']) {
set = {'migration':migrationName, 'items.mounts.JackOLantern-Base': true};
} else {
set = {'migration':migrationName, 'items.pets.JackOLantern-Base': 5};
}
dbUsers.update({_id: user._id}, {$set:set, $inc:inc});
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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View file

@ -1,9 +1,9 @@
// this variables are used to determine which shop npc/backgrounds should be loaded
// possible values are: normal, fall
// possible values are: normal, fall, habitoween
// 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

@ -4,14 +4,25 @@
.align-self-center.right-margin(:class='baileyClass')
.media-body
h1.align-self-center(v-markdown='$t("newStuff")')
h2 10/26/2017 - BEHIND THE SCENES: THE JOYFUL REAPER
h2 10/30/2017 - HAPPY HABITOWEEN!
hr
.media
.media-body
h3 Behind the Scenes Blog Post: The Joyful Reaper
p(v-markdown='"Have you ever wanted to know more about the Joyful Reaper, the Master of Healers? [Today\'s blog post](https://habitica.wordpress.com/2017/10/26/behind-the-scenes-spotlight-on-the-joyful-reaper/) features a spotlight on the guardian of the Flourishing Fields! Check it out now to learn about her masterful healer skills, as well as an explanation of some of Habitica\'s quirks."')
h3 It's Habitoween!
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....
h3 Jack O' Lantern Pets and Mounts!
p(v-markdown='"The Flourishing Fields are full of cute carved pumpkins - and it looks like one has [followed you home](/inventory/stable)!"')
p Each Habitoween, you'll get a new and exciting Jack o'Lantern variety! What kind of Jack o' Lantern? It all depends on how many Habitoweens you've celebrated with us. Happy Fall Festival!
.small by Lemoness
.npc_joyful_reaper
h3 Candy for Everyone!
p(v-markdown='"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 [Stable](/inventory/stable)! Enjoy."')
.small by SabreCat and Lemoness
.promo_jackolanterns.left-margin
h3 Last Chance for Fall Festival Items and Imperious Imp Set
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 Spooky and Ghost Hatching Potions. Grab them all while you still can!
p(v-markdown='"Plus, today is the final day to [subscribe](/user/settings/subscription) and receive the Imperious Imp Item Set!"')
p Thanks so much for your supporting the site -- you're helping us keep Habitica alive. Happy Habitoween!
.small by Lemoness
br
</template>

View file

@ -251,10 +251,10 @@ api.specialMounts = stable.specialMounts;
api.mountInfo = stable.mountInfo;
// For seasonal events, change these booleans:
let canBuyNormalFood = true;
let canDropNormalFood = true;
let canBuyCandyFood = false;
let canDropCandyFood = false;
let canBuyNormalFood = false;
let canDropNormalFood = false;
let canBuyCandyFood = true;
let canDropCandyFood = true;
let canBuyCakeFood = false;
let canDropCakeFood = false;

View file

@ -86,6 +86,7 @@ let specialMounts = {
'Turkey-Gilded': 'gildedTurkey',
'Jackalope-RoyalPurple': 'royalPurpleJackalope',
'Aether-Invisible': 'invisibleAether',
'JackOLantern-Ghost': 'ghostJackolantern',
};
each(specialPets, (translationString, key) => {

BIN
website/raw_sprites/spritesmith/npcs/npc_bailey.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
website/raw_sprites/spritesmith/npcs/npc_justin.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
website/raw_sprites/spritesmith/npcs/npc_matt.png Executable file → Normal file

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: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View file

@ -137,6 +137,8 @@ function _setUpNewUser (user) {
user.items.quests.dustbunnies = 1;
user.purchased.background.violet = true;
user.preferences.background = 'violet';
user.items.pets['JackOLantern-Base'] = 5;
user.items.currentPet = 'JackOLantern-Base';
if (user.registeredThrough === 'habitica-web') {
taskTypes = ['habit', 'daily', 'todo', 'reward', 'tag'];