From 06d7c08ab1c4e5b96c4ef3f42bb2fc859aff46aa Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Sun, 16 Jun 2024 10:54:04 -0400 Subject: [PATCH 1/4] 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 ---

: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 a0feab7052c..9f0728aa9a3 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 00000000000..983fb987d63 --- /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 39aa0ab8dea..8deb9d10867 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/moth.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/moth.yml @@ -51,9 +51,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: From f75a46fb8fa7cf86ec69c450e8d55ab9772ce6c0 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Sun, 16 Jun 2024 11:00:22 -0400 Subject: [PATCH 2/4] Update moth.yml --- Resources/Prototypes/Entities/Mobs/Species/moth.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/Entities/Mobs/Species/moth.yml b/Resources/Prototypes/Entities/Mobs/Species/moth.yml index 8deb9d10867..5959c497186 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/moth.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/moth.yml @@ -51,7 +51,7 @@ Female: UnisexMoth Unsexed: UnisexMoth - type: MovementSpeedModifier - weightlessAcceleration: 2.5 # Move around more easily in space. # Parkstation-FrictionlessSpace + weightlessAcceleration: 2.5 # Move around more easily in space. - type: Flammable damage: types: From 0791a3b8722d00b026eb590ef2facc3758b9de58 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Sun, 16 Jun 2024 17:56:46 -0400 Subject: [PATCH 3/4] Update Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Signed-off-by: VMSolidus --- .../Movement/Components/MovementSpeedModifierComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs b/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs index 9f0728aa9a3..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 = 0f; // Parkstation-FrictionlessSpace + public const float DefaultWeightlessFrictionNoInput = 0f; public const float DefaultWeightlessModifier = 0.7f; public const float DefaultWeightlessAcceleration = 1f; From 5fffcef278ee74ab7673b5b76c4582c01f149527 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Sun, 16 Jun 2024 17:59:52 -0400 Subject: [PATCH 4/4] respace friction remover system --- .../{SimpleStation14 => }/Physics/FrictionRemoverSystem.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename Content.Shared/{SimpleStation14 => }/Physics/FrictionRemoverSystem.cs (76%) diff --git a/Content.Shared/SimpleStation14/Physics/FrictionRemoverSystem.cs b/Content.Shared/Physics/FrictionRemoverSystem.cs similarity index 76% rename from Content.Shared/SimpleStation14/Physics/FrictionRemoverSystem.cs rename to Content.Shared/Physics/FrictionRemoverSystem.cs index 983fb987d63..65bbe9e4d23 100644 --- a/Content.Shared/SimpleStation14/Physics/FrictionRemoverSystem.cs +++ b/Content.Shared/Physics/FrictionRemoverSystem.cs @@ -2,7 +2,7 @@ using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; -namespace Content.Shared.SimpleStation14.Physics; +namespace Content.Shared.Physics; public sealed class FrictionRemoverSystem : EntitySystem { @@ -19,7 +19,7 @@ public override void Initialize() private void RemoveDampening(EntityUid uid, PhysicsComponent component, PhysicsSleepEvent args) { - _physics.SetAngularDamping(component, 0, false); - _physics.SetLinearDamping(component, 0); + _physics.SetAngularDamping(uid, component, 0f, false); + _physics.SetLinearDamping(uid, component, 0f); } }