Merge branch 'beta' into quash

This commit is contained in:
Dean 2025-01-07 20:07:54 -08:00 committed by GitHub
commit 054bd031ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 59 additions and 32 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "pokemon-rogue-battle",
"version": "1.4.1",
"version": "1.4.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "pokemon-rogue-battle",
"version": "1.4.1",
"version": "1.4.3",
"hasInstallScript": true,
"dependencies": {
"@material/material-color-utilities": "^0.2.7",

View File

@ -1,7 +1,7 @@
{
"name": "pokemon-rogue-battle",
"private": true,
"version": "1.4.1",
"version": "1.4.3",
"type": "module",
"scripts": {
"start": "vite",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -4,6 +4,7 @@
"3f4447": "466698",
"de3431": "3fca9f",
"f8f8f8": "a1e9f0",
"f4f4f4": "d7eff4",
"7b282e": "0e3e81",
"6b1d1d": "206d74",
"4ebdd9": "41a7b0",
@ -11,7 +12,7 @@
"bfbfbf": "8cc7d4",
"ffb2bf": "b7e9ff",
"bf4c60": "4386df",
"fff0a6": "271f4c",
"fff0a6": "208698",
"3e7acc": "6b4592",
"18335c": "170738",
"f2798d": "8dcfff",
@ -25,6 +26,7 @@
"3f4447": "466698",
"de3431": "9ceec6",
"f8f8f8": "89d2b8",
"f4f4f4": "d7eff4",
"7b282e": "152a5c",
"6b1d1d": "356e8d",
"4ebdd9": "2f6e74",

View File

@ -4,6 +4,7 @@
"3f4447": "466698",
"de3431": "3fca9f",
"f8f8f8": "a1e9f0",
"f4f4f4": "d7effa",
"7b282e": "0e3e81",
"6b1d1d": "206d74",
"4ebdd9": "41a7b0",
@ -25,6 +26,7 @@
"3f4447": "466698",
"de3431": "9ceec6",
"f8f8f8": "89d2b8",
"f4f4f4": "d7effa",
"7b282e": "152a5c",
"6b1d1d": "356e8d",
"4ebdd9": "2f6e74",

@ -1 +1 @@
Subproject commit 6c6f0af398ae11f8d96c6ac064f171d927812c85
Subproject commit 2e03bc8f2736269bfa365faad587c3ec54a37621

View File

@ -147,6 +147,7 @@ export default class BattleScene extends SceneBase {
public damageNumbersMode: integer = 0;
public reroll: boolean = false;
public shopCursorTarget: number = ShopCursorTarget.REWARDS;
public commandCursorMemory: boolean = false;
public showMovesetFlyout: boolean = true;
public showArenaFlyout: boolean = true;
public showTimeOfDayWidget: boolean = true;
@ -173,7 +174,7 @@ export default class BattleScene extends SceneBase {
public uiTheme: UiTheme = UiTheme.DEFAULT;
public windowType: integer = 0;
public experimentalSprites: boolean = false;
public musicPreference: number = MusicPreference.MIXED;
public musicPreference: number = MusicPreference.ALLGENS;
public moveAnimations: boolean = true;
public expGainsSpeed: ExpGainsSpeed = ExpGainsSpeed.DEFAULT;
public skipSeenDialogues: boolean = false;
@ -1423,6 +1424,8 @@ export default class BattleScene extends SceneBase {
return 0;
}
const isEggPhase: boolean = [ "EggLapsePhase", "EggHatchPhase" ].includes(this.getCurrentPhase()?.constructor.name ?? "");
switch (species.speciesId) {
case Species.UNOWN:
case Species.SHELLOS:
@ -1454,7 +1457,7 @@ export default class BattleScene extends SceneBase {
}
return Utils.randSeedInt(8);
case Species.EEVEE:
if (this.currentBattle?.battleType === BattleType.TRAINER && this.currentBattle?.waveIndex < 30) {
if (this.currentBattle?.battleType === BattleType.TRAINER && this.currentBattle?.waveIndex < 30 && !isEggPhase) {
return 0; // No Partner Eevee for Wave 12 Preschoolers
}
return Utils.randSeedInt(2);
@ -1482,7 +1485,7 @@ export default class BattleScene extends SceneBase {
return 0;
case Species.GIMMIGHOUL:
// Chest form can only be found in Mysterious Chest Encounter, if this is a game mode with MEs
if (this.gameMode.hasMysteryEncounters) {
if (this.gameMode.hasMysteryEncounters && !isEggPhase) {
return 1; // Wandering form
} else {
return Utils.randSeedInt(species.forms.length);

View File

@ -222,7 +222,7 @@ export default class Battle {
if (!this.started && this.trainer?.config.encounterBgm && this.trainer?.getEncounterMessages()?.length) {
return `encounter_${this.trainer?.getEncounterBgm()}`;
}
if (scene.musicPreference === MusicPreference.CONSISTENT) {
if (scene.musicPreference === MusicPreference.GENFIVE) {
return this.trainer?.getBattleBgm() ?? null;
} else {
return this.trainer?.getMixedBattleBgm() ?? null;
@ -239,7 +239,7 @@ export default class Battle {
return "battle_final_encounter";
}
if (pokemon.species.legendary || pokemon.species.subLegendary || pokemon.species.mythical) {
if (scene.musicPreference === MusicPreference.CONSISTENT) {
if (scene.musicPreference === MusicPreference.GENFIVE) {
switch (pokemon.species.speciesId) {
case Species.REGIROCK:
case Species.REGICE:
@ -256,7 +256,7 @@ export default class Battle {
}
return "battle_legendary_unova";
}
} else if (scene.musicPreference === MusicPreference.MIXED) {
} else if (scene.musicPreference === MusicPreference.ALLGENS) {
switch (pokemon.species.speciesId) {
case Species.ARTICUNO:
case Species.ZAPDOS:

View File

@ -4,7 +4,7 @@ export const POKERUS_STARTER_COUNT = 5;
// #region Friendship constants
export const CLASSIC_CANDY_FRIENDSHIP_MULTIPLIER = 3;
export const FRIENDSHIP_GAIN_FROM_BATTLE = 4;
export const FRIENDSHIP_GAIN_FROM_BATTLE = 3;
export const FRIENDSHIP_GAIN_FROM_RARE_CANDY = 6;
export const FRIENDSHIP_LOSS_FROM_FAINT = 5;

View File

@ -34,7 +34,7 @@ const OPTION_3_DISALLOWED_MODIFIERS = [
"PokemonBaseStatTotalModifier"
];
const DELIBIRDY_MONEY_PRICE_MULTIPLIER = 1.5;
const DELIBIRDY_MONEY_PRICE_MULTIPLIER = 2;
const doEventReward = (scene: BattleScene) => {
const event_buff = scene.eventManager.activeEvent()?.delibirdyBuff ?? [];
@ -60,8 +60,7 @@ const doEventReward = (scene: BattleScene) => {
*/
export const DelibirdyEncounter: MysteryEncounter =
MysteryEncounterBuilder.withEncounterType(MysteryEncounterType.DELIBIRDY)
.withMaxAllowedEncounters(4)
.withEncounterTier(MysteryEncounterTier.COMMON) //Change back after event!
.withEncounterTier(MysteryEncounterTier.GREAT)
.withSceneWaveRangeRequirement(...CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES)
.withSceneRequirement(new MoneyRequirement(0, DELIBIRDY_MONEY_PRICE_MULTIPLIER)) // Must have enough money for it to spawn at the very least
.withPrimaryPokemonRequirement(

View File

@ -107,7 +107,7 @@ export const GlobalTradeSystemEncounter: MysteryEncounter =
// Load bgm
let bgmKey: string;
if (scene.musicPreference === MusicPreference.CONSISTENT) {
if (scene.musicPreference === MusicPreference.GENFIVE) {
bgmKey = "mystery_encounter_gen_5_gts";
scene.loadBgm(bgmKey, `${bgmKey}.mp3`);
} else {

View File

@ -177,7 +177,7 @@ export const allMysteryEncounters: { [encounterType: number]: MysteryEncounter }
const extremeBiomeEncounters: MysteryEncounterType[] = [];
const nonExtremeBiomeEncounters: MysteryEncounterType[] = [
// MysteryEncounterType.FIELD_TRIP, Disabled for holiday event
// MysteryEncounterType.FIELD_TRIP, Disabled
MysteryEncounterType.DANCING_LESSONS, // Is also in BADLANDS, DESERT, VOLCANO, WASTELAND, ABYSS
];
@ -185,14 +185,14 @@ const humanTransitableBiomeEncounters: MysteryEncounterType[] = [
MysteryEncounterType.MYSTERIOUS_CHALLENGERS,
MysteryEncounterType.SHADY_VITAMIN_DEALER,
MysteryEncounterType.THE_POKEMON_SALESMAN,
// MysteryEncounterType.AN_OFFER_YOU_CANT_REFUSE, Disabled for holiday event
// MysteryEncounterType.AN_OFFER_YOU_CANT_REFUSE, Disabled
MysteryEncounterType.THE_WINSTRATE_CHALLENGE,
MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER
];
const civilizationBiomeEncounters: MysteryEncounterType[] = [
// MysteryEncounterType.DEPARTMENT_STORE_SALE, Disabled for holiday event
// MysteryEncounterType.PART_TIMER, Disabled for holiday event
MysteryEncounterType.DEPARTMENT_STORE_SALE,
MysteryEncounterType.PART_TIMER,
MysteryEncounterType.FUN_AND_GAMES,
MysteryEncounterType.GLOBAL_TRADE_SYSTEM
];

View File

@ -770,8 +770,8 @@ export const pokemonFormChanges: PokemonFormChanges = {
new SpeciesFormChange(Species.KYUREM, "", "white", new SpeciesFormChangeItemTrigger(FormChangeItem.LIGHT_STONE), false, getSpeciesDependentFormChangeCondition(Species.RESHIRAM))
],
[Species.KELDEO]: [
new SpeciesFormChange(Species.KELDEO, "ordinary", "resolute", new SpeciesFormChangeMoveLearnedTrigger(Moves.SECRET_SWORD)),
new SpeciesFormChange(Species.KELDEO, "resolute", "ordinary", new SpeciesFormChangeMoveLearnedTrigger(Moves.SECRET_SWORD, false))
new SpeciesFormChange(Species.KELDEO, "ordinary", "resolute", new SpeciesFormChangeMoveLearnedTrigger(Moves.SECRET_SWORD), false, new SpeciesFormChangeCondition((p) => p.scene.gameMode.isDaily !== true)),
new SpeciesFormChange(Species.KELDEO, "resolute", "ordinary", new SpeciesFormChangeMoveLearnedTrigger(Moves.SECRET_SWORD, false), false, new SpeciesFormChangeCondition((p) => p.scene.gameMode.isDaily !== true))
],
[Species.MELOETTA]: [
new SpeciesFormChange(Species.MELOETTA, "aria", "pirouette", new MeloettaFormChangePostMoveTrigger(Moves.RELIC_SONG), true),

View File

@ -4484,6 +4484,7 @@ export class PlayerPokemon extends Pokemon {
newPokemon.moveset = this.moveset.slice();
newPokemon.moveset = this.copyMoveset();
newPokemon.luck = this.luck;
newPokemon.gender = Gender.GENDERLESS;
newPokemon.metLevel = this.metLevel;
newPokemon.metBiome = this.metBiome;
newPokemon.metSpecies = this.metSpecies;

View File

@ -35,8 +35,14 @@ export class CommandPhase extends FieldPhase {
this.scene.updateGameInfo();
const commandUiHandler = this.scene.ui.handlers[Mode.COMMAND];
// If one of these conditions is true, we always reset the cursor to Command.FIGHT
const cursorResetEvent = this.scene.currentBattle.battleType === BattleType.MYSTERY_ENCOUNTER ||
this.scene.currentBattle.battleType === BattleType.TRAINER ||
this.scene.arena.biomeType === Biome.END;
if (commandUiHandler) {
if (this.scene.currentBattle.turn === 1 || commandUiHandler.getCursor() === Command.POKEMON) {
if ((this.scene.currentBattle.turn === 1 && (!this.scene.commandCursorMemory || cursorResetEvent)) || commandUiHandler.getCursor() === Command.POKEMON) {
commandUiHandler.setCursor(Command.FIGHT);
} else {
commandUiHandler.setCursor(commandUiHandler.getCursor());

View File

@ -39,7 +39,7 @@ export class TrainerVictoryPhase extends BattlePhase {
// Validate Voucher for boss trainers
if (vouchers.hasOwnProperty(TrainerType[trainerType])) {
if (!this.scene.validateVoucher(vouchers[TrainerType[trainerType]]) && this.scene.currentBattle.trainer?.config.isBoss) {
this.scene.unshiftPhase(new ModifierRewardPhase(this.scene, [ modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PREMIUM ][vouchers[TrainerType[trainerType]].voucherType]));
this.scene.unshiftPhase(new ModifierRewardPhase(this.scene, [ modifierTypes.VOUCHER, modifierTypes.VOUCHER, modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PREMIUM ][vouchers[TrainerType[trainerType]].voucherType]));
}
}
// Breeders in Space achievement

View File

@ -157,6 +157,7 @@ export const SettingKeys = {
Move_Animations: "MOVE_ANIMATIONS",
Show_Stats_on_Level_Up: "SHOW_LEVEL_UP_STATS",
Shop_Cursor_Target: "SHOP_CURSOR_TARGET",
Command_Cursor_Memory: "COMMAND_CURSOR_MEMORY",
Candy_Upgrade_Notification: "CANDY_UPGRADE_NOTIFICATION",
Candy_Upgrade_Display: "CANDY_UPGRADE_DISPLAY",
Move_Info: "MOVE_INFO",
@ -180,8 +181,8 @@ export const SettingKeys = {
};
export enum MusicPreference {
CONSISTENT,
MIXED
GENFIVE,
ALLGENS
}
/**
@ -339,6 +340,13 @@ export const Setting: Array<Setting> = [
default: 0,
type: SettingType.GENERAL
},
{
key: SettingKeys.Command_Cursor_Memory,
label: i18next.t("settings:commandCursorMemory"),
options: OFF_ON,
default: 0,
type: SettingType.GENERAL
},
{
key: SettingKeys.Enable_Retries,
label: i18next.t("settings:enableRetries"),
@ -662,15 +670,15 @@ export const Setting: Array<Setting> = [
label: i18next.t("settings:musicPreference"),
options: [
{
value: "Consistent",
label: i18next.t("settings:consistent")
value: "Gen V + PMD",
label: i18next.t("settings:musicGenFive")
},
{
value: "Mixed",
label: i18next.t("settings:mixed")
value: "All Gens",
label: i18next.t("settings:musicAllGens")
}
],
default: MusicPreference.MIXED,
default: MusicPreference.ALLGENS,
type: SettingType.AUDIO,
requireReload: true
},
@ -827,6 +835,9 @@ export function setSetting(scene: BattleScene, setting: string, value: integer):
const selectedValue = shopCursorTargetIndexMap[value];
scene.shopCursorTarget = selectedValue;
break;
case SettingKeys.Command_Cursor_Memory:
scene.commandCursorMemory = Setting[index].options[value].value === "On";
break;
case SettingKeys.EXP_Gains_Speed:
scene.expGainsSpeed = value;
break;

View File

@ -78,12 +78,15 @@ describe("Evolution", () => {
const nincada = game.scene.getPlayerPokemon()!;
nincada.abilityIndex = 2;
nincada.metBiome = -1;
nincada.gender = 1;
nincada.evolve(pokemonEvolutions[Species.NINCADA][0], nincada.getSpeciesForm());
const ninjask = game.scene.getPlayerParty()[0];
const shedinja = game.scene.getPlayerParty()[1];
expect(ninjask.abilityIndex).toBe(2);
expect(shedinja.abilityIndex).toBe(1);
expect(ninjask.gender).toBe(1);
expect(shedinja.gender).toBe(-1);
// Regression test for https://github.com/pagefaultgames/pokerogue/issues/3842
expect(shedinja.metBiome).toBe(-1);
});

View File

@ -56,7 +56,7 @@ describe("Delibird-y - Mystery Encounter", () => {
await game.runToMysteryEncounter(MysteryEncounterType.DELIBIRDY, defaultParty);
expect(DelibirdyEncounter.encounterType).toBe(MysteryEncounterType.DELIBIRDY);
expect(DelibirdyEncounter.encounterTier).toBe(MysteryEncounterTier.COMMON);
expect(DelibirdyEncounter.encounterTier).toBe(MysteryEncounterTier.GREAT);
expect(DelibirdyEncounter.dialogue).toBeDefined();
expect(DelibirdyEncounter.dialogue.intro).toStrictEqual([{ text: `${namespace}:intro` }]);
expect(DelibirdyEncounter.dialogue.outro).toStrictEqual([{ text: `${namespace}:outro` }]);