-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat(closes #491): Winemaking #497
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the stub savestate, it was quite helpful. i ended up with just a few comments and i wouldn't consider any required to change so i'll go ahead and approve as well. this is a huge feature so i also want to say nice work!
[yeast.id]: getYeastRequiredForWine(grape.variety), | ||
}, | ||
recipeType: recipeType.WINE, | ||
// NOTE: This prevents wines from appearing in the Learned Recipes list in the Workshop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also (or maybe instead?) update the workshop to filter out recipeType === recipeType.WINE
recipes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem that the additional filtering logic would change the behavior caused by this, and I don't think it's worth introducing code that isn't necessary.
Taking the filtering approach in the Workshop rendering logic would also be good solution, but condition
is a required property of farmhand.recipe
, so I figure we might at well use it to solve this specific problem (even if it's a bit of an unusual use of the mechanism):
Lines 158 to 165 in cc2b3c0
/** | |
* @typedef {farmhand.item & { | |
* recipeType: recipeType, // The type of recipe of recipe this is. | |
* ingredients: Record<string, number>, // An object where each key is the id of a farmhand.item and the value is the quantity of that item. | |
* condition: farmhand.recipeCondition, // This must return `true` for the recipe to be made available to the player. | |
* }} farmhand.recipe | |
* @readonly | |
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the excellent review, @lstebner! I think the code is in much better shape with your suggestions. I'll merge and ship this!
[yeast.id]: getYeastRequiredForWine(grape.variety), | ||
}, | ||
recipeType: recipeType.WINE, | ||
// NOTE: This prevents wines from appearing in the Learned Recipes list in the Workshop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem that the additional filtering logic would change the behavior caused by this, and I don't think it's worth introducing code that isn't necessary.
Taking the filtering approach in the Workshop rendering logic would also be good solution, but condition
is a required property of farmhand.recipe
, so I figure we might at well use it to solve this specific problem (even if it's a bit of an unusual use of the mechanism):
Lines 158 to 165 in cc2b3c0
/** | |
* @typedef {farmhand.item & { | |
* recipeType: recipeType, // The type of recipe of recipe this is. | |
* ingredients: Record<string, number>, // An object where each key is the id of a farmhand.item and the value is the quantity of that item. | |
* condition: farmhand.recipeCondition, // This must return `true` for the recipe to be made available to the player. | |
* }} farmhand.recipe | |
* @readonly | |
*/ |
What this PR does
For #491, this PR implements Winemaking. Wine works similarly to fermented crop recipes: Once the player purchases a cellar, they can combine Yeast and Grapes to produce a Wine keg. Wine kegs compound in value but top out at 100 days after maturity. Unlike fermented crops, wines do not spoil.
This PR also changes how Bread-related recipes work. Previously, Wheat could be made directly into Bread. Now, Wheat must be made into Flour which can then be made into Bread. This was changed to allow Flour to be made into Yeast, which is a new ingredient of Bread but also Wine. This has the downstream effect of raising the value of all Bread-derived recipes.
This PR also makes a few small tweaks throughout the UX. Specifically, the Items Sold list under Farm Stats is ordered alphabetically by name, and the Quantity Input UX has been improved to work more consistently.
This PR also updates and improves various type annotations throughout the project.
How this change can be validated
I recommend modifying the game state to give yourself a lot of money, grape items, and wheat. Here's a save file that can be used to get a head start.
Additional information
This is just the first iteration of this feature and I'm sure it will be improved and expanded over time.
This PR introduces a lot of commented-out wine recipes. These will be enabled in a future update.