[Enhancement] Add option for egg skip to settings (#4193)
* add option for egg skip * change eggSkip variable name more descriptive to eggSkipPreference * update requested changes from opaquer and tinylad and walker * update requested change from tinylad * update comment
This commit is contained in:
parent
c294e0846d
commit
5724ed4a5c
|
@ -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.
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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"));
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue