Add Wide Lens item
This commit is contained in:
1 parent
934fc0ef86
commit
0eff8cd81a
7 files changed
+227
-155
No files matched your search
@@ -502,6 +502,12 @@ export class PokemonFriendshipBoosterModifierType extends PokemonHeldItemModifie
|
||||
}
|
||||
}
|
||||
|
||||
export class PokemonMoveAccuracyBoosterModifierType extends PokemonHeldItemModifierType {
|
||||
constructor(name: string, amount: integer, iconImage?: string, group?: string, soundName?: string) {
|
||||
super(name, `Increases move accuracy by ${amount} (up to 100)`, (_type, args) => new Modifiers.PokemonMoveAccuracyBoosterModifier(this, (args[0] as Pokemon).id, amount), iconImage, group, soundName);
|
||||
}
|
||||
}
|
||||
|
||||
export class PokemonMultiHitModifierType extends PokemonHeldItemModifierType {
|
||||
constructor(name: string, iconImage?: string) {
|
||||
super(name, `Attacks hit one additional time at the cost of a 60/75/82.5% power reduction per stack respectively`, (type, args) => new Modifiers.PokemonMultiHitModifier(type as PokemonMultiHitModifierType, (args[0] as Pokemon).id), iconImage);
|
||||
@@ -887,6 +893,7 @@ export const modifierTypes = {
|
||||
LOCK_CAPSULE: () => new ModifierType('Lock Capsule', 'Allows you to lock item rarities when rerolling items', (type, _args) => new Modifiers.LockModifierTiersModifier(type), 'lock_capsule'),
|
||||
|
||||
GRIP_CLAW: () => new ContactHeldItemTransferChanceModifierType('Grip Claw', 10),
|
||||
WIDE_LENS: () => new PokemonMoveAccuracyBoosterModifierType('Wide Lens', 5, 'wide_lens'),
|
||||
|
||||
MULTI_LENS: () => new PokemonMultiHitModifierType('Multi Lens', 'zoom_lens'),
|
||||
|
||||
@@ -1056,6 +1063,7 @@ const modifierPool: ModifierPool = {
|
||||
new WeightedModifierType(modifierTypes.SHELL_BELL, 3),
|
||||
new WeightedModifierType(modifierTypes.BERRY_POUCH, 4),
|
||||
new WeightedModifierType(modifierTypes.GRIP_CLAW, 5),
|
||||
new WeightedModifierType(modifierTypes.WIDE_LENS, 4),
|
||||
new WeightedModifierType(modifierTypes.BATON, 2),
|
||||
new WeightedModifierType(modifierTypes.SOUL_DEW, 8),
|
||||
//new WeightedModifierType(modifierTypes.OVAL_CHARM, 6),
|
||||
@@ -1113,6 +1121,7 @@ const trainerModifierPool: ModifierPool = {
|
||||
new WeightedModifierType(modifierTypes.FOCUS_BAND, 2),
|
||||
new WeightedModifierType(modifierTypes.LUCKY_EGG, 4),
|
||||
new WeightedModifierType(modifierTypes.GRIP_CLAW, 1),
|
||||
new WeightedModifierType(modifierTypes.WIDE_LENS, 1),
|
||||
].map(m => { m.setTier(ModifierTier.ROGUE); return m; }),
|
||||
[ModifierTier.MASTER]: [
|
||||
new WeightedModifierType(modifierTypes.KINGS_ROCK, 1),
|
||||
|
||||
@@ -1438,6 +1438,46 @@ export class PokemonNatureWeightModifier extends PokemonHeldItemModifier {
|
||||
}
|
||||
}
|
||||
|
||||
export class PokemonMoveAccuracyBoosterModifier extends PokemonHeldItemModifier {
|
||||
private accuracyAmount: integer;
|
||||
|
||||
constructor(type: ModifierTypes.PokemonMoveAccuracyBoosterModifierType, pokemonId: integer, accuracy: integer, stackCount?: integer) {
|
||||
super(type, pokemonId, stackCount);
|
||||
this.accuracyAmount = accuracy;
|
||||
}
|
||||
|
||||
matchType(modifier: Modifier): boolean {
|
||||
if (modifier instanceof PokemonMoveAccuracyBoosterModifier) {
|
||||
const pokemonAccuracyBoosterModifier = modifier as PokemonMoveAccuracyBoosterModifier;
|
||||
return pokemonAccuracyBoosterModifier.accuracyAmount === this.accuracyAmount;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
clone(): PersistentModifier {
|
||||
return new PokemonMoveAccuracyBoosterModifier(this.type as ModifierTypes.PokemonMoveAccuracyBoosterModifierType, this.pokemonId, this.accuracyAmount, this.stackCount);
|
||||
}
|
||||
|
||||
getArgs(): any[] {
|
||||
return super.getArgs().concat(this.accuracyAmount);
|
||||
}
|
||||
|
||||
shouldApply(args: any[]): boolean {
|
||||
return super.shouldApply(args) && args.length === 2 && args[1] instanceof Utils.NumberHolder;
|
||||
}
|
||||
|
||||
apply(args: any[]): boolean {
|
||||
const moveAccuracy = (args[1] as Utils.IntegerHolder);
|
||||
moveAccuracy.value = Math.min(moveAccuracy.value + this.accuracyAmount, 100);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
getMaxHeldItemCount(pokemon: Pokemon): integer {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
export class PokemonMultiHitModifier extends PokemonHeldItemModifier {
|
||||
constructor(type: ModifierTypes.PokemonMultiHitModifierType, pokemonId: integer, stackCount?: integer) {
|
||||
super(type, pokemonId, stackCount);
|
||||
|
||||
Reference in new issue
Block a user