[Bug] Fix Storm moves having accuracy drops in sun/sand (#3381)

This commit is contained in:
Tempoanon 2024-08-06 12:20:23 -04:00 committed by GitHub
parent 3a4eea51c6
commit af56eee1cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 28 additions and 4 deletions

View File

@ -3565,6 +3565,9 @@ export class VariableAccuracyAttr extends MoveAttr {
} }
} }
/**
* Attribute used for Thunder and Hurricane that sets accuracy to 50 in sun and never miss in rain
*/
export class ThunderAccuracyAttr extends VariableAccuracyAttr { export class ThunderAccuracyAttr extends VariableAccuracyAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (!user.scene.arena.weather?.isEffectSuppressed(user.scene)) { if (!user.scene.arena.weather?.isEffectSuppressed(user.scene)) {
@ -3572,7 +3575,6 @@ export class ThunderAccuracyAttr extends VariableAccuracyAttr {
const weatherType = user.scene.arena.weather?.weatherType || WeatherType.NONE; const weatherType = user.scene.arena.weather?.weatherType || WeatherType.NONE;
switch (weatherType) { switch (weatherType) {
case WeatherType.SUNNY: case WeatherType.SUNNY:
case WeatherType.SANDSTORM:
case WeatherType.HARSH_SUN: case WeatherType.HARSH_SUN:
accuracy.value = 50; accuracy.value = 50;
return true; return true;
@ -3587,6 +3589,28 @@ export class ThunderAccuracyAttr extends VariableAccuracyAttr {
} }
} }
/**
* Attribute used for Bleakwind Storm, Wildbolt Storm, and Sandsear Storm that sets accuracy to never
* miss in rain
* Springtide Storm does NOT have this property
*/
export class StormAccuracyAttr extends VariableAccuracyAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (!user.scene.arena.weather?.isEffectSuppressed(user.scene)) {
const accuracy = args[0] as Utils.NumberHolder;
const weatherType = user.scene.arena.weather?.weatherType || WeatherType.NONE;
switch (weatherType) {
case WeatherType.RAIN:
case WeatherType.HEAVY_RAIN:
accuracy.value = -1;
return true;
}
}
return false;
}
}
/** /**
* Attribute used for moves which never miss * Attribute used for moves which never miss
* against Pokemon with the {@linkcode BattlerTagType.MINIMIZED} * against Pokemon with the {@linkcode BattlerTagType.MINIMIZED}
@ -8396,17 +8420,17 @@ export function initMoves() {
.attr(AddArenaTrapTagHitAttr, ArenaTagType.SPIKES) .attr(AddArenaTrapTagHitAttr, ArenaTagType.SPIKES)
.slicingMove(), .slicingMove(),
new AttackMove(Moves.BLEAKWIND_STORM, Type.FLYING, MoveCategory.SPECIAL, 100, 80, 10, 30, 0, 8) new AttackMove(Moves.BLEAKWIND_STORM, Type.FLYING, MoveCategory.SPECIAL, 100, 80, 10, 30, 0, 8)
.attr(ThunderAccuracyAttr) .attr(StormAccuracyAttr)
.attr(StatChangeAttr, BattleStat.SPD, -1) .attr(StatChangeAttr, BattleStat.SPD, -1)
.windMove() .windMove()
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.WILDBOLT_STORM, Type.ELECTRIC, MoveCategory.SPECIAL, 100, 80, 10, 20, 0, 8) new AttackMove(Moves.WILDBOLT_STORM, Type.ELECTRIC, MoveCategory.SPECIAL, 100, 80, 10, 20, 0, 8)
.attr(ThunderAccuracyAttr) .attr(StormAccuracyAttr)
.attr(StatusEffectAttr, StatusEffect.PARALYSIS) .attr(StatusEffectAttr, StatusEffect.PARALYSIS)
.windMove() .windMove()
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.SANDSEAR_STORM, Type.GROUND, MoveCategory.SPECIAL, 100, 80, 10, 20, 0, 8) new AttackMove(Moves.SANDSEAR_STORM, Type.GROUND, MoveCategory.SPECIAL, 100, 80, 10, 20, 0, 8)
.attr(ThunderAccuracyAttr) .attr(StormAccuracyAttr)
.attr(StatusEffectAttr, StatusEffect.BURN) .attr(StatusEffectAttr, StatusEffect.BURN)
.windMove() .windMove()
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),