Commit 01b9e6f1 authored by Chunchi Che's avatar Chunchi Che

handle chainEnd

parent 8bf177bd
Pipeline #21767 passed with stages
in 14 minutes and 20 seconds
...@@ -114,6 +114,10 @@ ...@@ -114,6 +114,10 @@
"protoType": "chain_solved", "protoType": "chain_solved",
"fields": [{ "fieldName": "solved_index", "fieldType": "uint8"}] "fields": [{ "fieldName": "solved_index", "fieldType": "uint8"}]
}, },
"74": {
"protoType": "chain_end",
"fields": []
},
"75": { "75": {
"protoType": "chain_solved", "protoType": "chain_solved",
"fields": [{ "fieldName": "solved_index", "fieldType": "uint8"}] "fields": [{ "fieldName": "solved_index", "fieldType": "uint8"}]
......
...@@ -31,6 +31,7 @@ const MsgConstructorMap: Map<string, Constructor> = new Map([ ...@@ -31,6 +31,7 @@ const MsgConstructorMap: Map<string, Constructor> = new Map([
["chaining", ygopro.StocGameMessage.MsgChaining], ["chaining", ygopro.StocGameMessage.MsgChaining],
["attack_disable", ygopro.StocGameMessage.MsgAttackDisabled], ["attack_disable", ygopro.StocGameMessage.MsgAttackDisabled],
["chain_solved", ygopro.StocGameMessage.MsgChainSolved], ["chain_solved", ygopro.StocGameMessage.MsgChainSolved],
["chain_end", ygopro.StocGameMessage.MsgChainEnd],
]); ]);
export interface penetrateType { export interface penetrateType {
......
import { ygopro } from "@/api";
import { matStore } from "@/stores";
export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => {
while (true) {
const chain = matStore.chains.pop();
if (chain === undefined) {
break;
}
matStore.setChained(chain, undefined);
}
};
...@@ -3,6 +3,7 @@ import { matStore } from "@/stores"; ...@@ -3,6 +3,7 @@ import { matStore } from "@/stores";
import onMsgAttack from "./attack"; import onMsgAttack from "./attack";
import onMsgAttackDisable from "./attackDisable"; import onMsgAttackDisable from "./attackDisable";
import onMsgChainEnd from "./chainEnd";
import onMsgChaining from "./chaining"; import onMsgChaining from "./chaining";
import onMsgChainSolved from "./chainSolved"; import onMsgChainSolved from "./chainSolved";
import onMsgDraw from "./draw"; import onMsgDraw from "./draw";
...@@ -234,6 +235,11 @@ export default async function handleGameMsg(pb: ygopro.YgoStocMsg) { ...@@ -234,6 +235,11 @@ export default async function handleGameMsg(pb: ygopro.YgoStocMsg) {
break; break;
} }
case "chain_end": {
onMsgChainEnd(msg.chain_end);
break;
}
case "summoning": { case "summoning": {
onMsgSummoning(msg.summoning); onMsgSummoning(msg.summoning);
......
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