forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update metastation & add new roundstart dock component for shuttles
- Loading branch information
Showing
9 changed files
with
2,369 additions
and
824 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
Content.Server/Starshine/Shuttles/Components/StationShuttleDockComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Content.Server.Starshine.Shuttles.Systems; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Server.Starshine.Shuttles.Components; | ||
|
||
[RegisterComponent, Access(typeof(StationShuttleDock))] | ||
public sealed partial class StationShuttleDockComponent : Component | ||
{ | ||
[DataField] | ||
public EntityUid Shuttle; | ||
|
||
[DataField(required: true)] | ||
public string TargetTag; | ||
|
||
[DataField(required: true)] | ||
public ResPath Path; | ||
} |
69 changes: 69 additions & 0 deletions
69
Content.Server/Starshine/Shuttles/Systems/StationShuttleDockSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using Content.Server.Shuttles.Components; | ||
using Content.Server.Shuttles.Systems; | ||
using Content.Server.Starshine.Shuttles.Components; | ||
using Content.Server.Station.Components; | ||
using Content.Server.Station.Events; | ||
using Robust.Server.GameObjects; | ||
using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent; | ||
|
||
namespace Content.Server.Starshine.Shuttles.Systems; | ||
|
||
/// <summary> | ||
/// If enabled spawns players on a separate arrivals station before they can transfer to the main station. | ||
/// </summary> | ||
public sealed class StationShuttleDock : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedMapSystem _mapSystem = default!; | ||
[Dependency] private readonly MapLoaderSystem _loader = default!; | ||
[Dependency] private readonly ShuttleSystem _shuttles = default!; | ||
|
||
/// <summary> | ||
/// The first arrival is a little early, to save everyone 10s | ||
/// </summary> | ||
private const float RoundStartFTLDuration = 10f; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<StationShuttleDockComponent, StationPostInitEvent>(OnStationPostInit); | ||
} | ||
|
||
private bool TryGetStation(out EntityUid uid) | ||
{ | ||
var stationsQuery = EntityQueryEnumerator<BecomesStationComponent>(); | ||
|
||
while (stationsQuery.MoveNext(out uid, out _)) | ||
{ | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
private void OnStationPostInit(EntityUid uid, StationShuttleDockComponent component, ref StationPostInitEvent args) | ||
{ | ||
SetupShuttle(uid, component); | ||
} | ||
|
||
private void SetupShuttle(EntityUid uid, StationShuttleDockComponent component) | ||
{ | ||
if (!Deleted(component.Shuttle)) | ||
return; | ||
|
||
// Spawn shuttle on a dummy map then dock it to the source. | ||
var dummpMapEntity = _mapSystem.CreateMap(out var dummyMapId); | ||
|
||
if (TryGetStation(out var station) && | ||
_loader.TryLoad(dummyMapId, component.Path.ToString(), out var shuttleUids)) | ||
{ | ||
component.Shuttle = shuttleUids[0]; | ||
var shuttleComp = Comp<ShuttleComponent>(component.Shuttle); | ||
_shuttles.FTLToDock(component.Shuttle, shuttleComp, station, hyperspaceTime: RoundStartFTLDuration, priorityTag: component.TargetTag); | ||
} | ||
|
||
// Don't start the arrivals shuttle immediately docked so power has a time to stabilise? | ||
var timer = AddComp<TimedDespawnComponent>(dummpMapEntity); | ||
timer.Lifetime = 15f; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Resources/Locale/ru-RU/starshine/ss14-ru/entities/structures/access.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ent-AirlockExternalGlassShuttlePilot = { ent-AirlockGlassShuttle } | ||
.suffix = Внешний, Пилот, Шаттл, Стеклянный, Стыковочный | ||
.desc = { ent-AirlockGlassShuttle.desc } | ||
ent-AirlockExternalGlassShuttleSalvage = { ent-AirlockGlassShuttle } | ||
.suffix = Внешний, Утилизатор, Шаттл, Стеклянный, Стыковочный | ||
.desc = { ent-AirlockGlassShuttle.desc } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ | |
- Bank | ||
- Zoo | ||
- MiningOutpost | ||
- Tesla | ||
- Tesla |
18 changes: 18 additions & 0 deletions
18
Resources/Prototypes/Starshine/Entities/Structures/Doors/Airlocks/access.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
- type: entity | ||
parent: AirlockGlassShuttle | ||
id: AirlockExternalGlassShuttlePilot | ||
suffix: External, Shuttle Pilot, Glass, Docking | ||
components: | ||
- type: GridFill | ||
path: /Maps/Shuttles/ferryman.yml | ||
|
||
- type: entity | ||
parent: AirlockGlassShuttle | ||
id: AirlockExternalGlassShuttleSalvage | ||
suffix: Salvage, Glass, Docking | ||
components: | ||
- type: PriorityDock | ||
tag: SalvageShuttle | ||
- type: ContainerFill | ||
containers: | ||
board: [ DoorElectronicsSalvage ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,9 @@ | |
- type: Tag | ||
id: PlushieSharkBlack | ||
|
||
- type: Tag | ||
id: SalvageShuttle | ||
|
||
- type: Tag | ||
id: Slime | ||
|
||
|