feat: 吃(chi)反应支持 — HandleDiscardReactions + 人类/AI

- CanChi→CanChiCheck公开给MahjongRoom调用
- HandleDiscardReactions: offset=1(上家)且非字牌时检查chi
- 人类HUD: c(吃)选项
- ExecuteChi: 找到配对的两张牌→创建chi副露→出牌
- ExecutePungKongHuman: 抽取碰/杠人类交互逻辑
This commit is contained in:
xiaoou
2026-07-04 17:51:58 +08:00
parent a047877494
commit b6bdf064ff
2 changed files with 114 additions and 39 deletions

View File

@ -99,7 +99,7 @@ public class MahjongPhaseMachine
// Chi
if (state.LastDiscard.HasValue && state.LastDiscardPlayer != playerId)
{
if (CanChi(state, playerId, state.LastDiscard.Value))
if (CanChiCheck(state, playerId, state.LastDiscard.Value))
actions.Add(new ActionOption { Action = "chi", Priority = 1 });
}
@ -147,7 +147,7 @@ public class MahjongPhaseMachine
state.Hands[playerId].Contains(m.Tiles[0]));
}
private bool CanChi(MahjongGameState state, string playerId, int tile)
public bool CanChiCheck(MahjongGameState state, string playerId, int tile)
{
if (MahjongTile.IsHonor(tile)) return false;
int suit = MahjongTile.Suit(tile);