Commit 70713eae authored by timel's avatar timel Committed by Chunchi Che

fix: optimize log

parent 7365a6b2
......@@ -175,15 +175,9 @@ export default async (move: MsgMove) => {
(async () => {
const { text } = await fetchCard(code);
console.warn(
"move",
text.name,
ygopro.CardZone[fromZone],
from.sequence,
"->",
ygopro.CardZone[toZone],
to.sequence
`${text.name} ${ygopro.CardZone[fromZone]}:${from.sequence}${ygopro.CardZone[toZone]}:${to.sequence}`
);
console.warn("overlay", from.overlay_sequence, to.overlay_sequence);
// console.warn("overlay", from.overlay_sequence, to.overlay_sequence);
})();
let target: CardType;
......@@ -238,6 +232,7 @@ export default async (move: MsgMove) => {
if (card.uuid !== target.uuid) eventBus.emit(Report.Move, card.uuid);
});
}
// TODO: 如果涉及了有超量素材的怪兽的移动,那么这个怪兽的移动应该也会带动超量素材的移动
// 注意,一个monster的overlayMaterials中的每一项都是一个cardType,
// 并且,overlayMaterials的idx就是超量素材的sequence。
......
......@@ -90,8 +90,14 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
>
<div className="card-shadow" />
<div className="card-img-wrap">
<img className="card-cover" src={getCardImgUrl(snap.code)} alt="" />
<img className="card-back" src={getCardImgUrl(0, true)} alt="" />
<img
className="card-cover"
onError={() => {
console.log("");
}}
src={getCardImgUrl(snap.code)}
/>
<img className="card-back" src={getCardImgUrl(0, true)} />
</div>
</animated.div>
);
......@@ -102,7 +108,7 @@ function getCardImgUrl(code: number, back = false) {
import.meta.env.BASE_URL == "/"
? NeosConfig.assetsPath
: import.meta.env.BASE_URL + NeosConfig.assetsPath;
if (back) {
if (code === 0 || back) {
return ASSETS_BASE + "/card_back.jpg";
}
return NeosConfig.cardImgUrl + "/" + code + ".jpg";
......
......@@ -29,9 +29,13 @@ export const moveToGround = async (props: {
api: SpringApi;
}) => {
const { card, api } = props;
// report
// 如果是超量素材,那么,应该看超量素材所属的xyzMonster
const targetCard =
card.zone === OVERLAY ? (card.xyzMonster ? card.xyzMonster : card) : card;
const { zone, sequence, controller, xyzMonster, position, overlayMaterials } =
card;
targetCard;
// 根据zone计算卡片的宽度
const cardWidth =
......@@ -61,6 +65,7 @@ export const moveToGround = async (props: {
}
break;
}
case OVERLAY:
case MZONE: {
if (sequence > 4) {
// 额外怪兽区
......@@ -72,20 +77,6 @@ export const moveToGround = async (props: {
}
break;
}
case OVERLAY: {
if (xyzMonster) {
const { sequence } = xyzMonster;
if (sequence > 4) {
// 额外怪兽区
x = (sequence > 5 ? 1 : -1) * (BLOCK_WIDTH.value + COL_GAP.value);
y = 0;
} else {
x = (sequence - 2) * (BLOCK_WIDTH.value + COL_GAP.value);
y = BLOCK_HEIGHT_M.value + ROW_GAP.value;
}
}
break;
}
}
if (!isMe(controller)) {
......@@ -119,14 +110,14 @@ export const moveToGround = async (props: {
rz,
config: {
// mass: 0.5,
easing: easings.easeInSine,
easing: easings.easeInOutSine,
},
});
await asyncStart(api)({
z: 0,
zIndex: overlayMaterials.length ? 3 : 1,
config: {
easing: easings.easeOutSine,
easing: easings.easeInOutQuad,
mass: 5,
tension: 300, // 170
friction: 12, // 26
......
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