adds the safety goggles item, does not have it's effect yet

This commit is contained in:
shayebeadlingkl 2024-05-11 13:19:27 -04:00
parent 03d68f877a
commit 4b004356d2
5 changed files with 3829 additions and 3776 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

View File

@ -922,6 +922,9 @@ export const modifierTypes = {
BERRY_POUCH: () => new ModifierType('Berry Pouch', 'Adds a 25% chance that a used berry will not be consumed',
(type, _args) => new Modifiers.PreserveBerryModifier(type)),
SAFETY_GOGGLES: () => new ModifierType('Safety Goggles', 'Prevents damage from weather and powder',
(type, _args) => new Modifiers.WeatherChipImmunityModifier(type), "safety_goggles"),
FOCUS_BAND: () => new PokemonHeldItemModifierType('Focus Band', 'Adds a 10% chance to survive with 1 HP after being damaged enough to faint',
(type, args) => new Modifiers.SurviveDamageModifier(type, (args[0] as Pokemon).id)),

View File

@ -918,6 +918,35 @@ export class PreserveBerryModifier extends PersistentModifier {
}
}
export class WeatherChipImmunityModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount);
}
match(modifier: Modifier) {
return modifier instanceof WeatherChipImmunityModifier;
}
clone() {
return new WeatherChipImmunityModifier(this.type, this.stackCount);
}
shouldApply(args: any[]): boolean {
return super.shouldApply(args) && args[0] instanceof Pokemon && args[1] instanceof Utils.BooleanHolder;
}
apply(args: any[]): boolean {
if (!(args[1] as Utils.BooleanHolder).value)
(args[1] as Utils.BooleanHolder).value = (args[0] as Pokemon).randSeedInt(this.getMaxStackCount(null)) < this.getStackCount();
return true;
}
getMaxStackCount(scene: BattleScene): integer {
return 1;
}
}
export class PokemonInstantReviveModifier extends PokemonHeldItemModifier {
constructor(type: ModifierType, pokemonId: integer, stackCount?: integer) {
super(type, pokemonId, stackCount);