From 5a6ea40dae30a0fe5364acd4054389d34c479095 Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Thu, 2 May 2024 07:09:54 +1000 Subject: [PATCH] Implement Acrobatics Currently scales from 0-5 items --- src/data/move.ts | 2 +- src/field/pokemon.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index 8b94756d04b..a13c1ac8861 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -5171,7 +5171,7 @@ export function initMoves() { new StatusMove(Moves.QUASH, Type.DARK, 100, 15, -1, 0, 5) .unimplemented(), new AttackMove(Moves.ACROBATICS, Type.FLYING, MoveCategory.PHYSICAL, 55, 100, 15, -1, 0, 5) - .partial(), + .attr(MovePowerMultiplierAttr, (user, target, move) => Math.max(1, 2 - 0.2 * user.getHeldItems().reduce((v, m) => v + m.stackCount, 0))), new StatusMove(Moves.REFLECT_TYPE, Type.NORMAL, -1, 15, -1, 0, 5) .attr(CopyTypeAttr), new AttackMove(Moves.RETALIATE, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 5, -1, 0, 5) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index ed248f7cc80..82915ce41bc 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -456,6 +456,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return 1; } + getHeldItems(): PokemonHeldItemModifier[] { + if (!this.scene) + return []; + return this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier && (m as PokemonHeldItemModifier).pokemonId === this.id, this.isPlayer()) as PokemonHeldItemModifier[]; + } + updateScale(): void { this.setScale(this.getSpriteScale()); }