Skip to content
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

Port Frictionless Space #464

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
25 changes: 25 additions & 0 deletions Content.Shared/Physics/FrictionRemoverSystem.cs
Original file line number Diff line number Diff line change
@@ -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<PhysicsComponent, PhysicsSleepEvent>(RemoveDampening);
}


private void RemoveDampening(EntityUid uid, PhysicsComponent component, PhysicsSleepEvent args)
{
_physics.SetAngularDamping(uid, component, 0f, false);
_physics.SetLinearDamping(uid, component, 0f);
}
}
4 changes: 1 addition & 3 deletions Resources/Prototypes/Entities/Mobs/Species/moth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- type: Flammable
damage:
types:
Expand Down
Loading