Changes

Jump to navigation Jump to search
Added references to rounding on the number of base distribution mushrooms added in the procedure for mushroom type
Line 17: Line 17:  
===Type===
 
===Type===
 
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, rounded down, 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 is a [[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 Tree|Maple Trees]] have a 10% chance to give a [[Purple Mushroom]] and a 90% chance to give a [[Red Mushroom]]. If the mature tree is none of these types, the same distribution as in step 1 is used.
 
* Then, one more mushroom is added for each mature tree. If the tree is a [[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 Tree|Maple Trees]] have a 10% chance to give a [[Purple Mushroom]] and a 90% chance to give a [[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" />
 +
This process makes it impossible to guarantee a single type of mushroom, as every tree added contributes not only to the chance of its own associated mushroom, but also the chance of [[Red Mushroom|red]], [[Common Mushroom|common]], and [[Purple Mushroom|purple]] mushrooms. Due to the rounding on the number of trees in step 1, adding more trees will not always increase the chance of the associated mushroom.
    
===Quality===
 
===Quality===
127

edits

Navigation menu