fix(production): correct blueprint power and planner edge cases

Read the Advanced Mining Machine speed stored with station settings in prebuild
and blueprint captures, and count charging power nodes such as Satellite
Substations at their idle draw. Skip recipes that consume their own product when
choosing an item's default recipe, so Refined Oil uses Plasma Refining instead
of Reforming Refine.

Run each planner recipe in one proliferation mode and report conflicting
explicit modes, keep material flows for recipe types the catalog does not know,
and attribute receiver warnings to their recipe. Compare simplex ratio ties
relatively and drive out near-zero artificials without amplifying residuals.
Bound the steady-state reduction so lossless cycles cannot stall blueprint
descriptions, and choose power units after rounding.

Remove redundant code: share the numeric and flow helpers, and drop the unused
IsExcessIntermediate threshold, legacy constructor and Capture overloads, the
multi-field updater, and the unused proliferator source table.
This commit is contained in:
soarqin committed 2026-10-25 15:24:38 +08:00
1 parent 4839f868e1
commit d941de2810
24 files changed
+463 -404

No files matched your search

+3 -3
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using static UXAssist.Production.ProductionMath;
namespace UXAssist.Production;
@@ -74,7 +75,7 @@ public sealed class LaunchProcessAdapter : IProductionProcessAdapter
}
var nativeStep = Math.Truncate(10000 * (1 + speedBonus) + 0.1) * (boosted ? 10 : 1);
if (nativeStep <= 0 || double.IsInfinity(nativeStep) || double.IsNaN(nativeStep))
if (!FinitePositive(nativeStep))
{
diagnostic = new ProductionDiagnostic(ProductionDiagnosticCode.InvalidRequest,
"The launcher's native speed is outside the supported range.", buildingItemId: building.ItemId);
@@ -84,8 +85,7 @@ public sealed class LaunchProcessAdapter : IProductionProcessAdapter
var cycleTicks = Math.Ceiling(building.LaunchChargeTicks * 10000.0 / nativeStep) +
Math.Ceiling(building.LaunchCooldownTicks * 10000.0 / nativeStep);
var launchesPerMinute = 3600.0 / cycleTicks;
if (launchesPerMinute <= 0 || double.IsInfinity(launchesPerMinute) ||
double.IsNaN(launchesPerMinute))
if (!FinitePositive(launchesPerMinute))
{
diagnostic = new ProductionDiagnostic(ProductionDiagnosticCode.InvalidRequest,
"The launcher cycle is outside the supported range.", buildingItemId: building.ItemId);