# Description
Implements the softcrit functionality.
Similiar to critical state but spessmen will be able to communicate and
crawl around, but not pick up items.
Also supports configuring what is and isn't allowed in different
MobStates (per mob prototype): you can enable picking up items while in
softcrit so people can pick up their lasgun and continue shooting after
taking a 40x46mm to their ass cheeks from the guest nukies while being
dragged to safety.

<details> <summary><h1>Technical details</h1></summary>
New prototype type: "mobStateParams" (`MobStateParametersPrototype`)
Used to specify what can and can't be done when in a certain mobstate.
Of note that they are not actually bound to any `MobState` by
themselves. To assign a params prototype to a mobstate, use
`InitMobStateParams` in `MobStateComponent`.
It has to be a prototype because if I just did something akin to
`Dictionary<MobState, Dictionary<string, bool>>`, you'd have to check
the parent and copy every flag besides the one you wish to modify. That
is, if I understand how the prototype system works correctly, which I
frankly doubt. <!-- Working on softcrit made me hate prototypes. -->
MobStateComponent now has:
- `Dictionary<string, string> InitMobStateParams`, for storing "mobstate
- parameter prototype" pairs. `<string, string>` because it has to be
editable via mob prototypes. Named "mobStateParams" for mob prototypes.
- `public Dictionary<MobState, MobStateParametersPrototype>
MobStateParams` for actually storing the params for each state
- `public Dictionary<MobState, MobStateParametersOverride>
MobStateParamsOverrides` for storing overrides.
`MobStateParametersOverride` is a struct which mirrors all
`MobStateParametersPrototype`'s fields, except they're all nullable.
This is meant for code which wants to temporarily override some setting,
like a spell which allows dead people to talk. This is not the best
solution, but it should do at first. A better option would be tracking
each change separately, instead of hoping different systems overriding
the same flag will play nicely with eachother.
- a shitton of getter methods
TraitModifyMobState now has:
- `public Dictionary<string, string> Params` to specify a new prototype
to use.
- Important note: All values of `MobStateParametersPrototype` are
nullable, which is a hack to support `TraitModifyMobState`. This trait
takes one `MobStateParametersPrototype` per mobstate and applies all of
its non-null values. This way, a params prototype can be created which
will only have `pointing: true` and the trait can apply it (e.g. to
critstate, so we can spam pointing while dying like it's a game of turbo
dota)
- The above is why that wall of getters exists: They check the relevant
override struct, then the relevant prototype. If both are null, they
default to false (0f for floats.) The only exception is
OxyDamageOverlay, because it's used both for oxy damage overlay (if
null) and as a vision-limiting black void in crit..
MobStateSystem now has:
- a bunch of new "IsSomething"/"CanDoSomething" methods to check the
various flags, alongside rewritten old ones.
-

lookin ahh predicate factory
</details>
---
# TODO
done:
- [x] Make proper use of `MobStateSystem.IsIncapacitated()`.
done: some checks were changed, some left as they did what was (more or
less) intended.
<details>Previous `IsIncapacitated()` implementation simply checked if
person was in crit or dead. Now there is a `IsIncapacitated` flag in the
parameters, but it's heavily underutilized. I may need some help on this
one, since I don't know where would be a good place to check for it and
I absolutely will not just scour the entire build in search for them.
</details>
- [x] Separate force-dropping items from being downed
done: dropItemsOnEntering bool field. If true, will drop items upon
entering linked mobstate.
- [x] Don't drop items if `ForceDown` is true but `PickingUp` is also
true.
done: dropItemsOnEntering bool field. If true, will drop items upon
entering linked mobstate.
- [x] Actually check what are "conscious attempts" are used for
done: whether or not mob is conscious. Renamed the bool field
accordingly.
- [x] Look into adding a way to make people choke "slowly" in softcrit
as opposed to choking at "regular speed" in crit. Make that into a param
option? Make that into a float so the speed can be finetuned?
done: `BreathingMultiplier` float field added.
<details>
1f is regular breathing, 0.25 is "quarter-breathing". Air taken is
multiplied by `BreathingMultiplier` and suffocation damage taken (that
is dealt by RespiratorSystem, not all oxy damage) is multiplied by
`1-BreathingMultiplier`.
</details>
- [x] make sure the serializer actually does its job
done: it doesn't. Removed.
- [x] Make an option to prohibit using radio headsets while in softcrit
done: Requires Incapacitated parameter to be false to be able to use
headset radio.
- [x] Make sure it at least compiles
not done:
- [ ] probably move some other stuff to Params if it makes sense. Same
thing as with `IsIncapacitated` though: I kinda don't want to, at least
for now.
---
<details><summary><h1>No media</h1></summary>
<p>
:p
</p>
</details>
---
# Changelog
🆑
- add: Soft critical state. Crawl to safety, or to your doom - whatever
is closer.
---------
Signed-off-by: RedFoxIV <38788538+RedFoxIV@users.noreply.github.com>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
(cherry picked from commit 9a357c1774f1a783844a07b5414f504ca574d84c)
## Mirror of PR #26222: [make romerol work on the
dead](https://github.com/space-wizards/space-station-14/pull/26222) from
<img src="https://avatars.githubusercontent.com/u/10567778?v=4"
alt="space-wizards" width="22"/>
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)
###### `87386ca0baa9fc3006b726d26723b345b737943d`
PR opened by <img
src="https://avatars.githubusercontent.com/u/45323883?v=4"
width="16"/><a href="https://github.com/Dutch-VanDerLinde">
Dutch-VanDerLinde</a> at 2024-03-18 03:07:02 UTC
---
PR changed 2 files with 10 additions and 3 deletions.
The PR had the following labels:
- Status: Needs Review
---
<details open="true"><summary><h1>Original Body</h1></summary>
> <!-- Please read these guidelines before opening your PR:
https://docs.spacestation14.io/en/getting-started/pr-guideline -->
> <!-- The text between the arrows are comments - they will not be
visible on your PR. -->
>
> ## About the PR
> title
>
> ## Why / Balance
> for zombie nukies it's bad because you have to have someone whose in
crit in order to efficiently infect them
>
> ## Technical details
> adds a new check if the entity is dead upon ``PendingZombie`` map
init, if it is then zombify
>
> ## Media
> <!--
> PRs which make ingame changes (adding clothing, items, new features,
etc) are required to have media attached that showcase the changes.
> Small fixes/refactors are exempt.
> Any media may be used in SS14 progress reports, with clear credit
given.
>
> If you're unsure whether your PR will require media, ask a maintainer.
>
> Check the box below to confirm that you have in fact seen this (put an
X in the brackets, like [X]):
> -->
>
> - [X] I have added screenshots/videos to this PR showcasing its
changes ingame, **or** this PR does not require an ingame showcase
>
> ## Breaking changes
> <!--
> List any breaking changes, including namespace, public
class/method/field changes, prototype renames; and provide instructions
for fixing them. This will be pasted in #codebase-changes.
> -->
>
> **Changelog**
>
> 🆑
> - tweak: Romerol now properly works on the dead.
</details>
Co-authored-by: SimpleStation14 <Unknown>
This reverts f391ff28 and implements an alternate messure where mice and other small animals can no longer infect people as zombies.
This is done through a component which if present cancels the check that would cause zombie components to be added on people that get infected due to a bite.
This still allows other special stuff that happens in that function that may affect already infected individuals.
This is a compromise between what's discussed in discord which would much rather see mice and other animals just die from the infection and people on github which would see no change happen.
Since bats can't go under doors it may not be necessary to make them non spreaders.
If someone disagrees please tell me to just add it back.
* zombie mode redux
* the great zombie changes
* fix this
* 65 down to 50
* empty
* Changes to address stalling
* make zombie nukies no longer nukies
* actually work
* Added component and functionality.
* Fixed ZombieImmune.
* Zombies now have zombie blood.
* Ambuzol plus.
* Ambuzol plus spawns in bundle.
* Fine CBURN get one too.
* Reworked the reaction
* No more magic blood refilling.
* ok CE i fixed it
* Component change.
* Nerf Space zombies, get DoT in space (barotrauma) and spawn stunned.
- Also discard any helmet or mask you might be wearing.
* Zombies have heal over time, infection far more fatal
- Stun time reduced to 2 seconds
* Zombification occurs after you die, rather than after you crit.
- Zombies cannot inflict Zombification DoT on other zombies.
* Heal shock damage, space zombies are back.
* Lower the chance of infection per hit
* Removed the stun, reduced zombification virus slightly
* Add AutoEmote comp/system
* Reduce groan chance so it's the same as before
Old code did 0.2 and then 0.5, now it's just one Prob(0.1)
* Fix typo, curTime var, don't log Resolve
* Maybe fix pausing?
* Fix mistake
* Update NextEmoteTime if an auto emote is removed
* Fix stuff
Get CurTime outside update loop
Use MapInit instead of ComponentInit
Fix a typo in a comment
Debug assert prototype ID in RemoveEmote
Do += PausedTime in OnUnpaused
Add prototype as arg to ResetTimer to avoid an indexing
* Fix dead mobs sneezing and coughing
* SneezeCough update
* Streamlined Event code, moved dead-check
* cleanup
* I can has merge?
* Shared event for SharedMobStateSystem