babalae/better-genshin-impact · warning · Exception
只有指定讨伐次数模式才能开启须臾树脂或脆弱树脂补充
Error message
只有指定讨伐次数模式才能开启须臾树脂或脆弱树脂补充
What it means
Validate 校验:只有 SpecifyRunCount=true(指定讨伐次数模式)才允许开启须臾树脂(UseTransientResin)或脆弱树脂(UseFragileResin)补充。非指定次数模式下开启补充会抛 Exception,因为补充逻辑依赖明确的剩余次数预算。
Source
Thrown at BetterGenshinImpact/GameTask/AutoBoss/AutoBossTask.cs:1010
if (!AutoBossData.IsSupportedBoss(_taskParam.BossName))
{
throw new Exception($"暂不支持首领:{_taskParam.BossName}");
}
if (_taskParam.ReviveRetryCount < 0)
{
throw new Exception("角色死亡后重试次数不能小于 0");
}
if (_taskParam.SpecifyRunCount && _taskParam.RunCount < 1)
{
throw new Exception("指定讨伐次数必须大于 0");
}
if (!_taskParam.SpecifyRunCount && (_taskParam.UseTransientResin || _taskParam.UseFragileResin))
{
throw new Exception("只有指定讨伐次数模式才能开启须臾树脂或脆弱树脂补充");
}
if (string.IsNullOrWhiteSpace(_taskParam.CombatStrategyPath))
{
_taskParam.SetCombatStrategyPath(_taskParam.StrategyName);
}
if (!File.Exists(_taskParam.CombatStrategyPath) && !Directory.Exists(_taskParam.CombatStrategyPath))
{
throw new Exception("当前选择的自动战斗策略文件不存在");
}
foreach (var route in GetRequiredRouteFiles(_taskParam.BossName))
{
if (!File.Exists(BuildPathingAssetPath(route)))
{
throw new FileNotFoundException($"未找到首领路线文件:{route}", BuildPathingAssetPath(route));
}View on GitHub (pinned to a7cb36712d)
Solutions
- 先开启 SpecifyRunCount(指定讨伐次数)再开启树脂补充。
- 或在非指定次数模式下关闭 UseTransientResin / UseFragileResin。
- 在 UI 让两个补充开关仅在 SpecifyRunCount 激活时可用。
Defensive patterns
Strategy: validation
Validate before calling
// UI 联动:补充开关 IsEnabled = SpecifyRunCount
// 运行前可自动修正:
if (!_taskParam.SpecifyRunCount)
{
_taskParam.UseTransientResin = false;
_taskParam.UseFragileResin = false;
} Prevention
- 补充树脂开关仅在指定次数模式启用。
- 切换模式时联动重置补充开关。
When it happens
Trigger: 用户在非指定次数模式(如树脂耗尽即停模式)下勾选了须臾/脆弱树脂补充;配置文件字段组合非法。
Common situations: 用户误勾;切换模式后补充开关未联动禁用;旧配置迁移产生不一致状态。
Related errors
AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13).
Data as JSON: /api/errors/c3c0e8997ee8694c.
Report an issue: GitHub.