From ed8d162125e87f7942a39a8ab8f7684948af0140 Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Fri, 21 Feb 2025 10:50:39 +1100 Subject: [PATCH] [Balance] Make stat a much larger factor in moveset gen #5383 --- src/field/pokemon.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 714f1ec7026..246f82b8164 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2348,12 +2348,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const maxPower = Math.min(movePool.reduce((v, m) => Math.max(allMoves[m[0]].power, v), 40), 90); movePool = movePool.map(m => [ m[0], m[1] * (allMoves[m[0]].category === MoveCategory.STATUS ? 1 : Math.max(Math.min(allMoves[m[0]].power / maxPower, 1), 0.5)) ]); - // Weight damaging moves against the lower stat + // Weight damaging moves against the lower stat. This uses a non-linear relationship. + // If the higher stat is 1 - 1.09x higher, no change. At higher stat ~1.38x lower stat, off-stat moves have half weight. + // One third weight at ~1.58x higher, one quarter weight at ~1.73x higher, one fifth at ~1.87x, and one tenth at ~2.35x higher. const atk = this.getStat(Stat.ATK); const spAtk = this.getStat(Stat.SPATK); const worseCategory: MoveCategory = atk > spAtk ? MoveCategory.SPECIAL : MoveCategory.PHYSICAL; const statRatio = worseCategory === MoveCategory.PHYSICAL ? atk / spAtk : spAtk / atk; - movePool = movePool.map(m => [ m[0], m[1] * (allMoves[m[0]].category === worseCategory ? statRatio : 1) ]); + movePool = movePool.map(m => [ m[0], m[1] * (allMoves[m[0]].category === worseCategory ? Math.min(Math.pow(statRatio, 3) * 1.3, 1) : 1) ]); /** The higher this is the more the game weights towards higher level moves. At `0` all moves are equal weight. */ let weightMultiplier = 0.9;