Adding isBypassOnField property to all abilities with a preSwitchOut trigger

This commit is contained in:
Wlowscha 2024-12-27 16:43:07 +01:00
parent 1752663f80
commit 0dbaad5ee1
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
1 changed files with 17 additions and 5 deletions

View File

@ -47,6 +47,7 @@ export class Ability implements Localizable {
public description: string; public description: string;
public generation: integer; public generation: integer;
public isBypassFaint: boolean; public isBypassFaint: boolean;
public isBypassOnField: boolean;
public isIgnorable: boolean; public isIgnorable: boolean;
public attrs: AbAttr[]; public attrs: AbAttr[];
public conditions: AbAttrCondition[]; public conditions: AbAttrCondition[];
@ -107,6 +108,11 @@ export class Ability implements Localizable {
return this; return this;
} }
bypassOnField(): Ability {
this.isBypassOnField = true;
return this;
}
ignorable(): Ability { ignorable(): Ability {
this.isIgnorable = true; this.isIgnorable = true;
return this; return this;
@ -5423,7 +5429,8 @@ export function initAbilities() {
.attr(ProtectStatAbAttr) .attr(ProtectStatAbAttr)
.ignorable(), .ignorable(),
new Ability(Abilities.NATURAL_CURE, 3) new Ability(Abilities.NATURAL_CURE, 3)
.attr(PreSwitchOutResetStatusAbAttr), .attr(PreSwitchOutResetStatusAbAttr)
.bypassOnField(),
new Ability(Abilities.LIGHTNING_ROD, 3) new Ability(Abilities.LIGHTNING_ROD, 3)
.attr(RedirectTypeMoveAbAttr, Type.ELECTRIC) .attr(RedirectTypeMoveAbAttr, Type.ELECTRIC)
.attr(TypeImmunityStatStageChangeAbAttr, Type.ELECTRIC, Stat.SPATK, 1) .attr(TypeImmunityStatStageChangeAbAttr, Type.ELECTRIC, Stat.SPATK, 1)
@ -5769,7 +5776,8 @@ export function initAbilities() {
new Ability(Abilities.POISON_TOUCH, 5) new Ability(Abilities.POISON_TOUCH, 5)
.attr(PostAttackContactApplyStatusEffectAbAttr, 30, StatusEffect.POISON), .attr(PostAttackContactApplyStatusEffectAbAttr, 30, StatusEffect.POISON),
new Ability(Abilities.REGENERATOR, 5) new Ability(Abilities.REGENERATOR, 5)
.attr(PreSwitchOutHealAbAttr), .attr(PreSwitchOutHealAbAttr)
.bypassOnField(),
new Ability(Abilities.BIG_PECKS, 5) new Ability(Abilities.BIG_PECKS, 5)
.attr(ProtectStatAbAttr, Stat.DEF) .attr(ProtectStatAbAttr, Stat.DEF)
.ignorable(), .ignorable(),
@ -5915,19 +5923,22 @@ export function initAbilities() {
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.HEAVY_RAIN) .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.HEAVY_RAIN)
.attr(PreSwitchOutClearWeatherAbAttr) .attr(PreSwitchOutClearWeatherAbAttr)
.attr(PostFaintClearWeatherAbAttr) .attr(PostFaintClearWeatherAbAttr)
.bypassFaint(), .bypassFaint()
.bypassOnField(),
new Ability(Abilities.DESOLATE_LAND, 6) new Ability(Abilities.DESOLATE_LAND, 6)
.attr(PostSummonWeatherChangeAbAttr, WeatherType.HARSH_SUN) .attr(PostSummonWeatherChangeAbAttr, WeatherType.HARSH_SUN)
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.HARSH_SUN) .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.HARSH_SUN)
.attr(PreSwitchOutClearWeatherAbAttr) .attr(PreSwitchOutClearWeatherAbAttr)
.attr(PostFaintClearWeatherAbAttr) .attr(PostFaintClearWeatherAbAttr)
.bypassFaint(), .bypassFaint()
.bypassOnField(),
new Ability(Abilities.DELTA_STREAM, 6) new Ability(Abilities.DELTA_STREAM, 6)
.attr(PostSummonWeatherChangeAbAttr, WeatherType.STRONG_WINDS) .attr(PostSummonWeatherChangeAbAttr, WeatherType.STRONG_WINDS)
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.STRONG_WINDS) .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.STRONG_WINDS)
.attr(PreSwitchOutClearWeatherAbAttr) .attr(PreSwitchOutClearWeatherAbAttr)
.attr(PostFaintClearWeatherAbAttr) .attr(PostFaintClearWeatherAbAttr)
.bypassFaint(), .bypassFaint()
.bypassOnField(),
new Ability(Abilities.STAMINA, 7) new Ability(Abilities.STAMINA, 7)
.attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, Stat.DEF, 1), .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, Stat.DEF, 1),
new Ability(Abilities.WIMP_OUT, 7) new Ability(Abilities.WIMP_OUT, 7)
@ -6264,6 +6275,7 @@ export function initAbilities() {
.attr(NoFusionAbilityAbAttr) .attr(NoFusionAbilityAbAttr)
.attr(PostBattleInitFormChangeAbAttr, () => 0) .attr(PostBattleInitFormChangeAbAttr, () => 0)
.attr(PreSwitchOutFormChangeAbAttr, (pokemon) => !pokemon.isFainted() ? 1 : pokemon.formIndex) .attr(PreSwitchOutFormChangeAbAttr, (pokemon) => !pokemon.isFainted() ? 1 : pokemon.formIndex)
.bypassOnField()
.bypassFaint(), .bypassFaint(),
new Ability(Abilities.COMMANDER, 9) new Ability(Abilities.COMMANDER, 9)
.attr(CommanderAbAttr) .attr(CommanderAbAttr)