mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-27 03: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 type Pokemon from "#app/field/pokemon";
|
||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||||
import { isPokemonValidForEncounterOptionSelection } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
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 */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounters/partTimer";
|
const namespace = "mysteryEncounters/partTimer";
|
||||||
@ -147,13 +149,9 @@ export const PartTimerEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
} else {
|
} else {
|
||||||
await showEncounterDialogue(`${namespace}:job_complete_bad`, `${namespace}:speaker`);
|
await showEncounterDialogue(`${namespace}:job_complete_bad`, `${namespace}:speaker`);
|
||||||
}
|
}
|
||||||
const moneyChange = globalScene.getWaveMoneyAmount(moneyMultiplier);
|
|
||||||
updatePlayerMoney(moneyChange, true, false);
|
const formattedMoneyAmount = applyMoneyMultipliers(moneyMultiplier);
|
||||||
await showEncounterText(
|
await showEncounterText(i18next.t("mysteryEncounterMessages:receive_money", { amount: formattedMoneyAmount }));
|
||||||
i18next.t("mysteryEncounterMessages:receive_money", {
|
|
||||||
amount: moneyChange,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
await showEncounterText(`${namespace}:pokemon_tired`);
|
await showEncounterText(`${namespace}:pokemon_tired`);
|
||||||
|
|
||||||
setEncounterRewards({ fillRemaining: true });
|
setEncounterRewards({ fillRemaining: true });
|
||||||
@ -229,13 +227,9 @@ export const PartTimerEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
} else {
|
} else {
|
||||||
await showEncounterDialogue(`${namespace}:job_complete_bad`, `${namespace}:speaker`);
|
await showEncounterDialogue(`${namespace}:job_complete_bad`, `${namespace}:speaker`);
|
||||||
}
|
}
|
||||||
const moneyChange = globalScene.getWaveMoneyAmount(moneyMultiplier);
|
|
||||||
updatePlayerMoney(moneyChange, true, false);
|
const formattedMoneyAmount = applyMoneyMultipliers(moneyMultiplier);
|
||||||
await showEncounterText(
|
await showEncounterText(i18next.t("mysteryEncounterMessages:receive_money", { amount: formattedMoneyAmount }));
|
||||||
i18next.t("mysteryEncounterMessages:receive_money", {
|
|
||||||
amount: moneyChange,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
await showEncounterText(`${namespace}:pokemon_tired`);
|
await showEncounterText(`${namespace}:pokemon_tired`);
|
||||||
|
|
||||||
setEncounterRewards({ fillRemaining: true });
|
setEncounterRewards({ fillRemaining: true });
|
||||||
@ -282,16 +276,12 @@ export const PartTimerEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
// Bring visuals back in
|
// Bring visuals back in
|
||||||
await transitionMysteryEncounterIntroVisuals(false, false);
|
await transitionMysteryEncounterIntroVisuals(false, false);
|
||||||
|
|
||||||
// Give money and do dialogue
|
// Give money and do dialogue
|
||||||
await showEncounterDialogue(`${namespace}:job_complete_good`, `${namespace}:speaker`);
|
await showEncounterDialogue(`${namespace}:job_complete_good`, `${namespace}:speaker`);
|
||||||
const moneyChange = globalScene.getWaveMoneyAmount(2.5);
|
|
||||||
updatePlayerMoney(moneyChange, true, false);
|
const formattedMoneyAmount = applyMoneyMultipliers(2.5);
|
||||||
await showEncounterText(
|
await showEncounterText(i18next.t("mysteryEncounterMessages:receive_money", { amount: formattedMoneyAmount }));
|
||||||
i18next.t("mysteryEncounterMessages:receive_money", {
|
await showEncounterText(`${namespace}:pokemon_tired`);
|
||||||
amount: moneyChange,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
await showEncounterText(`${namespace}:pokemon_tired`);
|
|
||||||
|
|
||||||
setEncounterRewards({ fillRemaining: true });
|
setEncounterRewards({ fillRemaining: true });
|
||||||
leaveEncounterWithoutBattle();
|
leaveEncounterWithoutBattle();
|
||||||
@ -354,3 +344,14 @@ function doSalesSfx() {
|
|||||||
globalScene.playSound("battle_anims/PRSFX- Attract2");
|
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