Apply suggestions from code review

Co-authored-by: ImperialSympathizer <110984302+ben-lear@users.noreply.github.com>
This commit is contained in:
Enoch 2024-09-26 02:43:45 +09:00 committed by GitHub
parent 9d4a352f3d
commit f9da29b21b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -127,7 +127,7 @@ export const BerriesAboundEncounter: MysteryEncounter =
const encounter = scene.currentBattle.mysteryEncounter!; const encounter = scene.currentBattle.mysteryEncounter!;
const numBerries = encounter.misc.numBerries; const numBerries = encounter.misc.numBerries;
const doBerryRewards = async () => { const doBerryRewards = () => {
const berryText = i18next.t(`${namespace}.berries`); const berryText = i18next.t(`${namespace}.berries`);
scene.playSound("item_fanfare"); scene.playSound("item_fanfare");
@ -178,7 +178,7 @@ export const BerriesAboundEncounter: MysteryEncounter =
if (speedDiff < 1) { if (speedDiff < 1) {
// Caught and attacked by boss, gets +1 to all stats at start of fight // Caught and attacked by boss, gets +1 to all stats at start of fight
const doBerryRewards = async () => { const doBerryRewards = () => {
const berryText = i18next.t(`${namespace}.berries`); const berryText = i18next.t(`${namespace}.berries`);
scene.playSound("item_fanfare"); scene.playSound("item_fanfare");
@ -209,7 +209,7 @@ export const BerriesAboundEncounter: MysteryEncounter =
// Gains 1 berry for every 10% faster the player's pokemon is than the enemy, up to a max of numBerries, minimum of 2 // Gains 1 berry for every 10% faster the player's pokemon is than the enemy, up to a max of numBerries, minimum of 2
const numBerriesGrabbed = Math.max(Math.min(Math.round((speedDiff - 1)/0.08), numBerries), 2); const numBerriesGrabbed = Math.max(Math.min(Math.round((speedDiff - 1)/0.08), numBerries), 2);
encounter.setDialogueToken("numBerries", String(numBerriesGrabbed)); encounter.setDialogueToken("numBerries", String(numBerriesGrabbed));
const doFasterBerryRewards = async () => { const doFasterBerryRewards = () => {
const berryText = i18next.t(`${namespace}.berries`); const berryText = i18next.t(`${namespace}.berries`);
scene.playSound("item_fanfare"); scene.playSound("item_fanfare");