fix: chi在四川血战等无吃变体中仍然可用
Root cause: HandleDiscardReactions始终调用CanChiCheck,不检查 DSL的others_reaction是否包含chi action 修复: - PhaseMachine: 构造时读取phases→检查是否有chi→_chiAllowed - MahjongRoom: HandleDiscardReactions用_phaseMachine.ChiAllowed门控 - 人类/AI均在无chi变体中不再看到/执行chi Impact: xuezhandaodi(无chi)和wuhan/guobiao/guangdong(有chi)行为正确隔离
This commit is contained in:
@ -43,6 +43,8 @@ public class MahjongPhaseMachine
|
||||
private readonly Dictionary<string, FanConfig> _fanConfig;
|
||||
private readonly bool _jiHuSelfDrawOnly;
|
||||
private readonly WildcardRegistry _wildcards;
|
||||
private readonly bool _chiAllowed;
|
||||
public bool ChiAllowed => _chiAllowed;
|
||||
|
||||
public MahjongPhaseMachine(List<PhaseConfig> phases, MeldsSolver solver,
|
||||
int wildcardCount = 0, bool require258 = false,
|
||||
@ -57,6 +59,8 @@ public class MahjongPhaseMachine
|
||||
_fanConfig = fanConfig ?? new();
|
||||
_jiHuSelfDrawOnly = jiHuSelfDrawOnly;
|
||||
_wildcards = wildcards ?? new();
|
||||
_chiAllowed = phases.Any(p =>
|
||||
p.OthersReactions.Any(o => o.Action == "chi"));
|
||||
}
|
||||
|
||||
public PhaseConfig? GetPhase(string name) => _phases.FirstOrDefault(p => p.Name == name);
|
||||
|
||||
Reference in New Issue
Block a user