Commit 4056b3c8 authored by chechunchi's avatar chechunchi

handle shuffle_deck

parent 2faa9c94
Pipeline #22350 passed with stages
in 17 minutes and 17 seconds
......@@ -235,5 +235,14 @@
"repeatedType":"CardLocation"
}
]
},
"32":{
"protoType":"shuffle_deck",
"fields":[
{
"fieldName":"player",
"fieldType":"uint8"
}
]
}
}
......@@ -35,6 +35,7 @@ const MsgConstructorMap: Map<string, Constructor> = new Map([
["lp_update", ygopro.StocGameMessage.MsgLpUpdate],
["confirm_cards", ygopro.StocGameMessage.MsgConfirmCards],
["become_target", ygopro.StocGameMessage.MsgBecomeTarget],
["shuffle_deck", ygopro.StocGameMessage.MsgShuffleDeck],
]);
export interface penetrateType {
......
......@@ -35,6 +35,7 @@ import onMsgSelectTribute from "./selectTribute";
import onMsgSelectUnselectCard from "./selectUnselectCard";
import onMsgSelectYesNo from "./selectYesNo";
import onMsgSet from "./set";
import onMsgShuffleDeck from "./shuffleDeck";
import onMsgShuffleHand from "./shuffleHand";
import onMsgShuffleSetCard from "./shuffleSetCard";
import onMsgSortCard from "./sortCard";
......@@ -321,6 +322,11 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
break;
}
case "shuffle_deck": {
onMsgShuffleDeck(msg.shuffle_deck);
break;
}
case "unimplemented": {
onUnimplemented(msg.unimplemented);
......
import { ygopro } from "@/api";
import { cardStore } from "@/stores";
export default (shuffleDeck: ygopro.StocGameMessage.MsgShuffleDeck) => {
const player = shuffleDeck.player;
for (const card of cardStore.at(ygopro.CardZone.DECK, player)) {
// 把数据抹掉就好了
card.code = 0;
card.meta = { id: 0, data: {}, text: {} };
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment