Overhaul X Items

This commit is contained in:
xsn34kzx 2024-08-18 22:02:39 -04:00
parent eeca684f9f
commit 5ab5e529a3
8 changed files with 188 additions and 111 deletions

View File

@ -1551,7 +1551,7 @@ export class AllyMoveCategoryPowerBoostAbAttr extends FieldMovePowerBoostAbAttr
} }
} }
export class StatStageMultiplierAbAttr extends AbAttr { export class StatMultiplierAbAttr extends AbAttr {
private stat: BattleStat; private stat: BattleStat;
private multiplier: number; private multiplier: number;
private condition: PokemonAttackCondition | null; private condition: PokemonAttackCondition | null;
@ -1822,36 +1822,20 @@ export class CopyFaintedAllyAbilityAbAttr extends PostKnockOutAbAttr {
} }
export class IgnoreOpponentStatStagesAbAttr extends AbAttr { export class IgnoreOpponentStatStagesAbAttr extends AbAttr {
constructor() { private stats: readonly BattleStat[];
constructor(stats?: BattleStat[]) {
super(false); super(false);
this.stats = stats ?? BATTLE_STATS;
} }
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]) { apply(_pokemon: Pokemon, _passive: boolean, _cancelled: Utils.BooleanHolder, args: any[]) {
(args[0] as Utils.IntegerHolder).value = 0; if (this.stats.includes(args[0])) {
(args[1] as Utils.BooleanHolder).value = true;
return true; return true;
} }
} return false;
/**
* Ignores opponent's evasion stat changes when determining if a move hits or not
* @extends AbAttr
* @see {@linkcode apply}
*/
export class IgnoreOpponentEvasionAbAttr extends AbAttr {
constructor() {
super(false);
}
/**
* Checks if enemy Pokemon is trapped by an Arena Trap-esque ability
* @param pokemon N/A
* @param passive N/A
* @param cancelled N/A
* @param args [0] {@linkcode Utils.IntegerHolder} of Stat.EVA
* @returns if evasion level was successfully considered as 0
*/
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]) {
(args[0] as Utils.IntegerHolder).value = 0;
return true;
} }
} }
@ -4225,9 +4209,9 @@ export function applyPostMoveUsedAbAttrs(attrType: Constructor<PostMoveUsedAbAtt
return applyAbAttrsInternal<PostMoveUsedAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostMoveUsed(pokemon, move, source, targets, args), args); return applyAbAttrsInternal<PostMoveUsedAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostMoveUsed(pokemon, move, source, targets, args), args);
} }
export function applyStatStageMultiplierAbAttrs(attrType: Constructor<StatStageMultiplierAbAttr>, export function applyStatMultiplierAbAttrs(attrType: Constructor<StatMultiplierAbAttr>,
pokemon: Pokemon, stat: BattleStat, statValue: Utils.NumberHolder, ...args: any[]): Promise<void> { pokemon: Pokemon, stat: BattleStat, statValue: Utils.NumberHolder, ...args: any[]): Promise<void> {
return applyAbAttrsInternal<StatStageMultiplierAbAttr>(attrType, pokemon, (attr, passive) => attr.applyStatStage(pokemon, passive, stat, statValue, args), args); return applyAbAttrsInternal<StatMultiplierAbAttr>(attrType, pokemon, (attr, passive) => attr.applyStatStage(pokemon, passive, stat, statValue, args), args);
} }
/** /**
@ -4377,7 +4361,7 @@ export function initAbilities() {
.attr(StatusEffectImmunityAbAttr, StatusEffect.PARALYSIS) .attr(StatusEffectImmunityAbAttr, StatusEffect.PARALYSIS)
.ignorable(), .ignorable(),
new Ability(Abilities.SAND_VEIL, 3) new Ability(Abilities.SAND_VEIL, 3)
.attr(StatStageMultiplierAbAttr, Stat.EVA, 1.2) .attr(StatMultiplierAbAttr, Stat.EVA, 1.2)
.attr(BlockWeatherDamageAttr, WeatherType.SANDSTORM) .attr(BlockWeatherDamageAttr, WeatherType.SANDSTORM)
.condition(getWeatherCondition(WeatherType.SANDSTORM)) .condition(getWeatherCondition(WeatherType.SANDSTORM))
.ignorable(), .ignorable(),
@ -4400,7 +4384,7 @@ export function initAbilities() {
.attr(SuppressWeatherEffectAbAttr, true) .attr(SuppressWeatherEffectAbAttr, true)
.attr(PostSummonUnnamedMessageAbAttr, "The effects of the weather disappeared."), .attr(PostSummonUnnamedMessageAbAttr, "The effects of the weather disappeared."),
new Ability(Abilities.COMPOUND_EYES, 3) new Ability(Abilities.COMPOUND_EYES, 3)
.attr(StatStageMultiplierAbAttr, Stat.ACC, 1.3), .attr(StatMultiplierAbAttr, Stat.ACC, 1.3),
new Ability(Abilities.INSOMNIA, 3) new Ability(Abilities.INSOMNIA, 3)
.attr(StatusEffectImmunityAbAttr, StatusEffect.SLEEP) .attr(StatusEffectImmunityAbAttr, StatusEffect.SLEEP)
.attr(BattlerTagImmunityAbAttr, BattlerTagType.DROWSY) .attr(BattlerTagImmunityAbAttr, BattlerTagType.DROWSY)
@ -4462,10 +4446,10 @@ export function initAbilities() {
.attr(MoveEffectChanceMultiplierAbAttr, 2) .attr(MoveEffectChanceMultiplierAbAttr, 2)
.partial(), .partial(),
new Ability(Abilities.SWIFT_SWIM, 3) new Ability(Abilities.SWIFT_SWIM, 3)
.attr(StatStageMultiplierAbAttr, Stat.SPD, 2) .attr(StatMultiplierAbAttr, Stat.SPD, 2)
.condition(getWeatherCondition(WeatherType.RAIN, WeatherType.HEAVY_RAIN)), .condition(getWeatherCondition(WeatherType.RAIN, WeatherType.HEAVY_RAIN)),
new Ability(Abilities.CHLOROPHYLL, 3) new Ability(Abilities.CHLOROPHYLL, 3)
.attr(StatStageMultiplierAbAttr, Stat.SPD, 2) .attr(StatMultiplierAbAttr, Stat.SPD, 2)
.condition(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN)), .condition(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN)),
new Ability(Abilities.ILLUMINATE, 3) new Ability(Abilities.ILLUMINATE, 3)
.attr(ProtectStatAbAttr, Stat.ACC) .attr(ProtectStatAbAttr, Stat.ACC)
@ -4475,7 +4459,7 @@ export function initAbilities() {
.attr(PostSummonCopyAbilityAbAttr) .attr(PostSummonCopyAbilityAbAttr)
.attr(UncopiableAbilityAbAttr), .attr(UncopiableAbilityAbAttr),
new Ability(Abilities.HUGE_POWER, 3) new Ability(Abilities.HUGE_POWER, 3)
.attr(StatStageMultiplierAbAttr, Stat.ATK, 2), .attr(StatMultiplierAbAttr, Stat.ATK, 2),
new Ability(Abilities.POISON_POINT, 3) new Ability(Abilities.POISON_POINT, 3)
.attr(PostDefendContactApplyStatusEffectAbAttr, 30, StatusEffect.POISON) .attr(PostDefendContactApplyStatusEffectAbAttr, 30, StatusEffect.POISON)
.bypassFaint(), .bypassFaint(),
@ -4530,15 +4514,15 @@ export function initAbilities() {
new Ability(Abilities.TRUANT, 3) new Ability(Abilities.TRUANT, 3)
.attr(PostSummonAddBattlerTagAbAttr, BattlerTagType.TRUANT, 1, false), .attr(PostSummonAddBattlerTagAbAttr, BattlerTagType.TRUANT, 1, false),
new Ability(Abilities.HUSTLE, 3) new Ability(Abilities.HUSTLE, 3)
.attr(StatStageMultiplierAbAttr, Stat.ATK, 1.5) .attr(StatMultiplierAbAttr, Stat.ATK, 1.5)
.attr(StatStageMultiplierAbAttr, Stat.ACC, 0.8, (_user, _target, move) => move.category === MoveCategory.PHYSICAL), .attr(StatMultiplierAbAttr, Stat.ACC, 0.8, (_user, _target, move) => move.category === MoveCategory.PHYSICAL),
new Ability(Abilities.CUTE_CHARM, 3) new Ability(Abilities.CUTE_CHARM, 3)
.attr(PostDefendContactApplyTagChanceAbAttr, 30, BattlerTagType.INFATUATED), .attr(PostDefendContactApplyTagChanceAbAttr, 30, BattlerTagType.INFATUATED),
new Ability(Abilities.PLUS, 3) new Ability(Abilities.PLUS, 3)
.conditionalAttr(p => p.scene.currentBattle.double && [Abilities.PLUS, Abilities.MINUS].some(a => p.getAlly().hasAbility(a)), StatStageMultiplierAbAttr, Stat.SPATK, 1.5) .conditionalAttr(p => p.scene.currentBattle.double && [Abilities.PLUS, Abilities.MINUS].some(a => p.getAlly().hasAbility(a)), StatMultiplierAbAttr, Stat.SPATK, 1.5)
.ignorable(), .ignorable(),
new Ability(Abilities.MINUS, 3) new Ability(Abilities.MINUS, 3)
.conditionalAttr(p => p.scene.currentBattle.double && [Abilities.PLUS, Abilities.MINUS].some(a => p.getAlly().hasAbility(a)), StatStageMultiplierAbAttr, Stat.SPATK, 1.5) .conditionalAttr(p => p.scene.currentBattle.double && [Abilities.PLUS, Abilities.MINUS].some(a => p.getAlly().hasAbility(a)), StatMultiplierAbAttr, Stat.SPATK, 1.5)
.ignorable(), .ignorable(),
new Ability(Abilities.FORECAST, 3) new Ability(Abilities.FORECAST, 3)
.attr(UncopiableAbilityAbAttr) .attr(UncopiableAbilityAbAttr)
@ -4552,9 +4536,9 @@ export function initAbilities() {
.conditionalAttr(pokemon => !Utils.randSeedInt(3), PostTurnResetStatusAbAttr), .conditionalAttr(pokemon => !Utils.randSeedInt(3), PostTurnResetStatusAbAttr),
new Ability(Abilities.GUTS, 3) new Ability(Abilities.GUTS, 3)
.attr(BypassBurnDamageReductionAbAttr) .attr(BypassBurnDamageReductionAbAttr)
.conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), StatStageMultiplierAbAttr, Stat.ATK, 1.5), .conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), StatMultiplierAbAttr, Stat.ATK, 1.5),
new Ability(Abilities.MARVEL_SCALE, 3) new Ability(Abilities.MARVEL_SCALE, 3)
.conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), StatStageMultiplierAbAttr, Stat.DEF, 1.5) .conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), StatMultiplierAbAttr, Stat.DEF, 1.5)
.ignorable(), .ignorable(),
new Ability(Abilities.LIQUID_OOZE, 3) new Ability(Abilities.LIQUID_OOZE, 3)
.attr(ReverseDrainAbAttr), .attr(ReverseDrainAbAttr),
@ -4587,7 +4571,7 @@ export function initAbilities() {
.attr(ProtectStatAbAttr) .attr(ProtectStatAbAttr)
.ignorable(), .ignorable(),
new Ability(Abilities.PURE_POWER, 3) new Ability(Abilities.PURE_POWER, 3)
.attr(StatStageMultiplierAbAttr, Stat.ATK, 2), .attr(StatMultiplierAbAttr, Stat.ATK, 2),
new Ability(Abilities.SHELL_ARMOR, 3) new Ability(Abilities.SHELL_ARMOR, 3)
.attr(BlockCritAbAttr) .attr(BlockCritAbAttr)
.ignorable(), .ignorable(),
@ -4595,7 +4579,7 @@ export function initAbilities() {
.attr(SuppressWeatherEffectAbAttr, true) .attr(SuppressWeatherEffectAbAttr, true)
.attr(PostSummonUnnamedMessageAbAttr, "The effects of the weather disappeared."), .attr(PostSummonUnnamedMessageAbAttr, "The effects of the weather disappeared."),
new Ability(Abilities.TANGLED_FEET, 4) new Ability(Abilities.TANGLED_FEET, 4)
.conditionalAttr(pokemon => !!pokemon.getTag(BattlerTagType.CONFUSED), StatStageMultiplierAbAttr, Stat.EVA, 2) .conditionalAttr(pokemon => !!pokemon.getTag(BattlerTagType.CONFUSED), StatMultiplierAbAttr, Stat.EVA, 2)
.ignorable(), .ignorable(),
new Ability(Abilities.MOTOR_DRIVE, 4) new Ability(Abilities.MOTOR_DRIVE, 4)
.attr(TypeImmunityStatStageChangeAbAttr, Type.ELECTRIC, Stat.SPD, 1) .attr(TypeImmunityStatStageChangeAbAttr, Type.ELECTRIC, Stat.SPD, 1)
@ -4606,7 +4590,7 @@ export function initAbilities() {
new Ability(Abilities.STEADFAST, 4) new Ability(Abilities.STEADFAST, 4)
.attr(FlinchStatStageChangeAbAttr, [ Stat.SPD ], 1), .attr(FlinchStatStageChangeAbAttr, [ Stat.SPD ], 1),
new Ability(Abilities.SNOW_CLOAK, 4) new Ability(Abilities.SNOW_CLOAK, 4)
.attr(StatStageMultiplierAbAttr, Stat.EVA, 1.2) .attr(StatMultiplierAbAttr, Stat.EVA, 1.2)
.attr(BlockWeatherDamageAttr, WeatherType.HAIL) .attr(BlockWeatherDamageAttr, WeatherType.HAIL)
.condition(getWeatherCondition(WeatherType.HAIL, WeatherType.SNOW)) .condition(getWeatherCondition(WeatherType.HAIL, WeatherType.SNOW))
.ignorable(), .ignorable(),
@ -4645,11 +4629,11 @@ export function initAbilities() {
.condition(getWeatherCondition(WeatherType.RAIN, WeatherType.HEAVY_RAIN)), .condition(getWeatherCondition(WeatherType.RAIN, WeatherType.HEAVY_RAIN)),
new Ability(Abilities.SOLAR_POWER, 4) new Ability(Abilities.SOLAR_POWER, 4)
.attr(PostWeatherLapseDamageAbAttr, 2, WeatherType.SUNNY, WeatherType.HARSH_SUN) .attr(PostWeatherLapseDamageAbAttr, 2, WeatherType.SUNNY, WeatherType.HARSH_SUN)
.attr(StatStageMultiplierAbAttr, Stat.SPATK, 1.5) .attr(StatMultiplierAbAttr, Stat.SPATK, 1.5)
.condition(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN)), .condition(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN)),
new Ability(Abilities.QUICK_FEET, 4) new Ability(Abilities.QUICK_FEET, 4)
.conditionalAttr(pokemon => pokemon.status ? pokemon.status.effect === StatusEffect.PARALYSIS : false, StatStageMultiplierAbAttr, Stat.SPD, 2) .conditionalAttr(pokemon => pokemon.status ? pokemon.status.effect === StatusEffect.PARALYSIS : false, StatMultiplierAbAttr, Stat.SPD, 2)
.conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), StatStageMultiplierAbAttr, Stat.SPD, 1.5), .conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), StatMultiplierAbAttr, Stat.SPD, 1.5),
new Ability(Abilities.NORMALIZE, 4) new Ability(Abilities.NORMALIZE, 4)
.attr(MoveTypeChangeAttr, Type.NORMAL, 1.2, (user, target, move) => { .attr(MoveTypeChangeAttr, Type.NORMAL, 1.2, (user, target, move) => {
return ![Moves.HIDDEN_POWER, Moves.WEATHER_BALL, Moves.NATURAL_GIFT, Moves.JUDGMENT, Moves.TECHNO_BLAST].includes(move.id); return ![Moves.HIDDEN_POWER, Moves.WEATHER_BALL, Moves.NATURAL_GIFT, Moves.JUDGMENT, Moves.TECHNO_BLAST].includes(move.id);
@ -4728,8 +4712,8 @@ export function initAbilities() {
.attr(UnsuppressableAbilityAbAttr) .attr(UnsuppressableAbilityAbAttr)
.attr(NoFusionAbilityAbAttr), .attr(NoFusionAbilityAbAttr),
new Ability(Abilities.FLOWER_GIFT, 4) new Ability(Abilities.FLOWER_GIFT, 4)
.conditionalAttr(getWeatherCondition(WeatherType.SUNNY || WeatherType.HARSH_SUN), StatStageMultiplierAbAttr, Stat.ATK, 1.5) .conditionalAttr(getWeatherCondition(WeatherType.SUNNY || WeatherType.HARSH_SUN), StatMultiplierAbAttr, Stat.ATK, 1.5)
.conditionalAttr(getWeatherCondition(WeatherType.SUNNY || WeatherType.HARSH_SUN), StatStageMultiplierAbAttr, Stat.SPDEF, 1.5) .conditionalAttr(getWeatherCondition(WeatherType.SUNNY || WeatherType.HARSH_SUN), StatMultiplierAbAttr, Stat.SPDEF, 1.5)
.attr(UncopiableAbilityAbAttr) .attr(UncopiableAbilityAbAttr)
.attr(NoFusionAbilityAbAttr) .attr(NoFusionAbilityAbAttr)
.ignorable() .ignorable()
@ -4751,8 +4735,8 @@ export function initAbilities() {
new Ability(Abilities.DEFIANT, 5) new Ability(Abilities.DEFIANT, 5)
.attr(PostStatStageChangeStatStageChangeAbAttr, (target, statsChanged, stages) => stages < 0, [Stat.ATK], 2), .attr(PostStatStageChangeStatStageChangeAbAttr, (target, statsChanged, stages) => stages < 0, [Stat.ATK], 2),
new Ability(Abilities.DEFEATIST, 5) new Ability(Abilities.DEFEATIST, 5)
.attr(StatStageMultiplierAbAttr, Stat.ATK, 0.5) .attr(StatMultiplierAbAttr, Stat.ATK, 0.5)
.attr(StatStageMultiplierAbAttr, Stat.SPATK, 0.5) .attr(StatMultiplierAbAttr, Stat.SPATK, 0.5)
.condition((pokemon) => pokemon.getHpRatio() <= 0.5), .condition((pokemon) => pokemon.getHpRatio() <= 0.5),
new Ability(Abilities.CURSED_BODY, 5) new Ability(Abilities.CURSED_BODY, 5)
.attr(PostDefendMoveDisableAbAttr, 30) .attr(PostDefendMoveDisableAbAttr, 30)
@ -4803,7 +4787,7 @@ export function initAbilities() {
.attr(ProtectStatAbAttr, Stat.DEF) .attr(ProtectStatAbAttr, Stat.DEF)
.ignorable(), .ignorable(),
new Ability(Abilities.SAND_RUSH, 5) new Ability(Abilities.SAND_RUSH, 5)
.attr(StatStageMultiplierAbAttr, Stat.SPD, 2) .attr(StatMultiplierAbAttr, Stat.SPD, 2)
.attr(BlockWeatherDamageAttr, WeatherType.SANDSTORM) .attr(BlockWeatherDamageAttr, WeatherType.SANDSTORM)
.condition(getWeatherCondition(WeatherType.SANDSTORM)), .condition(getWeatherCondition(WeatherType.SANDSTORM)),
new Ability(Abilities.WONDER_SKIN, 5) new Ability(Abilities.WONDER_SKIN, 5)
@ -4859,7 +4843,7 @@ export function initAbilities() {
.attr(NoFusionAbilityAbAttr) .attr(NoFusionAbilityAbAttr)
.bypassFaint(), .bypassFaint(),
new Ability(Abilities.VICTORY_STAR, 5) new Ability(Abilities.VICTORY_STAR, 5)
.attr(StatStageMultiplierAbAttr, Stat.ACC, 1.1) .attr(StatMultiplierAbAttr, Stat.ACC, 1.1)
.partial(), .partial(),
new Ability(Abilities.TURBOBLAZE, 5) new Ability(Abilities.TURBOBLAZE, 5)
.attr(PostSummonMessageAbAttr, (pokemon: Pokemon) => i18next.t("abilityTriggers:postSummonTurboblaze", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) })) .attr(PostSummonMessageAbAttr, (pokemon: Pokemon) => i18next.t("abilityTriggers:postSummonTurboblaze", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }))
@ -4908,7 +4892,7 @@ export function initAbilities() {
new Ability(Abilities.MEGA_LAUNCHER, 6) new Ability(Abilities.MEGA_LAUNCHER, 6)
.attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.PULSE_MOVE), 1.5), .attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.PULSE_MOVE), 1.5),
new Ability(Abilities.GRASS_PELT, 6) new Ability(Abilities.GRASS_PELT, 6)
.conditionalAttr(getTerrainCondition(TerrainType.GRASSY), StatStageMultiplierAbAttr, Stat.DEF, 1.5) .conditionalAttr(getTerrainCondition(TerrainType.GRASSY), StatMultiplierAbAttr, Stat.DEF, 1.5)
.ignorable(), .ignorable(),
new Ability(Abilities.SYMBIOSIS, 6) new Ability(Abilities.SYMBIOSIS, 6)
.unimplemented(), .unimplemented(),
@ -4986,7 +4970,7 @@ export function initAbilities() {
.attr(PostDefendHpGatedStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, 0.5, [Stat.SPATK], 1) .attr(PostDefendHpGatedStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, 0.5, [Stat.SPATK], 1)
.condition(getSheerForceHitDisableAbCondition()), .condition(getSheerForceHitDisableAbCondition()),
new Ability(Abilities.SLUSH_RUSH, 7) new Ability(Abilities.SLUSH_RUSH, 7)
.attr(StatStageMultiplierAbAttr, Stat.SPD, 2) .attr(StatMultiplierAbAttr, Stat.SPD, 2)
.condition(getWeatherCondition(WeatherType.HAIL, WeatherType.SNOW)), .condition(getWeatherCondition(WeatherType.HAIL, WeatherType.SNOW)),
new Ability(Abilities.LONG_REACH, 7) new Ability(Abilities.LONG_REACH, 7)
.attr(IgnoreContactAbAttr), .attr(IgnoreContactAbAttr),
@ -4997,7 +4981,7 @@ export function initAbilities() {
new Ability(Abilities.GALVANIZE, 7) new Ability(Abilities.GALVANIZE, 7)
.attr(MoveTypeChangeAttr, Type.ELECTRIC, 1.2, (user, target, move) => move.type === Type.NORMAL), .attr(MoveTypeChangeAttr, Type.ELECTRIC, 1.2, (user, target, move) => move.type === Type.NORMAL),
new Ability(Abilities.SURGE_SURFER, 7) new Ability(Abilities.SURGE_SURFER, 7)
.conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), StatStageMultiplierAbAttr, Stat.SPD, 2), .conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), StatMultiplierAbAttr, Stat.SPD, 2),
new Ability(Abilities.SCHOOLING, 7) new Ability(Abilities.SCHOOLING, 7)
.attr(PostBattleInitFormChangeAbAttr, () => 0) .attr(PostBattleInitFormChangeAbAttr, () => 0)
.attr(PostSummonFormChangeAbAttr, p => p.level < 20 || p.getHpRatio() <= 0.25 ? 0 : 1) .attr(PostSummonFormChangeAbAttr, p => p.level < 20 || p.getHpRatio() <= 0.25 ? 0 : 1)
@ -5320,11 +5304,11 @@ export function initAbilities() {
new Ability(Abilities.ORICHALCUM_PULSE, 9) new Ability(Abilities.ORICHALCUM_PULSE, 9)
.attr(PostSummonWeatherChangeAbAttr, WeatherType.SUNNY) .attr(PostSummonWeatherChangeAbAttr, WeatherType.SUNNY)
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.SUNNY) .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.SUNNY)
.conditionalAttr(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN), StatStageMultiplierAbAttr, Stat.ATK, 4 / 3), .conditionalAttr(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN), StatMultiplierAbAttr, Stat.ATK, 4 / 3),
new Ability(Abilities.HADRON_ENGINE, 9) new Ability(Abilities.HADRON_ENGINE, 9)
.attr(PostSummonTerrainChangeAbAttr, TerrainType.ELECTRIC) .attr(PostSummonTerrainChangeAbAttr, TerrainType.ELECTRIC)
.attr(PostBiomeChangeTerrainChangeAbAttr, TerrainType.ELECTRIC) .attr(PostBiomeChangeTerrainChangeAbAttr, TerrainType.ELECTRIC)
.conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), StatStageMultiplierAbAttr, Stat.SPATK, 4 / 3), .conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), StatMultiplierAbAttr, Stat.SPATK, 4 / 3),
new Ability(Abilities.OPPORTUNIST, 9) new Ability(Abilities.OPPORTUNIST, 9)
.attr(StatStageChangeCopyAbAttr), .attr(StatStageChangeCopyAbAttr),
new Ability(Abilities.CUD_CHEW, 9) new Ability(Abilities.CUD_CHEW, 9)
@ -5352,7 +5336,7 @@ export function initAbilities() {
new Ability(Abilities.MINDS_EYE, 9) new Ability(Abilities.MINDS_EYE, 9)
.attr(IgnoreTypeImmunityAbAttr, Type.GHOST, [Type.NORMAL, Type.FIGHTING]) .attr(IgnoreTypeImmunityAbAttr, Type.GHOST, [Type.NORMAL, Type.FIGHTING])
.attr(ProtectStatAbAttr, Stat.ACC) .attr(ProtectStatAbAttr, Stat.ACC)
.attr(IgnoreOpponentEvasionAbAttr) .attr(IgnoreOpponentStatStagesAbAttr, [ Stat.EVA ])
.ignorable(), .ignorable(),
new Ability(Abilities.SUPERSWEET_SYRUP, 9) new Ability(Abilities.SUPERSWEET_SYRUP, 9)
.attr(PostSummonStatStageChangeAbAttr, [ Stat.EVA ], -1) .attr(PostSummonStatStageChangeAbAttr, [ Stat.EVA ], -1)

View File

@ -1068,7 +1068,7 @@ export class StatusMoveTypeImmunityAttr extends MoveAttr {
export class IgnoreOpponentStatStagesAttr extends MoveAttr { export class IgnoreOpponentStatStagesAttr extends MoveAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
(args[0] as Utils.IntegerHolder).value = 0; (args[0] as Utils.BooleanHolder).value = true;
return true; return true;
} }

View File

@ -21,7 +21,7 @@ import { DamagePhase, FaintPhase, LearnMovePhase, MoveEffectPhase, ObtainStatusE
import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, ExposedTag } from "../data/battler-tags"; import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, ExposedTag } from "../data/battler-tags";
import { WeatherType } from "../data/weather"; import { WeatherType } from "../data/weather";
import { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag"; import { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag";
import { Ability, AbAttr, StatStageMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, IgnoreOpponentStatStagesAbAttr, MoveImmunityAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyStatStageMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldStatMultiplierAbAttrs, FieldMultiplyStatAbAttr, AddSecondStrikeAbAttr, IgnoreOpponentEvasionAbAttr, UserFieldStatusEffectImmunityAbAttr, UserFieldBattlerTagImmunityAbAttr, BattlerTagImmunityAbAttr } from "../data/ability"; import { Ability, AbAttr, StatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, IgnoreOpponentStatStagesAbAttr, MoveImmunityAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldStatMultiplierAbAttrs, FieldMultiplyStatAbAttr, AddSecondStrikeAbAttr, UserFieldStatusEffectImmunityAbAttr, UserFieldBattlerTagImmunityAbAttr, BattlerTagImmunityAbAttr } from "../data/ability";
import PokemonData from "../system/pokemon-data"; import PokemonData from "../system/pokemon-data";
import { BattlerIndex } from "../battle"; import { BattlerIndex } from "../battle";
import { Mode } from "../ui/ui"; import { Mode } from "../ui/ui";
@ -739,28 +739,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
getEffectiveStat(stat: EffectiveStat, opponent?: Pokemon, move?: Move, isCritical: boolean = false): integer { getEffectiveStat(stat: EffectiveStat, opponent?: Pokemon, move?: Move, isCritical: boolean = false): integer {
const statLevel = new Utils.IntegerHolder(this.getStatStage(stat));
if (opponent) {
if (isCritical) {
switch (stat) {
case Stat.ATK:
case Stat.SPATK:
statLevel.value = Math.max(statLevel.value, 0);
break;
case Stat.DEF:
case Stat.SPDEF:
statLevel.value = Math.min(statLevel.value, 0);
break;
}
}
applyAbAttrs(IgnoreOpponentStatStagesAbAttr, opponent, null, statLevel);
if (move) {
applyMoveAttrs(IgnoreOpponentStatStagesAttr, this, opponent, move, statLevel);
}
}
if (this.isPlayer()) {
this.scene.applyModifiers(TempStatStageBoosterModifier, this.isPlayer(), stat, statLevel);
}
const statValue = new Utils.NumberHolder(this.getStat(stat, false)); const statValue = new Utils.NumberHolder(this.getStat(stat, false));
this.scene.applyModifiers(StatBoosterModifier, this.isPlayer(), this, stat, statValue); this.scene.applyModifiers(StatBoosterModifier, this.isPlayer(), this, stat, statValue);
@ -771,8 +749,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
break; break;
} }
} }
applyStatStageMultiplierAbAttrs(StatStageMultiplierAbAttr, this, stat, statValue); applyStatMultiplierAbAttrs(StatMultiplierAbAttr, this, stat, statValue);
let ret = statValue.value * (Math.max(2, 2 + statLevel.value) / Math.max(2, 2 - statLevel.value)); let ret = statValue.value * this.getStatStageMultiplier(stat, opponent, move, isCritical);
switch (stat) { switch (stat) {
case Stat.ATK: case Stat.ATK:
if (this.getTag(BattlerTagType.SLOW_START)) { if (this.getTag(BattlerTagType.SLOW_START)) {
@ -1934,6 +1913,45 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return this instanceof PlayerPokemon ? this.scene.getPlayerField() : this.scene.getEnemyField(); return this instanceof PlayerPokemon ? this.scene.getPlayerField() : this.scene.getEnemyField();
} }
/**
* Calculates the stat stage multiplier of the user against an opponent.
*
* Note that this does not apply to evasion or accuracy
* @see {@linkcode getAccuracyMultiplier}
* @param
* @return the stat stage multiplier to be used for effective stat calculation
*/
getStatStageMultiplier(stat: EffectiveStat, opponent?: Pokemon, move?: Move, isCritical: boolean = false): number {
const statStage = new Utils.IntegerHolder(this.getStatStage(stat));
const ignoreStatStage = new Utils.BooleanHolder(false);
if (opponent) {
if (isCritical) {
switch (stat) {
case Stat.ATK:
case Stat.SPATK:
statStage.value = Math.max(statStage.value, 0);
break;
case Stat.DEF:
case Stat.SPDEF:
statStage.value = Math.min(statStage.value, 0);
break;
}
}
applyAbAttrs(IgnoreOpponentStatStagesAbAttr, opponent, null, stat, ignoreStatStage);
if (move) {
applyMoveAttrs(IgnoreOpponentStatStagesAttr, this, opponent, move, ignoreStatStage);
}
}
if (!ignoreStatStage.value) {
const statStageMultiplier = new Utils.NumberHolder(Math.max(2, 2 + statStage.value) / Math.max(2, 2 - statStage.value));
this.scene.applyModifiers(TempStatStageBoosterModifier, this.isPlayer(), stat, statStageMultiplier);
return Math.min(statStageMultiplier.value, 4);
}
return 1;
}
/** /**
* Calculates the accuracy multiplier of the user against a target. * Calculates the accuracy multiplier of the user against a target.
* *
@ -1953,12 +1971,18 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const userAccStage = new Utils.IntegerHolder(this.getStatStage(Stat.ACC)); const userAccStage = new Utils.IntegerHolder(this.getStatStage(Stat.ACC));
const targetEvaStage = new Utils.IntegerHolder(target.getStatStage(Stat.EVA)); const targetEvaStage = new Utils.IntegerHolder(target.getStatStage(Stat.EVA));
applyAbAttrs(IgnoreOpponentStatStagesAbAttr, target, null, userAccStage); const ignoreAccStatStage = new Utils.BooleanHolder(false);
applyAbAttrs(IgnoreOpponentStatStagesAbAttr, this, null, targetEvaStage); const ignoreEvaStatStage = new Utils.BooleanHolder(false);
applyAbAttrs(IgnoreOpponentEvasionAbAttr, this, null, targetEvaStage);
applyMoveAttrs(IgnoreOpponentStatStagesAttr, this, target, sourceMove, targetEvaStage); applyAbAttrs(IgnoreOpponentStatStagesAbAttr, target, null, Stat.ACC, ignoreAccStatStage);
applyAbAttrs(IgnoreOpponentStatStagesAbAttr, this, null, Stat.EVA, ignoreEvaStatStage);
applyMoveAttrs(IgnoreOpponentStatStagesAttr, this, target, sourceMove, ignoreEvaStatStage);
this.scene.applyModifiers(TempStatStageBoosterModifier, this.isPlayer(), Stat.ACC, userAccStage); this.scene.applyModifiers(TempStatStageBoosterModifier, this.isPlayer(), Stat.ACC, userAccStage);
userAccStage.value = ignoreAccStatStage.value ? 0 : userAccStage.value;
targetEvaStage.value = ignoreEvaStatStage.value ? 0 : targetEvaStage.value;
if (target.findTag(t => t instanceof ExposedTag)) { if (target.findTag(t => t instanceof ExposedTag)) {
targetEvaStage.value = Math.min(0, targetEvaStage.value); targetEvaStage.value = Math.min(0, targetEvaStage.value);
} }
@ -1970,14 +1994,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
: 3 / (3 + Math.min(targetEvaStage.value - userAccStage.value, 6)); : 3 / (3 + Math.min(targetEvaStage.value - userAccStage.value, 6));
} }
applyStatStageMultiplierAbAttrs(StatStageMultiplierAbAttr, this, Stat.ACC, accuracyMultiplier, sourceMove); applyStatMultiplierAbAttrs(StatMultiplierAbAttr, this, Stat.ACC, accuracyMultiplier, sourceMove);
const evasionMultiplier = new Utils.NumberHolder(1); const evasionMultiplier = new Utils.NumberHolder(1);
applyStatStageMultiplierAbAttrs(StatStageMultiplierAbAttr, target, Stat.EVA, evasionMultiplier); applyStatMultiplierAbAttrs(StatMultiplierAbAttr, target, Stat.EVA, evasionMultiplier);
accuracyMultiplier.value /= evasionMultiplier.value; return accuracyMultiplier.value / evasionMultiplier.value;
return accuracyMultiplier.value;
} }
apply(source: Pokemon, move: Move): HitResult { apply(source: Pokemon, move: Move): HitResult {

View File

@ -1207,7 +1207,7 @@ export type GeneratorModifierOverride = {
type?: SpeciesStatBoosterItem; type?: SpeciesStatBoosterItem;
} }
| { | {
name: keyof Pick<typeof modifierTypes, "TEMP_STAT_BOOSTER">; name: keyof Pick<typeof modifierTypes, "TEMP_STAT_STAGE_BOOSTER">;
type?: TempBattleStat; type?: TempBattleStat;
} }
| { | {
@ -1300,7 +1300,7 @@ export const modifierTypes = {
SPECIES_STAT_BOOSTER: () => new SpeciesStatBoosterModifierTypeGenerator(), SPECIES_STAT_BOOSTER: () => new SpeciesStatBoosterModifierTypeGenerator(),
TEMP_STAT_BOOSTER: () => new TempStatStageBoosterModifierTypeGenerator(), TEMP_STAT_STAGE_BOOSTER: () => new TempStatStageBoosterModifierTypeGenerator(),
DIRE_HIT: () => new class extends ModifierType { DIRE_HIT: () => new class extends ModifierType {
getDescription(_scene: BattleScene): string { getDescription(_scene: BattleScene): string {
@ -1478,7 +1478,7 @@ const modifierPool: ModifierPool = {
return thresholdPartyMemberCount; return thresholdPartyMemberCount;
}, 3), }, 3),
new WeightedModifierType(modifierTypes.LURE, 2), new WeightedModifierType(modifierTypes.LURE, 2),
new WeightedModifierType(modifierTypes.TEMP_STAT_BOOSTER, 4), new WeightedModifierType(modifierTypes.TEMP_STAT_STAGE_BOOSTER, 4),
new WeightedModifierType(modifierTypes.BERRY, 2), new WeightedModifierType(modifierTypes.BERRY, 2),
new WeightedModifierType(modifierTypes.TM_COMMON, 2), new WeightedModifierType(modifierTypes.TM_COMMON, 2),
].map(m => { ].map(m => {

View File

@ -362,23 +362,28 @@ export class DoubleBattleChanceBoosterModifier extends LapsingPersistentModifier
/** /**
* Modifier used for party-wide items, specifically the X items, that * Modifier used for party-wide items, specifically the X items, that
* temporarily increments the stat stage of the corresponding {@linkcode TempBattleStat}. * temporarily increases the stat stage multiplier of the corresponding
* {@linkcode TempBattleStat}.
* @extends LapsingPersistentModifier * @extends LapsingPersistentModifier
* @see {@linkcode apply} * @see {@linkcode apply}
*/ */
export class TempStatStageBoosterModifier extends LapsingPersistentModifier { export class TempStatStageBoosterModifier extends LapsingPersistentModifier {
private stat: TempBattleStat; private stat: TempBattleStat;
private multiplierBoost: number;
constructor(type: ModifierType, stat: TempBattleStat, battlesLeft?: integer, stackCount?: number) { constructor(type: ModifierType, stat: TempBattleStat, battlesLeft?: number, stackCount?: number) {
super(type, battlesLeft || 5, stackCount); super(type, battlesLeft ?? 5, stackCount);
this.stat = stat; this.stat = stat;
// Note that, because we want X Accuracy to maintain its original behavior,
// it will increment as it did previously, directly to the stat stage.
this.multiplierBoost = stat !== Stat.ACC ? 0.3 : 1;
} }
match(modifier: Modifier): boolean { match(modifier: Modifier): boolean {
if (modifier instanceof TempStatStageBoosterModifier) { if (modifier instanceof TempStatStageBoosterModifier) {
const modifierInstance = modifier as TempStatStageBoosterModifier; const modifierInstance = modifier as TempStatStageBoosterModifier;
return (modifierInstance.stat === this.stat) && (modifierInstance.battlesLeft === this.battlesLeft); return (modifierInstance.stat === this.stat);
} }
return false; return false;
} }
@ -395,21 +400,52 @@ export class TempStatStageBoosterModifier extends LapsingPersistentModifier {
* Checks if {@linkcode args} contains the necessary elements and if the * Checks if {@linkcode args} contains the necessary elements and if the
* incoming stat is matches {@linkcode stat}. * incoming stat is matches {@linkcode stat}.
* @param args [0] {@linkcode TempBattleStat} being checked at the time * @param args [0] {@linkcode TempBattleStat} being checked at the time
* [1] {@linkcode Utils.IntegerHolder} N/A * [1] {@linkcode Utils.NumberHolder} N/A
* @returns true if the modifier can be applied, false otherwise
*/ */
shouldApply(args: any[]): boolean { shouldApply(args: any[]): boolean {
return args && (args.length === 2) && TEMP_BATTLE_STATS.includes(args[0]) && (args[0] === this.stat) && (args[1] instanceof Utils.IntegerHolder); return args && (args.length === 2) && TEMP_BATTLE_STATS.includes(args[0]) && (args[0] === this.stat) && (args[1] instanceof Utils.NumberHolder);
} }
/** /**
* Increments the incoming stat stage matching {@linkcode stat}. * Increases the incoming stat stage matching {@linkcode stat} by {@linkcode multiplierBoost}.
* @param args [0] {@linkcode TempBattleStat} N/A * @param args [0] {@linkcode TempBattleStat} N/A
* [1] {@linkcode Utils.IntegerHolder} that holds the resulting value of the stat stage * [1] {@linkcode Utils.NumberHolder} that holds the resulting value of the stat stage multiplier
*/ */
apply(args: any[]): boolean { apply(args: any[]): boolean {
(args[1] as Utils.IntegerHolder).value++; (args[1] as Utils.NumberHolder).value += this.multiplierBoost;
return true; return true;
} }
/**
* Goes through existing modifiers for any that match the selected modifier,
* which will then either add it to the existing modifiers if none were found
* or, if one was found, it will refresh {@linkcode battlesLeft}.
* @param modifiers {@linkcode PersistentModifier} array of the player's modifiers
* @param _virtual N/A
* @param _scene N/A
* @returns true if the modifier was successfully added or applied, false otherwise
*/
add(modifiers: PersistentModifier[], _virtual: boolean, _scene: BattleScene): boolean {
for (const modifier of modifiers) {
if (this.match(modifier)) {
const modifierInstance = modifier as TempStatStageBoosterModifier;
if (modifierInstance.getBattlesLeft() < 5) {
modifierInstance.battlesLeft = 5;
return true;
}
// should never get here
return false;
}
}
modifiers.push(this);
return true;
}
getMaxStackCount(_scene: BattleScene, _forThreshold?: boolean): number {
return 1;
}
} }
/** /**
@ -427,10 +463,15 @@ export class TempCritBoosterModifier extends LapsingPersistentModifier {
return new TempCritBoosterModifier(this.type, this.stackCount); return new TempCritBoosterModifier(this.type, this.stackCount);
} }
matchType(modifier: Modifier): boolean { match(modifier: Modifier): boolean {
return (modifier instanceof TempCritBoosterModifier); return (modifier instanceof TempCritBoosterModifier);
} }
/**
* Checks if {@linkcode args} contains the necessary elements.
* @param args [1] {@linkcode Utils.NumberHolder} N/A
* @returns true if the critical-hit stage boost applies successfully
*/
shouldApply(args: any[]): boolean { shouldApply(args: any[]): boolean {
return args && (args.length === 1) && (args[0] instanceof Utils.NumberHolder); return args && (args.length === 1) && (args[0] instanceof Utils.NumberHolder);
} }
@ -444,6 +485,36 @@ export class TempCritBoosterModifier extends LapsingPersistentModifier {
(args[0] as Utils.NumberHolder).value++; (args[0] as Utils.NumberHolder).value++;
return true; return true;
} }
/**
* Goes through existing modifiers for any that match the selected modifier,
* which will then either add it to the existing modifiers if none were found
* or, if one was found, it will refresh {@linkcode battlesLeft}.
* @param modifiers {@linkcode PersistentModifier} array of the player's modifiers
* @param _virtual N/A
* @param _scene N/A
* @returns true if the modifier was successfully added or applied, false otherwise
*/
add(modifiers: PersistentModifier[], _virtual: boolean, _scene: BattleScene): boolean {
for (const modifier of modifiers) {
if (this.match(modifier)) {
const modifierInstance = modifier as TempCritBoosterModifier;
if (modifierInstance.getBattlesLeft() < 5) {
modifierInstance.battlesLeft = 5;
return true;
}
// should never get here
return false;
}
}
modifiers.push(this);
return true;
}
getMaxStackCount(_scene: BattleScene, _forThreshold?: boolean): number {
return 1;
}
} }
export class MapModifier extends PersistentModifier { export class MapModifier extends PersistentModifier {

View File

@ -1,4 +1,4 @@
import { StatStageMultiplierAbAttr, allAbilities } from "#app/data/ability.js"; import { StatMultiplierAbAttr, allAbilities } from "#app/data/ability.js";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { WeatherType } from "#app/data/weather.js"; import { WeatherType } from "#app/data/weather.js";
import { CommandPhase, MoveEffectPhase, MoveEndPhase } from "#app/phases.js"; import { CommandPhase, MoveEffectPhase, MoveEndPhase } from "#app/phases.js";
@ -48,7 +48,7 @@ describe("Abilities - Sand Veil", () => {
vi.spyOn(leadPokemon[0], "getAbility").mockReturnValue(allAbilities[Abilities.SAND_VEIL]); vi.spyOn(leadPokemon[0], "getAbility").mockReturnValue(allAbilities[Abilities.SAND_VEIL]);
const sandVeilAttr = allAbilities[Abilities.SAND_VEIL].getAttrs(StatStageMultiplierAbAttr)[0]; const sandVeilAttr = allAbilities[Abilities.SAND_VEIL].getAttrs(StatMultiplierAbAttr)[0];
vi.spyOn(sandVeilAttr, "applyStatStage").mockImplementation( vi.spyOn(sandVeilAttr, "applyStatStage").mockImplementation(
(_pokemon, _passive, stat, statValue, _args) => { (_pokemon, _passive, stat, statValue, _args) => {
if (stat === Stat.EVA && game.scene.arena.weather?.weatherType === WeatherType.SANDSTORM) { if (stat === Stat.EVA && game.scene.arena.weather?.weatherType === WeatherType.SANDSTORM) {

View File

@ -339,7 +339,7 @@ describe("Test Battle Phase", () => {
.startingLevel(100) .startingLevel(100)
.moveset([moveToUse]) .moveset([moveToUse])
.enemyMoveset(SPLASH_ONLY) .enemyMoveset(SPLASH_ONLY)
.startingHeldItems([{ name: "TEMP_STAT_BOOSTER", type: Stat.ACC }]); .startingHeldItems([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]);
await game.startBattle(); await game.startBattle();
game.scene.getPlayerPokemon()!.hp = 1; game.scene.getPlayerPokemon()!.hp = 1;

View File

@ -98,7 +98,7 @@ export default class BattleMessageUiHandler extends MessageUiHandler {
let levelUpStatsLabelText = ""; let levelUpStatsLabelText = "";
for (const s of PERMANENT_STATS) { for (const s of PERMANENT_STATS) {
levelUpStatsLabelText += `${getStatKey(s)}\n`; levelUpStatsLabelText += `${i18next.t(getStatKey(s))}\n`;
} }
levelUpStatsLabelsContent.text = levelUpStatsLabelText; levelUpStatsLabelsContent.text = levelUpStatsLabelText;
levelUpStatsLabelsContent.x -= levelUpStatsLabelsContent.displayWidth; levelUpStatsLabelsContent.x -= levelUpStatsLabelsContent.displayWidth;