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

Space Dampening and Salvager Docking #1298

Closed
wants to merge 15 commits into from
1 change: 0 additions & 1 deletion Content.Client/Shuttles/UI/NavScreen.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
Text="{controls:Loc 'shuttle-console-dock-toggle'}"
TextAlign="Center"
ToggleMode="True"/>

<!-- Frontier - IFF search -->
<controls:BoxContainer Orientation="Vertical" HorizontalExpand="True" Name="IffSearchBox">
<controls:Label Text="{controls:Loc 'shuttle-console-iff-search'}"></controls:Label>
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Shuttles/Components/ShuttleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public sealed partial class ShuttleComponent : Component
/// Damping applied to the shuttle's physics component when not in FTL.
/// </summary>
[DataField("linearDamping"), ViewVariables(VVAccess.ReadWrite)]
public float LinearDamping = 0.05f;
public float LinearDamping = 0.005f; // Frontier PR 1298 0.005f < 0.05f

[DataField("angularDamping"), ViewVariables(VVAccess.ReadWrite)]
public float AngularDamping = 0.05f;
public float AngularDamping = 0.6f; // Frontier PR 1298 0.6f < 0.05f
}
}
8 changes: 7 additions & 1 deletion Content.Server/Shuttles/Systems/DockingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
using Content.Shared.Shuttles.Components;
using Content.Shared.Shuttles.Events;
using Content.Shared.Shuttles.Systems;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events;
using Content.Server.Shuttles.Systems;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
Expand Down Expand Up @@ -176,8 +179,11 @@ private void OnStartup(Entity<DockingComponent> entity, ref ComponentStartup arg
}
}

private void OnAnchorChange(Entity<DockingComponent> entity, ref AnchorStateChangedEvent args)
public void OnAnchorChange(Entity<DockingComponent> entity, ref AnchorStateChangedEvent args)
{

_console.RefreshShuttleConsoles(); // frontier

if (!args.Anchored)
{
Undock(entity);
Expand Down
9 changes: 8 additions & 1 deletion Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly ShuttleSystem _shuttle = default!;
[Dependency] private readonly DockingSystem _docking = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly TagSystem _tags = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
Expand All @@ -46,7 +47,7 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
private EntityQuery<TransformComponent> _xformQuery;

private readonly HashSet<Entity<ShuttleConsoleComponent>> _consoles = new();

private readonly HashSet<Entity<DockingComponent>> _docks = new();
public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -83,6 +84,7 @@ public override void Initialize()
SubscribeLocalEvent<ShuttleConsoleComponent, EmpPulseEvent>(OnEmpPulse);
SubscribeLocalEvent<ShuttleConsoleComponent, ToolUseAttemptEvent>(OnToolUseAttempt);


InitializeFTL();
}

Expand All @@ -101,6 +103,11 @@ private void OnDock(DockEvent ev)
RefreshShuttleConsoles();
}

private void OnDockAnchorChange(Entity<DockingComponent> entity, ref AnchorStateChangedEvent args)
{
RefreshShuttleConsoles();
}

private void OnUndock(UndockEvent ev)
{
RefreshShuttleConsoles();
Expand Down
2 changes: 2 additions & 0 deletions Content.Shared/Doors/Components/DoorComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,11 @@ private float? SecondsUntilStateChange
[DataField]
public bool ClickOpen = true;

[ViewVariables(VVAccess.ReadWrite)]
[DataField(customTypeSerializer: typeof(ConstantSerializer<DrawDepthTag>))]
public int OpenDrawDepth = (int) DrawDepth.DrawDepth.Doors;

[ViewVariables(VVAccess.ReadWrite)]
[DataField(customTypeSerializer: typeof(ConstantSerializer<DrawDepthTag>))]
public int ClosedDrawDepth = (int) DrawDepth.DrawDepth.Doors;
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Structures/Walls/walls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@
tags:
- Wall
- type: Physics
bodyType: Static
bodyType: Dynamic
- type: Fixtures
fixtures:
fix1:
Expand Down
3 changes: 3 additions & 0 deletions Resources/Prototypes/Entities/World/Debris/asteroids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
abstract: true
components:
- type: MapGrid
- type: Shuttle #frontier
linearDamping: 0.02
angulerDamping: 0.02
- type: BlobFloorPlanBuilder
floorTileset:
- FloorAsteroidSand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@
AirlockGlassFlatpack: 20
AirlockShuttleFlatpack: 20
AirlockGlassShuttleFlatpack: 20
IronMassFlatpack: 50
DockingMagnetFlatpack: 50
emaggedInventory:
HoverbikeFlatpack: 1
29 changes: 29 additions & 0 deletions Resources/Prototypes/_NF/Entities/Objects/Devices/flatpacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,24 @@
- type: Flatpack
entity: AirlockGlassShuttle

- type: entity
parent: AirlockFlatpack
id: DockingMagnetFlatpack
name: docking magnet flatpack
description: A flatpack used for constructing a docking magnet.
components:
- type: Flatpack
entity: AirlockDockingMagnet

- type: entity
parent: AirlockFlatpack
id: IronMassFlatpack
name: iron mass flatpack
description: A flatpack used for constructing an iron mass, used to connect to a docking magnet.
components:
- type: Flatpack
entity: AirlockIronMass

# Musical instruments
- type: entity
parent: BaseNFFlatpack
Expand Down Expand Up @@ -631,3 +649,14 @@
entity: VehicleHoverbikeNfsdKey
- type: StaticPrice
price: 750

- type: entity
parent: HoverbikeFlatpack
id: HoverbikeSyndicateFlatpack
name: syndicate hoverbike flatpack
description: A flatpack used for constructing a hoverbike. Keys already slotted in the ignition.
components:
- type: Flatpack
entity: VehicleHoverbikeSyndicateKey
- type: StaticPrice
price: 750
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,39 @@
components:
- type: PriorityDock
tag: DockTransit

- type: entity
id: AirlockDockingMagnet #frontier
parent: AirlockShuttle
name: docking magnet
description: Necessary for connecting a spacecraft to salvage or asteroids. It can be spun while unanchored.
components:
- type: Docking
- type: Anchorable
- type: Rotatable
rotateWhileAnchored: false
- type: Transform
anchored: true
- type: Weldable
isWelded: true
time: 10000000
- type: Occluder
enabled: false
- type: Door
clickOpen: false
bumpOpen: false
occludes: false
openDrawDepth: -2
- type: Sprite
sprite: _NF/Structures/Doors/Airlocks/Glass/magnet.rsi
snapCardinals: false

- type: entity
id: AirlockIronMass
name: iron mass
parent: AirlockDockingMagnet
description: A hunk of iron meant to be bolted down and attached to a docking magnet. It can be spun while unanchored.
components:
- type: Sprite
sprite: _NF/Structures/Doors/Airlocks/Glass/ironmass.rsi
snapCardinals: false
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from CEV-Eris at commit https://github.com/discordia-space/CEV-Eris/commit/14517938186858388656a6aee14bf47af9e9649f - then modified by 20kdc & AJCM-git, glass by Peptide90",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "assembly"
},
{
"name": "bolted_unlit"
},
{
"name": "closed"
},
{
"name": "closed_unlit"
},
{
"name": "closing",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "closing_unlit",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "deny_unlit",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "open"
},
{
"name": "opening",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "opening_unlit",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "panel_closing",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "panel_open"
},
{
"name": "panel_opening",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "welded"
},
{
"name": "emergency_unlit",
"delays": [
[
0.4,
0.4
]
]
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading