Skip to content

Commit 89f6629

Browse files
authored
feat!: Hotfix 1.11.8 to main (#7062)
* update submodules * test: disable Roost test due to broken interaction * chore: update `markdown-it` sub-dep * github: add "beta" scope for "fix" prefix (#7058) * refactor: clean up `updatePlayerMoney` in `encounter-phase-utils.ts` #7057 * chore!: update version to 1.11.8 * fix(encounter): "The Pokemon Salesman" ME won't pick invalid Pokemon #7060 Non-starter Pokemon will be filtered out of the event Pokemon pool before being passed to the ME * chore: update submodules --------- Co-authored-by: damocleas <damocleas25@gmail.com>
2 parents 14eb17a + f12cf8f commit 89f6629

File tree

9 files changed

+43
-37
lines changed

9 files changed

+43
-37
lines changed

.github/scripts/pr-title.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ const PREFIX_SCOPE_MAP = {
6161
test: ALL_SCOPES,
6262
} as const satisfies Record<Prefixes, readonly AllScopes[]>;
6363

64+
// @ts-expect-error: Add special scope for fixing bugs that only existed on the beta branch
65+
PREFIX_SCOPE_MAP.fix = [...ALL_SCOPES, "beta"];
66+
6467
async function run(): Promise<void> {
6568
try {
6669
const authToken = core.getInput("github_token", { required: true });

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,6 @@ Try to keep the title under 72 characters, as GitHub cuts off commit titles long
226226
> All scopes are valid when using the "docs", "feat", "fix", "refactor" and "test" prefixes. \
227227
> All scopes except "audio", "battle", "graphics", and "ui" are valid when using the "balance" prefix. \
228228
> No other prefixes have valid scopes.
229+
>
230+
> There is a special "beta" scope for the "fix" prefix,
231+
> for fixing bugs that only existed on the `beta` branch that never made it onto `main`.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pokemon-rogue-battle",
33
"private": true,
4-
"version": "1.11.7",
4+
"version": "1.11.8",
55
"type": "module",
66
"scripts": {
77
"start:prod": "vite --mode production",

pnpm-lock.yaml

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ onlyBuiltDependencies:
77
- msw
88

99
overrides:
10+
markdown-it@>=13.0.0 <14.1.1: '>=14.1.1'
1011
undici@<6.23.0: '>=6.23.0'
1112

1213
shellEmulator: true

src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,22 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter = MysteryEncounterBui
9494
false,
9595
false,
9696
false,
97-
s => !NON_LEGEND_PARADOX_POKEMON.includes(s.speciesId) && !NON_LEGEND_ULTRA_BEASTS.includes(s.speciesId),
97+
s =>
98+
!NON_LEGEND_PARADOX_POKEMON.includes(s.speciesId)
99+
&& !NON_LEGEND_ULTRA_BEASTS.includes(s.speciesId)
100+
&& Object.keys(speciesStarterCosts) // The event expects the chosen pokemon to be a valid starter,
101+
.map(sId => Number.parseInt(sId)) // and will break if a non-starter is chosen
102+
.includes(s.speciesId),
98103
);
99104

100105
let pokemon: PlayerPokemon;
101-
/**
106+
/*
102107
* Mon is determined as follows:
103-
* If you roll the 1% for Shiny Magikarp, you get Magikarp with a random variant
104-
* If an event with more than 1 valid event encounter species is active, you have 20% chance to get one of those
105-
* If the rolled species has no HA, and there are valid event encounters, you will get one of those
106-
* If the rolled species has no HA and there are no valid event encounters, you will get Shiny Magikarp
108+
* - If you roll the 1% for Shiny Magikarp, you get Magikarp with a random variant
109+
* - If an event with more than 1 valid event encounter species is active, you have 20% chance to get one of those
110+
* - If the rolled species has no HA, and there are valid event encounters, you will get one of those
111+
* - If the rolled species has no HA and there are no valid event encounters, you will get Shiny Magikarp
112+
*
107113
* Mons rolled from the event encounter pool get 3 extra shiny rolls
108114
*/
109115
if (

src/data/mystery-encounters/utils/encounter-phase-utils.ts

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -463,36 +463,28 @@ export async function loadCustomMovesForEncounter(moves: MoveId | MoveId[]): Pro
463463
}
464464

465465
/**
466-
* Will update player money, and animate change (sound optional)
467-
* @param changeValue
468-
* @param playSound
469-
* @param showMessage
466+
* @param moneyAmount - The amount of money being added; negative values remove money
467+
* @param playSound - (Default `true`) Whether to play a sound afterward
468+
* @param showMessage - (Default `true`) Whether to show a message afterward
470469
*/
471-
export function updatePlayerMoney(changeValue: number, playSound = true, showMessage = true): void {
472-
globalScene.money = Math.min(Math.max(globalScene.money + changeValue, 0), Number.MAX_SAFE_INTEGER);
470+
export function updatePlayerMoney(moneyAmount: number, playSound = true, showMessage = true): void {
471+
globalScene.money = Phaser.Math.Clamp(globalScene.money + moneyAmount, 0, Number.MAX_SAFE_INTEGER);
473472
globalScene.updateMoneyText();
474-
globalScene.animateMoneyChanged(false);
473+
const isIncrease = moneyAmount >= 0;
474+
globalScene.animateMoneyChanged(isIncrease);
475+
475476
if (playSound) {
476477
globalScene.playSound("se/buy");
477478
}
479+
478480
if (showMessage) {
479-
if (changeValue < 0) {
480-
globalScene.phaseManager.queueMessage(
481-
i18next.t("mysteryEncounterMessages:paidMoney", {
482-
amount: -changeValue,
483-
}),
484-
null,
485-
true,
486-
);
487-
} else {
488-
globalScene.phaseManager.queueMessage(
489-
i18next.t("mysteryEncounterMessages:receiveMoney", {
490-
amount: changeValue,
491-
}),
492-
null,
493-
true,
494-
);
495-
}
481+
const i18nKey = isIncrease ? "receive" : "paid";
482+
const amount = isIncrease ? moneyAmount : -moneyAmount;
483+
globalScene.phaseManager.queueMessage(
484+
i18next.t(`mysteryEncounterMessages:${i18nKey}Money`, { amount }),
485+
null,
486+
true,
487+
);
496488
}
497489
}
498490

0 commit comments

Comments
 (0)