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(balance): cave entrances can spawn niter and other minerals, sanity-check gunpowder recipe #5371

Merged

Conversation

chaosvolt
Copy link
Member

Checklist

Required

Optional

Purpose of change

Had an idea to make saltpeter less hassle to deal with, but along the way I started sanity-checking my math in #1268 and realized I completely bungled it such that the recipe was only like 50% saltpeter, when it wasn't that hard to calculate a ratio that's more accurate but not absurdly wasteful.

Describe the solution

  1. Gave cave entrances a chance to spawn items of group cave_mineral, mainly representing bat activity in conjuction with the below change but still potentially spawning some other loose minerals.
  2. Adjusted weights of contents in cave_minerals to favor niter 75% of the time, with some chances of spawning sulfur, rock salt, or iron ore. Limestone no longer present since it's already widely available from mining rocks or smashing boulders, and iron ore also kept more rare since it's easy to find in swamps.
  3. Fixed the ratio in gunpowder recipe. So it turns out at some point I seriously screwed up the math, for it to be consistent by weight you'd want about 55 grams of saltpeter per 11-gram unit of charcoal, and 1 unit of saltpeter is 5.275 grams so it makes sense for it to be about 10:1. Sulfur meanwhile is .32 grams per unit, so you'd want ~22.92 units of it to match 1 charcoal. I opted to make it a simple even 20 sulfur instead, meanwhile in exchange bumped charges produced per batch to 35 since it now uses 70 grams of material (not counting how coal affects this) and each unit of powder is 2 grams.

Describe alternatives you've considered

Putting mineral spawns in the underground sections instead, which tend to spawn their own things.

Testing

  1. Checked affected files for syntax and lint errors.
  2. Load-tested in compiled test build.
  3. Warped over to a cave and took a look.
  4. Also actually did the math properly this time for blackpowder.

image

Additional context

Also on my radar for a later PR: CleverRaven/Cataclysm-DDA#55486

@github-actions github-actions bot added the JSON related to game datas in JSON format. label Sep 18, 2024
@RoyalFox2140 RoyalFox2140 merged commit 92bd39c into cataclysmbnteam:main Sep 18, 2024
9 checks passed
@chaosvolt chaosvolt deleted the niter-spawn-and-blackpowder-stuff branch September 18, 2024 00:43
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.

2 participants