@
feat(ai): 追击冲刺带冷却——CD 期巡逻,冷却结束仍在追逐区则再冲(PatrolBetweenChases) 按需求:冲刺打完 → CD 期切到巡逻(Move_Patrol) → 冷却结束且玩家仍在追逐区 → 再冲刺。 PerceptionStateMachine 加 opt-in 开关 PatrolBetweenChases: - Chase → Patrol When !IsAbilityRunning(chase):冲刺是 committed 冲锋,感知丢失 也不中途打断,打完(能力结束)即降巡逻。 - Idle/Patrol/Alert → Chase 加冷却门 CanUseAbility(chase):CD 中不回追击, 避免"CD 期在追逐区每帧 Chase↔Patrol 来回抖"(用户担心的错切/抖动)。 - 默认关:不影响其他敌人(leftAllZones 旧行为保留)。 E001CaoZhiAi 打开开关。追击能力保持单次冲刺不变,冷却=ABL_E001_Chase.cooldown(1s)。 测试:PerceptionStateMachineTests +5(CD 转换矩阵含"CD 期多帧不抖动"负例), FakeCombat 加可控 CanUse。全量 75/75 绿。PlayMode 实测循环 Move_Patrol(CD)→Chase(冲)→Move_Patrol,inChase 全程 true 亦不抖,0 报错。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> @
This commit is contained in:
@@ -19,10 +19,11 @@ namespace BaseGames.Tests.EditMode.AI
|
||||
public sealed class FakeCombat : ICombatant
|
||||
{
|
||||
public string Running; public List<string> Used = new List<string>();
|
||||
public bool CanUse = true; // 供 CD 门控测试控制(默认可用,向后兼容)
|
||||
public bool UseAbility(string id) { Used.Add(id); Running = id; return true; }
|
||||
public bool IsAbilityRunning(string id = null) => id == null ? Running != null : Running == id;
|
||||
public bool NoAbilityRunning => Running == null;
|
||||
public bool CanUseAbility(string id) => true;
|
||||
public bool CanUseAbility(string id) => CanUse;
|
||||
public void InterruptAbilities() => Running = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user