mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 08:22:16 +02:00
Compare commits
3 Commits
50c1f8aee4
...
145a79f8ef
Author | SHA1 | Date | |
---|---|---|---|
|
145a79f8ef | ||
|
1abc591318 | ||
|
12bd22f2ca |
@ -114,6 +114,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
public experimentalSprites: boolean = false;
|
public experimentalSprites: boolean = false;
|
||||||
public moveAnimations: boolean = true;
|
public moveAnimations: boolean = true;
|
||||||
public expGainsSpeed: integer = 0;
|
public expGainsSpeed: integer = 0;
|
||||||
|
public skipSeenDialogues: boolean = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the experience gain display mode.
|
* Defines the experience gain display mode.
|
||||||
*
|
*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {DialogueTranslationEntries, SimpleTranslationEntries} from "#app/plugins/i18n";
|
import { DialogueTranslationEntries, SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
// Dialogue of the NPCs in the game when the player character is male (or unset)
|
// Dialogue of the NPCs in the game when the player character is male (or unset)
|
||||||
export const PGMdialogue: DialogueTranslationEntries = {
|
export const PGMdialogue: DialogueTranslationEntries = {
|
||||||
@ -2398,12 +2398,12 @@ export const PGMdoubleBattleDialogue: DialogueTranslationEntries = {
|
|||||||
},
|
},
|
||||||
"steven_wallace_double": {
|
"steven_wallace_double": {
|
||||||
"encounter": {
|
"encounter": {
|
||||||
1: `Steven: Do you have any rare pokémon?
|
1: `Steven: Do you have any rare Pokémon?
|
||||||
$Wallace: Steven... We are here for a battle, not to show off our pokémon.
|
$Wallace: Steven... We are here for a battle, not to show off our Pokémon.
|
||||||
$Steven: Oh... I see... Let's go then!`,
|
$Steven: Oh... I see... Let's go then!`,
|
||||||
},
|
},
|
||||||
"victory": {
|
"victory": {
|
||||||
1: `Steven: Now that we are done with the battle, let's show off our pokémon!
|
1: `Steven: Now that we are done with the battle, let's show off our Pokémon!
|
||||||
$Wallace: Steven...`,
|
$Wallace: Steven...`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -29,8 +29,8 @@ export const tutorial: SimpleTranslationEntries = {
|
|||||||
$종류는 소모품, 포켓몬의 지닌 도구, 영구적 패시브 아이템에 이르기까지 다양합니다.
|
$종류는 소모품, 포켓몬의 지닌 도구, 영구적 패시브 아이템에 이르기까지 다양합니다.
|
||||||
$대부분의 소모되지 않는 도구는 효과가 누적됩니다.
|
$대부분의 소모되지 않는 도구는 효과가 누적됩니다.
|
||||||
$진화용과 같은 일부분의 아이템은 사용할 수 있는 경우에만 등장합니다.
|
$진화용과 같은 일부분의 아이템은 사용할 수 있는 경우에만 등장합니다.
|
||||||
$지닌 도구 건내주기 기능을 사용해 포켓몬끼리 도구를 옮겨 지닐 수도 있습니다.
|
$지닌 도구 건네주기 기능을 사용해 포켓몬끼리 도구를 옮겨 지닐 수도 있습니다.
|
||||||
$지닌 도구가 있다면 아이템 선택 화면 오른쪽 하단에 건내주기 기능이 표시됩니다.
|
$지닌 도구가 있다면 아이템 선택 화면 오른쪽 하단에 건네주기 기능이 표시됩니다.
|
||||||
$돈으로 소모품을 구입할 수도 있으며, 웨이브 진행에 따라 구입 가능한 종류가 늘어납니다.
|
$돈으로 소모품을 구입할 수도 있으며, 웨이브 진행에 따라 구입 가능한 종류가 늘어납니다.
|
||||||
$아이템을 선택하면 다음 웨이브로 넘어가므로, 소모품 구입을 먼저 해 주세요.`,
|
$아이템을 선택하면 다음 웨이브로 넘어가므로, 소모품 구입을 먼저 해 주세요.`,
|
||||||
|
|
||||||
|
@ -3,5 +3,5 @@ import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
|||||||
export const abilityTriggers: SimpleTranslationEntries = {
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
"blockRecoilDamage" : "{{abilityName}} de {{pokemonName}}\nprotegeu-o do dano de recuo!",
|
"blockRecoilDamage" : "{{abilityName}} de {{pokemonName}}\nprotegeu-o do dano de recuo!",
|
||||||
"badDreams": "{{pokemonName}} está tendo pesadelos!",
|
"badDreams": "{{pokemonName}} está tendo pesadelos!",
|
||||||
"windPowerCharged": "Being hit by {{moveName}} charged {{pokemonName}} with power!"
|
"windPowerCharged": "Ser atingido por {{moveName}} carregou {{pokemonName}} com poder!"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -48,7 +48,7 @@ export const battle: SimpleTranslationEntries = {
|
|||||||
"noEscapeForce": "Uma força misteriosa\nte impede de fugir.",
|
"noEscapeForce": "Uma força misteriosa\nte impede de fugir.",
|
||||||
"noEscapeTrainer": "Não se pode fugir de\nbatalhas contra treinadores!",
|
"noEscapeTrainer": "Não se pode fugir de\nbatalhas contra treinadores!",
|
||||||
"noEscapePokemon": "O movimento {{moveName}} de {{pokemonName}} te impede de fugir!",
|
"noEscapePokemon": "O movimento {{moveName}} de {{pokemonName}} te impede de fugir!",
|
||||||
"runAwaySuccess": "Você fugiu com sucesso",
|
"runAwaySuccess": "Você fugiu com sucesso.",
|
||||||
"runAwayCannotEscape": "Você nao conseguiu fugir!",
|
"runAwayCannotEscape": "Você nao conseguiu fugir!",
|
||||||
"escapeVerbSwitch": "trocar",
|
"escapeVerbSwitch": "trocar",
|
||||||
"escapeVerbFlee": "fugir",
|
"escapeVerbFlee": "fugir",
|
||||||
@ -56,6 +56,6 @@ export const battle: SimpleTranslationEntries = {
|
|||||||
"skipItemQuestion": "Tem certeza de que não quer escolher um item?",
|
"skipItemQuestion": "Tem certeza de que não quer escolher um item?",
|
||||||
"eggHatching": "Opa?",
|
"eggHatching": "Opa?",
|
||||||
"ivScannerUseQuestion": "Quer usar o Scanner de IVs em {{pokemonName}}?",
|
"ivScannerUseQuestion": "Quer usar o Scanner de IVs em {{pokemonName}}?",
|
||||||
"drainMessage": "{{pokemonName}} had its\nenergy drained!",
|
"drainMessage": "{{pokemonName}} teve sua\nenergia drenada!",
|
||||||
"regainHealth": "{{pokemonName}} regained\nhealth!"
|
"regainHealth": "{{pokemonName}} recuperou\npontos de saúde!"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -4,8 +4,8 @@ export const biome: SimpleTranslationEntries = {
|
|||||||
"unknownLocation": "Em algum lugar do qual você não se lembra",
|
"unknownLocation": "Em algum lugar do qual você não se lembra",
|
||||||
"TOWN": "Cidade",
|
"TOWN": "Cidade",
|
||||||
"PLAINS": "Planície",
|
"PLAINS": "Planície",
|
||||||
"GRASS": "Campo de Grama",
|
"GRASS": "Grama",
|
||||||
"TALL_GRASS": "Campo de Grama Alta",
|
"TALL_GRASS": "Grama Alta",
|
||||||
"METROPOLIS": "Metrópole",
|
"METROPOLIS": "Metrópole",
|
||||||
"FOREST": "Floresta",
|
"FOREST": "Floresta",
|
||||||
"SEA": "Mar",
|
"SEA": "Mar",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,44 +1,44 @@
|
|||||||
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
export const gameStatsUiHandler: SimpleTranslationEntries = {
|
export const gameStatsUiHandler: SimpleTranslationEntries = {
|
||||||
"stats": "Stats",
|
"stats": "Estatísticas",
|
||||||
"playTime": "Play Time",
|
"playTime": "Tempo de Jogo",
|
||||||
"totalBattles": "Total Battles",
|
"totalBattles": "Total de Batalhas",
|
||||||
"starters": "Starters",
|
"starters": "Iniciais",
|
||||||
"shinyStarters": "Shiny Starters",
|
"shinyStarters": "Iniciais Shiny",
|
||||||
"speciesSeen": "Species Seen",
|
"speciesSeen": "Espécies Vistas",
|
||||||
"speciesCaught": "Species Caught",
|
"speciesCaught": "Capturadas",
|
||||||
"ribbonsOwned": "Ribbons Owned",
|
"ribbonsOwned": "Fitas Obtidas",
|
||||||
"classicRuns": "Classic Runs",
|
"classicRuns": "Jogos Clássicos",
|
||||||
"classicWins": "Classic Wins",
|
"classicWins": "Vitórias Clássicas",
|
||||||
"dailyRunAttempts": "Daily Run Attempts",
|
"dailyRunAttempts": "Jogos de Desafio Diário",
|
||||||
"dailyRunWins": "Daily Run Wins",
|
"dailyRunWins": "Vitórias de Desafio Diário",
|
||||||
"endlessRuns": "Endless Runs",
|
"endlessRuns": "Jogos Infinitos",
|
||||||
"highestWaveEndless": "Highest Wave (Endless)",
|
"highestWaveEndless": "Maior Onda (Infinito)",
|
||||||
"highestMoney": "Highest Money",
|
"highestMoney": "Maior Dinheiro",
|
||||||
"highestDamage": "Highest Damage",
|
"highestDamage": "Maior Dano",
|
||||||
"highestHPHealed": "Highest HP Healed",
|
"highestHPHealed": "Maior PS Curado",
|
||||||
"pokemonEncountered": "Pokémon Encountered",
|
"pokemonEncountered": "Pokémon Encontrados",
|
||||||
"pokemonDefeated": "Pokémon Defeated",
|
"pokemonDefeated": "Pokémon Derrotados",
|
||||||
"pokemonCaught": "Pokémon Caught",
|
"pokemonCaught": "Pokémon Capturados",
|
||||||
"eggsHatched": "Eggs Hatched",
|
"eggsHatched": "Ovos Chocados",
|
||||||
"subLegendsSeen": "Sub-Legends Seen",
|
"subLegendsSeen": "Sub-Lendários Vistos",
|
||||||
"subLegendsCaught": "Sub-Legends Caught",
|
"subLegendsCaught": "Sub-Lend. Capturados",
|
||||||
"subLegendsHatched": "Sub-Legends Hatched",
|
"subLegendsHatched": "Sub-Lendários Chocados",
|
||||||
"legendsSeen": "Legends Seen",
|
"legendsSeen": "Lendários Vistos",
|
||||||
"legendsCaught": "Legends Caught",
|
"legendsCaught": "Lendários Capturados",
|
||||||
"legendsHatched": "Legends Hatched",
|
"legendsHatched": "Legendários Chocados",
|
||||||
"mythicalsSeen": "Mythicals Seen",
|
"mythicalsSeen": "Míticos Vistos",
|
||||||
"mythicalsCaught": "Mythicals Caught",
|
"mythicalsCaught": "Míticos Capturados",
|
||||||
"mythicalsHatched": "Mythicals Hatched",
|
"mythicalsHatched": "Míticos Chocados",
|
||||||
"shiniesSeen": "Shinies Seen",
|
"shiniesSeen": "Shinies Vistos",
|
||||||
"shiniesCaught": "Shinies Caught",
|
"shiniesCaught": "Shinies Capturados",
|
||||||
"shiniesHatched": "Shinies Hatched",
|
"shiniesHatched": "Shinies Chocados",
|
||||||
"pokemonFused": "Pokémon Fused",
|
"pokemonFused": "Pokémon Fundidos",
|
||||||
"trainersDefeated": "Trainers Defeated",
|
"trainersDefeated": "Treinadores Derrotados",
|
||||||
"eggsPulled": "Eggs Pulled",
|
"eggsPulled": "Ovos Ganhos",
|
||||||
"rareEggsPulled": "Rare Eggs Pulled",
|
"rareEggsPulled": "Ovos Raros Ganhos",
|
||||||
"epicEggsPulled": "Epic Eggs Pulled",
|
"epicEggsPulled": "Ovos Épicos Ganhos",
|
||||||
"legendaryEggsPulled": "Legendary Eggs Pulled",
|
"legendaryEggsPulled": "Ovos Lendários Ganhos",
|
||||||
"manaphyEggsPulled": "Manaphy Eggs Pulled",
|
"manaphyEggsPulled": "Ovos de Manaphy Ganhos",
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -209,8 +209,8 @@ export const modifierType: ModifierTypeTranslationEntries = {
|
|||||||
"LEFTOVERS": { name: "Sobras", description: "Cura 1/16 dos PS máximos de um Pokémon a cada turno" },
|
"LEFTOVERS": { name: "Sobras", description: "Cura 1/16 dos PS máximos de um Pokémon a cada turno" },
|
||||||
"SHELL_BELL": { name: "Concha-Sino", description: "Cura 1/8 do dano causado por um Pokémon" },
|
"SHELL_BELL": { name: "Concha-Sino", description: "Cura 1/8 do dano causado por um Pokémon" },
|
||||||
|
|
||||||
"TOXIC_ORB": { name: "Toxic Orb", description: "It's a bizarre orb that exudes toxins when touched and will badly poison the holder during battle" },
|
"TOXIC_ORB": { name: "Esfera Tóxica", description: "Uma esfera estranha que exala toxinas quando tocada e envenena seriamente quem a segurar" },
|
||||||
"FLAME_ORB": { name: "Flame Orb", description: "It's a bizarre orb that gives off heat when touched and will affect the holder with a burn during battle" },
|
"FLAME_ORB": { name: "Esfera da Chama", description: "Uma esfera estranha que aquece quando tocada e queima quem a segurar" },
|
||||||
|
|
||||||
"BATON": { name: "Bastão", description: "Permite passar mudanças de atributo ao trocar Pokémon, ignorando armadilhas" },
|
"BATON": { name: "Bastão", description: "Permite passar mudanças de atributo ao trocar Pokémon, ignorando armadilhas" },
|
||||||
|
|
||||||
|
@ -1943,7 +1943,7 @@ export const move: MoveTranslationEntries = {
|
|||||||
},
|
},
|
||||||
"electroBall": {
|
"electroBall": {
|
||||||
name: "Electro Ball",
|
name: "Electro Ball",
|
||||||
effect: "O usuário arremessa uma orbe elétrica no alvo. Quanto mais rápido for o usuário comparado ao alvo, maior será o poder do movimento."
|
effect: "O usuário arremessa uma esfera elétrica no alvo. Quanto mais rápido for o usuário comparado ao alvo, maior será o poder do movimento."
|
||||||
},
|
},
|
||||||
"soak": {
|
"soak": {
|
||||||
name: "Soak",
|
name: "Soak",
|
||||||
@ -2495,7 +2495,7 @@ export const move: MoveTranslationEntries = {
|
|||||||
},
|
},
|
||||||
"allOutPummelingPhysical": {
|
"allOutPummelingPhysical": {
|
||||||
name: "All-Out Pummeling",
|
name: "All-Out Pummeling",
|
||||||
effect: "Utilizando o Poder Z, o usuário cria e arremessa um orbe de energia no alvo com força total. Seu poder varia dependendo do movimento original."
|
effect: "Utilizando o Poder Z, o usuário cria e arremessa uma esfera de energia no alvo com força total. Seu poder varia dependendo do movimento original."
|
||||||
},
|
},
|
||||||
"allOutPummelingSpecial": {
|
"allOutPummelingSpecial": {
|
||||||
name: "All-Out Pummeling",
|
name: "All-Out Pummeling",
|
||||||
|
@ -48,7 +48,7 @@ export const trainerClasses: SimpleTranslationEntries = {
|
|||||||
"depot_agent": "Ferroviário",
|
"depot_agent": "Ferroviário",
|
||||||
"doctor": "Doutor",
|
"doctor": "Doutor",
|
||||||
"doctor_female": "Doutora",
|
"doctor_female": "Doutora",
|
||||||
"firebreather": "Firebreather",
|
"firebreather": "Cospe-Fogo",
|
||||||
"fishermen": "Pescador",
|
"fishermen": "Pescador",
|
||||||
"fishermen_female": "Pescadora",
|
"fishermen_female": "Pescadora",
|
||||||
"gentleman": "Cavalheiro",
|
"gentleman": "Cavalheiro",
|
||||||
|
@ -959,14 +959,15 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
if (!encounterMessages?.length) {
|
if (!encounterMessages?.length) {
|
||||||
doSummon();
|
doSummon();
|
||||||
} else {
|
} else {
|
||||||
const showDialogueAndSummon = () => {
|
|
||||||
let message: string;
|
let message: string;
|
||||||
this.scene.executeWithSeedOffset(() => message = Utils.randSeedItem(encounterMessages), this.scene.currentBattle.waveIndex);
|
this.scene.executeWithSeedOffset(() => message = Utils.randSeedItem(encounterMessages), this.scene.currentBattle.waveIndex);
|
||||||
|
|
||||||
|
const showDialogueAndSummon = () => {
|
||||||
this.scene.ui.showDialogue(message, trainer.getName(TrainerSlot.NONE,true), null, () => {
|
this.scene.ui.showDialogue(message, trainer.getName(TrainerSlot.NONE,true), null, () => {
|
||||||
this.scene.charSprite.hide().then(() => this.scene.hideFieldOverlay(250).then(() => doSummon()));
|
this.scene.charSprite.hide().then(() => this.scene.hideFieldOverlay(250).then(() => doSummon()));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
if (this.scene.currentBattle.trainer.config.hasCharSprite) {
|
if (this.scene.currentBattle.trainer.config.hasCharSprite && !this.scene.ui.shouldSkipDialogue(message)) {
|
||||||
this.scene.showFieldOverlay(500).then(() => this.scene.charSprite.showCharacter(trainer.getKey(), getCharVariantFromDialogue(encounterMessages[0])).then(() => showDialogueAndSummon()));
|
this.scene.showFieldOverlay(500).then(() => this.scene.charSprite.showCharacter(trainer.getKey(), getCharVariantFromDialogue(encounterMessages[0])).then(() => showDialogueAndSummon()));
|
||||||
} else {
|
} else {
|
||||||
showDialogueAndSummon();
|
showDialogueAndSummon();
|
||||||
@ -3789,21 +3790,18 @@ export class TrainerVictoryPhase extends BattlePhase {
|
|||||||
|
|
||||||
this.scene.ui.showText(i18next.t("battle:trainerDefeated", { trainerName: this.scene.currentBattle.trainer.getName(TrainerSlot.NONE, true) }), null, () => {
|
this.scene.ui.showText(i18next.t("battle:trainerDefeated", { trainerName: this.scene.currentBattle.trainer.getName(TrainerSlot.NONE, true) }), null, () => {
|
||||||
const victoryMessages = this.scene.currentBattle.trainer.getVictoryMessages();
|
const victoryMessages = this.scene.currentBattle.trainer.getVictoryMessages();
|
||||||
const showMessage = () => {
|
|
||||||
let message: string;
|
let message: string;
|
||||||
this.scene.executeWithSeedOffset(() => message = Utils.randSeedItem(victoryMessages), this.scene.currentBattle.waveIndex);
|
this.scene.executeWithSeedOffset(() => message = Utils.randSeedItem(victoryMessages), this.scene.currentBattle.waveIndex);
|
||||||
const messagePages = message.split(/\$/g).map(m => m.trim());
|
|
||||||
|
|
||||||
for (let p = messagePages.length - 1; p >= 0; p--) {
|
const showMessage = () => {
|
||||||
const originalFunc = showMessageOrEnd;
|
const originalFunc = showMessageOrEnd;
|
||||||
showMessageOrEnd = () => this.scene.ui.showDialogue(messagePages[p], this.scene.currentBattle.trainer.getName(), null, originalFunc);
|
showMessageOrEnd = () => this.scene.ui.showDialogue(message, this.scene.currentBattle.trainer.getName(), null, originalFunc);
|
||||||
}
|
|
||||||
|
|
||||||
showMessageOrEnd();
|
showMessageOrEnd();
|
||||||
};
|
};
|
||||||
let showMessageOrEnd = () => this.end();
|
let showMessageOrEnd = () => this.end();
|
||||||
if (victoryMessages?.length) {
|
if (victoryMessages?.length) {
|
||||||
if (this.scene.currentBattle.trainer.config.hasCharSprite) {
|
if (this.scene.currentBattle.trainer.config.hasCharSprite && !this.scene.ui.shouldSkipDialogue(message)) {
|
||||||
const originalFunc = showMessageOrEnd;
|
const originalFunc = showMessageOrEnd;
|
||||||
showMessageOrEnd = () => this.scene.charSprite.hide().then(() => this.scene.hideFieldOverlay(250).then(() => originalFunc()));
|
showMessageOrEnd = () => this.scene.charSprite.hide().then(() => this.scene.hideFieldOverlay(250).then(() => originalFunc()));
|
||||||
this.scene.showFieldOverlay(500).then(() => this.scene.charSprite.showCharacter(this.scene.currentBattle.trainer.getKey(), getCharVariantFromDialogue(victoryMessages[0])).then(() => showMessage()));
|
this.scene.showFieldOverlay(500).then(() => this.scene.charSprite.showCharacter(this.scene.currentBattle.trainer.getKey(), getCharVariantFromDialogue(victoryMessages[0])).then(() => showMessage()));
|
||||||
@ -4014,9 +4012,12 @@ export class GameOverPhase extends BattlePhase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (this.victory && this.scene.gameMode.isClassic) {
|
if (this.victory && this.scene.gameMode.isClassic) {
|
||||||
|
const message = miscDialogue.ending[this.scene.gameData.gender === PlayerGender.FEMALE ? 0 : 1];
|
||||||
|
|
||||||
|
if (!this.scene.ui.shouldSkipDialogue(message)) {
|
||||||
this.scene.ui.fadeIn(500).then(() => {
|
this.scene.ui.fadeIn(500).then(() => {
|
||||||
this.scene.charSprite.showCharacter(`rival_${this.scene.gameData.gender === PlayerGender.FEMALE ? "m" : "f"}`, getCharVariantFromDialogue(miscDialogue.ending[this.scene.gameData.gender === PlayerGender.FEMALE ? 0 : 1])).then(() => {
|
this.scene.charSprite.showCharacter(`rival_${this.scene.gameData.gender === PlayerGender.FEMALE ? "m" : "f"}`, getCharVariantFromDialogue(miscDialogue.ending[this.scene.gameData.gender === PlayerGender.FEMALE ? 0 : 1])).then(() => {
|
||||||
this.scene.ui.showDialogue(miscDialogue.ending[this.scene.gameData.gender === PlayerGender.FEMALE ? 0 : 1], this.scene.gameData.gender === PlayerGender.FEMALE ? trainerConfigs[TrainerType.RIVAL].name : trainerConfigs[TrainerType.RIVAL].nameFemale, null, () => {
|
this.scene.ui.showDialogue(message, this.scene.gameData.gender === PlayerGender.FEMALE ? trainerConfigs[TrainerType.RIVAL].name : trainerConfigs[TrainerType.RIVAL].nameFemale, null, () => {
|
||||||
this.scene.ui.fadeOut(500).then(() => {
|
this.scene.ui.fadeOut(500).then(() => {
|
||||||
this.scene.charSprite.hide().then(() => {
|
this.scene.charSprite.hide().then(() => {
|
||||||
const endCardPhase = new EndCardPhase(this.scene);
|
const endCardPhase = new EndCardPhase(this.scene);
|
||||||
@ -4027,6 +4028,11 @@ export class GameOverPhase extends BattlePhase {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
const endCardPhase = new EndCardPhase(this.scene);
|
||||||
|
this.scene.unshiftPhase(endCardPhase);
|
||||||
|
clear(endCardPhase);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,8 @@ export enum GameDataType {
|
|||||||
SYSTEM,
|
SYSTEM,
|
||||||
SESSION,
|
SESSION,
|
||||||
SETTINGS,
|
SETTINGS,
|
||||||
TUTORIALS
|
TUTORIALS,
|
||||||
|
SEEN_DIALOGUES
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PlayerGender {
|
export enum PlayerGender {
|
||||||
@ -68,6 +69,8 @@ export function getDataTypeKey(dataType: GameDataType, slotId: integer = 0): str
|
|||||||
return "settings";
|
return "settings";
|
||||||
case GameDataType.TUTORIALS:
|
case GameDataType.TUTORIALS:
|
||||||
return "tutorials";
|
return "tutorials";
|
||||||
|
case GameDataType.SEEN_DIALOGUES:
|
||||||
|
return "seenDialogues";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,6 +204,10 @@ export interface TutorialFlags {
|
|||||||
[key: string]: boolean
|
[key: string]: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SeenDialogues {
|
||||||
|
[key: string]: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
const systemShortKeys = {
|
const systemShortKeys = {
|
||||||
seenAttr: "$sa",
|
seenAttr: "$sa",
|
||||||
caughtAttr: "$ca",
|
caughtAttr: "$ca",
|
||||||
@ -716,9 +723,10 @@ export class GameData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public saveTutorialFlag(tutorial: Tutorial, flag: boolean): boolean {
|
public saveTutorialFlag(tutorial: Tutorial, flag: boolean): boolean {
|
||||||
|
const key = getDataTypeKey(GameDataType.TUTORIALS);
|
||||||
let tutorials: object = {};
|
let tutorials: object = {};
|
||||||
if (localStorage.hasOwnProperty("tutorials")) {
|
if (localStorage.hasOwnProperty(key)) {
|
||||||
tutorials = JSON.parse(localStorage.getItem("tutorials"));
|
tutorials = JSON.parse(localStorage.getItem(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.keys(Tutorial).map(t => t as Tutorial).forEach(t => {
|
Object.keys(Tutorial).map(t => t as Tutorial).forEach(t => {
|
||||||
@ -730,20 +738,21 @@ export class GameData {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
localStorage.setItem("tutorials", JSON.stringify(tutorials));
|
localStorage.setItem(key, JSON.stringify(tutorials));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getTutorialFlags(): TutorialFlags {
|
public getTutorialFlags(): TutorialFlags {
|
||||||
|
const key = getDataTypeKey(GameDataType.TUTORIALS);
|
||||||
const ret: TutorialFlags = {};
|
const ret: TutorialFlags = {};
|
||||||
Object.values(Tutorial).map(tutorial => tutorial as Tutorial).forEach(tutorial => ret[Tutorial[tutorial]] = false);
|
Object.values(Tutorial).map(tutorial => tutorial as Tutorial).forEach(tutorial => ret[Tutorial[tutorial]] = false);
|
||||||
|
|
||||||
if (!localStorage.hasOwnProperty("tutorials")) {
|
if (!localStorage.hasOwnProperty(key)) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tutorials = JSON.parse(localStorage.getItem("tutorials"));
|
const tutorials = JSON.parse(localStorage.getItem(key));
|
||||||
|
|
||||||
for (const tutorial of Object.keys(tutorials)) {
|
for (const tutorial of Object.keys(tutorials)) {
|
||||||
ret[tutorial] = tutorials[tutorial];
|
ret[tutorial] = tutorials[tutorial];
|
||||||
@ -752,6 +761,34 @@ export class GameData {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public saveSeenDialogue(dialogue: string): boolean {
|
||||||
|
const key = getDataTypeKey(GameDataType.SEEN_DIALOGUES);
|
||||||
|
const dialogues: object = this.getSeenDialogues();
|
||||||
|
|
||||||
|
dialogues[dialogue] = true;
|
||||||
|
localStorage.setItem(key, JSON.stringify(dialogues));
|
||||||
|
console.log("Dialogue saved as seen:", dialogue);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public getSeenDialogues(): SeenDialogues {
|
||||||
|
const key = getDataTypeKey(GameDataType.SEEN_DIALOGUES);
|
||||||
|
const ret: SeenDialogues = {};
|
||||||
|
|
||||||
|
if (!localStorage.hasOwnProperty(key)) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
const dialogues = JSON.parse(localStorage.getItem(key));
|
||||||
|
|
||||||
|
for (const dialogue of Object.keys(dialogues)) {
|
||||||
|
ret[dialogue] = dialogues[dialogue];
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
private getSessionSaveData(scene: BattleScene): SessionSaveData {
|
private getSessionSaveData(scene: BattleScene): SessionSaveData {
|
||||||
return {
|
return {
|
||||||
seed: scene.seed,
|
seed: scene.seed,
|
||||||
|
@ -19,6 +19,7 @@ export enum Setting {
|
|||||||
Window_Type = "WINDOW_TYPE",
|
Window_Type = "WINDOW_TYPE",
|
||||||
Tutorials = "TUTORIALS",
|
Tutorials = "TUTORIALS",
|
||||||
Enable_Retries = "ENABLE_RETRIES",
|
Enable_Retries = "ENABLE_RETRIES",
|
||||||
|
Skip_Seen_Dialogues = "SKIP_SEEN_DIALOGUES",
|
||||||
Candy_Upgrade_Notification = "CANDY_UPGRADE_NOTIFICATION",
|
Candy_Upgrade_Notification = "CANDY_UPGRADE_NOTIFICATION",
|
||||||
Candy_Upgrade_Display = "CANDY_UPGRADE_DISPLAY",
|
Candy_Upgrade_Display = "CANDY_UPGRADE_DISPLAY",
|
||||||
Money_Format = "MONEY_FORMAT",
|
Money_Format = "MONEY_FORMAT",
|
||||||
@ -54,6 +55,7 @@ export const settingOptions: SettingOptions = {
|
|||||||
[Setting.Window_Type]: new Array(5).fill(null).map((_, i) => (i + 1).toString()),
|
[Setting.Window_Type]: new Array(5).fill(null).map((_, i) => (i + 1).toString()),
|
||||||
[Setting.Tutorials]: ["Off", "On"],
|
[Setting.Tutorials]: ["Off", "On"],
|
||||||
[Setting.Enable_Retries]: ["Off", "On"],
|
[Setting.Enable_Retries]: ["Off", "On"],
|
||||||
|
[Setting.Skip_Seen_Dialogues]: ["Off", "On"],
|
||||||
[Setting.Candy_Upgrade_Notification]: ["Off", "Passives Only", "On"],
|
[Setting.Candy_Upgrade_Notification]: ["Off", "Passives Only", "On"],
|
||||||
[Setting.Candy_Upgrade_Display]: ["Icon", "Animation"],
|
[Setting.Candy_Upgrade_Display]: ["Icon", "Animation"],
|
||||||
[Setting.Money_Format]: ["Normal", "Abbreviated"],
|
[Setting.Money_Format]: ["Normal", "Abbreviated"],
|
||||||
@ -81,6 +83,7 @@ export const settingDefaults: SettingDefaults = {
|
|||||||
[Setting.Window_Type]: 0,
|
[Setting.Window_Type]: 0,
|
||||||
[Setting.Tutorials]: 1,
|
[Setting.Tutorials]: 1,
|
||||||
[Setting.Enable_Retries]: 0,
|
[Setting.Enable_Retries]: 0,
|
||||||
|
[Setting.Skip_Seen_Dialogues]: 0,
|
||||||
[Setting.Candy_Upgrade_Notification]: 0,
|
[Setting.Candy_Upgrade_Notification]: 0,
|
||||||
[Setting.Candy_Upgrade_Display]: 0,
|
[Setting.Candy_Upgrade_Display]: 0,
|
||||||
[Setting.Money_Format]: 0,
|
[Setting.Money_Format]: 0,
|
||||||
@ -198,6 +201,9 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
|
|||||||
case Setting.Vibration:
|
case Setting.Vibration:
|
||||||
scene.enableVibration = settingOptions[setting][value] !== "Disabled" && hasTouchscreen();
|
scene.enableVibration = settingOptions[setting][value] !== "Disabled" && hasTouchscreen();
|
||||||
break;
|
break;
|
||||||
|
case Setting.Skip_Seen_Dialogues:
|
||||||
|
scene.skipSeenDialogues = settingOptions[setting][value] === "On";
|
||||||
|
break;
|
||||||
case Setting.Language:
|
case Setting.Language:
|
||||||
if (value) {
|
if (value) {
|
||||||
if (scene.ui) {
|
if (scene.ui) {
|
||||||
|
37
src/ui/ui.ts
37
src/ui/ui.ts
@ -259,15 +259,26 @@ export default class UI extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
// Add the prefix to the text
|
// Add the prefix to the text
|
||||||
const localizationKey = playerGenderPrefix + text;
|
const localizationKey = playerGenderPrefix + text;
|
||||||
|
|
||||||
// Get localized dialogue (if available)
|
// Get localized dialogue (if available)
|
||||||
|
let hasi18n = false;
|
||||||
if (i18next.exists(localizationKey as ParseKeys) ) {
|
if (i18next.exists(localizationKey as ParseKeys) ) {
|
||||||
|
|
||||||
|
|
||||||
text = i18next.t(localizationKey as ParseKeys);
|
text = i18next.t(localizationKey as ParseKeys);
|
||||||
|
hasi18n = true;
|
||||||
|
|
||||||
|
// Skip dialogue if the player has enabled the option and the dialogue has been already seen
|
||||||
|
if ((this.scene as BattleScene).skipSeenDialogues && (this.scene as BattleScene).gameData.getSeenDialogues()[localizationKey] === true) {
|
||||||
|
console.log(`Dialogue ${localizationKey} skipped`);
|
||||||
|
callback();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
let showMessageAndCallback = () => {
|
||||||
|
hasi18n && (this.scene as BattleScene).gameData.saveSeenDialogue(localizationKey);
|
||||||
|
callback();
|
||||||
|
};
|
||||||
if (text.indexOf("$") > -1) {
|
if (text.indexOf("$") > -1) {
|
||||||
const messagePages = text.split(/\$/g).map(m => m.trim());
|
const messagePages = text.split(/\$/g).map(m => m.trim());
|
||||||
let showMessageAndCallback = () => callback();
|
|
||||||
for (let p = messagePages.length - 1; p >= 0; p--) {
|
for (let p = messagePages.length - 1; p >= 0; p--) {
|
||||||
const originalFunc = showMessageAndCallback;
|
const originalFunc = showMessageAndCallback;
|
||||||
showMessageAndCallback = () => this.showDialogue(messagePages[p], name, null, originalFunc);
|
showMessageAndCallback = () => this.showDialogue(messagePages[p], name, null, originalFunc);
|
||||||
@ -276,13 +287,29 @@ export default class UI extends Phaser.GameObjects.Container {
|
|||||||
} else {
|
} else {
|
||||||
const handler = this.getHandler();
|
const handler = this.getHandler();
|
||||||
if (handler instanceof MessageUiHandler) {
|
if (handler instanceof MessageUiHandler) {
|
||||||
(handler as MessageUiHandler).showDialogue(text, name, delay, callback, callbackDelay, true, promptDelay);
|
(handler as MessageUiHandler).showDialogue(text, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay);
|
||||||
} else {
|
} else {
|
||||||
this.getMessageHandler().showDialogue(text, name, delay, callback, callbackDelay, true, promptDelay);
|
this.getMessageHandler().showDialogue(text, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shouldSkipDialogue(text): boolean {
|
||||||
|
let playerGenderPrefix = "PGM";
|
||||||
|
if ((this.scene as BattleScene).gameData.gender === PlayerGender.FEMALE) {
|
||||||
|
playerGenderPrefix = "PGF";
|
||||||
|
}
|
||||||
|
|
||||||
|
const key = playerGenderPrefix + text;
|
||||||
|
|
||||||
|
if (i18next.exists(key as ParseKeys) ) {
|
||||||
|
if ((this.scene as BattleScene).skipSeenDialogues && (this.scene as BattleScene).gameData.getSeenDialogues()[key] === true) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
showTooltip(title: string, content: string, overlap?: boolean): void {
|
showTooltip(title: string, content: string, overlap?: boolean): void {
|
||||||
this.tooltipContainer.setVisible(true);
|
this.tooltipContainer.setVisible(true);
|
||||||
this.tooltipTitle.setText(title || "");
|
this.tooltipTitle.setText(title || "");
|
||||||
|
Loading…
Reference in New Issue
Block a user