diff --git a/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml.cs b/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml.cs
index 828b98868f..eb47ba9a87 100644
--- a/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml.cs
+++ b/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml.cs
@@ -106,31 +106,33 @@ private void UpdateFTL(List<(NetEntity Entity, string Destination, bool Enabled)
HyperspaceDestinations.DisposeAllChildren();
_destinations.Clear();
- if (destinations.Count == 0)
- {
- HyperspaceDestinations.AddChild(new Label()
- {
- Text = Loc.GetString("shuttle-console-hyperspace-none"),
- HorizontalAlignment = HAlignment.Center,
- });
- }
- else
- {
- destinations.Sort((x, y) => string.Compare(x.Destination, y.Destination, StringComparison.Ordinal));
-
- foreach (var destination in destinations)
- {
- var button = new Button()
- {
- Disabled = !destination.Enabled,
- Text = destination.Destination,
- };
-
- _destinations[button] = destination.Entity;
- button.OnPressed += OnHyperspacePressed;
- HyperspaceDestinations.AddChild(button);
- }
- }
+ // BEGIN EKRIXI MODIFICATION
+ // if (destinations.Count == 0)
+ // {
+ // HyperspaceDestinations.AddChild(new Label()
+ // {
+ // Text = Loc.GetString("shuttle-console-hyperspace-none"),
+ // HorizontalAlignment = HAlignment.Center,
+ // });
+ // }
+ // else
+ // {
+ // destinations.Sort((x, y) => string.Compare(x.Destination, y.Destination, StringComparison.Ordinal));
+ //
+ // foreach (var destination in destinations)
+ // {
+ // var button = new Button()
+ // {
+ // Disabled = !destination.Enabled,
+ // Text = destination.Destination,
+ // };
+ //
+ // _destinations[button] = destination.Entity;
+ // button.OnPressed += OnHyperspacePressed;
+ // HyperspaceDestinations.AddChild(button);
+ // }
+ // }
+ // END EKRIXI MODIFICATION
string stateText;
diff --git a/Content.Client/_FTL/FtlPoints/StarmapConsole.xaml b/Content.Client/_FTL/FtlPoints/StarmapConsole.xaml
new file mode 100644
index 0000000000..f95fd07c67
--- /dev/null
+++ b/Content.Client/_FTL/FtlPoints/StarmapConsole.xaml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Content.Client/_FTL/FtlPoints/StarmapConsole.xaml.cs b/Content.Client/_FTL/FtlPoints/StarmapConsole.xaml.cs
new file mode 100644
index 0000000000..a84efa5cce
--- /dev/null
+++ b/Content.Client/_FTL/FtlPoints/StarmapConsole.xaml.cs
@@ -0,0 +1,55 @@
+using System.Numerics;
+using Content.Client.UserInterface.Controls;
+using Content.Shared._FTL.FtlPoints;
+using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.XAML;
+using Robust.Shared.Prototypes;
+
+namespace Content.Client._FTL.FtlPoints;
+
+[GenerateTypedNameReferences]
+public sealed partial class StarmapConsole : FancyWindow
+{
+ private readonly StarmapConsoleBoundUserInterface _owner;
+ private Star? _hoveredStar = null;
+
+ public StarmapConsole(StarmapConsoleBoundUserInterface owner, IPrototypeManager protoManager)
+ {
+ RobustXamlLoader.Load(this);
+ IoCManager.InjectDependencies(this);
+
+ _owner = owner;
+
+ Title = Loc.GetString("starmap-computer-title");
+ Stars.OnStarSelect += StarsOnOnStarSelect;
+ StarWarpButton.OnPressed += args =>
+ {
+ if (_hoveredStar.HasValue)
+ {
+ _owner.StarWarpButtonOnOnPressed(_hoveredStar.Value);
+ }
+ };
+ }
+
+ private void StarsOnOnStarSelect(Star obj)
+ {
+ StarName.Text = obj.Name;
+ StarCoordinates.Text = Loc.GetString("starmap-star-details-position", ("x", MathF.Round(obj.GlobalPosition.X, 1)), ("y", MathF.Round(obj.GlobalPosition.Y, 1)));
+ StarWarpButton.Disabled = false;
+ _hoveredStar = obj;
+ }
+
+ public void UpdateState(StarmapConsoleBoundUserInterfaceState state)
+ {
+ UpdateStars(state.Stars);
+ Stars.Range = state.Range;
+ var currentStar = state.Stars.Find(star => star.Position == Vector2.Zero);
+ CurrentStarName.Text = currentStar.Name;
+ }
+
+ private void UpdateStars(List stars)
+ {
+ Stars.SetStars(stars);
+ }
+}
diff --git a/Content.Client/_FTL/FtlPoints/StarmapConsoleBoundUserInterface.cs b/Content.Client/_FTL/FtlPoints/StarmapConsoleBoundUserInterface.cs
new file mode 100644
index 0000000000..b8b9fd6942
--- /dev/null
+++ b/Content.Client/_FTL/FtlPoints/StarmapConsoleBoundUserInterface.cs
@@ -0,0 +1,50 @@
+using Content.Shared._FTL.FtlPoints;
+using Robust.Shared.Prototypes;
+using JetBrains.Annotations;
+using Robust.Client.UserInterface.Controls;
+
+namespace Content.Client._FTL.FtlPoints;
+
+[UsedImplicitly]
+public sealed class StarmapConsoleBoundUserInterface : BoundUserInterface
+{
+ private StarmapConsole? _window;
+
+ public StarmapConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) {}
+
+ protected override void Open()
+ {
+ base.Open();
+ var collection = IoCManager.Instance;
+
+ if (collection == null)
+ return;
+
+ _window = new StarmapConsole(this, IoCManager.Resolve());
+ _window.OnClose += Close;
+
+ _window.OpenCentered();
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ base.Dispose(disposing);
+ if (disposing)
+ {
+ _window?.Dispose();
+ }
+ }
+
+ public void StarWarpButtonOnOnPressed(Star star)
+ {
+ var message = new WarpToStarMessage(star);
+ SendMessage(message);
+ }
+
+ protected override void UpdateState(BoundUserInterfaceState state)
+ {
+ base.UpdateState(state);
+ var castState = (StarmapConsoleBoundUserInterfaceState) state;
+ _window?.UpdateState(castState);
+ }
+}
diff --git a/Content.Client/_FTL/FtlPoints/StarmapControl.cs b/Content.Client/_FTL/FtlPoints/StarmapControl.cs
new file mode 100644
index 0000000000..56f7fb7151
--- /dev/null
+++ b/Content.Client/_FTL/FtlPoints/StarmapControl.cs
@@ -0,0 +1,127 @@
+using System.Numerics;
+using Content.Shared._FTL.FtlPoints;
+using Content.Shared.Input;
+using Robust.Client.Graphics;
+using Robust.Client.Input;
+using Robust.Client.ResourceManagement;
+using Robust.Client.UserInterface;
+using Robust.Shared.Input;
+using YamlDotNet.Core.Tokens;
+
+namespace Content.Client._FTL.FtlPoints;
+
+public sealed class StarmapControl : Control
+{
+ [Dependency] private readonly IInputManager _inputManager = default!;
+
+ public float Range = 1f;
+
+ private List _stars = new List();
+ private const float Ppd = 15f;
+
+ private readonly Font _font;
+ private bool _mouseDown = false;
+
+ public event Action? OnStarSelect;
+
+ public StarmapControl()
+ {
+ IoCManager.InjectDependencies(this);
+
+ var cache = IoCManager.Resolve();
+ _font = new VectorFont(cache.GetResource("/Fonts/IBMPlexMono/IBMPlexMono-Regular.ttf"), 8);
+ }
+
+ public void SetStars(List stars)
+ {
+ _stars = stars;
+ }
+
+ private Vector2 CalculateOffset()
+ {
+ return Size / 2;
+ }
+
+ private Vector2 GetMouseCoordinates()
+ {
+ return _inputManager.MouseScreenPosition.Position;
+ }
+
+ private Vector2 GetPositionOfStar(Vector2 position)
+ {
+ return CalculateOffset() + (position * Ppd);
+ }
+
+ protected override void Draw(DrawingHandleScreen handle)
+ {
+ base.Draw(handle);
+ handle.DrawRect(new UIBox2(Vector2.Zero, Size), Color.Black);
+
+ // Draw lines in a grid
+ var lines = 10;
+
+ for (var i = 0; i < lines; i++)
+ {
+ var xStep = Size.X / lines;
+ var yStep = Size.X / lines;
+ handle.DrawLine(new Vector2(i * xStep, 0), new Vector2(i * xStep, Size.Y), Color.DarkSlateGray);
+ handle.DrawLine(new Vector2(0, i * yStep), new Vector2(Size.X, i * yStep), Color.DarkSlateGray);
+ }
+
+ // Draw warp range
+ handle.DrawCircle(GetPositionOfStar(Vector2.Zero), Range * Ppd, Color.White, false);
+ handle.DrawCircle(GetPositionOfStar(Vector2.Zero), Range * Ppd, new Color(47, 79, 79, 127));
+
+ // Draw sensor range
+ handle.DrawCircle(GetPositionOfStar(Vector2.Zero), (int) (Range * 1.5) * Ppd, Color.Blue, false);
+
+ foreach (var star in _stars)
+ {
+ var uiPosition = GetPositionOfStar(star.Position);
+ var globalPosition = GlobalPosition + uiPosition;
+ var radius = 5f;
+
+ // check if distance is smaller than radius of circle then BOOm
+ var hovered = Vector2.Distance(GetMouseCoordinates(), globalPosition) <= radius * 1.5;
+
+ var color = Color.White;
+ var name = star.Name;
+
+ // out of warp range
+ if (Vector2.Distance(Vector2.Zero, star.Position) >= Range)
+ color = Color.Red;
+
+ // out of scanning range
+ if (Vector2.Distance(Vector2.Zero, star.Position) >= Range * 1.5)
+ {
+ color = Color.DarkRed;
+ name = Loc.GetString("ship-ftl-tag-oor");
+ }
+
+ if (star.Position == Vector2.Zero)
+ color = Color.Blue;
+
+ // before circle rendering so that we can change whats rendered
+ if (hovered)
+ {
+ radius = 10f;
+ }
+ handle.DrawCircle(uiPosition, radius, color);
+
+ // after circle rendering incase we wish to show text/etc
+ if (hovered)
+ {
+ handle.DrawString(_font, uiPosition + new Vector2(10, 0), name);
+ }
+
+ // on click
+ if (!hovered || !_inputManager.IsKeyDown(Keyboard.Key.MouseLeft))
+ continue;
+
+ if (Vector2.Distance(Vector2.Zero, star.Position) >= Range)
+ continue; // out of warp range
+
+ OnStarSelect?.Invoke(star);
+ }
+ }
+}
diff --git a/Content.Client/_FTL/ShipWeapons/GunnerConsoleWindow.xaml b/Content.Client/_FTL/ShipWeapons/GunnerConsoleWindow.xaml
index 4fdfec277a..bf79a2f20e 100644
--- a/Content.Client/_FTL/ShipWeapons/GunnerConsoleWindow.xaml
+++ b/Content.Client/_FTL/ShipWeapons/GunnerConsoleWindow.xaml
@@ -41,6 +41,7 @@
HorizontalAlignment="Right"/>
+
diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs
index ace0fe84a6..9bceb2e979 100644
--- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs
+++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs
@@ -36,9 +36,9 @@ public sealed partial class ShuttleSystem
private MapId? _hyperSpaceMap;
public const float DefaultStartupTime = 13.5f;
- public const float DefaultTravelTime = 60f;
+ public const float DefaultTravelTime = 60;
public const float DefaultArrivalTime = 5f;
- private const float FTLCooldown = 30f;
+ private const float FTLCooldown = 35f;
private const float ShuttleFTLRange = 100f;
///
diff --git a/Content.Server/_FTL/AutomatedShip/Systems/AutomatedShipSystem.Combat.cs b/Content.Server/_FTL/AutomatedShip/Systems/AutomatedShipSystem.Combat.cs
index 5b53ca15b4..1a5e32af98 100644
--- a/Content.Server/_FTL/AutomatedShip/Systems/AutomatedShipSystem.Combat.cs
+++ b/Content.Server/_FTL/AutomatedShip/Systems/AutomatedShipSystem.Combat.cs
@@ -56,27 +56,25 @@ public List GetPriorityEntities(EntityUid grid)
private CombatResult PerformCombat(
EntityUid entity,
- AutomatedShipComponent aiComponent,
- ShipTrackerComponent shipTrackerComponent,
EntityUid targetShip
)
{
- Log.Info("Les go!!1!!11");
// realistically this should factor in distance but ¯\_(ツ)_/¯
var weaponGroup = _random.Pick(GetWeaponGroupsOnGrid(entity));
// get gun, aim, and shoot at place
if (!TryComp(weaponGroup, out var sourceComponent))
- return CombatResult.ERROR;
- Log.Info("got device!!");
+ return CombatResult.Error;
// get a list of prio entities and select one
var prioEnts = GetPriorityEntities(targetShip);
if (prioEnts.Count <= 0)
- return CombatResult.NOPRIOENT;
- Log.Info("there's more prioents!!!");
+ return CombatResult.NoPriorityEntity;
var prioEnt = _random.Pick(prioEnts);
var prioTransform = Transform(prioEnt);
+ if (sourceComponent.Outputs.Count <= 0)
+ return CombatResult.NoGuns;
+
// yeah we loop through everything
foreach (var (_, outputs) in sourceComponent.Outputs)
{
@@ -105,8 +103,6 @@ EntityUid targetShip
var hitEntityXform = Transform(result.HitEntity);
if (hitEntityXform.GridUid != gunTransform.GridUid)
continue;
- Log.Info("a: " + hitEntityXform.GridUid.ToString());
- Log.Info("b: " + result.HitEntity.ToString());
aimHitFriendly = true;
}
@@ -121,7 +117,7 @@ EntityUid targetShip
}
}
- return CombatResult.OK;
+ return CombatResult.Ok;
}
// private void OnShipDamaged(EntityUid uid, AutomatedShipComponent component, ref ShipDamagedEvent args)
@@ -134,10 +130,11 @@ EntityUid targetShip
// component.HostileShips.Add(args.Source);
// }
- enum CombatResult
+ private enum CombatResult
{
- OK,
- NOPRIOENT,
- ERROR
+ Ok,
+ NoPriorityEntity,
+ NoGuns,
+ Error
}
}
diff --git a/Content.Server/_FTL/AutomatedShip/Systems/AutomatedShipSystem.cs b/Content.Server/_FTL/AutomatedShip/Systems/AutomatedShipSystem.cs
index f3b66c348c..cb30165dae 100644
--- a/Content.Server/_FTL/AutomatedShip/Systems/AutomatedShipSystem.cs
+++ b/Content.Server/_FTL/AutomatedShip/Systems/AutomatedShipSystem.cs
@@ -2,6 +2,7 @@
using Content.Server._FTL.AutomatedShip.Components;
using Content.Server._FTL.ShipTracker.Components;
using Content.Server.NPC.Systems;
+using Content.Server.Shuttles.Components;
using Content.Server.Weapons.Ranged.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Random;
@@ -25,10 +26,10 @@ public override void Initialize()
{
base.Initialize();
- SubscribeLocalEvent(OnInit);
+ SubscribeLocalEvent(OnStartup);
}
- private void OnInit(EntityUid uid, AutomatedShipComponent component, ComponentInit args)
+ private void OnStartup(EntityUid uid, AutomatedShipComponent component, ComponentStartup args)
{
EnsureComp(uid);
UpdateName(uid, component);
@@ -51,11 +52,6 @@ private void UpdateName(EntityUid uid, AutomatedShipComponent component)
_metaDataSystem.SetEntityName(uid, tag + meta.EntityName);
}
- public void AutomatedShipJump()
- {
- // TODO: Make all ships jump to a random point in range
- }
-
public override void Update(float frameTime)
{
base.Update(frameTime);
@@ -65,9 +61,9 @@ public override void Update(float frameTime)
{
if (aiTrackerComponent.Destroyed)
continue;
-
+
// makes sure it's on the same map, not the same grid, and is hostile
- Log.Info("Retargeting");
+ Log.Debug("Retargeting");
var hostileShips = EntityQuery().Where(shipTrackerComponent =>
{
@@ -85,13 +81,13 @@ public override void Update(float frameTime)
if (hostileShips.Count <= 0)
continue;
- Log.Info("Reset retarget");
+ Log.Debug("Reset retarget");
var mainShip = _random.Pick(hostileShips).Owner;
UpdateName(entity, aiComponent);
// I seperated these into partial systems because I hate large line counts!!!
- Log.Info("Determining best course");
+ Log.Debug("Determining best course");
switch (aiComponent.AiState)
{
case AutomatedShipComponent.AiStates.Cruising:
@@ -111,11 +107,16 @@ public override void Update(float frameTime)
Log.Debug("Lack of a hostile ship.");
break;
}
- Log.Info("Fihjying");
- PerformCombat(entity,
- aiComponent,
- aiTrackerComponent,
- mainShip);
+
+ // var gyroscope = EntityQuery().Where(component => component.Item1.Type == ThrusterType.Angular && component.Item2.GridUid == entity );
+ //
+ // if (gyroscope.Any())
+ // {
+ // var angle = (_entityManager.GetCoordinates(xform.LocalPosition).ToMapPos(_entityManager, _transformSystem) - entityXform.MapPosition.Position).ToWorldAngle();
+ // _transformSystem.SetWorldRotation(entity, angle);
+ // }
+
+ PerformCombat(entity, mainShip);
break;
}
default:
diff --git a/Content.Server/_FTL/AutomatedShip/Systems/WarpEveryTickSystem.cs b/Content.Server/_FTL/AutomatedShip/Systems/WarpEveryTickSystem.cs
new file mode 100644
index 0000000000..8cb3262b96
--- /dev/null
+++ b/Content.Server/_FTL/AutomatedShip/Systems/WarpEveryTickSystem.cs
@@ -0,0 +1,39 @@
+using Content.Server._FTL.AutomatedShip.Components;
+using Content.Server._FTL.FTLPoints.Systems;
+using Content.Server._FTL.FTLPoints.Tick;
+using Content.Server._FTL.FTLPoints.Tick.AvoidStar;
+using Content.Server.Shuttles.Components;
+using Content.Server.Shuttles.Systems;
+using Robust.Shared.Map;
+using Robust.Shared.Random;
+
+namespace Content.Server._FTL.AutomatedShip.Systems;
+
+public sealed class WarpEveryTickSystem : StarmapTickSystem
+{
+ [Dependency] private readonly FtlPointsSystem _ftlPointsSystem = default!;
+ [Dependency] private readonly ShuttleSystem _shuttleSystem = default!;
+ [Dependency] private readonly IMapManager _mapManager = default!;
+ [Dependency] private readonly IRobustRandom _random = default!;
+
+ protected override void Ticked(EntityUid uid, AutomatedShipComponent component, float frameTime)
+ {
+ base.Ticked(uid, component, frameTime);
+
+ if (component.AiState == AutomatedShipComponent.AiStates.Fighting)
+ return; // can't warp mid-fight
+
+ var star = _ftlPointsSystem.GetStarWithMapId(Transform(uid).MapID);
+ if (!star.HasValue)
+ return;
+ var stars = _ftlPointsSystem.GetStarsInRange(star.Value.Position, 10);
+ var destination = _random.Pick(stars);
+ var mapUid = _mapManager.GetMapEntityId(destination.Map);
+
+ if (HasComp(mapUid))
+ return;
+
+ var shuttleComp = EnsureComp(uid);
+ _shuttleSystem.FTLTravel(uid, shuttleComp, mapUid);
+ }
+}
diff --git a/Content.Server/_FTL/FTLPoints/Commands/GeneratePointCommand.cs b/Content.Server/_FTL/FTLPoints/Commands/GeneratePointCommand.cs
index ae848ab14e..701ff8c6ac 100644
--- a/Content.Server/_FTL/FTLPoints/Commands/GeneratePointCommand.cs
+++ b/Content.Server/_FTL/FTLPoints/Commands/GeneratePointCommand.cs
@@ -13,25 +13,18 @@ public sealed class GeneratePointCommand : ToolshedCommand
[Dependency] private readonly EntityManager _entityManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
- [CommandImplementation]
- public void GenerateRandom([CommandInvocationContext] IInvocationContext ctx)
- {
- _entityManager.System().GenerateDisposablePoint();
- ctx.WriteLine("Generated random FTL point.");
- }
-
[CommandImplementation]
public void GenerateWithId(
[CommandInvocationContext] IInvocationContext ctx,
[PipedArgument] string id
)
{
- if (!_prototypeManager.TryIndex(id, out var prototype))
+ if (!_prototypeManager.TryIndex(id, out var prototype))
{
ctx.WriteLine("Invalid ID.");
return;
}
- _entityManager.System().GenerateDisposablePoint(prototype);
+ _entityManager.System().GeneratePoint(prototype);
ctx.WriteLine("Generated FTL point.");
}
}
diff --git a/Content.Server/_FTL/FTLPoints/Components/DisposalFTLPointComponent.cs b/Content.Server/_FTL/FTLPoints/Components/DisposalFTLPointComponent.cs
deleted file mode 100644
index fe5043ebbb..0000000000
--- a/Content.Server/_FTL/FTLPoints/Components/DisposalFTLPointComponent.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace Content.Server._FTL.FTLPoints.Components;
-
-[RegisterComponent]
-public sealed partial class DisposalFTLPointComponent : Component
-{
-
-}
diff --git a/Content.Server/_FTL/FTLPoints/Components/StarMapComponent.cs b/Content.Server/_FTL/FTLPoints/Components/StarMapComponent.cs
index 261c4c3b1b..ff0ad74933 100644
--- a/Content.Server/_FTL/FTLPoints/Components/StarMapComponent.cs
+++ b/Content.Server/_FTL/FTLPoints/Components/StarMapComponent.cs
@@ -1,13 +1,16 @@
using System.Numerics;
using Content.Server._FTL.FTLPoints.Systems;
+using Content.Shared._FTL.FtlPoints;
+using Robust.Shared.Map;
namespace Content.Server._FTL.FTLPoints.Components;
///
/// This is used for tracking FTL points and their positioning.
///
-[RegisterComponent, Access(typeof(FTLPointsSystem), Other = AccessPermissions.Read)]
+[RegisterComponent, Access(typeof(FtlPointsSystem), Other = AccessPermissions.Read)]
public sealed partial class StarMapComponent : Component
{
- public Dictionary StarMap = new ();
+ [ViewVariables] public readonly List StarMap = new ();
}
+
diff --git a/Content.Server/_FTL/FTLPoints/Components/StarmapConsoleComponent.cs b/Content.Server/_FTL/FTLPoints/Components/StarmapConsoleComponent.cs
new file mode 100644
index 0000000000..a716e96198
--- /dev/null
+++ b/Content.Server/_FTL/FTLPoints/Components/StarmapConsoleComponent.cs
@@ -0,0 +1,10 @@
+namespace Content.Server._FTL.FTLPoints.Components;
+
+///
+/// This is used for tracking the starmap console
+///
+[RegisterComponent]
+public sealed partial class StarmapConsoleComponent : Component
+{
+
+}
diff --git a/Content.Server/_FTL/FTLPoints/Effects/AddWeatherEffect.cs b/Content.Server/_FTL/FTLPoints/Effects/AddWeatherEffect.cs
index 4b653dfa6f..cf5370f640 100644
--- a/Content.Server/_FTL/FTLPoints/Effects/AddWeatherEffect.cs
+++ b/Content.Server/_FTL/FTLPoints/Effects/AddWeatherEffect.cs
@@ -7,12 +7,12 @@
namespace Content.Server._FTL.FTLPoints.Effects;
[DataDefinition]
-public sealed partial class AddWeatherEffect : FTLPointEffect
+public sealed partial class AddWeatherEffect : FtlPointEffect
{
[DataField("weatherPrototypes", customTypeSerializer: typeof(PrototypeIdListSerializer))]
public List WeatherPrototypes { set; get; } = default!;
- public override void Effect(FTLPointEffectArgs args)
+ public override void Effect(FtlPointEffectArgs args)
{
var random = IoCManager.Resolve();
var protoManager = IoCManager.Resolve();
diff --git a/Content.Server/_FTL/FTLPoints/Effects/ApplyWorldGenConfigEffect.cs b/Content.Server/_FTL/FTLPoints/Effects/ApplyWorldGenConfigEffect.cs
index 0c87231460..8c3fc9aa83 100644
--- a/Content.Server/_FTL/FTLPoints/Effects/ApplyWorldGenConfigEffect.cs
+++ b/Content.Server/_FTL/FTLPoints/Effects/ApplyWorldGenConfigEffect.cs
@@ -13,12 +13,12 @@
namespace Content.Server._FTL.FTLPoints.Effects;
[DataDefinition]
-public sealed partial class ApplyWorldGenConfigEffect : FTLPointEffect
+public sealed partial class ApplyWorldGenConfigEffect : FtlPointEffect
{
[DataField("config", customTypeSerializer:typeof(PrototypeIdSerializer))]
public string ConfigPrototype = "Default";
- public override void Effect(FTLPointEffectArgs args)
+ public override void Effect(FtlPointEffectArgs args)
{
var prototypeManager = IoCManager.Resolve();
var ser = IoCManager.Resolve();
diff --git a/Content.Server/_FTL/FTLPoints/Effects/FTLPointEffect.cs b/Content.Server/_FTL/FTLPoints/Effects/FtlPointEffect.cs
similarity index 72%
rename from Content.Server/_FTL/FTLPoints/Effects/FTLPointEffect.cs
rename to Content.Server/_FTL/FTLPoints/Effects/FtlPointEffect.cs
index 1e70499b46..971ae42cd0 100644
--- a/Content.Server/_FTL/FTLPoints/Effects/FTLPointEffect.cs
+++ b/Content.Server/_FTL/FTLPoints/Effects/FtlPointEffect.cs
@@ -8,12 +8,12 @@ namespace Content.Server._FTL.FTLPoints.Effects;
///
///
[ImplicitDataDefinitionForInheritors, MeansImplicitUse]
-public abstract partial class FTLPointEffect
+public abstract partial class FtlPointEffect
{
[DataField("probability")] public float Probability = 1f;
- public abstract void Effect(FTLPointEffectArgs args);
+ public abstract void Effect(FtlPointEffectArgs args);
- public readonly record struct FTLPointEffectArgs(
+ public readonly record struct FtlPointEffectArgs(
EntityUid MapUid,
MapId MapId,
IEntityManager EntityManager,
diff --git a/Content.Server/_FTL/FTLPoints/Effects/SpawnDungeonEffect.cs b/Content.Server/_FTL/FTLPoints/Effects/SpawnDungeonEffect.cs
index b881a44ac4..14cb193d6d 100644
--- a/Content.Server/_FTL/FTLPoints/Effects/SpawnDungeonEffect.cs
+++ b/Content.Server/_FTL/FTLPoints/Effects/SpawnDungeonEffect.cs
@@ -10,7 +10,7 @@
namespace Content.Server._FTL.FTLPoints.Effects;
[DataDefinition]
-public sealed partial class SpawnDungeonEffect : FTLPointEffect
+public sealed partial class SpawnDungeonEffect : FtlPointEffect
{
[DataField("configPrototypes")]
public List ConfigPrototypes { set; get; } = new List()
@@ -23,7 +23,7 @@ public sealed partial class SpawnDungeonEffect : FTLPointEffect
[DataField("maxSpawn")] public int MaxSpawn = 2;
[DataField("range")] public int SpawnRange = 200;
- public override void Effect(FTLPointEffectArgs args)
+ public override void Effect(FtlPointEffectArgs args)
{
var random = IoCManager.Resolve();
var amountToSpawn = random.Next(MinSpawn, MaxSpawn);
diff --git a/Content.Server/_FTL/FTLPoints/Effects/SpawnMapEffect.cs b/Content.Server/_FTL/FTLPoints/Effects/SpawnMapEffect.cs
index 0a0b255634..5c1667fd4c 100644
--- a/Content.Server/_FTL/FTLPoints/Effects/SpawnMapEffect.cs
+++ b/Content.Server/_FTL/FTLPoints/Effects/SpawnMapEffect.cs
@@ -6,7 +6,7 @@
namespace Content.Server._FTL.FTLPoints.Effects;
[DataDefinition]
-public sealed partial class SpawnMapEffect : FTLPointEffect
+public sealed partial class SpawnMapEffect : FtlPointEffect
{
[DataField("mapPaths", required: true)]
public List MapPaths { set; get; } = new List()
@@ -14,7 +14,7 @@ public sealed partial class SpawnMapEffect : FTLPointEffect
new ResPath("/Maps/_FTL/trade-station.yml")
};
- public override void Effect(FTLPointEffectArgs args)
+ public override void Effect(FtlPointEffectArgs args)
{
var mapLoader = args.EntityManager.System();
var random = IoCManager.Resolve();
diff --git a/Content.Server/_FTL/FTLPoints/Effects/SpawnStationEffect.cs b/Content.Server/_FTL/FTLPoints/Effects/SpawnStationEffect.cs
index 45ef1d7ac5..aa449f5aa9 100644
--- a/Content.Server/_FTL/FTLPoints/Effects/SpawnStationEffect.cs
+++ b/Content.Server/_FTL/FTLPoints/Effects/SpawnStationEffect.cs
@@ -10,7 +10,7 @@
namespace Content.Server._FTL.FTLPoints.Effects;
[DataDefinition]
-public sealed partial class SpawnStationEffect : FTLPointEffect
+public sealed partial class SpawnStationEffect : FtlPointEffect
{
[DataField("stationIds", required: true)]
public List StationIds { set; get; } = new List()
@@ -18,7 +18,7 @@ public sealed partial class SpawnStationEffect : FTLPointEffect
"TradeStation"
};
- public override void Effect(FTLPointEffectArgs args)
+ public override void Effect(FtlPointEffectArgs args)
{
var protoManager = IoCManager.Resolve();
var random = IoCManager.Resolve();
diff --git a/Content.Server/_FTL/FTLPoints/Effects/ToPlanetEffect.cs b/Content.Server/_FTL/FTLPoints/Effects/ToPlanetEffect.cs
index 9e815039bc..4f3e83a92a 100644
--- a/Content.Server/_FTL/FTLPoints/Effects/ToPlanetEffect.cs
+++ b/Content.Server/_FTL/FTLPoints/Effects/ToPlanetEffect.cs
@@ -17,7 +17,7 @@
namespace Content.Server._FTL.FTLPoints.Effects;
[DataDefinition]
-public sealed partial class ToPlanetEffect : FTLPointEffect
+public sealed partial class ToPlanetEffect : FtlPointEffect
{
[DataField("lightingColors")]
public List LightingColors { set; get; } = new List()
@@ -31,7 +31,7 @@ public sealed partial class ToPlanetEffect : FTLPointEffect
[DataField("biomeTemplates", customTypeSerializer: typeof(PrototypeIdListSerializer))]
public List BiomeTemplates { set; get; } = default!;
- public override void Effect(FTLPointEffectArgs args)
+ public override void Effect(FtlPointEffectArgs args)
{
var protoManager = IoCManager.Resolve();
var random = IoCManager.Resolve();
diff --git a/Content.Server/_FTL/FTLPoints/Events/FTLPointSpawn.cs b/Content.Server/_FTL/FTLPoints/Events/FtlPointSpawn.cs
similarity index 66%
rename from Content.Server/_FTL/FTLPoints/Events/FTLPointSpawn.cs
rename to Content.Server/_FTL/FTLPoints/Events/FtlPointSpawn.cs
index 01ef1b035c..3401668df1 100644
--- a/Content.Server/_FTL/FTLPoints/Events/FTLPointSpawn.cs
+++ b/Content.Server/_FTL/FTLPoints/Events/FtlPointSpawn.cs
@@ -8,11 +8,11 @@ namespace Content.Server._FTL.FTLPoints.Events;
///
///
[ImplicitDataDefinitionForInheritors, MeansImplicitUse]
-public abstract partial class FTLPointSpawn
+public abstract partial class FtlPointSpawn
{
- public abstract void Effect(FTLPointSpawnArgs args);
+ public abstract void Effect(FtlPointSpawnArgs args);
- public readonly record struct FTLPointSpawnArgs(
+ public readonly record struct FtlPointSpawnArgs(
IEntityManager EntityManager,
IMapManager MapManager
);
diff --git a/Content.Server/_FTL/FTLPoints/Prototypes/FTLPointPrototype.cs b/Content.Server/_FTL/FTLPoints/Prototypes/FtlPointPrototype.cs
similarity index 70%
rename from Content.Server/_FTL/FTLPoints/Prototypes/FTLPointPrototype.cs
rename to Content.Server/_FTL/FTLPoints/Prototypes/FtlPointPrototype.cs
index f77bce912d..4982f5c154 100644
--- a/Content.Server/_FTL/FTLPoints/Prototypes/FTLPointPrototype.cs
+++ b/Content.Server/_FTL/FTLPoints/Prototypes/FtlPointPrototype.cs
@@ -8,7 +8,7 @@ namespace Content.Server._FTL.FTLPoints.Prototypes;
/// This is a prototype for getting a specific type of FTL point.
///
[Prototype("ftlPoint")]
-public sealed class FTLPointPrototype : IPrototype
+public sealed class FtlPointPrototype : IPrototype
{
///
[IdDataField]
@@ -22,12 +22,15 @@ public sealed class FTLPointPrototype : IPrototype
///
/// Loc string in the FTL menu next to the name ([STAR] Cepheus-I-32).
///
- [DataField("tag")] public string Tag = "";
+ [DataField("tag")] public LocId Tag = "";
///
/// FTL point effects.
///
- [DataField("effects")] public FTLPointEffect[] FtlPointEffects = default!;
+ [DataField("effects")] public FtlPointEffect[] FtlPointEffects = default!;
- [DataField("overrideSpawn")] public FTLPointSpawn? OverrideSpawn = default!;
+ ///
+ /// Components for systems
+ ///
+ [DataField("components")] public ComponentRegistry? TickComponents = default!;
}
diff --git a/Content.Server/_FTL/FTLPoints/Systems/FTLPointsSystem.Starmap.cs b/Content.Server/_FTL/FTLPoints/Systems/FTLPointsSystem.Starmap.cs
deleted file mode 100644
index 21c2ccce33..0000000000
--- a/Content.Server/_FTL/FTLPoints/Systems/FTLPointsSystem.Starmap.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Numerics;
-using Content.Server._FTL.FTLPoints.Components;
-using JetBrains.Annotations;
-using Robust.Server.GameStates;
-using Robust.Shared.Map;
-
-namespace Content.Server._FTL.FTLPoints.Systems;
-
-///
-/// This handles managing the starmap singleton, such as getting stars in range, and other stuff.
-///
-public sealed partial class FTLPointsSystem
-{
- [Dependency] private readonly PvsOverrideSystem _pvs = default!;
-
- ///
- public override void Initialize()
- {
- SubscribeLocalEvent(OnInit);
- }
-
- private void OnInit(EntityUid uid, StarMapComponent component, ComponentStartup args)
- {
- _pvs.AddGlobalOverride(uid);
- }
-
- // ew i know singletons suck but this is the only thing that makes sense
- public bool TryGetStarMap([NotNullWhen(true)] ref StarMapComponent? component)
- {
- if (component != null)
- return true;
-
- var query = EntityQuery().ToList();
- component = !query.Any() ? CreatePointManager() : query.First();
- return true;
- }
-
- private StarMapComponent CreatePointManager()
- {
- var manager = Spawn(null, MapCoordinates.Nullspace);
- return EnsureComp(manager);
- }
-
- #region Public API
-
- [PublicAPI]
- public List? GetStarsInRange(Vector2 position, float range, StarMapComponent? component = null)
- {
- if (!TryGetStarMap(ref component))
- return default;
-
- var list = new List();
- foreach (var (starPos, starUid) in component.StarMap)
- {
- if (Vector2.Distance(position, starPos) <= range)
- list.Add(starUid);
- }
-
- return list;
- }
-
- [PublicAPI]
- public bool TryAddPoint(EntityUid uid, Vector2 position, StarMapComponent? component = null)
- {
- return TryGetStarMap(ref component) && component.StarMap.TryAdd(position, uid);
- }
-
- #endregion
-}
diff --git a/Content.Server/_FTL/FTLPoints/Systems/FTLPointsSystem.cs b/Content.Server/_FTL/FTLPoints/Systems/FTLPointsSystem.cs
deleted file mode 100644
index 1a1460ecdf..0000000000
--- a/Content.Server/_FTL/FTLPoints/Systems/FTLPointsSystem.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-using Content.Server._FTL.FTLPoints.Components;
-using Content.Server._FTL.FTLPoints.Effects;
-using Content.Server._FTL.FTLPoints.Events;
-using Content.Server._FTL.FTLPoints.Prototypes;
-using Content.Server.Parallax;
-using Content.Server.Shuttles.Components;
-using Content.Server.Shuttles.Systems;
-using Content.Shared.Dataset;
-using Content.Shared.Parallax;
-using Content.Shared.Random;
-using Content.Shared.Random.Helpers;
-using Content.Shared.Salvage;
-using Robust.Shared.Map;
-using Robust.Shared.Prototypes;
-using Robust.Shared.Random;
-
-namespace Content.Server._FTL.FTLPoints.Systems;
-
-///
-/// This handles the generation of FTL points
-///
-public sealed partial class FTLPointsSystem : EntitySystem
-{
- [Dependency] private readonly EntityManager _entManager = default!;
- [Dependency] private readonly IMapManager _mapManager = default!;
- [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
- [Dependency] private readonly MetaDataSystem _metaDataSystem = default!;
- [Dependency] private readonly IRobustRandom _random = default!;
- [Dependency] private readonly ShuttleConsoleSystem _consoleSystem = default!;
-
- public void RegeneratePoints()
- {
- ClearDisposablePoints();
-
- var preferredPointAmount = _random.Next(2, 5);
-
- for (var i = 0; i < preferredPointAmount; i++)
- {
- GenerateDisposablePoint();
- }
-
- Log.Debug("Regenerated points.");
- }
-
- ///
- /// Clears all disposable points
- ///
- public void ClearDisposablePoints()
- {
- var query = EntityQueryEnumerator();
- while (query.MoveNext(out var uid, out var component))
- {
- DeletePoint(uid);
- }
- }
-
- public void DeletePoint(EntityUid point)
- {
- Del(point);
- }
-
- ///
- /// Generates a temporary disposable FTL point.
- ///
- public void GenerateDisposablePoint(FTLPointPrototype? prototype = null)
- {
- var picked = _prototypeManager.Index("FTLPoints").Pick();
-
- Log.Info($"Picked {picked} as point type.");
-
- var point = _prototypeManager.Index(picked);
-
- if (prototype != null)
- point = prototype;
-
- // create map
- if (point.OverrideSpawn == null)
- {
- if (!_random.Prob(point.Probability))
- return;
-
- var mapId = _mapManager.CreateMap();
- _mapManager.AddUninitializedMap(mapId);
- var mapUid = _mapManager.GetMapEntityId(mapId);
-
- // make it ftlable
- EnsureComp(mapUid);
- EnsureComp(mapUid);
- _metaDataSystem.SetEntityName(mapUid, $"[{Loc.GetString(point.Tag)}] {
- SharedSalvageSystem.GetFTLName(_prototypeManager.Index("names_borer"), _random.Next())}");
- _consoleSystem.RefreshShuttleConsoles();
-
- // add parallax
- var parallaxes = new[]
- {
- "AspidParallax",
- "KettleStation",
- "Default",
- "Blank",
- "BagelStation",
- "Blue_Nebula_01",
- "Blue_Nebula_02",
- "Blue_Nebula_03",
- "Blue_Nebula_04",
- "Green_Nebula_01",
- "Green_Nebula_02",
- "Green_Nebula_03",
- "Green_Nebula_04",
- "Green_Nebula_06",
- "Green_Nebula_07",
- "Green_Nebula_08",
- "Purple_Nebula_01",
- "Purple_Nebula_02",
- "Purple_Nebula_03",
- "Purple_Nebula_04",
- "Purple_Nebula_05",
- "Purple_Nebula_08"
- };
- var parallax = EnsureComp(mapUid);
- parallax.Parallax = _random.Pick(parallaxes);
-
- // spawn the stuff
- foreach (var effect in point.FtlPointEffects)
- {
- if (_random.Prob(effect.Probability))
- {
- effect.Effect(new FTLPointEffect.FTLPointEffectArgs(mapUid, mapId, _entManager, _mapManager));
- }
- }
-
- }
- else
- {
- point.OverrideSpawn.Effect(new FTLPointSpawn.FTLPointSpawnArgs(_entManager, _mapManager));
- }
- }
-}
diff --git a/Content.Server/_FTL/FTLPoints/Systems/FtlPointsSystem.Starmap.cs b/Content.Server/_FTL/FTLPoints/Systems/FtlPointsSystem.Starmap.cs
new file mode 100644
index 0000000000..cde84cd042
--- /dev/null
+++ b/Content.Server/_FTL/FTLPoints/Systems/FtlPointsSystem.Starmap.cs
@@ -0,0 +1,150 @@
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Numerics;
+using Content.Server._FTL.FTLPoints.Components;
+using Content.Server.Shuttles.Components;
+using Content.Server.UserInterface;
+using Content.Shared._FTL.FtlPoints;
+using JetBrains.Annotations;
+using Robust.Server.GameStates;
+using Robust.Shared.Map;
+
+namespace Content.Server._FTL.FTLPoints.Systems;
+
+///
+/// This handles managing the star map singleton, such as getting stars in range, and other stuff.
+///
+public sealed partial class FtlPointsSystem
+{
+ [Dependency] private readonly PvsOverrideSystem _pvs = default!;
+
+ private void OnInit(EntityUid uid, StarMapComponent component, ComponentStartup args)
+ {
+ _pvs.AddGlobalOverride(uid);
+ }
+
+ // ew i know singletons suck but this is the only thing that makes sense
+ public bool TryGetStarMap([NotNullWhen(true)] ref StarMapComponent? component)
+ {
+ if (component != null)
+ return true;
+
+ var query = EntityQuery().ToList();
+ component = !query.Any() ? CreatePointManager() : query.First();
+ return true;
+ }
+
+ private StarMapComponent CreatePointManager()
+ {
+ var manager = Spawn(null, MapCoordinates.Nullspace);
+ return EnsureComp(manager);
+ }
+
+ private void OnToggleInterface(EntityUid uid, StarmapConsoleComponent? component, AfterActivatableUIOpenEvent args)
+ {
+ UpdateUserInterface(uid, component);
+ }
+
+ private void UpdateUserInterface(EntityUid uid, StarmapConsoleComponent? component = null)
+ {
+ if (!Resolve(uid, ref component))
+ return;
+
+ var xform = Transform(uid);
+ Log.Info("Tried to get transform");
+
+ var star = GetStarWithMapId(xform.MapID);
+ Log.Info("Tried to find star");
+ if (!star.HasValue)
+ return;
+ Log.Info("Got star, sending state");
+
+ var range = 10f;
+ var stars = GetStarsInRange(star.Value.Position, 50f);
+ stars.Insert(0, star.Value with {Position = Vector2.Zero});
+ var state = new StarmapConsoleBoundUserInterfaceState(stars, range);
+
+ _userInterface.TrySetUiState(uid, StarmapConsoleUiKey.Key, state);
+ }
+
+ #region Public API
+
+ ///
+ /// Returns stars in range, and their position's relative to the position.
+ ///
+ ///
+ ///
+ ///
+ ///
+ [PublicAPI]
+ public List GetStarsInRange(Vector2 position, float range, StarMapComponent? component = null)
+ {
+ var list = new List();
+ if (!TryGetStarMap(ref component))
+ return list;
+
+ foreach (var star in component.StarMap)
+ {
+ if (Vector2.Distance(position, star.Position) <= range)
+ {
+ list.Add(star with
+ {
+ Position = star.Position - position
+ });
+ }
+ }
+
+ return list;
+ }
+
+ [PublicAPI]
+ public Star? GetStarWithMapId(MapId map, StarMapComponent? component = null)
+ {
+ if (!TryGetStarMap(ref component))
+ return default;
+
+ foreach (var star in component.StarMap.Where(star => star.Map == map))
+ {
+ return star;
+ }
+
+ return null;
+ }
+
+ [PublicAPI]
+ public Star? GetStarWithPosition(Vector2 pos, StarMapComponent? component = null)
+ {
+ if (!TryGetStarMap(ref component))
+ return default;
+
+ foreach (var star in component.StarMap.Where(star => star.Position == pos))
+ {
+ return star;
+ }
+
+ return null;
+ }
+
+ [PublicAPI]
+ public void TryAddPoint(MapId mapId, Vector2 position, string name, StarMapComponent? component = null)
+ {
+ if (TryGetStarMap(ref component))
+ component.StarMap.Add(new Star(position, mapId, name, position));
+ }
+
+ #endregion
+
+ private void OnWarpToStarMessage(EntityUid uid, StarmapConsoleComponent component, WarpToStarMessage args)
+ {
+ var xform = Transform(uid);
+ var grid = xform.GridUid;
+
+ if (!grid.HasValue)
+ return;
+
+ if (!TryComp(grid, out var shuttleComponent))
+ return;
+
+ _shuttleSystem.FTLTravel(grid.Value, shuttleComponent, _mapManager.GetMapEntityId(args.Star.Map));
+ }
+}
diff --git a/Content.Server/_FTL/FTLPoints/Systems/FtlPointsSystem.cs b/Content.Server/_FTL/FTLPoints/Systems/FtlPointsSystem.cs
new file mode 100644
index 0000000000..fe05bf56bd
--- /dev/null
+++ b/Content.Server/_FTL/FTLPoints/Systems/FtlPointsSystem.cs
@@ -0,0 +1,192 @@
+using System.Linq;
+using System.Numerics;
+using Content.Server._FTL.FTLPoints.Components;
+using Content.Server._FTL.FTLPoints.Effects;
+using Content.Server._FTL.FTLPoints.Prototypes;
+using Content.Server.Shuttles.Components;
+using Content.Server.Shuttles.Systems;
+using Content.Server.UserInterface;
+using Content.Shared._FTL.FtlPoints;
+using Content.Shared.Dataset;
+using Content.Shared.Parallax;
+using Content.Shared.Random;
+using Content.Shared.Random.Helpers;
+using Content.Shared.Salvage;
+using Robust.Server.GameObjects;
+using Robust.Shared.Map;
+using Robust.Shared.Prototypes;
+using Robust.Shared.Random;
+using Robust.Shared.Serialization.Manager;
+
+namespace Content.Server._FTL.FTLPoints.Systems;
+
+///
+/// This handles the generation of FTL points
+///
+public sealed partial class FtlPointsSystem : SharedFtlPointsSystem
+{
+ [Dependency] private readonly EntityManager _entManager = default!;
+ [Dependency] private readonly IMapManager _mapManager = default!;
+ [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+ [Dependency] private readonly MetaDataSystem _metaDataSystem = default!;
+ [Dependency] private readonly IRobustRandom _random = default!;
+ [Dependency] private readonly ShuttleConsoleSystem _consoleSystem = default!;
+ [Dependency] private readonly UserInterfaceSystem _userInterface = default!;
+ [Dependency] private readonly ShuttleSystem _shuttleSystem = default!;
+ [Dependency] private readonly ISerializationManager _serializationManager = default!;
+
+ public override void Initialize()
+ {
+ base.Initialize();
+ SubscribeLocalEvent(OnInit);
+ SubscribeLocalEvent(OnToggleInterface);
+ SubscribeLocalEvent(OnWarpToStarMessage);
+ }
+
+ ///
+ /// Generates a float within minimum and maximum, with a 50% chance of being negative.
+ ///
+ ///
+ ///
+ ///
+ private float GeneratePositionWithRandomRadius(float minRadius, float maxRadius)
+ {
+ return _random.NextFloat(minRadius, maxRadius) * (_random.Prob(0.5f) ? -1 : 1);
+ }
+
+ ///
+ /// Generates a random sector.
+ ///
+ /// How many stars in the newest generation until we must forcibly stop it?
+ /// The MapId of the central trade station.
+ public MapId GenerateSector(int maxStars)
+ {
+ var centerStation = GeneratePoint(_prototypeManager.Index("StationPoint"));
+ var latestGeneration = new List
+ {
+ Vector2.Zero
+ };
+ TryAddPoint(centerStation, new Vector2(0,0), Loc.GetString("starmap-center-station"));
+
+ var starsCreated = 0;
+
+ Log.Info("Generating sector.");
+
+ while (starsCreated <= maxStars)
+ {
+ var toIter = latestGeneration.ToList();
+ latestGeneration.Clear();
+ foreach (var origin in toIter)
+ {
+ var branches = _random.Next(1, 3);
+
+ for (var i = 0; i < branches; i++)
+ {
+ var prototype = _prototypeManager.Index(_prototypeManager.Index("FTLPoints").Pick());
+ Log.Info($"Picked {prototype} as point type.");
+ if (!_random.Prob(prototype.Probability))
+ continue;
+ var mapId = GeneratePoint(prototype);
+ var mapUid = _mapManager.GetMapEntityId(mapId);
+ var position = new Vector2(
+ origin.X + GeneratePositionWithRandomRadius(3, 10),
+ origin.Y + GeneratePositionWithRandomRadius(3, 10)
+ );
+ TryAddPoint(mapId, position, MetaData(mapUid).EntityName);
+ latestGeneration.Add(position);
+ starsCreated++;
+ }
+ }
+ }
+
+ for (var i = 0; i < 3; i++)
+ {
+ var origin = _random.Pick(latestGeneration);
+ var prototype = _prototypeManager.Index("WarpPoint");
+ var mapId = GeneratePoint(prototype);
+ var mapUid = _mapManager.GetMapEntityId(mapId);
+ var position = new Vector2(
+ origin.X + GeneratePositionWithRandomRadius(5, 7),
+ origin.Y + GeneratePositionWithRandomRadius(5, 7)
+ );
+ TryAddPoint(mapId, position, MetaData(mapUid).EntityName);
+ latestGeneration.Add(position);
+ starsCreated++;
+ }
+
+ Log.Debug("Generated a brand new sector.");
+
+ return centerStation;
+ }
+
+ ///
+ /// Generates a temporary disposable FTL point.
+ ///
+ public MapId GeneratePoint(FtlPointPrototype prototype)
+ {
+ // create map
+
+ var mapId = _mapManager.CreateMap();
+ var mapUid = _mapManager.GetMapEntityId(mapId);
+
+ // make it ftlable
+ EnsureComp(mapUid);
+ _metaDataSystem.SetEntityName(mapUid, $"[{Loc.GetString(prototype.Tag)}] {
+ SharedSalvageSystem.GetFTLName(_prototypeManager.Index("names_borer"), _random.Next())}");
+ _consoleSystem.RefreshShuttleConsoles();
+
+ // add parallax
+ var parallaxes = new[]
+ {
+ "AspidParallax",
+ "KettleStation",
+ "Default",
+ "Blank",
+ "BagelStation",
+ "Blue_Nebula_01",
+ "Blue_Nebula_02",
+ "Blue_Nebula_03",
+ "Blue_Nebula_04",
+ "Green_Nebula_01",
+ "Green_Nebula_02",
+ "Green_Nebula_03",
+ "Green_Nebula_04",
+ "Green_Nebula_06",
+ "Green_Nebula_07",
+ "Green_Nebula_08",
+ "Purple_Nebula_01",
+ "Purple_Nebula_02",
+ "Purple_Nebula_03",
+ "Purple_Nebula_04",
+ "Purple_Nebula_05",
+ "Purple_Nebula_08"
+ };
+ var parallax = EnsureComp(mapUid);
+ parallax.Parallax = _random.Pick(parallaxes);
+
+ // spawn the stuff
+ foreach (var effect in prototype.FtlPointEffects)
+ {
+ if (_random.Prob(effect.Probability))
+ {
+ effect.Effect(new FtlPointEffect.FtlPointEffectArgs(mapUid, mapId, _entManager, _mapManager));
+ }
+ }
+
+ // Add all components required by the prototype
+ if (prototype.TickComponents == null)
+ return mapId;
+
+ foreach (var entry in prototype.TickComponents.Values)
+ {
+ if (HasComp(mapUid, entry.Component.GetType()))
+ continue;
+
+ var comp = (Component) _serializationManager.CreateCopy(entry.Component, notNullableOverride: true);
+ comp.Owner = mapUid;
+ EntityManager.AddComponent(mapUid, comp);
+ }
+
+ return mapId;
+ }
+}
diff --git a/Content.Server/_FTL/FTLPoints/Tick/AvoidStar/AvoidStarComponent.cs b/Content.Server/_FTL/FTLPoints/Tick/AvoidStar/AvoidStarComponent.cs
new file mode 100644
index 0000000000..0d219755ce
--- /dev/null
+++ b/Content.Server/_FTL/FTLPoints/Tick/AvoidStar/AvoidStarComponent.cs
@@ -0,0 +1,10 @@
+namespace Content.Server._FTL.FTLPoints.Tick.AvoidStar;
+
+///
+/// This is used for disallowing ships to visit the selected star
+///
+[RegisterComponent]
+public sealed partial class AvoidStarComponent : Component
+{
+
+}
diff --git a/Content.Server/_FTL/FTLPoints/Tick/Factory/FactoryTickComponent.cs b/Content.Server/_FTL/FTLPoints/Tick/Factory/FactoryTickComponent.cs
new file mode 100644
index 0000000000..f12060193c
--- /dev/null
+++ b/Content.Server/_FTL/FTLPoints/Tick/Factory/FactoryTickComponent.cs
@@ -0,0 +1,13 @@
+using Robust.Shared.Utility;
+
+namespace Content.Server._FTL.FTLPoints.Tick.Factory;
+
+///
+/// This is used for tracking the ResPaths to maps that we would like to spawn.
+///
+[RegisterComponent]
+public sealed partial class FactoryTickComponent : Component
+{
+ [DataField("mapPaths", required: true)]
+ public List MapPaths { set; get; } = new();
+}
diff --git a/Content.Server/_FTL/FTLPoints/Tick/Factory/FactoryTickSystem.cs b/Content.Server/_FTL/FTLPoints/Tick/Factory/FactoryTickSystem.cs
new file mode 100644
index 0000000000..1e666097dd
--- /dev/null
+++ b/Content.Server/_FTL/FTLPoints/Tick/Factory/FactoryTickSystem.cs
@@ -0,0 +1,26 @@
+using Robust.Server.GameObjects;
+using Robust.Shared.Map;
+using Robust.Shared.Random;
+
+namespace Content.Server._FTL.FTLPoints.Tick.Factory;
+
+///
+/// This system spawns ships every tick.
+///
+public sealed class FactoryTickSystem : StarmapTickSystem
+{
+ [Dependency] private readonly IRobustRandom _random = default!;
+ [Dependency] private readonly MapLoaderSystem _mapLoader = default!;
+
+ protected override void Ticked(EntityUid uid, FactoryTickComponent component, float frameTime)
+ {
+ base.Ticked(uid, component, frameTime);
+
+ var transform = Transform(uid);
+
+ if (_mapLoader.TryLoad(transform.MapID, _random.Pick(component.MapPaths).ToString(), out _))
+ {
+ Log.Debug("Created a new ship!");
+ }
+ }
+}
diff --git a/Content.Server/_FTL/FTLPoints/Tick/StarmapTickSystem.cs b/Content.Server/_FTL/FTLPoints/Tick/StarmapTickSystem.cs
new file mode 100644
index 0000000000..6fd664b5a3
--- /dev/null
+++ b/Content.Server/_FTL/FTLPoints/Tick/StarmapTickSystem.cs
@@ -0,0 +1,51 @@
+namespace Content.Server._FTL.FTLPoints.Tick;
+
+public abstract class StarmapTickSystem : EntitySystem where T : Component
+{
+ private readonly float _tickInterval = 300f;
+ private float _timeSinceLastTick = 0f; // SIN
+
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ SubscribeLocalEvent(Added);
+ }
+
+ ///
+ /// Called on entities when added
+ ///
+ private void Added(EntityUid uid, T component, ComponentInit args)
+ {
+
+ }
+
+ ///
+ /// Called on entities every tick
+ ///
+ protected virtual void Ticked(EntityUid uid, T component, float frameTime)
+ {
+
+ }
+
+ protected EntityQueryEnumerator QueryStars()
+ {
+ return EntityQueryEnumerator();
+ }
+
+ public override void Update(float frameTime)
+ {
+ base.Update(frameTime);
+
+ _timeSinceLastTick += frameTime;
+ if (!(_timeSinceLastTick >= _tickInterval))
+ return;
+ _timeSinceLastTick = 0;
+ var stars = QueryStars();
+ while (stars.MoveNext(out var uid, out var component))
+ {
+ Ticked(uid, component, frameTime);
+ }
+ Log.Debug("Tick!");
+ }
+}
diff --git a/Content.Server/_FTL/FTLPoints/Generators/IndependentNameGenerator.cs b/Content.Server/_FTL/ShipTracker/Generators/IndependentNameGenerator.cs
similarity index 100%
rename from Content.Server/_FTL/FTLPoints/Generators/IndependentNameGenerator.cs
rename to Content.Server/_FTL/ShipTracker/Generators/IndependentNameGenerator.cs
diff --git a/Content.Server/_FTL/ShipTracker/Rules/GeneratePoints/GeneratePointsComponent.cs b/Content.Server/_FTL/ShipTracker/Rules/GeneratePoints/GeneratePointsComponent.cs
index 1b3867985a..cd3e92fb22 100644
--- a/Content.Server/_FTL/ShipTracker/Rules/GeneratePoints/GeneratePointsComponent.cs
+++ b/Content.Server/_FTL/ShipTracker/Rules/GeneratePoints/GeneratePointsComponent.cs
@@ -3,5 +3,5 @@ namespace Content.Server._FTL.ShipTracker.Rules.GeneratePoints;
[RegisterComponent, Access(typeof(GeneratePointsSystem))]
public sealed partial class GeneratePointsComponent : Component
{
-
+ public bool Generated;
}
diff --git a/Content.Server/_FTL/ShipTracker/Rules/GeneratePoints/GeneratePointsSystem.cs b/Content.Server/_FTL/ShipTracker/Rules/GeneratePoints/GeneratePointsSystem.cs
index 0e699863ce..818d97a603 100644
--- a/Content.Server/_FTL/ShipTracker/Rules/GeneratePoints/GeneratePointsSystem.cs
+++ b/Content.Server/_FTL/ShipTracker/Rules/GeneratePoints/GeneratePointsSystem.cs
@@ -1,8 +1,13 @@
+using System.Linq;
using Content.Server._FTL.FTLPoints.Systems;
using Content.Server.GameTicking.Rules;
+using Content.Server.Shuttles.Components;
+using Content.Server.Shuttles.Systems;
+using Content.Server.Station.Components;
using Content.Server.Station.Systems;
using Robust.Shared.Configuration;
using Content.Shared.CCVar;
+using Robust.Shared.Map;
namespace Content.Server._FTL.ShipTracker.Rules.GeneratePoints;
@@ -12,19 +17,46 @@ namespace Content.Server._FTL.ShipTracker.Rules.GeneratePoints;
public sealed class GeneratePointsSystem : GameRuleSystem
{
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
- [Dependency] private readonly FTLPointsSystem _pointsSystem = default!;
+ [Dependency] private readonly FtlPointsSystem _pointsSystem = default!;
+ [Dependency] private readonly StationSystem _stationSystem = default!;
+ [Dependency] private readonly ShuttleSystem _shuttleSystem = default!;
+ [Dependency] private readonly IMapManager _mapManager = default!;
public override void Initialize()
{
base.Initialize();
- SubscribeLocalEvent(OnPlayerSpawningEvent);
+
+ SubscribeLocalEvent(OnPlayerSpawnEvent);
}
- private void OnPlayerSpawningEvent(PlayerSpawningEvent ev)
+ private void OnPlayerSpawnEvent(PlayerSpawningEvent ev)
{
- if (_configurationManager.GetCVar(CCVars.GenerateFTLPointsRoundstart))
+ var activeRules = QueryActiveRules();
+ while (activeRules.MoveNext(out _, out var component, out _))
{
- _pointsSystem.RegeneratePoints();
+ if (component.Generated)
+ return;
+
+ if (!_configurationManager.GetCVar(CCVars.GenerateFTLPointsRoundstart))
+ return;
+ var station = _pointsSystem.GenerateSector(20);
+
+ if (ev.Station.HasValue)
+ {
+ if (TryComp(ev.Station.Value, out var stationDataComponent))
+ {
+ var grid = _stationSystem.GetLargestGrid(stationDataComponent);
+ if (grid.HasValue)
+ {
+ var shuttle = EnsureComp(grid.Value);
+ _shuttleSystem.FTLTravel(grid.Value, shuttle, _mapManager.GetMapEntityId(station));
+ }
+ }
+ }
+
+ component.Generated = true;
+
+ Log.Info("Finished generation of sector.");
}
}
}
diff --git a/Content.Server/_FTL/ShipTracker/Systems/ShipTrackerSystem.cs b/Content.Server/_FTL/ShipTracker/Systems/ShipTrackerSystem.cs
index cfd1a61a5d..802c07a393 100644
--- a/Content.Server/_FTL/ShipTracker/Systems/ShipTrackerSystem.cs
+++ b/Content.Server/_FTL/ShipTracker/Systems/ShipTrackerSystem.cs
@@ -1,19 +1,11 @@
using System.Linq;
-using Content.Server._FTL.AutomatedShip.Components;
-using Content.Server._FTL.FTLPoints.Components;
-using Content.Server._FTL.FTLPoints.Systems;
using Content.Server._FTL.ShipTracker.Components;
-using Content.Server.AlertLevel;
-using Content.Server.Atmos.EntitySystems;
using Content.Server.Chat.Systems;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events;
using Content.Shared._FTL.ShipTracker;
-using Content.Shared.Pinpointer;
-using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
using Robust.Shared.Map;
-using Robust.Shared.Map.Components;
-using Robust.Shared.Random;
namespace Content.Server._FTL.ShipTracker.Systems;
@@ -22,89 +14,40 @@ namespace Content.Server._FTL.ShipTracker.Systems;
///
public sealed partial class ShipTrackerSystem : SharedShipTrackerSystem
{
- [Dependency] private readonly AlertLevelSystem _alertLevelSystem = default!;
- [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
- [Dependency] private readonly TransformSystem _transformSystem = default!;
- [Dependency] private readonly FTLPointsSystem _pointsSystem = default!;
- [Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;
- [Dependency] private readonly IRobustRandom _random = default!;
+ [Dependency] private readonly IEntityManager _entityManager = default!;
public override void Initialize()
{
base.Initialize();
- SubscribeLocalEvent(OnFTLCompletedEvent);
- SubscribeLocalEvent(OnFTLStartedEvent);
- SubscribeLocalEvent(OnFTLRequestEvent);
+ //SubscribeLocalEvent(OnFTLStartedEvent);
}
- private void OnFTLRequestEvent(EntityUid uid, ShipTrackerComponent component, ref FTLRequestEvent args)
- {
- _chatSystem.DispatchGlobalAnnouncement(Loc.GetString("ship-ftl-jump-jumped-message"), colorOverride: Color.Gold);
- }
-
- private void OnFTLStartedEvent(EntityUid uid, ShipTrackerComponent component, ref FTLStartedEvent args)
- {
- if (args.FromMapUid != null)
- Del(args.FromMapUid.Value);
-
- _chatSystem.DispatchStationAnnouncement(uid, Loc.GetString("ship-ftl-jump-jumped-message"), colorOverride: Color.Gold);
- }
- private void OnFTLCompletedEvent(EntityUid uid, ShipTrackerComponent component, ref FTLCompletedEvent args)
+ private void BroadcastToStationsOnMap(
+ MapId map,
+ string message,
+ string sender = "Automated Ship",
+ bool playDefaultSound = true,
+ SoundSpecifier? announcementSound = null,
+ Color? colorOverride = null)
{
- RemComp(args.MapUid);
-
- var mapId = Transform(args.MapUid).MapID;
- _mapManager.DoMapInitialize(mapId);
+ // broadcast ONLY to the same map
+ var activeShips = EntityQuery()
+ .Where(x => x.Item2.MapID == map);
- var amount = EntityQuery().Select(x => Transform(x.Owner).MapID == mapId).Count();
- if (amount > 0)
- {
- _chatSystem.DispatchGlobalAnnouncement(Loc.GetString("ship-inbound-message", ("amount", amount)));
- _alertLevelSystem.SetLevel(args.Entity, "blue", true, true, true);
- }
- else
+ foreach (var ship in activeShips.ToList())
{
- _chatSystem.DispatchGlobalAnnouncement(Loc.GetString("ship-ftl-jump-arrival-message"),
- colorOverride: Color.Gold);
+ // rider im not making obsolete code for the LOVE OF GOD
+ _chatSystem.DispatchStationAnnouncement(ship.Item1.Owner, message, sender, playDefaultSound, announcementSound, colorOverride);
}
- _pointsSystem.RegeneratePoints();
}
- public bool TryFindRandomTile(EntityUid targetGrid, out Vector2i tile, out EntityCoordinates targetCoords)
+ private void OnFTLStartedEvent(EntityUid uid, ShipTrackerComponent component, ref FTLStartedEvent args)
{
- tile = default;
-
- targetCoords = EntityCoordinates.Invalid;
-
- if (!TryComp(targetGrid, out var gridComp))
- return false;
-
- var found = false;
- var (gridPos, _, gridMatrix) = _transformSystem.GetWorldPositionRotationMatrix(targetGrid);
- var gridBounds = gridMatrix.TransformBox(gridComp.LocalAABB);
-
- for (var i = 0; i < 10; i++)
- {
- var randomX = _random.Next((int) gridBounds.Left, (int) gridBounds.Right);
- var randomY = _random.Next((int) gridBounds.Bottom, (int) gridBounds.Top);
-
- tile = new Vector2i(randomX - (int) gridPos.X, randomY - (int) gridPos.Y);
- if (_atmosphereSystem.IsTileSpace(targetGrid, Transform(targetGrid).MapUid, tile,
- mapGridComp: gridComp)
- || _atmosphereSystem.IsTileAirBlocked(targetGrid, tile, mapGridComp: gridComp))
- {
- continue;
- }
-
- found = true;
- targetCoords = gridComp.GridTileToLocal(tile);
- break;
- }
-
- return found;
+ // alert those who are going onto map
+ // BroadcastToStationsOnMap(args.TargetCoordinates.GetMapId(_entityManager), Loc.GetString("ship-ftl-jump-jumped-message"), colorOverride: Color.Gold);
}
public override void Update(float frameTime)
@@ -118,10 +61,11 @@ public override void Update(float frameTime)
if (shipTrackerComponent.Destroyed)
continue;
- var active = EntityQuery()
+ var xform = Transform(entity);
+ var activeShuttleComps = EntityQuery()
.Count(tuple => tuple.Item2.GridUid == entity);
-
- if (active > 0)
+
+ if (activeShuttleComps > 0)
{
// not destroyed, aka piloting is there
shipTrackerComponent.SecondsWithoutPiloting = 0f;
@@ -133,8 +77,8 @@ public override void Update(float frameTime)
continue;
shipTrackerComponent.Destroyed = true;
- _chatSystem.DispatchGlobalAnnouncement(Loc.GetString("ship-destroyed-message",
- ("ship", MetaData(entity).EntityName)));
+ // BroadcastToStationsOnMap(xform.MapID, Loc.GetString("ship-destroyed-message",
+ // ("ship", MetaData(entity).EntityName)));
}
}
}
diff --git a/Content.Shared/_FTL/FtlPoints/SharedFtlPointsSystem.cs b/Content.Shared/_FTL/FtlPoints/SharedFtlPointsSystem.cs
new file mode 100644
index 0000000000..7c08f03e7b
--- /dev/null
+++ b/Content.Shared/_FTL/FtlPoints/SharedFtlPointsSystem.cs
@@ -0,0 +1,56 @@
+using System.Numerics;
+using Robust.Shared.Map;
+using Robust.Shared.Serialization;
+
+namespace Content.Shared._FTL.FtlPoints;
+
+public abstract class SharedFtlPointsSystem : EntitySystem
+{
+
+}
+
+[NetSerializable, Serializable]
+public enum StarmapConsoleUiKey : byte
+{
+ Key,
+}
+
+[Serializable, NetSerializable]
+public sealed class WarpToStarMessage : BoundUserInterfaceMessage
+{
+ public Star Star { get; }
+ public WarpToStarMessage(Star star)
+ {
+ Star = star;
+ }
+}
+
+[Serializable, NetSerializable]
+public sealed class StarmapConsoleBoundUserInterfaceState : BoundUserInterfaceState
+{
+ public List Stars;
+ public float Range;
+
+ public StarmapConsoleBoundUserInterfaceState(List stars, float range)
+ {
+ Stars = stars;
+ Range = range;
+ }
+}
+
+[Serializable, NetSerializable]
+public struct Star
+{
+ public Vector2 Position;
+ public Vector2 GlobalPosition;
+ public string Name;
+ public MapId Map;
+
+ public Star(Vector2 position, MapId map, string name, Vector2 globalPosition)
+ {
+ Position = position;
+ Name = name;
+ Map = map;
+ GlobalPosition = globalPosition;
+ }
+}
diff --git a/Resources/ConfigPresets/Ekrixi/ekrixi.toml b/Resources/ConfigPresets/Ekrixi/ekrixi.toml
index 3154104624..d468b3d6cb 100644
--- a/Resources/ConfigPresets/Ekrixi/ekrixi.toml
+++ b/Resources/ConfigPresets/Ekrixi/ekrixi.toml
@@ -3,7 +3,6 @@ tickrate = 30
max_connections = 1024
[game]
-hostname = "[EN] Ekrixi"
desc = "Ekrixi is a PvE fork of SS14 revolving around PvE gameplay, ship travel, and roleplay."
lobbyenabled = true
soft_max_players = 50
diff --git a/Resources/ConfigPresets/Ekrixi/kryo.toml b/Resources/ConfigPresets/Ekrixi/kryo.toml
index 89e575d408..88f04fabd4 100644
--- a/Resources/ConfigPresets/Ekrixi/kryo.toml
+++ b/Resources/ConfigPresets/Ekrixi/kryo.toml
@@ -1,6 +1,6 @@
[game]
-hostname = "[EN][LM] Official Ekrixi Servers - Krýo"
-desc = "Krýo is a stable branch server of Ekrixi."
+hostname = "[EN][LM] Scorched Stars - Krýo | EKRIXICODE"
+desc = "Krýo is the stable branch server of Ekrixi."
[whitelist]
enabled = false
diff --git a/Resources/Locale/en-US/_ftl/ships.ftl b/Resources/Locale/en-US/_ftl/ships.ftl
deleted file mode 100644
index 761c235ae6..0000000000
--- a/Resources/Locale/en-US/_ftl/ships.ftl
+++ /dev/null
@@ -1,25 +0,0 @@
-ship-ftl-jump-soon-message = Attention all crew. Ship coil spin initiated, course set to {$destination}. Prepare for jump in T-15 seconds.
-ship-ftl-jump-jumped-message = Attention all crew. Ship coil spin stable. Re-entry into realspace ETA in T-60 seconds.
-ship-ftl-jump-arrival-message = Attention all crew. Ship has officially re-entered realspace. Coolant systems initiated.
-
-ship-destroyed-message = We are receiving no more inbound pings from {$ship}.
-ship-inbound-message = Alert! Sensor array output have detected {$amount ->
- [one] a ship
- *[other] {$amount} ships
- } in the area. Hostility unknown. Automatically elevating to Blue alert.
-
-ship-ftl-tag-star = STAR
-ship-ftl-tag-base = BASE
-ship-ftl-tag-danger = !!!!
-ship-ftl-tag-unknown = ????
-ship-ftl-tag-planet = PLNT
-ship-ftl-tag-moon = MOON
-ship-ftl-tag-ruin = RUIN
-ship-ftl-tag-yard = YARD
-ship-ftl-tag-asteroid = ROID
-
-ship-state-tag-neutral = NTRL
-ship-state-tag-hostile = HSTL
-
-ship-shield-examine-inactive-message = The shield generator is [color=#ff0000]inactive[/color].
-ship-shield-examine-active-message = The shield generator is [color=#00ff00]active[/color].
diff --git a/Resources/Locale/en-US/_ftl/starmap.ftl b/Resources/Locale/en-US/_ftl/starmap.ftl
new file mode 100644
index 0000000000..54f1c45b1a
--- /dev/null
+++ b/Resources/Locale/en-US/_ftl/starmap.ftl
@@ -0,0 +1,46 @@
+ship-ftl-jump-soon-message = Attention all crew. Ship coil spin initiated, course set to {$destination}. Prepare for jump in T-15 seconds.
+ship-ftl-jump-jumped-message = Attention all crew. Ship coil spin stable. Re-entry into realspace ETA in T-60 seconds.
+ship-ftl-jump-arrival-message = Attention all crew. Ship has officially re-entered realspace. Coolant systems initiated.
+
+ship-destroyed-message = We are receiving no more inbound pings from {$ship}.
+ship-inbound-message = Alert! Sensor array output have detected {$amount ->
+ [one] a ship
+ *[other] {$amount} ships
+ } in the area. {$hostile ->
+ [true] Hostilities confirmed!
+ *[false] No hostile activity detected.
+ } Automatically elevating to Blue alert.
+
+ship-ftl-tag-star = STAR
+ship-ftl-tag-base = BASE
+ship-ftl-tag-planet = PLNT
+ship-ftl-tag-ruin = RUIN
+ship-ftl-tag-yard = YARD
+ship-ftl-tag-gateway = GATE
+ship-ftl-tag-warp = WARP
+ship-ftl-tag-asteroid = ROID
+ship-ftl-tag-oor = OUT OF RANGE
+
+ship-state-tag-neutral = NTRL
+ship-state-tag-hostile = HSTL
+
+starmap-computer-title = Starmap Computer
+
+starmap-details-display-label = Details
+starmap-star-details-current-star = Current Star:
+starmap-star-details-spin-range = Spin Range:
+starmap-star-details-crystal-integrity = Integrity:
+
+starmap-star-details-display-label = Selected Star
+starmap-star-details-name = Name:
+starmap-star-details-coordinates = Coordinates:
+
+starmap-star-details-button-warp = Warp
+starmap-star-details-position = X: {$x} Y: {$y}
+
+starmap-center-station = Trading Outpost
+
+starmap-alert-near = NEAR
+starmap-alert-low = LOW
+starmap-alert-danger = DANGER
+starmap-alert-critical = ! CRITICAL !
diff --git a/Resources/Maps/_FTL/maps/trade-station.yml b/Resources/Maps/_FTL/maps/trade-station.yml
index 5bf0eb2b09..22de2506ae 100644
--- a/Resources/Maps/_FTL/maps/trade-station.yml
+++ b/Resources/Maps/_FTL/maps/trade-station.yml
@@ -13400,97 +13400,6 @@ entities:
- pos: 7.5,6.5
parent: 2
type: Transform
-- proto: MachineSleeperCryopod
- entities:
- - uid: 1200
- components:
- - pos: -13.5,16.5
- parent: 2
- type: Transform
- - uid: 1984
- components:
- - rot: 1.5707963267948966 rad
- pos: -14.5,13.5
- parent: 2
- type: Transform
- - uid: 2231
- components:
- - rot: -1.5707963267948966 rad
- pos: -12.5,15.5
- parent: 2
- type: Transform
- - uid: 2232
- components:
- - rot: -1.5707963267948966 rad
- pos: -12.5,14.5
- parent: 2
- type: Transform
- - uid: 2233
- components:
- - rot: -1.5707963267948966 rad
- pos: -12.5,12.5
- parent: 2
- type: Transform
- - uid: 2244
- components:
- - rot: -1.5707963267948966 rad
- pos: -12.5,11.5
- parent: 2
- type: Transform
- - uid: 2245
- components:
- - rot: -1.5707963267948966 rad
- pos: -12.5,10.5
- parent: 2
- type: Transform
- - uid: 2246
- components:
- - rot: 1.5707963267948966 rad
- pos: -14.5,10.5
- parent: 2
- type: Transform
- - uid: 2247
- components:
- - rot: 1.5707963267948966 rad
- pos: -14.5,11.5
- parent: 2
- type: Transform
- - uid: 2248
- components:
- - rot: 1.5707963267948966 rad
- pos: -14.5,12.5
- parent: 2
- type: Transform
- - uid: 2357
- components:
- - rot: 1.5707963267948966 rad
- pos: -14.5,14.5
- parent: 2
- type: Transform
- - uid: 2703
- components:
- - rot: 1.5707963267948966 rad
- pos: -14.5,15.5
- parent: 2
- type: Transform
- - uid: 2704
- components:
- - rot: 1.5707963267948966 rad
- pos: -14.5,16.5
- parent: 2
- type: Transform
- - uid: 2706
- components:
- - rot: 3.141592653589793 rad
- pos: -13.5,10.5
- parent: 2
- type: Transform
- - uid: 2707
- components:
- - rot: -1.5707963267948966 rad
- pos: -12.5,16.5
- parent: 2
- type: Transform
- proto: MagazinePistolHighCapacity
entities:
- uid: 2831
diff --git a/Resources/Prototypes/_FTL/Entities/Structures/Machines/Computers/starmap.yml b/Resources/Prototypes/_FTL/Entities/Structures/Machines/Computers/starmap.yml
new file mode 100644
index 0000000000..f34fe8209a
--- /dev/null
+++ b/Resources/Prototypes/_FTL/Entities/Structures/Machines/Computers/starmap.yml
@@ -0,0 +1,29 @@
+- type: entity
+ parent: BaseComputer
+ id: ComputerStarmap
+ name: starmap computer
+ description: A controller for the spin-drive.
+ components:
+ - type: Sprite
+ layers:
+ - map: ["computerLayerBody"]
+ state: computer
+ - map: ["computerLayerKeyboard"]
+ state: generic_keyboard
+ - map: ["computerLayerScreen"]
+ state: solar_screen
+ - map: ["computerLayerKeys"]
+ state: generic_keys
+ - type: StarmapConsole
+ - type: ActivatableUI
+ key: enum.StarmapConsoleUiKey.Key
+ - type: UserInterface
+ interfaces:
+ - key: enum.StarmapConsoleUiKey.Key
+ type: StarmapConsoleBoundUserInterface
+# - type: Computer
+# board: SolarControlComputerCircuitboard
+ - type: PointLight
+ radius: 1.5
+ energy: 1.6
+ color: "#e6e227"
diff --git a/Resources/Prototypes/_FTL/ftl_points.yml b/Resources/Prototypes/_FTL/ftl_points.yml
index a7b6c2a2dc..ad9dbe2ddd 100644
--- a/Resources/Prototypes/_FTL/ftl_points.yml
+++ b/Resources/Prototypes/_FTL/ftl_points.yml
@@ -3,10 +3,12 @@
tag: ship-ftl-tag-base
effects:
- !type:SpawnStationEffect
+ components:
+ - type: AvoidStar
- type: ftlPoint
id: LoDangerPoint
- tag: ship-ftl-tag-unknown
+ tag: ship-ftl-tag-star
probability: 0.6
effects:
- !type:SpawnMapEffect
@@ -19,7 +21,7 @@
- type: ftlPoint
id: HiDangerPoint
- tag: ship-ftl-tag-unknown
+ tag: ship-ftl-tag-star
probability: 0.9
effects:
- !type:SpawnMapEffect
@@ -33,7 +35,7 @@
- type: ftlPoint
id: ConfDangerPoint
- tag: ship-ftl-tag-danger
+ tag: ship-ftl-tag-star
effects:
- !type:SpawnMapEffect
mapPaths:
@@ -72,16 +74,8 @@
- Blood
- !type:SpawnDungeonEffect
range: 75
-
-- type: ftlPoint
- id: MoonPoint
- tag: ship-ftl-tag-moon
- effects:
- - !type:ToPlanetEffect
- biomeTemplates:
- - Caves
- - !type:SpawnDungeonEffect
- range: 100
+ components:
+ - type: AvoidStar
- type: ftlPoint
id: AsteroidPoint
@@ -104,11 +98,39 @@
tag: ship-ftl-tag-ruin
effects:
- !type:SpawnDungeonEffect
+ components:
+ - type: AvoidStar
- type: ftlPoint
id: NoDangerPoint
- tag: ship-ftl-tag-unknown
+ tag: ship-ftl-tag-star
+ effects: []
+
+- type: ftlPoint
+ id: WarpPoint
+ tag: ship-ftl-tag-warp
effects: []
+ components:
+ - type: AvoidStar
+ - type: FactoryTick
+ mapPaths:
+ - /Maps/_FTL/ancient/easy-drone.yml
+ - /Maps/_FTL/ancient/tough-drone.yml
+ - /Maps/_FTL/independent/orb.yml
+ - /Maps/_FTL/independent/pod.yml
+ - /Maps/_FTL/independent/rod.yml
+ - /Maps/_FTL/independent/hostile-escape-pod.yml
+ - /Maps/_FTL/independent/cargo-vessel.yml
+ - /Maps/_FTL/incsek/bomber.yml
+ - /Maps/_FTL/coregov/retribution.yml
+ - /Maps/_FTL/fsc/fighter.yml
+
+#- type: ftlPoint
+# id: ShipyardPoint
+# tag: ship-ftl-tag-yard
+# effects: []
+# components:
+# - type: FactoryTick
- type: weightedRandom
id: FTLPoints
@@ -118,7 +140,4 @@
HiDangerPoint: 3
NoDangerPoint: 1
StarPoint: 1
- PlanetPoint: 1
- StationPoint: 1
- MoonPoint: 0.25
RuinPoint: 0.15