Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiword Potions pushed to Database as One Word #1227

Closed
AndreCaseyScott opened this issue Jul 3, 2013 · 2 comments
Closed

Multiword Potions pushed to Database as One Word #1227

AndreCaseyScott opened this issue Jul 3, 2013 · 2 comments

Comments

@AndreCaseyScott
Copy link
Contributor

screen shot 2013-07-02 at 10 50 57 pm

Since Cotton Candy potions are the only ones (at this moment) that are multiword, they are the only ones affected. This could be a problem later on, with more users generating more potions, and any new potions added.

Isolated the code in habitshared/algos.coffee in the Drops System. Pushes drop.name when it should be drop.text (the human readable version). Will try to submit a pull request for this soon.

@AndreCaseyScott
Copy link
Contributor Author

Okay, I lied -__- guess I have only identified the offended code piece, not sure what it should be though. Its confusing because the drop system references items.eggs in the items.coffee file, which actually doesn't exist (in that file). And when the items.hatchingPotions is referenced, it uses a different syntax.

Egg Drop [lines 116-120 of node_modules/habit-shared/script/algos.coffee]:

if rarity > .5
    drop = helpers.randomVal(pets)
(user.items.eggs ?= []).push drop; paths['items.eggs'] = true      #this line
drop.type = 'Egg'
drop.dialog = "You've found a #{drop.text} Egg! #{drop.notes}"```

Hatching Potion Drop [lines 150-155 of node_modules/habit-shared/script/algos.coffee]:

acceptableDrops = hatchingPotions.filter (hatchingPotion) ->
         hatchingPotion.name in acceptableDrops
  drop = helpers.randomVal acceptableDrops
  (user.items.hatchingPotions ?= []).push drop.name; paths['items.hatchingPotions'] = true    #this line
  drop.type = 'HatchingPotion'
  drop.dialog = "You've found a #{drop.text} Hatching Potion! #{drop.notes}"

Line 153 uses drop.name, which in items.coffee is the single word variation of the potion. I tried replacing with just drop (like used with eggs) and breaks all together. Tried with drops.text, and works with everything but Cotton Candies (which makes sense, but took me forever to find out... So. Much. Clicking. to finally land a cotton candy on test system >_<). To be honest, I'm barely able to comprehend how this all fits together, so I figured I'd throw this out there to the developers of the group.

screen shot 2013-07-02 at 11 26 45 pm

@paglias
Copy link
Contributor

paglias commented Sep 9, 2013

Hi! The site has been totally rewritten from the ground up, I'm closing the issue since it's probably fixed. Check if it's still happening and in case reopen the bug, thanks!

@paglias paglias closed this as completed Sep 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants