diff --git a/package-lock.json b/package-lock.json index 7db944a45..a4e40a2cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "phaser3spectorjs": "^0.0.8", "pokenode-ts": "^1.20.0", "typescript": "^5.0.3", - "vite": "^4.5.0", + "vite": "^4.5.3", "vite-plugin-fs": "^0.4.4", "vitest": "^1.4.0", "vitest-canvas-mock": "^0.3.3" diff --git a/package.json b/package.json index d5ffb651f..c004c3f80 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "phaser3spectorjs": "^0.0.8", "pokenode-ts": "^1.20.0", "typescript": "^5.0.3", - "vite": "^4.5.0", + "vite": "^4.5.3", "vite-plugin-fs": "^0.4.4", "vitest": "^1.4.0", "vitest-canvas-mock": "^0.3.3" diff --git a/src/battle-scene.ts b/src/battle-scene.ts index cbf363f68..87a1f0ead 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -112,6 +112,7 @@ export default class BattleScene extends SceneBase { public gameSpeed: integer = 1; public damageNumbersMode: integer = 0; public showLevelUpStats: boolean = true; + public disableIVScanner: boolean = true; public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1"; public enableRetries: boolean = false; public uiTheme: UiTheme = UiTheme.DEFAULT; diff --git a/src/data/move.ts b/src/data/move.ts index dc6d326b2..9ddc56fc3 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -3390,13 +3390,38 @@ export class CopyMoveAttr extends OverrideMoveEffectAttr { } export class ReducePpMoveAttr extends MoveEffectAttr { + public reduction: integer + public causesMoveToFail: boolean + + constructor(reduction: integer, causesMoveToFail: boolean) { + super(false, MoveEffectTrigger.POST_APPLY); + + this.reduction = reduction; + this.causesMoveToFail = causesMoveToFail; + } + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - // Null checks can be skipped due to condition function const lastMove = target.getLastXMoves().find(() => true); + if (!lastMove) { + return false; + } const movesetMove = target.getMoveset().find(m => m.moveId === lastMove.move); const lastPpUsed = movesetMove.ppUsed; - movesetMove.ppUsed = Math.min(movesetMove.ppUsed + 4, movesetMove.getMovePp()); - user.scene.queueMessage(`It reduced the PP of ${getPokemonMessage(target, `'s\n${movesetMove.getName()} by ${movesetMove.ppUsed - lastPpUsed}!`)}`); +<<<<<<< Updated upstream +<<<<<<< Updated upstream + if (!lastMove || lastPpUsed < 1) { +======= + if (lastPpUsed < 1) { +>>>>>>> Stashed changes +======= + if (lastPpUsed < 1) { +>>>>>>> Stashed changes + return false; + } + else { + movesetMove.ppUsed = Math.min(movesetMove.ppUsed + this.reduction, movesetMove.getMovePp()); + user.scene.queueMessage(`It reduced the PP of ${getPokemonMessage(target, `'s\n${movesetMove.getName()} by ${movesetMove.ppUsed - lastPpUsed}!`)}`); + } return true; } @@ -3408,6 +3433,7 @@ export class ReducePpMoveAttr extends MoveEffectAttr { const movesetMove = target.getMoveset().find(m => m.moveId === lastMove.move); return !!movesetMove?.getPpRatio(); } + if (!this.causesMoveToFail) {return true;} return false; }; } @@ -4323,7 +4349,7 @@ export function initMoves() { new AttackMove(Moves.REVERSAL, Type.FIGHTING, MoveCategory.PHYSICAL, -1, 100, 15, -1, 0, 2) .attr(LowHpPowerAttr), new StatusMove(Moves.SPITE, Type.GHOST, 100, 10, -1, 0, 2) - .attr(ReducePpMoveAttr), + .attr(ReducePpMoveAttr, 4, true), new AttackMove(Moves.POWDER_SNOW, Type.ICE, MoveCategory.SPECIAL, 40, 100, 25, 10, 0, 2) .attr(StatusEffectAttr, StatusEffect.FREEZE) .target(MoveTarget.ALL_NEAR_ENEMIES), @@ -6078,7 +6104,7 @@ export function initMoves() { .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.EERIE_SPELL, Type.PSYCHIC, MoveCategory.SPECIAL, 80, 100, 5, 100, 0, 8) .soundBased() - .partial(), + .attr(ReducePpMoveAttr, 3, false), new AttackMove(Moves.DIRE_CLAW, Type.POISON, MoveCategory.PHYSICAL, 80, 100, 15, 50, 0, 8) .attr(MultiStatusEffectAttr, [StatusEffect.POISON, StatusEffect.PARALYSIS, StatusEffect.SLEEP]), new AttackMove(Moves.PSYSHIELD_BASH, Type.PSYCHIC, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8) diff --git a/src/data/pokemon-level-moves.ts b/src/data/pokemon-level-moves.ts index 0b545d1bd..ac123e4ff 100644 --- a/src/data/pokemon-level-moves.ts +++ b/src/data/pokemon-level-moves.ts @@ -15330,6 +15330,8 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [Species.LECHONK]: [ [ 1, Moves.TACKLE ], [ 1, Moves.TAIL_WHIP ], + [ 1, Moves.EERIE_SPELL ], + [ 1, Moves.SPITE ], [ 5, Moves.DISARMING_VOICE ], [ 8, Moves.ECHOED_VOICE ], [ 12, Moves.MUD_SHOT ], diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index d118adc0f..a5487a5cb 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -835,7 +835,7 @@ export function initSpecies() { new PokemonSpecies(Species.NIDORAN_F, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.4, 7, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 275, 55, 47, 52, 40, 40, 41, 235, 50, 55, GrowthRate.MEDIUM_SLOW, 0, false), new PokemonSpecies(Species.NIDORINA, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.8, 20, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 365, 70, 62, 67, 55, 55, 56, 120, 50, 128, GrowthRate.MEDIUM_SLOW, 0, false), new PokemonSpecies(Species.NIDOQUEEN, 1, false, false, false, "Drill Pokémon", Type.POISON, Type.GROUND, 1.3, 60, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.SHEER_FORCE, 505, 90, 92, 87, 75, 85, 76, 45, 50, 253, GrowthRate.MEDIUM_SLOW, 0, false), - new PokemonSpecies(Species.NIDORAN_M, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.5, 9, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 273, 46, 57, 40, 40, 40, 50, 235, 50, 55, GrowthRate.MEDIUM_SLOW, 100, false), + new PokemonSpecies(Species.NIDORAN_M, 1, false, false, false, "Poison Pin Pokémon", Type.PSYCHIC, null, 0.5, 9, Abilities.ICE_SCALES, Abilities.RIVALRY, Abilities.HUSTLE, 273, 46, 57, 40, 40, 40, 50, 235, 50, 55, GrowthRate.MEDIUM_SLOW, 100, false), new PokemonSpecies(Species.NIDORINO, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.9, 19.5, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 365, 61, 72, 57, 55, 55, 65, 120, 50, 128, GrowthRate.MEDIUM_SLOW, 100, false), new PokemonSpecies(Species.NIDOKING, 1, false, false, false, "Drill Pokémon", Type.POISON, Type.GROUND, 1.4, 62, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.SHEER_FORCE, 505, 81, 102, 77, 85, 75, 85, 45, 50, 253, GrowthRate.MEDIUM_SLOW, 100, false), new PokemonSpecies(Species.CLEFAIRY, 1, false, false, false, "Fairy Pokémon", Type.FAIRY, null, 0.6, 7.5, Abilities.CUTE_CHARM, Abilities.MAGIC_GUARD, Abilities.FRIEND_GUARD, 323, 70, 45, 48, 60, 65, 35, 150, 140, 113, GrowthRate.FAST, 25, false), diff --git a/src/phases.ts b/src/phases.ts index 3d80b22eb..b3b981f23 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -899,7 +899,7 @@ export class EncounterPhase extends BattlePhase { if (this.scene.currentBattle.battleType !== BattleType.TRAINER) { enemyField.map(p => this.scene.pushPhase(new PostSummonPhase(this.scene, p.getBattlerIndex()))); const ivScannerModifier = this.scene.findModifier(m => m instanceof IvScannerModifier); - if (ivScannerModifier) + if (ivScannerModifier && !this.scene.disableIVScanner) enemyField.map(p => this.scene.pushPhase(new ScanIvsPhase(this.scene, p.getBattlerIndex(), Math.min(ivScannerModifier.getStackCount() * 2, 6)))); } diff --git a/src/system/settings.ts b/src/system/settings.ts index df4f894c9..2276d9eb7 100644 --- a/src/system/settings.ts +++ b/src/system/settings.ts @@ -20,6 +20,7 @@ export enum Setting { Sprite_Set = "SPRITE_SET", Move_Animations = "MOVE_ANIMATIONS", Show_Stats_on_Level_Up = "SHOW_LEVEL_UP_STATS", + Disable_IV_Scanner = "DISABLE_IV_SCANNER", EXP_Gains_Speed = "EXP_GAINS_SPEED", HP_Bar_Speed = "HP_BAR_SPEED", Fusion_Palette_Swaps = "FUSION_PALETTE_SWAPS", @@ -51,6 +52,7 @@ export const settingOptions: SettingOptions = { [Setting.Sprite_Set]: [ 'Consistent', 'Mixed Animated' ], [Setting.Move_Animations]: [ 'Off', 'On' ], [Setting.Show_Stats_on_Level_Up]: [ 'Off', 'On' ], + [Setting.Disable_IV_Scanner]: [ 'On', 'Off' ], [Setting.EXP_Gains_Speed]: [ 'Normal', 'Fast', 'Faster', 'Skip' ], [Setting.HP_Bar_Speed]: [ 'Normal', 'Fast', 'Faster', 'Instant' ], [Setting.Fusion_Palette_Swaps]: [ 'Off', 'On' ], @@ -74,6 +76,7 @@ export const settingDefaults: SettingDefaults = { [Setting.Sprite_Set]: 0, [Setting.Move_Animations]: 1, [Setting.Show_Stats_on_Level_Up]: 1, + [Setting.Disable_IV_Scanner]: 1, [Setting.EXP_Gains_Speed]: 0, [Setting.HP_Bar_Speed]: 0, [Setting.Fusion_Palette_Swaps]: 1, @@ -128,6 +131,9 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer) case Setting.Show_Stats_on_Level_Up: scene.showLevelUpStats = settingOptions[setting][value] === 'On'; break; + case Setting.Disable_IV_Scanner: + scene.disableIVScanner = settingOptions[setting][value] === 'On'; + break; case Setting.EXP_Gains_Speed: scene.expGainsSpeed = value; break;