diff --git a/server/games/erqiwang/class.arith.js b/server/games/erqiwang/class.arith.js index e792404..9b299f0 100644 --- a/server/games/erqiwang/class.arith.js +++ b/server/games/erqiwang/class.arith.js @@ -219,8 +219,11 @@ var cls_youle_erqiwang_arith = cls_youle_erqiwang_arith || { if (is_fu2(bigcode) && is_zhuA(smallcode)){ return true; } - //8、6 - if (is_8(bigcode) && is_6(smallcode)){ + //8、6(design §5.3:7 不与 6/8 相连,6 与 8 相连) + //必须是同一花色的 8 与 6:牌编码同花色相差 2(主花色 1408-1406=2、副牌 308-306=2), + //跨花色则相差 100 的倍数。只判 %100 会把「♥8 + ♣6」误判为连对, + //进而在 get_chongguan 扫描整手牌时让副牌的 6 对错误接续主 8、多算奖(design §8.1 连对链) + if (is_8(bigcode) && is_6(smallcode) && (bigcode - smallcode == 2)){ return true; } return false; diff --git a/server/games/erqiwang/test/test_arith.js b/server/games/erqiwang/test/test_arith.js index 1fbe3fc..23240fc 100644 --- a/server/games/erqiwang/test/test_arith.js +++ b/server/games/erqiwang/test/test_arith.js @@ -156,6 +156,13 @@ t.eq('相邻 主8-主6(6/8可连)', cont(id(1, 1, 8), id(1, 1, 6)), true); t.eq('相邻 主6-主5', cont(id(1, 1, 6), z5), true); t.eq('相邻 正7-主6 不连(7不入普通序)', cont(Z7, id(1, 1, 6)), false); t.eq('相邻 主8-正7 不连', cont(id(1, 1, 8), Z7), false); +// 8/6 相邻必须同花色:跨花色的 8 与 6 不成连对(否则 get_chongguan 连对链会被副牌 6 对错误接续) +t.eq('相邻 副♥8-副♥6 同花色 连', cont(id(1, 3, 8), id(1, 3, 6)), true); +t.eq('相邻 副♥8-副♣6 跨花色 不连', cont(id(1, 3, 8), id(1, 2, 6)), false); +t.eq('相邻 主8-副♣6 跨花色 不连', cont(id(1, 1, 8), id(1, 2, 6)), false); +t.eq('相邻 副♠8-副♦6 跨花色 不连', cont(id(1, 4, 8), id(1, 1, 6)), false); +// 顺带确认非 8/6 的等差2组合仍不连(防守卫写宽) +t.eq('相邻 主A-主Q 不连(差2但非8/6)', cont(zA, id(1, 1, 12)), false); // ============ §7 算子:每档小光/过庄分界 + 升3级(补强)============ t.eq('常规65 g39小光', judge(65, 39, false), '小光/4');