mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-13 11:52:18 +02:00
adds the safety goggles item, does not have it's effect yet
This commit is contained in:
parent
03d68f877a
commit
4b004356d2
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 |
BIN
public/images/items/safety_goggles.png
Normal file
BIN
public/images/items/safety_goggles.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 317 B |
@ -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',
|
BERRY_POUCH: () => new ModifierType('Berry Pouch', 'Adds a 25% chance that a used berry will not be consumed',
|
||||||
(type, _args) => new Modifiers.PreserveBerryModifier(type)),
|
(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',
|
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)),
|
(type, args) => new Modifiers.SurviveDamageModifier(type, (args[0] as Pokemon).id)),
|
||||||
|
|
||||||
|
@ -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 {
|
export class PokemonInstantReviveModifier extends PokemonHeldItemModifier {
|
||||||
constructor(type: ModifierType, pokemonId: integer, stackCount?: integer) {
|
constructor(type: ModifierType, pokemonId: integer, stackCount?: integer) {
|
||||||
super(type, pokemonId, stackCount);
|
super(type, pokemonId, stackCount);
|
||||||
|
Loading…
Reference in New Issue
Block a user