Thorinair / Stardew-Profits

A Stardew Valley crop profits calculator and visualizer. Link: https://thorinair.github.io/Stardew-Profits/
MIT License
153 stars 74 forks source link

Updates to Dehydrator #73

Closed doodlebunnyhops closed 1 month ago

doodlebunnyhops commented 1 month ago

Fix:

  1. Processing Per Harvest - not total by season
  2. Dehydrator Ignores the need of keeping half the produce for seeds, if Process & Replant is enabled
  3. Check if equipment is used
doodlebunnyhops commented 1 month ago

Hey @Thorinair I'm actively working through this and was focusing on number 2: Adding dehydrator to account for Process & Replant if enabled.

I see where the forSeed section is taking place but I'm not sure if I'm missing something, the calculation seems slightly off to me. Wanted to touch base - see what I'm missing or if this needs massaging.

I'm rather visual so as an example I used Red Cabbage and StarFruit

The part I'm hung up on is paying for the initial seeds, but wouldn't there be a few more needed to purchase to maintain 2 replants each harvest?

mermaid-diagram-2024-05-24-220855

mermaid-diagram-2024-05-24-220621

Thorinair commented 1 month ago

The way how the Process & Replant works is that it accounts for the fact that you get 2 seeds per processing on average. This means that when you do plant 2 crops, you only pay for the initial seeds, and after that it keeps reusing the seeds that you process from 1 crop to plant 2, and you sell the one extra.

doodlebunnyhops commented 1 month ago

Ah thanks! That's what I was missing - carrying on 🥰

doodlebunnyhops commented 1 month ago

I do have another question for you, couple of ways to handle number of crops planted for dehydrator. Like replant it requires divisible by 2 crops - we could approach the same for dehydrator but that would obviate the excess calculations. Have thoughts preferences?

Thorinair commented 1 month ago

The way how I would approach is that if it has a number non-divisible by 5, it basically sells the rest normally (if that is enabled, the Dehydrator Excess: Sell Raw option), so in case when you have:

doodlebunnyhops commented 1 month ago

More updates - think this should resolve the original asks. I did create some more functions, they helped me see where I was straying. I only utilize the new functions in the profits section for dehydrator, but they could be used in other places down the road.

Thorinair commented 1 month ago

Very nice! I can pull it to the dev to give it a test if you feel like it is ready!

doodlebunnyhops commented 1 month ago

I actually want to check something - I don't see that I've add atri buff to grapes

doodlebunnyhops commented 1 month ago

:D ready!

Thorinair commented 1 month ago

Awesome! I will be pulling it tomorrow and integrating!

Thorinair commented 1 month ago

I am actually not sure if it is working correctly, having default settings, with spring active, and just activating dehydrator says that there is 1 item sold for Strawberries, but it should be 0 if there is just 1 planted

doodlebunnyhops commented 1 month ago

I am actually not sure if it is working correctly, having default settings, with spring active, and just activating dehydrator says that there is 1 item sold for Strawberries, but it should be 0 if there is just 1 planted

default will accumulate all harvests to see how many can be sold

Thorinair commented 1 month ago

Oh, I understand, I think we can leave it like that, although I am not sure how to activate the processing per harvest

doodlebunnyhops commented 1 month ago

😅 yea now I understand your ask - I mistook for calculating using harvest total - ask was to show per harvest how many dehydrated items, I can make a new pr

doodlebunnyhops commented 1 month ago

But even using equipment will accommodate unused produce to the last harvest 🤔 that still wouldn't result in your ask here - alright onto another pr I go!

Thorinair commented 1 month ago

Maybe we could introduce a toggle that enables or disables whether the produce accumulates thru the season for the dehydrator, so you can pick whether its per harvest or total?

doodlebunnyhops commented 1 month ago

I like that idea! Haha on it 😊