From bf8c0dd9dc1042214e5a1b92b30d0c68cf92d1ba Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Thu, 14 Nov 2013 12:40:08 -0800 Subject: [PATCH] mounts: remove food temporarily. merging to master so we can run schema migration and start with item translations. This commit will be reverted when mounts is fully merged --- dist/habitrpg-shared.js | 24 ++++++++---------------- script/algos.coffee | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 16f32c9d67..d7fce83954 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -8304,7 +8304,7 @@ if(typeof module != 'undefined' && module.exports){ randomDrop = function(user, delta, priority, streak, options) { - var acceptableDrops, chanceMultiplier, drop, paths, rarity, reachedDropLimit, _base, _base1, _base2, _base3, _name, _name1, _name2, _ref1; + var acceptableDrops, chanceMultiplier, drop, paths, rarity, reachedDropLimit, _base, _base1, _base2, _name, _name1, _ref1; if (streak == null) { streak = 0; } @@ -8318,7 +8318,7 @@ if(typeof module != 'undefined' && module.exports){ count: 0 }; } - reachedDropLimit = (helpers.daysSince(user.items.lastDrop.date, user.preferences) === 0) && (user.items.lastDrop.count >= 5); + reachedDropLimit = (helpers.daysSince(user.items.lastDrop.date, user.preferences) === 0) && (user.items.lastDrop.count >= 2); if (reachedDropLimit) { return; } @@ -8327,29 +8327,21 @@ if(typeof module != 'undefined' && module.exports){ chanceMultiplier += streak; if (((_ref1 = user.flags) != null ? _ref1.dropsEnabled : void 0) && Math.random() < (.05 * chanceMultiplier)) { rarity = Math.random(); - if (rarity > .6) { - drop = helpers.randomVal(_.omit(items.items.food, 'Saddle')); - if ((_base1 = user.items.food)[_name = drop.name] == null) { - _base1[_name] = 0; - } - user.items.food[drop.name] += 1; - drop.type = 'Food'; - drop.dialog = "You've found a " + drop.text + " Food! " + drop.notes; - } else if (rarity > .3) { + if (rarity > .5) { drop = helpers.randomVal(eggs); - if ((_base2 = user.items.eggs)[_name1 = drop.name] == null) { - _base2[_name1] = 0; + if ((_base1 = user.items.eggs)[_name = drop.name] == null) { + _base1[_name] = 0; } user.items.eggs[drop.name]++; drop.type = 'Egg'; drop.dialog = "You've found a " + drop.text + " Egg! " + drop.notes; } else { - acceptableDrops = rarity < .03 ? ['Golden'] : rarity < .06 ? ['Zombie', 'CottonCandyPink', 'CottonCandyBlue'] : rarity < .09 ? ['Red', 'Shade', 'Skeleton'] : ['Base', 'White', 'Desert']; + acceptableDrops = rarity < .05 ? ['Golden'] : rarity < .1 ? ['Zombie', 'CottonCandyPink', 'CottonCandyBlue'] : rarity < .15 ? ['Red', 'Shade', 'Skeleton'] : ['Base', 'White', 'Desert']; drop = helpers.randomVal(_.pick(hatchingPotions, (function(v, k) { return __indexOf.call(acceptableDrops, k) >= 0; }))); - if ((_base3 = user.items.hatchingPotions)[_name2 = drop.name] == null) { - _base3[_name2] = 0; + if ((_base2 = user.items.hatchingPotions)[_name1 = drop.name] == null) { + _base2[_name1] = 0; } user.items.hatchingPotions[drop.name]++; drop.type = 'HatchingPotion'; diff --git a/script/algos.coffee b/script/algos.coffee index a06f5f6aa8..dc09095ad9 100644 --- a/script/algos.coffee +++ b/script/algos.coffee @@ -119,7 +119,7 @@ randomDrop = (user, delta, priority, streak = 0, options={}) -> date: +moment().subtract('d', 1) # trick - set it to yesterday on first run, that way they can get drops today count: 0 - reachedDropLimit = (helpers.daysSince(user.items.lastDrop.date, user.preferences) is 0) and (user.items.lastDrop.count >= 5) + reachedDropLimit = (helpers.daysSince(user.items.lastDrop.date, user.preferences) is 0) and (user.items.lastDrop.count >= 2) return if reachedDropLimit # % chance of getting a pet or meat @@ -132,16 +132,16 @@ randomDrop = (user, delta, priority, streak = 0, options={}) -> # If they got a drop: 50% chance of egg, 50% Hatching Potion. If hatchingPotion, broken down further even further rarity = Math.random() - # Food: 40% chance - if rarity > .6 - drop = helpers.randomVal _.omit(items.items.food, 'Saddle') - user.items.food[drop.name] ?= 0 - user.items.food[drop.name]+= 1 - drop.type = 'Food' - drop.dialog = "You've found a #{drop.text} Food! #{drop.notes}" +# # Food: 40% chance +# if rarity > .6 +# drop = helpers.randomVal _.omit(items.items.food, 'Saddle') +# user.items.food[drop.name] ?= 0 +# user.items.food[drop.name]+= 1 +# drop.type = 'Food' +# drop.dialog = "You've found a #{drop.text} Food! #{drop.notes}" # Eggs: 30% chance - else if rarity > .3 + if rarity > .5 drop = helpers.randomVal eggs user.items.eggs[drop.name] ?= 0 user.items.eggs[drop.name]++ @@ -152,11 +152,11 @@ randomDrop = (user, delta, priority, streak = 0, options={}) -> else acceptableDrops = # Very Rare: 10% (of 30%) - if rarity < .03 then ['Golden'] + if rarity < .05 then ['Golden'] # Rare: 20% (of 30%) - else if rarity < .06 then ['Zombie', 'CottonCandyPink', 'CottonCandyBlue'] + else if rarity < .1 then ['Zombie', 'CottonCandyPink', 'CottonCandyBlue'] # Uncommon: 30% (of 30%) - else if rarity < .09 then ['Red', 'Shade', 'Skeleton'] + else if rarity < .15 then ['Red', 'Shade', 'Skeleton'] # Common: 40% (of 30%) else ['Base', 'White', 'Desert']