fixed issues with declare vs override oopsie

This commit is contained in:
Bertie690 2025-08-14 21:30:08 -04:00
parent 3a491a6201
commit 57b8b466df
3 changed files with 11 additions and 9 deletions

View File

@ -2,12 +2,14 @@ import { globalScene } from "#app/global-scene";
import { getPokemonNameWithAffix } from "#app/messages";
// biome-ignore-start lint/correctness/noUnusedImports: TSDoc
import type { ArenaTag } from "#data/arena-tag";
import type { Stat } from "#enums/stat";
// biome-ignore-end lint/correctness/noUnusedImports: TSDoc
import { allMoves } from "#data/data-lists";
import type { BattlerIndex } from "#enums/battler-index";
import type { MoveId } from "#enums/move-id";
import { MoveUseMode } from "#enums/move-use-mode";
import type { PositionalTagType } from "#enums/positional-tag-type";
import { PositionalTagType } from "#enums/positional-tag-type";
import type { Pokemon } from "#field/pokemon";
import i18next from "i18next";
@ -87,7 +89,7 @@ interface DelayedAttackArgs extends PositionalTagBaseArgs {
* triggering against a certain slot after the turn count has elapsed.
*/
export class DelayedAttackTag extends PositionalTag implements DelayedAttackArgs {
public declare readonly tagType: PositionalTagType.DELAYED_ATTACK;
public override readonly tagType = PositionalTagType.DELAYED_ATTACK;
public readonly sourceMove: MoveId;
public readonly sourceId: number;
@ -142,7 +144,7 @@ interface WishArgs extends PositionalTagBaseArgs {
* Tag to implement {@linkcode MoveId.WISH | Wish}.
*/
export class WishTag extends PositionalTag implements WishArgs {
public declare readonly tagType: PositionalTagType.WISH;
public override readonly tagType = PositionalTagType.WISH;
public readonly pokemonName: string;
public readonly healHp: number;

View File

@ -77,15 +77,13 @@ describe("Moves - Heal Block", () => {
game.move.use(MoveId.WISH);
await game.toNextTurn();
expect(game.scene.arena.positionalTagManager.tags.filter(t => t.tagType === PositionalTagType.WISH)) //
.toHaveLength(1);
expect(game).toHavePositionalTag(PositionalTagType.WISH);
game.move.use(MoveId.SPLASH);
await game.toNextTurn();
// wish triggered, but did NOT heal the player
expect(game.scene.arena.positionalTagManager.tags.filter(t => t.tagType === PositionalTagType.WISH)) //
.toHaveLength(0);
expect(game).toHavePositionalTag(PositionalTagType.WISH, 0);
expect(player.hp).toBe(1);
});

View File

@ -1,4 +1,6 @@
// biome-ignore-start lint/correctness/noUnusedImports: TSDoc
import type { PositionalTag } from "#data/positional-tags/positional-tag";
import type { GameManager } from "#test/test-utils/game-manager";
// biome-ignore-end lint/correctness/noUnusedImports: TSDoc
@ -17,8 +19,8 @@ export type toHavePositionalTagOptions<P extends PositionalTagType> = OneOther<s
/**
* Matcher to check if the {@linkcode Arena} has a certain number of {@linkcode PositionalTag}s active.
* @param received - The object to check. Should be the current {@linkcode GameManager}
* @param expectedTag - The {@linkcode PositionalTagType} of the desired tag, or a partially-filled {@linkcode PositionalTag}
* containing the desired properties
* @param expectedTag - The {@linkcode PositionalTagType} of the desired tag, or a partially-filled
* {@linkcode PositionalTag} containing the desired properties
* @param count - The number of tags that should be active; defaults to `1` and must be within the range `[0, 4]`
* @returns The result of the matching
*/