diff --git a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.FTL.cs b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.FTL.cs index c214bb015c..9eac3e68af 100644 --- a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.FTL.cs +++ b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.FTL.cs @@ -128,6 +128,9 @@ private void ConsoleFTL(Entity ent, EntityCoordinates t if (!_shuttle.CanFTL(shuttleUid.Value, out var reason)) { // TODO: Session popup + // Exodus-DynamicFTLMass-start + _popup.PopupEntity(reason, ent.Owner, Shared.Popups.PopupType.Medium); + // Exodus-DynamicFTLMass-end return; } diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index 5128869103..333c353748 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -37,7 +37,7 @@ public sealed partial class ShuttleSystem public const float DefaultTravelTime = 20f; public const float DefaultArrivalTime = 5f; private const float FTLCooldown = 10f; - public const float FTLMassLimit = 300f; + public const float FTLMassParametr = 0.5f; // Exodus-DynamicFTLMass // I'm too lazy to make CVars. @@ -210,7 +210,11 @@ public bool CanFTL(EntityUid shuttleUid, [NotNullWhen(false)] out string? reason return false; } - if (TryComp(shuttleUid, out PhysicsComponent? shuttlePhysics) && shuttlePhysics.Mass > FTLMassLimit) + // Exodus-DynamicFTLMass-start + if (TryComp(shuttleUid, out PhysicsComponent? shuttlePhysics) && + TryComp(shuttleUid, out var shuttleComp) && + shuttlePhysics.Mass > CalculateFTLMassLimit(shuttleUid, shuttleComp)) + // Exodus-DynamicFTLMass-end { reason = Loc.GetString("shuttle-console-mass"); return false; @@ -235,6 +239,13 @@ public bool CanFTL(EntityUid shuttleUid, [NotNullWhen(false)] out string? reason return true; } + // Exodus-DynamicFTLMass-start + public float CalculateFTLMassLimit(EntityUid shuttleUid, ShuttleComponent shuttleComp) + { + return _thruster.GetThrustValueDirection(shuttleComp, DirectionFlag.North) * FTLMassParametr; + } + // Exodus-DynamicFTLMass-end + /// /// Moves a shuttle from its current position to the target one without any checks. Goes through the hyperspace map while the timer is running. /// diff --git a/Content.Server/Shuttles/Systems/ThrusterSystem.cs b/Content.Server/Shuttles/Systems/ThrusterSystem.cs index 74c42ccbc5..73314ccc94 100644 --- a/Content.Server/Shuttles/Systems/ThrusterSystem.cs +++ b/Content.Server/Shuttles/Systems/ThrusterSystem.cs @@ -572,6 +572,15 @@ public void SetAngularThrust(ShuttleComponent component, bool on) #endregion + + // Exodus-DynamicFTLMass-start + public float GetThrustValueDirection(ShuttleComponent shuttleComp, DirectionFlag flag) + { + var index = GetFlagIndex(flag); + return shuttleComp.LinearThrust[index]; + } + // Exodus-DynamicFTLMass-end + private int GetFlagIndex(DirectionFlag flag) { return (int) Math.Log2((int) flag); diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/body/organs/kidan.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/entities/body/organs/kidan.ftl similarity index 100% rename from Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/body/organs/kidan.ftl rename to Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/entities/body/organs/kidan.ftl diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/body/parts/kidan.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/entities/body/parts/kidan.ftl similarity index 100% rename from Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/body/parts/kidan.ftl rename to Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/entities/body/parts/kidan.ftl diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/entities/structures/shuttles/thrusters.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/entities/structures/shuttles/thrusters.ftl new file mode 100644 index 0000000000..49e9613949 --- /dev/null +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/exodus/entities/structures/shuttles/thrusters.ftl @@ -0,0 +1,4 @@ +ent-BigThruster = большой ракетный двигатель + .desc = { ent-Thruster.desc } +ent-LargeThruster = огромный ракетный двигатель + .desc = { ent-Thruster.desc } diff --git a/Resources/Prototypes/Exodus/Entities/Structures/Shuttles/thrusters.yml b/Resources/Prototypes/Exodus/Entities/Structures/Shuttles/thrusters.yml new file mode 100644 index 0000000000..7294fe8717 --- /dev/null +++ b/Resources/Prototypes/Exodus/Entities/Structures/Shuttles/thrusters.yml @@ -0,0 +1,87 @@ +- type: entity + id: BigThruster + parent: Thruster + name: big thruster + description: A thruster that allows a shuttle to move. + components: + - type: Thruster + thrust: 300 + burnShape: + - 0.4,0.5 + - -0.4,2.2 + - -0.6,2.2 + - -1.4,0.5 + damage: + types: + Heat: 150 + - type: Fixtures + fixtures: + fix1: + shape: + !type:PhysShapeAabb + bounds: "-1.45,-1.45,0.45,0.45" + density: 60 + mask: + - MachineMask + layer: + - MachineLayer + - type: Sprite + sprite: Structures/Shuttles/thruster.rsi + scale: 2.0,2.0 + offset: -0.5,-0.5 + layers: + - state: base + map: ["enum.ThrusterVisualLayers.Base"] + - state: thrust + map: ["enum.ThrusterVisualLayers.ThrustOn"] + shader: unshaded + visible: false + - state: thrust_burn_unshaded + map: ["enum.ThrusterVisualLayers.ThrustingUnshaded"] + shader: unshaded + visible: false + offset: 0, 1 + +- type: entity + id: LargeThruster + parent: Thruster + name: large thruster + description: A thruster that allows a shuttle to move. + components: + - type: Thruster + thrust: 700 + burnShape: + - 1.4,0.5 + - -0.3,3.2 + - 0.3,3.2 + - -1.4,0.5 + damage: + types: + Heat: 500 + - type: Fixtures + fixtures: + fix1: + shape: + !type:PhysShapeAabb + bounds: "-1.45,-2.45,1.45,0.45" + density: 60 + mask: + - MachineMask + layer: + - MachineLayer + - type: Sprite + sprite: Structures/Shuttles/thruster.rsi + scale: 3.0,3.0 + offset: 0,-1 + layers: + - state: base + map: ["enum.ThrusterVisualLayers.Base"] + - state: thrust + map: ["enum.ThrusterVisualLayers.ThrustOn"] + shader: unshaded + visible: false + - state: thrust_burn_unshaded + map: ["enum.ThrusterVisualLayers.ThrustingUnshaded"] + shader: unshaded + visible: false + offset: 0, 1