diff --git a/migrations/users/20181030_habitoween_ladder.js b/migrations/users/20181030_habitoween_ladder.js new file mode 100644 index 0000000000..39880b2fad --- /dev/null +++ b/migrations/users/20181030_habitoween_ladder.js @@ -0,0 +1,116 @@ +/* + * Award Habitoween ladder items to participants in this month's Habitoween festivities + */ + +import monk from 'monk'; +import nconf from 'nconf'; +const MIGRATION_NAME = '20181030_habitoween_ladder.js'; // Update when running in future years +const CONNECTION_STRING = nconf.get('MIGRATION_CONNECT_STRING'); +const AUTHOR_NAME = 'Sabe'; // in case script author needs to know when their ... +const AUTHOR_UUID = '7f14ed62-5408-4e1b-be83-ada62d504931'; // ... own data is done + +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: MIGRATION_NAME}, + 'auth.timestamps.loggedin': {$gt: new Date('2018-10-01')}, + }; + + if (lastId) { + query._id = { + $gt: lastId, + }; + } + + dbUsers.find(query, { + sort: {_id: 1}, + limit: 250, + fields: [ + 'items.mounts', + 'items.pets', + ], // 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}`); + }); +} + +const PROGRESS_COUNT = 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 = {}; + let 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.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; + } + + dbUsers.update({_id: user._id}, {$set: set, $inc: inc}); + + if (count % PROGRESS_COUNT === 0) console.warn(`${count} ${user._id}`); + if (user._id === AUTHOR_UUID) console.warn(`${AUTHOR_NAME} 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/npc_bailey.png b/website/client/assets/images/npc/habitoween/npc_bailey.png new file mode 100644 index 0000000000..755699a1cb Binary files /dev/null and b/website/client/assets/images/npc/habitoween/npc_bailey.png differ diff --git a/website/raw_sprites/spritesmith/npcs/npc_daniel.png b/website/client/assets/images/npc/habitoween/npc_justin.png old mode 100755 new mode 100644 similarity index 58% rename from website/raw_sprites/spritesmith/npcs/npc_daniel.png rename to website/client/assets/images/npc/habitoween/npc_justin.png index 7914f5cc60..97ce158c9f Binary files a/website/raw_sprites/spritesmith/npcs/npc_daniel.png and b/website/client/assets/images/npc/habitoween/npc_justin.png differ diff --git a/website/client/assets/images/npc/habitoween/npc_matt.png b/website/client/assets/images/npc/habitoween/npc_matt.png new file mode 100644 index 0000000000..30e95d29f3 Binary files /dev/null and b/website/client/assets/images/npc/habitoween/npc_matt.png differ diff --git a/website/client/assets/images/npc/habitoween/seasonalshop_open.png b/website/client/assets/images/npc/habitoween/seasonalshop_open.png new file mode 100644 index 0000000000..f69fb9d792 Binary files /dev/null and b/website/client/assets/images/npc/habitoween/seasonalshop_open.png differ diff --git a/website/client/assets/scss/variables.scss b/website/client/assets/scss/variables.scss index 77b0a8265b..3b1c2d17ba 100644 --- a/website/client/assets/scss/variables.scss +++ b/website/client/assets/scss/variables.scss @@ -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'; diff --git a/website/common/locales/en/limited.json b/website/common/locales/en/limited.json index 0e18167dc2..3ff905bafa 100644 --- a/website/common/locales/en/limited.json +++ b/website/common/locales/en/limited.json @@ -25,6 +25,7 @@ "polarBearPup": "Polar Bear Cub", "jackolantern": "Jack-O-Lantern", "ghostJackolantern": "Ghost Jack-O-Lantern", + "glowJackolantern": "Glow-in-the-Dark Jack-O-Lantern", "seasonalShop": "Seasonal Shop", "seasonalShopClosedTitle": "<%= linkStart %>Leslie<%= linkEnd %>", "seasonalShopTitle": "<%= linkStart %>Seasonal Sorceress<%= linkEnd %>", diff --git a/website/common/script/content/stable.js b/website/common/script/content/stable.js index 2b788813cf..1c758b2714 100644 --- a/website/common/script/content/stable.js +++ b/website/common/script/content/stable.js @@ -72,6 +72,7 @@ let specialPets = { 'Bear-Veteran': 'veteranBear', 'Hippogriff-Hopeful': 'hopefulHippogriffPet', 'Fox-Veteran': 'veteranFox', + 'JackOLantern-Glow': 'glowJackolantern', }; let specialMounts = { diff --git a/website/raw_sprites/spritesmith/npcs/npc_alex.png b/website/raw_sprites/spritesmith/npcs/npc_alex.png deleted file mode 100755 index a3dfad58d9..0000000000 Binary files a/website/raw_sprites/spritesmith/npcs/npc_alex.png and /dev/null differ diff --git a/website/raw_sprites/spritesmith/npcs/npc_bailey.png b/website/raw_sprites/spritesmith/npcs/npc_bailey.png index ea7bd68e40..755699a1cb 100644 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_ian.png b/website/raw_sprites/spritesmith/npcs/npc_ian.png deleted file mode 100755 index eb9c63fe0d..0000000000 Binary files a/website/raw_sprites/spritesmith/npcs/npc_ian.png and /dev/null differ diff --git a/website/raw_sprites/spritesmith/npcs/npc_justin.png b/website/raw_sprites/spritesmith/npcs/npc_justin.png index d1973b48df..97ce158c9f 100644 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 index 1cd1006fd3..30e95d29f3 100644 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/pets/Pet-JackOLantern-Glow.png b/website/raw_sprites/spritesmith/stable/pets/Pet-JackOLantern-Glow.png new file mode 100644 index 0000000000..c3c616f2ba Binary files /dev/null and b/website/raw_sprites/spritesmith/stable/pets/Pet-JackOLantern-Glow.png 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..23ee2da51c Binary files /dev/null and b/website/raw_sprites/spritesmith_large/promo_jackolanterns.png differ diff --git a/website/server/controllers/api-v3/news.js b/website/server/controllers/api-v3/news.js index 8b945ac87f..cb30708188 100644 --- a/website/server/controllers/api-v3/news.js +++ b/website/server/controllers/api-v3/news.js @@ -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 = 'OCTOBER SUBSCRIBER ITEMS REVEALED'; +const LAST_ANNOUNCEMENT_TITLE = 'HABITOWEEN! PLUS LAST CHANCE FOR FALL FESTIVAL AND OCTOBER SUBSCRIBER ITEMS'; const worldDmg = { // @TODO bailey: false, }; @@ -30,14 +30,26 @@ api.getNews = {

${res.t('newStuff')}

-

10/25/2018 - ${LAST_ANNOUNCEMENT_TITLE}

+

10/30/2018 - ${LAST_ANNOUNCEMENT_TITLE}


+

Happy Habitoween!

+

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...

+

Jack O' Lantern Pets and Mounts

+

The Flourishing Fields are full of cute carved pumpkins - and it looks like one has followed you home! 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!

+
by Lemoness and Beffymaroo
+
+

Candy for Everyone!

+

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! Enjoy.

+
by SabreCat and Lemoness
-

October's Subscriber Items have been revealed: the Dark Forest Item Set! You only have seven days to receive the item set when you subscribe. If you're already an active subscriber, reload the site and then head to Inventory > Items to claim your gear!

-

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.

-
by Beffymaroo
+

Last Chance for Fall Festival Items and Dark Forest Set

+

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 Ghost and Glow Hatching Potions. Grab them all while you still can!

+

Plus, today is the final day to subscribe and receive the Dark Forest set! Subscribing also lets you buy Gems for Gold and nets you a special Jackalope pet.

+

Thanks so much for your supporting the site -- you're helping us keep Habitica alive. Happy Habitoween!

+
by Hermi, AaronTheTwin, tricksy.fox, Lemoness, Beffymaroo and SabreCat
+
`, });