-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Item faults #71961
Item faults #71961
Conversation
If you're looking for recipe ideas, we have hair dryers that have a currently unused BLOW_HOT_AIR quality which might dry out a wet phone faster than a bag of rice. |
Bionics repair system. Take a broken item, press m, spend time and possibly materials and get a working item. But does it make sense? Most often my smartphone breaks down. Threw it out and got a new one. |
Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details. Click to expand
This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to |
Added |
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.
I'm not wholly in love with the fault types being arbitrary strings, but the technical implementation is competent.
A good next-step refactoring would be to give all faults fault types and move the faults types to a similar implementation as item flags, and maybe allow faults to have multiple fault types. But don't want to balloon the PR. |
5c7448d
to
73bcb0a
Compare
Cleaned up commit history |
The big concern I’m getting is that repairing modern electronics that have gotten wet like a phone just isn’t possible. Is it possible to do this only to simple electronics like radios? I apologize if I’m confused about ground that’s already covered. But I definitely think we’d want to limit this to simple electronics in vanilla and make it expandable to more complicated electronics in mods like Aftershock and Blaze Industries. Edit: contributors I trust have suggested that my suggestion is a good following PR |
My recommendation remains that submerging electronics in water should apply both a short and a wet type fault. Which means that it at least requires replacingsome of the hardware (although very valid concerns were raised elsewhere about the ability to repair consumer electronics with random PCBs). Right now our electronics are all simply electronics, a supercomputer is the same thing as a flashlight with no regards for how complex it might be to repair. Differentiating all of our electronics into their specific fault types is a worthy cause, but it would badly bloat this PR's scope. |
I think this discussion should continue in #64528 |
Summary
Balance "Replace ITEM_BROKEN flag with a nuanced but simple system that uses faults following the system used for vehicle parts"
Purpose of change
The current system of items becoming permanently disabled by water and electricity, while necessary for balance and providing a challenge, lacks nuance and complexity. Instead, use the system of mending and repair used for vehicle parts and guns. Also see issue #64528
Describe the solution
For now, create a number of faults that can be applied to items with the ELECTRONIC or WATER_BREAK or WATER_BREAK_ACTIVE flags when these items are damaged by water or EMP-like effects.
When an item with a WATER_BREAK or WATER_BREAK_ACTIVE flag is exposed to water, it receives a random fault of fault type "wet".
When an item with a WATER_BREAK or WATER_BREAK_ACTIVE flag is exposed to water, if it has the ELECTRONIC flag, it receives a random fault of fault type "shorted".
When an item with the ELECTRONIC flag is exposed to EMP, it receives a random fault of type "shorted".
Fault type is a new json property for faults.
New "wet" and "shorted" faults added. Fault fixes added for those as well (a few example ones only, more faults and fixes can be added later).
Describe alternatives you've considered
Health-points damage
Making flags reversable (faults seem more nuanced as you can have multiples for both problems and fixes).
Testing
Tested via item unit tests and manually via spawning items, jumping in water, and fixing items.
Additional context
At this point this needs reviews
Note this affected performance of item.is_broken
This introduces optional types to faults which was out-of-scope for what I wanted to do
Future work: relevant items also take damage points and/or permanent damage points when they are exposed to water/EMP?