mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-16 21:32:18 +02:00
add: Toggling pokemon cries
This will only affect the cries played during fights. Starter select, evolutions etc. will not be affected y the setting
This commit is contained in:
parent
e6a574c48f
commit
c7cc935f26
@ -140,6 +140,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
public enableMoveInfo: boolean = true;
|
public enableMoveInfo: boolean = true;
|
||||||
public enableRetries: boolean = false;
|
public enableRetries: boolean = false;
|
||||||
public hideIvs: boolean = false;
|
public hideIvs: boolean = false;
|
||||||
|
/** Toggle Pokemon cries */
|
||||||
|
public enablePokemonCries: boolean = true;
|
||||||
/**
|
/**
|
||||||
* Determines the condition for a notification should be shown for Candy Upgrades
|
* Determines the condition for a notification should be shown for Candy Upgrades
|
||||||
* - 0 = 'Off'
|
* - 0 = 'Off'
|
||||||
|
@ -2767,6 +2767,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
faintCry(callback: Function): void {
|
faintCry(callback: Function): void {
|
||||||
|
if (!this.scene.enablePokemonCries) {
|
||||||
|
return callback();
|
||||||
|
} //skip cry and callback immediately
|
||||||
|
|
||||||
if (this.fusionSpecies && this.getSpeciesForm() !== this.getFusionSpeciesForm()) {
|
if (this.fusionSpecies && this.getSpeciesForm() !== this.getFusionSpeciesForm()) {
|
||||||
return this.fusionFaintCry(callback);
|
return this.fusionFaintCry(callback);
|
||||||
}
|
}
|
||||||
|
@ -103,5 +103,6 @@
|
|||||||
"rewards": "Rewards",
|
"rewards": "Rewards",
|
||||||
"reroll": "Reroll",
|
"reroll": "Reroll",
|
||||||
"shop": "Shop",
|
"shop": "Shop",
|
||||||
"checkTeam": "Check Team"
|
"checkTeam": "Check Team",
|
||||||
|
"pokemonCries": "Pokemon Cries"
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,9 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
if (this.scene.currentBattle.battleType === BattleType.WILD) {
|
if (this.scene.currentBattle.battleType === BattleType.WILD) {
|
||||||
enemyField.forEach(enemyPokemon => {
|
enemyField.forEach(enemyPokemon => {
|
||||||
enemyPokemon.untint(100, "Sine.easeOut");
|
enemyPokemon.untint(100, "Sine.easeOut");
|
||||||
enemyPokemon.cry();
|
if (this.scene.enablePokemonCries) {
|
||||||
|
enemyPokemon.cry();
|
||||||
|
}
|
||||||
enemyPokemon.showInfo();
|
enemyPokemon.showInfo();
|
||||||
if (enemyPokemon.isShiny()) {
|
if (enemyPokemon.isShiny()) {
|
||||||
this.scene.validateAchv(achvs.SEE_SHINY);
|
this.scene.validateAchv(achvs.SEE_SHINY);
|
||||||
|
@ -155,10 +155,12 @@ export class SummonPhase extends PartyMemberPokemonPhase {
|
|||||||
ease: "Sine.easeIn",
|
ease: "Sine.easeIn",
|
||||||
scale: pokemon.getSpriteScale(),
|
scale: pokemon.getSpriteScale(),
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
pokemon.cry(pokemon.getHpRatio() > 0.25 ? undefined : { rate: 0.85 });
|
if (this.scene.enablePokemonCries) {
|
||||||
|
pokemon.cry(pokemon.getHpRatio() > 0.25 ? undefined : { rate: 0.85 });
|
||||||
|
}
|
||||||
pokemon.getSprite().clearTint();
|
pokemon.getSprite().clearTint();
|
||||||
pokemon.resetSummonData();
|
pokemon.resetSummonData();
|
||||||
this.scene.time.delayedCall(1000, () => this.end());
|
this.scene.time.delayedCall(this.scene.enablePokemonCries ? 1000 : 100, () => this.end());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,8 @@ export const SettingKeys = {
|
|||||||
Music_Preference: "MUSIC_PREFERENCE",
|
Music_Preference: "MUSIC_PREFERENCE",
|
||||||
Show_BGM_Bar: "SHOW_BGM_BAR",
|
Show_BGM_Bar: "SHOW_BGM_BAR",
|
||||||
Move_Touch_Controls: "MOVE_TOUCH_CONTROLS",
|
Move_Touch_Controls: "MOVE_TOUCH_CONTROLS",
|
||||||
Shop_Overlay_Opacity: "SHOP_OVERLAY_OPACITY"
|
Shop_Overlay_Opacity: "SHOP_OVERLAY_OPACITY",
|
||||||
|
Pokemon_Cries: "POKEMON_CRIES",
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -617,6 +618,22 @@ export const Setting: Array<Setting> = [
|
|||||||
type: SettingType.AUDIO,
|
type: SettingType.AUDIO,
|
||||||
requireReload: true
|
requireReload: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: SettingKeys.Pokemon_Cries,
|
||||||
|
label: i18next.t("settings:pokemonCries"),
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
value: "On",
|
||||||
|
label: i18next.t("settings:on")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "Off",
|
||||||
|
label: i18next.t("settings:off")
|
||||||
|
}
|
||||||
|
],
|
||||||
|
default: 0,
|
||||||
|
type: SettingType.AUDIO,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: SettingKeys.Move_Touch_Controls,
|
key: SettingKeys.Move_Touch_Controls,
|
||||||
label: i18next.t("settings:moveTouchControls"),
|
label: i18next.t("settings:moveTouchControls"),
|
||||||
@ -895,6 +912,9 @@ export function setSetting(scene: BattleScene, setting: string, value: integer):
|
|||||||
case SettingKeys.Shop_Overlay_Opacity:
|
case SettingKeys.Shop_Overlay_Opacity:
|
||||||
scene.updateShopOverlayOpacity(parseInt(Setting[index].options[value].value) * .01);
|
scene.updateShopOverlayOpacity(parseInt(Setting[index].options[value].value) * .01);
|
||||||
break;
|
break;
|
||||||
|
case SettingKeys.Pokemon_Cries:
|
||||||
|
scene.enablePokemonCries = Setting[index].options[value].value === "On";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -15,6 +15,6 @@ export default class SettingsAudioUiHandler extends AbstractSettingsUiHandler {
|
|||||||
super(scene, SettingType.AUDIO, mode);
|
super(scene, SettingType.AUDIO, mode);
|
||||||
this.title = "Audio";
|
this.title = "Audio";
|
||||||
this.localStorageKey = "settings";
|
this.localStorageKey = "settings";
|
||||||
this.rowsToDisplay = 6;
|
this.rowsToDisplay = 7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user