mounts: simpler, cleaner breakdown of potion rarity

This commit is contained in:
Tyler Renelle 2013-11-14 12:34:11 -08:00
parent ba548ed67b
commit a52eaee62f
4 changed files with 20 additions and 41 deletions

View file

@ -8344,20 +8344,10 @@ if(typeof module != 'undefined' && module.exports){
drop.type = 'Egg';
drop.dialog = "You've found a " + drop.text + " Egg! " + drop.notes;
} else {
acceptableDrops = [];
if (rarity < .15) {
acceptableDrops = 'Base White Desert Red Shade Skeleton Zombie CottonCandyPink CottonCandyBlue Golden'.split(' ');
} else if (rarity < .2) {
acceptableDrops = 'Base White Desert Red Shade Skeleton Zombie CottonCandyPink CottonCandyBlue'.split(' ');
} else if (rarity < .25) {
acceptableDrops = 'Base White Desert Red Shade Skeleton'.split(' ');
} else {
acceptableDrops = ['Base', 'White', 'Desert'];
}
acceptableDrops = _.pick(hatchingPotions, (function(v, k) {
acceptableDrops = rarity < .03 ? ['Golden'] : rarity < .06 ? ['Zombie', 'CottonCandyPink', 'CottonCandyBlue'] : rarity < .09 ? ['Red', 'Shade', 'Skeleton'] : ['Base', 'White', 'Desert'];
drop = helpers.randomVal(_.pick(hatchingPotions, (function(v, k) {
return __indexOf.call(acceptableDrops, k) >= 0;
}));
drop = helpers.randomVal(acceptableDrops);
})));
if ((_base3 = user.items.hatchingPotions)[_name2 = drop.name] == null) {
_base3[_name2] = 0;
}
@ -9739,7 +9729,7 @@ try {
},
hatchingPotions: {
Base: {
value: 1,
value: 2,
text: 'Base'
},
White: {

File diff suppressed because one or more lines are too long

View file

@ -140,7 +140,7 @@ randomDrop = (user, delta, priority, streak = 0, options={}) ->
drop.type = 'Food'
drop.dialog = "You've found a #{drop.text} Food! #{drop.notes}"
# Eggs & hatchingPotions: 60% chance
# Eggs: 30% chance
else if rarity > .3
drop = helpers.randomVal eggs
user.items.eggs[drop.name] ?= 0
@ -148,33 +148,22 @@ randomDrop = (user, delta, priority, streak = 0, options={}) ->
drop.type = 'Egg'
drop.dialog = "You've found a #{drop.text} Egg! #{drop.notes}"
# Hatching Potion, 30% chance - break down by rarity even more.
# Hatching Potion, 30% chance - break down by rarity.
else
acceptableDrops = []
acceptableDrops =
# Very Rare: 10% (of 30%)
if rarity < .03 then ['Golden']
# Rare: 20% (of 30%)
else if rarity < .06 then ['Zombie', 'CottonCandyPink', 'CottonCandyBlue']
# Uncommon: 30% (of 30%)
else if rarity < .09 then ['Red', 'Shade', 'Skeleton']
# Common: 40% (of 30%)
else ['Base', 'White', 'Desert']
# Tier 5 (Blue Moon Rare)
if rarity < .15
acceptableDrops = 'Base White Desert Red Shade Skeleton Zombie CottonCandyPink CottonCandyBlue Golden'.split(' ')
# No Rarity (@see https://github.com/HabitRPG/habitrpg/issues/1048, we may want to remove rareness when we add mounts)
#drop = helpers.randomVal hatchingPotions
drop = helpers.randomVal _.pick(hatchingPotions, ((v,k) -> k in acceptableDrops))
# Tier 4 (Very Rare)
else if rarity < .2
acceptableDrops = 'Base White Desert Red Shade Skeleton Zombie CottonCandyPink CottonCandyBlue'.split(' ')
# Tier 3 (Rare)
else if rarity < .25
acceptableDrops = 'Base White Desert Red Shade Skeleton'.split(' ')
# Commented out for testing with increased egg drop, delete if successful
# Tier 2 (Scarce)
# else if rarity < .4
# acceptableDrops = ['Base', 'White', 'Desert']
# Tier 1 (Common)
else
acceptableDrops = ['Base', 'White', 'Desert']
acceptableDrops = _.pick hatchingPotions, ((v,k) -> k in acceptableDrops)
drop = helpers.randomVal acceptableDrops
user.items.hatchingPotions[drop.name] ?= 0
user.items.hatchingPotions[drop.name]++
drop.type = 'HatchingPotion'

View file

@ -59,7 +59,7 @@ items = module.exports.items =
#{text: 'Polar Bear Cub', name: 'PolarBearCub', value: 3}
hatchingPotions:
Base: value: 1, text: 'Base'
Base: value: 2, text: 'Base'
White: value: 2, text: 'White'
Desert: value: 2, text: 'Desert'
Red: value: 3, text: 'Red'