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 @@ ...@@ -235,5 +235,14 @@
"repeatedType":"CardLocation" "repeatedType":"CardLocation"
} }
] ]
},
"32":{
"protoType":"shuffle_deck",
"fields":[
{
"fieldName":"player",
"fieldType":"uint8"
}
]
} }
} }
...@@ -35,6 +35,7 @@ const MsgConstructorMap: Map<string, Constructor> = new Map([ ...@@ -35,6 +35,7 @@ const MsgConstructorMap: Map<string, Constructor> = new Map([
["lp_update", ygopro.StocGameMessage.MsgLpUpdate], ["lp_update", ygopro.StocGameMessage.MsgLpUpdate],
["confirm_cards", ygopro.StocGameMessage.MsgConfirmCards], ["confirm_cards", ygopro.StocGameMessage.MsgConfirmCards],
["become_target", ygopro.StocGameMessage.MsgBecomeTarget], ["become_target", ygopro.StocGameMessage.MsgBecomeTarget],
["shuffle_deck", ygopro.StocGameMessage.MsgShuffleDeck],
]); ]);
export interface penetrateType { export interface penetrateType {
......
...@@ -35,6 +35,7 @@ import onMsgSelectTribute from "./selectTribute"; ...@@ -35,6 +35,7 @@ import onMsgSelectTribute from "./selectTribute";
import onMsgSelectUnselectCard from "./selectUnselectCard"; import onMsgSelectUnselectCard from "./selectUnselectCard";
import onMsgSelectYesNo from "./selectYesNo"; import onMsgSelectYesNo from "./selectYesNo";
import onMsgSet from "./set"; import onMsgSet from "./set";
import onMsgShuffleDeck from "./shuffleDeck";
import onMsgShuffleHand from "./shuffleHand"; import onMsgShuffleHand from "./shuffleHand";
import onMsgShuffleSetCard from "./shuffleSetCard"; import onMsgShuffleSetCard from "./shuffleSetCard";
import onMsgSortCard from "./sortCard"; import onMsgSortCard from "./sortCard";
...@@ -321,6 +322,11 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) { ...@@ -321,6 +322,11 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
break; break;
} }
case "shuffle_deck": {
onMsgShuffleDeck(msg.shuffle_deck);
break;
}
case "unimplemented": { case "unimplemented": {
onUnimplemented(msg.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