From 03d68f877a64514efc084e3bd2077ad899128b8b Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Sun, 12 May 2024 01:25:48 +1000 Subject: [PATCH 1/9] Fix fluctuating xp curve (#743) Was scaling with square of level, not cube. --- src/data/exp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/exp.ts b/src/data/exp.ts index 4b8eb972f51..d416734bede 100644 --- a/src/data/exp.ts +++ b/src/data/exp.ts @@ -43,7 +43,7 @@ export function getLevelTotalExp(level: integer, growthRate: GrowthRate): intege ret = Math.pow(level, 3) * 5 / 4; break; case GrowthRate.FLUCTUATING: - ret = (Math.pow(level, 3) + ((level / 2) + 32)) * 4 / (100 + level); + ret = (Math.pow(level, 3) * ((level / 2) + 32)) * 4 / (100 + level); break; } From 6b49b4f4692949c9b0a4b8802c257e72869dca2d Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Sun, 12 May 2024 02:54:05 +1000 Subject: [PATCH 2/9] Lowers xp curve for fluctuating slightly (#746) --- src/data/exp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/exp.ts b/src/data/exp.ts index d416734bede..4a0fd2879c2 100644 --- a/src/data/exp.ts +++ b/src/data/exp.ts @@ -43,7 +43,7 @@ export function getLevelTotalExp(level: integer, growthRate: GrowthRate): intege ret = Math.pow(level, 3) * 5 / 4; break; case GrowthRate.FLUCTUATING: - ret = (Math.pow(level, 3) * ((level / 2) + 32)) * 4 / (100 + level); + ret = (Math.pow(level, 3) * ((level / 2) + 8)) * 4 / (100 + level); break; } From 34aa68df1498bce0587a9843408c160e12108f68 Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Sun, 12 May 2024 04:15:01 +1000 Subject: [PATCH 3/9] Fix fusion icon variant id (#747) --- src/field/pokemon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index f879ec1a8db..e11a0503241 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -423,7 +423,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } getFusionIconId(ignoreOverride?: boolean): string { - return this.getFusionSpeciesForm(ignoreOverride).getIconId(this.getFusionGender(ignoreOverride) === Gender.FEMALE, this.fusionFormIndex, this.fusionShiny, this.variant); + return this.getFusionSpeciesForm(ignoreOverride).getIconId(this.getFusionGender(ignoreOverride) === Gender.FEMALE, this.fusionFormIndex, this.fusionShiny, this.fusionVariant); } getSpeciesForm(ignoreOverride?: boolean): PokemonSpeciesForm { From 3f9158083e010481b2d78b8e06d64df57933137f Mon Sep 17 00:00:00 2001 From: Madmadness65 Date: Sat, 11 May 2024 14:20:54 -0500 Subject: [PATCH 4/9] Swap Rayquaza's egg moves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With egg moves factoring in to trainer Pokémon's learnsets now, Oblivion Wing was too problematic for a common egg move. So it has been swapped with V-create to make fights with it more tolerable. --- src/data/egg-moves.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/egg-moves.ts b/src/data/egg-moves.ts index 0452297797d..61099c72fdf 100644 --- a/src/data/egg-moves.ts +++ b/src/data/egg-moves.ts @@ -197,7 +197,7 @@ export const speciesEggMoves = { [Species.LATIOS]: [ Moves.CORE_ENFORCER, Moves.SEARING_SHOT, Moves.DRAGON_ENERGY, Moves.QUIVER_DANCE ], [Species.KYOGRE]: [ Moves.BOUNCY_BUBBLE, Moves.HURRICANE, Moves.THUNDER, Moves.TAIL_GLOW ], [Species.GROUDON]: [ Moves.STONE_AXE, Moves.SOLAR_BLADE, Moves.MORNING_SUN, Moves.SACRED_FIRE ], - [Species.RAYQUAZA]: [ Moves.OBLIVION_WING, Moves.DRAGON_DARTS, Moves.DRAGON_ENERGY, Moves.V_CREATE ], + [Species.RAYQUAZA]: [ Moves.V_CREATE, Moves.DRAGON_DARTS, Moves.DRAGON_ENERGY, Moves.OBLIVION_WING ], [Species.JIRACHI]: [ Moves.IRON_HEAD, Moves.FLOATY_FALL, Moves.ROCK_SLIDE, Moves.SHIFT_GEAR ], [Species.DEOXYS]: [ Moves.COLLISION_COURSE, Moves.EARTH_POWER, Moves.PARTING_SHOT, Moves.LUMINA_CRASH ], [Species.TURTWIG]: [ Moves.SHELL_SMASH, Moves.MIGHTY_CLEAVE, Moves.ICE_SPINNER, Moves.SAPPY_SEED ], From f540b7d17fa01a6f43e3f9ba237f92c682e2fe9b Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 11 May 2024 20:33:03 -0400 Subject: [PATCH 5/9] Fix always clearing first slot in offline mode --- src/system/game-data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/game-data.ts b/src/system/game-data.ts index bd1fcfae048..a213a35490a 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -754,7 +754,7 @@ export class GameData { tryClearSession(scene: BattleScene, slotId: integer): Promise<[success: boolean, newClear: boolean]> { return new Promise<[boolean, boolean]>(resolve => { if (bypassLogin) { - localStorage.removeItem('sessionData'); + localStorage.removeItem(`sessionData${slotId ? slotId : ''}`); return resolve([true, true]); } From e9ca17c51929b21cbbc6939bad9a9201a709b823 Mon Sep 17 00:00:00 2001 From: ArceUseless <36188730+ArceUseless@users.noreply.github.com> Date: Sun, 12 May 2024 04:04:09 +0200 Subject: [PATCH 6/9] New growth rate lang files (#563) * New growth rate lang files * Update i18n.ts, fixing overwrite * Added growth to lang conf files --------- Co-authored-by: rnicar --- src/locales/de/config.ts | 4 +++- src/locales/de/growth.ts | 10 ++++++++++ src/locales/en/config.ts | 4 +++- src/locales/en/growth.ts | 10 ++++++++++ src/locales/es/config.ts | 4 +++- src/locales/es/growth.ts | 10 ++++++++++ src/locales/fr/config.ts | 4 +++- src/locales/fr/growth.ts | 10 ++++++++++ src/locales/it/config.ts | 4 +++- src/locales/it/growth.ts | 10 ++++++++++ src/plugins/i18n.ts | 1 + src/ui/starter-select-ui-handler.ts | 9 ++++++++- 12 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 src/locales/de/growth.ts create mode 100644 src/locales/en/growth.ts create mode 100644 src/locales/es/growth.ts create mode 100644 src/locales/fr/growth.ts create mode 100644 src/locales/it/growth.ts diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index c388d7dec99..e876fa48fc7 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -2,6 +2,7 @@ import { ability } from "./ability"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; import { fightUiHandler } from "./fight-ui-handler"; +import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; @@ -24,5 +25,6 @@ export const deConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + growth: growth } \ No newline at end of file diff --git a/src/locales/de/growth.ts b/src/locales/de/growth.ts new file mode 100644 index 00000000000..a0d1cb5eeaa --- /dev/null +++ b/src/locales/de/growth.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const growth: SimpleTranslationEntries = { + "Erratic": "Erratic", + "Fast": "Fast", + "Medium_Fast": "Medium Fast", + "Medium_Slow": "Medium Slow", + "Slow": "Slow", + "Fluctuating": "Fluctuating" +} as const; \ No newline at end of file diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index 11cbc42d965..d1aa349b728 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -2,6 +2,7 @@ import { ability } from "./ability"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; import { fightUiHandler } from "./fight-ui-handler"; +import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; @@ -24,5 +25,6 @@ export const enConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + growth: growth } \ No newline at end of file diff --git a/src/locales/en/growth.ts b/src/locales/en/growth.ts new file mode 100644 index 00000000000..a0d1cb5eeaa --- /dev/null +++ b/src/locales/en/growth.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const growth: SimpleTranslationEntries = { + "Erratic": "Erratic", + "Fast": "Fast", + "Medium_Fast": "Medium Fast", + "Medium_Slow": "Medium Slow", + "Slow": "Slow", + "Fluctuating": "Fluctuating" +} as const; \ No newline at end of file diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index 093a4b39351..ecb9538dacd 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -2,6 +2,7 @@ import { ability } from "./ability"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; import { fightUiHandler } from "./fight-ui-handler"; +import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; @@ -24,5 +25,6 @@ export const esConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + growth: growth } \ No newline at end of file diff --git a/src/locales/es/growth.ts b/src/locales/es/growth.ts new file mode 100644 index 00000000000..d89f5c16b2b --- /dev/null +++ b/src/locales/es/growth.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const growth: SimpleTranslationEntries = { + "Erratic": "Errático", + "Fast": "Rápido", + "Medium_Fast": "Medio Rápido", + "Medium_Slow": "Medio Lento", + "Slow": "Lento", + "Fluctuating": "Fluctuante" +} as const; \ No newline at end of file diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index a2e678ca695..5b2668ccc1e 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -2,6 +2,7 @@ import { ability } from "./ability"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; import { fightUiHandler } from "./fight-ui-handler"; +import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; @@ -24,5 +25,6 @@ export const frConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + growth: growth } \ No newline at end of file diff --git a/src/locales/fr/growth.ts b/src/locales/fr/growth.ts new file mode 100644 index 00000000000..a0d1cb5eeaa --- /dev/null +++ b/src/locales/fr/growth.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const growth: SimpleTranslationEntries = { + "Erratic": "Erratic", + "Fast": "Fast", + "Medium_Fast": "Medium Fast", + "Medium_Slow": "Medium Slow", + "Slow": "Slow", + "Fluctuating": "Fluctuating" +} as const; \ No newline at end of file diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index af394bd64c4..d641e66c672 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -2,6 +2,7 @@ import { ability } from "./ability"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; import { fightUiHandler } from "./fight-ui-handler"; +import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; @@ -24,5 +25,6 @@ export const itConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + growth: growth } \ No newline at end of file diff --git a/src/locales/it/growth.ts b/src/locales/it/growth.ts new file mode 100644 index 00000000000..a0d1cb5eeaa --- /dev/null +++ b/src/locales/it/growth.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const growth: SimpleTranslationEntries = { + "Erratic": "Erratic", + "Fast": "Fast", + "Medium_Fast": "Medium Fast", + "Medium_Slow": "Medium Slow", + "Slow": "Slow", + "Fluctuating": "Fluctuating" +} as const; \ No newline at end of file diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 91006979b2d..d5a37127eae 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -103,6 +103,7 @@ declare module 'i18next' { fightUiHandler: SimpleTranslationEntries; tutorial: SimpleTranslationEntries; starterSelectUiHandler: SimpleTranslationEntries; + growth: SimpleTranslationEntries; }; } } diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 514bb173a5c..b341cf947fd 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1294,7 +1294,14 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonLuckText.setTint(getVariantTint(Math.min(luck - 1, 2) as Variant)); this.pokemonLuckLabelText.setVisible(this.pokemonLuckText.visible); - this.pokemonGrowthRateText.setText(Utils.toReadableString(GrowthRate[species.growthRate])); + //Growth translate + let growthReadable = Utils.toReadableString(GrowthRate[species.growthRate]); + let growthAux = growthReadable.replace(" ", "_") + if(i18next.exists("growth:" + growthAux)){ + growthReadable = i18next.t("growth:"+ growthAux as any) + } + this.pokemonGrowthRateText.setText(growthReadable); + this.pokemonGrowthRateText.setColor(getGrowthRateColor(species.growthRate)); this.pokemonGrowthRateText.setShadowColor(getGrowthRateColor(species.growthRate, true)); this.pokemonGrowthRateLabelText.setVisible(true); From fe6aefd910a09bc8a21d60b74cf8794f054544e0 Mon Sep 17 00:00:00 2001 From: ArceUseless <36188730+ArceUseless@users.noreply.github.com> Date: Sun, 12 May 2024 04:22:45 +0200 Subject: [PATCH 7/9] Natures langs with new config (#611) * Natures lang files * Updated French nature.ts * Nature german translation + chinese added * Added nature to chinese config.ts --------- Co-authored-by: rnicar Co-authored-by: Lugiad Co-authored-by: rnicar245 <55734812+rnicar245@users.noreply.github.com> --- src/data/nature.ts | 5 +++++ src/locales/de/config.ts | 2 ++ src/locales/de/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/en/config.ts | 2 ++ src/locales/en/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/es/config.ts | 2 ++ src/locales/es/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/fr/config.ts | 2 ++ src/locales/fr/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/it/config.ts | 2 ++ src/locales/it/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/zh_CN/config.ts | 5 ++++- src/locales/zh_CN/nature.ts | 29 +++++++++++++++++++++++++++++ src/plugins/i18n.ts | 1 + 14 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 src/locales/de/nature.ts create mode 100644 src/locales/en/nature.ts create mode 100644 src/locales/es/nature.ts create mode 100644 src/locales/fr/nature.ts create mode 100644 src/locales/it/nature.ts create mode 100644 src/locales/zh_CN/nature.ts diff --git a/src/data/nature.ts b/src/data/nature.ts index b18ce5abde7..a8b361674e2 100644 --- a/src/data/nature.ts +++ b/src/data/nature.ts @@ -2,6 +2,7 @@ import { Stat, getStatName } from "./pokemon-stat"; import * as Utils from "../utils"; import { TextStyle, getBBCodeFrag } from "../ui/text"; import { UiTheme } from "#app/enums/ui-theme"; +import i18next from 'i18next'; export enum Nature { HARDY, @@ -33,6 +34,10 @@ export enum Nature { export function getNatureName(nature: Nature, includeStatEffects: boolean = false, forStarterSelect: boolean = false, ignoreBBCode: boolean = false, uiTheme: UiTheme = UiTheme.DEFAULT): string { let ret = Utils.toReadableString(Nature[nature]); + //Translating nature + if(i18next.exists('nature:' + ret)){ + ret = i18next.t('nature:' + ret as any) + } if (includeStatEffects) { const stats = Utils.getEnumValues(Stat).slice(1); let increasedStat: Stat = null; diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index e876fa48fc7..2cc7a52c8f1 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -6,6 +6,7 @@ import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; +import { nature } from "./nature"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; @@ -26,5 +27,6 @@ export const deConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + nature: nature, growth: growth } \ No newline at end of file diff --git a/src/locales/de/nature.ts b/src/locales/de/nature.ts new file mode 100644 index 00000000000..b6e3d05b8c0 --- /dev/null +++ b/src/locales/de/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Robust", + "Lonely": "Solo", + "Brave": "Mutig", + "Adamant": "Hart", + "Naughty": "Frech", + "Bold": "Kühn", + "Docile": "Sanft", + "Relaxed": "Locker", + "Impish": "Pfiffig", + "Lax": "Lasch", + "Timid": "Scheu", + "Hasty": "Hastig", + "Serious": "Ernst", + "Jolly": "Froh", + "Naive": "Naiv", + "Modest": "Mäßig", + "Mild": "Mild", + "Quiet": "Ruhig", + "Bashful": "Zaghaft", + "Rash": "Hitzig", + "Calm": "Still", + "Gentle": "Zart", + "Sassy": "Forsch", + "Careful": "Sacht", + "Quirky": "Kauzig" +} as const; \ No newline at end of file diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index d1aa349b728..029791a701c 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -6,6 +6,7 @@ import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; +import { nature } from "./nature"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; @@ -26,5 +27,6 @@ export const enConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + nature: nature, growth: growth } \ No newline at end of file diff --git a/src/locales/en/nature.ts b/src/locales/en/nature.ts new file mode 100644 index 00000000000..f29917ff60d --- /dev/null +++ b/src/locales/en/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Hardy", + "Lonely": "Lonely", + "Brave": "Brave", + "Adamant": "Adamant", + "Naughty": "Naughty", + "Bold": "Bold", + "Docile": "Docile", + "Relaxed": "Relaxed", + "Impish": "Impish", + "Lax": "Lax", + "Timid": "Timid", + "Hasty": "Hasty", + "Serious": "Serious", + "Jolly": "Jolly", + "Naive": "Naive", + "Modest": "Modest", + "Mild": "Mild", + "Quiet": "Quiet", + "Bashful": "Bashful", + "Rash": "Rash", + "Calm": "Calm", + "Gentle": "Gentle", + "Sassy": "Sassy", + "Careful": "Careful", + "Quirky": "Quirky" +} as const; \ No newline at end of file diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index ecb9538dacd..564b8dd320d 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -6,6 +6,7 @@ import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; +import { nature } from "./nature"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; @@ -26,5 +27,6 @@ export const esConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + nature: nature, growth: growth } \ No newline at end of file diff --git a/src/locales/es/nature.ts b/src/locales/es/nature.ts new file mode 100644 index 00000000000..74f9c017ac8 --- /dev/null +++ b/src/locales/es/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Fuerte", + "Lonely": "Huraña", + "Brave": "Audaz", + "Adamant": "Firme", + "Naughty": "Pícara", + "Bold": "Osada", + "Docile": "Dócil", + "Relaxed": "Plácida", + "Impish": "Agitada", + "Lax": "Floja", + "Timid": "Miedosa", + "Hasty": "Activa", + "Serious": "Seria", + "Jolly": "Alegre", + "Naive": "Ingenua", + "Modest": "Modesta", + "Mild": "Afable", + "Quiet": "Mansa", + "Bashful": "Tímida", + "Rash": "Alocada", + "Calm": "Serena", + "Gentle": "Amable", + "Sassy": "Grosera", + "Careful": "Cauta", + "Quirky": "Rara" +} as const; \ No newline at end of file diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index 5b2668ccc1e..90f9fb83c53 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -6,6 +6,7 @@ import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; +import { nature } from "./nature"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; @@ -26,5 +27,6 @@ export const frConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + nature: nature, growth: growth } \ No newline at end of file diff --git a/src/locales/fr/nature.ts b/src/locales/fr/nature.ts new file mode 100644 index 00000000000..0c838138bfe --- /dev/null +++ b/src/locales/fr/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Hardi", + "Lonely": "Solo", + "Brave": "Brave", + "Adamant": "Rigide", + "Naughty": "Mauvais", + "Bold": "Assuré", + "Docile": "Docile", + "Relaxed": "Relax", + "Impish": "Malin", + "Lax": "Lâche", + "Timid": "Timide", + "Hasty": "Pressé", + "Serious": "Sérieux", + "Jolly": "Jovial", + "Naive": "Naïf", + "Modest": "Modeste", + "Mild": "Doux", + "Quiet": "Discret", + "Bashful": "Pudique", + "Rash": "Foufou", + "Calm": "Calme", + "Gentle": "Gentil", + "Sassy": "Malpoli", + "Careful": "Prudent", + "Quirky": "Bizarre" +} as const; diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index d641e66c672..bbfd452dc39 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -6,6 +6,7 @@ import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; +import { nature } from "./nature"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; @@ -26,5 +27,6 @@ export const itConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + nature: nature, growth: growth } \ No newline at end of file diff --git a/src/locales/it/nature.ts b/src/locales/it/nature.ts new file mode 100644 index 00000000000..f29917ff60d --- /dev/null +++ b/src/locales/it/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Hardy", + "Lonely": "Lonely", + "Brave": "Brave", + "Adamant": "Adamant", + "Naughty": "Naughty", + "Bold": "Bold", + "Docile": "Docile", + "Relaxed": "Relaxed", + "Impish": "Impish", + "Lax": "Lax", + "Timid": "Timid", + "Hasty": "Hasty", + "Serious": "Serious", + "Jolly": "Jolly", + "Naive": "Naive", + "Modest": "Modest", + "Mild": "Mild", + "Quiet": "Quiet", + "Bashful": "Bashful", + "Rash": "Rash", + "Calm": "Calm", + "Gentle": "Gentle", + "Sassy": "Sassy", + "Careful": "Careful", + "Quirky": "Quirky" +} as const; \ No newline at end of file diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 0d0f1ea5a4c..a8f5f878ba0 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -10,6 +10,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { nature } from "./nature"; export const zhCnConfig = { @@ -24,5 +25,7 @@ export const zhCnConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + + nature: nature } \ No newline at end of file diff --git a/src/locales/zh_CN/nature.ts b/src/locales/zh_CN/nature.ts new file mode 100644 index 00000000000..f29917ff60d --- /dev/null +++ b/src/locales/zh_CN/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Hardy", + "Lonely": "Lonely", + "Brave": "Brave", + "Adamant": "Adamant", + "Naughty": "Naughty", + "Bold": "Bold", + "Docile": "Docile", + "Relaxed": "Relaxed", + "Impish": "Impish", + "Lax": "Lax", + "Timid": "Timid", + "Hasty": "Hasty", + "Serious": "Serious", + "Jolly": "Jolly", + "Naive": "Naive", + "Modest": "Modest", + "Mild": "Mild", + "Quiet": "Quiet", + "Bashful": "Bashful", + "Rash": "Rash", + "Calm": "Calm", + "Gentle": "Gentle", + "Sassy": "Sassy", + "Careful": "Careful", + "Quirky": "Quirky" +} as const; \ No newline at end of file diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index d5a37127eae..763eb8522f5 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -103,6 +103,7 @@ declare module 'i18next' { fightUiHandler: SimpleTranslationEntries; tutorial: SimpleTranslationEntries; starterSelectUiHandler: SimpleTranslationEntries; + nature: SimpleTranslationEntries; growth: SimpleTranslationEntries; }; } From db6008d15c7b045d64a416f75034e36ba066a381 Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Sun, 12 May 2024 15:48:56 +1000 Subject: [PATCH 8/9] Add tsdoc comments for ability getters (#764) * Add tsdoc comments for ability getters * Add links to the docs --- src/field/pokemon.ts | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index e11a0503241..b2ecd4de3e6 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -796,6 +796,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return !!this.getTypes(true, forDefend).find(t => t === type); } + /** + * Gets the non-passive ability of the pokemon. This accounts for fusions and ability changing effects. + * This should rarely be called, most of the time {@link hasAbility} or {@link hasAbilityWithAttr} are better used as + * those check both the passive and non-passive abilities and account for ability suppression. + * @see {@link hasAbility} {@link hasAbilityWithAttr} Intended ways to check abilities in most cases + * @param {boolean} ignoreOverride If true, ignore ability changing effects + * @returns {Ability} The non-passive ability of the pokemon + */ getAbility(ignoreOverride?: boolean): Ability { if (!ignoreOverride && this.summonData?.ability) return allAbilities[this.summonData.ability]; @@ -811,6 +819,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return allAbilities[abilityId]; } + /** + * Gets the passive ability of the pokemon. This should rarely be called, most of the time + * {@link hasAbility} or {@link hasAbilityWithAttr} are better used as those check both the passive and + * non-passive abilities and account for ability suppression. + * @see {@link hasAbility} {@link hasAbilityWithAttr} Intended ways to check abilities in most cases + * @returns {Ability} The passive ability of the pokemon + */ getPassiveAbility(): Ability { if (Overrides.PASSIVE_ABILITY_OVERRIDE && this.isPlayer()) return allAbilities[Overrides.PASSIVE_ABILITY_OVERRIDE]; @@ -838,6 +853,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return this.passive || this.isBoss(); } + /** + * Checks whether an ability of a pokemon can be currently applied. This should rarely be + * directly called, as {@link hasAbility} and {@link hasAbilityWithAttr} already call this. + * @see {@link hasAbility} {@link hasAbilityWithAttr} Intended ways to check abilities in most cases + * @param {boolean} passive If true, check if passive can be applied instead of non-passive + * @returns {Ability} The passive ability of the pokemon + */ canApplyAbility(passive: boolean = false): boolean { if (passive && !this.hasPassive()) return false; @@ -862,6 +884,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return (this.hp || ability.isBypassFaint) && !ability.conditions.find(condition => !condition(this)); } + /** + * Checks whether a pokemon has the specified ability and it's in effect. Accounts for all the various + * effects which can affect whether an ability will be present or in effect, and both passive and + * non-passive. This is the primary way to check whether a pokemon has a particular ability. + * @param {Abilities} ability The ability to check for + * @param {boolean} canApply If false, it doesn't check whether the abiltiy is currently active + * @param {boolean} ignoreOverride If true, it ignores ability changing effects + * @returns {boolean} Whether the ability is present and active + */ hasAbility(ability: Abilities, canApply: boolean = true, ignoreOverride?: boolean): boolean { if ((!canApply || this.canApplyAbility()) && this.getAbility(ignoreOverride).id === ability) return true; @@ -870,6 +901,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return false; } + /** + * Checks whether a pokemon has an ability with the specified attribute and it's in effect. + * Accounts for all the various effects which can affect whether an ability will be present or + * in effect, and both passive and non-passive. This is one of the two primary ways to check + * whether a pokemon has a particular ability. + * @param {AbAttr} attrType The ability attribute to check for + * @param {boolean} canApply If false, it doesn't check whether the abiltiy is currently active + * @param {boolean} ignoreOverride If true, it ignores ability changing effects + * @returns {boolean} Whether an ability with that attribute is present and active + */ hasAbilityWithAttr(attrType: { new(...args: any[]): AbAttr }, canApply: boolean = true, ignoreOverride?: boolean): boolean { if ((!canApply || this.canApplyAbility()) && this.getAbility(ignoreOverride).hasAttr(attrType)) return true; From e4afdf1d4554b50474feaa6810f9f0fb0d7de15b Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sun, 12 May 2024 08:18:23 +0100 Subject: [PATCH 9/9] Add ignoresProtect to life dew (#758) Co-authored-by: Frederico Santos --- src/data/move.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index f3b1c4dcc23..36254320fc3 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -6362,7 +6362,8 @@ export function initMoves() { .attr(ConfuseAttr), new StatusMove(Moves.LIFE_DEW, Type.WATER, -1, 10, -1, 0, 8) .attr(HealAttr, 0.25, true, false) - .target(MoveTarget.USER_AND_ALLIES), + .target(MoveTarget.USER_AND_ALLIES) + .ignoresProtect(), new SelfStatusMove(Moves.OBSTRUCT, Type.DARK, 100, 10, -1, 4, 8) .attr(ProtectAttr, BattlerTagType.OBSTRUCT), new AttackMove(Moves.FALSE_SURRENDER, Type.DARK, MoveCategory.PHYSICAL, 80, -1, 10, -1, 0, 8),