Commit bf60d17a authored by Chunchi Che's avatar Chunchi Che

Merge branch 'feat/lp_update' into 'main'

Feat/lp update

See merge request mycard/Neos!209
parents 00bbfcce ae15de6f
Pipeline #21842 passed with stages
in 12 minutes and 46 seconds
Subproject commit ee85cb1d1f71ad6b44f1daf1877b63fa2ac1991f Subproject commit 0993b418f4ae7be10af05ca5360315656bfe2690
This diff is collapsed.
...@@ -125,5 +125,12 @@ ...@@ -125,5 +125,12 @@
"76": { "76": {
"protoType": "chain_solved", "protoType": "chain_solved",
"fields": [{ "fieldName": "solved_index", "fieldType": "uint8"}] "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([ ...@@ -32,6 +32,7 @@ const MsgConstructorMap: Map<string, Constructor> = new Map([
["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], ["chain_end", ygopro.StocGameMessage.MsgChainEnd],
["lp_update", ygopro.StocGameMessage.MsgLpUpdate],
]); ]);
export interface penetrateType { export interface penetrateType {
......
...@@ -11,6 +11,7 @@ import onMsgDraw from "./draw"; ...@@ -11,6 +11,7 @@ import onMsgDraw from "./draw";
import onMsgFilpSummoned from "./flipSummoned"; import onMsgFilpSummoned from "./flipSummoned";
import onMsgFlipSummoning from "./flipSummoning"; import onMsgFlipSummoning from "./flipSummoning";
import onMsgHint from "./hint"; import onMsgHint from "./hint";
import onLpUpdate from "./lpUpdate";
import onMsgMove from "./move"; import onMsgMove from "./move";
import onMsgNewPhase from "./newPhase"; import onMsgNewPhase from "./newPhase";
import onMsgNewTurn from "./newTurn"; import onMsgNewTurn from "./newTurn";
...@@ -276,6 +277,11 @@ export default async function handleGameMsg(pb: ygopro.YgoStocMsg) { ...@@ -276,6 +277,11 @@ export default async function handleGameMsg(pb: ygopro.YgoStocMsg) {
break; break;
} }
case "lp_update": {
onLpUpdate(msg.lp_update);
break;
}
case "unimplemented": { case "unimplemented": {
onUnimplemented(msg.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