mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-30 17:33:08 +01:00
8d7db532c0
## About The Pull Request This is a followup PR to https://github.com/tgstation/tgstation/pull/73866 Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/19991 I had suspected the nutrition loss slimes experience alongside blood regen might necessitate some tweaks down the line and here we are. This PR has two parts. --- **PART I:** _Reworking the blood deficiency quirk backend_ As it is, blood drain from the blood deficiency occurs in the quirk's subsystem process() call asynchronously to Life(), where the blood regen occurs. This results in the blood volume fluctuating constantly, making it difficult to really make sense of readings and potentially introducing race conditions. This PR changes that. The blood deficiency quirk no longer processes and instead has a proc, `lose_blood(delta_time)`, which is called in the `handle_blood()` proc at the same time blood gets regenerated. Added a `get_quirk` proc to help with this, so that we only have to iterate through the quirks list once for each mob (rather than calling has_quirk, then locate in quirks... etc). Added a `TRAIT_BLOOD_DEFICIENCY` to further optimize the code. --- **PART II:** _Some fine tuning of the slime blood deficiency quirk_ Slime regen works a bit differently than humans such that if they lose -any- blood whatsoever, they will also lose nutrition. This means that even if hooked up to an IV they will still become starving rather quickly. A bit -too- quickly. Instead, now the hunger does not kick in until `blood_volume` reaches 550. This means that if a slime with the blood deficiency quirk is hooked up to an IV with say, welding fluid, and has over 150 nutrition, they will regen blood faster than they lose it from the blood deficiency quirk. Once they get to over 550 `blood_volume`, they will stop losing hunger (from blood regen, anyway--normal hunger rate still applies). So essentially this just allows slimes with the blood deficiency quirk to be able to function so long as they stay hooked up to their IV's (or chug welder fluid/some other toxin), which is the intended purpose of the quirk. Edit: As a bonus I added new blood bags for the exotic blood types, and added a proc `update_mail_goodies` which updates the blood deficiency quirk's mail goodies accordingly (crewmembers with blood deficiency get sent blood bags, now they will get the correct type if their species changes). While I was in these files I changed any immediate single letter vars I could find and cleaned up what I could.  <details> <summary>The new blood packs</summary>  </details> ## Why It's Good For The Game -This is arguably a more performant option than before, and fixes race conditions from `Life()` and `quirk/blooddeficiency/process()` fighting with one another. -Adjustments to slime blood deficiency will enable it to function as intended. -It is now easier to read health analyzer blood volume readings for blood deficient mobs. -Now the correct blood packs are sent in the mail. ## Changelog 🆑 qol: adjusted the blood deficiency quirk for slimepeople to not cause excessive hunger as long as blood volume is kept above 550 via an IV drip (or other means of getting welding fluid/some other toxin etc into the bloodstream, e.g. ingestion) qol: speciees with exotic blood types will now receive the correct blood bag in the mail from having the blood deficiency perk add: adds new blood bag types: TOX (slimepeople), H2O (podpeople), S (snail) fix: fixed blood deficiency quirk causing wild fluctuations in blood volume on the analyzer, giving more accurate readings /🆑 --------- Co-authored-by: san7890 <the@san7890.com>