diff --git a/public/images/items.json b/public/images/items.json index 3d247c554f8..b2fd7491979 100644 --- a/public/images/items.json +++ b/public/images/items.json @@ -6058,7 +6058,7 @@ } }, { - "filename": "big_root", + "filename": "wide_lens", "rotated": false, "trimmed": true, "sourceSize": { @@ -6066,16 +6066,16 @@ "h": 32 }, "spriteSourceSize": { - "x": 4, + "x": 5, "y": 4, - "w": 23, - "h": 24 + "w": 22, + "h": 23 }, "frame": { "x": 66, "y": 301, - "w": 23, - "h": 24 + "w": 22, + "h": 23 } }, { @@ -6093,12 +6093,33 @@ "h": 23 }, "frame": { - "x": 89, + "x": 88, "y": 302, "w": 24, "h": 23 } }, + { + "filename": "big_root", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 23, + "h": 24 + }, + "frame": { + "x": 112, + "y": 303, + "w": 23, + "h": 24 + } + }, { "filename": "catching_charm", "rotated": false, @@ -6114,7 +6135,7 @@ "h": 24 }, "frame": { - "x": 113, + "x": 135, "y": 303, "w": 21, "h": 24 @@ -6135,8 +6156,8 @@ "h": 24 }, "frame": { - "x": 134, - "y": 303, + "x": 156, + "y": 304, "w": 24, "h": 24 } @@ -6156,7 +6177,7 @@ "h": 24 }, "frame": { - "x": 158, + "x": 180, "y": 304, "w": 24, "h": 24 @@ -6177,8 +6198,8 @@ "h": 24 }, "frame": { - "x": 182, - "y": 304, + "x": 204, + "y": 305, "w": 24, "h": 24 } @@ -6198,7 +6219,7 @@ "h": 24 }, "frame": { - "x": 206, + "x": 228, "y": 305, "w": 24, "h": 24 @@ -6219,8 +6240,8 @@ "h": 24 }, "frame": { - "x": 230, - "y": 305, + "x": 252, + "y": 306, "w": 24, "h": 24 } @@ -6240,8 +6261,8 @@ "h": 24 }, "frame": { - "x": 254, - "y": 306, + "x": 276, + "y": 307, "w": 16, "h": 24 } @@ -6261,7 +6282,7 @@ "h": 24 }, "frame": { - "x": 270, + "x": 292, "y": 307, "w": 23, "h": 24 @@ -6282,7 +6303,7 @@ "h": 24 }, "frame": { - "x": 293, + "x": 315, "y": 307, "w": 24, "h": 24 @@ -6303,7 +6324,7 @@ "h": 24 }, "frame": { - "x": 317, + "x": 339, "y": 307, "w": 24, "h": 24 @@ -6324,28 +6345,7 @@ "h": 24 }, "frame": { - "x": 341, - "y": 307, - "w": 24, - "h": 24 - } - }, - { - "filename": "lucky_punch_ultra", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 365, + "x": 363, "y": 309, "w": 24, "h": 24 @@ -6373,7 +6373,7 @@ } }, { - "filename": "lustrous_globe", + "filename": "lucky_punch_ultra", "rotated": false, "trimmed": true, "sourceSize": { @@ -6393,6 +6393,27 @@ "h": 24 } }, + { + "filename": "lustrous_globe", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 24, + "h": 24 + }, + "frame": { + "x": 41, + "y": 323, + "w": 24, + "h": 24 + } + }, { "filename": "max_elixir", "rotated": false, @@ -6408,8 +6429,8 @@ "h": 24 }, "frame": { - "x": 41, - "y": 323, + "x": 65, + "y": 324, "w": 18, "h": 24 } @@ -6429,7 +6450,7 @@ "h": 24 }, "frame": { - "x": 59, + "x": 83, "y": 325, "w": 18, "h": 24 @@ -6450,8 +6471,8 @@ "h": 24 }, "frame": { - "x": 77, - "y": 325, + "x": 101, + "y": 327, "w": 17, "h": 24 } @@ -6471,8 +6492,8 @@ "h": 24 }, "frame": { - "x": 94, - "y": 325, + "x": 118, + "y": 327, "w": 18, "h": 24 } @@ -6492,7 +6513,7 @@ "h": 24 }, "frame": { - "x": 112, + "x": 136, "y": 327, "w": 16, "h": 24 @@ -6513,8 +6534,8 @@ "h": 24 }, "frame": { - "x": 128, - "y": 327, + "x": 152, + "y": 328, "w": 22, "h": 24 } @@ -6534,7 +6555,7 @@ "h": 24 }, "frame": { - "x": 150, + "x": 174, "y": 328, "w": 24, "h": 24 @@ -6555,8 +6576,8 @@ "h": 24 }, "frame": { - "x": 174, - "y": 328, + "x": 198, + "y": 329, "w": 21, "h": 24 } @@ -6576,7 +6597,7 @@ "h": 24 }, "frame": { - "x": 195, + "x": 219, "y": 329, "w": 16, "h": 24 @@ -6597,7 +6618,7 @@ "h": 24 }, "frame": { - "x": 211, + "x": 235, "y": 329, "w": 16, "h": 24 @@ -6618,8 +6639,8 @@ "h": 24 }, "frame": { - "x": 227, - "y": 329, + "x": 251, + "y": 330, "w": 16, "h": 24 } @@ -6639,8 +6660,8 @@ "h": 24 }, "frame": { - "x": 243, - "y": 330, + "x": 267, + "y": 331, "w": 20, "h": 24 } @@ -6660,7 +6681,7 @@ "h": 24 }, "frame": { - "x": 263, + "x": 287, "y": 331, "w": 16, "h": 24 @@ -6681,7 +6702,7 @@ "h": 24 }, "frame": { - "x": 279, + "x": 303, "y": 331, "w": 23, "h": 24 @@ -6702,7 +6723,7 @@ "h": 24 }, "frame": { - "x": 302, + "x": 326, "y": 331, "w": 24, "h": 24 @@ -6722,52 +6743,10 @@ "w": 24, "h": 24 }, - "frame": { - "x": 326, - "y": 331, - "w": 24, - "h": 24 - } - }, - { - "filename": "shiny_charm", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 21, - "h": 24 - }, "frame": { "x": 350, "y": 333, - "w": 21, - "h": 24 - } - }, - { - "filename": "super_lure", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 17, - "h": 24 - }, - "frame": { - "x": 371, - "y": 333, - "w": 17, + "w": 24, "h": 24 } }, @@ -6785,10 +6764,52 @@ "w": 16, "h": 24 }, + "frame": { + "x": 374, + "y": 333, + "w": 16, + "h": 24 + } + }, + { + "filename": "super_lure", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 17, + "h": 24 + }, "frame": { "x": 0, "y": 346, - "w": 16, + "w": 17, + "h": 24 + } + }, + { + "filename": "shiny_charm", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 21, + "h": 24 + }, + "frame": { + "x": 17, + "y": 347, + "w": 21, "h": 24 } }, @@ -6807,7 +6828,7 @@ "h": 24 }, "frame": { - "x": 16, + "x": 38, "y": 347, "w": 24, "h": 24 @@ -6828,8 +6849,29 @@ "h": 24 }, "frame": { - "x": 40, - "y": 347, + "x": 62, + "y": 348, + "w": 16, + "h": 24 + } + }, + { + "filename": "zinc", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 78, + "y": 349, "w": 16, "h": 24 } @@ -6849,33 +6891,12 @@ "h": 24 }, "frame": { - "x": 56, - "y": 349, + "x": 94, + "y": 351, "w": 24, "h": 24 } }, - { - "filename": "zinc", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 80, - "y": 349, - "w": 16, - "h": 24 - } - }, { "filename": "black_augurite", "rotated": false, @@ -6891,7 +6912,7 @@ "h": 25 }, "frame": { - "x": 96, + "x": 118, "y": 351, "w": 22, "h": 25 @@ -6912,8 +6933,8 @@ "h": 26 }, "frame": { - "x": 118, - "y": 351, + "x": 140, + "y": 352, "w": 23, "h": 26 } @@ -6933,7 +6954,7 @@ "h": 26 }, "frame": { - "x": 141, + "x": 163, "y": 352, "w": 24, "h": 26 @@ -6954,8 +6975,8 @@ "h": 26 }, "frame": { - "x": 165, - "y": 352, + "x": 187, + "y": 353, "w": 27, "h": 26 } @@ -6975,7 +6996,7 @@ "h": 27 }, "frame": { - "x": 192, + "x": 214, "y": 353, "w": 32, "h": 27 @@ -6996,8 +7017,8 @@ "h": 28 }, "frame": { - "x": 224, - "y": 354, + "x": 246, + "y": 355, "w": 29, "h": 28 } @@ -7017,7 +7038,7 @@ "h": 30 }, "frame": { - "x": 253, + "x": 275, "y": 355, "w": 29, "h": 30 @@ -7038,7 +7059,7 @@ "h": 30 }, "frame": { - "x": 282, + "x": 304, "y": 355, "w": 17, "h": 30 @@ -7059,7 +7080,7 @@ "h": 31 }, "frame": { - "x": 299, + "x": 321, "y": 355, "w": 17, "h": 31 @@ -7080,8 +7101,8 @@ "h": 31 }, "frame": { - "x": 316, - "y": 355, + "x": 338, + "y": 357, "w": 17, "h": 31 } @@ -7101,8 +7122,8 @@ "h": 31 }, "frame": { - "x": 333, - "y": 355, + "x": 355, + "y": 357, "w": 17, "h": 31 } @@ -7113,6 +7134,6 @@ "meta": { "app": "https://www.codeandweb.com/texturepacker", "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:6d684b34b1074ff970152bf5b6c304e3:7c1ae946dd8c91ed5dfd1e2c9a39e1b1:110e074689c9edd2c54833ce2e4d9270$" + "smartupdate": "$TexturePacker:SmartUpdate:c16376d506289ffa5c901575af53cc84:c882e2e3aa145f15aae7eaf611efe36c:110e074689c9edd2c54833ce2e4d9270$" } } diff --git a/public/images/items.png b/public/images/items.png index 1ecd17240f0..d01db47850d 100644 Binary files a/public/images/items.png and b/public/images/items.png differ diff --git a/public/images/items/wide_lens.png b/public/images/items/wide_lens.png new file mode 100644 index 00000000000..bf622521a9a Binary files /dev/null and b/public/images/items/wide_lens.png differ diff --git a/src/loading-scene.ts b/src/loading-scene.ts index 431e99ca72c..74deaa5fdbd 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -198,7 +198,8 @@ export class LoadingScene extends SceneBase { for (let i = 0; i < 10; i++) { this.loadAtlas(`pokemon_icons_${i}`, ''); - this.loadAtlas(`pokemon_icons_${i}v`, ''); + if (i) + this.loadAtlas(`pokemon_icons_${i}v`, ''); } this.loadSe('select'); diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 115c9bc23f3..77d70954768 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -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), diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 1dde041b782..3ebf4e75bbd 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -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); diff --git a/src/phases.ts b/src/phases.ts index 04d712cdcaf..70160364f90 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -6,7 +6,7 @@ import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMov import { Mode } from './ui/ui'; import { Command } from "./ui/command-ui-handler"; import { Stat } from "./data/pokemon-stat"; -import { BerryModifier, ContactHeldItemTransferChanceModifier, EnemyAttackStatusEffectChanceModifier, EnemyPersistentModifier, EnemyStatusEffectHealChanceModifier, EnemyTurnHealModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, FusePokemonModifier, HealingBoosterModifier, HitHealModifier, LapsingPersistentModifier, MapModifier, Modifier, MultipleParticipantExpBonusModifier, PersistentModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, PokemonInstantReviveModifier, SwitchEffectTransferModifier, TempBattleStatBoosterModifier, TurnHealModifier, TurnHeldItemTransferModifier, MoneyMultiplierModifier, MoneyInterestModifier, IvScannerModifier, PokemonFriendshipBoosterModifier, LapsingPokemonHeldItemModifier, PokemonMultiHitModifier } from "./modifier/modifier"; +import { BerryModifier, ContactHeldItemTransferChanceModifier, EnemyAttackStatusEffectChanceModifier, EnemyPersistentModifier, EnemyStatusEffectHealChanceModifier, EnemyTurnHealModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, FusePokemonModifier, HealingBoosterModifier, HitHealModifier, LapsingPersistentModifier, MapModifier, Modifier, MultipleParticipantExpBonusModifier, PersistentModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, PokemonInstantReviveModifier, SwitchEffectTransferModifier, TempBattleStatBoosterModifier, TurnHealModifier, TurnHeldItemTransferModifier, MoneyMultiplierModifier, MoneyInterestModifier, IvScannerModifier, PokemonFriendshipBoosterModifier, LapsingPokemonHeldItemModifier, PokemonMultiHitModifier, PokemonMoveAccuracyBoosterModifier } from "./modifier/modifier"; import PartyUiHandler, { PartyOption, PartyUiMode } from "./ui/party-ui-handler"; import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballTintColor, PokeballType } from "./data/pokeball"; import { CommonAnim, CommonBattleAnim, MoveAnim, initMoveAnim, loadMoveAnimAssets } from "./data/battle-anims"; @@ -2477,6 +2477,7 @@ export class MoveEffectPhase extends PokemonPhase { const moveAccuracy = new Utils.NumberHolder(this.move.getMove().accuracy); applyMoveAttrs(VariableAccuracyAttr, user, target, this.move.getMove(), moveAccuracy); + user.scene.applyModifiers(PokemonMoveAccuracyBoosterModifier, user.isPlayer(), user, moveAccuracy); if (moveAccuracy.value === -1) return true;