mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-15 21:02:18 +02:00
Make OPP_MOVESET_OVERRIDE
fully override the enemy's moveset
This commit is contained in:
parent
f1650d2515
commit
38a266b3dd
@ -985,8 +985,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
// Overrides moveset based on arrays specified in overrides.ts
|
// Overrides moveset based on arrays specified in overrides.ts
|
||||||
const overrideArray: Array<Moves> = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE;
|
const overrideArray: Array<Moves> = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE;
|
||||||
if (overrideArray.length > 0) {
|
if (overrideArray.length > 0) {
|
||||||
|
if (!this.isPlayer()) {
|
||||||
|
this.moveset = [];
|
||||||
|
}
|
||||||
overrideArray.forEach((move: Moves, index: number) => {
|
overrideArray.forEach((move: Moves, index: number) => {
|
||||||
const ppUsed = this.moveset[index]?.ppUsed || 0;
|
const ppUsed = this.moveset[index]?.ppUsed ?? 0;
|
||||||
this.moveset[index] = new PokemonMove(move, Math.min(ppUsed, allMoves[move].pp));
|
this.moveset[index] = new PokemonMove(move, Math.min(ppUsed, allMoves[move].pp));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user