From b3a10e52e53fa80657b17ea0887be8fa86207e87 Mon Sep 17 00:00:00 2001 From: 3ae3ae Date: Wed, 3 Jul 2024 12:34:17 +0900 Subject: [PATCH] feat: Add FrenzyAttr to Uproar. Update FrenzyAttr constructor to accept min and max parameters The FrenzyAttr class in move.ts has been updated to accept min and max parameters in its constructor. This allows for more flexibility in setting the turn count for the Frenzy effect. --- src/data/move.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 9964665c12a..2cb4e0f108c 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -3869,8 +3869,12 @@ export class DisableMoveAttr extends MoveEffectAttr { } export class FrenzyAttr extends MoveEffectAttr { - constructor() { + private min: number; + private max: number; + constructor(min: number = 2, max: number = 3) { super(true, MoveEffectTrigger.HIT, false, true); + this.min = min-1; + this.max = max-1; } canApply(user: Pokemon, target: Pokemon, move: Move, args: any[]) { @@ -3884,7 +3888,7 @@ export class FrenzyAttr extends MoveEffectAttr { if (!user.getMoveQueue().length) { if (!user.getTag(BattlerTagType.FRENZY)) { - const turnCount = user.randSeedIntRange(1, 2); + const turnCount = user.randSeedIntRange(this.min, this.max); new Array(turnCount).fill(null).map(() => user.getMoveQueue().push({ move: move.id, targets: [ target.getBattlerIndex() ], ignorePP: true })); user.addTag(BattlerTagType.FRENZY, 1, move.id, user.id); } else { @@ -6340,6 +6344,8 @@ export function initMoves() { .attr(FlinchAttr) .condition(new FirstMoveCondition()), new AttackMove(Moves.UPROAR, Type.NORMAL, MoveCategory.SPECIAL, 90, 100, 10, -1, 0, 3) + .attr(FrenzyAttr, 3, 3) + .attr(MissEffectAttr, frenzyMissFunc) .ignoresVirtual() .soundBased() .target(MoveTarget.RANDOM_NEAR_ENEMY)