# Medical
## Primer
- medical is boring and unengaging at times
- we want to change it because we don't like it(tm) but we also don't want to overshoot and make the game too much of realism simulator
- optimally, most injuries fixable without cloning, death treatable up to 15-30 minutes with proper facilities, most minor to moderate injuries have improvised ways to treat
- wound based system, get rid of the -100 to 100 numerical health system
- *LME NOTE:* A lot of the suggestions here sound similar to how rimworld handles both injuries and drugs
- Maybe as a short summery of what I mean by that:
- Colonists(in our case it would be mobs or just players) have a series of stats, that normally reach from 0% (completely gone) to 100% (Normal condition) but can reach above 100% with drugs, augments or colonist abilities (think CM orders)
- Pain
- Caused by injury
- 0% by default
- above 10% affects conciousness
- default colonist drops due to shock above 80% (there are deviants)
- Conciousness(*)
- Sight
- Hearing
- Moving
- Manipulation
- Talking
- Breathing(*)
- Blood Filtration(*)
- Blood Pumping(*)
- Metabolism (Here it refers to how efficent a colonist eats, not how often they need to)(*)
- Each limb has at least one stat they are linked to
- Hand, Arm: Manipulation
- Foot, Leg: Moving
- Kidney, Liver: Blood Filtration
- etc.
- Any of the * marked stats lead to instant death when lost
- for us they should probably put the patient into critical giving medical a 3-5 Minute window to stabilize the patient
- Blood Filtration and Metabolism should probably be handled different from Conciousness and Breathing and Blood Pumping
- A Colonist in pain shock wont directly die to the shock, although they cant treat themselves, or move to safety
- Formula for the impact of Pain on the Consciousness:
`
E( C ) = Brain-Integrety * (1 - Clamp((Pain - 0.1) * 4 / 9, 0, 0.4)) *
(1 - 0.2 * Blood-Pumping-Efficiency) *
(1 - 0.2 * Breathing-Efficiency) *
(1 - 0.1 * Blood-Filtration-Efficiency)`
## CPR, Defibs [PARTIAL]
- ~~CPR forces metabolism, slowly, even on dead~~ done
- ~~CPR halts organ damage and respiration failure. Will not reverse other forms of respiration failure like poisoning~~ done
- Defibs just try to restart your heart, as well as resolve things like poential heart conditions in the future.
- Defibs should do a heft amount of pain and a small bit of burning
- Add **very** slight defib sickness if you were dead for too long (see cloning section for what it should do, please do not slap on utterly stupid value modifiers).
- This isn't in the finished/open PR.
## Surgery [design-ready]
- Surgical states per limb
- Certain limbs require certain steps to open, levels of open
- cyberlimbs just have one level of open
- most biolimbs have two levels - skin incision prepared, and bones sawed, latter applicable to head
- Surgical system generally operates off "can access" checks
- Some steps immediately accessible on first level of open, some requires bonesaw like heart ops with ribcage in the way
- Things like tend wounds/manual flesh stitching should only require first level of open
- Surgery should have nuanced system of skill + failure
- Both time penalties + failure chance penalties, rather than just latter
- Medical cyborgs have **perfect** chance anywhere
- Laying on floor has high penalty + high chance of failure by untrained
- Unanesthesized extremely high chance failure even trained, painkillers-only low chance failure trained, etc
- Optimal operating room + operating computer (holographic surgical aid?) = perfect surgery chance always, only time penalties to untrained - with proper tools
- Ghetto tools always increase penalties
- Repeatable surgery support
- Tend wounds - when fixing wounds, automatically repeat surgery if still needed, no further clicking required
- **Radial menus for step selection**
- Surgery code reads state from limb + organs based on what tool is used, presents user list of things they can do via radial menu
- bone repair/etc state kept on limbs/organs, not the surgery datums
- Allows for true non-linear surgery, aka can close someone while half-done with something
- All surgical-related states should be examinable when surgery is accessible.
## Pulse [design-incomplete]
- Pulse should become relevant
- Injury/etc raises pulse, some things decrease pulse
- Pulse determines metabolism
- Too high pulse = loses effectiveness
- Actual pulse effectiveness determined both by pulse + blood volume + traumatic shock level (maybe) + heart strength
- As multiplier - can be above 100% for upgraded cyberhearts/whatnot
## Wounds [design-incomplete]
- All injuries are wounds on limbs
- Limbs have maximum damage limit
- Going past destroys the limb - burning in lava will not infinitely stack wounds
- All discrete attacks = new wound or makes existing wounds worse
- tg wounds? stackable baywounds?
- DoT effects obviously have a "full limb" wound aka "full-surface burns", etc
- Wound severities - light cut all the way to arterial bleeds
- Similar injury types have RNG chance **per existing wound** to escalate wound severity instead of making new wounds
- Most damage sources get a wound bonus, by-default calculated from damage type + amount. High wound bonus = higher severity wound + higher chance of escalating existing wound rather than making a new one
- Many less-severe wounds generally far better than large severe wound
- All wounds naturally heal - slow without treatment and usually not enough to stop you from dying to something serious
- Put pressure on bleeds --> use hand + minor slowdown, until you can put bandage on, etc
- Bandages/burn ointment works by severity halted, not wound amount - Advanced trauma kit just as effective on a full limb of minor wounds as a single major wound.
- Instantly heal a bit of severity, otherwise stop the worst effects, aka infection or bleed-outs.
- Bandaged/salved wounds can be re-agitated by being re-escalated in severity.
- All wounds are brute/burn on /organ. Organs are usually bodyparts, sometimes literal organs.
- Internal bleeding is now on organs only.
- Health analyzers should show per brute/burn, per limb, `80 - 40`, `50 - 5`, etc, where the first number is total trauma of a type of damage, and the second is the most severe wound's intensity. This allows you to quickly tell at a glance how badly hurt someone is without literally listing every wound.
## Chemicals [design-incomplete]
- Healing chemicals do not directly heal
- New chemical effect holder list - chemicals stack onto this list
- Diminishing returns, stacking many kinds = longer lasting, slower depletion, smaller boosts in strength, not full-effectiveness stacking.
## Pain, Traumatic Shock [design-incomplete]
- Wounds cause pain (duh!) on application and a little bit on tick
- *LME Suggestion:* The pain per wound varies with type of injury
- Burn wounds tend to hurt more than cuts
- amount of pain isnt necessary linked to severity(e.g. papercuts)
- Traumatic shock mounts per tick based on this - does not go down unless original sources are addressed/bandaged/resolved
- Pain slowdown drastically reduced
- Traumatic shock slowdown drastically reduced
- Painkillers reduce susceptibility to this - **except for pulse altering effects**, since we do not want painkillers to make people ignore the actual lethality of the damage as much as the incapacitation of the damage, if it makes sense.
- Traumatic shock decreases circulation at high stages, and **ultimately makes it easier to die.** (see pulse.)
- *LME Suggestion:* Shock is a stage the body enters at somepoint and it doesn't leave that state until the cause is sufficently dealt with.
- Painkillers dont help with shock
- Pulse boosters like caffeine, adrenaline or hyperzine help to carry someone through a traumatic shock
- Rimworld Wiki on Damage Type to Pain: https://rimworldwiki.com/wiki/Health_Difficulties
## Incapacitation [design-incomplete]
- Above too much pain/traumatic shock, knockouts can occur - as well as damage + oxyloss to brain
- We do not want this to be too prevalent - soft-crit should be added, staring at blank screen for too long is not fun!
- Limbs lose effectiveness as damage/wounds mount - non-life-threatening injuries can still stop you from effectively using a limb.
## Robots, Synthetics [design-incomplete]
- Robots do not bleed out; they'll be de-facto powerful for their inability to feel pain + traumatic shock of any kind.
- "Attration" replaces traumatic shock - less severe by far, but still full-body disruptive.
- *LME Suggestion:* Pseudo-Pain for robots, slowing them down/causing them to misstep sometimes
- For each 5/10 Damage sustained the noiselevel is increased by one
- The noiselevel has three steps:
- First Step is reached with level 3, and is a minor slowdown.
- slowdown = 2 * noiselevel / 30
- Second Step is reached with level 5, and chance for a move command to be misinterpeted.
- mis_step_chance = noiselevel / 50
- Final Step is level 9, and it renders the user into a basicmob(no tool use) but removes the chance for move commands to be misinterpeted. You can still walk away, but lost the chance to engage in fights, or repair yourself
- Logic behind this:
- Damaged wires result in white noise, which mess with the signals.
- First you can fix it by increasing signal power, that means it takes longer for the signal to be registered.
- At somepoint that becomes infeasable anymore, so you need to accept some errors.
- Finally you get so desperate that you fall back to some super resiliant protocol which lacks ability for complex data -> Survival mode
- yes, this is slightly exaggerated and probably not what would happen in reality, but its better than "Robots are just peak powergame"
## Toxicity [design-incomplete]
- Toxins gradually (**slowly**) cause organ damage at high values
- Toxins automatically filtered by filteration organs, usually damaging them in the process at high values
- Toxins cause traumatic shock at high values.
- *LME Suggestion:* Three kinds of toxins: Organic, inorganic and internal.
- Organic Toxins are first processed by the liver either reducing severity or neutralising it entirely.
- Inorganic Toxins bypass the liver.
- Internal toxins are caused by infections and are slowly processed through the liver while being able to reach other organs
## Oxyloss [design-incomplete]
- Remove oxyloss and replace with blood oxygenation (or literally retheme it)
## Organs [design-incomplete]
- Per organ damage + oxy deprivation
- Losing circulation/other factors creates stress on organs
- Organs **very** slowly (serious damage after 7.5-15 min, unviable after 22-30) damage while dead - halted by CPR.
- Surgery can still fix (almost) all organ damages.
- Brain damages far faster when dead.
- Organs automatically heal when you're healthy. Not too realistic, but this is a video game.
- This will **not** outheal most sources of poisoning.
- At a certain stage of wounding, organs can start taking direct damage from even non-penetrating attacks.
- *LME Suggestion:* Organs turn necrotic during/after the serious damage phase limiting their effectiveness to 10% which continues to slowly decrease until the 30 min mark is reached.
## Health System - Brain Time! [design-incomplete]
- Remove death at -100%.
- Death occurs when brain loses activity, usually from cessation of pulse --> too much oxyloss on brain
- You may not be entirely able to fight - even if you make brain immortal, having your legs disabled still makes you incapacitated!
## Infections [design-incomplete]
- Wounds can become infected in some cases
- Slashed by dirty things, not bandaged
- Burns that aren't salved
- Infection chance goes down greatly when treated
- We don't want infection to be too obnoxious
- Infection based on severity when starting - most minor infections are going to be an ouch and gradually cause a fever, itching, bad messages, then toxins, but won't kill you
- Yes, infections will actually go down and be counteractable! Without spaceacillin! Go drink tea, ERPers, it heals toxins!
- Infections gain immunity over time. Rimworld! Bad circulation/blood oxygenation hampers this, along with organ damage + simutaneous infections.
- If you get too many/too severe/are heavily hurt, you have a greater chance of dying from infections!
- Bad infections can still kill you if untreated.
- Overall: Increase infection chance (see: not only burns can infect!), and make it so spessmen have a relatively powerful immune system so the only way to deal with them isn't spaceacillin spam!
## Cloning/Resleeving/Mirroring/Whatevering [design-incomplete]
- Potentially modify memory loss to "events leading up to death" (policy issue)
- Less utterly ass to deal with for players, higher administrative overhead
- Add resleeving sickness
- 15 minutes, slight damage/accuracy decrease, annoying messages, slight vulnerability
- **Roleplay based** - do not add dumb high-value multipliers to values, **that is not how modifiers and armor should be used for.**
- Decrease natural healing factor during this period.
- *LME Suggestion:* motion sickness (running to far/much causes vomiting), sudden and short jitter, random drug cravings/addictions
- *LME Suggestion for annoying messages:* Sudden Itches(maybe similar to infections), Unease, Phantom-Pain
## What does this all mean?
- Things like fistfights become really awful at killing people - though too much "minor" bruising can obviously stack to produce broken bones, internal bleeds, etc. You'll still quickly start to be incapcitated as the fight progresses.
- Blunt weapons/unarmed will kill through severe wounds and organ damage.
- Bladed will generally kill you through bloodloss. A single stab is not much, a few stabs will need you to limp away and be life threatening without bandages or improvised treatment (Hey, just like it s right now!), getting seriously cut will make you bleed out in a minute or two if you can't stop the bleeding through any means.
- Chemical poisoning, radiation, etc, start becoming delayed killers - they're less immediately obnoxious, and more obnoxious after a little bit.
- You don't have to tend wounds bodies for half an hour to revert 30000 burn from falling in lava!
- That's because if that happens, their body probably will have incinerated already and they'll need proper sleeving.
- It's harder to kill someone quickly unless you're deliberately trying to kill them. A few stabs aren't necessarily a game ender as long as they improvise it quick, beating someone up won't make them stay at 30% health at 10% speed for the rest of the round until they find a bandage. **Trying** to intentionally kill someone with a high damage weapon will be just as lethal as before.
- This coincidentally makes mob combat, which usually is done by players cheesing the system with healing medicines/whatever, more lethal (or at least, more dangerous - mercs are lethal due to bullets having high wounds, other mobs probably not so much, stuff that does blunt force trauma probably won't be even as strong as they are now due to the lack of pure-RNG internal bleeding!).
- Good! Why the hell are we relying on mobspam to give our roleplay server conflict??
- This also makes people easier to keep alive/revive, just harder to rush to full health again.
- Wow, this really is baymed with blackjack and hookers.
## Non-maintainer notes section
Feel free to put ideas down here as ### YOURNAME - Idea title.