CleverRaven/Cataclysm-DDA — pull request #6380 by 9600bauds (2014-03-02 04:14:01+00:00)
Title: [CR] Adds alcohol brewing and fermenting!

This PR adds a robust brewing system, bundled with new brewing ingredients, alcohol types, crafting recipes, and a unique fermenting system that I've done my best to keep in a compromise between realism and gameplay.

NEW CONTENT:
* Adds brews: Must be crafted at a still (with a couple of exceptions) and later set to ferment in open fermenting vats.
* New alcohol types: spiced mead, fruit wine, brandy, moonshine, homebrew beer.
* Crafting ingredients for brews: Molasses, hops, barley, sugar beet, yeast. Hops, barley, and sugar beet can be farmed, while yeast can be cultured, which makes it renewable. All these ingredients were also added into some already existing crafting recipes, and they all also spawn naturally.
* New furniture: Fermenting vats are used as the means to ferment your brews, and stationary wooden kegs allow you to store any drink you want en masse, then bottle or drink it without having to handle big containers.

TECHNICAL STUFF:
* Re-implements a "portions" tooltip that shows when crafting comestibles, now you can tell how many portions will that meat pizza have without having crafted it before.
* "result_mult" tag for recipes: This optional flag multiplies the result you get from crafting items, i.e. you can have one recipe that gives you 4 portions of meat pizza, and another that gives you 8. Works with the "portions" tooltip as well, and handles returning more than 1 volume of liquid.
* Fermenting time of all brews is based on your world's season length, much like crops. However, brews have unique brewing times: when examined, their tooltip will say how long it will take to ferment them with your current season length. I.E. at season length 14, Rum takes 2 days to ferment, while fruit wine takes 4 and a half.

NOTES:
* Not all pre-existent booze is craftable: for example, a survivor has no means to craft fancy wines or tequila, and the wide variety of stouts and ales that are found in the city require special hops that can't be found in New England (and wouldn't really add anything to the gameplay).
* "result_mult" is only implemented for comestibles: I didn't implement it with other types of items as I felt that comestibles will likely be most (if not all) the use this flag will get. So, no crafting recipes that give you 3 pointy sticks yet... but if anyone ever feels the need to do it, it should be pretty easy to implement.

ISSUES:
* Handling liquid-returning recipes with result_mult doesn't account for containers too well: no method I tried of detecting whether the player could hold any more liquid would work fully when placed in a loop. The way this works now is that the handle_liquid() screen will continue appearing until the liquid is gone, and if the player runs out of containers, they must say yes to the "Dump x on the ground? Y/N" dialog to continue. Although it might be a bit confusing the first time, it works perfectly and hopefully can be fixed when liquid volume and containers are tweaked.
* PLEASE, PLEASE NOTE: This PR adds 3 new furniture items. These SHOULD play nice with the tiles version of the game, but I haven't tested it as I don't have SDL working. Somebody should pretty pretty please test this PR with tiles and report if fermenting vats and kegs work, I wouldn't want to accidentally break tiles again.

MIGHT ADD SOMETIME IN THE FUTURE:
* Vehicle-mounted kegs!
* Harvesting yeast from successful fermenting
* Malt, currently barley is used raw since having to let it ferment into malt before you can craft brews would complicate brewing as a whole without really adding anything to the game.
* Normalize STIM values of alcohol just a bit, from my experience and testing, they seem a bit excessive (and alcohol doesn't really work that way IRL)