diff --git a/migrations/20171030_jackolanterns.js b/migrations/20171030_jackolanterns.js new file mode 100644 index 0000000000..63be6de265 --- /dev/null +++ b/migrations/20171030_jackolanterns.js @@ -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; diff --git a/website/client/assets/images/npc/habitoween/market_background.png b/website/client/assets/images/npc/habitoween/market_background.png new file mode 100644 index 0000000000..398b96d19f Binary files /dev/null and b/website/client/assets/images/npc/habitoween/market_background.png differ diff --git a/website/client/assets/images/npc/habitoween/market_banner_npc.png b/website/client/assets/images/npc/habitoween/market_banner_npc.png new file mode 100644 index 0000000000..beb12ffe8e Binary files /dev/null and b/website/client/assets/images/npc/habitoween/market_banner_npc.png differ diff --git a/website/client/assets/images/npc/habitoween/quest_shop_background.png b/website/client/assets/images/npc/habitoween/quest_shop_background.png new file mode 100644 index 0000000000..c9d2868638 Binary files /dev/null and b/website/client/assets/images/npc/habitoween/quest_shop_background.png differ diff --git a/website/client/assets/images/npc/habitoween/quest_shop_npc.png b/website/client/assets/images/npc/habitoween/quest_shop_npc.png new file mode 100644 index 0000000000..b5699944bb Binary files /dev/null and b/website/client/assets/images/npc/habitoween/quest_shop_npc.png differ diff --git a/website/client/assets/images/npc/habitoween/seasonal_shop_opened_background.png b/website/client/assets/images/npc/habitoween/seasonal_shop_opened_background.png new file mode 100644 index 0000000000..b81f2bda25 Binary files /dev/null and b/website/client/assets/images/npc/habitoween/seasonal_shop_opened_background.png differ diff --git a/website/client/assets/images/npc/habitoween/seasonal_shop_opened_npc.png b/website/client/assets/images/npc/habitoween/seasonal_shop_opened_npc.png new file mode 100644 index 0000000000..4bcfd9a621 Binary files /dev/null and b/website/client/assets/images/npc/habitoween/seasonal_shop_opened_npc.png differ diff --git a/website/client/assets/images/npc/habitoween/tavern_background.png b/website/client/assets/images/npc/habitoween/tavern_background.png new file mode 100644 index 0000000000..05d8abb722 Binary files /dev/null and b/website/client/assets/images/npc/habitoween/tavern_background.png differ diff --git a/website/client/assets/images/npc/habitoween/tavern_npc.png b/website/client/assets/images/npc/habitoween/tavern_npc.png new file mode 100644 index 0000000000..f8c58ba0c6 Binary files /dev/null and b/website/client/assets/images/npc/habitoween/tavern_npc.png differ diff --git a/website/client/assets/scss/variables.scss b/website/client/assets/scss/variables.scss index dc866265a7..22ef620052 100644 --- a/website/client/assets/scss/variables.scss +++ b/website/client/assets/scss/variables.scss @@ -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"; diff --git a/website/client/components/static/newStuff.vue b/website/client/components/static/newStuff.vue index 6180c9a676..0cc3d28d9d 100644 --- a/website/client/components/static/newStuff.vue +++ b/website/client/components/static/newStuff.vue @@ -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 diff --git a/website/common/script/content/index.js b/website/common/script/content/index.js index 23d9a9769b..da4d968968 100644 --- a/website/common/script/content/index.js +++ b/website/common/script/content/index.js @@ -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; diff --git a/website/common/script/content/stable.js b/website/common/script/content/stable.js index 51f6f991df..3bfa8ed814 100644 --- a/website/common/script/content/stable.js +++ b/website/common/script/content/stable.js @@ -86,6 +86,7 @@ let specialMounts = { 'Turkey-Gilded': 'gildedTurkey', 'Jackalope-RoyalPurple': 'royalPurpleJackalope', 'Aether-Invisible': 'invisibleAether', + 'JackOLantern-Ghost': 'ghostJackolantern', }; each(specialPets, (translationString, key) => { diff --git a/website/raw_sprites/spritesmith/npcs/npc_bailey.png b/website/raw_sprites/spritesmith/npcs/npc_bailey.png old mode 100755 new mode 100644 index da25513fb8..755699a1cb Binary files a/website/raw_sprites/spritesmith/npcs/npc_bailey.png and b/website/raw_sprites/spritesmith/npcs/npc_bailey.png differ diff --git a/website/raw_sprites/spritesmith/npcs/npc_justin.png b/website/raw_sprites/spritesmith/npcs/npc_justin.png old mode 100755 new mode 100644 index d1973b48df..97ce158c9f Binary files a/website/raw_sprites/spritesmith/npcs/npc_justin.png and b/website/raw_sprites/spritesmith/npcs/npc_justin.png differ diff --git a/website/raw_sprites/spritesmith/npcs/npc_matt.png b/website/raw_sprites/spritesmith/npcs/npc_matt.png old mode 100755 new mode 100644 index 1cd1006fd3..30e95d29f3 Binary files a/website/raw_sprites/spritesmith/npcs/npc_matt.png and b/website/raw_sprites/spritesmith/npcs/npc_matt.png differ diff --git a/website/raw_sprites/spritesmith/stable/mounts/body/Mount_Body_JackOLantern-Ghost.png b/website/raw_sprites/spritesmith/stable/mounts/body/Mount_Body_JackOLantern-Ghost.png new file mode 100644 index 0000000000..082e23ab95 Binary files /dev/null and b/website/raw_sprites/spritesmith/stable/mounts/body/Mount_Body_JackOLantern-Ghost.png differ diff --git a/website/raw_sprites/spritesmith/stable/mounts/head/Mount_Head_JackOLantern-Ghost.png b/website/raw_sprites/spritesmith/stable/mounts/head/Mount_Head_JackOLantern-Ghost.png new file mode 100644 index 0000000000..8de0599e8b Binary files /dev/null and b/website/raw_sprites/spritesmith/stable/mounts/head/Mount_Head_JackOLantern-Ghost.png differ diff --git a/website/raw_sprites/spritesmith/stable/mounts/icon/Mount_Icon_JackOLantern-Ghost.png b/website/raw_sprites/spritesmith/stable/mounts/icon/Mount_Icon_JackOLantern-Ghost.png new file mode 100644 index 0000000000..fd61c266b3 Binary files /dev/null and b/website/raw_sprites/spritesmith/stable/mounts/icon/Mount_Icon_JackOLantern-Ghost.png differ diff --git a/website/raw_sprites/spritesmith_large/npc_joyful_reaper.png b/website/raw_sprites/spritesmith_large/npc_joyful_reaper.png deleted file mode 100644 index d2ea953596..0000000000 Binary files a/website/raw_sprites/spritesmith_large/npc_joyful_reaper.png and /dev/null differ diff --git a/website/raw_sprites/spritesmith_large/promo_jackolanterns.png b/website/raw_sprites/spritesmith_large/promo_jackolanterns.png new file mode 100644 index 0000000000..2a54d4dfd8 Binary files /dev/null and b/website/raw_sprites/spritesmith_large/promo_jackolanterns.png differ diff --git a/website/server/models/user/hooks.js b/website/server/models/user/hooks.js index a557b8781a..ce2cc1e41d 100644 --- a/website/server/models/user/hooks.js +++ b/website/server/models/user/hooks.js @@ -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'];