zc
This commit is contained in:
Binary file not shown.
@@ -8,7 +8,7 @@ using System;
|
|||||||
|
|
||||||
namespace ArachnaeSwarm
|
namespace ArachnaeSwarm
|
||||||
{
|
{
|
||||||
public class Building_EquipmentOotheca : Building, IFluxController, ILarvaActivatable, IOrderGizmoProvider
|
public class Building_EquipmentOotheca : Building, IFluxController, ILarvaActivatable, IOrderGizmoProvider, IIncubationState
|
||||||
{
|
{
|
||||||
// === 通量系统字段 ===
|
// === 通量系统字段 ===
|
||||||
private float neutronFlux = 0.5f;
|
private float neutronFlux = 0.5f;
|
||||||
@@ -71,6 +71,12 @@ namespace ArachnaeSwarm
|
|||||||
public float QualityPercent => qualityTotal > 0 ? qualityProgress / qualityTotal : 0f;
|
public float QualityPercent => qualityTotal > 0 ? qualityProgress / qualityTotal : 0f;
|
||||||
public float AdjustedProgressPercent => IncubationProgress;
|
public float AdjustedProgressPercent => IncubationProgress;
|
||||||
|
|
||||||
|
// IIncubationState 接口实现
|
||||||
|
float IIncubationState.IncubationProgress { get => incubationProgress; set => incubationProgress = value; }
|
||||||
|
float IIncubationState.IncubationDuration => incubationDuration;
|
||||||
|
float IIncubationState.QualityProgress { get => qualityProgress; set => qualityProgress = value; }
|
||||||
|
float IIncubationState.QualityTotal => qualityTotal;
|
||||||
|
|
||||||
public float SpeedMultiplier
|
public float SpeedMultiplier
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -230,13 +236,8 @@ namespace ArachnaeSwarm
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 进度增长
|
// 使用统一工具方法处理进度和品质
|
||||||
float fluxSpeed = SpeedMultiplier * FluxEfficiency * 5f;
|
IncubatorUtils.TickIncubation(this, SpeedMultiplier, neutronFlux, false);
|
||||||
incubationProgress += fluxSpeed;
|
|
||||||
|
|
||||||
// 品质增长(新公式:50%通量时与进度同步)
|
|
||||||
float qualityGain = IncubatorUtils.CalculateQualityGainNew(fluxSpeed, neutronFlux);
|
|
||||||
qualityProgress = Mathf.Min(qualityProgress + qualityGain, qualityTotal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (incubationProgress >= incubationDuration)
|
if (incubationProgress >= incubationDuration)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Verse.AI;
|
|||||||
|
|
||||||
namespace ArachnaeSwarm
|
namespace ArachnaeSwarm
|
||||||
{
|
{
|
||||||
public class Building_Ootheca : Building, IFluxController, ILarvaActivatable, IOrderGizmoProvider
|
public class Building_Ootheca : Building, IFluxController, ILarvaActivatable, IOrderGizmoProvider, IIncubationState
|
||||||
{
|
{
|
||||||
// === 通量系统字段 ===
|
// === 通量系统字段 ===
|
||||||
private float neutronFlux = 0.5f;
|
private float neutronFlux = 0.5f;
|
||||||
@@ -86,6 +86,12 @@ namespace ArachnaeSwarm
|
|||||||
public float QualityPercent => qualityTotal > 0 ? qualityProgress / qualityTotal : 0f;
|
public float QualityPercent => qualityTotal > 0 ? qualityProgress / qualityTotal : 0f;
|
||||||
public float AdjustedProgressPercent => incubationDuration > 0 ? incubationProgress / incubationDuration : 0f;
|
public float AdjustedProgressPercent => incubationDuration > 0 ? incubationProgress / incubationDuration : 0f;
|
||||||
|
|
||||||
|
// IIncubationState 接口实现
|
||||||
|
float IIncubationState.IncubationProgress { get => incubationProgress; set => incubationProgress = value; }
|
||||||
|
float IIncubationState.IncubationDuration => incubationDuration;
|
||||||
|
float IIncubationState.QualityProgress { get => qualityProgress; set => qualityProgress = value; }
|
||||||
|
float IIncubationState.QualityTotal => qualityTotal;
|
||||||
|
|
||||||
// === IOrderGizmoProvider 实现 ===
|
// === IOrderGizmoProvider 实现 ===
|
||||||
private float gizmoScrollPosition = 0f;
|
private float gizmoScrollPosition = 0f;
|
||||||
public float GizmoScrollPosition { get => gizmoScrollPosition; set => gizmoScrollPosition = value; }
|
public float GizmoScrollPosition { get => gizmoScrollPosition; set => gizmoScrollPosition = value; }
|
||||||
@@ -335,14 +341,8 @@ namespace ArachnaeSwarm
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 进度增长
|
// 使用统一工具方法处理进度和品质
|
||||||
float fluxSpeed = SpeedMultiplier * FluxEfficiency * 5f;
|
IncubatorUtils.TickIncubation(this, SpeedMultiplier, neutronFlux, false);
|
||||||
incubationProgress += fluxSpeed;
|
|
||||||
|
|
||||||
// 品质增长(新公式:50%通量时与进度同步)
|
|
||||||
float qualityGain = IncubatorUtils.CalculateQualityGainNew(fluxSpeed, neutronFlux);
|
|
||||||
// 不限制上限,允许超过100%(最高150%)
|
|
||||||
qualityProgress += qualityGain;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (incubationProgress >= incubationDuration)
|
if (incubationProgress >= incubationDuration)
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ namespace ArachnaeSwarm
|
|||||||
float qualityGain = CalculateQualityGainNew(progressGain, neutronFlux);
|
float qualityGain = CalculateQualityGainNew(progressGain, neutronFlux);
|
||||||
|
|
||||||
state.IncubationProgress += progressGain;
|
state.IncubationProgress += progressGain;
|
||||||
state.QualityProgress = Mathf.Min(state.QualityProgress + qualityGain, state.QualityTotal);
|
// 不限制上限,允许超过100%(最高150%)
|
||||||
|
state.QualityProgress += qualityGain;
|
||||||
|
|
||||||
return progressGain;
|
return progressGain;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user