From 67103130cedb6240d0ba6755c4adec0863fcd648 Mon Sep 17 00:00:00 2001 From: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Date: Sat, 3 Feb 2024 21:49:01 -0800 Subject: [PATCH] Make Space Frictionless (#46)

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: - 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 --- .../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/SimpleStation14/Physics/FrictionRemoverSystem.cs diff --git a/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs b/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs index b84c340855..796611fc0a 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; // Parkstation-FrictionlessSpace public const float DefaultWeightlessModifier = 0.7f; public const float DefaultWeightlessAcceleration = 1f; diff --git a/Content.Shared/SimpleStation14/Physics/FrictionRemoverSystem.cs b/Content.Shared/SimpleStation14/Physics/FrictionRemoverSystem.cs new file mode 100644 index 0000000000..983fb987d6 --- /dev/null +++ b/Content.Shared/SimpleStation14/Physics/FrictionRemoverSystem.cs @@ -0,0 +1,25 @@ +using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; +using Robust.Shared.Physics.Systems; + +namespace Content.Shared.SimpleStation14.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(component, 0, false); + _physics.SetLinearDamping(component, 0); + } +} diff --git a/Resources/Prototypes/Entities/Mobs/Species/moth.yml b/Resources/Prototypes/Entities/Mobs/Species/moth.yml index 292828b4e6..5b067d89cb 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/moth.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/moth.yml @@ -48,9 +48,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. # Parkstation-FrictionlessSpace - type: Flammable damage: types: