diff --git a/src/battle-scene.ts b/src/battle-scene.ts index dc22ba71d14..d8aac67c7fc 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1126,12 +1126,10 @@ export default class BattleScene extends Phaser.Scene { this.ui?.achvBar.setY((this.game.canvas.height / 6 + this.moneyText.y + 15)); } - getMaxExpLevel(ignoreLevelCap?: boolean): integer { - if (ignoreLevelCap) - return 10000; + getMaxExpLevel(): integer { const lastWaveIndex = Math.ceil((this.currentBattle?.waveIndex || 1) / 10) * 10; const baseLevel = (1 + lastWaveIndex / 2 + Math.pow(lastWaveIndex / 25, 2)) * 1.2; - return Math.min(Math.ceil(baseLevel / 2) * 2 + 2, 10000); + return Math.ceil(baseLevel / 2) * 2 + 2; } randomSpecies(waveIndex: integer, level: integer, fromArenaPool?: boolean, speciesFilter?: PokemonSpeciesFilter, filterAllEvolutions?: boolean): PokemonSpecies { diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index ae62e989a77..dad2b58b64c 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -1080,7 +1080,7 @@ export class PokemonLevelIncrementModifier extends ConsumablePokemonModifier { pokemon.scene.applyModifiers(LevelIncrementBoosterModifier, true, levelCount); pokemon.level += levelCount.value; - if (pokemon.level <= pokemon.scene.getMaxExpLevel(true)) { + if (pokemon.level <= pokemon.scene.getMaxExpLevel()) { pokemon.exp = getLevelTotalExp(pokemon.level, pokemon.species.growthRate); pokemon.levelExp = 0; } diff --git a/src/pokemon.ts b/src/pokemon.ts index 9cb4f4beee6..1a0cc34dc54 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -542,7 +542,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { let baseStat = baseStats[s]; let value = Math.floor(((2 * baseStat + this.ivs[s]) * this.level) * 0.01); if (isHp) { - value = Math.min(value + this.level + 10, 99999); + value = value + this.level + 10; if (this.getAbility().hasAttr(NonSuperEffectiveImmunityAbAttr)) value = 1; if (this.hp > value || this.hp === undefined) @@ -558,7 +558,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.scene.applyModifier(PokemonNatureWeightModifier, this.isPlayer(), this, natureStatMultiplier); if (natureStatMultiplier.value !== 1) value = Math.max(Math[natureStatMultiplier.value > 1 ? 'ceil' : 'floor'](value * natureStatMultiplier.value), 1); - value = Math.min(value, 99999); } this.stats[s] = value; } diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index 2d46edad6b1..672a62e6c91 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -378,7 +378,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container { const relLevelExp = getLevelRelExp(this.lastLevel + 1, pokemon.species.growthRate); const levelExp = levelUp ? relLevelExp : pokemon.levelExp; let ratio = relLevelExp ? levelExp / relLevelExp : 0; - if (this.lastLevel >= (this.scene as BattleScene).getMaxExpLevel(true)) { + if (this.lastLevel >= (this.scene as BattleScene).getMaxExpLevel()) { if (levelUp) ratio = 1; else diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index c6d2a65ab6e..e8923d93c47 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -570,8 +570,8 @@ export default class SummaryUiHandler extends UiHandler { statsContainer.add(statLabel); const statValueText = stat !== Stat.HP - ? this.pokemon.stats[s].toString() - : `${this.pokemon.hp}/${this.pokemon.getMaxHp()}`; + ? Utils.formatStat(this.pokemon.stats[s]) + : `${Utils.formatStat(this.pokemon.hp, true)}/${Utils.formatStat(this.pokemon.getMaxHp(), true)}`; const statValue = addTextObject(this.scene, 120 + 88 * colIndex, 56 + 16 * rowIndex, statValueText, TextStyle.WINDOW); statValue.setOrigin(1, 0); diff --git a/src/utils.ts b/src/utils.ts index c4876eabcd9..d7dff840d0f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -139,6 +139,29 @@ export function decToBin(input: integer): string { return bin; } +export function formatStat(stat: integer, forHp: boolean = false): string { + if (stat < (forHp ? 100000 : 1000000)) + return stat.toString(); + let ret = stat.toString(); + let suffix = ''; + switch (Math.ceil(ret.length / 3) - 1) { + case 1: + suffix = 'K'; + break; + case 2: + suffix = 'M'; + break; + case 3: + suffix = 'B'; + break; + default: + return '?'; + } + const digits = ((ret.length + 2) % 3) + 1; + const decimalNumber = parseInt(ret.slice(digits, digits + (3 - digits))); + return `${ret.slice(0, digits)}${decimalNumber ? `.${decimalNumber}` : ''}${suffix}`; +} + export function getEnumKeys(enumType): string[] { return Object.values(enumType).filter(v => isNaN(parseInt(v.toString()))).map(v => v.toString()); }