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

Prompt before oxytorch activity if you don't have enough gas #78432

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AlexMooney
Copy link
Contributor

@AlexMooney AlexMooney commented Dec 8, 2024

Summary

Features "Prompt before oxytorch activity if you don't have enough gas"

Purpose of change

With the addition of tiny acetylene tanks, having insufficient gas to torch things is far more prevalent. Since you need 112 charges to cut through a metal door and the new tanks hold 100, the player can easily waste 96 charges (8 gas per second until it runs out) if they attempt to torch a door with a full tiny tank.

Describe the solution

Check if the player has enough acetylene before starting the activity and prompt them if they want to start if it's not possible to finish with the current tank.

Describe alternatives you've considered

  1. Could make the oxy_torch USES_NEARBY_AMMO so that multiple tiny tanks can do the job. This would still waste gas when there isn't enough and would also change up welding crafting to be able to squeeze every drop out of each tank.
  2. Handwave steel doors to require 6 kg of steel melting requiring 96 gas instead of 7 kg requiring 112 gas, so that you can cut a door with a tiny tank. This doesn't solve the problem of wasting gas, but at least makes the tiny tanks less punishing.
  3. Increase the tiny tank to 1.25 L so that you can cut a door. As above.
  4. Empty the current tank whether or not it'll do the job. Current behavior.

Testing

Prompt appears
image

Can reload and resume
image

Additional context

Gas requirements in the oxy_torch
Capacity of tinyweldtank

@github-actions github-actions bot added [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 labels Dec 8, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Dec 8, 2024
@AlexMooney
Copy link
Contributor Author

Did more testing when updating the tests and now I see that you can reload the torch and resume the activity. This PR would prevent you from using multiple tanks to get the job done. I'll see about updating it with a prompt to ask if you're sure you want to start given your current tank doesn't have enough.

@Night-Pryanik
Copy link
Contributor

Care to update the tests?

@AlexMooney
Copy link
Contributor Author

Care to update the tests?

As I mentioned in the comment above, I was working on updating the tests but I decided this change isn't correct yet. I'm going to change it to prompt for confirmation instead of blocking the action and I'll also add a test.

@AlexMooney AlexMooney changed the title Don't start oxytorch activity if you don't have enough gas Prompt before oxytorch activity if you don't have enough gas Dec 10, 2024
@AlexMooney
Copy link
Contributor Author

I'm thinking of adding something to Avatar so that I can force the query_yn to return true. Something along the lines of dummy->set_query_yn(true) to override the return ::query_yn call.

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 [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.

2 participants