Minor battle animation changes

pull/1/head
Flashfyre 2023-04-24 19:46:02 -04:00
parent 4a595db3ef
commit 842e2707a1
3 changed files with 140 additions and 127 deletions

View File

@ -10,7 +10,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -44,7 +44,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -67,7 +67,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -80,7 +80,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -114,7 +114,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -137,7 +137,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -150,7 +150,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -184,7 +184,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -207,7 +207,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -220,7 +220,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -254,7 +254,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -277,7 +277,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -290,7 +290,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -324,7 +324,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -347,7 +347,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -360,7 +360,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -394,7 +394,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -417,7 +417,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -430,7 +430,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -464,7 +464,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -487,7 +487,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -500,7 +500,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -534,7 +534,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -557,7 +557,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -570,7 +570,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -604,7 +604,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -627,7 +627,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -640,7 +640,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -674,7 +674,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -697,7 +697,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -710,7 +710,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -744,7 +744,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -767,7 +767,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -780,7 +780,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -814,7 +814,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -837,7 +837,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -850,7 +850,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -884,7 +884,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -907,7 +907,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -920,7 +920,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -954,7 +954,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -977,7 +977,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -990,7 +990,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1024,7 +1024,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1047,7 +1047,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -1060,7 +1060,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1094,7 +1094,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1117,7 +1117,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -1130,7 +1130,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1164,7 +1164,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1187,7 +1187,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -1200,7 +1200,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1234,7 +1234,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1257,7 +1257,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -1270,7 +1270,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1293,7 +1293,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -1304,7 +1304,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1327,7 +1327,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -1340,7 +1340,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1363,7 +1363,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -1374,7 +1374,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1397,7 +1397,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -1410,7 +1410,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1433,7 +1433,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -1444,7 +1444,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1467,7 +1467,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -1480,7 +1480,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1503,7 +1503,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -1514,7 +1514,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1537,7 +1537,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -1550,7 +1550,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1573,7 +1573,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -1584,7 +1584,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1607,7 +1607,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
}
@ -1620,7 +1620,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1643,7 +1643,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -1654,7 +1654,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1677,7 +1677,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
},
@ -1688,7 +1688,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 2,
"target": 2,
"graphicFrame": 0,
@ -1724,7 +1724,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1747,7 +1747,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -1758,7 +1758,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1781,7 +1781,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
},
@ -1792,7 +1792,7 @@
"zoomY": 150,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 2,
"target": 2,
"graphicFrame": 0,
@ -1828,7 +1828,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1851,7 +1851,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -1862,7 +1862,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1885,7 +1885,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
},
@ -1896,7 +1896,7 @@
"zoomY": 200,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 2,
"target": 2,
"graphicFrame": 0,
@ -1932,7 +1932,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -1955,7 +1955,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -1966,7 +1966,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -1989,7 +1989,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
},
@ -2000,7 +2000,7 @@
"zoomY": 200,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 2,
"target": 2,
"graphicFrame": 0,
@ -2036,7 +2036,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -2059,7 +2059,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -2070,7 +2070,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -2093,7 +2093,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
},
@ -2104,7 +2104,7 @@
"zoomY": 150,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 2,
"target": 2,
"graphicFrame": 0,
@ -2140,7 +2140,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 0,
"graphicFrame": 0,
@ -2163,7 +2163,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 2
},
@ -2174,7 +2174,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 0,
"target": 1,
"graphicFrame": 0,
@ -2197,7 +2197,7 @@
0,
0
],
"locked": false,
"locked": true,
"priority": 1,
"focus": 1
},
@ -2208,7 +2208,7 @@
"zoomY": 100,
"angle": 0,
"mirror": false,
"visible": false,
"visible": true,
"blendType": 2,
"target": 2,
"graphicFrame": 0,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -502,6 +502,8 @@ function loadAnimAssets(scene: BattleScene, anims: AnimConfig[], startLoad?: boo
interface GraphicFrameData {
x: number,
y: number,
scaleX: number,
scaleY: number,
angle: number
}
@ -534,7 +536,6 @@ export abstract class BattleAnim {
const user = !isOppAnim ? this.user : this.target;
const target = !isOppAnim ? this.target : this.user;
const isReverseCoords = this.isReverseCoords();
const graphicScale = this.getGraphicScale();
const userInitialX = user.x;
const userInitialY = user.y;
@ -549,21 +550,27 @@ export abstract class BattleAnim {
if (frame.target !== AnimFrameTarget.GRAPHIC)
continue;
const isGlobal = isGlobalGraphic(this.getAnim().graphic, frame.graphicFrame);
const xProgress = frame.focus !== AnimFocus.SCREEN ? Math.min(Math.max(frame.x, 0) / 128, 1) : 0;
const initialX = targetInitialX;
const initialY = targetInitialY;
let xOffset = (!isReverseCoords ? (userInitialX - targetInitialX) : (targetInitialX - userInitialX));
let yOffset = (!isReverseCoords ? (userInitialY - targetInitialY) : (targetInitialY - userInitialY));
const ySpriteOffset = ((userHalfHeight * (1 - xProgress)) + (targetHalfHeight * xProgress)) * -1;
if (graphicScale > 1) {
xOffset -= ((scene.game.canvas.width / 6) * (graphicScale - 1)) / 2;
yOffset -= ((scene.game.canvas.height / 6) * (graphicScale - 1)) / 2;
const globalXOffset = !isGlobal ? 0 : -114;
const globalYOffset = 0;
if (isGlobal) {
xOffset -= ((scene.game.canvas.width / 6) * 0.25) / 2;
yOffset -= ((scene.game.canvas.height / 6) * 0.25) / 2;
}
const x = initialX + xOffset * (!isReverseCoords ? 1 : -1) + (frame.x * graphicScale) * (!isReverseCoords ? 1 : -1);
const globalScale = !isGlobal ? 1 : 1.25;
const scaleX = globalScale * (frame.zoomX / 100) *(isReverseCoords === frame.mirror ? 1 : -1);
const scaleY = globalScale * (frame.zoomY / 100);
const x = (initialX + xOffset * (!isReverseCoords ? 1 : -1) + (frame.x * globalScale) * (!isReverseCoords ? 1 : -1));
const y = ((initialY + yOffset * (!isReverseCoords || frame.focus === AnimFocus.USER || frame.focus === AnimFocus.SCREEN ? 1 : -1)
+ (frame.y * graphicScale) * (!isReverseCoords || (frame.focus !== AnimFocus.USER_TARGET) ? 1 : -1) + ySpriteOffset));
+ (frame.y * globalScale) * (!isReverseCoords || (frame.focus !== AnimFocus.USER_TARGET) ? 1 : -1) + ySpriteOffset));
const angle = -frame.angle * (!isReverseCoords ? 1 : -1);
ret.set(g++, { x: x, y: y, angle: angle });
ret.set(g++, { x: x + globalXOffset, y: y + globalYOffset, scaleX: scaleX, scaleY: scaleY, angle: angle });
}
return ret;
@ -662,13 +669,11 @@ export abstract class BattleAnim {
}
moveSprite.setFrame(frame.graphicFrame);
//console.log(AnimFocus[frame.focus]);
const graphicScale = this.getGraphicScale();
moveSprite.setPosition(frameData.get(graphicIndex).x, frameData.get(graphicIndex).y);
moveSprite.setAngle(frameData.get(graphicIndex).angle);
const scaleX = graphicScale * (isReverseCoords === frame.mirror ? 1 : -1);
const scaleY = graphicScale;
moveSprite.setScale(scaleX, scaleY);
const graphicFrameData = frameData.get(graphicIndex);
moveSprite.setPosition(graphicFrameData.x, graphicFrameData.y);
moveSprite.setAngle(graphicFrameData.angle);
moveSprite.setScale(graphicFrameData.scaleX, graphicFrameData.scaleY);
moveSprite.setAlpha(frame.opacity / 255);
moveSprite.setVisible(frame.visible);
@ -783,16 +788,6 @@ export class MoveAnim extends BattleAnim {
isReverseCoords(): boolean {
return !this.user.isPlayer() === !this.isOppAnim();
}
getGraphicScale(): number {
switch (this.move) {
case Moves.SEISMIC_TOSS:
case Moves.FISSURE:
return 1.25;
}
return 1;
}
}
export class MoveChargeAnim extends MoveAnim {
@ -811,6 +806,24 @@ export class MoveChargeAnim extends MoveAnim {
}
}
function isGlobalGraphic(graphic: string, graphicFrame: integer): boolean {
switch (graphic) {
case 'PRAS- Fissure':
return true;
case 'PRAS- Seismic Toss':
switch (graphicFrame) {
case 1:
case 2:
case 3:
case 4:
return false;
}
return true;
}
return false;
}
export function populateAnims() {
return;
const commonAnimNames = Utils.getEnumKeys(CommonAnim).map(k => k.toLowerCase());