From f9e3b373d9baf33c3c3bd1ea67dbebd6a5051b8b Mon Sep 17 00:00:00 2001 From: chaosgrimmon <31082757+chaosgrimmon@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:45:06 -0400 Subject: [PATCH 01/11] [Sprite] Shiny Lycanroc Midnight using non-shiny Palette taken from static back --- .../pokemon/exp/back/shiny/745-midnight.png | Bin 3707 -> 3925 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/images/pokemon/exp/back/shiny/745-midnight.png b/public/images/pokemon/exp/back/shiny/745-midnight.png index 94a9c328d01bf8d1a573f8fc16230c0375ca0746..a7d7e0497b5cabfd2e036b43106f95577071ffca 100644 GIT binary patch literal 3925 zcmaJ^c{CK>`yMe_CXKRHmdVzn8B57F)Fc!UW#4DAYm6mpVKCXp7KI`^#SCWb#yZxl zStq8FrG)Gy^C5iIU%$V8_niB_&-*;jx%a&Hk9*D=d(YrDH`h5X006+PtD|LflsEov z4%VZ{NjRH(lvsR>Zr=oy4+$?F6_@Vmn`j^9Fi*Rc#Sc6@JUvx!IK>sE9AiapT0GEE zQi7g|@Vw8IeiXxRcW`ikobdBLa-Z}yGB5@l{@-PO=Of>d(5kDYVG@|NYWss)pmMVM za)ej$&ORz&liM9WRrxh}OkuIdy=6=q&M(zoR(@6XOoDC{zn|Ix@ zZmTUxsZwIp#7LhDg?HPy-tF?xvtpQH!fQj-M4%oyN8((CO7QxL&?bVAS9H`98vhEk z*WSJvG5VYp*;P0p$3f)Nm0oVTWT2%Iri$Tf zzK2Rzguui=PI_UA$90}4DNRj8e(5>}*H05W#a$&uYuC-p*qR%)WFPU0;uE7LyIWjCq^kkxy)+bjkI zclq-Sc3aud=;0wUN~=!Mp2)HHN<5fUS+a;Dg|hbPr+9zz&$-IlR=0I*P-|!#UfY6Y z#Kv7^(#i66x!p&AH9L84NL7CvIW??Ap9jqxL34AQ+pVNJ2_P3@Aqm}s=g4j zRC3OFY9cp#n4)7dq(|@zGwAzAQ1aAapn1x1it|AM>v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^mPBd!%0@k9cqMd+R{=7%SDIE@=-vvLBczp|E zr!sjQN0l8m<6C}^1s?|5W+dBnicymruQ)q>ohr3oZ*6%_iGNmBWTC|ZZpgaWOT!3t zVCMVvnxL7n!I(78zwzP%u6!CL1~dji-b+Sl0y8<7%P|WKSophlsP0TP@MIEAkNZh& z-cR=dwe1#!A{3?0ua40^-%^`cmJDWLLHr3B+;qg^vrwAc5Ytr)3_B0J+4^+vU2rE8 zQgBe|`APl;oTyT^p4(>>XwdaLmp~?V5F(0<=y~YnpE}re2{@U-S^dXTlP=Le%7hNW z#c<;0|3Ag9JA-O;0+((<;F?pVNau`xg-Lazuc?7yhQL)L@DM5~>LPHmfU|n`9XiKh zsTU@TdjK)|fwm?i`UxG(?YjzlgH)*#`SF|n{E7-gmHH3{)E91$eT Date: Wed, 28 Aug 2024 08:34:16 +0800 Subject: [PATCH 02/11] [Dev] Cleanup some opponent overrides + add new opp form override (#3733) * replace interger types, add opp form override * move code to EnemyPokemon class * Update src/field/pokemon.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/battle-scene.ts | 9 ++++----- src/field/pokemon.ts | 12 ++++++++++++ src/overrides.ts | 13 +++++++------ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 6da5c9482bc..2a920864850 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -844,14 +844,13 @@ export default class BattleScene extends SceneBase { if (Overrides.OPP_SPECIES_OVERRIDE) { species = getPokemonSpecies(Overrides.OPP_SPECIES_OVERRIDE); } - const pokemon = new EnemyPokemon(this, species, level, trainerSlot, boss, dataSource); + if (Overrides.OPP_LEVEL_OVERRIDE !== 0) { - pokemon.level = Overrides.OPP_LEVEL_OVERRIDE; + level = Overrides.OPP_LEVEL_OVERRIDE; } - if (Overrides.OPP_GENDER_OVERRIDE !== null) { - pokemon.gender = Overrides.OPP_GENDER_OVERRIDE; - } + const pokemon = new EnemyPokemon(this, species, level, trainerSlot, boss, dataSource); + overrideModifiers(this, false); overrideHeldItems(this, pokemon, false); if (boss && !dataSource) { diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index a8dfb9d6c48..8a3a6b280cb 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3758,6 +3758,18 @@ export class EnemyPokemon extends Pokemon { this.status = new Status(Overrides.OPP_STATUS_OVERRIDE); } + if (Overrides.OPP_GENDER_OVERRIDE) { + this.gender = Overrides.OPP_GENDER_OVERRIDE; + } + + const speciesId = this.species.speciesId; + + if (speciesId in Overrides.OPP_FORM_OVERRIDES + && Overrides.OPP_FORM_OVERRIDES[speciesId] + && this.species.forms[Overrides.OPP_FORM_OVERRIDES[speciesId]]) { + this.formIndex = Overrides.OPP_FORM_OVERRIDES[speciesId] ?? 0; + } + if (!dataSource) { this.generateAndPopulateMoveset(); diff --git a/src/overrides.ts b/src/overrides.ts index 8b3d628e05e..32ff116f41d 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -46,14 +46,14 @@ class DefaultOverrides { readonly SEED_OVERRIDE: string = ""; readonly WEATHER_OVERRIDE: WeatherType = WeatherType.NONE; readonly BATTLE_TYPE_OVERRIDE: "double" | "single" | null = null; - readonly STARTING_WAVE_OVERRIDE: integer = 0; + readonly STARTING_WAVE_OVERRIDE: number = 0; readonly STARTING_BIOME_OVERRIDE: Biome = Biome.TOWN; readonly ARENA_TINT_OVERRIDE: TimeOfDay | null = null; /** Multiplies XP gained by this value including 0. Set to null to ignore the override */ readonly XP_MULTIPLIER_OVERRIDE: number | null = null; readonly NEVER_CRIT_OVERRIDE: boolean = false; /** default 1000 */ - readonly STARTING_MONEY_OVERRIDE: integer = 0; + readonly STARTING_MONEY_OVERRIDE: number = 0; /** Sets all shop item prices to 0 */ readonly WAIVE_SHOP_FEES_OVERRIDE: boolean = false; /** Sets reroll price to 0 */ @@ -86,14 +86,14 @@ class DefaultOverrides { readonly STARTER_FORM_OVERRIDES: Partial> = {}; /** default 5 or 20 for Daily */ - readonly STARTING_LEVEL_OVERRIDE: integer = 0; + readonly STARTING_LEVEL_OVERRIDE: number = 0; /** * SPECIES OVERRIDE * will only apply to the first starter in your party or each enemy pokemon * default is 0 to not override * @example SPECIES_OVERRIDE = Species.Bulbasaur; */ - readonly STARTER_SPECIES_OVERRIDE: Species | integer = 0; + readonly STARTER_SPECIES_OVERRIDE: Species | number = 0; readonly ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; @@ -105,7 +105,7 @@ class DefaultOverrides { // -------------------------- // OPPONENT / ENEMY OVERRIDES // -------------------------- - readonly OPP_SPECIES_OVERRIDE: Species | integer = 0; + readonly OPP_SPECIES_OVERRIDE: Species | number = 0; readonly OPP_LEVEL_OVERRIDE: number = 0; readonly OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; @@ -114,7 +114,8 @@ class DefaultOverrides { readonly OPP_MOVESET_OVERRIDE: Array = []; readonly OPP_SHINY_OVERRIDE: boolean = false; readonly OPP_VARIANT_OVERRIDE: Variant = 0; - readonly OPP_IVS_OVERRIDE: integer | integer[] = []; + readonly OPP_IVS_OVERRIDE: number | number[] = []; + readonly OPP_FORM_OVERRIDES: Partial> = {}; // ------------- // EGG OVERRIDES From f34137a950da165da5291580ecf8baf844eef9f7 Mon Sep 17 00:00:00 2001 From: "gitlocalize-app[bot]" <55277160+gitlocalize-app[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:34:58 -0700 Subject: [PATCH 03/11] [Localization][KO] Translate missed things (settings, bgm-name) (#3857) * Translate bgm-name.json via GitLocalize * Translate settings.json via GitLocalize --------- Co-authored-by: Enoch --- src/locales/ko/bgm-name.json | 6 ++++-- src/locales/ko/settings.json | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/locales/ko/bgm-name.json b/src/locales/ko/bgm-name.json index bfb63e210c5..5295e2d8708 100644 --- a/src/locales/ko/bgm-name.json +++ b/src/locales/ko/bgm-name.json @@ -83,15 +83,17 @@ "battle_aether_grunt": "SM 에테르재단 배틀", "battle_skull_grunt": "SM 스컬단 배틀", "battle_macro_grunt": "SWSH 트레이너 배틀", + "battle_galactic_admin": "BDSP 갤럭시단 간부 배틀", + "battle_skull_admin": "SM 스컬단 간부 배틀", + "battle_oleana": "SWSH 올리브 배틀", "battle_rocket_boss": "USUM 비주기 배틀", "battle_aqua_magma_boss": "ORAS 아강 & 마적 배틀", "battle_galactic_boss": "BDSP 태홍 배틀", "battle_plasma_boss": "B2W2 게치스 배틀", "battle_flare_boss": "XY 플라드리 배틀", - "battle_aether_boss": "SM 루자미네 배틀", + "battle_aether_boss": "SM 루자미네 배틀", "battle_skull_boss": "SM 구즈마 배틀", "battle_macro_boss": "SWSH 로즈 배틀", - "abyss": "불가사의 던전 하늘의 탐험대 어둠의 화구", "badlands": "불가사의 던전 하늘의 탐험대 불모의 계곡", "beach": "불가사의 던전 하늘의 탐험대 축축한 암반", diff --git a/src/locales/ko/settings.json b/src/locales/ko/settings.json index d867d86a91a..b7fc01cb148 100644 --- a/src/locales/ko/settings.json +++ b/src/locales/ko/settings.json @@ -59,10 +59,11 @@ "fusionPaletteSwaps": "셰이더 적용", "playerGender": "플레이어 성별", "typeHints": "상성 힌트", - "masterVolume": "전체 볼륨", - "bgmVolume": "배경음악 볼륨", + "masterVolume": "마스터 볼륨", + "bgmVolume": "BGM 볼륨", "fieldVolume": "전투효과 볼륨", - "seVolume": "조작 볼륨", + "seVolume": "SE 볼륨", + "uiVolume": "UI 볼륨", "musicPreference": "음악 설정", "mixed": "믹스", "gamepadPleasePlug": "게임패드를 연결하거나 버튼을 입력하세요", From 214a9275a95f5b92550f1e80dfa46ff462556b38 Mon Sep 17 00:00:00 2001 From: Enoch Date: Wed, 28 Aug 2024 09:37:20 +0900 Subject: [PATCH 04/11] Add missed natureFragment (#3859) --- src/locales/en/pokemon-summary.json | 27 +++++++++++++++++++++++++++ src/locales/ko/pokemon-summary.json | 27 +++++++++++++++++++++++++++ src/ui/summary-ui-handler.ts | 5 +---- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/src/locales/en/pokemon-summary.json b/src/locales/en/pokemon-summary.json index 8d266999084..80e0cdab010 100644 --- a/src/locales/en/pokemon-summary.json +++ b/src/locales/en/pokemon-summary.json @@ -13,5 +13,32 @@ "metFragment": { "normal": "met at Lv{{level}},\n{{biome}}.", "apparently": "apparently met at Lv{{level}},\n{{biome}}." + }, + "natureFragment": { + "Hardy": "{{nature}}", + "Lonely": "{{nature}}", + "Brave": "{{nature}}", + "Adamant": "{{nature}}", + "Naughty": "{{nature}}", + "Bold": "{{nature}}", + "Docile": "{{nature}}", + "Relaxed": "{{nature}}", + "Impish": "{{nature}}", + "Lax": "{{nature}}", + "Timid": "{{nature}}", + "Hasty": "{{nature}}", + "Serious": "{{nature}}", + "Jolly": "{{nature}}", + "Naive": "{{nature}}", + "Modest": "{{nature}}", + "Mild": "{{nature}}", + "Quiet": "{{nature}}", + "Bashful": "{{nature}}", + "Rash": "{{nature}}", + "Calm": "{{nature}}", + "Gentle": "{{nature}}", + "Sassy": "{{nature}}", + "Careful": "{{nature}}", + "Quirky": "{{nature}}" } } \ No newline at end of file diff --git a/src/locales/ko/pokemon-summary.json b/src/locales/ko/pokemon-summary.json index 3deec35c62d..d9119623662 100644 --- a/src/locales/ko/pokemon-summary.json +++ b/src/locales/ko/pokemon-summary.json @@ -13,5 +13,32 @@ "metFragment": { "normal": "{{biome}}에서\n레벨 {{level}}일 때 만났다.", "apparently": "{{biome}}에서\n레벨 {{level}}일 때 만난 것 같다." + }, + "natureFragment": { + "Hardy": "{{nature}}하는 성격", + "Lonely": "{{nature}}을 타는 성격", + "Brave": "{{nature}}한 성격", + "Adamant": "{{nature}}스러운 성격", + "Naughty": "{{nature}}같은 성격", + "Bold": "{{nature}}한 성격", + "Docile": "{{nature}}한 성격", + "Relaxed": "{{nature}}한 성격", + "Impish": "{{nature}}같은 성격", + "Lax": "{{nature}}거리는 성격", + "Timid": "{{nature}}같은 성격", + "Hasty": "{{nature}}한 성격", + "Serious": "{{nature}}한 성격", + "Jolly": "{{nature}}한 성격", + "Naive": "{{nature}}한 성격", + "Modest": "{{nature}}스러운 성격", + "Mild": "{{nature}}한 성격", + "Quiet": "{{nature}}한 성격", + "Bashful": "{{nature}}을 타는 성격", + "Rash": "{{nature}}거리는 성격", + "Calm": "{{nature}}한 성격", + "Gentle": "{{nature}}한 성격", + "Sassy": "{{nature}}진 성격", + "Careful": "{{nature}}한 성격", + "Quirky": "{{nature}}스러운 성격" } } diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index e5def3a1961..ea7b798f2bf 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -825,10 +825,7 @@ export default class SummaryUiHandler extends UiHandler { biome: `${getBBCodeFrag(getBiomeName(this.pokemon?.metBiome!), TextStyle.SUMMARY_RED)}${closeFragment}`, // TODO: is this bang correct? level: `${getBBCodeFrag(this.pokemon?.metLevel.toString()!, TextStyle.SUMMARY_RED)}${closeFragment}`, // TODO: is this bang correct? }), - natureFragment: - i18next.exists(`pokemonSummary:natureFragment.${rawNature}`) ? - i18next.t(`pokemonSummary:natureFragment.${rawNature}`, { nature: nature }) : - nature, + natureFragment: i18next.t(`pokemonSummary:natureFragment.${rawNature}`, { nature: nature }) }); const memoText = addBBCodeTextObject(this.scene, 7, 113, String(memoString), TextStyle.WINDOW_ALT); From 4124ad0b937fc75fbb0988fbcaf06760aa53b2c4 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:47:09 -0700 Subject: [PATCH 05/11] Create the appropriate `startBattle()` functions in the helper classes (#3855) --- src/test/utils/gameManager.ts | 21 ++++++++++------ src/test/utils/helpers/classicModeHelper.ts | 27 +++++++++++++++++++++ src/test/utils/helpers/dailyModeHelper.ts | 26 ++++++++++++++++++++ 3 files changed, 66 insertions(+), 8 deletions(-) diff --git a/src/test/utils/gameManager.ts b/src/test/utils/gameManager.ts index cb3c547744b..d3c2652fcbe 100644 --- a/src/test/utils/gameManager.ts +++ b/src/test/utils/gameManager.ts @@ -1,6 +1,7 @@ import { updateUserInfo } from "#app/account"; import { BattlerIndex } from "#app/battle"; import BattleScene from "#app/battle-scene"; +import { BattleStyle } from "#app/enums/battle-style"; import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; import Trainer from "#app/field/trainer"; import { GameModes, getGameMode } from "#app/game-mode"; @@ -170,6 +171,8 @@ export default class GameManager { } /** + * @deprecated Use `game.classicMode.startBattle()` or `game.dailyMode.startBattle()` instead + * * Transitions to the start of a battle. * @param species - Optional array of species to start the battle with. * @returns A promise that resolves when the battle is started. @@ -177,15 +180,17 @@ export default class GameManager { async startBattle(species?: Species[]) { await this.classicMode.runToSummon(species); - this.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { - this.setMode(Mode.MESSAGE); - this.endPhase(); - }, () => this.isCurrentPhase(CommandPhase) || this.isCurrentPhase(TurnInitPhase)); + if (this.scene.battleStyle === BattleStyle.SWITCH) { + this.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { + this.setMode(Mode.MESSAGE); + this.endPhase(); + }, () => this.isCurrentPhase(CommandPhase) || this.isCurrentPhase(TurnInitPhase)); - this.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { - this.setMode(Mode.MESSAGE); - this.endPhase(); - }, () => this.isCurrentPhase(CommandPhase) || this.isCurrentPhase(TurnInitPhase)); + this.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { + this.setMode(Mode.MESSAGE); + this.endPhase(); + }, () => this.isCurrentPhase(CommandPhase) || this.isCurrentPhase(TurnInitPhase)); + } await this.phaseInterceptor.to(CommandPhase); console.log("==================[New Turn]=================="); diff --git a/src/test/utils/helpers/classicModeHelper.ts b/src/test/utils/helpers/classicModeHelper.ts index f41472303b4..55e995fc9dc 100644 --- a/src/test/utils/helpers/classicModeHelper.ts +++ b/src/test/utils/helpers/classicModeHelper.ts @@ -1,8 +1,11 @@ +import { BattleStyle } from "#app/enums/battle-style"; import { Species } from "#app/enums/species"; import { GameModes, getGameMode } from "#app/game-mode"; import overrides from "#app/overrides"; +import { CommandPhase } from "#app/phases/command-phase"; import { EncounterPhase } from "#app/phases/encounter-phase"; import { SelectStarterPhase } from "#app/phases/select-starter-phase"; +import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { Mode } from "#app/ui/ui"; import { generateStarter } from "../gameManagerUtils"; import { GameManagerHelper } from "./gameManagerHelper"; @@ -33,4 +36,28 @@ export class ClassicModeHelper extends GameManagerHelper { this.game.removeEnemyHeldItems(); } } + + /** + * Transitions to the start of a battle. + * @param species - Optional array of species to start the battle with. + * @returns A promise that resolves when the battle is started. + */ + async startBattle(species?: Species[]) { + await this.runToSummon(species); + + if (this.game.scene.battleStyle === BattleStyle.SWITCH) { + this.game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { + this.game.setMode(Mode.MESSAGE); + this.game.endPhase(); + }, () => this.game.isCurrentPhase(CommandPhase) || this.game.isCurrentPhase(TurnInitPhase)); + + this.game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { + this.game.setMode(Mode.MESSAGE); + this.game.endPhase(); + }, () => this.game.isCurrentPhase(CommandPhase) || this.game.isCurrentPhase(TurnInitPhase)); + } + + await this.game.phaseInterceptor.to(CommandPhase); + console.log("==================[New Turn]=================="); + } } diff --git a/src/test/utils/helpers/dailyModeHelper.ts b/src/test/utils/helpers/dailyModeHelper.ts index d68edf43647..e40fada8ac7 100644 --- a/src/test/utils/helpers/dailyModeHelper.ts +++ b/src/test/utils/helpers/dailyModeHelper.ts @@ -1,7 +1,10 @@ +import { BattleStyle } from "#app/enums/battle-style"; import { Button } from "#app/enums/buttons"; import overrides from "#app/overrides"; +import { CommandPhase } from "#app/phases/command-phase"; import { EncounterPhase } from "#app/phases/encounter-phase"; import { TitlePhase } from "#app/phases/title-phase"; +import { TurnInitPhase } from "#app/phases/turn-init-phase"; import SaveSlotSelectUiHandler from "#app/ui/save-slot-select-ui-handler"; import { Mode } from "#app/ui/ui"; import { GameManagerHelper } from "./gameManagerHelper"; @@ -34,4 +37,27 @@ export class DailyModeHelper extends GameManagerHelper { this.game.removeEnemyHeldItems(); } } + + /** + * Transitions to the start of a battle. + * @returns A promise that resolves when the battle is started. + */ + async startBattle() { + await this.runToSummon(); + + if (this.game.scene.battleStyle === BattleStyle.SWITCH) { + this.game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { + this.game.setMode(Mode.MESSAGE); + this.game.endPhase(); + }, () => this.game.isCurrentPhase(CommandPhase) || this.game.isCurrentPhase(TurnInitPhase)); + + this.game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { + this.game.setMode(Mode.MESSAGE); + this.game.endPhase(); + }, () => this.game.isCurrentPhase(CommandPhase) || this.game.isCurrentPhase(TurnInitPhase)); + } + + await this.game.phaseInterceptor.to(CommandPhase); + console.log("==================[New Turn]=================="); + } } From 35af6b2cbc062135935b01edb37add411f5e76a1 Mon Sep 17 00:00:00 2001 From: "gitlocalize-app[bot]" <55277160+gitlocalize-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:15:56 +0200 Subject: [PATCH 06/11] Translate pokemon-summary.json via GitLocalize (#3864) Co-authored-by: Jannik Tappert --- src/locales/de/pokemon-summary.json | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/locales/de/pokemon-summary.json b/src/locales/de/pokemon-summary.json index deb4a69f248..1790c6878b9 100644 --- a/src/locales/de/pokemon-summary.json +++ b/src/locales/de/pokemon-summary.json @@ -13,5 +13,32 @@ "metFragment": { "normal": "Herkunft: {{biome}}\nMit Lv. {{level}} erhalten.", "apparently": "Herkunft: {{biome}}\nOffenbar mit Lv. {{level}} erhalten." + }, + "natureFragment": { + "Hardy": "{{nature}}", + "Lonely": "{{nature}}", + "Brave": "{{nature}}", + "Adamant": "{{nature}}", + "Naughty": "{{nature}}", + "Bold": "{{nature}}", + "Docile": "{{nature}}", + "Relaxed": "{{nature}}", + "Impish": "{{nature}}", + "Lax": "{{nature}}", + "Timid": "{{nature}}", + "Hasty": "{{nature}}", + "Serious": "{{nature}}", + "Jolly": "{{nature}}", + "Naive": "{{nature}}", + "Modest": "{{nature}}", + "Mild": "{{nature}}", + "Quiet": "{{nature}}", + "Bashful": "{{nature}}", + "Rash": "{{nature}}", + "Calm": "{{nature}}", + "Gentle": "{{nature}}", + "Sassy": "{{nature}}", + "Careful": "{{nature}}", + "Quirky": "{{nature}}" } -} \ No newline at end of file +} From ad4b4a0af759962acc428d2606d9f6ce7e55f36c Mon Sep 17 00:00:00 2001 From: "gitlocalize-app[bot]" <55277160+gitlocalize-app[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 01:06:39 +0900 Subject: [PATCH 07/11] [Localisation] [ES] Reviewed and translated missing settings.json (#3865) * Translate settings.json via GitLocalize * Translate settings.json via GitLocalize --------- Co-authored-by: Rafa Co-authored-by: Asdar --- src/locales/es/settings.json | 102 ++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/src/locales/es/settings.json b/src/locales/es/settings.json index 2351abf04ae..ff37c8464bf 100644 --- a/src/locales/es/settings.json +++ b/src/locales/es/settings.json @@ -2,6 +2,106 @@ "boy": "Chico", "girl": "Chica", "general": "General", + "display": "Pantalla", "audio": "Audio", - "shopOverlayOpacity": "Opacidad de la fase de compra" + "gamepad": "Mando", + "keyboard": "Teclado", + "gameSpeed": "Veloc. del juego", + "hpBarSpeed": "Veloc. Barra PS", + "expGainsSpeed": "Veloc. de EXP", + "expPartyDisplay": "Mostrar EXP del Equipo", + "skipSeenDialogues": "Saltar diálogos leídos", + "battleStyle": "Estilo de lucha", + "enableRetries": "Activar reintento", + "hideIvs": "Ocultar escáner de IVs", + "tutorials": "Tutoriales", + "touchControls": "Control táctil", + "vibrations": "Vibración", + "normal": "Normal", + "fast": "+1", + "faster": "+2", + "skip": "Saltar", + "levelUpNotifications": "Aumentos de nivel", + "on": "Sí", + "off": "No", + "switch": "Cambiar", + "set": "Mantener", + "auto": "Auto.", + "disabled": "Desact.", + "language": "Idioma", + "change": "Cambiar", + "uiTheme": "Color UI", + "default": "Predet.", + "legacy": "Clásico", + "windowType": "Ventana", + "moneyFormat": "Formato Dinero", + "damageNumbers": "Cifras de daño", + "simple": "Simple", + "fancy": "Elegante", + "abbreviated": "Abreviado", + "moveAnimations": "Animación de Movs.", + "showStatsOnLevelUp": "Estadísticas al Aum. Nivel", + "candyUpgradeNotification": "Notificar Mejora Caramelo", + "passivesOnly": "Solo Pasivas", + "candyUpgradeDisplay": "Muestra Mejora Caramelo", + "icon": "Icono", + "animation": "Animación", + "moveInfo": "Info. Movimiento", + "showMovesetFlyout": "Descripción de Movimientos", + "showArenaFlyout": "Descripción de Escenarios", + "showTimeOfDayWidget": "Mostrar Hora del Día", + "timeOfDayAnimation": "Animación Hora del Día", + "bounce": "Rebote", + "timeOfDay_back": "Vuelta", + "spriteSet": "Set de Sprites", + "consistent": "Consistente", + "mixedAnimated": "Animación mixta", + "fusionPaletteSwaps": "Colores de fusión", + "playerGender": "Género del jugador", + "typeHints": "Pistas de tipos", + "masterVolume": "Volumen total", + "bgmVolume": "Volumen música", + "fieldVolume": "Volumen escenario", + "seVolume": "Volumen efectos", + "uiVolume": "Volumen sistema", + "musicPreference": "Preferencia musical", + "mixed": "Mixta", + "gamepadPleasePlug": "Conecta un mando o pulsa un botón", + "delete": "Eliminar", + "keyboardPleasePress": "Pulsa una tecla de tu teclado", + "reset": "Restablecer", + "requireReload": "Requiere reinicio", + "action": "Acción", + "back": "Atrás", + "pressToBind": "Pulsa para vincular", + "pressButton": "Pulsa un botón...", + "buttonUp": "Arriba", + "buttonDown": "Abajo", + "buttonLeft": "Izquierda", + "buttonRight": "Derecha", + "buttonAction": "Acción", + "buttonMenu": "Menú", + "buttonSubmit": "Confirmar", + "buttonCancel": "Cancelar", + "buttonStats": "Estadísticas", + "buttonCycleForm": "Cambiar forma", + "buttonCycleShiny": "Cambiar shiny", + "buttonCycleGender": "Cambiar género", + "buttonCycleAbility": "Cambiar habilidad", + "buttonCycleNature": "Cambiar naturaleza", + "buttonCycleVariant": "Cambiar variante", + "buttonSpeedUp": "Acelerar", + "buttonSlowDown": "Ralentizar", + "alt": " (Alt.)", + "mute": "Silenciar", + "controller": "Mando", + "gamepadSupport": "Soporte de mando", + "showBgmBar": "Mostrar título de canción", + "moveTouchControls": "Controles táctiles", + "shopOverlayOpacity": "Opacidad de la fase de compra", + "shopCursorTarget": "Cursor de la tienda", + "items": "Objetos", + "reroll": "Actualizar", + "shop": "Tienda", + "checkTeam": "Ver equipo" } From 170a5831bf928edf6de4c348889d9c9002c0e39b Mon Sep 17 00:00:00 2001 From: Mumble <171087428+frutescens@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:01:15 -0700 Subject: [PATCH 08/11] [Bug] Updating ModifierItems' audio keys (#3853) Co-authored-by: frutescens --- src/modifier/modifier-type.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index beec048754e..938f73a1e08 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -57,7 +57,7 @@ export class ModifierType { this.localeKey = localeKey!; // TODO: is this bang correct? this.iconImage = iconImage!; // TODO: is this bang correct? this.group = group!; // TODO: is this bang correct? - this.soundName = soundName ?? "restore"; + this.soundName = soundName ?? "se/restore"; this.newModifierFunc = newModifierFunc; } @@ -169,7 +169,7 @@ class AddPokeballModifierType extends ModifierType { private count: integer; constructor(iconImage: string, pokeballType: PokeballType, count: integer) { - super("", iconImage, (_type, _args) => new Modifiers.AddPokeballModifier(this, pokeballType, count), "pb", "pb_bounce_1"); + super("", iconImage, (_type, _args) => new Modifiers.AddPokeballModifier(this, pokeballType, count), "pb", "se/pb_bounce_1"); this.pokeballType = pokeballType; this.count = count; } @@ -677,7 +677,7 @@ export class MoneyRewardModifierType extends ModifierType { private moneyMultiplierDescriptorKey: string; constructor(localeKey: string, iconImage: string, moneyMultiplier: number, moneyMultiplierDescriptorKey: string) { - super(localeKey, iconImage, (_type, _args) => new Modifiers.MoneyRewardModifier(this, moneyMultiplier), "money", "buy"); + super(localeKey, iconImage, (_type, _args) => new Modifiers.MoneyRewardModifier(this, moneyMultiplier), "money", "se/buy"); this.moneyMultiplier = moneyMultiplier; this.moneyMultiplierDescriptorKey = moneyMultiplierDescriptorKey; @@ -1462,7 +1462,7 @@ export const modifierTypes = { VOUCHER_PLUS: () => new AddVoucherModifierType(VoucherType.PLUS, 1), VOUCHER_PREMIUM: () => new AddVoucherModifierType(VoucherType.PREMIUM, 1), - GOLDEN_POKEBALL: () => new ModifierType("modifierType:ModifierType.GOLDEN_POKEBALL", "pb_gold", (type, _args) => new Modifiers.ExtraModifierModifier(type), undefined, "pb_bounce_1"), + GOLDEN_POKEBALL: () => new ModifierType("modifierType:ModifierType.GOLDEN_POKEBALL", "pb_gold", (type, _args) => new Modifiers.ExtraModifierModifier(type), undefined, "se/pb_bounce_1"), ENEMY_DAMAGE_BOOSTER: () => new ModifierType("modifierType:ModifierType.ENEMY_DAMAGE_BOOSTER", "wl_item_drop", (type, _args) => new Modifiers.EnemyDamageBoosterModifier(type, 5)), ENEMY_DAMAGE_REDUCTION: () => new ModifierType("modifierType:ModifierType.ENEMY_DAMAGE_REDUCTION", "wl_guard_spec", (type, _args) => new Modifiers.EnemyDamageReducerModifier(type, 2.5)), From fd81a5d3b38bfb536e91536971c5ac4180991296 Mon Sep 17 00:00:00 2001 From: "gitlocalize-app[bot]" <55277160+gitlocalize-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 20:27:12 +0200 Subject: [PATCH 09/11] Translate settings.json via GitLocalize (#3867) Co-authored-by: Asdar --- src/locales/es/settings.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/locales/es/settings.json b/src/locales/es/settings.json index ff37c8464bf..9c16fbb0fd6 100644 --- a/src/locales/es/settings.json +++ b/src/locales/es/settings.json @@ -7,7 +7,7 @@ "gamepad": "Mando", "keyboard": "Teclado", "gameSpeed": "Veloc. del juego", - "hpBarSpeed": "Veloc. Barra PS", + "hpBarSpeed": "Veloc. barra PS", "expGainsSpeed": "Veloc. de EXP", "expPartyDisplay": "Mostrar EXP del Equipo", "skipSeenDialogues": "Saltar diálogos leídos", @@ -34,28 +34,28 @@ "default": "Predet.", "legacy": "Clásico", "windowType": "Ventana", - "moneyFormat": "Formato Dinero", + "moneyFormat": "Formato dinero", "damageNumbers": "Cifras de daño", "simple": "Simple", "fancy": "Elegante", "abbreviated": "Abreviado", - "moveAnimations": "Animación de Movs.", - "showStatsOnLevelUp": "Estadísticas al Aum. Nivel", - "candyUpgradeNotification": "Notificar Mejora Caramelo", - "passivesOnly": "Solo Pasivas", - "candyUpgradeDisplay": "Muestra Mejora Caramelo", + "moveAnimations": "Animación de movs.", + "showStatsOnLevelUp": "Estadísticas al aum. nivel", + "candyUpgradeNotification": "Aviso de caramelos", + "passivesOnly": "Solo pasivas", + "candyUpgradeDisplay": "Muestra de caramelos", "icon": "Icono", "animation": "Animación", - "moveInfo": "Info. Movimiento", - "showMovesetFlyout": "Descripción de Movimientos", - "showArenaFlyout": "Descripción de Escenarios", - "showTimeOfDayWidget": "Mostrar Hora del Día", - "timeOfDayAnimation": "Animación Hora del Día", + "moveInfo": "Info. de movimientos", + "showMovesetFlyout": "Descripción de movimientos", + "showArenaFlyout": "Descripción de escenarios", + "showTimeOfDayWidget": "Mostrar hora del día", + "timeOfDayAnimation": "Animación hora del día", "bounce": "Rebote", "timeOfDay_back": "Vuelta", - "spriteSet": "Set de Sprites", + "spriteSet": "Set de sprites", "consistent": "Consistente", - "mixedAnimated": "Animación mixta", + "mixedAnimated": "Mixto", "fusionPaletteSwaps": "Colores de fusión", "playerGender": "Género del jugador", "typeHints": "Pistas de tipos", From 447d47ef477bde42183f0d72560f413d4800fe5b Mon Sep 17 00:00:00 2001 From: "gitlocalize-app[bot]" <55277160+gitlocalize-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 20:29:15 +0200 Subject: [PATCH 10/11] Translate trainer-names.json via GitLocalize (#3860) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: José Ricardo --- src/locales/pt_BR/trainer-names.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/locales/pt_BR/trainer-names.json b/src/locales/pt_BR/trainer-names.json index fc4e48de040..5500e2ddb46 100644 --- a/src/locales/pt_BR/trainer-names.json +++ b/src/locales/pt_BR/trainer-names.json @@ -138,11 +138,17 @@ "rood": "Rood", "xerosic": "Xerosic", "bryony": "Bryony", + "faba": "Faba", + "plumeria": "Plumeria", + "oleana": "Oleana", "maxie": "Maxie", "archie": "Archie", "cyrus": "Cyrus", "ghetsis": "Ghetsis", "lysandre": "Lysandre", + "lusamine": "Lusamine", + "guzma": "Guzma", + "rose": "Rose", "blue_red_double": "Blue & Red", "red_blue_double": "Red & Blue", "tate_liza_double": "Tate & Liza", @@ -153,4 +159,4 @@ "iris_alder_double": "Iris & Alder", "marnie_piers_double": "Marnie & Piers", "piers_marnie_double": "Piers & Marnie" -} \ No newline at end of file +} From e0bcb2ef27f02c510837087f1ffcabaa7ac22cdd Mon Sep 17 00:00:00 2001 From: Mumble <171087428+frutescens@users.noreply.github.com> Date: Wed, 28 Aug 2024 12:00:38 -0700 Subject: [PATCH 11/11] [P3 Bug] Run History function saves the most-recent session data possible (#3838) Co-authored-by: frutescens --- src/phases/game-over-phase.ts | 72 ++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/src/phases/game-over-phase.ts b/src/phases/game-over-phase.ts index a42e8472952..78dd73057a1 100644 --- a/src/phases/game-over-phase.ts +++ b/src/phases/game-over-phase.ts @@ -1,19 +1,19 @@ -import { clientSessionId } from "#app/account.js"; -import BattleScene from "#app/battle-scene.js"; -import { BattleType } from "#app/battle.js"; -import { miscDialogue, getCharVariantFromDialogue } from "#app/data/dialogue.js"; -import { pokemonEvolutions } from "#app/data/pokemon-evolutions.js"; -import PokemonSpecies, { getPokemonSpecies } from "#app/data/pokemon-species.js"; -import { trainerConfigs } from "#app/data/trainer-config.js"; -import { PlayerGender } from "#app/enums/player-gender.js"; -import { TrainerType } from "#app/enums/trainer-type.js"; -import Pokemon from "#app/field/pokemon.js"; -import { modifierTypes } from "#app/modifier/modifier-type.js"; -import { achvs, ChallengeAchv } from "#app/system/achv.js"; -import { Unlockables } from "#app/system/unlockables.js"; -import { Mode } from "#app/ui/ui.js"; +import { clientSessionId } from "#app/account"; +import BattleScene from "#app/battle-scene"; +import { BattleType } from "#app/battle"; +import { miscDialogue, getCharVariantFromDialogue } from "#app/data/dialogue"; +import { pokemonEvolutions } from "#app/data/pokemon-evolutions"; +import PokemonSpecies, { getPokemonSpecies } from "#app/data/pokemon-species"; +import { trainerConfigs } from "#app/data/trainer-config"; +import { PlayerGender } from "#app/enums/player-gender"; +import { TrainerType } from "#app/enums/trainer-type"; +import Pokemon from "#app/field/pokemon"; +import { modifierTypes } from "#app/modifier/modifier-type"; +import { achvs, ChallengeAchv } from "#app/system/achv"; +import { Unlockables } from "#app/system/unlockables"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { BattlePhase } from "./battle-phase"; import { CheckSwitchPhase } from "./check-switch-phase"; import { EncounterPhase } from "./encounter-phase"; @@ -23,6 +23,12 @@ import { SummonPhase } from "./summon-phase"; import { EndCardPhase } from "./end-card-phase"; import { PostGameOverPhase } from "./post-game-over-phase"; import { UnlockPhase } from "./unlock-phase"; +import { SessionSaveData } from "../system/game-data"; +import TrainerData from "../system/trainer-data"; +import PokemonData from "../system/pokemon-data"; +import PersistentModifierData from "../system/modifier-data"; +import ChallengeData from "../system/challenge-data"; +import ArenaData from "../system/arena-data"; export class GameOverPhase extends BattlePhase { private victory: boolean; @@ -98,13 +104,7 @@ export class GameOverPhase extends BattlePhase { this.scene.gameData.gameStats.dailyRunSessionsWon++; } } - this.scene.gameData.getSession(this.scene.sessionSlotId).then(sessionData => { - if (sessionData) { - this.scene.gameData.saveRunHistory(this.scene, sessionData, this.victory); - } - }).catch(err => { - console.error("Failed to save run to history.", err); - }); + this.scene.gameData.saveRunHistory(this.scene, this.getFinalSessionData(), this.victory); const fadeDuration = this.victory ? 10000 : 5000; this.scene.fadeOutBgm(fadeDuration, true); const activeBattlers = this.scene.getField().filter(p => p?.isActive(true)); @@ -207,4 +207,32 @@ export class GameOverPhase extends BattlePhase { this.firstRibbons.push(getPokemonSpecies(pokemon.species.getRootSpeciesId(forStarter))); } } + + /** + * This function mirrors game-data.ts' getSessionSaveData() to update the session data to reflect any changes that occurred within the last wave + * This means that level ups, item usage, evolutions, etc. will all be accurately reflected. + * @returns {@linkCode SessionSaveData} an updated version of the wave's SessionSaveData that accurately reflects the events of the wave + */ + private getFinalSessionData(): SessionSaveData { + return { + seed: this.scene.seed, + playTime: this.scene.sessionPlayTime, + gameMode: this.scene.gameMode.modeId, + party: this.scene.getParty().map(p => new PokemonData(p)), + enemyParty: this.scene.getEnemyParty().map(p => new PokemonData(p)), + modifiers: this.scene.findModifiers(() => true).map(m => new PersistentModifierData(m, true)), + enemyModifiers: this.scene.findModifiers(() => true, false).map(m => new PersistentModifierData(m, false)), + arena: new ArenaData(this.scene.arena), + pokeballCounts: this.scene.pokeballCounts, + money: this.scene.money, + score: this.scene.score, + waveIndex: this.scene.currentBattle.waveIndex, + battleType: this.scene.currentBattle.battleType, + trainer: this.scene.currentBattle.battleType === BattleType.TRAINER ? new TrainerData(this.scene.currentBattle.trainer) : null, + gameVersion: this.scene.game.config.gameVersion, + timestamp: new Date().getTime(), + challenges: this.scene.gameMode.challenges.map(c => new ChallengeData(c)) + } as SessionSaveData; + } } +