Changes

79 bytes added ,  19:14, 20 June 2023
fixed formula parentheses, consistency
Line 72: Line 72:  
* Not Fed (-20 ''Calculated day-end'')
 
* Not Fed (-20 ''Calculated day-end'')
 
* Trapped outside overnight (-20 ''Calculated day-end'')
 
* Trapped outside overnight (-20 ''Calculated day-end'')
* Not Pet/Talked to (-5 to -10, ''Calculated day-end by the formula:'' <samp>(10 - (CurrentFriendship / 200)))</samp>. This means they will lose less friendship if they are already at high friendship.
+
* Not Pet/Talked to (-5 to -10, ''Calculated day-end by the formula:'' <code>(10 - (Friendship / 200))</code>). This means they will lose less friendship if they are already at high friendship.
    
===Mood===
 
===Mood===
Line 106: Line 106:  
If the animal has met the required amount of days to create their product, some additional checks will be made to determine if they will actually produce.
 
If the animal has met the required amount of days to create their product, some additional checks will be made to determine if they will actually produce.
 
*If the animal was not fed, it will not produce.
 
*If the animal was not fed, it will not produce.
*If the animal has less than 70 Mood, there is a chance it will not produce. The lower the mood, the less likely it will produce. (The percent chance it will still produce is equal to <samp>Mood/70</samp>)
+
*If the animal has less than 70 Mood, there is a chance it will not produce. The lower the mood, the less likely it will produce. The percent chance it will still produce is calculated using <code>Mood / 70</code>.
    
Whether an animal produces a Deluxe or Large product, and the quality of the products, is determined at the very beginning of the day by some randomness as well as a combination of Mood and Friendship.
 
Whether an animal produces a Deluxe or Large product, and the quality of the products, is determined at the very beginning of the day by some randomness as well as a combination of Mood and Friendship.
    
*If an animal has 150 Mood or above, it will gain the ability to produce Quality and Large or Deluxe products. ('''Note, this is just the ability, the actual chance for these items is covered in the sections below, Quality and Large/Deluxe products are not guaranteed''')
 
*If an animal has 150 Mood or above, it will gain the ability to produce Quality and Large or Deluxe products. ('''Note, this is just the ability, the actual chance for these items is covered in the sections below, Quality and Large/Deluxe products are not guaranteed''')
*If an animal is below 150 Mood, it still has a chance to have the ability to produce Quality and Large or Deluxe products. The lower the mood, the less likely. (The percent chance to gain the ability is equal to <samp>Mood/150</samp>)
+
*If an animal is below 150 Mood, it still has a chance to have the ability to produce Quality and Large or Deluxe products. The lower the mood, the less likely. The percent chance to gain the ability is calculated using <code>Mood / 150</code>.
    
'''Special case''': If an animal meets the requirement to produce something, but does not gain the ability to create a Quality or Large/Deluxe product, the game will not register the fact that it produced an item that day. In this case, animals that normally would take multiple days to produce, will produce again immediately the next day.
 
'''Special case''': If an animal meets the requirement to produce something, but does not gain the ability to create a Quality or Large/Deluxe product, the game will not register the fact that it produced an item that day. In this case, animals that normally would take multiple days to produce, will produce again immediately the next day.
Line 127: Line 127:  
Ducks and rabbits will take into account the Daily [[Luck]] to determine if they will create their Deluxe produce.
 
Ducks and rabbits will take into account the Daily [[Luck]] to determine if they will create their Deluxe produce.
   −
For each rabbit, an overall score is created using the following formula: <code>(<span style="color:crimson;">'''Friendship'''</span> + <span style="color:mediumblue;">'''Mood × Mood Modifier'''</span>)/5000 + <span style="color: green;">'''Daily Luck'''</span></code>
+
For each rabbit, an overall score is created using the following formula: <code>((<span style="color:crimson;">'''Friendship'''</span> + (<span style="color:mediumblue;">'''Mood × Mood Modifier'''</span>)) / 5000) + <span style="color: green;">'''Daily Luck'''</span></code>
   −
For each duck, an overall score is created using the following formula: <code>(<span style="color:crimson;">'''Friendship'''</span> + <span style="color:mediumblue;">'''Mood × Mood Modifier'''</span>)/4750 + <span style="color: green;">'''Daily Luck'''</span></code>
+
For each duck, an overall score is created using the following formula: <code>((<span style="color:crimson;">'''Friendship'''</span> + (<span style="color:mediumblue;">'''Mood × Mood Modifier'''</span>)) / 4750) + <span style="color: green;">'''Daily Luck'''</span></code>
    
For example, a rabbit with <span style="color:crimson;">600 Friendship</span> (3 Hearts), <span style="color:mediumblue;">150 Mood</span>, and <span style="color: green;">0.10 Daily Luck</span>, would be calculated as:
 
For example, a rabbit with <span style="color:crimson;">600 Friendship</span> (3 Hearts), <span style="color:mediumblue;">150 Mood</span>, and <span style="color: green;">0.10 Daily Luck</span>, would be calculated as:
   −
<code> =(<span style="color:crimson;">600</span> + (<span style="color:mediumblue;">150 × 0</span>))/5000 + <span style="color: green;">0.10</span>
+
<code> = ((<span style="color:crimson;">600</span> + (<span style="color:mediumblue;">150 × 0</span>)) / 5000) + <span style="color: green;">0.10</span>
   −
=(600 + 0)/5000 + 0.10
+
= ((600 + 0) / 5000) + 0.10
   −
='''0.22'''</code>
+
= '''0.22'''</code>
    
Each time a product is rolled, a random number between 0-1 is rolled against this score. If the overall score is higher than the random number, a Deluxe product will be created. '''At max Friendship, Mood, and Luck, there is a 40% chance of getting a [[Rabbit's Foot]] and a 42% chance of getting a [[Duck Feather]].'''
 
Each time a product is rolled, a random number between 0-1 is rolled against this score. If the overall score is higher than the random number, a Deluxe product will be created. '''At max Friendship, Mood, and Luck, there is a 40% chance of getting a [[Rabbit's Foot]] and a 42% chance of getting a [[Duck Feather]].'''
Line 147: Line 147:  
Only animals with 200 or higher friendship can produce Large products.
 
Only animals with 200 or higher friendship can produce Large products.
   −
Each animal will have an overall score created with the following formula: <code>(<span style="color:crimson;">'''Friendship'''</span> + <span style="color:mediumblue;">'''Mood Modifier'''</span>)/1200</code>
+
Each animal will have an overall score created with the following formula: <code>(<span style="color:crimson;">'''Friendship'''</span> + (<span style="color:mediumblue;">'''Mood × Mood Modifier'''</span>)) / 1200</code>
    
For example, an animal with <span style="color:crimson;">600 Friendship</span> (3 Hearts) and <span style="color:mediumblue;">210 Mood</span> would be calculated as:
 
For example, an animal with <span style="color:crimson;">600 Friendship</span> (3 Hearts) and <span style="color:mediumblue;">210 Mood</span> would be calculated as:
   −
<code> =((<span style="color:crimson;">600</span> + (<span style="color:mediumblue;">210*1.5</span>))/1200
+
<code> = (<span style="color:crimson;">600</span> + (<span style="color:mediumblue;">210 × 1.5</span>)) / 1200
   −
=(600+315)/1200
+
= (600 + 315) / 1200
   −
=0.7625</code>
+
= '''0.7625'''</code>
    
Each time a product is rolled, a number between 0-1 is chosen randomly. If the overall score is higher than the random number, a Large product will be created. In our example there is a 76% chance of a large product. '''An overall score of at least 1200 will guarantee a Large product.'''
 
Each time a product is rolled, a number between 0-1 is chosen randomly. If the overall score is higher than the random number, a Large product will be created. In our example there is a 76% chance of a large product. '''An overall score of at least 1200 will guarantee a Large product.'''
Line 163: Line 163:  
If the animal has the ability to produce a Quality item, it will roll for quality from normal to iridium.
 
If the animal has the ability to produce a Quality item, it will roll for quality from normal to iridium.
   −
Each animal will have an overall '''score''' created with the following formula: <code>((<span style="color:crimson;">'''Friendship'''</span>/1000) - (1 - (<span style="color:mediumblue;">'''Mood'''</span>/225))</code>
+
Each animal will have an overall '''score''' created with the following formula: <code>(<span style="color:crimson;">'''Friendship'''</span> / 1000) - (1 - (<span style="color:mediumblue;">'''Mood'''</span> / 225))</code>
    
For example, an animal with <span style="color:crimson;">600 Friendship</span> (3 Hearts) and <span style="color:mediumblue;">150 Mood</span> would be calculated thus:
 
For example, an animal with <span style="color:crimson;">600 Friendship</span> (3 Hearts) and <span style="color:mediumblue;">150 Mood</span> would be calculated thus:
   −
<code>=((<span style="color:crimson;">600</span>/1000) - (1 - (<span style="color:mediumblue;">150</span>/225))
+
<code>= (<span style="color:crimson;">600</span> / 1000) - (1 - (<span style="color:mediumblue;">150</span> / 225))
   −
=0.6 - (1 - 0.666...)
+
= 0.6 - (1 - 0.666...)
   −
=0.6 - 0.333...
+
= 0.6 - 0.333...
   −
='''0.266...''' </code>
+
= '''0.266...'''</code>
    
If the player has the [[Farming#Farming Skill|Shepherd]] or [[Farming#Farming Skill|Coopmaster]] Profession, 0.333 will be added to the '''score''' for any barn animals or coop animals respectively.
 
If the player has the [[Farming#Farming Skill|Shepherd]] or [[Farming#Farming Skill|Coopmaster]] Profession, 0.333 will be added to the '''score''' for any barn animals or coop animals respectively.
Line 232: Line 232:     
===Animal Births===
 
===Animal Births===
Similar to animal attacks, if there are no other events occurring in the night, there will be a 50% chance that the game will attempt an animal birth event. The game searches through all buildings for an upgraded Barn that isn't full. The game then makes another check where there is a 0.55% * (the number of animals inside) chance of proceeding with the event. For example, an upgraded barn with three animals inside would have a 1.65% chance of passing this check. If the building fails this check, the game will continue going through all buildings until none are left.
+
Similar to animal attacks, if there are no other events occurring in the night, there will be a 50% chance that the game will attempt an animal birth event. The game searches through all buildings for an upgraded Barn that isn't full. The game then makes another check where the chance of proceeding with the event is the number of animals inside multiplied by 0.55%. For example, an upgraded barn with three animals inside would have a 1.65% chance of passing this check. If the building fails this check, the game will continue going through all buildings until none are left.
    
If a barn passes all these checks, a random animal inside is chosen. If the animal is not a baby and has pregnancy enabled, that animal will give birth.
 
If a barn passes all these checks, a random animal inside is chosen. If the animal is not a baby and has pregnancy enabled, that animal will give birth.
Line 239: Line 239:  
To sell a coop or barn animal, right-click the animal after petting. The friendship/mood interface appears. Move the cursor over the gold coin button at the right to see how much the animal can be sold for. Click that button and the confirmation that follows to complete the sale.
 
To sell a coop or barn animal, right-click the animal after petting. The friendship/mood interface appears. Move the cursor over the gold coin button at the right to see how much the animal can be sold for. Click that button and the confirmation that follows to complete the sale.
   −
The sell price of a farm animal is <code>Price * ((Friendship / 1000) + 0.3)</code>.<ref name="sellprice" />
+
The sell price of a farm animal is <code>Price × ((Friendship / 1000) + 0.3)</code>.<ref name="sellprice" />
 
<br />"<samp>Price</samp>" is read from the game's data file <samp>Data/FarmAnimals.xnb</samp>.
 
<br />"<samp>Price</samp>" is read from the game's data file <samp>Data/FarmAnimals.xnb</samp>.