From e4b8bffdec119ff18a8127ada3db5f564d96ed42 Mon Sep 17 00:00:00 2001 From: Madi Simpson Date: Sun, 5 May 2024 07:41:42 -0700 Subject: [PATCH] stat change phase: only display comma before and if there are 3 or more stats --- src/phases.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phases.ts b/src/phases.ts index 6f1ebc261..7ae30f0a8 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -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)}!`));