stat change phase: only display comma before and if there are 3 or more stats

This commit is contained in:
Madi Simpson 2024-05-05 07:41:42 -07:00 committed by Samuel H
parent b076dec346
commit e4b8bffdec
1 changed files with 1 additions and 1 deletions

View File

@ -2839,7 +2839,7 @@ export class StatChangePhase extends PokemonPhase {
if (relLevelStats.length > 1) {
statsFragment = relLevelStats.length >= 5
? 'stats'
: `${relLevelStats.slice(0, -1).map(s => getBattleStatName(s)).join(', ')}, and ${getBattleStatName(relLevelStats[relLevelStats.length - 1])}`;
: `${relLevelStats.slice(0, -1).map(s => getBattleStatName(s)).join(', ')}${relLevelStats.length > 2 ? ',' : ''} and ${getBattleStatName(relLevelStats[relLevelStats.length - 1])}`;
} else
statsFragment = getBattleStatName(relLevelStats[0]);
messages.push(getPokemonMessage(this.getPokemon(), `'s ${statsFragment} ${getBattleStatLevelChangeDescription(Math.abs(parseInt(rl)), levels >= 1)}!`));