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

Allow filling containers directly from blood draw kit #3262

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

chaosvolt
Copy link
Member

Summary

SUMMARY: Interface "Using blood draw kit now asks what container to fill, only defaults to filling the item if you cancel"

Purpose of change

Whenever I find myself needing to draw blood (usually for alchemical stuff in Arcana), I always have to unload the blood draw kit again and again, every single time I want to reuse it. This fixes it by having the iuse skip right to that step.

Describe the solution

In iuse.cpp, changed iuse::blood_draw so that the blood being drawn up gets ran through liquid_handler::handle_liquid instead of immediately defaultin to filling the blood draw kit, so you can opt to fill another container with it immediately and go back to sucking blood.

Also means that if drawing acid blood destroys the item, it'll just not produce any acid for you instead of giving you a container of acid that's immediately destroyed.

Lastly, it uses some if function stuff so that if you just hit escape, instead of the liquid ceasing to exist it will go in the blood draw kit by default like normal.

Describe alternatives you've considered

  1. Also figuring out the least annoying way to limit how much blood you can draw out of one corpse. I figure probably adding an item flag to the corpse I guess that stops you with a "this corpse has been drained dry" message, but if so do we want it to do so immediately after a single drain, random chance with each drain that varies depending on critter size, or...
  2. Porting over blood being a thing in butcher yield from DDA instead.

Testing

  1. Compiled and load-tested.
  2. Spawned in and used a blood draw kit on myself.
  3. Liquid handling comes up as expected, in this case only option is the blood draw kit, which correctly prevents any further blood work being done until I empty it.
  4. Empty my water bottle and repeat, can opt to just keep going as normal by filling up the bottle instead, until my third unit has to go in the blood draw kit instead.
  5. Spawn in and kill a zombie, works the same as with drawing my own blood.
  6. Opted to draw some blood then canceled, it correctly defaults to going in the blood draw kit instead.
  7. Confirmed it works as normal when drawing from a spitter zombie until a failure destroys the blood draw kit, at which point you get no acid spawned and no prompt to handle liquids.
  8. Checked affected file for astyle.

Additional context

@github-actions github-actions bot added the src changes related to source code. label Sep 25, 2023
@scarf005 scarf005 self-requested a review September 25, 2023 22:49
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently-drinking-your-own-blood-is-cannibalism.mp4

LGTM

@scarf005 scarf005 added this pull request to the merge queue Sep 25, 2023
Merged via the queue into cataclysmbnteam:upload with commit 87a04bc Sep 25, 2023
14 checks passed
scarf005 pushed a commit to scarf005/Cataclysm-BN that referenced this pull request Sep 28, 2023
@chaosvolt chaosvolt deleted the succ branch November 5, 2023 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants