M2 回合制调度:速度/阵营/队伍顺序规则、先制第一轮、4v4 调试入口与调度测试

- BattleRuntime 调度替换为完整规则:速度高优先、同速玩家优先、同阵营同速 PartyOrder 小优先;先制第一轮玩家全先行,第二轮恢复普通排序;RemainingTurnOrder 同步按调度序输出
- TurnBattleComponent 开局行动者为敌人时自动推进,协程等待 UI 监听注册避免先手事件丢失
- 调试入口支持 1v1 / 2v2 / 4v4 与先制开关;新增敌人队伍预设 4005(四普通敌人)
- UI:修复 UIForm 复用导致第二次开战按钮监听丢失;EnemySlots/TurnSlots 改为按数量复用 item,图标同一单位不重复加载
- EditMode 新增 10 个调度用例(共 35 个):排序规则、先制两轮、重复敌人分别击杀、4v4 创建、死亡移出候选、固定随机序列复现
This commit is contained in:
huangjun
2026-09-02 10:12:30 +08:00
parent 7dcac0ac87
commit 202ab337f9
14 changed files with 605 additions and 85 deletions
@@ -156,6 +156,9 @@ namespace SepCore.CustomComponent
GameEntry.UI.OpenUIForm(UIFormType.BattleForm);
Log.Info("Battle started with encounter '{0}'.", encounter.EncounterId);
// M2:敌人速度更高时开局行动者为敌人,同样按间歇节奏自动推进
ScheduleAutoAdvance();
return true;
}
@@ -283,6 +286,13 @@ namespace SepCore.CustomComponent
private System.Collections.IEnumerator AutoAdvanceRoutine()
{
// 战斗 UI 打开是异步资源加载,等推进监听注册后再推第一步,避免敌人先手事件丢失
int waitFrames = 0;
while (_stepListener == null && _runtime != null && !_runtime.IsCompleted && waitFrames++ < 600)
{
yield return null;
}
while (_runtime != null && !_runtime.IsCompleted &&
_runtime.CurrentActor != null && _runtime.CurrentActor.Faction == BattleFaction.Enemy)
{