Commit 9d02d41c authored by Chunchi Che's avatar Chunchi Che

add status for card

parent 1a685aa3
Pipeline #28743 passed with stages
in 17 minutes and 10 seconds
......@@ -453,3 +453,36 @@ function ifSetCard(setCodeToAnalyse: number, setCodeFromCard: number): boolean {
return res;
}
export const STATUS_DISABLED = 0x0001;
// const STATUS_TO_ENABLE = 0x0002
// const STATUS_TO_DISABLE = 0x0004
// const STATUS_PROC_COMPLETE = 0x0008
// const STATUS_SET_TURN = 0x0010
// const STATUS_NO_LEVEL = 0x0020
// const STATUS_BATTLE_RESULT = 0x0040
// const STATUS_SPSUMMON_STEP = 0x0080
// const STATUS_FORM_CHANGED = 0x0100
// const STATUS_SUMMONING = 0x0200
// const STATUS_EFFECT_ENABLED = 0x0400
// const STATUS_SUMMON_TURN = 0x0800
// const STATUS_DESTROY_CONFIRMED = 0x1000
// const STATUS_LEAVE_CONFIRMED = 0x2000
// const STATUS_BATTLE_DESTROYED = 0x4000
// const STATUS_COPYING_EFFECT = 0x8000
// const STATUS_CHAINING = 0x10000
// const STATUS_SUMMON_DISABLED = 0x20000
// const STATUS_ACTIVATE_DISABLED = 0x40000
// const STATUS_EFFECT_REPLACED = 0x80000
// const STATUS_FLIP_SUMMONING = 0x100000
// const STATUS_ATTACK_CANCELED = 0x200000
// const STATUS_INITIALIZING = 0x400000
// const STATUS_TO_HAND_WITHOUT_CONFIRM = 0x800000
// const STATUS_JUST_POS = 0x1000000
// const STATUS_CONTINUOUS_POS = 0x2000000
export const STATUS_FORBIDDEN = 0x4000000;
// const STATUS_ACT_FROM_HAND = 0x8000000
// const STATUS_OPPO_BATTLE = 0x10000000
// const STATUS_FLIP_SUMMON_TURN = 0x20000000
// const STATUS_SPSUMMON_TURN = 0x40000000
// const STATUS_FLIP_SUMMON_DISABLED = 0x80000000
......@@ -41,6 +41,7 @@ export default (container: Container, field: MsgReloadField) => {
selectable: false,
selected: false,
},
status: 0,
}),
),
)
......
......@@ -77,6 +77,7 @@ export default async (
selectable: false,
selected: false,
},
status: 0,
}),
),
),
......
......@@ -16,7 +16,7 @@ export default async (container: Container, updateData: MsgUpdateData) => {
.filter((card) => card.location.sequence === sequence)
.at(0);
if (target) {
if (action?.code > 0 && target.code === 0) {
if (action.code > 0 && target.code === 0) {
// 当本地code为0且action的code大于0时,才从db加载整个meta信息
const newMeta = fetchCard(action.code);
target.code = action.code;
......@@ -32,27 +32,30 @@ export default async (container: Container, updateData: MsgUpdateData) => {
await callCardMove(target.uuid);
}
}
if (action?.type_ >= 0) {
if (action.type_ >= 0) {
meta.data.type = action.type_;
if (action.type_ & TYPE_TOKEN) {
target.isToken = true;
}
}
if (action?.level >= 0) {
if (action.level >= 0) {
meta.data.level = action.level;
}
if (action?.attribute >= 0) {
if (action.attribute >= 0) {
meta.data.attribute = action.attribute;
}
if (action?.race >= 0) {
if (action.race >= 0) {
meta.data.race = action.race;
}
if (action?.attack >= 0) {
if (action.attack >= 0) {
meta.data.atk = action.attack;
}
if (action?.defense >= 0) {
if (action.defense >= 0) {
meta.data.def = action.defense;
}
if (action.status >= 0) {
target.status = action.status;
}
// TODO: counters
} else {
console.warn(
......
......@@ -22,6 +22,7 @@ export interface CardType {
selected: boolean; // 是否已经被选择
response?: number; // 被选择时发送给服务器的值
};
status: number; // Current status, STATUS_DISABLED, etc.
}
export class CardStore implements NeosStore {
......
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