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: internal-mag guns that lack RELOAD_ONE no longer massively inflate reload cost #5769

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

chaosvolt
Copy link
Member

Checklist

Required

Optional

Purpose of change

This fixes weapons like the BB gun saying they only take 500 moves to reload but then taking entire minutes due to weird code stuff.

Describe the solution

C++ changes:

  1. In character.cpp, Character::item_reload_cost now only multiplies the reload rate of an item by how many bullets it has to insert if the item's a magazine. Guns will always use just the reload rate. This doesn't affect guns swapping mags or RELOAD_ONE guns, but instead the few weapons that still use clip size but reload all ammo at once.

JSON changes:

  1. Changed reload rate of flamethrower base class from 4 to 400. Flamethrowers no longer have internal mags anymore but use magazines, so the low time it seems was likely a hack for when they used clip size.
  2. Set pneumatic speargun's reload rate from an absurd 6000 moves to 1000, to be only a bit slower than the base class for pnematic guns. This was even more wacky back when it was multiplied by the number of rounds, but still felt it excessive for this fairly mid-tier weapon.
  3. Lower reload rate per round of pneumatic shotgun from 6000 moves to 1000, as above.
  4. Gave pneumatic bolt driver RELOAD_ONE so it still forces the extra delay of dealing with the (now lower) reload cost per each bolt.
  5. Pneumatic assault rifle meanwhile gets to use that fixed time for the entire load of 20 rounds since it only fires pebbles, and has much lower damage than the pneumatic bolt driver, making it more comparable to the BB gun.
  6. Water cannon given a reload rate of 500 now that it's not per round.
  7. Nailgun reload rate bumped up from 50 to 200.
  8. Autolaser given a reload rate of 300 for topping off the water jacket.
  9. Per feedback by Royalfox, reload rate for flamethrower and chemical sprayer tank magazines reduced from 3 to 1, since these typically have massive capacities and refilling a tank with liquid or gas fuel should absolutely be smoother than loading a firearm magazine.

Describe alternatives you've considered

Hacking around this by giving relevant guns very low reload rates.

Testing

  1. Compiled and load-tested.
  2. Spawned in a BB gun, confirmed it no longer takes ages to unload and reload.
  3. Spawned in a pressurized fuel tank. As expected, reloading it with fresh fuel still takes time. Interestingly, unloading it only takes a couple seconds.
  4. Spawned in a glock, confirmed that swapping mags still takes the expected time, and loading an empty mag while it's loaded in it correctly takes several seconds.
  5. Spawned a revolver, reloading one round at a time still works as expected.

Additional context

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Nov 27, 2024
Copy link
Contributor

autofix-ci bot commented Nov 27, 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.

@chaosvolt chaosvolt merged commit 0575c7a into cataclysmbnteam:main Nov 27, 2024
12 checks passed
@chaosvolt chaosvolt deleted the clip-size-goes-nyoom branch November 27, 2024 01:18
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. src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants