diff --git a/migrations/20170711_orcas.js b/migrations/20170711_orcas.js new file mode 100644 index 0000000000..fbecd0cecd --- /dev/null +++ b/migrations/20170711_orcas.js @@ -0,0 +1,90 @@ +var migrationName = '20170711_orcas.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 Orca pets to owners of Orca mount, and Orca mount 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.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 = {}; + + if (user.items.mounts['Orca-Base']) { + set = {'migration':migrationName, 'items.pets.Orca-Base': 5}; + } else { + set = {'migration':migrationName, 'items.mounts.Orca-Base': true}; + } + + dbUsers.update({_id: user._id}, {$set:set}); + + 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/assets/sprites/spritesmith/quests/scrolls/quest_bundle_splashyPals.png b/website/assets/sprites/spritesmith/quests/scrolls/quest_bundle_splashyPals.png new file mode 100644 index 0000000000..6f1a7a86dc Binary files /dev/null and b/website/assets/sprites/spritesmith/quests/scrolls/quest_bundle_splashyPals.png differ diff --git a/website/assets/sprites/spritesmith/stable/pets/Pet-Orca-Base.png b/website/assets/sprites/spritesmith/stable/pets/Pet-Orca-Base.png new file mode 100644 index 0000000000..f7fbd51dd1 Binary files /dev/null and b/website/assets/sprites/spritesmith/stable/pets/Pet-Orca-Base.png differ diff --git a/website/assets/sprites/spritesmith_large/promo/promo_bundle_splashy.png b/website/assets/sprites/spritesmith_large/promo/promo_bundle_splashy.png new file mode 100644 index 0000000000..2066fe64d6 Binary files /dev/null and b/website/assets/sprites/spritesmith_large/promo/promo_bundle_splashy.png differ diff --git a/website/assets/sprites/spritesmith_large/promo/promo_orcas.png b/website/assets/sprites/spritesmith_large/promo/promo_orcas.png new file mode 100644 index 0000000000..953f1976d2 Binary files /dev/null and b/website/assets/sprites/spritesmith_large/promo/promo_orcas.png differ diff --git a/website/common/locales/en/questsContent.json b/website/common/locales/en/questsContent.json index 601efa0f42..5ca904aec0 100644 --- a/website/common/locales/en/questsContent.json +++ b/website/common/locales/en/questsContent.json @@ -563,5 +563,8 @@ "questNudibranchCompletion": "You see the last of the NowDo Nudibranches sliding off of a pile of completed tasks as @amadshade washes them away. One leaves behind a cloth bag, and you open it to reveal some gold and a few little ellipsoids you guess are eggs.", "questNudibranchBoss": "NowDo Nudibranch", "questNudibranchDropNudibranchEgg": "Nudibranch (Egg)", - "questNudibranchUnlockText": "Unlocks purchasable Nudibranch eggs in the Market" + "questNudibranchUnlockText": "Unlocks purchasable Nudibranch eggs in the Market", + + "splashyPalsText": "Splashy Pals Quest Bundle", + "splashyPalsNotes": "Contains 'The Dilatory Derby', 'Guide the Turtle', and 'Wail of the Whale'. Available until July 31." } diff --git a/website/common/script/content/index.js b/website/common/script/content/index.js index c8882cd878..6b2f3104d8 100644 --- a/website/common/script/content/index.js +++ b/website/common/script/content/index.js @@ -70,6 +70,21 @@ api.bundles = { type: 'quests', value: 7, }, + splashyPals: { + key: 'splashyPals', + text: t('splashyPalsText'), + notes: t('splashyPalsNotes'), + bundleKeys: [ + 'dilatory_derby', + 'turtle', + 'whale', + ], + canBuy () { + return moment().isBetween('2017-07-11', '2017-08-02'); + }, + type: 'quests', + value: 7, + }, }; /* diff --git a/website/common/script/content/stable.js b/website/common/script/content/stable.js index 80d89f5a0e..fbff98e70f 100644 --- a/website/common/script/content/stable.js +++ b/website/common/script/content/stable.js @@ -68,6 +68,7 @@ let specialPets = { 'Gryphon-RoyalPurple': 'royalPurpleGryphon', 'JackOLantern-Ghost': 'ghostJackolantern', 'Jackalope-RoyalPurple': 'royalPurpleJackalope', + 'Orca-Base': 'orca', }; let specialMounts = { diff --git a/website/views/shared/new-stuff.jade b/website/views/shared/new-stuff.jade index f2935eac48..e66e1e14bc 100644 --- a/website/views/shared/new-stuff.jade +++ b/website/views/shared/new-stuff.jade @@ -1,35 +1,50 @@ -.scene_dailies.pull-right -h2 7/5/2017 - RECORD YESTERDAY'S ACTIVITY, SPLASHY SKINS, AND SEAFOAM +.promo_bundle_splashy.pull-right +h2 7/11/2017 - NEW DISCOUNTED PET QUEST BUNDLE AND ORCAS FOR EVERYONE hr tr td - h3 Record Yesterday's Activity - p Great news! We've added a new feature to protect you if you accidentally forget to check off some of the previous day's Dailies. Now the first time that you sign into Habitica each day, a pop-up will let you note any Dailies that you completed but weren't able to check off. Record Yesterday's Activity will be automatically available on the Habitica website, as well as on our iOS and Android apps! There's nothing you need to do to enable the feature aside from updating to the most recent version of the apps. We hope this helps you get even more out of your Dailies list. Enjoy your added productivity! - p.small.muted by TheHollidayInn, SabreCat, Alys, viirus, and all our awesome testers! + h3 New Discounted Pet Quest Bundle: Splashy Pals + p If you're a fan of sea creatures, you're in luck! From now until July 31, you can purchase the Splashy Pals Pet Quest Bundle and receive the Seahorse, Sea Turtle, and Whale 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 Quest Shop today! + p.small.muted by Lemoness and SabreCat + p.small.muted Art by McCoyly, krazjega, UncommonCriminal, zoebeagle, Kiwibot, JessicaChase, Scarabsi, JaizakArpaik + p.small.muted Writing by Calae, Ginger_Hanna, Lemoness tr td - .promo_splashy_skins.center-block - .promo_seafoam.pull-left.slight-right-margin - h3 Splashy Skins - p The Seasonal Edition Splashy Skins are available until July 31st! You can complete your summer avatar look with Clownfish, Deep Ocean, Tropical Water, Mergold, Mergreen, Merblue, Merruby, and Shark Skins. - br - p This Seasonal Edition customization set will only be available to purchase until July 31st, after which they'll be gone until next year, so be sure to swoop them up now! - p.small.muted by Lemoness and UncommonCriminal - tr - td - h3 Seafoam - p Throw some Seafoam at your friends and they will turn into a cheerful sea star until their next cron! You can buy the Seafoam in the Seasonal Shop for gold. Plus, you and your pal will both receive the Aquatic Friends badge! - br - p Don't want to be a sea star? Just buy some Sand from the Rewards Store to reverse it. - br - p Seafoam will be available in the Seasonal Shop until July 31st! - p.small.muted by Lemoness + .promo_orcas.pull-left.slight-right-margin + h3 Orcas for Everyone! + p Looks like there are even more sea animals riding the waves around the city of Dilatory: Some friendly Orcas are swimming into Habiticans' stables! In honor of the Summer Splash event, everyone gets a free Orca mount or, if you already had the Orca mount, a cute Orca pet. Enjoy! + p.small.muted by Beffymaroo and UncommonCriminal if menuItem !== 'oldNews' hr a(href='/static/old-news', target='_blank') Read older news mixin oldNews + h2 7/5/2017 - RECORD YESTERDAY'S ACTIVITY, SPLASHY SKINS, AND SEAFOAM + .scene_dailies.pull-right + tr + td + h3 Record Yesterday's Activity + p Great news! We've added a new feature to protect you if you accidentally forget to check off some of the previous day's Dailies. Now the first time that you sign into Habitica each day, a pop-up will let you note any Dailies that you completed but weren't able to check off. Record Yesterday's Activity will be automatically available on the Habitica website, as well as on our iOS and Android apps! There's nothing you need to do to enable the feature aside from updating to the most recent version of the apps. We hope this helps you get even more out of your Dailies list. Enjoy your added productivity! + p.small.muted by TheHollidayInn, SabreCat, Alys, viirus, and all our awesome testers! + tr + td + .promo_splashy_skins.center-block + .promo_seafoam.pull-left.slight-right-margin + h3 Splashy Skins + p The Seasonal Edition Splashy Skins are available until July 31st! You can complete your summer avatar look with Clownfish, Deep Ocean, Tropical Water, Mergold, Mergreen, Merblue, Merruby, and Shark Skins. + br + p This Seasonal Edition customization set will only be available to purchase until July 31st, after which they'll be gone until next year, so be sure to swoop them up now! + p.small.muted by Lemoness and UncommonCriminal + tr + td + h3 Seafoam + p Throw some Seafoam at your friends and they will turn into a cheerful sea star until their next cron! You can buy the Seafoam in the Seasonal Shop for gold. Plus, you and your pal will both receive the Aquatic Friends badge! + br + p Don't want to be a sea star? Just buy some Sand from the Rewards Store to reverse it. + br + p Seafoam will be available in the Seasonal Shop until July 31st! + p.small.muted by Lemoness h2 7/3/2017 - JULY BACKGROUNDS, ARMOIRE ITEMS, AND TAKE THIS CHALLENGE .promo_backgrounds_armoire_201707.pull-right tr