From 307c84914effb0f4bdb0dd2f5fe0295f9de9c2e7 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 6 Apr 2024 10:37:54 -0400 Subject: [PATCH] Buff IV Scanner item --- src/modifier/modifier-type.ts | 2 +- src/modifier/modifier.ts | 2 +- src/phases.ts | 2 +- src/ui/battle-message-ui-handler.ts | 9 ++++++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index bd1bfda80..cb7fd1554 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -895,7 +895,7 @@ export const modifierTypes = { 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)), - IV_SCANNER: () => new ModifierType('IV Scanner', 'Allows scanning the IVs of wild Pokémon', (type, _args) => new Modifiers.IvScannerModifier(type), 'scanner'), + IV_SCANNER: () => new ModifierType('IV Scanner', 'Allows scanning the IVs of wild Pokémon. 2 IVs are revealed per stack. The best IVs are shown first.', (type, _args) => new Modifiers.IvScannerModifier(type), 'scanner'), DNA_SPLICERS: () => new FusePokemonModifierType('DNA Splicers'), diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 5a2474532..a75f59631 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -1873,7 +1873,7 @@ export class IvScannerModifier extends PersistentModifier { } getMaxStackCount(scene: BattleScene): integer { - return 5; + return 3; } } diff --git a/src/phases.ts b/src/phases.ts index 7e9ed5a85..09dd81a96 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -765,7 +765,7 @@ export class EncounterPhase extends BattlePhase { enemyField.map(p => this.scene.pushPhase(new PostSummonPhase(this.scene, p.getBattlerIndex()))); const ivScannerModifier = this.scene.findModifier(m => m instanceof IvScannerModifier); if (ivScannerModifier) - enemyField.map(p => this.scene.pushPhase(new ScanIvsPhase(this.scene, p.getBattlerIndex(), Math.min(ivScannerModifier.getStackCount(), 6)))); + enemyField.map(p => this.scene.pushPhase(new ScanIvsPhase(this.scene, p.getBattlerIndex(), Math.min(ivScannerModifier.getStackCount() * 2, 6)))); } if (!this.loaded) { diff --git a/src/ui/battle-message-ui-handler.ts b/src/ui/battle-message-ui-handler.ts index 23830cd75..2ae2f5b37 100644 --- a/src/ui/battle-message-ui-handler.ts +++ b/src/ui/battle-message-ui-handler.ts @@ -193,7 +193,14 @@ export default class BattleMessageUiHandler extends MessageUiHandler { if (shownIvsCount < 6) { let statsPool = stats.slice(0); for (let i = 0; i < shownIvsCount; i++) { - const shownStat = Utils.randSeedItem(statsPool); + let shownStat: Stat; + let highestIv = -1; + statsPool.map(s => { + if (ivs[s] > highestIv) { + shownStat = s as Stat; + highestIv = ivs[s]; + } + }); shownStats.push(shownStat); statsPool.splice(statsPool.indexOf(shownStat), 1); }