mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
feat(content): Orca Pets and Splashy Pals
This commit is contained in:
90
migrations/20170711_orcas.js
Normal file
90
migrations/20170711_orcas.js
Normal file
@@ -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;
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
website/assets/sprites/spritesmith/stable/pets/Pet-Orca-Base.png
Normal file
BIN
website/assets/sprites/spritesmith/stable/pets/Pet-Orca-Base.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
website/assets/sprites/spritesmith_large/promo/promo_orcas.png
Normal file
BIN
website/assets/sprites/spritesmith_large/promo/promo_orcas.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
@@ -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.",
|
"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",
|
"questNudibranchBoss": "NowDo Nudibranch",
|
||||||
"questNudibranchDropNudibranchEgg": "Nudibranch (Egg)",
|
"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."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,21 @@ api.bundles = {
|
|||||||
type: 'quests',
|
type: 'quests',
|
||||||
value: 7,
|
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,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ let specialPets = {
|
|||||||
'Gryphon-RoyalPurple': 'royalPurpleGryphon',
|
'Gryphon-RoyalPurple': 'royalPurpleGryphon',
|
||||||
'JackOLantern-Ghost': 'ghostJackolantern',
|
'JackOLantern-Ghost': 'ghostJackolantern',
|
||||||
'Jackalope-RoyalPurple': 'royalPurpleJackalope',
|
'Jackalope-RoyalPurple': 'royalPurpleJackalope',
|
||||||
|
'Orca-Base': 'orca',
|
||||||
};
|
};
|
||||||
|
|
||||||
let specialMounts = {
|
let specialMounts = {
|
||||||
|
|||||||
@@ -1,6 +1,27 @@
|
|||||||
.scene_dailies.pull-right
|
.promo_bundle_splashy.pull-right
|
||||||
h2 7/5/2017 - RECORD YESTERDAY'S ACTIVITY, SPLASHY SKINS, AND SEAFOAM
|
h2 7/11/2017 - NEW DISCOUNTED PET QUEST BUNDLE AND ORCAS FOR EVERYONE
|
||||||
hr
|
hr
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
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 <a href='/#/options/inventory/quests'>Quest Shop</a> 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_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
|
tr
|
||||||
td
|
td
|
||||||
h3 Record Yesterday's Activity
|
h3 Record Yesterday's Activity
|
||||||
@@ -24,12 +45,6 @@ h2 7/5/2017 - RECORD YESTERDAY'S ACTIVITY, SPLASHY SKINS, AND SEAFOAM
|
|||||||
br
|
br
|
||||||
p Seafoam will be available in the Seasonal Shop until July 31st!
|
p Seafoam will be available in the Seasonal Shop until July 31st!
|
||||||
p.small.muted by Lemoness
|
p.small.muted by Lemoness
|
||||||
|
|
||||||
if menuItem !== 'oldNews'
|
|
||||||
hr
|
|
||||||
a(href='/static/old-news', target='_blank') Read older news
|
|
||||||
|
|
||||||
mixin oldNews
|
|
||||||
h2 7/3/2017 - JULY BACKGROUNDS, ARMOIRE ITEMS, AND TAKE THIS CHALLENGE
|
h2 7/3/2017 - JULY BACKGROUNDS, ARMOIRE ITEMS, AND TAKE THIS CHALLENGE
|
||||||
.promo_backgrounds_armoire_201707.pull-right
|
.promo_backgrounds_armoire_201707.pull-right
|
||||||
tr
|
tr
|
||||||
|
|||||||
Reference in New Issue
Block a user