From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Tue, 19 Aug 2025 19:18:05 +0000 (-0700) Subject: Crawling Fixes Part 4: Can't crawl when weightless. (#39099) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=da23bc9dcc0965b59d3ec8152c3f134952164a3d;p=space-station-14.git Crawling Fixes Part 4: Can't crawl when weightless. (#39099) * Init Commit * Typos * Commit 2 * Save Interaction Test Mob from failing * ssss * Confident I've gotten all the correct prototypes * Whoops forgot to edit those * aaaaa * Better solution * Test fail fixes * Yaml fix * THE FINAL TEST FIX * Final fix(?) * whoops * Added a WeightlessnessChangedEvent * Check out this diff * Wait I'm dumb * Final optimization and don't duplicate code * Death to IsWeightless * Moth directed targeted attack * A * Bugfixes and such * Grrr * Death * Cleanup * Cleanup 2 --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- diff --git a/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs b/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs index 2257812da1..c1757b1c2d 100644 --- a/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs +++ b/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs @@ -22,7 +22,7 @@ internal sealed class StunOnCollideSystem : EntitySystem private void TryDoCollideStun(Entity ent, EntityUid target) { - _stunSystem.TryKnockdown(target, ent.Comp.KnockdownAmount, ent.Comp.Refresh, ent.Comp.AutoStand, ent.Comp.Drop); + _stunSystem.TryKnockdown(target, ent.Comp.KnockdownAmount, ent.Comp.Refresh, ent.Comp.AutoStand, ent.Comp.Drop, true); if (ent.Comp.Refresh) { diff --git a/Content.Shared/Stunnable/SharedStunSystem.Knockdown.cs b/Content.Shared/Stunnable/SharedStunSystem.Knockdown.cs index 7917f10bd5..098e3176d9 100644 --- a/Content.Shared/Stunnable/SharedStunSystem.Knockdown.cs +++ b/Content.Shared/Stunnable/SharedStunSystem.Knockdown.cs @@ -4,6 +4,7 @@ using Content.Shared.Damage; using Content.Shared.Damage.Components; using Content.Shared.Database; using Content.Shared.DoAfter; +using Content.Shared.Gravity; using Content.Shared.Hands.EntitySystems; using Content.Shared.Input; using Content.Shared.Movement.Events; @@ -60,6 +61,9 @@ public abstract partial class SharedStunSystem // Crawling SubscribeLocalEvent(OnKnockdownRefresh); SubscribeLocalEvent(OnDamaged); + SubscribeLocalEvent(OnWeightlessnessChanged); + SubscribeLocalEvent(OnKnockdownAttempt); + SubscribeLocalEvent(OnGetStandUpTime); // Handling Alternative Inputs SubscribeAllEvent(OnForceStandup); @@ -488,6 +492,32 @@ public abstract partial class SharedStunSystem args.SpeedModifier *= entity.Comp.SpeedModifier; } + private void OnWeightlessnessChanged(Entity entity, ref WeightlessnessChangedEvent args) + { + // I probably don't need this check since weightless -> non-weightless you shouldn't be knocked down + // But you never know. + if (!args.Weightless) + return; + + // Targeted moth attack + CancelKnockdownDoAfter((entity, entity.Comp)); + RemComp(entity); + } + + private void OnKnockdownAttempt(Entity entity, ref KnockDownAttemptEvent args) + { + // Directed, targeted moth attack. + if (entity.Comp.Weightless) + args.Cancelled = true; + } + + private void OnGetStandUpTime(Entity entity, ref GetStandUpTimeEvent args) + { + // Get up instantly if weightless + if (entity.Comp.Weightless) + args.DoAfterTime = TimeSpan.Zero; + } + #endregion #region Action Blockers