Material generators from Afterlight (#18387)
This commit is contained in:
@@ -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