Material generators from Afterlight (#18387)
This commit is contained in:
@@ -76,8 +76,12 @@ internal sealed class PowerMonitoringConsoleSystem : EntitySystem
|
||||
}
|
||||
foreach (PowerSupplierComponent pcc in netQ.Suppliers)
|
||||
{
|
||||
sources.Add(LoadOrSource(pcc, pcc.MaxSupply, false));
|
||||
totalSources += pcc.MaxSupply;
|
||||
var supply = pcc.Enabled
|
||||
? pcc.MaxSupply
|
||||
: 0f;
|
||||
|
||||
sources.Add(LoadOrSource(pcc, supply, false));
|
||||
totalSources += supply;
|
||||
}
|
||||
foreach (BatteryDischargerComponent pcc in netQ.Dischargers)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ public sealed class UpgradePowerSystem : EntitySystem
|
||||
load *= MathF.Pow(component.PowerDrawMultiplier, rating - 1);
|
||||
break;
|
||||
default:
|
||||
Logger.Error($"invalid power scaling type for {ToPrettyString(uid)}.");
|
||||
Log.Error($"invalid power scaling type for {ToPrettyString(uid)}.");
|
||||
load = 0;
|
||||
break;
|
||||
}
|
||||
@@ -82,19 +82,19 @@ public sealed class UpgradePowerSystem : EntitySystem
|
||||
supply *= MathF.Pow(component.PowerSupplyMultiplier, rating - 1);
|
||||
break;
|
||||
default:
|
||||
Logger.Error($"invalid power scaling type for {ToPrettyString(uid)}.");
|
||||
Log.Error($"invalid power scaling type for {ToPrettyString(uid)}.");
|
||||
supply = component.BaseSupplyRate;
|
||||
break;
|
||||
}
|
||||
|
||||
component.ActualScalar = supply / component.BaseSupplyRate;
|
||||
|
||||
if (TryComp<PowerSupplierComponent>(uid, out var powa))
|
||||
powa.MaxSupply = supply;
|
||||
}
|
||||
|
||||
private void OnSupplierUpgradeExamine(EntityUid uid, UpgradePowerSupplierComponent component, UpgradeExamineEvent args)
|
||||
{
|
||||
// UpgradePowerSupplierComponent.PowerSupplyMultiplier is not the actual multiplier, so we have to do this.
|
||||
if (TryComp<PowerSupplierComponent>(uid, out var powa))
|
||||
args.AddPercentageUpgrade("upgrade-power-supply", powa.MaxSupply / component.BaseSupplyRate);
|
||||
args.AddPercentageUpgrade("upgrade-power-supply", component.ActualScalar);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user