From d34f64b4a7b59c3e9f0675c01da57dd29294d6b1 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Mon, 17 Jun 2024 03:58:34 -0400 Subject: [PATCH] Port Frictionless Space (#464) # Description This ports https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/pull/46. This PR is something I consider a key feature adjacent to Space Wind Rework and its accompanying updates, and is an essential part of the space station experience. In practice, this weirdly enough makes being launched into space a bit easier to survive, since instead of needing to throw potentially hundreds of items, you can simply throw enough items to get started flying in the direction of the station and will eventually float back to the station. ---

Media

https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/5570ef35-16e2-493a-ac35-738f27751346 https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/51fba943-8dce-4265-a9cc-7181155eb8de https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/cd6c0511-2639-4e14-8160-426ba7f2ba73 ---

# Changelog :cl: DEATHB4DEFEAT - tweak: Space has suddenly become less dense (objects don't slow down in space) - remove: Moths are unable to move in space - tweak: Moths have way better control in zero gravity environments --------- Signed-off-by: VMSolidus Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> --- .../MovementSpeedModifierComponent.cs | 2 +- .../Physics/FrictionRemoverSystem.cs | 25 +++++++++++++++++++ .../Prototypes/Entities/Mobs/Species/moth.yml | 4 +-- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 Content.Shared/Physics/FrictionRemoverSystem.cs diff --git a/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs b/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs index a0feab7052c..813a18f974c 100644 --- a/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs +++ b/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs @@ -14,7 +14,7 @@ public sealed partial class MovementSpeedModifierComponent : Component // Weightless public const float DefaultMinimumFrictionSpeed = 0.005f; public const float DefaultWeightlessFriction = 1f; - public const float DefaultWeightlessFrictionNoInput = 0.2f; + public const float DefaultWeightlessFrictionNoInput = 0f; public const float DefaultWeightlessModifier = 0.7f; public const float DefaultWeightlessAcceleration = 1f; diff --git a/Content.Shared/Physics/FrictionRemoverSystem.cs b/Content.Shared/Physics/FrictionRemoverSystem.cs new file mode 100644 index 00000000000..65bbe9e4d23 --- /dev/null +++ b/Content.Shared/Physics/FrictionRemoverSystem.cs @@ -0,0 +1,25 @@ +using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; +using Robust.Shared.Physics.Systems; + +namespace Content.Shared.Physics; + +public sealed class FrictionRemoverSystem : EntitySystem +{ + [Dependency] private readonly SharedPhysicsSystem _physics = default!; + + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(RemoveDampening); + } + + + private void RemoveDampening(EntityUid uid, PhysicsComponent component, PhysicsSleepEvent args) + { + _physics.SetAngularDamping(uid, component, 0f, false); + _physics.SetLinearDamping(uid, component, 0f); + } +} diff --git a/Resources/Prototypes/Entities/Mobs/Species/moth.yml b/Resources/Prototypes/Entities/Mobs/Species/moth.yml index 1680dd6cda6..df7fad06dd2 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/moth.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/moth.yml @@ -44,9 +44,7 @@ Female: UnisexMoth Unsexed: UnisexMoth - type: MovementSpeedModifier - weightlessAcceleration: 1.5 # Move around more easily in space. - weightlessFriction: 1 - weightlessModifier: 1 + weightlessAcceleration: 2.5 # Move around more easily in space. - type: Flammable damage: types: