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

Standalone fault_fix object #65197

Merged
merged 5 commits into from
May 19, 2023

Conversation

irwiss
Copy link
Contributor

@irwiss irwiss commented Apr 19, 2023

Summary

None

Purpose of change

Work towards #64528

Describe the solution

72a8af6 Makes fault_fix (previously mending_method) a standalone json object with it's own loader. Also slightly changes schema: skills are now a dictionary, this should allow cleaner copy-from if needed and less complex json.

dd5cbc9 Merges the existing fault_fix duplicates for dirt and blackpowder cleaning / lubrication now that fixes are separate from faults.

4f17b95 Moves hardcoded (faulty) prefixes into json definition of the fault

Describe alternatives you've considered

Testing

Most user facing changes should be string changes; (faulty) is now defined per-fault, so gun with a fault_gun_chamber_spent will display jammed instead of faulty, salvaged bionics will display salvaged, blackpowder fouled guns will display rusting etc

The layout of fault mending changed slightly as fault_fix now can add/remove multiple faults, unused so invisible yet but also a UI change: there's label for fault_fix modifying damage

Spawn lightly damaged cars until you get some engine faults, should be able to mend them if the requirements are fulfilled

Spawn 2 5.56 guns and some blackpowder ammo, load one with BP ammo, shoot both, see that the correct faults were added (one should have bp fouling, other normal fouling), mend both guns - see both guns lose their correspponding fouling fault

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Bionics CBM (Compact Bionic Modules) Items: Ammo / Guns Ammunition for all kinds of weapons and these weapons themselves Vehicles Vehicles, parts, mechanics & interactions astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Apr 19, 2023
@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch from 1f53469 to c75ebd7 Compare April 19, 2023 22:44
@github-actions github-actions bot added [Python] Code made in Python Translation I18n labels Apr 19, 2023
@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch 2 times, most recently from 0ebbc32 to 8f2d1f3 Compare April 19, 2023 22:49
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 19, 2023
@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch from 8f2d1f3 to 1bef8b3 Compare April 20, 2023 15:38
@github-actions github-actions bot added the Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies label Apr 20, 2023
@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch from 1bef8b3 to ed3147b Compare April 20, 2023 15:43
@github-actions
Copy link
Contributor

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • unlubricated

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch 3 times, most recently from 697b183 to 4f17b95 Compare April 20, 2023 16:11
@irwiss irwiss marked this pull request as ready for review April 20, 2023 17:38
@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch 2 times, most recently from 067d5b5 to 9884e6f Compare April 20, 2023 17:41
@ama0
Copy link
Contributor

ama0 commented Apr 20, 2023

Maybe it's better to change the json filenames from faults_xyz.json to xyz_faults.json in data/json/faults/. Just to make it easier to navigate all the files, because there probably will be a lot of files in this folder. And I think it's more intuitive 😅

faults_xyz xyz_faults
faults_bar bar_faults
faults_baz bar_fixes
faults_bionics baz_faults
faults_foo baz_fixes
faults_guns bionics_faults
faults_vehicles bionics_fixes
fixes_bar foo_faults
fixes_baz foo_fixes
fixes_bionics guns_faults
fixes_foo guns_fixes
fixes_guns vehicle_faults
fixes_vehicles vehicle_fixes

@irwiss
Copy link
Contributor Author

irwiss commented Apr 21, 2023

I don't expect a lot of files, or at least not a lot of sense to split more than per kind of fault, so worst case ~20 files in total

@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch from 9884e6f to f0dee35 Compare April 21, 2023 08:54
@Fris0uman
Copy link
Contributor

Don't this need some documentation to explain how to write a fault object?

@irwiss irwiss marked this pull request as draft May 9, 2023 14:58
@irwiss irwiss marked this pull request as ready for review May 9, 2023 18:43
@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch from f0dee35 to bccfeda Compare May 9, 2023 18:43
@irwiss
Copy link
Contributor Author

irwiss commented May 9, 2023

Yep forgot about those, seems docs didn't exist even for previous fault definitions either, added some

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs labels May 9, 2023
@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch from bccfeda to 6fc0814 Compare May 9, 2023 19:26
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels May 9, 2023
@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch from 6fc0814 to 3259cd3 Compare May 11, 2023 09:03
doc/JSON_INFO.md Outdated Show resolved Hide resolved
@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch from 3259cd3 to 1f10f33 Compare May 16, 2023 11:16
@irwiss irwiss force-pushed the standalone-fault_fixes-obj branch from 1f10f33 to 88afc11 Compare May 19, 2023 00:15
@dseguin dseguin merged commit b5f3842 into CleverRaven:master May 19, 2023
@irwiss irwiss deleted the standalone-fault_fixes-obj branch May 19, 2023 01:57
nornagon added a commit to nornagon/cdda-guide that referenced this pull request Jun 12, 2023
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 Bionics CBM (Compact Bionic Modules) [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. Items: Ammo / Guns Ammunition for all kinds of weapons and these weapons themselves [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [Python] Code made in Python Translation I18n Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants