Line 4: |
Line 4: |
| :This talk page could be useful: [https://stardewcommunitywiki.com/Talk:Luck#Mechanics Talk:Luck]. [[User:Horizon98|Horizon98]] ([[User talk:Horizon98|talk]]) 18:00, 18 May 2021 (UTC) | | :This talk page could be useful: [https://stardewcommunitywiki.com/Talk:Luck#Mechanics Talk:Luck]. [[User:Horizon98|Horizon98]] ([[User talk:Horizon98|talk]]) 18:00, 18 May 2021 (UTC) |
| ::Oh man what a rookie mistake, I didn't know which wiki I was on. Appreciate the link, feel free to delete! [[User:Zonesville|Zonesville]] ([[User talk:Zonesville|talk]]) 14:07, 18 May 2021 (UTC) | | ::Oh man what a rookie mistake, I didn't know which wiki I was on. Appreciate the link, feel free to delete! [[User:Zonesville|Zonesville]] ([[User talk:Zonesville|talk]]) 14:07, 18 May 2021 (UTC) |
| + | |
| + | == Play Luck not took into account on dayUpdate? == |
| + | |
| + | I'm not an advanced expert about the game code, but I don't get why player luck would not be taken into account in <samp>FarmAnimal::dayUpdate</samp> (which is called by <samp>AnimalHouse::DayUpdate</samp> and <samp>Farm::DayUpdate</samp>, which are called by <samp>Game1::_newDayAfterFade</samp> in <samp>foreach (GameLocation location2 in locations)</samp>) |
| + | |
| + | Extract of <samp>FarmAnimal::dayUpdate</samp> code: |
| + | |
| + | <syntaxhighlight lang="C#"> |
| + | float num3 = ((&.op_Implicit((&)(object)happiness) > 200) ? ((float)(int)&.op_Implicit((&)(object)happiness) * 1.5f) : ((float)((&.op_Implicit((&)(object)happiness) <= 100) ? (&.op_Implicit((&)(object)happiness) - 100) : 0))); |
| + | if (((&)(object)type).get_Value().Equals("Duck") && random.NextDouble() < (double)((float)&.op_Implicit((&)(object)friendshipTowardFarmer) + num3) / 4750.0 + Game1.player.team.AverageDailyLuck() + Game1.player.team.AverageLuckLevel() * 0.01) |
| + | { |
| + | num2 = &.op_Implicit((&)(object)deluxeProduceIndex); |
| + | } |
| + | else if (((&)(object)type).get_Value().Equals("Rabbit") && random.NextDouble() < (double)((float)&.op_Implicit((&)(object)friendshipTowardFarmer) + num3) / 5000.0 + Game1.player.team.AverageDailyLuck() + Game1.player.team.AverageLuckLevel() * 0.02) |
| + | { |
| + | num2 = &.op_Implicit((&)(object)deluxeProduceIndex); |
| + | } |
| + | </syntaxhighlight> |
| + | (<samp>NetFieldBase</samp> specifications replaced with <samp>&</samp> for readability) |
| + | |
| + | <samp>Game1.player.team.AverageLuckLevel()</samp> appears on both formula. Why and more importantly how would it be neutralized? |
| + | |
| + | <samp>FarmerTeam::AverageLuckLevel</samp> just compute the average <samp>LuckLevel</samp> of <samp>Game1.getOnlineFarmers()</samp> and <samp>Farmer::LuckLevel</samp> is just a get/set (get is <samp>luckLevel + addedLuckLevel</samp>, the first being as a skill and the second one obtained from buffs). |
| + | |
| + | -- [[User:Charly|Charly]] ([[User talk:Charly|talk]]) 21:34, 15 November 2021 (UTC) |