Skip to content

Commit

Permalink
Merged from official repos
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeyTheA committed Jul 8, 2024
2 parents 01657a5 + 0d9dd1d commit 611e2a7
Show file tree
Hide file tree
Showing 52 changed files with 592 additions and 49 deletions.
6 changes: 5 additions & 1 deletion src/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Moves } from "#enums/moves";
import { PlayerGender } from "#enums/player-gender";
import { Species } from "#enums/species";
import { TrainerType } from "#enums/trainer-type";
import i18next from "#app/plugins/i18n";

export enum BattleType {
WILD,
Expand Down Expand Up @@ -173,7 +174,10 @@ export default class Battle {

scene.addMoney(moneyAmount.value);

scene.queueMessage(`You picked up ₽${moneyAmount.value.toLocaleString("en-US")}!`, null, true);
const userLocale = navigator.language || "en-US";
const formattedMoneyAmount = moneyAmount.value.toLocaleString(userLocale);
const message = i18next.t("battle:moneyPickedUp", { moneyAmount: formattedMoneyAmount });
scene.queueMessage(message, null, true);

scene.currentBattle.moneyScattered = 0;
}
Expand Down
17 changes: 17 additions & 0 deletions src/data/terrain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as Utils from "../utils";
import { IncrementMovePriorityAbAttr, applyAbAttrs } from "./ability";
import { ProtectAttr } from "./move";
import { BattlerIndex } from "#app/battle.js";
import i18next from "i18next";

export enum TerrainType {
NONE,
Expand Down Expand Up @@ -67,6 +68,22 @@ export class Terrain {
}
}

export function getTerrainName(terrainType: TerrainType): string {
switch (terrainType) {
case TerrainType.MISTY:
return i18next.t("terrain:misty");
case TerrainType.ELECTRIC:
return i18next.t("terrain:electric");
case TerrainType.GRASSY:
return i18next.t("terrain:grassy");
case TerrainType.PSYCHIC:
return i18next.t("terrain:psychic");
}

return "";
}


export function getTerrainColor(terrainType: TerrainType): [ integer, integer, integer ] {
switch (terrainType) {
case TerrainType.MISTY:
Expand Down
7 changes: 0 additions & 7 deletions src/data/tms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59855,16 +59855,11 @@ export const tmSpecies: TmSpecies = {
Species.ZUBAT,
Species.GOLBAT,
Species.TENTACRUEL,
Species.MUK,
Species.KOFFING,
Species.WEEZING,
Species.MEW,
Species.ARIADOS,
Species.CROBAT,
Species.QWILFISH,
Species.GULPIN,
Species.SWALOT,
Species.SEVIPER,
Species.ROSERADE,
Species.STUNKY,
Species.SKUNTANK,
Expand Down Expand Up @@ -59896,8 +59891,6 @@ export const tmSpecies: TmSpecies = {
Species.NAGANADEL,
Species.PINCURCHIN,
Species.ETERNATUS,
Species.PIKACHU,
Species.ALOLA_MUK,
Species.GALAR_WEEZING,
Species.GALAR_SLOWKING,
[
Expand Down
24 changes: 12 additions & 12 deletions src/data/weather.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Biome } from "#enums/biome";
import { getPokemonMessage, getPokemonNameWithAffix } from "../messages";
import { getPokemonNameWithAffix } from "../messages";
import Pokemon from "../field/pokemon";
import { Type } from "./type";
import Move, { AttackMove } from "./move";
import * as Utils from "../utils";
import BattleScene from "../battle-scene";
import { SuppressWeatherEffectAbAttr } from "./ability";
import { TerrainType } from "./terrain";
import { TerrainType, getTerrainName } from "./terrain";
import i18next from "i18next";

export enum WeatherType {
Expand Down Expand Up @@ -216,34 +216,34 @@ export function getWeatherClearMessage(weatherType: WeatherType): string {
export function getTerrainStartMessage(terrainType: TerrainType): string {
switch (terrainType) {
case TerrainType.MISTY:
return "Mist swirled around the battlefield!";
return i18next.t("terrain:mistyStartMessage");
case TerrainType.ELECTRIC:
return "An electric current ran across the battlefield!";
return i18next.t("terrain:electricStartMessage");
case TerrainType.GRASSY:
return "Grass grew to cover the battlefield!";
return i18next.t("terrain:grassyStartMessage");
case TerrainType.PSYCHIC:
return "The battlefield got weird!";
return i18next.t("terrain:psychicStartMessage");
}
}

export function getTerrainClearMessage(terrainType: TerrainType): string {
switch (terrainType) {
case TerrainType.MISTY:
return "The mist disappeared from the battlefield.";
return i18next.t("terrain:mistyClearMessage");
case TerrainType.ELECTRIC:
return "The electricity disappeared from the battlefield.";
return i18next.t("terrain:electricClearMessage");
case TerrainType.GRASSY:
return "The grass disappeared from the battlefield.";
return i18next.t("terrain:grassyClearMessage");
case TerrainType.PSYCHIC:
return "The weirdness disappeared from the battlefield!";
return i18next.t("terrain:psychicClearMessage");
}
}

export function getTerrainBlockMessage(pokemon: Pokemon, terrainType: TerrainType): string {
if (terrainType === TerrainType.MISTY) {
return getPokemonMessage(pokemon, " surrounds itself with a protective mist!");
return i18next.t("terrain:mistyBlockMessage", {pokemonNameWithAffix: getPokemonNameWithAffix(pokemon)});
}
return getPokemonMessage(pokemon, ` is protected by the ${Utils.toReadableString(TerrainType[terrainType])} Terrain!`);
return i18next.t("terrain:defaultBlockMessage", {pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), terrainName: getTerrainName(terrainType)});
}

interface WeatherPoolEntry {
Expand Down
1 change: 1 addition & 0 deletions src/locales/de/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const battle: SimpleTranslationEntries = {
"switchQuestion": "Möchtest du\n{{pokemonName}} auswechseln?",
"trainerDefeated": "{{trainerName}}\nwurde besiegt!",
"moneyWon": "Du gewinnst\n{{moneyAmount}} ₽!",
"moneyPickedUp": "Du hebst {{moneyAmount}} ₽ auf!",
"pokemonCaught": "{{pokemonName}} wurde gefangen!",
"addedAsAStarter": "{{pokemonName}} wurde als Starterpokémon hinzugefügt!",
"partyFull": "Dein Team ist voll.\nMöchtest du ein Pokémon durch {{pokemonName}} ersetzen?",
Expand Down
5 changes: 4 additions & 1 deletion src/locales/de/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { gameStatsUiHandler } from "./game-stats-ui-handler";
import { growth } from "./growth";
import { menu } from "./menu";
import { menuUiHandler } from "./menu-ui-handler";
import { modifier } from "./modifier";
import { modifierType } from "./modifier-type";
import { move } from "./move";
import { nature } from "./nature";
Expand All @@ -39,7 +40,7 @@ import { statusEffect } from "./status-effect";
import { titles, trainerClasses, trainerNames } from "./trainers";
import { tutorial } from "./tutorial";
import { voucher } from "./voucher";
import { weather } from "./weather";
import { terrain, weather } from "./weather";
import { partyUiHandler } from "./party-ui-handler";
import { settings } from "./settings.js";
import { common } from "./common.js";
Expand Down Expand Up @@ -73,6 +74,7 @@ export const deConfig = {
growth: growth,
menu: menu,
menuUiHandler: menuUiHandler,
modifier: modifier,
modifierType: modifierType,
move: move,
nature: nature,
Expand All @@ -85,6 +87,7 @@ export const deConfig = {
splashMessages: splashMessages,
starterSelectUiHandler: starterSelectUiHandler,
statusEffect: statusEffect,
terrain: terrain,
titles: titles,
trainerClasses: trainerClasses,
trainerNames: trainerNames,
Expand Down
12 changes: 12 additions & 0 deletions src/locales/de/modifier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";

export const modifier: SimpleTranslationEntries = {
"surviveDamageApply": "{{pokemonNameWithAffix}} hält mithilfe des Items {{typeName}} durch!",
"turnHealApply": "{{typeName}} von {{pokemonNameWithAffix}} füllt einige KP auf!",
"hitHealApply": "{{typeName}} von {{pokemonNameWithAffix}} füllt einige KP auf!",
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}} wurde durch {{typeName}} wiederbelebt!",
"moneyInterestApply": "Du erhählst {{moneyAmount}} ₽ durch das Item {{typeName}}!",
"turnHeldItemTransferApply": "{{itemName}} von {{pokemonNameWithAffix}} wurde durch {{typeName}} von {{pokemonName}} absorbiert!",
"contactHeldItemTransferApply": "{{itemName}} von {{pokemonNameWithAffix}} wurde durch {{typeName}} von {{pokemonName}} geklaut!",
"enemyTurnHealApply": "{{pokemonNameWithAffix}} stellt einige KP wieder her!",
} as const;
2 changes: 1 addition & 1 deletion src/locales/de/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const settings: SimpleTranslationEntries = {
"buttonMenu": "Menü",
"buttonSubmit": "Bestätigen",
"buttonCancel": "Abbrechen",
"buttonStats": "Statistiken",
"buttonStats": "Statuswerte",
"buttonCycleForm": "Form wechseln",
"buttonCycleShiny": "Schillernd wechseln",
"buttonCycleGender": "Geschlecht wechseln",
Expand Down
21 changes: 21 additions & 0 deletions src/locales/de/weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,24 @@ export const weather: SimpleTranslationEntries = {
"strongWindsEffectMessage": "Rätselhafte Luftströmungen haben den Angriff abgeschwächt!",
"strongWindsClearMessage": "Die rätselhafte Luftströmung hat sich wieder geleget.",
};

export const terrain: SimpleTranslationEntries = {
"misty": "Nebelfeld",
"mistyStartMessage": "Am Boden breitet sich dichter Nebel aus!",
"mistyClearMessage": "Das Nebelfeld ist wieder verschwunden!",
"mistyBlockMessage": "{{pokemonNameWithAffix}} wird vom Nebelfeld geschützt!",

"electric": "Elektrofeld",
"electricStartMessage": "Elektrische Energie fließt durch den Boden!",
"electricClearMessage": "Das Elektrofeld ist wieder verschwunden!",

"grassy": "Grasfeld",
"grassyStartMessage": "Dichtes Gras schießt aus dem Boden!",
"grassyClearMessage": "Das Grasfeld ist wieder verschwunden!",

"psychic": "Psychofeld",
"psychicStartMessage": "Der Boden fühlt sich seltsam an!",
"psychicClearMessage": "Das Psychofeld ist wieder verschwunden!",

"defaultBlockMessage": "{{pokemonNameWithAffix}} wird vom {{terrainName}} geschützt!"
};
1 change: 1 addition & 0 deletions src/locales/en/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const battle: SimpleTranslationEntries = {
"switchQuestion": "Will you switch\n{{pokemonName}}?",
"trainerDefeated": "You defeated\n{{trainerName}}!",
"moneyWon": "You got\n₽{{moneyAmount}} for winning!",
"moneyPickedUp": "You picked up ₽{{moneyAmount}}!",
"pokemonCaught": "{{pokemonName}} was caught!",
"addedAsAStarter": "{{pokemonName}} has been\nadded as a starter!",
"partyFull": "Your party is full.\nRelease a Pokémon to make room for {{pokemonName}}?",
Expand Down
7 changes: 5 additions & 2 deletions src/locales/en/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { gameStatsUiHandler } from "./game-stats-ui-handler";
import { growth } from "./growth";
import { menu } from "./menu";
import { menuUiHandler } from "./menu-ui-handler";
import { modifier } from "./modifier";
import { modifierType } from "./modifier-type";
import { move } from "./move";
import { nature } from "./nature";
Expand All @@ -42,7 +43,7 @@ import { statusEffect } from "./status-effect";
import { titles, trainerClasses, trainerNames } from "./trainers";
import { tutorial } from "./tutorial";
import { voucher } from "./voucher";
import { weather } from "./weather";
import { terrain, weather } from "./weather";
import { modifierSelectUiHandler } from "./modifier-select-ui-handler";

export const enConfig = {
Expand Down Expand Up @@ -73,10 +74,10 @@ export const enConfig = {
growth: growth,
menu: menu,
menuUiHandler: menuUiHandler,
modifier: modifier,
modifierType: modifierType,
move: move,
nature: nature,
partyUiHandler: partyUiHandler,
pokeball: pokeball,
pokemon: pokemon,
pokemonInfo: pokemonInfo,
Expand All @@ -86,11 +87,13 @@ export const enConfig = {
splashMessages: splashMessages,
starterSelectUiHandler: starterSelectUiHandler,
statusEffect: statusEffect,
terrain: terrain,
titles: titles,
trainerClasses: trainerClasses,
trainerNames: trainerNames,
tutorial: tutorial,
voucher: voucher,
weather: weather,
partyUiHandler: partyUiHandler,
modifierSelectUiHandler: modifierSelectUiHandler
};
12 changes: 12 additions & 0 deletions src/locales/en/modifier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";

export const modifier: SimpleTranslationEntries = {
"surviveDamageApply": "{{pokemonNameWithAffix}} hung on\nusing its {{typeName}}!",
"turnHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!",
"hitHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!",
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}} was revived\nby its {{typeName}}!",
"moneyInterestApply": "You received interest of ₽{{moneyAmount}}\nfrom the {{typeName}}!",
"turnHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was absorbed\nby {{pokemonName}}'s {{typeName}}!",
"contactHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was snatched\nby {{pokemonName}}'s {{typeName}}!",
"enemyTurnHealApply": "{{pokemonNameWithAffix}}\nrestored some HP!",
} as const;
21 changes: 21 additions & 0 deletions src/locales/en/weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,24 @@ export const weather: SimpleTranslationEntries = {
"strongWindsEffectMessage": "The mysterious air current weakened the attack!",
"strongWindsClearMessage": "The heavy wind stopped."
};

export const terrain: SimpleTranslationEntries = {
"misty": "Misty",
"mistyStartMessage": "Mist swirled around the battlefield!",
"mistyClearMessage": "The mist disappeared from the battlefield.",
"mistyBlockMessage": "{{pokemonNameWithAffix}} surrounds itself with a protective mist!",

"electric": "Electric",
"electricStartMessage": "An electric current ran across the battlefield!",
"electricClearMessage": "The electricity disappeared from the battlefield.",

"grassy": "Grassy",
"grassyStartMessage": "Grass grew to cover the battlefield!",
"grassyClearMessage": "The grass disappeared from the battlefield.",

"psychic": "Psychic",
"psychicStartMessage": "The battlefield got weird!",
"psychicClearMessage": "The weirdness disappeared from the battlefield!",

"defaultBlockMessage": "{{pokemonNameWithAffix}} is protected by the {{terrainName}} Terrain!"
};
1 change: 1 addition & 0 deletions src/locales/es/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const battle: SimpleTranslationEntries = {
"switchQuestion": "¿Quieres cambiar a\n{{pokemonName}}?",
"trainerDefeated": "¡Has derrotado a\n{{trainerName}}!",
"moneyWon": "¡Has ganado\n₽{{moneyAmount}} por vencer!",
"moneyPickedUp": "You picked up ₽{{moneyAmount}}!",
"pokemonCaught": "¡{{pokemonName}} atrapado!",
"addedAsAStarter": "{{pokemonName}} ha sido añadido\na tus iniciales!",
"partyFull": "Tu equipo esta completo.\n¿Quieres liberar un Pokémon para meter a {{pokemonName}}?",
Expand Down
5 changes: 4 additions & 1 deletion src/locales/es/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { gameStatsUiHandler } from "./game-stats-ui-handler";
import { growth } from "./growth";
import { menu } from "./menu";
import { menuUiHandler } from "./menu-ui-handler";
import { modifier } from "./modifier";
import { modifierType } from "./modifier-type";
import { move } from "./move";
import { nature } from "./nature";
Expand All @@ -39,7 +40,7 @@ import { statusEffect } from "./status-effect";
import { titles, trainerClasses, trainerNames } from "./trainers";
import { tutorial } from "./tutorial";
import { voucher } from "./voucher";
import { weather } from "./weather";
import { terrain, weather } from "./weather";
import { partyUiHandler } from "./party-ui-handler";
import { settings } from "./settings.js";
import { common } from "./common.js";
Expand Down Expand Up @@ -73,6 +74,7 @@ export const esConfig = {
growth: growth,
menu: menu,
menuUiHandler: menuUiHandler,
modifier: modifier,
modifierType: modifierType,
move: move,
nature: nature,
Expand All @@ -85,6 +87,7 @@ export const esConfig = {
splashMessages: splashMessages,
starterSelectUiHandler: starterSelectUiHandler,
statusEffect: statusEffect,
terrain: terrain,
titles: titles,
trainerClasses: trainerClasses,
trainerNames: trainerNames,
Expand Down
12 changes: 12 additions & 0 deletions src/locales/es/modifier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";

export const modifier: SimpleTranslationEntries = {
"surviveDamageApply": "{{pokemonNameWithAffix}} hung on\nusing its {{typeName}}!",
"turnHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!",
"hitHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!",
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}} was revived\nby its {{typeName}}!",
"moneyInterestApply": "You received interest of ₽{{moneyAmount}}\nfrom the {{typeName}}!",
"turnHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was absorbed\nby {{pokemonName}}'s {{typeName}}!",
"contactHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was snatched\nby {{pokemonName}}'s {{typeName}}!",
"enemyTurnHealApply": "{{pokemonNameWithAffix}}\nrestored some HP!",
} as const;
21 changes: 21 additions & 0 deletions src/locales/es/weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,24 @@ export const weather: SimpleTranslationEntries = {
"strongWindsEffectMessage": "¡Las misteriosas turbulencias atenúan el ataque!",
"strongWindsClearMessage": "El fuerte viento cesó."
};

export const terrain: SimpleTranslationEntries = {
"misty": "Misty",
"mistyStartMessage": "Mist swirled around the battlefield!",
"mistyClearMessage": "The mist disappeared from the battlefield.",
"mistyBlockMessage": "{{pokemonNameWithAffix}} surrounds itself with a protective mist!",

"electric": "Electric",
"electricStartMessage": "An electric current ran across the battlefield!",
"electricClearMessage": "The electricity disappeared from the battlefield.",

"grassy": "Grassy",
"grassyStartMessage": "Grass grew to cover the battlefield!",
"grassyClearMessage": "The grass disappeared from the battlefield.",

"psychic": "Psychic",
"psychicStartMessage": "The battlefield got weird!",
"psychicClearMessage": "The weirdness disappeared from the battlefield!",

"defaultBlockMessage": "{{pokemonNameWithAffix}} is protected by the {{terrainName}} Terrain!"
};
Loading

0 comments on commit 611e2a7

Please sign in to comment.