Commit 2586a52b authored by Chunchi Che's avatar Chunchi Che

修复某些卡(比如神弓)攻击力展示不正确的问题

parent 551fc976
...@@ -24,9 +24,11 @@ npm_ci: ...@@ -24,9 +24,11 @@ npm_ci:
rs_check_lint: rs_check_lint:
stage: rs_check_lint stage: rs_check_lint
image: rust:latest
tags: tags:
- linux - linux
before_script:
- curl https://sh.rustup.rs -sSf | sh -s -- -y
- source "$HOME/.cargo/env"
script: script:
- cd rust-src - cd rust-src
- cargo check - cargo check
...@@ -36,11 +38,12 @@ rs_check_lint: ...@@ -36,11 +38,12 @@ rs_check_lint:
wasm_build: wasm_build:
tags: tags:
- linux - linux
image: rust:latest
stage: wasm stage: wasm
extends: extends:
- .build_base - .build_base
before_script: before_script:
- curl https://sh.rustup.rs -sSf | sh -s -- -y
- source "$HOME/.cargo/env"
- curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
script: script:
- wasm-pack build ./rust-src --target web - wasm-pack build ./rust-src --target web
......
...@@ -58,6 +58,7 @@ export const MSG_PAY_LP_COST = 100; ...@@ -58,6 +58,7 @@ export const MSG_PAY_LP_COST = 100;
export const MSG_WIN = 5; export const MSG_WIN = 5;
export const MSG_WAITING = 3; export const MSG_WAITING = 3;
export const MSG_UPDATE_DATA = 6; export const MSG_UPDATE_DATA = 6;
export const MSG_UPDATE_CARD = 7;
export const MSG_RELOAD_FIELD = 162; export const MSG_RELOAD_FIELD = 162;
export const MSG_SELECT_SUM = 23; export const MSG_SELECT_SUM = 23;
export const MSG_ADD_COUNTER = 101; export const MSG_ADD_COUNTER = 101;
......
...@@ -41,6 +41,7 @@ import MsgSibylNameAdapter from "./sibylName"; ...@@ -41,6 +41,7 @@ import MsgSibylNameAdapter from "./sibylName";
import MsgSortCard from "./sortCard"; import MsgSortCard from "./sortCard";
import MsgStartAdapter from "./start"; import MsgStartAdapter from "./start";
import MsgTossAdapter from "./toss"; import MsgTossAdapter from "./toss";
import MsgUpdateCardAdapter from "./updateCard";
import MsgUpdateDataAdapter from "./updateData"; import MsgUpdateDataAdapter from "./updateData";
import MsgWaitAdapter from "./wait"; import MsgWaitAdapter from "./wait";
import MsgWin from "./win"; import MsgWin from "./win";
...@@ -72,159 +73,132 @@ export default class GameMsgAdapter implements StocAdapter { ...@@ -72,159 +73,132 @@ export default class GameMsgAdapter implements StocAdapter {
switch (func) { switch (func) {
case GAME_MSG.MSG_START: { case GAME_MSG.MSG_START: {
gameMsg.start = MsgStartAdapter(gameData); gameMsg.start = MsgStartAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_DRAW: { case GAME_MSG.MSG_DRAW: {
gameMsg.draw = MsgDrawAdapter(gameData); gameMsg.draw = MsgDrawAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_NEW_TURN: { case GAME_MSG.MSG_NEW_TURN: {
gameMsg.new_turn = MsgNewTurnAdapter(gameData); gameMsg.new_turn = MsgNewTurnAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_NEW_PHASE: { case GAME_MSG.MSG_NEW_PHASE: {
gameMsg.new_phase = MsgNewPhaseAdapter(gameData); gameMsg.new_phase = MsgNewPhaseAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_HINT: { case GAME_MSG.MSG_HINT: {
gameMsg.hint = MsgHintAdapter(gameData); gameMsg.hint = MsgHintAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_IDLE_CMD: { case GAME_MSG.MSG_SELECT_IDLE_CMD: {
gameMsg.select_idle_cmd = MsgSelectIdleCmdAdapter(gameData); gameMsg.select_idle_cmd = MsgSelectIdleCmdAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_DISFIELD: case GAME_MSG.MSG_SELECT_DISFIELD:
case GAME_MSG.MSG_SELECT_PLACE: { case GAME_MSG.MSG_SELECT_PLACE: {
gameMsg.select_place = MsgSelectPlaceAdapter(gameData); gameMsg.select_place = MsgSelectPlaceAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_CARD: { case GAME_MSG.MSG_SELECT_CARD: {
gameMsg.select_card = MsgSelectCardAdapter(gameData); gameMsg.select_card = MsgSelectCardAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_TRIBUTE: { case GAME_MSG.MSG_SELECT_TRIBUTE: {
gameMsg.select_tribute = MsgSelectTributeAdapter(gameData); gameMsg.select_tribute = MsgSelectTributeAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_CHAIN: { case GAME_MSG.MSG_SELECT_CHAIN: {
gameMsg.select_chain = MsgSelectChainAdapter(gameData); gameMsg.select_chain = MsgSelectChainAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_EFFECTYN: { case GAME_MSG.MSG_SELECT_EFFECTYN: {
gameMsg.select_effect_yn = MsgSelectEffectYnAdapter(gameData); gameMsg.select_effect_yn = MsgSelectEffectYnAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_POSITION: { case GAME_MSG.MSG_SELECT_POSITION: {
gameMsg.select_position = MsgSelectPositionAdapter(gameData); gameMsg.select_position = MsgSelectPositionAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_OPTION: { case GAME_MSG.MSG_SELECT_OPTION: {
gameMsg.select_option = MsgSelectOptionAdapter(gameData); gameMsg.select_option = MsgSelectOptionAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_BATTLE_CMD: { case GAME_MSG.MSG_SELECT_BATTLE_CMD: {
gameMsg.select_battle_cmd = MsgSelectBattleCmdAdapter(gameData); gameMsg.select_battle_cmd = MsgSelectBattleCmdAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_UNSELECT_CARD: { case GAME_MSG.MSG_SELECT_UNSELECT_CARD: {
gameMsg.select_unselect_card = MsgSelectUnselectCardAdapter(gameData); gameMsg.select_unselect_card = MsgSelectUnselectCardAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_PAY_LP_COST: case GAME_MSG.MSG_PAY_LP_COST:
case GAME_MSG.MSG_DAMAGE: { case GAME_MSG.MSG_DAMAGE: {
gameMsg.update_hp = MsgDamage(gameData); gameMsg.update_hp = MsgDamage(gameData);
break; break;
} }
case GAME_MSG.MSG_RECOVER: { case GAME_MSG.MSG_RECOVER: {
gameMsg.update_hp = MsgRecover(gameData); gameMsg.update_hp = MsgRecover(gameData);
break; break;
} }
case GAME_MSG.MSG_WIN: { case GAME_MSG.MSG_WIN: {
gameMsg.win = MsgWin(gameData); gameMsg.win = MsgWin(gameData);
break; break;
} }
case GAME_MSG.MSG_WAITING: { case GAME_MSG.MSG_WAITING: {
gameMsg.wait = MsgWaitAdapter(gameData); gameMsg.wait = MsgWaitAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_UPDATE_DATA: { case GAME_MSG.MSG_UPDATE_DATA: {
gameMsg.update_data = MsgUpdateDataAdapter(gameData); gameMsg.update_data = MsgUpdateDataAdapter(gameData);
break;
}
case GAME_MSG.MSG_UPDATE_CARD: {
gameMsg.update_data = MsgUpdateCardAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_RELOAD_FIELD: { case GAME_MSG.MSG_RELOAD_FIELD: {
gameMsg.reload_field = MsgReloadFieldAdapter(gameData); gameMsg.reload_field = MsgReloadFieldAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_SUM: { case GAME_MSG.MSG_SELECT_SUM: {
gameMsg.select_sum = MsgSelectSum(gameData); gameMsg.select_sum = MsgSelectSum(gameData);
break; break;
} }
case GAME_MSG.MSG_ADD_COUNTER: { case GAME_MSG.MSG_ADD_COUNTER: {
gameMsg.update_counter = MsgAddCounter(gameData); gameMsg.update_counter = MsgAddCounter(gameData);
break; break;
} }
case GAME_MSG.MSG_REMOVE_COUNTER: { case GAME_MSG.MSG_REMOVE_COUNTER: {
gameMsg.update_counter = MsgRemoveCounter(gameData); gameMsg.update_counter = MsgRemoveCounter(gameData);
break; break;
} }
case GAME_MSG.MSG_SELECT_COUNTER: { case GAME_MSG.MSG_SELECT_COUNTER: {
gameMsg.select_counter = MsgSelectCounter(gameData); gameMsg.select_counter = MsgSelectCounter(gameData);
break; break;
} }
case GAME_MSG.MSG_SORT_CARD: { case GAME_MSG.MSG_SORT_CARD: {
gameMsg.sort_card = MsgSortCard(gameData); gameMsg.sort_card = MsgSortCard(gameData);
break; break;
} }
case GAME_MSG.MSG_ATTACK: { case GAME_MSG.MSG_ATTACK: {
gameMsg.attack = MsgAttack(gameData); gameMsg.attack = MsgAttack(gameData);
break; break;
} }
case GAME_MSG.MSG_ANNOUNCE_RACE: { case GAME_MSG.MSG_ANNOUNCE_RACE: {
gameMsg.announce = MsgAnnounceRace(gameData); gameMsg.announce = MsgAnnounceRace(gameData);
break; break;
} }
case GAME_MSG.MSG_ANNOUNCE_ATTRIB: { case GAME_MSG.MSG_ANNOUNCE_ATTRIB: {
gameMsg.announce = MsgAnnounceAttribute(gameData); gameMsg.announce = MsgAnnounceAttribute(gameData);
break; break;
} }
case GAME_MSG.MSG_ANNOUNCE_CARD: { case GAME_MSG.MSG_ANNOUNCE_CARD: {
gameMsg.announce = MsgAnnounceCard(gameData); gameMsg.announce = MsgAnnounceCard(gameData);
break; break;
} }
case GAME_MSG.MSG_ANNOUNCE_NUMBER: { case GAME_MSG.MSG_ANNOUNCE_NUMBER: {
gameMsg.announce = MsgAnnounceNumber(gameData); gameMsg.announce = MsgAnnounceNumber(gameData);
break; break;
} }
case GAME_MSG.MSG_TOSS_COIN: { case GAME_MSG.MSG_TOSS_COIN: {
...@@ -232,7 +206,6 @@ export default class GameMsgAdapter implements StocAdapter { ...@@ -232,7 +206,6 @@ export default class GameMsgAdapter implements StocAdapter {
gameData, gameData,
ygopro.StocGameMessage.MsgToss.TossType.COIN, ygopro.StocGameMessage.MsgToss.TossType.COIN,
); );
break; break;
} }
case GAME_MSG.MSG_TOSS_DICE: { case GAME_MSG.MSG_TOSS_DICE: {
...@@ -240,22 +213,18 @@ export default class GameMsgAdapter implements StocAdapter { ...@@ -240,22 +213,18 @@ export default class GameMsgAdapter implements StocAdapter {
gameData, gameData,
ygopro.StocGameMessage.MsgToss.TossType.DICE, ygopro.StocGameMessage.MsgToss.TossType.DICE,
); );
break; break;
} }
case GAME_MSG.MSG_SHUFFLE_SET_CARD: { case GAME_MSG.MSG_SHUFFLE_SET_CARD: {
gameMsg.shuffle_set_card = MsgShuffleSetCard(gameData); gameMsg.shuffle_set_card = MsgShuffleSetCard(gameData);
break; break;
} }
case GAME_MSG.MSG_FIELD_DISABLED: { case GAME_MSG.MSG_FIELD_DISABLED: {
gameMsg.field_disabled = MsgFieldDisabledAdapter(gameData); gameMsg.field_disabled = MsgFieldDisabledAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_HAND_RES: { case GAME_MSG.MSG_HAND_RES: {
gameMsg.hand_res = MsgHandResultAdapter(gameData); gameMsg.hand_res = MsgHandResultAdapter(gameData);
break; break;
} }
case GAME_MSG.MSG_SHUFFLE_HAND: { case GAME_MSG.MSG_SHUFFLE_HAND: {
...@@ -263,7 +232,6 @@ export default class GameMsgAdapter implements StocAdapter { ...@@ -263,7 +232,6 @@ export default class GameMsgAdapter implements StocAdapter {
gameData, gameData,
false, false,
); );
break; break;
} }
case GAME_MSG.MSG_SHUFFLE_EXTRA: { case GAME_MSG.MSG_SHUFFLE_EXTRA: {
...@@ -271,19 +239,16 @@ export default class GameMsgAdapter implements StocAdapter { ...@@ -271,19 +239,16 @@ export default class GameMsgAdapter implements StocAdapter {
gameData, gameData,
true, true,
); );
break; break;
} }
case GAME_MSG.MSG_SIBYL_NAME: { case GAME_MSG.MSG_SIBYL_NAME: {
gameMsg.sibyl_name = MsgSibylNameAdapter(gameData); gameMsg.sibyl_name = MsgSibylNameAdapter(gameData);
break; break;
} }
default: { default: {
gameMsg.unimplemented = new ygopro.StocGameMessage.MsgUnimplemented({ gameMsg.unimplemented = new ygopro.StocGameMessage.MsgUnimplemented({
command: func, command: func,
}); });
break; break;
} }
} }
......
import { ygopro } from "../../../idl/ocgcore";
import { BufferReaderExt } from "../../bufferIO";
import { numberToCardZone, readUpdateAction } from "../../util";
import MsgUpdateData = ygopro.StocGameMessage.MsgUpdateData;
/*
* Msg UpdateCard
*
* @param - TODO
*
* @usage - ygopro后端通知前端更新单张卡片的元数据
* */
export default (data: Uint8Array) => {
const reader = new BufferReaderExt(data);
const player = reader.inner.readUint8();
const zone = numberToCardZone(reader.inner.readUint8());
const sequence = reader.inner.readUint8();
// pending
reader.inner.readUint32();
const msg = new MsgUpdateData({ player, zone, actions: [] });
const action = readUpdateAction(reader);
if (action) {
if (action.location !== undefined && zone !== undefined) {
action.location.controller = player;
action.location.zone = zone;
action.location.sequence = sequence;
} else {
action.location = new ygopro.CardLocation({
controller: player,
zone,
sequence,
});
}
msg.actions.push(action);
}
return msg;
};
import {
QUERY_ALIAS,
QUERY_ATTACK,
QUERY_ATTRIBUTE,
QUERY_BASE_ATTACK,
QUERY_BASE_DEFENSE,
QUERY_CODE,
QUERY_COUNTERS,
QUERY_DEFENSE,
QUERY_EQUIP_CARD,
QUERY_LEVEL,
QUERY_LINK,
QUERY_LSCALE,
QUERY_OVERLAY_CARD,
QUERY_OWNER,
QUERY_POSITION,
QUERY_RACE,
QUERY_RANK,
QUERY_REASON,
QUERY_REASON_CARD,
QUERY_RSCALE,
QUERY_STATUS,
QUERY_TARGET_CARD,
QUERY_TYPE,
} from "../../../../../common";
import { ygopro } from "../../../idl/ocgcore"; import { ygopro } from "../../../idl/ocgcore";
import { BufferReaderExt } from "../../bufferIO"; import { BufferReaderExt } from "../../bufferIO";
import { numberToCardZone } from "../../util"; import { numberToCardZone, readUpdateAction } from "../../util";
import MsgUpdateData = ygopro.StocGameMessage.MsgUpdateData; import MsgUpdateData = ygopro.StocGameMessage.MsgUpdateData;
/* /*
...@@ -52,7 +27,7 @@ export default (data: Uint8Array) => { ...@@ -52,7 +27,7 @@ export default (data: Uint8Array) => {
const len = reader.inner.readInt32(); const len = reader.inner.readInt32();
if (len === 4) continue; if (len === 4) continue;
const pos = reader.inner.offset(); const pos = reader.inner.offset();
const action = _readUpdateAction(reader); const action = readUpdateAction(reader);
if (action) { if (action) {
msg.actions.push(action); msg.actions.push(action);
} }
...@@ -64,142 +39,3 @@ export default (data: Uint8Array) => { ...@@ -64,142 +39,3 @@ export default (data: Uint8Array) => {
return msg; return msg;
}; };
function _readUpdateAction(
reader: BufferReaderExt,
): MsgUpdateData.Action | undefined {
const flag = reader.inner.readInt32();
if (flag === 0) return undefined;
const mask = -1;
let code = mask;
let location;
let alias = mask;
let type_ = mask;
let level = mask;
let rank = mask;
let attribute = mask;
let race = mask;
let attack = mask;
let defense = mask;
let base_attack = mask;
let base_defense = mask;
let reason = mask;
let reason_card = mask;
let equip_card;
let target_cards = [];
let overlay_cards = [];
let counters = new Map<number, number>();
let owner = mask;
let status = mask;
let lscale = mask;
let rscale = mask;
let link = mask;
if (flag & QUERY_CODE) {
code = reader.inner.readInt32();
}
if (flag & QUERY_POSITION) {
location = reader.readCardLocation();
}
if (flag & QUERY_ALIAS) {
alias = reader.inner.readInt32();
}
if (flag & QUERY_TYPE) {
type_ = reader.inner.readInt32();
}
if (flag & QUERY_LEVEL) {
level = reader.inner.readInt32();
}
if (flag & QUERY_RANK) {
rank = reader.inner.readInt32();
}
if (flag & QUERY_ATTRIBUTE) {
attribute = reader.inner.readInt32();
}
if (flag & QUERY_RACE) {
race = reader.inner.readInt32();
}
if (flag & QUERY_ATTACK) {
attack = reader.inner.readInt32();
}
if (flag & QUERY_DEFENSE) {
defense = reader.inner.readInt32();
}
if (flag & QUERY_BASE_ATTACK) {
base_attack = reader.inner.readInt32();
}
if (flag & QUERY_BASE_DEFENSE) {
base_defense = reader.inner.readInt32();
}
if (flag & QUERY_REASON) {
reason = reader.inner.readInt32();
}
if (flag & QUERY_REASON_CARD) {
reason_card = reader.inner.readInt32();
}
if (flag & QUERY_EQUIP_CARD) {
equip_card = reader.readCardLocation();
}
if (flag & QUERY_TARGET_CARD) {
const count = reader.inner.readInt32();
for (let i = 0; i < count; i += 1) {
target_cards.push(reader.readCardLocation());
}
}
if (flag & QUERY_OVERLAY_CARD) {
const count = reader.inner.readInt32();
for (let i = 0; i < count; i += 1) {
overlay_cards.push(reader.inner.readInt32());
}
}
if (flag & QUERY_COUNTERS) {
const count = reader.inner.readInt32();
for (let i = 0; i < count; i += 1) {
const ctype = reader.inner.readUint16();
const ccount = reader.inner.readUint16();
counters.set(ctype, ccount);
}
}
if (flag & QUERY_OWNER) {
owner = reader.inner.readInt32();
}
if (flag & QUERY_STATUS) {
status = reader.inner.readInt32();
}
if (flag & QUERY_LSCALE) {
lscale = reader.inner.readInt32();
}
if (flag & QUERY_RSCALE) {
rscale = reader.inner.readInt32();
}
if (flag & QUERY_LINK) {
link = reader.inner.readInt32();
}
return new MsgUpdateData.Action({
code,
location,
alias,
type_,
level,
rank,
attribute,
race,
attack,
defense,
base_attack,
base_defense,
reason,
reason_card,
equip_card,
target_cards,
overlay_cards,
counters,
owner,
status,
lscale,
rscale,
link,
});
}
...@@ -3,7 +3,34 @@ ...@@ -3,7 +3,34 @@
* *
* */ * */
import {
QUERY_ALIAS,
QUERY_ATTACK,
QUERY_ATTRIBUTE,
QUERY_BASE_ATTACK,
QUERY_BASE_DEFENSE,
QUERY_CODE,
QUERY_COUNTERS,
QUERY_DEFENSE,
QUERY_EQUIP_CARD,
QUERY_LEVEL,
QUERY_LINK,
QUERY_LSCALE,
QUERY_OVERLAY_CARD,
QUERY_OWNER,
QUERY_POSITION,
QUERY_RACE,
QUERY_RANK,
QUERY_REASON,
QUERY_REASON_CARD,
QUERY_RSCALE,
QUERY_STATUS,
QUERY_TARGET_CARD,
QUERY_TYPE,
} from "../../../common";
import { ygopro } from "../idl/ocgcore"; import { ygopro } from "../idl/ocgcore";
import { BufferReaderExt } from "./bufferIO";
import MsgUpdateData = ygopro.StocGameMessage.MsgUpdateData;
export const UTF16_BUFFER_MAX_LEN = 20; export const UTF16_BUFFER_MAX_LEN = 20;
const FILLING_TOKEN: number = 0xcccc; const FILLING_TOKEN: number = 0xcccc;
...@@ -226,3 +253,142 @@ export function _cutoff_name(data: Uint8Array): Uint8Array { ...@@ -226,3 +253,142 @@ export function _cutoff_name(data: Uint8Array): Uint8Array {
} }
return Uint8Array.from(res); return Uint8Array.from(res);
} }
export function readUpdateAction(
reader: BufferReaderExt,
): MsgUpdateData.Action | undefined {
const flag = reader.inner.readInt32();
if (flag === 0) return undefined;
const mask = -1;
let code = mask;
let location;
let alias = mask;
let type_ = mask;
let level = mask;
let rank = mask;
let attribute = mask;
let race = mask;
let attack = mask;
let defense = mask;
let base_attack = mask;
let base_defense = mask;
let reason = mask;
let reason_card = mask;
let equip_card;
let target_cards = [];
let overlay_cards = [];
let counters = new Map<number, number>();
let owner = mask;
let status = mask;
let lscale = mask;
let rscale = mask;
let link = mask;
if (flag & QUERY_CODE) {
code = reader.inner.readInt32();
}
if (flag & QUERY_POSITION) {
location = reader.readCardLocation();
}
if (flag & QUERY_ALIAS) {
alias = reader.inner.readInt32();
}
if (flag & QUERY_TYPE) {
type_ = reader.inner.readInt32();
}
if (flag & QUERY_LEVEL) {
level = reader.inner.readInt32();
}
if (flag & QUERY_RANK) {
rank = reader.inner.readInt32();
}
if (flag & QUERY_ATTRIBUTE) {
attribute = reader.inner.readInt32();
}
if (flag & QUERY_RACE) {
race = reader.inner.readInt32();
}
if (flag & QUERY_ATTACK) {
attack = reader.inner.readInt32();
}
if (flag & QUERY_DEFENSE) {
defense = reader.inner.readInt32();
}
if (flag & QUERY_BASE_ATTACK) {
base_attack = reader.inner.readInt32();
}
if (flag & QUERY_BASE_DEFENSE) {
base_defense = reader.inner.readInt32();
}
if (flag & QUERY_REASON) {
reason = reader.inner.readInt32();
}
if (flag & QUERY_REASON_CARD) {
reason_card = reader.inner.readInt32();
}
if (flag & QUERY_EQUIP_CARD) {
equip_card = reader.readCardLocation();
}
if (flag & QUERY_TARGET_CARD) {
const count = reader.inner.readInt32();
for (let i = 0; i < count; i += 1) {
target_cards.push(reader.readCardLocation());
}
}
if (flag & QUERY_OVERLAY_CARD) {
const count = reader.inner.readInt32();
for (let i = 0; i < count; i += 1) {
overlay_cards.push(reader.inner.readInt32());
}
}
if (flag & QUERY_COUNTERS) {
const count = reader.inner.readInt32();
for (let i = 0; i < count; i += 1) {
const ctype = reader.inner.readUint16();
const ccount = reader.inner.readUint16();
counters.set(ctype, ccount);
}
}
if (flag & QUERY_OWNER) {
owner = reader.inner.readInt32();
}
if (flag & QUERY_STATUS) {
status = reader.inner.readInt32();
}
if (flag & QUERY_LSCALE) {
lscale = reader.inner.readInt32();
}
if (flag & QUERY_RSCALE) {
rscale = reader.inner.readInt32();
}
if (flag & QUERY_LINK) {
link = reader.inner.readInt32();
}
return new MsgUpdateData.Action({
code,
location,
alias,
type_,
level,
rank,
attribute,
race,
attack,
defense,
base_attack,
base_defense,
reason,
reason_card,
equip_card,
target_cards,
overlay_cards,
counters,
owner,
status,
lscale,
rscale,
link,
});
}
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