Add Baton modifier
This commit is contained in:
1 parent
140e759486
commit
2b95d4ce51
6 files changed
+86
-22
No files matched your search
@@ -607,6 +607,9 @@ const modifierTypes = {
|
||||
SHELL_BELL: () => new PokemonHeldItemModifierType('SHELL BELL', 'Heals 1/8 of a POKéMON\'s dealt damage',
|
||||
(type, args) => new Modifiers.HitHealModifier(type, (args[0] as Pokemon).id)),
|
||||
|
||||
BATON: () => new PokemonHeldItemModifierType('BATON', 'Allows passing along effects when switching POKéMON, which also bypasses traps',
|
||||
(type, args) => new Modifiers.SwitchEffectTransferModifier(type, (args[0] as Pokemon).id), 'stick'),
|
||||
|
||||
SHINY_CHARM: () => new ModifierType('SHINY CHARM', 'Dramatically increases the chance of a wild POKéMON being shiny', (type, _args) => new Modifiers.ShinyRateBoosterModifier(type)),
|
||||
|
||||
MINI_BLACK_HOLE: () => new HeldItemTransferModifierType('MINI BLACK HOLE'),
|
||||
@@ -684,6 +687,7 @@ const modifierPool = {
|
||||
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 5),
|
||||
new WeightedModifierType(modifierTypes.CANDY_JAR, 3),
|
||||
new WeightedModifierType(modifierTypes.HEALING_CHARM, 1),
|
||||
new WeightedModifierType(modifierTypes.BATON, 1),
|
||||
new WeightedModifierType(modifierTypes.FOCUS_BAND, 3),
|
||||
new WeightedModifierType(modifierTypes.KINGS_ROCK, 2),
|
||||
new WeightedModifierType(modifierTypes.LEFTOVERS, 2),
|
||||
|
||||
@@ -972,6 +972,28 @@ export class ShinyRateBoosterModifier extends PersistentModifier {
|
||||
}
|
||||
}
|
||||
|
||||
export class SwitchEffectTransferModifier extends PokemonHeldItemModifier {
|
||||
constructor(type: ModifierType, pokemonId: integer, stackCount?: integer) {
|
||||
super(type, pokemonId, stackCount);
|
||||
}
|
||||
|
||||
matchType(modifier: Modifier): boolean {
|
||||
return modifier instanceof SwitchEffectTransferModifier;
|
||||
}
|
||||
|
||||
clone(): SwitchEffectTransferModifier {
|
||||
return new SwitchEffectTransferModifier(this.type, this.pokemonId, this.stackCount);
|
||||
}
|
||||
|
||||
apply(args: any[]): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
getMaxStackCount(): integer {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
export class HeldItemTransferModifier extends PokemonHeldItemModifier {
|
||||
constructor(type: ModifierType, pokemonId: integer, stackCount?: integer) {
|
||||
super(type, pokemonId, stackCount);
|
||||
@@ -1030,7 +1052,7 @@ export class ExtraModifierModifier extends PersistentModifier {
|
||||
return true;
|
||||
}
|
||||
|
||||
getMaxStackCount(): integer {
|
||||
getMaxStackCount(): integer {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user