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

Fix powered tools not consuming charges on use #47485

Closed
wants to merge 3 commits into from

Conversation

aerrant
Copy link
Contributor

@aerrant aerrant commented Feb 14, 2021

Summary

Bugfixes "Fix powered tools not consuming charges on use"

Purpose of change

This PR makes the following changes:

  1. Powered tools are now recognized by charges_per_use tool property rather than max_charges. This is necessary to evade unwanted side effects like magazine spawning and barter price reduction, an also to have tools without max_charges consume charges. This fixes Electric Firestarter Not Consuming Battery Charges #40269
  2. The electric firestarter item is now changed to consume 250 moves per use rather than work instantly (a fire drill, for example, consumes 500 moves).
  3. Tools are now only considered for actions menu when they have enough charges for use, rather than when they have any amount of charges.

Testing

To check for power tools not consuming charges, spawn an electric firestarter, reload it and use it to light a fire. If the bug is there, you'll see that its charges remain the same.

@aerrant aerrant marked this pull request as draft February 14, 2021 02:03
@aerrant
Copy link
Contributor Author

aerrant commented Feb 14, 2021

Okay, this needs some more work: I've accidentally busted item pocket creation and molotovs.

@actual-nh
Copy link
Contributor

  1. The electric firestarter item is now changed to consume 250 moves per use rather than work instantly (a fire drill, for example, consumes 500 moves).

A fire drill should require quite a lot more moves than any modern firestarter - more like 250 and 2500, and that's being wildly optimistic in favor of the fire drill.

@BrettDong BrettDong added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Items / Item Actions / Item Qualities Items and how they work and interact labels Feb 14, 2021
@aerrant aerrant closed this Feb 15, 2021
@aerrant aerrant deleted the fix-tool-charges branch February 15, 2021 22:54
@aerrant aerrant restored the fix-tool-charges branch February 15, 2021 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact [JSON] Changes (can be) made in JSON
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Electric Firestarter Not Consuming Battery Charges
3 participants