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