Changes

549 bytes added ,  01:36, 21 May 2022
Line 31: Line 31:  
:Because no luck buffs are active when the player sleeps, which is when the code executes. [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 21:38, 15 November 2021 (UTC)
 
:Because no luck buffs are active when the player sleeps, which is when the code executes. [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 21:38, 15 November 2021 (UTC)
 
::Fair point, <samp>player.dayupdate()</samp> calling <samp>Farmer::ClearBuffs</samp> happens before locations update in <samp>Game1::_newDayAfterFade</samp>. -- [[User:Charly|Charly]] ([[User talk:Charly|talk]]) 21:46, 15 November 2021 (UTC)
 
::Fair point, <samp>player.dayupdate()</samp> calling <samp>Farmer::ClearBuffs</samp> happens before locations update in <samp>Game1::_newDayAfterFade</samp>. -- [[User:Charly|Charly]] ([[User talk:Charly|talk]]) 21:46, 15 November 2021 (UTC)
 +
 +
== I feel there should more detail on how luck is calculated ==
 +
 +
This line of code appears to be responsible for determining the days luck:
 +
    Game1.player.team.sharedDailyLuck.Value = Math.Min(0.100000001490116, (double) Game1.random.Next(-100, 101) / 1000.0);
 +
So it seems there are only 200 different possible luck values. Making the chance of a true neutral event 1/200 rather than effectively 0 (if it were Random.NextDouble).
 +
 +
Also, there is little explanation on luck buffs? No code references either, making that section entirely useless.
1

edit