-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Change milking to an activity, restore udders on load catchup #37523
Conversation
I feel slightly guilty for sending you off course into this rabbit hole and very thankful that you got it done. Don't have a equal/better understanding of the code than you to do a meaningful review of it but the milking time changes seem perfect. |
@@ -548,6 +549,7 @@ class monster : public Creature | |||
cata::optional<time_point> baby_timer; | |||
bool biosignatures; | |||
cata::optional<time_point> biosig_timer; | |||
time_point udder_timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous approach (adding an effect
) was sound. Can it still be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Effects do not progress outside of the reality bubble.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it fast-forwarded when the player re-enters the reality bubble. If it's not, I'd consider that a bug.
erroneous edit to mtype.h from review: use iterator instead of map directly add check for udders being empty in milk_finish add serialization for udder timer from review : const int and use iterator instead of map directly add checking for temp_tie effect removal Update src/activity_handlers.cpp Co-Authored-By: BevapDin <tho_ki@gmx.de>
Summary
SUMMARY: Bugfixes "Change milking to an activity, restore udders on load catchup"
Purpose of change
Fixes #36826
Describe the solution
Instead of subtracting moves and adding a timed effect to the cow, turn milking into an interruptable activity.
This now takes around 25 minutes in-game ( as per googling hand-milking cow time tells me ) but the real time it takes is around the same, as before subtracting movs just made the seconds tick by slowly.
also , the udders now refill every day, either oncatchup on load, or in reality bubble, which acts the same as the checking for the effect did in monexamine.cpp but is more robust now, and potentially ready for NPC milking activities in the future.
also added try_reproduce() and biosig ( poop ) to the monster do turn once_every( 1_days ) check, so now animals can poop and lay eggs whilst in reality bubble too.
Describe alternatives you've considered
N/A
Testing
I did a lot of milking, teleporting, and waiting. all seems ok.
Additional context
N/A