Printable drills and constructable thrusters (#12943)

This commit is contained in:
Nemanja
2022-12-18 23:38:30 -05:00
committed by GitHub
parent 494b416999
commit cdc6716859
9 changed files with 128 additions and 26 deletions

View File

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