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
pull/583/head
Alvin Zou 2024-05-06 19:43:01 -07:00 committed by GitHub
parent f18ff5b6cc
commit 0beb3a0f89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -144,9 +144,16 @@ class AddPokeballModifierType extends ModifierType implements Localizable {
} }
localize(): void { localize(): void {
// TODO: Actually use i18n to localize this description.
this.name = `${this.count}x ${getPokeballName(this.pokeballType)}`; 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 { class AddVoucherModifierType extends ModifierType {