Printable drills and constructable thrusters (#12943)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Content.Server.Audio;
|
||||
using Content.Server.Construction;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
using Content.Server.Shuttles.Components;
|
||||
@@ -58,6 +59,9 @@ namespace Content.Server.Shuttles.Systems
|
||||
|
||||
SubscribeLocalEvent<ThrusterComponent, ExaminedEvent>(OnThrusterExamine);
|
||||
|
||||
SubscribeLocalEvent<ThrusterComponent, RefreshPartsEvent>(OnRefreshParts);
|
||||
SubscribeLocalEvent<ThrusterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
||||
|
||||
_mapManager.TileChanged += OnTileChange;
|
||||
}
|
||||
|
||||
@@ -515,6 +519,18 @@ namespace Content.Server.Shuttles.Systems
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRefreshParts(EntityUid uid, ThrusterComponent component, RefreshPartsEvent args)
|
||||
{
|
||||
var thrustRating = args.PartRatings[component.MachinePartThrust];
|
||||
|
||||
component.Thrust = component.BaseThrust * MathF.Pow(component.PartRatingThrustMultiplier, thrustRating - 1);
|
||||
}
|
||||
|
||||
private void OnUpgradeExamine(EntityUid uid, ThrusterComponent component, UpgradeExamineEvent args)
|
||||
{
|
||||
args.AddPercentageUpgrade("thruster-comp-upgrade-thrust", component.Thrust / component.BaseThrust);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
|
||||
Reference in New Issue
Block a user