zc
This commit is contained in:
Binary file not shown.
@@ -44,6 +44,7 @@
|
||||
<ARA_Status_IncubationSpeed>孵化速度: {0}x</ARA_Status_IncubationSpeed>
|
||||
<ARA_Status_Efficiency>效率</ARA_Status_Efficiency>
|
||||
<ARA_Status_Speed>速度</ARA_Status_Speed>
|
||||
<ARA_Status_Quality>品质</ARA_Status_Quality>
|
||||
<ARA_Status_Mode>模式: {0}</ARA_Status_Mode>
|
||||
<ARA_Status_DormantWarning>⚠ 休眠中,品质下降!</ARA_Status_DormantWarning>
|
||||
<ARA_Status_RemainingTime>剩余时间: {0} 天</ARA_Status_RemainingTime>
|
||||
|
||||
@@ -160,23 +160,24 @@ namespace ArachnaeSwarm
|
||||
|
||||
Text.Font = GameFont.Tiny;
|
||||
|
||||
// 效率
|
||||
GUI.color = new Color(0.7f, 0.7f, 0.7f);
|
||||
Rect effRect = new Rect(infoX, barRect.y + 22f, infoWidth, 14f);
|
||||
Widgets.Label(effRect, "ARA_Status_Efficiency".Translate());
|
||||
Rect effValRect = new Rect(infoX, barRect.y + 36f, infoWidth, 14f);
|
||||
GUI.color = Color.white;
|
||||
Widgets.Label(effValRect, (controller.FluxEfficiency * 100f).ToString("0") + "%");
|
||||
|
||||
// 速度倍率
|
||||
GUI.color = new Color(0.7f, 0.7f, 0.7f);
|
||||
float speedMultiplier = controller.FluxEfficiency * 5f;
|
||||
Rect speedRect = new Rect(infoX, barRect.y + 54f, infoWidth, 14f);
|
||||
Widgets.Label(speedRect, "ARA_Status_Speed".Translate());
|
||||
Rect speedValRect = new Rect(infoX, barRect.y + 68f, infoWidth, 14f);
|
||||
Rect speedLabelRect = new Rect(infoX, barRect.y + 22f, infoWidth, 14f);
|
||||
Widgets.Label(speedLabelRect, "ARA_Status_Speed".Translate());
|
||||
float speedMultiplier = controller.FluxEfficiency;
|
||||
Rect speedValRect = new Rect(infoX, barRect.y + 36f, infoWidth, 14f);
|
||||
GUI.color = speedMultiplier >= 1f ? new Color(0.5f, 1f, 0.5f) : new Color(1f, 0.7f, 0.5f);
|
||||
Widgets.Label(speedValRect, speedMultiplier.ToString("0.0") + "x");
|
||||
|
||||
// 品质倍率
|
||||
GUI.color = new Color(0.7f, 0.7f, 0.7f);
|
||||
float qualityCoeff = IncubatorUtils.GetQualityCoefficient(controller.NeutronFlux);
|
||||
Rect qualLabelRect = new Rect(infoX, barRect.y + 54f, infoWidth, 14f);
|
||||
Widgets.Label(qualLabelRect, "ARA_Status_Quality".Translate());
|
||||
Rect qualValRect = new Rect(infoX, barRect.y + 68f, infoWidth, 14f);
|
||||
GUI.color = qualityCoeff >= 1f ? new Color(0.5f, 0.7f, 1f) : new Color(1f, 0.7f, 0.5f);
|
||||
Widgets.Label(qualValRect, qualityCoeff.ToString("0.0") + "x");
|
||||
|
||||
GUI.color = Color.white;
|
||||
Text.Anchor = TextAnchor.UpperLeft;
|
||||
Text.Font = GameFont.Small;
|
||||
|
||||
@@ -32,12 +32,17 @@ namespace ArachnaeSwarm
|
||||
public static class IFluxControllerExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 计算通量效率(非线性曲线)
|
||||
/// 计算通量速度效率(非线性二次曲线)
|
||||
/// 0% = 0.1× (几乎停滞)
|
||||
/// 50% = 1.0× (基准)
|
||||
/// 100% = 3.3× (极速)
|
||||
/// </summary>
|
||||
public static float GetEfficiency(float flux)
|
||||
{
|
||||
// 使用平方根曲线:0% -> 0, 50% -> 0.707, 100% -> 1.0
|
||||
return Mathf.Sqrt(Mathf.Clamp01(flux));
|
||||
// 与 IncubatorUtils.GetFluxEfficiency 保持一致
|
||||
float x = Mathf.Clamp01(flux) - 0.5f;
|
||||
float efficiency = 2.8f * x * x + 3.2f * x + 1.0f;
|
||||
return Mathf.Max(0.1f, efficiency);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,12 +72,31 @@ namespace ArachnaeSwarm
|
||||
// ============================================
|
||||
|
||||
/// <summary>
|
||||
/// 计算通量效率(0-1之间,通量越高效率越高)
|
||||
/// 计算通量速度效率(非线性曲线)
|
||||
/// 0% = 0.1× (几乎停滞)
|
||||
/// 50% = 1.0× (基准)
|
||||
/// 100% = 3.3× (极速)
|
||||
/// 公式: 2.8*(flux-0.5)^2 + 3.2*(flux-0.5) + 1.0
|
||||
/// </summary>
|
||||
public static float GetFluxEfficiency(float neutronFlux)
|
||||
{
|
||||
// 与 IFluxControllerExtensions.GetEfficiency 保持一致
|
||||
return Mathf.Pow(neutronFlux, 0.7f);
|
||||
// 非线性二次曲线:低通量惩罚激进,高通量加成显著
|
||||
float x = neutronFlux - 0.5f;
|
||||
float efficiency = 2.8f * x * x + 3.2f * x + 1.0f;
|
||||
return Mathf.Max(0.1f, efficiency);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算通量品质系数(线性曲线)
|
||||
/// 0% = 2.0× (精雕细琢)
|
||||
/// 50% = 1.0× (基准)
|
||||
/// 100% = 0.1× (粗制滥造)
|
||||
/// </summary>
|
||||
public static float GetQualityCoefficient(float neutronFlux)
|
||||
{
|
||||
// 线性下降:高通量严重牺牲品质
|
||||
float coeff = 2.0f * (1f - neutronFlux);
|
||||
return Mathf.Max(0.1f, coeff);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -132,18 +151,17 @@ namespace ArachnaeSwarm
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 品质系统(新公式:50%通量时与进度同步)
|
||||
// 品质系统(平衡点设计:50%通量时综合效用最大)
|
||||
// ============================================
|
||||
|
||||
/// <summary>
|
||||
/// 计算单tick的品质增量(新公式)
|
||||
/// 核心:50%通量时品质增长 = 进度增长(1:1同步)
|
||||
/// 公式:qualityGain = progressGain × 2 × (1 - neutronFlux)
|
||||
/// 计算单tick的品质增量
|
||||
/// 使用品质系数:0%=2.0, 50%=1.0, 100%=0.1
|
||||
/// 公式:qualityGain = progressGain × qualityCoeff
|
||||
/// </summary>
|
||||
public static float CalculateQualityGainNew(float progressGain, float neutronFlux)
|
||||
{
|
||||
// qualityCoeff: 0%通量=2.0, 25%通量=1.5, 50%通量=1.0, 75%通量=0.5, 100%通量=0
|
||||
float qualityCoeff = 2f * (1f - neutronFlux);
|
||||
float qualityCoeff = GetQualityCoefficient(neutronFlux);
|
||||
return progressGain * qualityCoeff;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user