mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +02:00
bugfix: allow mystery encounter part timer rewards to account for amulet coin
This commit is contained in:
parent
ff6f9131ae
commit
95025f315a
@ -22,6 +22,8 @@ import type { PlayerPokemon } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||
import { isPokemonValidForEncounterOptionSelection } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||
import { MoneyMultiplierModifier } from "#app/modifier/modifier";
|
||||
import * as Utils from "#app/utils";
|
||||
|
||||
/** the i18n namespace for the encounter */
|
||||
const namespace = "mysteryEncounters/partTimer";
|
||||
@ -147,13 +149,9 @@ export const PartTimerEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
||||
} else {
|
||||
await showEncounterDialogue(`${namespace}:job_complete_bad`, `${namespace}:speaker`);
|
||||
}
|
||||
const moneyChange = globalScene.getWaveMoneyAmount(moneyMultiplier);
|
||||
updatePlayerMoney(moneyChange, true, false);
|
||||
await showEncounterText(
|
||||
i18next.t("mysteryEncounterMessages:receive_money", {
|
||||
amount: moneyChange,
|
||||
}),
|
||||
);
|
||||
|
||||
const formattedMoneyAmount = applyMoneyMultipliers(moneyMultiplier);
|
||||
await showEncounterText(i18next.t("mysteryEncounterMessages:receive_money", { amount: formattedMoneyAmount }));
|
||||
await showEncounterText(`${namespace}:pokemon_tired`);
|
||||
|
||||
setEncounterRewards({ fillRemaining: true });
|
||||
@ -229,13 +227,9 @@ export const PartTimerEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
||||
} else {
|
||||
await showEncounterDialogue(`${namespace}:job_complete_bad`, `${namespace}:speaker`);
|
||||
}
|
||||
const moneyChange = globalScene.getWaveMoneyAmount(moneyMultiplier);
|
||||
updatePlayerMoney(moneyChange, true, false);
|
||||
await showEncounterText(
|
||||
i18next.t("mysteryEncounterMessages:receive_money", {
|
||||
amount: moneyChange,
|
||||
}),
|
||||
);
|
||||
|
||||
const formattedMoneyAmount = applyMoneyMultipliers(moneyMultiplier);
|
||||
await showEncounterText(i18next.t("mysteryEncounterMessages:receive_money", { amount: formattedMoneyAmount }));
|
||||
await showEncounterText(`${namespace}:pokemon_tired`);
|
||||
|
||||
setEncounterRewards({ fillRemaining: true });
|
||||
@ -282,16 +276,12 @@ export const PartTimerEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
||||
// Bring visuals back in
|
||||
await transitionMysteryEncounterIntroVisuals(false, false);
|
||||
|
||||
// Give money and do dialogue
|
||||
await showEncounterDialogue(`${namespace}:job_complete_good`, `${namespace}:speaker`);
|
||||
const moneyChange = globalScene.getWaveMoneyAmount(2.5);
|
||||
updatePlayerMoney(moneyChange, true, false);
|
||||
await showEncounterText(
|
||||
i18next.t("mysteryEncounterMessages:receive_money", {
|
||||
amount: moneyChange,
|
||||
}),
|
||||
);
|
||||
await showEncounterText(`${namespace}:pokemon_tired`);
|
||||
// Give money and do dialogue
|
||||
await showEncounterDialogue(`${namespace}:job_complete_good`, `${namespace}:speaker`);
|
||||
|
||||
const formattedMoneyAmount = applyMoneyMultipliers(2.5);
|
||||
await showEncounterText(i18next.t("mysteryEncounterMessages:receive_money", { amount: formattedMoneyAmount }));
|
||||
await showEncounterText(`${namespace}:pokemon_tired`);
|
||||
|
||||
setEncounterRewards({ fillRemaining: true });
|
||||
leaveEncounterWithoutBattle();
|
||||
@ -354,3 +344,14 @@ function doSalesSfx() {
|
||||
globalScene.playSound("battle_anims/PRSFX- Attract2");
|
||||
});
|
||||
}
|
||||
|
||||
function applyMoneyMultipliers(moneyMultiplier) {
|
||||
const moneyChange = new Utils.IntegerHolder(globalScene.getWaveMoneyAmount(moneyMultiplier));
|
||||
globalScene.applyModifiers(MoneyMultiplierModifier, true, moneyChange);
|
||||
updatePlayerMoney(moneyChange.value, true, false);
|
||||
|
||||
const userLocale = navigator.language || "en-US";
|
||||
const formattedMoneyAmount = moneyChange.value.toLocaleString(userLocale);
|
||||
|
||||
return formattedMoneyAmount;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user