Implement Acrobatics

Currently scales from 0-5 items
pull/389/head
Xavion3 2024-05-02 07:09:54 +10:00 committed by Samuel H
parent d6ca09e431
commit 5a6ea40dae
2 changed files with 7 additions and 1 deletions

View File

@ -5171,7 +5171,7 @@ export function initMoves() {
new StatusMove(Moves.QUASH, Type.DARK, 100, 15, -1, 0, 5) new StatusMove(Moves.QUASH, Type.DARK, 100, 15, -1, 0, 5)
.unimplemented(), .unimplemented(),
new AttackMove(Moves.ACROBATICS, Type.FLYING, MoveCategory.PHYSICAL, 55, 100, 15, -1, 0, 5) 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) new StatusMove(Moves.REFLECT_TYPE, Type.NORMAL, -1, 15, -1, 0, 5)
.attr(CopyTypeAttr), .attr(CopyTypeAttr),
new AttackMove(Moves.RETALIATE, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 5, -1, 0, 5) new AttackMove(Moves.RETALIATE, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 5, -1, 0, 5)

View File

@ -456,6 +456,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return 1; 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 { updateScale(): void {
this.setScale(this.getSpriteScale()); this.setScale(this.getSpriteScale());
} }