diff --git a/migrations/20161030-jackolanterns.js b/migrations/20161030-jackolanterns.js new file mode 100644 index 0000000000..bbea4d3455 --- /dev/null +++ b/migrations/20161030-jackolanterns.js @@ -0,0 +1,86 @@ +var migrationName = '20161030-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 + +/* + * set the newStuff flag in all user accounts so they see a Bailey message + */ + +var mongo = require('mongoskin'); + +var connectionString = 'mongodb://localhost:27017/habitrpg?auto_reconnect=true'; // FOR TEST DATABASE + +var dbUsers = mongo.db(connectionString).collection('users'); + +// specify a query to limit the affected users (empty for all users): +var query = { + 'auth.timestamps.loggedin':{$gt:new Date('2016-10-01')} // remove when running migration a second time +}; + +// specify fields we are interested in to limit retrieved data (empty if we're not reading data): +var fields = { + 'migration': 1, + 'items.pets.JackOLantern-Base': 1, + 'items.mounts.JackOLantern-Base': 1, +}; + +console.warn('Updating users...'); +var progressCount = 1000; +var count = 0; +dbUsers.findEach(query, fields, {batchSize:250}, function(err, user) { + if (err) { return exiting(1, 'ERROR! ' + err); } + if (!user) { + console.warn('All appropriate users found and modified.'); + setTimeout(displayData, 300000); + return; + } + count++; + + // specify user data to change: + var set = {}; + var inc = {}; + if (user.migration !== migrationName) { + if (user.items.mounts['JackOLantern-Base']) { + set = {'migration':migrationName, 'items.pets.JackOLantern-Ghost':5}; + } else if (user.items.pets['JackOLantern-Base']) { + set = {'migration':migrationName, 'items.mounts.JackOLantern-Base':true}; + } else { + set = {'migration':migrationName, 'items.pets.JackOLantern-Base':5}; + } + inc = { + 'items.food.Candy_Base': 1, + 'items.food.Candy_CottonCandyBlue': 1, + 'items.food.Candy_CottonCandyPink': 1, + 'items.food.Candy_Desert': 1, + 'items.food.Candy_Golden': 1, + 'items.food.Candy_Red': 1, + 'items.food.Candy_Shade': 1, + 'items.food.Candy_Skeleton': 1, + 'items.food.Candy_White': 1, + 'items.food.Candy_Zombie': 1, + } + } + + 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); +} + diff --git a/website/assets/sprites/spritesmith/stable/pets/Pet-JackOLantern-Ghost.png b/website/assets/sprites/spritesmith/stable/pets/Pet-JackOLantern-Ghost.png new file mode 100644 index 0000000000..cdc7dfa691 Binary files /dev/null and b/website/assets/sprites/spritesmith/stable/pets/Pet-JackOLantern-Ghost.png differ diff --git a/website/assets/sprites/spritesmith_large/promo/promo_habitoween_2016.png b/website/assets/sprites/spritesmith_large/promo/promo_habitoween_2016.png new file mode 100644 index 0000000000..2a54d4dfd8 Binary files /dev/null and b/website/assets/sprites/spritesmith_large/promo/promo_habitoween_2016.png differ diff --git a/website/common/locales/en/limited.json b/website/common/locales/en/limited.json index 120bd513db..8cf71a2052 100644 --- a/website/common/locales/en/limited.json +++ b/website/common/locales/en/limited.json @@ -24,6 +24,7 @@ "gildedTurkey": "Gilded Turkey", "polarBearPup": "Polar Bear Cub", "jackolantern": "Jack-O-Lantern", + "ghostJackolantern": "Ghost 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 cb6adae702..fdd3b522b1 100644 --- a/website/common/script/content/stable.js +++ b/website/common/script/content/stable.js @@ -68,6 +68,7 @@ let specialPets = { 'MagicalBee-Base': 'magicalBee', 'Lion-Veteran': 'veteranLion', 'Gryphon-RoyalPurple': 'royalPurpleGryphon', + 'JackOLantern-Ghost': 'ghostJackolantern', }; let specialMounts = {