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: repair nanobots not working at all on broken limbs #3787

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

scarf005
Copy link
Member

@scarf005 scarf005 commented Nov 30, 2023

Purpose of change

Describe the solution

  1. removed mentions of repair nanobots requiring splints (so its behavior matches with Simplify broken limb mending #3054)
  2. extracted is_broken logic into has_broken_limb_penalty. hidden ATM to encourage encap?sulation in future
  3. extracted broken_heal logic into heal_adjusted. it takes account of whether limb gets penalty from being broken and not splinted.
  4. made repair nanobot logic use heal_adjusted.

Describe alternatives you've considered

  • making heal_adjusted the default behavior of character::heal

Testing

in both cases player waited ~6 hours with arms broken and repair nanobots active.

Without Splints

without-splints.mp4

it heals slowly.

With Splints

with-splints.mp4

it heals quickly.

Additional context

  • bodypart health logic is getting messier.
  • spent 40 minutes figuring out why no changes/breakpoints was made after code changes, only to find out cmake changed emitting files from ./cataclysm-tiles into build/src/cataclysm-tiles
  • also hecc, i made the PR on my main branch

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Nov 30, 2023
@scarf005
Copy link
Member Author

cc @KheirFerrum

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.

The chief complaint on discord is that this buff to nanobots is a radical shift in balance. While I disagree with that, I think we need to know the exact math for how the heal rate works with and without fast healer and with varying medical qualities such as high disinfectant. We can't make an informed decision on if a player can walk through all damage without knowing if they currently can.

@KheirFerrum
Copy link
Collaborator

KheirFerrum commented Nov 30, 2023

Okay, after reading what has been shown, I jumped the gun in the Discord due to anxiety over people touching the code I did, a bit of past issues I've had with code being rapidly merged, and not being able to read it over a computer (laptop's broken again). I was under the impression that the repair nanobots had been working on broken limbs when splinted and that this PR was going to give the full benefit to unsplinted limbs. I can see now that this is not the case, and that it didn't work at all for broken limbs (which is a bug, and should be fixed).

I would still suggest that unsplinted limbs be given lower (or no) bonuses from repair nanobots, as they will rapidly heal broken limbs otherwise (a player without mutations can expect almost all of their broken limb repair progress to be from repair nanobots). I would also suggest that it not be tied into the introduced heal_adjusted function as that accounts for mending modifiers from mutations as well, which essentially doubles up on it for characters with those mutations and reduces the use of repair nanobots as a source of flat healing unaffected by both good and bad modifiers to healing.

Other than that it seems fine, I can't read most of the new code format, but the gist looks right.

The description should note what may alter the healing rate (so just whether it's broken/has been splinted in my suggested version)

@scarf005 scarf005 changed the title fix: make nanobot work regardless of splint fix: nanobot not working at all on broken limbs Dec 1, 2023
@scarf005 scarf005 changed the title fix: nanobot not working at all on broken limbs fix: repair nanobots not working at all on broken limbs Dec 1, 2023
@scarf005
Copy link
Member Author

scarf005 commented Dec 2, 2023

I would also suggest that it not be tied into the introduced heal_adjusted function as that accounts for mending modifiers from mutations as well, which essentially doubles up on it for characters with those mutations and

While I agree with the premise, I chose with this solution as it was simpler to implement. Maybe i should make that function boolean predicate...

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.

Failure unrelated, so functioning should be good to go.

Balance and consistency wise, I would object to this if not for the fact that disabled limbs can heal without being splinted anyway as a result of #3054

Either way, making sure that it can be used to improve disabled limbs is reasonable anyway, whether that take the form of only helping splinted limbs heal or applying to all limb healing.

@scarf005
Copy link
Member Author

scarf005 commented Dec 6, 2023

yeah, could add nerf for limbs without splints in future PR.

@scarf005 scarf005 added this pull request to the merge queue Dec 6, 2023
Merged via the queue into cataclysmbnteam:upload with commit 5da2793 Dec 6, 2023
14 of 17 checks passed
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.

Repair nanobot doesn't work with splinted broken limbs
4 participants