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.
This commit is contained in:
3ae3ae 2024-07-03 12:34:17 +09:00
parent 93d8082f24
commit b3a10e52e5
1 changed files with 8 additions and 2 deletions

View File

@ -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)