zc
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -241,6 +241,7 @@
|
||||
<Compile Include="Building_Comps\ARA_BuildingTerrainSpawn\CompProperties_DelayedTerrainSpawn.cs" />
|
||||
<Compile Include="Building_Comps\ARA_CompInteractiveProducer\CompInteractiveProducer.cs" />
|
||||
<Compile Include="Building_Comps\ARA_CompInteractiveProducer\CompQueuedInteractiveProducer.cs" />
|
||||
<Compile Include="Building_Comps\ARA_CompInteractiveProducer\CompQueuedInteractiveProducerWithFlux.cs" />
|
||||
<Compile Include="Building_Comps\CompRefuelableNutrition.cs" />
|
||||
<Compile Include="Building_Comps\CompTemperatureRuinableDamage.cs" />
|
||||
<Compile Include="Building_Comps\ARA_CompInteractiveProducer\DataContracts.cs" />
|
||||
@@ -259,6 +260,7 @@
|
||||
<Compile Include="Building_Comps\ARA_NutrientVat\DefModExtension_NutrientVat.cs" />
|
||||
<Compile Include="Building_Comps\ARA_SpawnPawnFromList\CompProperties_SpawnPawnFromList.cs" />
|
||||
<Compile Include="Building_Comps\ARA_SpawnPawnFromList\CompQueuedPawnSpawner.cs" />
|
||||
<Compile Include="Building_Comps\ARA_SpawnPawnFromList\CompQueuedPawnSpawnerWithFlux.cs" />
|
||||
<Compile Include="Building_Comps\ARA_SpawnPawnFromList\CompSpawnPawnFromList.cs" />
|
||||
<Compile Include="Building_Comps\ARA_SpawnPawnFromList\JobDriver_AddToQueue.cs" />
|
||||
<Compile Include="Building_Comps\ARA_SpawnPawnFromList\JobDriver_Incubate.cs" />
|
||||
|
||||
@@ -55,16 +55,16 @@ namespace ArachnaeSwarm
|
||||
[StaticConstructorOnStartup]
|
||||
public class CompQueuedInteractiveProducer : ThingComp
|
||||
{
|
||||
private List<QueuedProcessOrder> productionOrders = new List<QueuedProcessOrder>();
|
||||
protected List<QueuedProcessOrder> productionOrders = new List<QueuedProcessOrder>();
|
||||
public ProcessDef selectedProcess;
|
||||
|
||||
private CompRefuelableNutrition _fuelComp;
|
||||
private CompAffectedByFacilities _facilitiesComp;
|
||||
private List<ProcessDef> _cachedProcesses;
|
||||
protected CompRefuelableNutrition _fuelComp;
|
||||
protected CompAffectedByFacilities _facilitiesComp;
|
||||
protected List<ProcessDef> _cachedProcesses;
|
||||
|
||||
public CompProperties_QueuedInteractiveProducer Props => (CompProperties_QueuedInteractiveProducer)props;
|
||||
private CompRefuelableNutrition FuelComp => _fuelComp ?? (_fuelComp = parent.GetComp<CompRefuelableNutrition>());
|
||||
private CompAffectedByFacilities FacilitiesComp => _facilitiesComp ?? (_facilitiesComp = parent.GetComp<CompAffectedByFacilities>());
|
||||
protected CompRefuelableNutrition FuelComp => _fuelComp ?? (_fuelComp = parent.GetComp<CompRefuelableNutrition>());
|
||||
protected CompAffectedByFacilities FacilitiesComp => _facilitiesComp ?? (_facilitiesComp = parent.GetComp<CompAffectedByFacilities>());
|
||||
|
||||
public List<ProcessDef> Processes
|
||||
{
|
||||
@@ -225,7 +225,7 @@ namespace ArachnaeSwarm
|
||||
return (finalQuality, progress, order.temperaturePenaltyPercent);
|
||||
}
|
||||
|
||||
private void FinishProduction(QueuedProcessOrder order)
|
||||
protected virtual void FinishProduction(QueuedProcessOrder order)
|
||||
{
|
||||
if (order.process == null)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace ArachnaeSwarm
|
||||
public float NeutronFlux => neutronFlux;
|
||||
public float RawFlux => neutronFlux;
|
||||
public FluxMode CurrentFluxMode => fluxMode;
|
||||
public float FluxEfficiency => IFluxController.GetEfficiency(neutronFlux);
|
||||
public float FluxEfficiency => IFluxControllerExtensions.GetEfficiency(neutronFlux);
|
||||
public bool IsAutoMode => fluxMode != FluxMode.Manual;
|
||||
public bool IsIncubating => IsAnyOrderActive;
|
||||
public bool IsDormant => neutronFlux < 0.05f;
|
||||
|
||||
@@ -23,16 +23,16 @@ namespace ArachnaeSwarm
|
||||
|
||||
public class CompQueuedPawnSpawner : ThingComp
|
||||
{
|
||||
private List<QueuedProductionOrder> productionOrders = new List<QueuedProductionOrder>();
|
||||
protected List<QueuedProductionOrder> productionOrders = new List<QueuedProductionOrder>();
|
||||
public QueuedPawnSpawnEntry selectedEntry;
|
||||
|
||||
private CompRefuelableNutrition _fuelComp;
|
||||
private CompAffectedByFacilities _facilitiesComp;
|
||||
protected CompRefuelableNutrition _fuelComp;
|
||||
protected CompAffectedByFacilities _facilitiesComp;
|
||||
|
||||
public CompProperties_QueuedPawnSpawner Props => (CompProperties_QueuedPawnSpawner)props;
|
||||
|
||||
private CompRefuelableNutrition FuelComp => _fuelComp ?? (_fuelComp = parent.GetComp<CompRefuelableNutrition>());
|
||||
private CompAffectedByFacilities FacilitiesComp => _facilitiesComp ?? (_facilitiesComp = parent.GetComp<CompAffectedByFacilities>());
|
||||
protected CompRefuelableNutrition FuelComp => _fuelComp ?? (_fuelComp = parent.GetComp<CompRefuelableNutrition>());
|
||||
protected CompAffectedByFacilities FacilitiesComp => _facilitiesComp ?? (_facilitiesComp = parent.GetComp<CompAffectedByFacilities>());
|
||||
|
||||
public override void Initialize(CompProperties props)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace ArachnaeSwarm
|
||||
public float NeutronFlux => neutronFlux;
|
||||
public float RawFlux => neutronFlux;
|
||||
public FluxMode CurrentFluxMode => fluxMode;
|
||||
public float FluxEfficiency => IFluxController.GetEfficiency(neutronFlux);
|
||||
public float FluxEfficiency => IFluxControllerExtensions.GetEfficiency(neutronFlux);
|
||||
public bool IsAutoMode => fluxMode != FluxMode.Manual;
|
||||
public bool IsIncubating => IsAnyOrderActive;
|
||||
public bool IsDormant => neutronFlux < 0.05f;
|
||||
|
||||
@@ -116,10 +116,10 @@ namespace ArachnaeSwarm
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ShouldAutoRefuelNow =>
|
||||
public new bool ShouldAutoRefuelNow =>
|
||||
allowAutoRefuel && TargetFuelLevel > 0.01f && (Fuel < TargetFuelLevel * 0.75f || Fuel == 0f);
|
||||
|
||||
public override bool ShouldAutoRefuelNowIgnoringFuelPct =>
|
||||
public new bool ShouldAutoRefuelNowIgnoringFuelPct =>
|
||||
allowAutoRefuel && TargetFuelLevel > 0.01f && Fuel < TargetFuelLevel;
|
||||
|
||||
// 覆盖基类属性,确保 WorkGiver 扫描时拦截
|
||||
|
||||
@@ -35,9 +35,12 @@ namespace ArachnaeSwarm
|
||||
// === 属性 ===
|
||||
public IFluxController FluxController => this;
|
||||
public float NeutronFlux => neutronFlux;
|
||||
public float RawFlux => neutronFlux;
|
||||
public FluxMode FluxMode => fluxMode;
|
||||
public float FluxEfficiency => IFluxController.GetEfficiency(neutronFlux);
|
||||
public FluxMode CurrentFluxMode => fluxMode;
|
||||
public float FluxEfficiency => IFluxControllerExtensions.GetEfficiency(neutronFlux);
|
||||
public bool IsAutoMode => fluxMode != FluxMode.Manual;
|
||||
public bool IsIncubating => isIncubating;
|
||||
public bool IsDormant => neutronFlux < 0.05f;
|
||||
|
||||
public CompRefuelableNutrition FuelComp => GetComp<CompRefuelableNutrition>();
|
||||
@@ -85,7 +88,7 @@ namespace ArachnaeSwarm
|
||||
private void InitializeNutrientInfo() { } // 清理完毕
|
||||
|
||||
// === Tick方法(带活性系统)===
|
||||
public override void Tick()
|
||||
protected override void Tick()
|
||||
{
|
||||
base.Tick();
|
||||
|
||||
|
||||
@@ -37,9 +37,12 @@ namespace ArachnaeSwarm
|
||||
// === 属性 ===
|
||||
public IFluxController FluxController => this;
|
||||
public float NeutronFlux => neutronFlux;
|
||||
public float RawFlux => neutronFlux;
|
||||
public FluxMode FluxMode => fluxMode;
|
||||
public float FluxEfficiency => IFluxController.GetEfficiency(neutronFlux);
|
||||
public FluxMode CurrentFluxMode => fluxMode;
|
||||
public float FluxEfficiency => IFluxControllerExtensions.GetEfficiency(neutronFlux);
|
||||
public bool IsAutoMode => fluxMode != FluxMode.Manual;
|
||||
public bool IsIncubating => isIncubating;
|
||||
public bool IsDormant => neutronFlux < 0.05f;
|
||||
|
||||
public CompRefuelableNutrition FuelComp => GetComp<CompRefuelableNutrition>();
|
||||
@@ -195,7 +198,7 @@ namespace ArachnaeSwarm
|
||||
}
|
||||
|
||||
// === Tick方法 ===
|
||||
public override void Tick()
|
||||
protected override void Tick()
|
||||
{
|
||||
base.Tick();
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ArachnaeSwarm
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,6 +26,21 @@ namespace ArachnaeSwarm
|
||||
string GetModeShort();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IFluxController 扩展方法
|
||||
/// </summary>
|
||||
public static class IFluxControllerExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 计算通量效率(非线性曲线)
|
||||
/// </summary>
|
||||
public static float GetEfficiency(float flux)
|
||||
{
|
||||
// 使用平方根曲线:0% -> 0, 50% -> 0.707, 100% -> 1.0
|
||||
return Mathf.Sqrt(Mathf.Clamp01(flux));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 活性模式枚举(共享)
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user