add move attrs for pursuit

This commit is contained in:
snoozbuster 2024-08-03 22:41:12 -07:00
parent a0f8a4df5b
commit a3a42931ba
1 changed files with 21 additions and 3 deletions

View File

@ -3744,6 +3744,21 @@ export class BlizzardAccuracyAttr extends VariableAccuracyAttr {
} }
} }
const isPursuingFunc = (user: Pokemon, target: Pokemon) =>
user.getTag(BattlerTagType.ANTICIPATING_ACTION) && target.getTag(BattlerTagType.ESCAPING);
export class PursuitAccuracyAttr extends VariableAccuracyAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (isPursuingFunc(user, target)) {
const accuracy = args[0] as Utils.NumberHolder;
accuracy.value = -1;
return true;
}
return false;
}
}
export class VariableMoveCategoryAttr extends MoveAttr { export class VariableMoveCategoryAttr extends MoveAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
return false; return false;
@ -4482,8 +4497,8 @@ export class LapseBattlerTagAttr extends MoveEffectAttr {
export class RemoveBattlerTagAttr extends MoveEffectAttr { export class RemoveBattlerTagAttr extends MoveEffectAttr {
public tagTypes: BattlerTagType[]; public tagTypes: BattlerTagType[];
constructor(tagTypes: BattlerTagType[], selfTarget: boolean = false) { constructor(tagTypes: BattlerTagType[], selfTarget: boolean = false, trigger?: MoveEffectTrigger) {
super(selfTarget); super(selfTarget, trigger);
this.tagTypes = tagTypes; this.tagTypes = tagTypes;
} }
@ -6811,7 +6826,10 @@ export function initMoves() {
.attr(AddBattlerTagAttr, BattlerTagType.ENCORE, false, true) .attr(AddBattlerTagAttr, BattlerTagType.ENCORE, false, true)
.condition((user, target, move) => new EncoreTag(user.id).canAdd(target)), .condition((user, target, move) => new EncoreTag(user.id).canAdd(target)),
new AttackMove(Moves.PURSUIT, Type.DARK, MoveCategory.PHYSICAL, 40, 100, 20, -1, 0, 2) new AttackMove(Moves.PURSUIT, Type.DARK, MoveCategory.PHYSICAL, 40, 100, 20, -1, 0, 2)
.partial(), .attr(PursuitAccuracyAttr)
.attr(AddBattlerTagOnMoveReadyAttr, BattlerTagType.ANTICIPATING_ACTION)
.attr(RemoveBattlerTagAttr, [BattlerTagType.ANTICIPATING_ACTION], true, MoveEffectTrigger.POST_APPLY)
.attr(MovePowerMultiplierAttr, (user, target) => isPursuingFunc(user, target) ? 2 : 1),
new AttackMove(Moves.RAPID_SPIN, Type.NORMAL, MoveCategory.PHYSICAL, 50, 100, 40, 100, 0, 2) new AttackMove(Moves.RAPID_SPIN, Type.NORMAL, MoveCategory.PHYSICAL, 50, 100, 40, 100, 0, 2)
.attr(StatChangeAttr, BattleStat.SPD, 1, true) .attr(StatChangeAttr, BattleStat.SPD, 1, true)
.attr(RemoveBattlerTagAttr, [ .attr(RemoveBattlerTagAttr, [