mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 23:32:19 +02:00
More animation fixes (mostly for Roar)
This commit is contained in:
parent
bd9d5931e5
commit
9d2f309f75
@ -802,11 +802,20 @@ export abstract class BattleAnim {
|
||||
}
|
||||
targetSprite.pipelineData["tone"] = [ 0.0, 0.0, 0.0, 0.0 ];
|
||||
targetSprite.setAngle(0);
|
||||
if (!this.isHideUser() && userSprite) {
|
||||
userSprite.setVisible(true); // using this.user to fix context loss due to isOppAnim swap (#481)
|
||||
|
||||
/**
|
||||
* This and `targetSpriteToShow` are used to restore context lost
|
||||
* from the `isOppAnim` swap. Using these references instead of `this.user`
|
||||
* and `this.target` prevent the target's Substitute doll from disappearing
|
||||
* after being the target of an animation.
|
||||
*/
|
||||
const userSpriteToShow = !isOppAnim ? userSprite : targetSprite;
|
||||
const targetSpriteToShow = !isOppAnim ? targetSprite : userSprite;
|
||||
if (!this.isHideUser() && userSpriteToShow) {
|
||||
userSpriteToShow.setVisible(true);
|
||||
}
|
||||
if (!this.isHideTarget() && (targetSprite !== userSprite || !this.isHideUser())) {
|
||||
targetSprite.setVisible(true); // using this.target to fix context loss due to isOppAnim swap (#481)
|
||||
if (!this.isHideTarget() && (targetSpriteToShow !== userSpriteToShow || !this.isHideUser())) {
|
||||
targetSpriteToShow.setVisible(true);
|
||||
}
|
||||
for (const ms of Object.values(spriteCache).flat()) {
|
||||
if (ms) {
|
||||
|
@ -3587,6 +3587,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
this.resetSprite();
|
||||
this.resetTurnData();
|
||||
if (clearEffects) {
|
||||
this.destroySubstitute();
|
||||
this.resetSummonData();
|
||||
this.resetBattleData();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user