mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 00:12:16 +02:00
Compare commits
3 Commits
c2bc94a5f3
...
622885767d
Author | SHA1 | Date | |
---|---|---|---|
|
622885767d | ||
|
e2be6ba002 | ||
|
68e94845ab |
@ -22,7 +22,13 @@
|
||||
"@typescript-eslint/no-extra-semi": ["error"], // Disallows unnecessary semicolons for TypeScript-specific syntax
|
||||
"brace-style": "off", // Note: you must disable the base rule as it can report incorrect errors
|
||||
"curly": ["error", "all"], // Enforces the use of curly braces for all control statements
|
||||
"@typescript-eslint/brace-style": ["error", "1tbs"]
|
||||
"@typescript-eslint/brace-style": ["error", "1tbs"],
|
||||
"no-trailing-spaces": ["error", { // Disallows trailing whitespace at the end of lines
|
||||
"skipBlankLines": false, // Enforces the rule even on blank lines
|
||||
"ignoreComments": false // Enforces the rule on lines containing comments
|
||||
}],
|
||||
"space-before-blocks": ["error", "always"], // Enforces a space before blocks
|
||||
"keyword-spacing": ["error", { "before": true, "after": true }] // Enforces spacing before and after keywords
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -2765,6 +2765,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
this.battleInfo?.destroy();
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
getBattleInfo(): BattleInfo {
|
||||
return this.battleInfo;
|
||||
}
|
||||
}
|
||||
|
||||
export default interface Pokemon {
|
||||
|
@ -12,6 +12,8 @@ import { BattleStat } from "#app/data/battle-stat";
|
||||
const battleStatOrder = [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.ACC, BattleStat.EVA, BattleStat.SPD ];
|
||||
|
||||
export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||
private baseY: number;
|
||||
|
||||
private player: boolean;
|
||||
private mini: boolean;
|
||||
private boss: boolean;
|
||||
@ -57,6 +59,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||
|
||||
constructor(scene: Phaser.Scene, x: number, y: number, player: boolean) {
|
||||
super(scene, x, y);
|
||||
this.baseY = y;
|
||||
this.player = player;
|
||||
this.mini = !player;
|
||||
this.boss = false;
|
||||
@ -417,6 +420,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||
|
||||
this.x += 10 * (offset === this.player ? 1 : -1);
|
||||
this.y += 27 * (offset ? 1 : -1);
|
||||
this.baseY = this.y;
|
||||
}
|
||||
|
||||
updateInfo(pokemon: Pokemon, instant?: boolean): Promise<void> {
|
||||
@ -655,6 +659,14 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||
this.statNumbers[i].setFrame(battleStats[s].toString());
|
||||
});
|
||||
}
|
||||
|
||||
getBaseY(): number {
|
||||
return this.baseY;
|
||||
}
|
||||
|
||||
resetY(): void {
|
||||
this.y = this.baseY;
|
||||
}
|
||||
}
|
||||
|
||||
export class PlayerBattleInfo extends BattleInfo {
|
||||
|
@ -16,6 +16,7 @@ export default class TargetSelectUiHandler extends UiHandler {
|
||||
|
||||
private targets: BattlerIndex[];
|
||||
private targetFlashTween: Phaser.Tweens.Tween;
|
||||
private targetBattleInfoMoveTween: Phaser.Tweens.Tween;
|
||||
|
||||
constructor(scene: BattleScene) {
|
||||
super(scene, Mode.TARGET_SELECT);
|
||||
@ -116,6 +117,25 @@ export default class TargetSelectUiHandler extends UiHandler {
|
||||
}
|
||||
});
|
||||
|
||||
if (this.targetBattleInfoMoveTween) {
|
||||
this.targetBattleInfoMoveTween.stop();
|
||||
const lastTarget = this.scene.getField()[lastCursor];
|
||||
if (lastTarget) {
|
||||
lastTarget.getBattleInfo().resetY();
|
||||
}
|
||||
}
|
||||
|
||||
const targetBattleInfo = target.getBattleInfo();
|
||||
|
||||
this.targetBattleInfoMoveTween = this.scene.tweens.add({
|
||||
targets: [ targetBattleInfo ],
|
||||
y: { start: targetBattleInfo.getBaseY(), to: targetBattleInfo.getBaseY() + 1 },
|
||||
loop: -1,
|
||||
duration: Utils.fixedInt(250),
|
||||
ease: "Linear",
|
||||
yoyo: true
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -128,6 +148,15 @@ export default class TargetSelectUiHandler extends UiHandler {
|
||||
if (target) {
|
||||
target.setAlpha(1);
|
||||
}
|
||||
|
||||
const targetBattleInfo = target.getBattleInfo();
|
||||
if (this.targetBattleInfoMoveTween) {
|
||||
this.targetBattleInfoMoveTween.stop();
|
||||
this.targetBattleInfoMoveTween = null;
|
||||
}
|
||||
if (targetBattleInfo) {
|
||||
targetBattleInfo.resetY();
|
||||
}
|
||||
}
|
||||
|
||||
clear() {
|
||||
|
Loading…
Reference in New Issue
Block a user