Commit 16155b29 authored by Chunchi Che's avatar Chunchi Che

rename controler to controller

parent 1c27f135
neos-protobuf @ 44727f71
Subproject commit 75fb3c4b20d9909da5aa0ac4a4cbb512a602cf4a
Subproject commit 44727f7136ec5708c86d6ed09d5bec8b48f13efc
......@@ -41,7 +41,7 @@ export namespace ygopro {
| any[]
| {
code?: number;
controler?: number;
controller?: number;
location?: CardZone;
sequence?: number;
}
......@@ -59,8 +59,8 @@ export namespace ygopro {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("controler" in data && data.controler != undefined) {
this.controler = data.controler;
if ("controller" in data && data.controller != undefined) {
this.controller = data.controller;
}
if ("location" in data && data.location != undefined) {
this.location = data.location;
......@@ -76,10 +76,10 @@ export namespace ygopro {
set code(value: number) {
pb_1.Message.setField(this, 1, value);
}
get controler() {
get controller() {
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
}
set controler(value: number) {
set controller(value: number) {
pb_1.Message.setField(this, 2, value);
}
get location() {
......@@ -100,7 +100,7 @@ export namespace ygopro {
}
static fromObject(data: {
code?: number;
controler?: number;
controller?: number;
location?: CardZone;
sequence?: number;
}): CardInfo {
......@@ -108,8 +108,8 @@ export namespace ygopro {
if (data.code != null) {
message.code = data.code;
}
if (data.controler != null) {
message.controler = data.controler;
if (data.controller != null) {
message.controller = data.controller;
}
if (data.location != null) {
message.location = data.location;
......@@ -122,15 +122,15 @@ export namespace ygopro {
toObject() {
const data: {
code?: number;
controler?: number;
controller?: number;
location?: CardZone;
sequence?: number;
} = {};
if (this.code != null) {
data.code = this.code;
}
if (this.controler != null) {
data.controler = this.controler;
if (this.controller != null) {
data.controller = this.controller;
}
if (this.location != null) {
data.location = this.location;
......@@ -145,7 +145,7 @@ export namespace ygopro {
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.code != 0) writer.writeInt32(1, this.code);
if (this.controler != 0) writer.writeInt32(2, this.controler);
if (this.controller != 0) writer.writeInt32(2, this.controller);
if (this.location != CardZone.DECK) writer.writeEnum(3, this.location);
if (this.sequence != 0) writer.writeInt32(4, this.sequence);
if (!w) return writer.getResultBuffer();
......@@ -163,7 +163,7 @@ export namespace ygopro {
message.code = reader.readInt32();
break;
case 2:
message.controler = reader.readInt32();
message.controller = reader.readInt32();
break;
case 3:
message.location = reader.readEnum();
......@@ -190,7 +190,7 @@ export namespace ygopro {
data?:
| any[]
| {
controler?: number;
controller?: number;
zone?: CardZone;
sequence?: number;
position?: CardPosition;
......@@ -208,8 +208,8 @@ export namespace ygopro {
this.#one_of_decls
);
if (!Array.isArray(data) && typeof data == "object") {
if ("controler" in data && data.controler != undefined) {
this.controler = data.controler;
if ("controller" in data && data.controller != undefined) {
this.controller = data.controller;
}
if ("zone" in data && data.zone != undefined) {
this.zone = data.zone;
......@@ -228,10 +228,10 @@ export namespace ygopro {
}
}
}
get controler() {
get controller() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set controler(value: number) {
set controller(value: number) {
pb_1.Message.setField(this, 1, value);
}
get zone() {
......@@ -273,7 +273,7 @@ export namespace ygopro {
pb_1.Message.setField(this, 6, value);
}
static fromObject(data: {
controler?: number;
controller?: number;
zone?: CardZone;
sequence?: number;
position?: CardPosition;
......@@ -281,8 +281,8 @@ export namespace ygopro {
overlay_sequence?: number;
}): CardLocation {
const message = new CardLocation({});
if (data.controler != null) {
message.controler = data.controler;
if (data.controller != null) {
message.controller = data.controller;
}
if (data.zone != null) {
message.zone = data.zone;
......@@ -303,15 +303,15 @@ export namespace ygopro {
}
toObject() {
const data: {
controler?: number;
controller?: number;
zone?: CardZone;
sequence?: number;
position?: CardPosition;
is_overlay?: boolean;
overlay_sequence?: number;
} = {};
if (this.controler != null) {
data.controler = this.controler;
if (this.controller != null) {
data.controller = this.controller;
}
if (this.zone != null) {
data.zone = this.zone;
......@@ -334,7 +334,7 @@ export namespace ygopro {
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.controler != 0) writer.writeInt32(1, this.controler);
if (this.controller != 0) writer.writeInt32(1, this.controller);
if (this.zone != CardZone.DECK) writer.writeEnum(2, this.zone);
if (this.sequence != 0) writer.writeInt32(3, this.sequence);
if (this.position != CardPosition.FACEUP_ATTACK)
......@@ -354,7 +354,7 @@ export namespace ygopro {
if (reader.isEndGroup()) break;
switch (reader.getFieldNumber()) {
case 1:
message.controler = reader.readInt32();
message.controller = reader.readInt32();
break;
case 2:
message.zone = reader.readEnum();
......@@ -11006,7 +11006,7 @@ export namespace ygopro {
data?:
| any[]
| {
controler?: number;
controller?: number;
zone?: CardZone;
sequence?: number;
}
......@@ -11021,8 +11021,8 @@ export namespace ygopro {
this.#one_of_decls
);
if (!Array.isArray(data) && typeof data == "object") {
if ("controler" in data && data.controler != undefined) {
this.controler = data.controler;
if ("controller" in data && data.controller != undefined) {
this.controller = data.controller;
}
if ("zone" in data && data.zone != undefined) {
this.zone = data.zone;
......@@ -11032,10 +11032,10 @@ export namespace ygopro {
}
}
}
get controler() {
get controller() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set controler(value: number) {
set controller(value: number) {
pb_1.Message.setField(this, 1, value);
}
get zone() {
......@@ -11055,13 +11055,13 @@ export namespace ygopro {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: {
controler?: number;
controller?: number;
zone?: CardZone;
sequence?: number;
}): SelectAblePlace {
const message = new SelectAblePlace({});
if (data.controler != null) {
message.controler = data.controler;
if (data.controller != null) {
message.controller = data.controller;
}
if (data.zone != null) {
message.zone = data.zone;
......@@ -11073,12 +11073,12 @@ export namespace ygopro {
}
toObject() {
const data: {
controler?: number;
controller?: number;
zone?: CardZone;
sequence?: number;
} = {};
if (this.controler != null) {
data.controler = this.controler;
if (this.controller != null) {
data.controller = this.controller;
}
if (this.zone != null) {
data.zone = this.zone;
......@@ -11092,7 +11092,7 @@ export namespace ygopro {
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.controler != 0) writer.writeInt32(1, this.controler);
if (this.controller != 0) writer.writeInt32(1, this.controller);
if (this.zone != CardZone.DECK) writer.writeEnum(2, this.zone);
if (this.sequence != 0) writer.writeInt32(3, this.sequence);
if (!w) return writer.getResultBuffer();
......@@ -11109,7 +11109,7 @@ export namespace ygopro {
if (reader.isEndGroup()) break;
switch (reader.getFieldNumber()) {
case 1:
message.controler = reader.readInt32();
message.controller = reader.readInt32();
break;
case 2:
message.zone = reader.readEnum();
......
......@@ -14,20 +14,20 @@ export class BufferReaderExt {
readCardInfo(): ygopro.CardInfo {
const code = this.inner.readUint32();
const controler = this.inner.readUint8();
const controller = this.inner.readUint8();
const location = numberToCardZone(this.inner.readUint8());
const sequence = this.inner.readUint8();
return new ygopro.CardInfo({
code,
controler,
controller,
location,
sequence,
});
}
readCardLocation(): ygopro.CardLocation {
const controler = this.inner.readUint8();
const controller = this.inner.readUint8();
const location = this.inner.readUint8();
const sequence = this.inner.readUint8();
const ss = this.inner.readUint8();
......@@ -35,7 +35,7 @@ export class BufferReaderExt {
if (location & LOCATION_OVERLAY) {
// 超量素材
return new ygopro.CardLocation({
controler,
controller,
zone: numberToCardZone(location & ~LOCATION_OVERLAY),
sequence,
is_overlay: true,
......@@ -43,7 +43,7 @@ export class BufferReaderExt {
});
} else {
return new ygopro.CardLocation({
controler,
controller,
zone: numberToCardZone(location),
sequence,
is_overlay: false,
......@@ -53,12 +53,12 @@ export class BufferReaderExt {
}
readCardShortLocation(): ygopro.CardLocation {
const controler = this.inner.readUint8();
const controller = this.inner.readUint8();
const location = this.inner.readUint8();
const sequence = this.inner.readUint8();
return new ygopro.CardLocation({
controler,
controller,
zone: numberToCardZone(location),
sequence,
});
......
......@@ -17,7 +17,7 @@ export default (data: Uint8Array) => {
const target_location = reader.readCardLocation();
if (
target_location.controler == 0 &&
target_location.controller == 0 &&
target_location.zone == 0 &&
target_location.sequence == 0
) {
......
......@@ -30,7 +30,7 @@ export default (data: Uint8Array) => {
});
for (let i = 0; i < 2; i++) {
const controler = i == 0 ? player : 1 - player;
const controller = i == 0 ? player : 1 - player;
const field = i == 0 ? _field & 0xffff : _field >> 16;
if ((field & 0x7f) != 0) {
......@@ -42,7 +42,7 @@ export default (data: Uint8Array) => {
if ((filter & (1 << sequence)) != 0) {
msg.places.push(
new MsgSelectPlace.SelectAblePlace({
controler,
controller,
zone,
sequence: sequence,
})
......@@ -60,7 +60,7 @@ export default (data: Uint8Array) => {
if ((filter & (1 << sequence)) != 0) {
msg.places.push(
new MsgSelectPlace.SelectAblePlace({
controler,
controller,
zone,
sequence,
})
......@@ -77,7 +77,7 @@ export default (data: Uint8Array) => {
if ((filter & 0x1) != 0) {
msg.places.push(
new MsgSelectPlace.SelectAblePlace({
controler,
controller,
zone,
sequence: 6,
})
......@@ -87,7 +87,7 @@ export default (data: Uint8Array) => {
if ((filter & 0x2) != 0) {
msg.places.push(
new MsgSelectPlace.SelectAblePlace({
controler,
controller,
zone,
sequence: 7,
})
......
......@@ -154,14 +154,14 @@ export function sendSelectIdleCmdResponse(value: number) {
}
export function sendSelectPlaceResponse(value: {
controler: number;
controller: number;
zone: ygopro.CardZone;
sequence: number;
}) {
const response = new ygopro.YgoCtosMsg({
ctos_response: new ygopro.CtosGameMsgResponse({
select_place: new ygopro.CtosGameMsgResponse.SelectPlaceResponse({
player: value.controler,
player: value.controller,
zone: value.zone,
sequence: value.sequence,
}),
......
......@@ -9,7 +9,7 @@ export default async (attack: ygopro.StocGameMessage.MsgAttack) => {
const attacker = cardStore.at(
attack.attacker_location.zone,
attack.attacker_location.controler,
attack.attacker_location.controller,
attack.attacker_location.sequence
);
......@@ -22,13 +22,13 @@ export default async (attack: ygopro.StocGameMessage.MsgAttack) => {
} else {
const target = cardStore.at(
attack.target_location.zone,
attack.target_location.controler,
attack.target_location.controller,
attack.target_location.sequence
);
if (target) {
attacker.attackTarget = {
opponent: !matStore.isMe(attack.target_location.controler),
opponent: !matStore.isMe(attack.target_location.controller),
...target,
};
......
......@@ -6,7 +6,7 @@ export default async (confirmCards: ygopro.StocGameMessage.MsgConfirmCards) => {
console.color("pink")(`confirmCards: ${cards}`);
for (const card of cards) {
const target = cardStore.at(card.location, card.controler, card.sequence);
const target = cardStore.at(card.location, card.controller, card.sequence);
if (target) {
// 设置`occupant`
......
......@@ -64,7 +64,7 @@ export default async (move: MsgMove) => {
// 超量素材的去除
const overlayMaterial = cardStore.at(
from.zone,
from.controler,
from.controller,
from.sequence,
from.overlay_sequence
);
......@@ -72,20 +72,20 @@ export default async (move: MsgMove) => {
target = overlayMaterial;
} else {
console.warn(
`<Move>overlayMaterial from zone=${from.zone}, controller=${from.controler},
`<Move>overlayMaterial from zone=${from.zone}, controller=${from.controller},
sequence=${from.sequence}, overlay_sequence=${from.overlay_sequence} is null`
);
return;
}
} else {
const card = cardStore.at(from.zone, from.controler, from.sequence);
const card = cardStore.at(from.zone, from.controller, from.sequence);
if (card) {
target = card;
} else {
console.warn(
`<Move>card from zone=${from.zone}, controller=${from.controler} sequence=${from.sequence} is null`
`<Move>card from zone=${from.zone}, controller=${from.controller} sequence=${from.sequence} is null`
);
console.info(cardStore.at(from.zone, from.controler));
console.info(cardStore.at(from.zone, from.controller));
return;
}
}
......@@ -106,28 +106,28 @@ export default async (move: MsgMove) => {
for (const location of xyzLocations) {
const overlayMaterial = cardStore.at(
location.zone,
location.controler,
location.controller,
location.sequence,
location.overlay_sequence
);
if (overlayMaterial) {
// 超量素材的位置应该和超量怪兽保持一致
overlayMaterial.location.controler = to.controler;
overlayMaterial.location.controller = to.controller;
overlayMaterial.location.zone = to.zone;
overlayMaterial.location.sequence = to.sequence;
await eventbus.call(Task.Move, overlayMaterial.uuid);
} else {
console.warn(
`<Move>overlayMaterial from zone=${location.zone}, controller=${location.controler}, sequence=${location.sequence}, overlay_sequence=${location.overlay_sequence} is null`
`<Move>overlayMaterial from zone=${location.zone}, controller=${location.controller}, sequence=${location.sequence}, overlay_sequence=${location.overlay_sequence} is null`
);
}
}
}
// 维护sequence
const fromCards = cardStore.at(from.zone, from.controler);
const toCards = cardStore.at(to.zone, to.controler);
const fromCards = cardStore.at(from.zone, from.controller);
const toCards = cardStore.at(to.zone, to.controller);
if ([HAND, GRAVE, REMOVED, DECK, EXTRA, TZONE].includes(from.zone))
fromCards.forEach(
......@@ -142,7 +142,7 @@ export default async (move: MsgMove) => {
const overlay_sequence = from.overlay_sequence;
for (const overlay of cardStore.findOverlay(
from.zone,
from.controler,
from.controller,
from.sequence
)) {
if (overlay.location.overlay_sequence > overlay_sequence) {
......@@ -160,7 +160,7 @@ export default async (move: MsgMove) => {
promises.push(eventbus.call(Task.Move, target.uuid));
// 如果from或者to是手卡,那么需要刷新除了这张卡之外,这个玩家的所有手卡
if ([from.zone, to.zone].includes(HAND)) {
cardStore.at(HAND, target.location.controler).forEach((card) => {
cardStore.at(HAND, target.location.controller).forEach((card) => {
if (card.uuid !== target.uuid)
promises.push(eventbus.call(Task.Move, card.uuid));
});
......@@ -172,11 +172,11 @@ export default async (move: MsgMove) => {
if (from.zone == MZONE && !from.is_overlay) {
for (const overlay of cardStore.findOverlay(
from.zone,
from.controler,
from.controller,
from.sequence
)) {
overlay.location.zone = to.zone;
overlay.location.controler = to.controler;
overlay.location.controller = to.controller;
overlay.location.sequence = to.sequence;
await eventbus.call(Task.Move, overlay.uuid);
......
......@@ -3,9 +3,9 @@ import MsgPosChange = ygopro.StocGameMessage.MsgPosChange;
import { eventbus, Task } from "@/infra";
import { cardStore, fetchEsHintMeta } from "@/stores";
export default async (posChange: MsgPosChange) => {
const { location, controler, sequence } = posChange.card_info;
const { location, controller, sequence } = posChange.card_info;
const target = cardStore.at(location, controler, sequence);
const target = cardStore.at(location, controller, sequence);
if (target) {
target.location.position = posChange.cur_position;
......
......@@ -13,10 +13,10 @@ export default (selectPlace: MsgSelectPlace) => {
switch (place.zone) {
case ygopro.CardZone.MZONE:
case ygopro.CardZone.SZONE:
placeStore.set(place.zone, place.controler, place.sequence, {
placeStore.set(place.zone, place.controller, place.sequence, {
interactType: InteractType.PLACE_SELECTABLE,
response: {
controler: place.controler,
controller: place.controller,
zone: place.zone,
sequence: place.sequence,
},
......
......@@ -43,7 +43,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
uuid: v4uuid(),
code: 0,
location: new ygopro.CardLocation({
controler: i < 3 ? 0 : 1,
controller: i < 3 ? 0 : 1,
zone: [
ygopro.CardZone.DECK,
ygopro.CardZone.EXTRA,
......
......@@ -15,7 +15,7 @@ export interface CardType {
originController: number; // 在卡组构建之中持有这张卡的玩家,方便reloadField的使用
idleInteractivities: Interactivity<number>[]; // IDLE状态下的互动信息
placeInteractivity?: Interactivity<{
controler: number;
controller: number;
zone: ygopro.CardZone;
sequence: number;
}>; // 选择位置状态下的互动信息
......@@ -52,7 +52,7 @@ class CardStore {
.filter(
(card) =>
card.location.zone === zone &&
card.location.controler === controller &&
card.location.controller === controller &&
card.location.sequence === sequence &&
card.location.is_overlay == true &&
card.location.overlay_sequence == overlay_sequence
......@@ -63,7 +63,7 @@ class CardStore {
.filter(
(card) =>
card.location.zone === zone &&
card.location.controler === controller &&
card.location.controller === controller &&
card.location.sequence === sequence &&
card.location.is_overlay == false
)
......@@ -73,13 +73,13 @@ class CardStore {
return this.inner.filter(
(card) =>
card.location.zone === zone &&
card.location.controler === controller &&
card.location.controller === controller &&
card.location.is_overlay == false
);
}
}
find(location: ygopro.CardLocation): CardType | undefined {
return this.at(location.zone, location.controler, location.sequence);
return this.at(location.zone, location.controller, location.sequence);
}
// 获取特定位置下的所有超量素材
findOverlay(
......@@ -90,7 +90,7 @@ class CardStore {
return this.inner.filter(
(card) =>
card.location.zone == zone &&
card.location.controler == controller &&
card.location.controller == controller &&
card.location.sequence == sequence &&
card.location.is_overlay
);
......
......@@ -66,7 +66,7 @@ export const fetchEsHintMeta = async ({
if (location) {
const fieldMeta = cardStore.at(
location.zone,
location.controler,
location.controller,
location.sequence
);
if (fieldMeta?.meta.text.name) {
......
......@@ -21,7 +21,7 @@ export const fetchCheckCardMeta = async (
selected?: boolean,
mustSelect?: boolean
) => {
const controller = location.controler;
const controller = location.controller;
const newID =
code != 0
? code
......
......@@ -7,7 +7,7 @@ import type { Interactivity } from "./matStore/types";
export type PlaceInteractivity =
| Interactivity<{
controler: number;
controller: number;
zone: ygopro.CardZone;
sequence: number;
}>
......
......@@ -151,7 +151,7 @@ export const SelectActionsModal = () => {
style={{
width: 120,
backgroundColor:
option.location?.controler === 0
option.location?.controller === 0
? "white"
: "grey",
}}
......
......@@ -164,7 +164,7 @@ const onCardClick = (card: CardType) => {
// 侧边栏展示超量素材信息
const overlayMaterials = cardStore.findOverlay(
card.location.zone,
card.location.controler,
card.location.controller,
card.location.sequence
);
if (overlayMaterials.length > 0) {
......@@ -184,7 +184,7 @@ const onCardClick = (card: CardType) => {
const onFieldClick = (card: CardType) => {
const displayStates = cardStore.at(
card.location.zone,
card.location.controler
card.location.controller
);
messageStore.cardListModal.list = displayStates.map((item) => ({
meta: {
......
......@@ -13,7 +13,7 @@ export const focus = async (props: { card: CardType; api: SpringApi }) => {
const current = api.current[0].get();
if (card.location.zone === ygopro.CardZone.HAND) {
await asyncStart(api)({
y: current.y + (matStore.isMe(card.location.controler) ? -1 : 1) * 200, // TODO: 放到config之中
y: current.y + (matStore.isMe(card.location.controller) ? -1 : 1) * 200, // TODO: 放到config之中
rz: 0,
});
await asyncStart(api)({ y: current.y, rz: current.rz });
......
......@@ -31,7 +31,7 @@ export const moveToDeck = async (props: { card: CardType; api: SpringApi }) => {
const { card, api } = props;
// report
const { location } = card;
const { controler, zone, sequence, position } = location;
const { controller, zone, sequence, position } = location;
const rightX = DECK_OFFSET_X.value + 2 * (BLOCK_WIDTH.value + COL_GAP.value);
const leftX = -rightX;
......@@ -42,20 +42,20 @@ export const moveToDeck = async (props: { card: CardType; api: SpringApi }) => {
2 * ROW_GAP.value -
BLOCK_HEIGHT_S.value;
const topY = -bottomY;
let x = isMe(controler) ? rightX : leftX;
let y = isMe(controler) ? bottomY : topY;
let x = isMe(controller) ? rightX : leftX;
let y = isMe(controller) ? bottomY : topY;
if (zone === EXTRA) {
x = isMe(controler) ? leftX : rightX;
x = isMe(controller) ? leftX : rightX;
}
let rz = zone === EXTRA ? DECK_ROTATE_Z.value : -DECK_ROTATE_Z.value;
rz += isMe(controler) ? 0 : 180;
rz += isMe(controller) ? 0 : 180;
const z = sequence;
api.start({
x,
y,
z,
rz,
ry: isMe(controler) ? (zone === DECK ? 180 : 0) : 180,
ry: isMe(controller) ? (zone === DECK ? 180 : 0) : 180,
zIndex: z,
height: DECK_CARD_HEIGHT.value,
});
......
......@@ -34,7 +34,7 @@ export const moveToGround = async (props: {
const { location } = card;
const { controler, zone, sequence, position, is_overlay } = location;
const { controller, zone, sequence, position, is_overlay } = location;
// 根据zone计算卡片的宽度
const cardWidth =
......@@ -77,7 +77,7 @@ export const moveToGround = async (props: {
}
}
if (!isMe(controler)) {
if (!isMe(controller)) {
x = -x;
y = -y;
}
......@@ -89,7 +89,7 @@ export const moveToGround = async (props: {
ygopro.CardPosition.FACEUP_DEFENSE,
].includes(position ?? 5);
height = defence ? BLOCK_WIDTH.value : height;
let rz = isMe(controler) ? 0 : 180;
let rz = isMe(controller) ? 0 : 180;
rz += defence ? 90 : 0;
// 动画
......
......@@ -28,7 +28,7 @@ const { HAND, GRAVE, REMOVED, DECK, EXTRA, MZONE, SZONE, TZONE } =
export const moveToHand = async (props: { card: CardType; api: SpringApi }) => {
const { card, api } = props;
const { zone, sequence, controler } = card.location;
const { zone, sequence, controller } = card.location;
// 手卡会有很复杂的计算...
const hand_circle_center_x = 0;
const hand_circle_center_y =
......@@ -48,22 +48,22 @@ export const moveToHand = async (props: { card: CardType; api: SpringApi }) => {
) *
0.9;
// 接下来计算每一张手卡
const hands_length = cardStore.at(HAND, controler).length;
const hands_length = cardStore.at(HAND, controller).length;
const angle = (sequence - (hands_length - 1) / 2) * THETA;
const r = HAND_CIRCLE_CENTER_OFFSET_Y.value + HAND_CARD_HEIGHT.value / 2;
const negativeX = Math.sin(angle) * r;
const negativeY = Math.cos(angle) * r + HAND_CARD_HEIGHT.value / 2;
const x = hand_circle_center_x + negativeX * (isMe(controler) ? 1 : -1);
const x = hand_circle_center_x + negativeX * (isMe(controller) ? 1 : -1);
const y = hand_circle_center_y - negativeY + 130; // 常量 是手动调的 这里肯定有问题 有空来修
const _rz = (angle * 180) / Math.PI;
api.start({
x: isMe(controler) ? x : -x,
y: isMe(controler) ? y : -y,
x: isMe(controller) ? x : -x,
y: isMe(controller) ? y : -y,
z: 0,
rz: isMe(controler) ? _rz : 180 - _rz,
ry: isMe(controler) ? 0 : 180,
rz: isMe(controller) ? _rz : 180 - _rz,
ry: isMe(controller) ? 0 : 180,
height: HAND_CARD_HEIGHT.value,
zIndex: sequence,
// rx: -PLANE_ROTATE_X.value,
......
......@@ -32,11 +32,11 @@ export const moveToOutside = async (props: {
}) => {
const { card, api } = props;
// report
const { zone, sequence, controler, position } = card.location;
const { zone, sequence, controller, position } = card.location;
let x = (BLOCK_WIDTH.value + COL_GAP.value) * 3,
y = zone === GRAVE ? BLOCK_HEIGHT_M.value + ROW_GAP.value : 0;
if (!isMe(controler)) {
if (!isMe(controller)) {
x = -x;
y = -y;
}
......@@ -45,7 +45,7 @@ export const moveToOutside = async (props: {
y,
z: 0,
height: BLOCK_HEIGHT_S.value,
rz: isMe(controler) ? 0 : 180,
rz: isMe(controller) ? 0 : 180,
ry: [ygopro.CardPosition.FACEDOWN].includes(position) ? 180 : 0,
});
};
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