Machine upgrade examine verb (#12119)

This commit is contained in:
0x6273
2022-11-04 04:27:47 +01:00
committed by GitHub
parent 5ede1f4862
commit a201d777bc
22 changed files with 205 additions and 3 deletions

View File

@@ -39,6 +39,7 @@ namespace Content.Server.Singularity.EntitySystems
SubscribeLocalEvent<EmitterComponent, PowerConsumerReceivedChanged>(ReceivedChanged);
SubscribeLocalEvent<EmitterComponent, InteractHandEvent>(OnInteractHand);
SubscribeLocalEvent<EmitterComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<EmitterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
}
private void OnInteractHand(EntityUid uid, EmitterComponent component, InteractHandEvent args)
@@ -109,6 +110,13 @@ namespace Content.Server.Singularity.EntitySystems
component.FireBurstDelayMax = component.BaseFireBurstDelayMax * MathF.Pow(component.FireRateMultiplier, fireRateRating - 1);
}
private void OnUpgradeExamine(EntityUid uid, EmitterComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("emitter-component-upgrade-fire-rate", (float) (component.BaseFireInterval.TotalSeconds / component.FireInterval.TotalSeconds));
// TODO: Remove this and use UpgradePowerDrawComponent instead.
args.AddPercentageUpgrade("upgrade-power-draw", component.PowerUseActive / (float) component.BasePowerUseActive);
}
public void SwitchOff(EmitterComponent component)
{
component.IsOn = false;