pagefaultgames / pokerogue

A browser based Pokémon fangame heavily inspired by the roguelite genre.
https://pokerogue.net
GNU Affero General Public License v3.0
4.41k stars 1.78k forks source link

[P2 Bug] Forewarn treats self status moves as 80bp #3872

Open Tempo-anon opened 1 month ago

Tempo-anon commented 1 month ago

Describe the bug

Right now Forewarn treats StatusMoves as 1 base power correctly: https://github.com/pagefaultgames/pokerogue/blob/main/src/data/ability.ts#L2865

The issue arises because SelfStatusMoves extend Move rather than StatusMove so self status moves do not have their base power set to 1 but instead -1 which is then treated as 80 for Forewarn.

export class StatusMove extends Move {
  constructor(id: Moves, type: Type, accuracy: integer, pp: integer, chance: integer, priority: integer, generation: integer) {
    super(id, type, MoveCategory.STATUS, MoveTarget.NEAR_OTHER, -1, accuracy, pp, chance, priority, generation);
  }
}

export class SelfStatusMove extends Move {
  constructor(id: Moves, type: Type, accuracy: integer, pp: integer, chance: integer, priority: integer, generation: integer) {
    super(id, type, MoveCategory.STATUS, MoveTarget.USER, -1, accuracy, pp, chance, priority, generation);
  }
}

A bit of a refactor and as far as I can tell the only difference between SelfStatusMove and StatusMove is the MoveTarget but want to make sure that there will be no breaking changes.

Session export file

No response

User data export file

No response

Expected behavior

SelfStatusMoves should be treated as 1bp rather than -1 (80)

Screenshots / Videos

No response

What OS did you observe the bug on?

PC/Windows

If other please specify

No response

Which browser do you use?

Firefox

If other please specify

No response

Additional context

No response

Snailman11 commented 2 weeks ago

Discord Bug Report (Forewarn warning about Quiver Dance) https://discord.com/channels/1125469663833370665/1278168794472120342