feat: 吃(chi)反应支持 — HandleDiscardReactions + 人类/AI
- CanChi→CanChiCheck公开给MahjongRoom调用 - HandleDiscardReactions: offset=1(上家)且非字牌时检查chi - 人类HUD: c(吃)选项 - ExecuteChi: 找到配对的两张牌→创建chi副露→出牌 - ExecutePungKongHuman: 抽取碰/杠人类交互逻辑
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user