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

feat(content): Add salvage action for metal items #4207

Merged
merged 5 commits into from
Feb 18, 2024

Conversation

RoyalFox2140
Copy link
Collaborator

Purpose of change

Allows the hacksaw and toolboxes to salvage a select number of metals by weight so we can avoid a thousand uncrafts (not exaggerating here) and so we can turn useless items into useful scrap.

Describe the solution

In the docs it was known we have a way to do custom salvage actions, so I created one you will see on the hacksaw. I also was required to add "salvaged_into" items for each appropriate metal and went with chunks of steel for iron items. We only allow steel and don't differentiate so I added steel to iron because some steel items are made of iron for some reason. I also was required to add "flags": [ "NO_SALVAGE" ] to each relevant base material because in testing you could saw down chunks of steel into chunks of steel. I added a lot of extra no salvages in case we expand this salvage PR in the future.

Note: I selected just a few appropriate metals but not all possible metals. If we want to we can add it for everything.

Describe alternatives you've considered

An uncraft for every. Single. Item. >:(

Testing

JSON loaded into game, tested. NOTE The screenshot is not fully indicative as I changed time to 10 seconds.

image
image
image

Additional context

HAHAHAHAHAHAHAHAHAHA

@github-actions github-actions bot added the JSON related to game datas in JSON format. label Feb 9, 2024
Copy link
Contributor

autofix-ci bot commented Feb 9, 2024

The Autofix app has found code style violation and automatically formatted this Pull Request.

I locally edit my commits (e.g: git, github desktop)

Please choose following options:

I'd like to accept the automated commit
  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.

This PR is complete and I don't want to edit it anymore

It's safe to ignore this message.

I edit this PR through web UI

You can ignore this message and continue working.

I have no idea what this message is talking about

You can ignore this message and continue working. If you find any problem, please ask for help and ping @scarf005.

autofix-ci bot and others added 2 commits February 9, 2024 03:43
fix nails, add missing salvage actions
@@ -183,6 +183,7 @@
"fire_resist": 3,
"elec_resist": 0,
"chip_resist": 11,
"salvaged_into": "steel_chunk",
Copy link
Member

Choose a reason for hiding this comment

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

These and related salvaging into chunks of steel instead of scrap is prolly why some of the behavior you observed during was a touch janky.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think scrap metal is too small, you'd be sawing all day to get your item that small. The hacksaw is 20 scrap metal or 4 chunks of steel, so we're increasing the sawing required by a factor of 5.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. Might be worth testing if making it saw into scrap metal fixes the weird issue of it salvaging super-fast however. If it doesn't then keeping them as steel chunks may be best, who knows.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@RoyalFox2140
Copy link
Collaborator Author

#4208 Confirmed all salvage actions are bugged and do not use correct time.

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.

So, far as I can tell this all looks good at a glance aside from the issue that currently has me a touch stumped as to the cause, the toolbox having moves_per_part massively inflated is basically a hack in my opinion and it seems not even nessecary since salvaging for a lot of items is still instant.

I think what'd be good, probably as a followup PR I'll probably have to work on, would be to figure out how to fix salvaging moves_per_part to actually work right, and then make it so that the item density of the material being salvaged modifies this time. That way the same JSON value will let you zip through cloth and the like while taking longer to process metals.

Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

image

let's worry about salvage actions in following PRs.

@scarf005 scarf005 merged commit e3a73f1 into cataclysmbnteam:main Feb 18, 2024
10 checks passed
@RoyalFox2140 RoyalFox2140 deleted the bonesaw-is-ready branch July 14, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants