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

Resume butchering #73610

Merged
merged 2 commits into from
May 10, 2024
Merged

Resume butchering #73610

merged 2 commits into from
May 10, 2024

Conversation

inogenous
Copy link
Contributor

Summary

Features "Resume butchering"

Purpose of change

Allows resuming previously started butchering activities. Fixes #42586 .

Describe the solution

This is done by storing a var on the corpse item with the progress. For example, aborting a dissection after 90% has been completed will store var DISSECT_progress=0.9 on the corpse.

Displays percent of previous progress in the butchery ui, if it has already started earlier.

resume-butcher

Describe alternatives you've considered

We should migrate the butcher activity from the old activity classes into "new" activity_actor classes - but that's for another PR.

Testing

  • Dissected lots of zombies by selecting them individually. ✓
  • Placed several zombies on the same tile and selected "Butcher everything". All zombies are correctly butchered. ✓

Additional context

The idea of storing a var on the corpse was already suggested before: #26113 (comment)

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) <Enhancement / Feature> New features, or enhancements on existing labels May 9, 2024
@Nebnis
Copy link
Contributor

Nebnis commented May 9, 2024

Huge gamechanger, blob bless u

@inogenous inogenous force-pushed the resume-butchering branch from bd151c8 to c08fba4 Compare May 9, 2024 18:22
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels May 9, 2024
@Procyonae
Copy link
Contributor

You probably shouldn't be able to 99% dismember a corpse and then start doing a full butchery on it etc but idk how to suggest changing it to accommodate for that

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 10, 2024
@Qrox
Copy link
Contributor

Qrox commented May 10, 2024

You probably shouldn't be able to 99% dismember a corpse and then start doing a full butchery on it etc but idk how to suggest changing it to accommodate for that

I think we can disallow finer butchering methods when a cruder method is already in progress. Alternatively, we can allow resuming butchering with a different method, and return butchering results based on the percentage of each method chosen once the methods' total progress reaches 100% or as soon as you pause butchering.

@inogenous inogenous force-pushed the resume-butchering branch from c08fba4 to 847ce8d Compare May 10, 2024 20:46
@inogenous
Copy link
Contributor Author

Thank you all for good ideas.

I think we can disallow finer butchering methods when a cruder method is already in progress.

Have added another commit here now that implements this. For example, starting "quick butchery" will make "dissect" unavailable. A butcher type is considered more crude than another type if it takes less time to complete.

Example when having started "quick butchery" :
resume-butcher-2

inogenous added 2 commits May 10, 2024 23:36
Allows resuming previously started butchering activities.

This is done by storing a var on the corpse item with the progress. For
example, aborting a dissection after 90% has been completed will store
var `DISSECT_progress`=`0.9` on the corpse.

Displays percent of previous progress in the butchery ui, if it has
already started earlier.
Disables finer butchery types if a cruder butcher type has already been
started. For example, starting "quick butchery" will make "dissect"
unavailable. A butcher type is considered more crude than another type
if it takes less time to complete.
@inogenous inogenous force-pushed the resume-butchering branch from 847ce8d to 2d0c254 Compare May 10, 2024 21:38
@I-am-Erk I-am-Erk merged commit cf0d689 into CleverRaven:master May 10, 2024
19 of 26 checks passed
@I-am-Erk
Copy link
Member

cool one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: Be possible to continue butchering instead of starting over from the beginning
5 participants