-
Notifications
You must be signed in to change notification settings - Fork 195
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 |
377a449
to
5153336
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: RedFoxIV <38788538+RedFoxIV@users.noreply.github.com>
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
# Conflicts: # Content.Shared/CCVar/CCVars.cs
It's as ready as I will ever get it to be without someone else looking at it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holy shit this PR is amazing.
current.MergeWith(mod); | ||
//current.FillDefaults(); | ||
} | ||
comp.Dirty(); // why is this deprecated? it's much better than manually resolving entitymanager with ioc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comp.Dirty(); // why is this deprecated? it's much better than manually resolving entitymanager with ioc | |
comp.Dirty(); // why is this deprecated? it's much better than manually resolving entitymanager with ioc |
It's deprecated because it's been replaced with Dirty(uid, comp); instead of Dirty(comp). I think you might be able to get around the deprecated warning by doing comp.Dirty(uid);. The reason for the deprecation is because you're supposed to only dirty one component at a time, and if you dirty just the component, the system now has to dirty all of that component, so it needs UID + Component.
However we now have as an engine option, the ability to dirty individual datafields in components, feel free to take a look at that if you wish!
if (AllowHandInteractWhileDead is not null) | ||
mobStateComponent.AllowHandInteractWhileDead = AllowHandInteractWhileDead.Value; | ||
foreach (var pair in Params) { | ||
DebugTools.Assert(_reflection.TryParseEnumReference($"enum.MobState.{pair.Key}", out var e), $"MobState.{pair.Key} does not exist."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DebugTools.Assert(_reflection.TryParseEnumReference($"enum.MobState.{pair.Key}", out var e), $"MobState.{pair.Key} does not exist."); | |
DebugTools.Assert(_reflection.TryParseEnumReference($"enum.MobState.{pair.Key}", out var e), $"MobState.{pair.Key} does not exist."); |
You're not allowed to use e as a variable here because it straight up won't exist in Release configuration. Separate out TryParseEnumReference into an If Not {Assert; Continue;} statement to clear the error
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public bool CanEquipOther(MobState? State = null) => GetOverride(State).CanEquipOther ?? GetParams(State)?.CanEquipOther ?? false; | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public bool CanUnequipOther(MobState? State = null) => GetOverride(State).CanUnequipOther ?? GetParams(State)?.CanUnequipOther ?? false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holy fuck this is amazing. I'm taking notes.
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
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.
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>`, 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.Technical details
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
done:
MobStateSystem.IsIncapacitated()
.done: some checks were changed, some left as they did what was (more or less) intended.
done: dropItemsOnEntering bool field. If true, will drop items upon entering linked mobstate.
ForceDown
is true butPickingUp
is also true.done: dropItemsOnEntering bool field. If true, will drop items upon entering linked mobstate.
done: whether or not mob is conscious. Renamed the bool field accordingly.
done:
BreathingMultiplier
float field added.done: it doesn't. Removed.
done: Requires Incapacitated parameter to be false to be able to use headset radio.
not done:
IsIncapacitated
though: I kinda don't want to, at least for now.No media
:p
Changelog
🆑