Merge branch 'beta' into mystery-encounters-translations

This commit is contained in:
Lugiad 2024-09-12 17:00:57 +02:00 committed by GitHub
commit 18cde1c14a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 41 additions and 4 deletions

View File

@ -161,6 +161,13 @@ export default class BattleScene extends SceneBase {
public moveAnimations: boolean = true; public moveAnimations: boolean = true;
public expGainsSpeed: integer = 0; public expGainsSpeed: integer = 0;
public skipSeenDialogues: boolean = false; public skipSeenDialogues: boolean = false;
/**
* Determines if the egg hatching animation should be skipped
* - 0 = Never (never skip animation)
* - 1 = Ask (ask to skip animation when hatching 2 or more eggs)
* - 2 = Always (automatically skip animation when hatching 2 or more eggs)
*/
public eggSkipPreference: number = 0;
/** /**
* Defines the experience gain display mode. * Defines the experience gain display mode.

View File

@ -11,6 +11,10 @@
"expGainsSpeed": "EXP Gains Speed", "expGainsSpeed": "EXP Gains Speed",
"expPartyDisplay": "Show EXP Party", "expPartyDisplay": "Show EXP Party",
"skipSeenDialogues": "Skip Seen Dialogues", "skipSeenDialogues": "Skip Seen Dialogues",
"eggSkip": "Egg Skip",
"never": "Never",
"always": "Always",
"ask": "Ask",
"battleStyle": "Battle Style", "battleStyle": "Battle Style",
"enableRetries": "Enable Retries", "enableRetries": "Enable Retries",
"hideIvs": "Hide IV scanner", "hideIvs": "Hide IV scanner",

View File

@ -17,14 +17,13 @@ import { EggHatchData } from "#app/data/egg-hatch-data";
export class EggLapsePhase extends Phase { export class EggLapsePhase extends Phase {
private eggHatchData: EggHatchData[] = []; private eggHatchData: EggHatchData[] = [];
private readonly minEggsToPromptSkip: number = 5; private readonly minEggsToSkip: number = 2;
constructor(scene: BattleScene) { constructor(scene: BattleScene) {
super(scene); super(scene);
} }
start() { start() {
super.start(); super.start();
const eggsToHatch: Egg[] = this.scene.gameData.eggs.filter((egg: Egg) => { const eggsToHatch: Egg[] = this.scene.gameData.eggs.filter((egg: Egg) => {
return Overrides.EGG_IMMEDIATE_HATCH_OVERRIDE ? true : --egg.hatchWaves < 1; return Overrides.EGG_IMMEDIATE_HATCH_OVERRIDE ? true : --egg.hatchWaves < 1;
}); });
@ -32,8 +31,7 @@ export class EggLapsePhase extends Phase {
this.eggHatchData= []; this.eggHatchData= [];
if (eggsToHatchCount > 0) { if (eggsToHatchCount > 0) {
if (eggsToHatchCount >= this.minEggsToSkip && this.scene.eggSkipPreference === 1) {
if (eggsToHatchCount >= this.minEggsToPromptSkip) {
this.scene.ui.showText(i18next.t("battle:eggHatching"), 0, () => { this.scene.ui.showText(i18next.t("battle:eggHatching"), 0, () => {
// show prompt for skip // show prompt for skip
this.scene.ui.showText(i18next.t("battle:eggSkipPrompt"), 0); this.scene.ui.showText(i18next.t("battle:eggSkipPrompt"), 0);
@ -46,6 +44,10 @@ export class EggLapsePhase extends Phase {
} }
); );
}, 100, true); }, 100, true);
} else if (eggsToHatchCount >= this.minEggsToSkip && this.scene.eggSkipPreference === 2) {
this.scene.queueMessage(i18next.t("battle:eggHatching"));
this.hatchEggsSkipped(eggsToHatch);
this.showSummary();
} else { } else {
// regular hatches, no summary // regular hatches, no summary
this.scene.queueMessage(i18next.t("battle:eggHatching")); this.scene.queueMessage(i18next.t("battle:eggHatching"));

View File

@ -126,6 +126,7 @@ export const SettingKeys = {
EXP_Gains_Speed: "EXP_GAINS_SPEED", EXP_Gains_Speed: "EXP_GAINS_SPEED",
EXP_Party_Display: "EXP_PARTY_DISPLAY", EXP_Party_Display: "EXP_PARTY_DISPLAY",
Skip_Seen_Dialogues: "SKIP_SEEN_DIALOGUES", Skip_Seen_Dialogues: "SKIP_SEEN_DIALOGUES",
Egg_Skip: "EGG_SKIP",
Battle_Style: "BATTLE_STYLE", Battle_Style: "BATTLE_STYLE",
Enable_Retries: "ENABLE_RETRIES", Enable_Retries: "ENABLE_RETRIES",
Hide_IVs: "HIDE_IVS", Hide_IVs: "HIDE_IVS",
@ -281,6 +282,26 @@ export const Setting: Array<Setting> = [
default: 0, default: 0,
type: SettingType.GENERAL type: SettingType.GENERAL
}, },
{
key: SettingKeys.Egg_Skip,
label: i18next.t("settings:eggSkip"),
options: [
{
value: "Never",
label: i18next.t("settings:never")
},
{
value: "Ask",
label: i18next.t("settings:ask")
},
{
value: "Always",
label: i18next.t("settings:always")
}
],
default: 1,
type: SettingType.GENERAL
},
{ {
key: SettingKeys.Battle_Style, key: SettingKeys.Battle_Style,
label: i18next.t("settings:battleStyle"), label: i18next.t("settings:battleStyle"),
@ -727,6 +748,9 @@ export function setSetting(scene: BattleScene, setting: string, value: integer):
case SettingKeys.Skip_Seen_Dialogues: case SettingKeys.Skip_Seen_Dialogues:
scene.skipSeenDialogues = Setting[index].options[value].value === "On"; scene.skipSeenDialogues = Setting[index].options[value].value === "On";
break; break;
case SettingKeys.Egg_Skip:
scene.eggSkipPreference = value;
break;
case SettingKeys.Battle_Style: case SettingKeys.Battle_Style:
scene.battleStyle = value; scene.battleStyle = value;
break; break;