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:
parent
93d8082f24
commit
b3a10e52e5
|
@ -3869,8 +3869,12 @@ export class DisableMoveAttr extends MoveEffectAttr {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FrenzyAttr 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);
|
super(true, MoveEffectTrigger.HIT, false, true);
|
||||||
|
this.min = min-1;
|
||||||
|
this.max = max-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
canApply(user: Pokemon, target: Pokemon, move: Move, args: any[]) {
|
canApply(user: Pokemon, target: Pokemon, move: Move, args: any[]) {
|
||||||
|
@ -3884,7 +3888,7 @@ export class FrenzyAttr extends MoveEffectAttr {
|
||||||
|
|
||||||
if (!user.getMoveQueue().length) {
|
if (!user.getMoveQueue().length) {
|
||||||
if (!user.getTag(BattlerTagType.FRENZY)) {
|
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 }));
|
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);
|
user.addTag(BattlerTagType.FRENZY, 1, move.id, user.id);
|
||||||
} else {
|
} else {
|
||||||
|
@ -6340,6 +6344,8 @@ export function initMoves() {
|
||||||
.attr(FlinchAttr)
|
.attr(FlinchAttr)
|
||||||
.condition(new FirstMoveCondition()),
|
.condition(new FirstMoveCondition()),
|
||||||
new AttackMove(Moves.UPROAR, Type.NORMAL, MoveCategory.SPECIAL, 90, 100, 10, -1, 0, 3)
|
new AttackMove(Moves.UPROAR, Type.NORMAL, MoveCategory.SPECIAL, 90, 100, 10, -1, 0, 3)
|
||||||
|
.attr(FrenzyAttr, 3, 3)
|
||||||
|
.attr(MissEffectAttr, frenzyMissFunc)
|
||||||
.ignoresVirtual()
|
.ignoresVirtual()
|
||||||
.soundBased()
|
.soundBased()
|
||||||
.target(MoveTarget.RANDOM_NEAR_ENEMY)
|
.target(MoveTarget.RANDOM_NEAR_ENEMY)
|
||||||
|
|
Loading…
Reference in New Issue