fix: Code Review完整修复 — AI chi/暗杠/加杠/chi位置

发现的6个缺口:
1. HandleDiscardReactions AI分支缺chi → 新增ExecuteAiChi
2. StepTurn不处理an_kong/bu_kong → 新增ExecuteAnKong/ExecuteBuKong
3. PhaseMachine.GetLegalActions chi误在自回合 → 移除(chi只能反应)
4. ScoreEngine.CheckFinish死代码 → 保留(无影响)
5. ExecutePungKong用Random.Shared → 改用_rng
6. HumanMahjongPlayer残留chiOpt → 移除
This commit is contained in:
xiaoou
2026-07-04 17:56:14 +08:00
parent b6bdf064ff
commit cbbe503117
3 changed files with 101 additions and 11 deletions

View File

@ -96,13 +96,6 @@ public class MahjongPhaseMachine
actions.Add(new ActionOption { Action = "win", Priority = 4 });
}
// Chi
if (state.LastDiscard.HasValue && state.LastDiscardPlayer != playerId)
{
if (CanChiCheck(state, playerId, state.LastDiscard.Value))
actions.Add(new ActionOption { Action = "chi", Priority = 1 });
}
actions.Add(new ActionOption { Action = "pass", Priority = 0 });
return actions;
}