revert to using egg.name

This commit is contained in:
Dušan Juretić 2013-11-16 09:26:15 -03:00
parent 2879b050a0
commit 80afa45b2b
2 changed files with 3 additions and 3 deletions

View file

@ -143,8 +143,8 @@ randomDrop = (user, delta, priority, streak = 0, options={}) ->
# Eggs: 30% chance
if rarity > .5
drop = helpers.randomVal eggs
user.items.eggs[drop.text] ?= 0
user.items.eggs[drop.text]++
user.items.eggs[drop.name] ?= 0
user.items.eggs[drop.name]++
drop.type = 'Egg'
drop.dialog = "You've found a #{drop.text} Egg! #{drop.notes}"

View file

@ -162,7 +162,7 @@ describe 'User', ->
it 'gets a bear cub egg', ->
sinon.stub(Math, 'random', cycle [0, 0.55])
algos.score(user, user.dailys[0], 'up')
expect(user.items.eggs).to.eql {'Bear Cub': 1}
expect(user.items.eggs).to.eql {'BearCub': 1}
expect(user.items.hatchingPotions).to.eql {}
it 'does not get a drop', ->