Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tractor Mod] Adds constant energy drain. #812

Closed
wants to merge 4 commits into from

Conversation

ZeroOne010101
Copy link

Hello!
This might be a possible or partial solution to #194.

These proposed changes add a constant energy drain while the Tractor is mounted.
They also add menu bindings to toggle and modify said energy drain.

This uses the stamina property of the player, so the timing isn't ideal with the upcoming 1.6 changes.

My first thought was to add a drain equivalent to the actions as if they had been done with the tools.
I didnt find a function to do that without copy-pasting the calcuations from the game, however, and i couldnt figure out how to implement it in a way that didnt trigger every update.
There'd need to be some way to get a list of eligible actions taken every tick i think.

@ZeroOne010101
Copy link
Author

ZeroOne010101 commented Jul 30, 2023

I am very sorry for not discussing those changes beforehand.
I mainly wanted the functionality for myself, since i am playing the game for the first time and am very close to buying the shed right now.
I think i may have jumped the gun there a little.

Ill leave this open for now, but please dont feel pressured to include it or anything.

@Pathoschild
Copy link
Owner

Thanks for the pull request!

I'll close this per my comment in #194:

I'm not sure I want to link the tractor fuel to the player's stamina though. While that does simplify the code, I think it would somewhat break immersion (since driving a tractor shouldn't be that exhausting) and the ideal meta is to use the tractor in the morning (thus draining fuel) before spending the afternoon doing other stuff (thus draining stamina).

Your implementation is pretty similar to what I had in mind for the fuel mechanic though. It's just that instead of draining the player stamina, the mod would track a remaining-fuel value in the tractor's modData field.

One small complication is that the upcoming Tractor Mod 4.17.0 (for Stardew Valley 1.6) adds tractor sound effects, so we'll need to adjust sounds for the fuel mechanic too (e.g. refueling, fuel runs out, riding tractor while out of fuel).

I might take another look at this when implementing the full fuel mechanic though. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants