Rip out remaining machine upgrades (#24413)

* Rip out remaining machine upgrades

* eek
This commit is contained in:
Nemanja
2024-01-22 17:13:04 -05:00
committed by GitHub
parent 7daf7ac0be
commit a9e89ab372
79 changed files with 36 additions and 1135 deletions

View File

@@ -1,10 +1,8 @@
using System.Numerics;
using Content.Server.Shuttles.Systems;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Damage;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Shuttles.Components
{
@@ -27,9 +25,6 @@ namespace Content.Server.Shuttles.Components
[ViewVariables(VVAccess.ReadWrite), DataField("thrust")]
public float Thrust = 100f;
[DataField("baseThrust"), ViewVariables(VVAccess.ReadWrite)]
public float BaseThrust = 100f;
[DataField("thrusterType")]
public ThrusterType Type = ThrusterType.Linear;
@@ -60,12 +55,6 @@ namespace Content.Server.Shuttles.Components
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("nextFire", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan NextFire;
[DataField("machinePartThrust", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartThrust = "Capacitor";
[DataField("partRatingThrustMultiplier")]
public float PartRatingThrustMultiplier = 1.5f;
}
public enum ThrusterType

View File

@@ -52,9 +52,6 @@ public sealed class ThrusterSystem : EntitySystem
SubscribeLocalEvent<ThrusterComponent, ExaminedEvent>(OnThrusterExamine);
SubscribeLocalEvent<ThrusterComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<ThrusterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<ShuttleComponent, TileChangedEvent>(OnShuttleTileChange);
}
@@ -204,12 +201,10 @@ public sealed class ThrusterSystem : EntitySystem
if (component.Type == ThrusterType.Linear)
{
oldShuttleComponent.LinearThrust[oldDirection] -= component.Thrust;
oldShuttleComponent.BaseLinearThrust[oldDirection] -= component.BaseThrust;
DebugTools.Assert(oldShuttleComponent.LinearThrusters[oldDirection].Contains(uid));
oldShuttleComponent.LinearThrusters[oldDirection].Remove(uid);
shuttleComponent.LinearThrust[direction] += component.Thrust;
shuttleComponent.BaseLinearThrust[direction] += component.BaseThrust;
DebugTools.Assert(!shuttleComponent.LinearThrusters[direction].Contains(uid));
shuttleComponent.LinearThrusters[direction].Add(uid);
}
@@ -283,7 +278,6 @@ public sealed class ThrusterSystem : EntitySystem
var direction = (int) xform.LocalRotation.GetCardinalDir() / 2;
shuttleComponent.LinearThrust[direction] += component.Thrust;
shuttleComponent.BaseLinearThrust[direction] += component.BaseThrust;
DebugTools.Assert(!shuttleComponent.LinearThrusters[direction].Contains(uid));
shuttleComponent.LinearThrusters[direction].Add(uid);
@@ -382,7 +376,6 @@ public sealed class ThrusterSystem : EntitySystem
var direction = (int) angle.Value.GetCardinalDir() / 2;
shuttleComponent.LinearThrust[direction] -= component.Thrust;
shuttleComponent.BaseLinearThrust[direction] -= component.BaseThrust;
DebugTools.Assert(shuttleComponent.LinearThrusters[direction].Contains(uid));
shuttleComponent.LinearThrusters[direction].Remove(uid);
break;
@@ -578,24 +571,6 @@ public sealed class ThrusterSystem : EntitySystem
}
}
private void OnRefreshParts(EntityUid uid, ThrusterComponent component, RefreshPartsEvent args)
{
if (component.IsOn) // safely disable thruster to prevent negative thrust
DisableThruster(uid, component);
var thrustRating = args.PartRatings[component.MachinePartThrust];
component.Thrust = component.BaseThrust * MathF.Pow(component.PartRatingThrustMultiplier, thrustRating - 1);
if (component.Enabled && CanEnable(uid, component))
EnableThruster(uid, component);
}
private void OnUpgradeExamine(EntityUid uid, ThrusterComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("thruster-comp-upgrade-thrust", component.Thrust / component.BaseThrust);
}
#endregion
private int GetFlagIndex(DirectionFlag flag)