Changes

m
Line 18: Line 18:  
The type of mushrooms produced depends on the type of trees nearby. The game code creates a list of possible mushrooms based on nearby trees, and then selects one at random from that list.  
 
The type of mushrooms produced depends on the type of trees nearby. The game code creates a list of possible mushrooms based on nearby trees, and then selects one at random from that list.  
 
* First the game finds how many trees are in the 7×7 square around it. That number is multiplied by 3/4 and that many mushrooms (at least one) are added to the list with a distribution of 5% [[Purple Mushroom|purple]], 14.25% [[Red Mushroom|red]] and 80.75% [[Common Mushroom|common]].   
 
* First the game finds how many trees are in the 7×7 square around it. That number is multiplied by 3/4 and that many mushrooms (at least one) are added to the list with a distribution of 5% [[Purple Mushroom|purple]], 14.25% [[Red Mushroom|red]] and 80.75% [[Common Mushroom|common]].   
* Then, one more mushroom is added for each mature tree. If the tree type is [[Oak Tree]] then the mushroom added will always be a [[Morel]]. The same goes for [[Pine Tree]] with [[Chanterelle]], and for [[Mystic Tree]] with [[Purple Mushroom]]. Maple trees have a 10% chance to give [[Purple Mushroom]] and a 90% chance to give [[Red Mushroom]]. If it is none of those types it will use the same distribution as before.
+
* Then, one more mushroom is added for each mature tree. If the tree type is [[Oak Tree]] then the mushroom added will always be a [[Morel]]. The same goes for [[Pine Tree]] with [[Chanterelle]], and for [[Mystic Tree]] with [[Purple Mushroom]]. Maple trees have a 10% chance to give [[Purple Mushroom]] and a 90% chance to give [[Red Mushroom]]. If the mature tree is none of these types, the same distribution as in step 1 is used.
* Finally, a random mushroom is chosen from that list to generate.<ref name="code" />  
+
* Finally, a random mushroom is chosen from that list to generate.<ref name="code" />
 +
 
 
===Quality===
 
===Quality===
 
The quality of the mushrooms produced can vary, but is not affected by the [[Foraging#Foraging Skill|Botanist]] Perk. Instead, the quality is calculated based on the number of nearby trees, and how many of them have moss on them. Each nearby tree is counted, with mossy trees counted twice This number is then divided by 40 and is used as the chance for the quality to upgrade. This chance occurs repeatedly until it fails or reaches iridium quality.<ref name="code" /> So for example if the count is 20 then the chance is 0.5, meaning there is a 50% chance of regular quality, a 25% chance of silver quality, a 12.5% chance of gold quality, and a 12.5% chance of iridium quality. If the count is 40, 5 mushrooms of iridium quality are guaranteed.
 
The quality of the mushrooms produced can vary, but is not affected by the [[Foraging#Foraging Skill|Botanist]] Perk. Instead, the quality is calculated based on the number of nearby trees, and how many of them have moss on them. Each nearby tree is counted, with mossy trees counted twice This number is then divided by 40 and is used as the chance for the quality to upgrade. This chance occurs repeatedly until it fails or reaches iridium quality.<ref name="code" /> So for example if the count is 20 then the chance is 0.5, meaning there is a 50% chance of regular quality, a 25% chance of silver quality, a 12.5% chance of gold quality, and a 12.5% chance of iridium quality. If the count is 40, 5 mushrooms of iridium quality are guaranteed.
294

edits