Commit 0c25de0d authored by Chunchi Che's avatar Chunchi Che

add lpUpdate

parent 298a37f1
Pipeline #21838 passed with stages
in 13 minutes and 43 seconds
......@@ -125,5 +125,12 @@
"76": {
"protoType": "chain_solved",
"fields": [{ "fieldName": "solved_index", "fieldType": "uint8"}]
},
"94": {
"protoType": "lp_update",
"fields": [
{ "fieldName": "player", "fieldType": "uint8" },
{ "fieldName": "new_lp", "fieldType": "uint32" }
]
}
}
......@@ -32,6 +32,7 @@ const MsgConstructorMap: Map<string, Constructor> = new Map([
["attack_disable", ygopro.StocGameMessage.MsgAttackDisabled],
["chain_solved", ygopro.StocGameMessage.MsgChainSolved],
["chain_end", ygopro.StocGameMessage.MsgChainEnd],
["lp_update", ygopro.StocGameMessage.MsgLpUpdate],
]);
export interface penetrateType {
......
......@@ -11,6 +11,7 @@ import onMsgDraw from "./draw";
import onMsgFilpSummoned from "./flipSummoned";
import onMsgFlipSummoning from "./flipSummoning";
import onMsgHint from "./hint";
import onLpUpdate from "./lpUpdate";
import onMsgMove from "./move";
import onMsgNewPhase from "./newPhase";
import onMsgNewTurn from "./newTurn";
......@@ -276,6 +277,11 @@ export default async function handleGameMsg(pb: ygopro.YgoStocMsg) {
break;
}
case "lp_udpate": {
onLpUpdate(msg.lp_udpate);
break;
}
case "unimplemented": {
onUnimplemented(msg.unimplemented);
......
import { ygopro } from "@/api";
import { matStore } from "@/stores";
export default (lpUpdate: ygopro.StocGameMessage.MsgLpUpdate) => {
const player = lpUpdate.player;
const newLp = lpUpdate.new_lp;
matStore.initInfo.of(player).life = newLp;
};
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