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: Tear out toolweapon_on and toolweapon_off and dependent iuse actions. Add WATER_DISABLE flag. Add need_dry variable to transforms. #5488

Merged

Conversation

KheirFerrum
Copy link
Collaborator

@KheirFerrum KheirFerrum commented Oct 2, 2024

Checklist

Required

Optional

  • This is a C++ PR that modifies JSON loading or behavior.
    • I have documented the changes in the appropriate location in the doc/ folder.
    • If documentation for this feature does not exist, please write it or at least note its lack in PR description.

Purpose of change

  • refactor: Energy Rework #5259 needs to convert all iuse actions to the new format, I figured we could use a separate PR to cut down on actions I need to convert.

Describe the solution

  • Removes toolweapon_on and toolweapon_off iuse actions and their dependent actions for stuff like chainsaws and lajatangs. Adds a need_dry field to transforms to the behaviour closely mimics that of the toolweapon_* iuse actions and a WATER_DISABLE flag that disables an item that gets submerged in water, as WATER_EXTINGUISH would mean even rain can kill it which we don't want. (Not to mention it adds the (lit) modifier to the name of the item)

Describe alternatives you've considered

  • Doing it another time while cursing the name of all who came before.

Testing

  • Spawned Electric Chainsaw, turned it on.
    • Checked that it consumed charges on transformation and continues to do so in active state.
    • Check that it can be turned off without issue.
    • Check that it can still chop down trees in off form.

Additional context

I heard you liked removing fossilized spaghetti code, so I removed spaghetti code so I can remove more spaghetti code.

Remove all our shitty `toolweapon_on` and `toolweapon_off` iuse actions, make them use transforms like everything else.

Add transform bool that denotes if an item cannot transform while submerged in water. Add a flag that reverts an item when it is submerged in water.

Also added an example conversion so @RoyalFox2140 can help me convert all the items over.
@github-actions github-actions bot added docs PRs releated to docs page src changes related to source code. JSON related to game datas in JSON format. labels Oct 2, 2024
Copy link
Contributor

autofix-ci bot commented Oct 2, 2024

Autofix has formatted code style violation in this PR.

I edit commits locally (e.g: git, github desktop) and want to keep autofix
  1. Run git pull. this will merge the automated commit into your local copy of the PR branch.
  2. Continue working.
I do not want the automated commit
  1. Format your code locally, then commit it.
  2. Run git push --force to force push your branch. This will overwrite the automated commit on remote with your local one.
  3. Continue working.

If you don't do this, your following commits will be based on the old commit, and cause MERGE CONFLICT.

Copy link
Collaborator

@RoyalFox2140 RoyalFox2140 left a comment

Choose a reason for hiding this comment

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

Nobody merge it until I'm done working on the hellish amounts of json.

@RoyalFox2140 RoyalFox2140 requested review from RoyalFox2140 and chaosvolt and removed request for RoyalFox2140 October 2, 2024 22:03
These apparently had a special fast_startup tag for their activation speed in the `toolweapon_off` action
src/iuse_actor.cpp Outdated Show resolved Hide resolved
Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

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

  1. Compiled and load-tested.
  2. Started up a chainsaw, it runs as expected and only eats a few charges when started, as expected.
  3. Deactivated the chainsaw and could re-start it without issue.
  4. Walked into shallow water, can activate the chainsaw just fine, moving around doesn't extinguingish it.
  5. Deep water correctly reverts a running chainsaw to inactive state and disallows starting it, stepping back out lets it work again.

Left a single smol proposal for a more clear message, everything else seems fine. :3

chaosvolt
chaosvolt previously approved these changes Oct 3, 2024
@chaosvolt chaosvolt merged commit cf3f5dc into cataclysmbnteam:main Oct 3, 2024
12 checks passed
@KheirFerrum KheirFerrum deleted the FUCK-ALL-YALL-LEGACY-TRANSFORMS branch October 3, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs PRs releated to docs page JSON related to game datas in JSON format. src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants