Implement hidden abilities and ability charm
This commit is contained in:
1 parent
d503834758
commit
2c17efca9b
8 files changed
+2008
-1956
No files matched your search
@@ -669,6 +669,7 @@ export const modifierTypes = {
|
||||
(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)),
|
||||
ABILITY_CHARM: () => new ModifierType('Ability Charm', 'Dramatically increases the chance of a wild Pokémon having a hidden ability', (type, _args) => new Modifiers.HiddenAbilityRateBoosterModifier(type)),
|
||||
|
||||
MINI_BLACK_HOLE: () => new TurnHeldItemTransferModifierType('Mini Black Hole'),
|
||||
|
||||
@@ -770,6 +771,7 @@ const modifierPool = {
|
||||
new WeightedModifierType(modifierTypes.BERRY_POUCH, 3),
|
||||
new WeightedModifierType(modifierTypes.EXP_CHARM, 4),
|
||||
new WeightedModifierType(modifierTypes.OVAL_CHARM, 2),
|
||||
new WeightedModifierType(modifierTypes.ABILITY_CHARM, 2),
|
||||
new WeightedModifierType(modifierTypes.EXP_BALANCE, 1),
|
||||
].map(m => { m.setTier(ModifierTier.ULTRA); return m; }),
|
||||
[ModifierTier.MASTER]: [
|
||||
|
||||
@@ -1050,6 +1050,30 @@ export class ExpBalanceModifier extends PersistentModifier {
|
||||
}
|
||||
}
|
||||
|
||||
export class HiddenAbilityRateBoosterModifier extends PersistentModifier {
|
||||
constructor(type: ModifierType, stackCount?: integer) {
|
||||
super(type, stackCount);
|
||||
}
|
||||
|
||||
match(modifier: Modifier): boolean {
|
||||
return modifier instanceof HiddenAbilityRateBoosterModifier;
|
||||
}
|
||||
|
||||
clone(): HiddenAbilityRateBoosterModifier {
|
||||
return new HiddenAbilityRateBoosterModifier(this.type, this.stackCount);
|
||||
}
|
||||
|
||||
apply(args: any[]): boolean {
|
||||
(args[0] as Utils.IntegerHolder).value *= Math.pow(2, -1 - this.getStackCount());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
getMaxStackCount(): integer {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
export class ShinyRateBoosterModifier extends PersistentModifier {
|
||||
constructor(type: ModifierType, stackCount?: integer) {
|
||||
super(type, stackCount);
|
||||
|
||||
Reference in new issue
Block a user