Files
erqiwang_youle/client/js/01_SubGame/codes/net/handlers/BuryHandler.js
T
joywayerandClaude Opus 5 daf2708af9 二七王:选主与埋牌 handler
选主后主牌集合变化、手牌需重排,但重排是渲染时由 core/CardOrder 现算,
不在状态里落地——GameState 只镜像不派生。

埋牌区分 burycards(埋牌底牌)与 bottomcards(底牌),两批不同的牌;
闲家无 cards/burycards 但可能有 liangpai,缺字段一律不抹已有值。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 17:46:01 +08:00

37 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
///////////////////////////////////////////////////////////////
////////// EQW_BuryHandler: 埋牌(maipai)////////////////////
///////////////////////////////////////////////////////////////
// 协议 §9:cards 埋牌后手牌(仅庄家) / burycards 埋牌底牌(仅庄家) /
// seat 首出者(必为庄家) / countdown 出牌倒计时 /
// liangpai 亮牌(仅闲家 + 可查牌模式 + 庄家固定主牌达门槛)
//
// 注意 burycards(埋牌底牌,庄家埋下的 8 张)与 bottomcards(底牌,发牌留桌的 8 张)
// 是两批不同的牌,协议 §0.0 与验收清单专门警告过别写反。
var EQW_BuryHandler = EQW_BuryHandler || {
handle: function (data) {
if (!data.hasOwnProperty('seat')) {
console.error('[EQW_BuryHandler] maipai 缺 seat,已跳过该包');
return;
}
//庄家才有的两项,闲家缺字段时保持原值、不抹手牌
EQW_GameState._apply(EQW_GameState.my, data, {
cards: 'cards',
buryCards: 'burycards'
});
//闲家才可能有的亮牌
EQW_GameState._apply(EQW_GameState.table, data, { liangpai: 'liangpai' });
EQW_GameState._apply(EQW_GameState.turn, data, {
seat: 'seat',
countdown: 'countdown'
});
EQW_GameState.aset.step = 5; //进入出牌
EventBus.emit(EQW_Events.EQW_BURY_DONE);
if (data.hasOwnProperty('cards')) { EventBus.emit(EQW_Events.EQW_HAND_CHANGED); }
EventBus.emit(EQW_Events.EQW_TURN_CHANGED);
}
};