Gateway destinations (#21040)

* Gateway generation

* Gateway stuff

* gatewehs

* mercenaries

* play area

* Range fixes and tweaks

* weh

* Gateway UI polish

* Lots of fixes

* Knock some items off

* Fix dungeon spawning

Realistically we should probably be using a salvage job.

* wahwah

* wehvs

* expression

* weh

* eee

* a

* a

* WEH

* frfr

* Gatwey

* Fix gateway windows

* Fix gateway windows

* a

* a

* Better layer masking

* a

* a

* Noise fixes

* a

* Fix fractal calculations

* a

* More fixes

* Fixes

* Add layers back in

* Fixes

* namespaces and ftl

* Other TODO

* Fix distance

* Cleanup

* Fix test
This commit is contained in:
metalgearsloth
2023-11-15 13:23:40 +11:00
committed by GitHub
parent 67a3c3a6a3
commit 816ee2e1ab
51 changed files with 1562 additions and 959 deletions

View File

@@ -1,4 +1,5 @@
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Gateway;
@@ -26,7 +27,7 @@ public sealed class GatewayBoundUserInterfaceState : BoundUserInterfaceState
/// <summary>
/// List of enabled destinations and information about them.
/// </summary>
public readonly List<(NetEntity, string, TimeSpan, bool)> Destinations;
public readonly List<GatewayDestinationData> Destinations;
/// <summary>
/// Which destination it is currently linked to, if any.
@@ -34,25 +35,52 @@ public sealed class GatewayBoundUserInterfaceState : BoundUserInterfaceState
public readonly NetEntity? Current;
/// <summary>
/// Time the portal will close at.
/// Next time the portal is ready to be used.
/// </summary>
public readonly TimeSpan NextClose;
public readonly TimeSpan NextReady;
public readonly TimeSpan Cooldown;
/// <summary>
/// Time the portal last opened at.
/// Next time the destination generator unlocks another destination.
/// </summary>
public readonly TimeSpan LastOpen;
public readonly TimeSpan NextUnlock;
public GatewayBoundUserInterfaceState(List<(NetEntity, string, TimeSpan, bool)> destinations,
NetEntity? current, TimeSpan nextClose, TimeSpan lastOpen)
/// <summary>
/// How long an unlock takes.
/// </summary>
public readonly TimeSpan UnlockTime;
public GatewayBoundUserInterfaceState(List<GatewayDestinationData> destinations,
NetEntity? current, TimeSpan nextReady, TimeSpan cooldown, TimeSpan nextUnlock, TimeSpan unlockTime)
{
Destinations = destinations;
Current = current;
NextClose = nextClose;
LastOpen = lastOpen;
NextReady = nextReady;
Cooldown = cooldown;
NextUnlock = nextUnlock;
UnlockTime = unlockTime;
}
}
[Serializable, NetSerializable]
public record struct GatewayDestinationData
{
public NetEntity Entity;
public FormattedMessage Name;
/// <summary>
/// Is the portal currently open.
/// </summary>
public bool Portal;
/// <summary>
/// Is the map the gateway on locked or unlocked.
/// </summary>
public bool Locked;
}
[Serializable, NetSerializable]
public sealed class GatewayOpenPortalMessage : BoundUserInterfaceMessage
{

View File

@@ -0,0 +1,12 @@
using Robust.Shared.Serialization;
namespace Content.Shared.Gateway;
/// <summary>
/// Sent from client to server upon taking a gateway destination.
/// </summary>
[Serializable, NetSerializable]
public sealed class GatewayDestinationMessage : EntityEventArgs
{
public int Index;
}