-
Notifications
You must be signed in to change notification settings - Fork 190
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
"Proper" "Softcrit" "Support" #1545
base: master
Are you sure you want to change the base?
Conversation
(cherry picked from commit 05759d916d03e77b4240e92b547e507e611d7258) # Conflicts: # Content.Client/Overlays/EntityHealthBarOverlay.cs # Content.Server/FootPrint/FootPrintsSystem.cs # Content.Shared/Mobs/Components/MobStateComponent.cs # Content.Shared/Mobs/MobState.cs # Content.Shared/Mobs/Systems/MobStateSystem.Subscribers.cs # Content.Shared/Mobs/Systems/MobStateSystem.cs # Content.Shared/Shadowkin/SharedEtherealSystem.cs
# Conflicts: # Content.Server/Traits/TraitSystem.Functions.cs # Content.Shared/Mobs/Components/MobStateComponent.cs # Content.Shared/Mobs/Systems/MobStateSystem.Subscribers.cs
(cherry picked from commit e2f31775ce29c14dca7c622f183bc21ec57fa6db)
(cherry picked from commit 289a0ee00c071cbf1841120f70e08771badfcee4)
(cherry picked from commit 4bd639d70be6d69067d1e07dba4ec2fac09c0e28) # Conflicts: # Content.Client/Overlays/EntityHealthBarOverlay.cs # Content.Shared/Standing/SharedLayingDownSystem.cs
i probably should use ProtoId more, huh |
huh?? didnt we already have this??? |
now that i am reading this a day later, I can confidently say this PR is borderline incomprehensible |
What the fuck happened here? |
lack of QA |
Nothing in SS14 has Quality Assurance, my friend |
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.
Technical details
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, useInitMobStateParams
inMobStateComponent
.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.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 statepublic Dictionary<MobState, MobStateParametersOverride> MobStateParamsOverrides
for storing overrides.MobStateParametersOverride
is a struct which mirrors allMobStateParametersPrototype
'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.TraitModifyMobState now has:
public Dictionary<string, string> Params
to specify a new prototype to use.MobStateParametersPrototype
are nullable, which is a hack to supportTraitModifyMobState
. This trait takes oneMobStateParametersPrototype
per mobstate and applies all of its non-null values. This way, a params prototype can be created which will only havepointing: 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)MobStateSystem now has:
TODO
I am left dead inside after working on this because 80% of work was either writing boilerplate, replacing boilerplate with other boilerplate or fixing boilerplate that i broke with the cherrypick while moving softcrits to EE. Hence, this is a draft PR.
MobStateSystem.IsIncapacitated()
.Previous
IsIncapacitated()
implementation simply checked if person was in crit or dead. Now there is aIsIncapacitated
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.ForceDown
is true butPickingUp
is also true.IsIncapacitated
though: I kinda don't want to, at least for now.No media
:p
Changelog
🆑