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

@@ -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)