From d608fdb43791b5f59eaa544771996104c0c50f85 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 10 Mar 2016 16:59:39 -0600 Subject: [PATCH 1/3] fix(news): Pfeffernusse typo --- website/views/shared/new-stuff.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/views/shared/new-stuff.jade b/website/views/shared/new-stuff.jade index 49556f9646..b61a997b6b 100644 --- a/website/views/shared/new-stuff.jade +++ b/website/views/shared/new-stuff.jade @@ -7,7 +7,7 @@ h2 3/9/2016 - SNAIL PET QUEST AND MOBILE CHALLENGE WINNERS. PLUS, SPRING PLOT-LI h3 Snail Pet Quest p We've released a new Pet Quest: The Snail of Drudgery Sludge! Habiticans everywhere are bogged down by unimportant tasks. Can you wash away the slime? If so, you'll earn some Snail Eggs! p.small.muted by Lemoness and SabreCat - p.small.muted Art by Overomega, Pffernusse, and Misceo + p.small.muted Art by Overomega, Pfeffernusse, and Misceo p.small.muted Writing by Maz Wendling tr td From d28219e90de8fba88a2dfdd9ce4fa1abe323627a Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 10 Mar 2016 17:35:36 -0600 Subject: [PATCH 2/3] fix(content): Pfeffernusse typo, again --- common/locales/en/questsContent.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/locales/en/questsContent.json b/common/locales/en/questsContent.json index 25b0b8ae6d..994d0a90fa 100644 --- a/common/locales/en/questsContent.json +++ b/common/locales/en/questsContent.json @@ -342,7 +342,7 @@ "questMonkeyUnlockText": "Unlocks purchasable Monkey eggs in the Market", "questSnailText": "The Snail of Drudgery Sludge", - "questSnailNotes": "You're excited to begin questing in the abandoned Dungeons of Drudgery, but as soon as you enter, you feel the ground under your feet start to suck at your boots. You look up to the path ahead and see Habiticans mired in slime. @Overomega yells, \"They have too many unimportant tasks and dailies, and they're getting stuck on things that don't matter! Pull them out!\"

\"You need to find the source of the ooze,\" @Pffernusse agrees, \"or the tasks that they cannot accomplish will drag them down forever!\"

Pulling out your weapon, you wade through the gooey mud.... and encounter the fearsome Snail of Drudgery Sludge.", + "questSnailNotes": "You're excited to begin questing in the abandoned Dungeons of Drudgery, but as soon as you enter, you feel the ground under your feet start to suck at your boots. You look up to the path ahead and see Habiticans mired in slime. @Overomega yells, \"They have too many unimportant tasks and dailies, and they're getting stuck on things that don't matter! Pull them out!\"

\"You need to find the source of the ooze,\" @Pfeffernusse agrees, \"or the tasks that they cannot accomplish will drag them down forever!\"

Pulling out your weapon, you wade through the gooey mud.... and encounter the fearsome Snail of Drudgery Sludge.", "questSnailCompletion": "You bring your weapon down on the great Snail's shell, cracking it in two, releasing a flood of water. The slime is washed away, and the Habiticans around you rejoice. \"Look!\" says @Misceo. \"There's a small group of snail eggs in the remnants of the muck.\"", "questSnailBoss": "Snail of Drudgery Sludge", "questSnailDropSnailEgg": "Snail (Egg)", From 6fa23ae49f48a43861ff2335bca1be8cc8a67e08 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Fri, 11 Mar 2016 19:11:46 +0100 Subject: [PATCH 3/3] make sure to clone drop so original properties do not change --- common/script/fns/randomDrop.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/common/script/fns/randomDrop.js b/common/script/fns/randomDrop.js index e9c284afe0..b0121b157b 100644 --- a/common/script/fns/randomDrop.js +++ b/common/script/fns/randomDrop.js @@ -4,6 +4,13 @@ import i18n from '../i18n'; import { daysSince } from '../cron'; import { diminishingReturns } from '../statHelpers'; +// Clone a drop object maintaining its functions so that we can change it without affecting the original item +function cloneDropItem (drop) { + return _.cloneDeep(drop, function (val) { + return _.isFunction(val) ? val : undefined; // undefined will be handled by lodash + }); +} + module.exports = function(user, modifiers, req) { var acceptableDrops, base, base1, base2, chance, drop, dropK, dropMultiplier, name, name1, name2, quest, rarity, ref, ref1, ref2, ref3, task; task = modifiers.task; @@ -29,9 +36,9 @@ module.exports = function(user, modifiers, req) { if (((ref3 = user.flags) != null ? ref3.dropsEnabled : void 0) && user.fns.predictableRandom(user.stats.exp) < chance) { rarity = user.fns.predictableRandom(user.stats.gp); if (rarity > .6) { - drop = user.fns.randomVal(_.where(content.food, { + drop = cloneDropItem(user.fns.randomVal(_.where(content.food, { canDrop: true - })); + }))); if ((base = user.items.food)[name = drop.key] == null) { base[name] = 0; } @@ -43,7 +50,7 @@ module.exports = function(user, modifiers, req) { dropNotes: drop.notes(req.language) }, req.language); } else if (rarity > .3) { - drop = user.fns.randomVal(content.dropEggs); + drop = cloneDropItem(user.fns.randomVal(content.dropEggs)); if ((base1 = user.items.eggs)[name1 = drop.key] == null) { base1[name1] = 0; } @@ -55,9 +62,9 @@ module.exports = function(user, modifiers, req) { }, req.language); } else { acceptableDrops = rarity < .02 ? ['Golden'] : rarity < .09 ? ['Zombie', 'CottonCandyPink', 'CottonCandyBlue'] : rarity < .18 ? ['Red', 'Shade', 'Skeleton'] : ['Base', 'White', 'Desert']; - drop = user.fns.randomVal(_.pick(content.hatchingPotions, (function(v, k) { + drop = cloneDropItem(user.fns.randomVal(_.pick(content.hatchingPotions, (function(v, k) { return acceptableDrops.indexOf(k) >= 0; - }))); + })))); if ((base2 = user.items.hatchingPotions)[name2 = drop.key] == null) { base2[name2] = 0; }