From 0beb3a0f8956bba93e6ff2611ef6dbc68fca3b19 Mon Sep 17 00:00:00 2001 From: Alvin Zou <59787978+happinyz@users.noreply.github.com> Date: Mon, 6 May 2024 19:43:01 -0700 Subject: [PATCH] Show number of Pokeballs in inventory when selecting a pokeball in the reward phase (#573) * Show number of Pokeballs in inventory when selecting a pokeball in the reward phase * Address comments --- src/modifier/modifier-type.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 2e18cd917..45cdd9c4c 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -144,9 +144,16 @@ class AddPokeballModifierType extends ModifierType implements Localizable { } localize(): void { + // TODO: Actually use i18n to localize this description. this.name = `${this.count}x ${getPokeballName(this.pokeballType)}`; - this.description = `Receive ${getPokeballName(this.pokeballType)} x${this.count}\nCatch Rate: ${getPokeballCatchMultiplier(this.pokeballType) > -1 ? `${getPokeballCatchMultiplier(this.pokeballType)}x` : 'Certain'}`; + this.description = `Receive ${getPokeballName(this.pokeballType)} x${this.count} (Inventory: {AMOUNT}) \nCatch Rate: ${getPokeballCatchMultiplier(this.pokeballType) > -1 ? `${getPokeballCatchMultiplier(this.pokeballType)}x` : 'Certain'}`; } + + getDescription(scene: BattleScene): string { + this.localize(); + return this.description.replace('{AMOUNT}', scene.pokeballCounts[this.pokeballType].toString()); + } + } class AddVoucherModifierType extends ModifierType {