Merge branch 'main' into 745-localizedTrainerNames_TrainerClasses_And_Titles

pull/752/head
Jannik Tappert 2024-05-13 18:42:24 +02:00
commit d4bb94a4f6
52 changed files with 6899 additions and 154 deletions

View File

@ -11,6 +11,7 @@
<meta property="og:image" content="https://pokerogue.net/logo512.png" />
<link rel="apple-touch-icon" href="./logo512.png" />
<link rel="shortcut icon" type="image/png" href="./logo512.png" />
<link rel="canonical" href="https://pokerogue.net" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<style type="text/css">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

View File

@ -647,6 +647,15 @@ export default class BattleScene extends SceneBase {
const icon = this.add.sprite(0, 0, pokemon.getIconAtlasKey(ignoreOverride));
icon.setFrame(pokemon.getIconId(true));
// Temporary fix to show pokemon's default icon if variant icon doesn't exist
if (icon.frame.name != pokemon.getIconId(true)) {
console.log(`${pokemon.name}'s variant icon does not exist. Replacing with default.`)
const temp = pokemon.shiny;
pokemon.shiny = false;
icon.setTexture(pokemon.getIconAtlasKey(ignoreOverride));
icon.setFrame(pokemon.getIconId(true));
pokemon.shiny = temp;
}
icon.setOrigin(0.5, 0);
container.add(icon);
@ -732,6 +741,9 @@ export default class BattleScene extends SceneBase {
this.pokeballCounts = Object.fromEntries(Utils.getEnumValues(PokeballType).filter(p => p <= PokeballType.MASTER_BALL).map(t => [ t, 0 ]));
this.pokeballCounts[PokeballType.POKEBALL] += 5;
if (Overrides.POKEBALL_OVERRIDE.active) {
this.pokeballCounts = Overrides.POKEBALL_OVERRIDE.pokeballs;
}
this.modifiers = [];
this.enemyModifiers = [];

View File

@ -249,11 +249,14 @@ export class PreDefendFormChangeAbAttr extends PreDefendAbAttr {
}
export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr {
applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean {
if (pokemon.getMaxHp() <= 1 && (pokemon.getHpRatio() < 1 || (args[0] as Utils.NumberHolder).value < pokemon.hp))
return false;
if (pokemon.hp === pokemon.getMaxHp() &&
pokemon.getMaxHp() > 1 && //Checks if pokemon has wonder_guard (which forces 1hp)
(args[0] as Utils.NumberHolder).value >= pokemon.hp){ //Damage >= hp
return pokemon.addTag(BattlerTagType.STURDY, 1);
}
return false
}
}
export class BlockItemTheftAbAttr extends AbAttr {
@ -1445,6 +1448,34 @@ export class PostSummonAllyHealAbAttr extends PostSummonAbAttr {
}
}
/**
* Resets an ally's temporary stat boots to zero with no regard to
* whether this is a positive or negative change
* @param pokemon The {@link Pokemon} with this {@link AbAttr}
* @param passive N/A
* @param args N/A
* @returns if the move was successful
*/
export class PostSummonClearAllyStatsAbAttr extends PostSummonAbAttr {
constructor() {
super();
}
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
const target = pokemon.getAlly();
if (target?.isActive(true)) {
for (let s = 0; s < target.summonData.battleStats.length; s++)
target.summonData.battleStats[s] = 0;
target.scene.queueMessage(getPokemonMessage(target, `'s stat changes\nwere removed!`));
return true;
}
return false;
}
}
export class DownloadAbAttr extends PostSummonAbAttr {
private enemyDef: integer;
private enemySpDef: integer;
@ -2344,6 +2375,26 @@ export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
}
}
/**
* Attribute used for abilities (Innards Out) that damage the opponent based on how much HP the last attack used to knock out the owner of the ability.
*/
export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
constructor() {
super ();
}
applyPostFaint(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
const damage = pokemon.turnData.attacksReceived[0].damage;
attacker.damageAndUpdate((damage), HitResult.OTHER);
attacker.turnData.damageTaken += damage;
return true;
}
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string {
return getPokemonMessage(pokemon, `'s ${abilityName} hurt\nits attacker!`);
}
}
export class RedirectMoveAbAttr extends AbAttr {
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
if (this.canRedirect(args[0] as Moves)) {
@ -2760,7 +2811,7 @@ export const allAbilities = [ new Ability(Abilities.NONE, 3) ];
export function initAbilities() {
allAbilities.push(
new Ability(Abilities.STENCH, 3)
.attr(PostAttackApplyBattlerTagAbAttr, false, (user, target, move) => !move.getMove().findAttr(attr => attr instanceof FlinchAttr) ? 10 : 0, BattlerTagType.FLINCHED),
.attr(PostAttackApplyBattlerTagAbAttr, false, (user, target, move) => (move.getMove().category !== MoveCategory.STATUS && !move.getMove().findAttr(attr => attr instanceof FlinchAttr)) ? 10 : 0, BattlerTagType.FLINCHED),
new Ability(Abilities.DRIZZLE, 3)
.attr(PostSummonWeatherChangeAbAttr, WeatherType.RAIN)
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.RAIN),
@ -3155,8 +3206,8 @@ export function initAbilities() {
new Ability(Abilities.HARVEST, 5)
.unimplemented(),
new Ability(Abilities.TELEPATHY, 5)
.ignorable()
.unimplemented(),
.attr(MoveImmunityAbAttr, (pokemon, attacker, move) => pokemon.getAlly() === attacker && move.getMove() instanceof AttackMove)
.ignorable(),
new Ability(Abilities.MOODY, 5)
.attr(MoodyAbAttr),
new Ability(Abilities.OVERCOAT, 5)
@ -3395,7 +3446,8 @@ export function initAbilities() {
.attr(FieldPriorityMoveImmunityAbAttr)
.ignorable(),
new Ability(Abilities.INNARDS_OUT, 7)
.unimplemented(),
.attr(PostFaintHPDamageAbAttr)
.bypassFaint(),
new Ability(Abilities.DANCER, 7)
.unimplemented(),
new Ability(Abilities.BATTERY, 7)
@ -3542,7 +3594,7 @@ export function initAbilities() {
new Ability(Abilities.UNSEEN_FIST, 8)
.unimplemented(),
new Ability(Abilities.CURIOUS_MEDICINE, 8)
.unimplemented(),
.attr(PostSummonClearAllyStatsAbAttr),
new Ability(Abilities.TRANSISTOR, 8)
.attr(MoveTypePowerBoostAbAttr, Type.ELECTRIC),
new Ability(Abilities.DRAGONS_MAW, 8)

View File

@ -824,7 +824,7 @@ export class HealAttr extends MoveEffectAttr {
addHealPhase(target: Pokemon, healRatio: number) {
target.scene.unshiftPhase(new PokemonHealPhase(target.scene, target.getBattlerIndex(),
Math.max(Math.floor(target.getMaxHp() * healRatio), 1), getPokemonMessage(target, ' regained\nhealth!'), true, !this.showAnim));
Math.max(Math.floor(target.getMaxHp() * healRatio), 1), getPokemonMessage(target, ' \nhad its HP restored.'), true, !this.showAnim));
}
getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer {
@ -962,6 +962,42 @@ export class SandHealAttr extends WeatherHealAttr {
}
}
/**
* Heals the target by either {@link normalHealRatio} or {@link boostedHealRatio}
* depending on the evaluation of {@link condition}
* @see {@link apply}
* @param user The Pokemon using this move
* @param target The target Pokemon of this move
* @param move This move
* @param args N/A
* @returns if the move was successful
*/
export class BoostHealAttr extends HealAttr {
private normalHealRatio?: number;
private boostedHealRatio?: number;
private condition?: MoveConditionFunc;
/**
* @param normalHealRatio Healing received when {@link condition} is false
* @param boostedHealRatio Healing received when {@link condition} is true
* @param showAnim Should a healing animation be showed?
* @param selfTarget Should the move target the user?
* @param condition The condition to check against when boosting the healing value
*/
constructor(normalHealRatio?: number, boostedHealRatio?: number, showAnim?: boolean, selfTarget?: boolean, condition?: MoveConditionFunc) {
super(normalHealRatio, showAnim, selfTarget);
this.normalHealRatio = normalHealRatio;
this.boostedHealRatio = boostedHealRatio;
this.condition = condition;
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const healRatio = this.condition(user, target, move) ? this.boostedHealRatio : this.normalHealRatio;
this.addHealPhase(target, healRatio);
return true;
}
}
export class HitHealAttr extends MoveEffectAttr {
private healRatio: number;
@ -5977,9 +6013,8 @@ export function initMoves() {
.attr(StatChangeAttr, BattleStat.SPD, -1, true)
.punchingMove(),
new StatusMove(Moves.FLORAL_HEALING, Type.FAIRY, -1, 10, -1, 0, 7)
.attr(HealAttr, 0.5, true, false)
.triageMove()
.partial(),
.attr(BoostHealAttr, 0.5, 2/3, true, false, (user, target, move) => user.scene.arena.terrain?.terrainType === TerrainType.GRASSY)
.triageMove(),
new AttackMove(Moves.HIGH_HORSEPOWER, Type.GROUND, MoveCategory.PHYSICAL, 95, 95, 10, -1, 0, 7),
new StatusMove(Moves.STRENGTH_SAP, Type.GRASS, 100, 10, 100, 0, 7)
.attr(StrengthSapHealAttr)

View File

@ -1,6 +1,5 @@
import { Gender } from "./gender";
import { AttackTypeBoosterModifier, FlinchChanceModifier } from "../modifier/modifier";
import { AttackTypeBoosterModifierType } from "../modifier/modifier-type";
import { Moves } from "./enums/moves";
import { PokeballType } from "./pokeball";
import Pokemon from "../field/pokemon";
@ -1392,9 +1391,9 @@ export const pokemonEvolutions: PokemonEvolutions = {
new SpeciesEvolution(Species.CRABOMINABLE, 1, EvolutionItem.ICE_STONE, null)
],
[Species.ROCKRUFF]: [
new SpeciesFormEvolution(Species.LYCANROC, '', 'midday', 25, null, new SpeciesEvolutionCondition(p => p.scene.arena.getTimeOfDay() === TimeOfDay.DAY), null),
new SpeciesFormEvolution(Species.LYCANROC, '', 'dusk', 25, null, new SpeciesEvolutionCondition(p => p.scene.getSpeciesFormIndex(p.species) === 1), null),
new SpeciesFormEvolution(Species.LYCANROC, '', 'midnight', 25, null, new SpeciesEvolutionCondition(p => p.scene.arena.getTimeOfDay() === TimeOfDay.NIGHT), null)
new SpeciesFormEvolution(Species.LYCANROC, '', 'midday', 25, null, new SpeciesEvolutionCondition(p => (p.scene.arena.getTimeOfDay() === TimeOfDay.DAWN || p.scene.arena.getTimeOfDay() === TimeOfDay.DAY) && (p.formIndex === 0)), null),
new SpeciesFormEvolution(Species.LYCANROC, '', 'dusk', 25, null, new SpeciesEvolutionCondition(p => p.formIndex === 1), null),
new SpeciesFormEvolution(Species.LYCANROC, '', 'midnight', 25, null, new SpeciesEvolutionCondition(p => (p.scene.arena.getTimeOfDay() === TimeOfDay.DUSK || p.scene.arena.getTimeOfDay() === TimeOfDay.NIGHT) && (p.formIndex === 0)), null)
],
[Species.STEENEE]: [
new SpeciesEvolution(Species.TSAREENA, 28, null, new SpeciesEvolutionCondition(p => p.moveset.filter(m => m.moveId === Moves.STOMP).length > 0), SpeciesWildEvolutionDelay.LONG)

View File

@ -1096,11 +1096,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
let shinyThreshold = new Utils.IntegerHolder(32);
if (thresholdOverride === undefined) {
if (!this.hasTrainer()) {
if (new Date() < new Date('2024-05-13'))
shinyThreshold.value *= 3;
if (!this.hasTrainer())
this.scene.applyModifiers(ShinyRateBoosterModifier, true, shinyThreshold);
}
} else
shinyThreshold.value = thresholdOverride;
@ -2492,6 +2489,13 @@ export class PlayerPokemon extends Pokemon {
constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex: integer, formIndex: integer, gender: Gender, shiny: boolean, variant: Variant, ivs: integer[], nature: Nature, dataSource: Pokemon | PokemonData) {
super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource);
if (Overrides.SHINY_OVERRIDE) {
this.shiny = true;
this.initShinySparkle();
if (Overrides.VARIANT_OVERRIDE)
this.variant = Overrides.VARIANT_OVERRIDE;
}
if (!dataSource)
this.generateAndPopulateMoveset();
this.generateCompatibleTms();

View File

@ -100,6 +100,10 @@ export class LoadingScene extends SceneBase {
this.loadImage('summary_bg', 'ui');
this.loadImage('summary_overlay_shiny', 'ui');
this.loadImage('summary_profile', 'ui');
this.loadImage('summary_profile_prompt_z', 'ui') // The pixel Z button prompt
this.loadImage('summary_profile_prompt_a', 'ui'); // The pixel A button prompt
this.loadImage('summary_profile_ability', 'ui'); // Pixel text 'ABILITY'
this.loadImage('summary_profile_passive', 'ui'); // Pixel text 'PASSIVE'
this.loadImage('summary_status', 'ui');
this.loadImage('summary_stats', 'ui');
this.loadImage('summary_stats_overlay_exp', 'ui');

View File

@ -1,7 +1,7 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "Power",
"accuracy": "Accuracy",
"pp": "AP",
"power": "Stärke",
"accuracy": "Genauigkeit",
} as const;

View File

@ -1,10 +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"
"Erratic": "Unregelmäßig",
"Fast": "Schnell",
"Medium_Fast": "Schneller",
"Medium_Slow": "Langsamer",
"Slow": "Langsam",
"Fluctuating": "Schwankend"
} as const;

View File

@ -898,14 +898,14 @@ export const pokemon: SimpleTranslationEntries = {
"regidrago": "Regidrago",
"glastrier": "Polaross",
"spectrier": "Phantoross",
"calyrex": "Calyrex",
"calyrex": "Coronospa",
"wyrdeer": "Damythir",
"kleavor": "Axantor",
"ursaluna": "Ursaluna",
"basculegion": "Salmagnis",
"sneasler": "Snieboss",
"overqwil": "Myriador",
"enamorus": "Enamorus",
"enamorus": "Cupidos",
"sprigatito": "Felori",
"floragato": "Feliospa",
"meowscarada": "Maskagato",
@ -1059,7 +1059,7 @@ export const pokemon: SimpleTranslationEntries = {
"galar_slowking": "Laschoking",
"galar_corsola": "Corasonn",
"galar_zigzagoon": "Zigzachs",
"galar_linoone": "Geradachs",
"galar_linoone": "Geradaks",
"galar_darumaka": "Flampion",
"galar_darmanitan": "Flampivian",
"galar_yamask": "Makabaja",

View File

@ -475,7 +475,7 @@ export const ability: AbilityTranslationEntries = {
},
frisk: {
name: "Frisk",
description: "When it enters a battle, the Pokémon can check an opposing Pokémon's held item.",
description: "When it enters a battle, the Pokémon can check an opposing Pokémon's Ability.",
},
reckless: {
name: "Reckless",

View File

@ -475,7 +475,7 @@ export const ability: AbilityTranslationEntries = {
},
"frisk": {
name: "Cacheo",
description: "Puede ver el objeto que lleva el rival al entrar en combate."
description: "Cuando entra en combate, el Pokémon puede comprobar la habilidad de un Pokémon rival."
},
"reckless": {
name: "Audaz",

View File

@ -475,7 +475,7 @@ export const ability: AbilityTranslationEntries = {
},
frisk: {
name: "Fouille",
description: "Permet de connaitre lobjet tenu par ladversaire quand le combat commence.",
description: "Lorsqu'il entre en combat, le Pokémon peut vérifier la capacité d'un Pokémon adverse.",
},
reckless: {
name: "Téméraire",

View File

@ -1,10 +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"
"Erratic": "Erratique",
"Fast": "Rapide",
"Medium_Fast": "Moyenne-Rapide",
"Medium_Slow": "Moyenne-Lente",
"Slow": "Lente",
"Fluctuating": "Fluctuante"
} as const;

View File

@ -475,7 +475,7 @@ export const ability: AbilityTranslationEntries = {
},
frisk: {
name: "Indagine",
description: "Quando il Pokémon entra in campo, rivela lo strumento del nemico.",
description: "Quando entra in battaglia, il Pokémon può controllare il Potere di un Pokémon avversario.",
},
reckless: {
name: "Temerarietà",

View File

@ -3,5 +3,5 @@ import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "Potenza",
"accuracy": "Accuracy",
"accuracy": "Precisione",
} as const;

View File

@ -1,10 +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"
"Erratic": "Irregolare",
"Fast": "Veloce",
"Medium_Fast": "Medio-Veloce",
"Medium_Slow": "Medio-Lenta",
"Slow": "Lenta",
"Fluctuating": "Fluttuante"
} as const;

View File

@ -1,29 +1,29 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const nature: SimpleTranslationEntries = {
"Hardy": "Hardy",
"Lonely": "Lonely",
"Brave": "Brave",
"Adamant": "Adamant",
"Naughty": "Naughty",
"Bold": "Bold",
"Hardy": "Ardita",
"Lonely": "Schiva",
"Brave": "Audace",
"Adamant": "Decisa",
"Naughty": "Birbona",
"Bold": "Sicura",
"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"
"Relaxed": "Placida",
"Impish": "Scaltra",
"Lax": "Fiacca",
"Timid": "Timida",
"Hasty": "Lesta",
"Serious": "Seria",
"Jolly": "Allegra",
"Naive": "Ingenuaa",
"Modest": "Modesta",
"Mild": "Mite",
"Quiet": "Quieta",
"Bashful": "Ritrosa",
"Rash": "Ardente",
"Calm": "Calma",
"Gentle": "Gentile",
"Sassy": "Vivace",
"Careful": "Cauta",
"Quirky": "Furba"
} as const;

1241
src/locales/pt_BR/ability.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const battle: SimpleTranslationEntries = {
"bossAppeared": "{{bossName}} apareceu.",
"trainerAppeared": "{{trainerName}}\nquer batalhar!",
"singleWildAppeared": "Um {{pokemonName}} selvagem apareceu!",
"multiWildAppeared": "Um {{pokemonName1}} e um {{pokemonName2}} selvagens\napareceram!",
"playerComeBack": "{{pokemonName}}, retorne!",
"trainerComeBack": "{{trainerName}} retirou {{pokemonName}} da batalha!",
"playerGo": "{{pokemonName}}, eu escolho você!",
"trainerGo": "{{trainerName}} enviou {{pokemonName}}!",
"switchQuestion": "Quer trocar\n{{pokemonName}}?",
"trainerDefeated": "Você derrotou\n{{trainerName}}!",
"pokemonCaught": "{{pokemonName}} foi capturado!",
"pokemon": "Pokémon",
"sendOutPokemon": "{{pokemonName}}, eu escolho você!!",
"hitResultCriticalHit": "Um golpe crítico!",
"hitResultSuperEffective": "É supereficaz!",
"hitResultNotVeryEffective": "É pouco eficaz...",
"hitResultNoEffect": "Isso não afeta {{pokemonName}}!",
"hitResultOneHitKO": "Foi um nocaute de um golpe!",
"attackFailed": "Mas falhou!",
"attackHitsCount": `Acertou {{count}} vezes.`,
"expGain": "{{pokemonName}} ganhou\n{{exp}} pontos de experiência.",
"levelUp": "{{pokemonName}} subiu para \nNv. {{level}}!",
"learnMove": "{{pokemonName}} aprendeu {{moveName}}!",
"learnMovePrompt": "{{pokemonName}} quer aprender\n{{moveName}}.",
"learnMoveLimitReached": "Porém, {{pokemonName}} já sabe\nquatro movimentos.",
"learnMoveReplaceQuestion": "Quer substituir um de seus movimentos por {{moveName}}?",
"learnMoveStopTeaching": "Você não quer aprender\n{{moveName}}?",
"learnMoveNotLearned": "{{pokemonName}} não aprendeu {{moveName}}.",
"learnMoveForgetQuestion": "Qual movimento quer esquecer?",
"learnMoveForgetSuccess": "{{pokemonName}} esqueceu como usar {{moveName}}.",
"levelCapUp": "O nível máximo aumentou\npara {{levelCap}}!",
"moveNotImplemented": "{{moveName}} ainda não foi implementado e não pode ser usado.",
"moveNoPP": "Não há mais PP\npara esse movimento!",
"moveDisabled": "Não se pode usar {{moveName}} porque foi desabilitado!",
"noPokeballForce": "Uma força misteriosa\nte impede de usar Poké Bolas.",
"noPokeballTrainer": "Não se pode capturar\nPokémon dos outros!",
"noPokeballMulti": "Não se pode lançar Poké Bolas\nquando há mais de um Pokémon!",
"noPokeballStrong": "Este Pokémon é forte demais para ser capturado!\nÉ preciso enfraquecê-lo primeiro!",
"noEscapeForce": "Uma força misteriosa\nte impede de fugir.",
"noEscapeTrainer": "Não se pode fugir de\nbatalhas contra treinadores!",
"noEscapePokemon": "O movimento {{moveName}} de {{pokemonName}} te impede de fugir!",
"runAwaySuccess": "Você fugiu com sucesso",
"runAwayCannotEscape": "Você nao conseguiu fugir!",
"escapeVerbSwitch": "trocar",
"escapeVerbFlee": "fugir",
"notDisabled": "O movimento {{moveName}}\nnão está mais desabilitado!",
"skipItemQuestion": "Tem certeza de que não quer escolher um item?",
"eggHatching": "Opa?",
"ivScannerUseQuestion": "Quer usar o Scanner de IVs em {{pokemonName}}?"
} as const;

View File

@ -0,0 +1,9 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const commandUiHandler: SimpleTranslationEntries = {
"fight": "Lutar",
"ball": "Bolas",
"pokemon": "Pokémon",
"run": "Fugir",
"actionMessage": "O que {{pokemonName}}\ndeve fazer?",
} as const;

View File

@ -0,0 +1,32 @@
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";
import { nature } from "./nature";
import { pokeball } from "./pokeball";
import { pokemon } from "./pokemon";
import { pokemonStat } from "./pokemon-stat";
import { starterSelectUiHandler } from "./starter-select-ui-handler";
import { tutorial } from "./tutorial";
export const ptBrConfig = {
ability: ability,
battle: battle,
commandUiHandler: commandUiHandler,
fightUiHandler: fightUiHandler,
menuUiHandler: menuUiHandler,
menu: menu,
move: move,
pokeball: pokeball,
pokemonStat: pokemonStat,
pokemon: pokemon,
starterSelectUiHandler: starterSelectUiHandler,
tutorial: tutorial,
nature: nature,
growth: growth
}

View File

@ -0,0 +1,7 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "Poder",
"accuracy": "Precisão",
} as const;

View File

@ -0,0 +1,10 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const growth: SimpleTranslationEntries = {
"Erratic": "Instável",
"Fast": "Rápido",
"Medium_Fast": "Meio Rápido",
"Medium_Slow": "Meio Lento",
"Slow": "Lento",
"Fluctuating": "Flutuante"
} as const;

View File

@ -0,0 +1,23 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const menuUiHandler: SimpleTranslationEntries = {
"GAME_SETTINGS": 'Configurações',
"ACHIEVEMENTS": "Conquistas",
"STATS": "Estatísticas",
"VOUCHERS": "Vouchers",
"EGG_LIST": "Incubadora",
"EGG_GACHA": "Gacha de Ovos",
"MANAGE_DATA": "Gerenciar Dados",
"COMMUNITY": "Comunidade",
"RETURN_TO_TITLE": "Voltar ao Início",
"LOG_OUT": "Logout",
"slot": "Slot {{slotNumber}}",
"importSession": "Importar Sessão",
"importSlotSelect": "Selecione um slot para importar.",
"exportSession": "Exportar Sessão",
"exportSlotSelect": "Selecione um slot para exportar.",
"importData": "Importar Dados",
"exportData": "Exportar Dados",
"cancel": "Cancelar",
"losingProgressionWarning": "Você vai perder todo o progresso desde o início da batalha. Confirmar?"
} as const;

46
src/locales/pt_BR/menu.ts Normal file
View File

@ -0,0 +1,46 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
/**
* The menu namespace holds most miscellaneous text that isn't directly part of the game's
* contents or directly related to Pokemon data. This includes menu navigation, settings,
* account interactions, descriptive text, etc.
*/
export const menu: SimpleTranslationEntries = {
"cancel": "Cancelar",
"continue": "Continuar",
"dailyRun": "Desafio diário (Beta)",
"loadGame": "Carregar Jogo",
"newGame": "Novo Jogo",
"selectGameMode": "Escolha um modo de jogo.",
"logInOrCreateAccount": "Inicie uma sessão ou crie uma conta para começar. Não é necessário email!",
"username": "Nome de Usuário",
"password": "Senha",
"login": "Iniciar sessão",
"register": "Registrar-se",
"emptyUsername": "Nome de usuário vazio",
"invalidLoginUsername": "Nome de usuário inválido",
"invalidRegisterUsername": "O nome de usuário só pode conter letras, números e sublinhados",
"invalidLoginPassword": "Senha inválida",
"invalidRegisterPassword": "A senha deve ter pelo menos 6 caracteres",
"usernameAlreadyUsed": "Esse nome de usuário já está em uso",
"accountNonExistent": "Esse nome de usuário não existe",
"unmatchingPassword": "Senha incorreta",
"passwordNotMatchingConfirmPassword": "As senhas não coincidem",
"confirmPassword": "Confirmar senha",
"registrationAgeWarning": "Se registrando, você confirma que tem pelo menos 13 anos de idade.",
"backToLogin": "Voltar ao Login",
"failedToLoadSaveData": "Não foi possível carregar os dados de salvamento. Por favor, recarregue a página.\nSe a falha persistir, contate o administrador.",
"sessionSuccess": "Sessão carregada com sucesso.",
"failedToLoadSession": "Não foi possível carregar os dados da sua sessão.\nEles podem estar corrompidos.",
"boyOrGirl": "Você é um menino ou uma menina?",
"boy": "Menino",
"girl": "Menina",
"dailyRankings": "Classificação Diária",
"weeklyRankings": "Classificação Semanal",
"noRankings": "Sem Classificação",
"loading": "Carregando…",
"playersOnline": "Jogadores Ativos",
"empty": "Vazio",
"yes": "Sim",
"no": "Não",
} as const;

3812
src/locales/pt_BR/move.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const nature: SimpleTranslationEntries = {
"Hardy": "Destemida",
"Lonely": "Solitária",
"Brave": "Valente",
"Adamant": "Rígida",
"Naughty": "Teimosa",
"Bold": "Corajosa",
"Docile": "Dócil",
"Relaxed": "Descontraída",
"Impish": "Inquieta",
"Lax": "Relaxada",
"Timid": "Tímida",
"Hasty": "Apressada",
"Serious": "Séria",
"Jolly": "Alegre",
"Naive": "Ingênua",
"Modest": "Modesta",
"Mild": "Mansa",
"Quiet": "Quieta",
"Bashful": "Atrapalhada",
"Rash": "Imprudente",
"Calm": "Calma",
"Gentle": "Gentil",
"Sassy": "Atrevida",
"Careful": "Cuidadosa",
"Quirky": "Peculiar",
} as const;

View File

@ -0,0 +1,10 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const pokeball: SimpleTranslationEntries = {
"pokeBall": "Poké Bola",
"greatBall": "Grande Bola",
"ultraBall": "Ultra Bola",
"rogueBall": "Rogue Bola",
"masterBall": "Master Bola",
"luxuryBall": "Bola de Luxo",
} as const;

View File

@ -0,0 +1,16 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const pokemonStat: SimpleTranslationEntries = {
"HP": "PS",
"HPshortened": "PS",
"ATK": "Ataque",
"ATKshortened": "Ata",
"DEF": "Defesa",
"DEFshortened": "Def",
"SPATK": "At. Esp.",
"SPATKshortened": "AtEsp",
"SPDEF": "Def. Esp.",
"SPDEFshortened": "DefEsp",
"SPD": "Veloc.",
"SPDshortened": "Veloc."
} as const;

1086
src/locales/pt_BR/pokemon.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
/**
* The menu namespace holds most miscellaneous text that isn't directly part of the game's
* contents or directly related to Pokemon data. This includes menu navigation, settings,
* account interactions, descriptive text, etc.
*/
export const starterSelectUiHandler: SimpleTranslationEntries = {
"confirmStartTeam": 'Começar com esses Pokémon?',
"growthRate": "Crescimento:",
"ability": "Hab.:",
"passive": "Passiva:",
"nature": "Nature:",
"eggMoves": "Mov. de Ovo",
"start": "Iniciar",
"addToParty": "Adicionar à equipe",
"toggleIVs": "Mostrar IVs",
"manageMoves": "Mudar Movimentos",
"useCandies": "Usar Doces",
"selectMoveSwapOut": "Escolha um movimento para substituir.",
"selectMoveSwapWith": "Escolha o movimento que substituirá",
"unlockPassive": "Aprender Passiva",
"reduceCost": "Reduzir Custo",
"cycleShiny": "R: Mudar Shiny",
"cycleForm": 'F: Mudar Forma',
"cycleGender": 'G: Mudar Gênero',
"cycleAbility": 'E: Mudar Habilidade',
"cycleNature": 'N: Mudar Nature',
"cycleVariant": 'V: Mudar Variante',
"enablePassive": "Ativar Passiva",
"disablePassive": "Desativar Passiva"
}

View File

@ -0,0 +1,43 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const tutorial: SimpleTranslationEntries = {
"intro": `Bem-vindo ao PokéRogue! Este é um jogo de Pokémon feito por fãs focado em batalha com elementos roguelite.
$Este jogo não é monetizado e não reivindicamos propriedade de Pokémon nem dos ativos protegidos por direitos autorais usados.
$O jogo é um trabalho em andamento, mas totalmente jogável.\nPara relatórios de bugs, use a comunidade no Discord.
$Se o jogo rodar lentamente, certifique-se de que a 'Aceleração de hardware' esteja ativada nas configurações do seu navegador.`,
"accessMenu": `Para acessar o menu, aperte M ou Esc.
$O menu contém configurações e diversas funções.`,
"menu": `A partir deste menu, você pode acessar as configurações.
$Nas configurações, você pode alterar a velocidade do jogo, o estilo da janela e outras opções.
$Existem também vários outros recursos aqui, então não deixe de conferir todos eles!`,
"starterSelect": `Nessa tela, você pode selecionar seus iniciais.\nEsses são os Pokémon iniciais da sua equipe.
$Cada inicial tem seu próprio custo. Sua equipe pode ter até \n6 membros contando que o preço não ultrapasse 10.
$Você pode também selecionar o gênero, habilidade, e formas dependendo \ndas variantes que você capturou ou chocou.
$Os IVs da espécie são os melhores de todos que você \njá capturou ou chocou, então tente conseguir vários Pokémon da mesma espécie!`,
"pokerus": `Todo dia, 3 Pokémon iniciais ficam com uma borda roxa.
$Caso veja um inicial que você possui com uma dessa, tente\nadicioná-lo a sua equipe. Lembre-se de olhar seu sumário!`,
"statChange": `As mudanças de estatísticas se mantém depois do combate\ndesde que o Pokémon não seja trocado.
$Seus Pokémon voltam a suas Poké Bolas antes de batalhas contra treinadores e de entrar em um novo bioma.
$Também é possível ver as mudanças de estatísticas dos Pokémon em campo mantendo pressionado C ou Shift.`,
"selectItem": `Após cada batalha você pode escolher entre 3 itens aleatórios.\nVocê pode escolher apenas um.
$Esses variam entre consumíveis, itens de segurar, e itens passivos permanentes.
$A maioria dos efeitos de itens não consumíveis serão acumulados de várias maneiras.
$Alguns itens só aparecerão se puderem ser usados, por exemplo, itens de evolução.
$Você também pode transferir itens de segurar entre os Pokémon utilizando a opção de transferir.
$A opção de transferir irá aparecer no canto inferior direito assim que você obter um item de segurar.
$Você pode comprar itens consumíveis com dinheiro, e uma maior variedade ficará disponível conforme você for mais longe.
$Certifique-se de comprá-los antes de escolher seu item aleatório. Ao escolher, a próxima batalha começará.`,
"eggGacha": `Nesta tela você pode trocar seus vouchers\npor ovos de Pokémon.
$Ovos ficam mais próximos de chocar depois de cada batalha.\nOvos raros demoram mais para chocar.
$Pokémon chocados não serão adicionados a sua equipe,\nmas sim aos seus iniciais.
$Pokémon chocados geralmente possuem IVs melhores\nque Pokémon selvagens.
$Alguns Pokémon só podem ser obtidos através de seus ovos.
$Há 3 máquinas, cada uma com um bônus diferente,\nentão escolha a que mais lhe convém!`,
} as const;

View File

@ -475,7 +475,7 @@ export const ability: AbilityTranslationEntries = {
},
frisk: {
name: "察觉",
description: "出场时,可以察觉对手的持\n有物。",
description: "进入战斗时,神奇宝贝可以检查对方神奇宝贝的能力。",
},
reckless: {
name: "舍身",

View File

@ -9,6 +9,8 @@ import { TempBattleStat } from './data/temp-battle-stat';
import { Nature } from './data/nature';
import { Type } from './data/type';
import { Stat } from './data/pokemon-stat';
import { PokeballCounts } from './battle-scene';
import { PokeballType } from './data/pokeball';
/**
* Overrides for testing different in game situations
@ -27,6 +29,16 @@ export const STARTING_WAVE_OVERRIDE: integer = 0;
export const STARTING_BIOME_OVERRIDE: Biome = Biome.TOWN;
// default 1000
export const STARTING_MONEY_OVERRIDE: integer = 0;
export const POKEBALL_OVERRIDE: { active: boolean, pokeballs: PokeballCounts } = {
active: false,
pokeballs: {
[PokeballType.POKEBALL]: 5,
[PokeballType.GREAT_BALL]: 0,
[PokeballType.ULTRA_BALL]: 0,
[PokeballType.ROGUE_BALL]: 0,
[PokeballType.MASTER_BALL]: 0,
}
}
/**
* PLAYER OVERRIDES
@ -39,6 +51,8 @@ export const STARTING_LEVEL_OVERRIDE: integer = 0;
export const ABILITY_OVERRIDE: Abilities = Abilities.NONE;
export const PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
export const MOVESET_OVERRIDE: Array<Moves> = [];
export const SHINY_OVERRIDE: boolean = false;
export const VARIANT_OVERRIDE: Variant = 0;
/**
* OPPONENT / ENEMY OVERRIDES

View File

@ -775,11 +775,11 @@ export class EncounterPhase extends BattlePhase {
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
if (!this.loaded) {
this.scene.gameData.saveSystem().then(success => {
this.scene.gameData.saveAll(this.scene, true).then(success => {
this.scene.disableMenu = false;
if (!success)
return this.scene.reset(true);
this.scene.gameData.saveSession(this.scene, true).then(() => this.doEncounter());
this.doEncounter();
});
} else
this.doEncounter();

View File

@ -6,6 +6,7 @@ import { enConfig } from '#app/locales/en/config.js';
import { esConfig } from '#app/locales/es/config.js';
import { frConfig } from '#app/locales/fr/config.js';
import { itConfig } from '#app/locales/it/config.js';
import { ptBrConfig } from '#app/locales/pt_BR/config.js';
import { zhCnConfig } from '#app/locales/zh_CN/config.js';
export interface SimpleTranslationEntries {
[key: string]: string
@ -65,7 +66,7 @@ export function initI18n(): void {
i18next.use(LanguageDetector).init({
lng: lang,
fallbackLng: 'en',
supportedLngs: ['en', 'es', 'fr', 'it', 'de', 'zh_CN'],
supportedLngs: ['en', 'es', 'fr', 'it', 'de', 'zh_CN','pt_BR'],
debug: true,
interpolation: {
escapeValue: false,
@ -86,6 +87,9 @@ export function initI18n(): void {
de: {
...deConfig
},
pt_BR: {
...ptBrConfig
},
zh_CN: {
...zhCnConfig
}

View File

@ -4,6 +4,7 @@ import { pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutio
import PokemonSpecies, { allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species";
import { Species, defaultStarterSpecies } from "../data/enums/species";
import * as Utils from "../utils";
import * as Overrides from '../overrides';
import PokemonData from "./pokemon-data";
import PersistentModifierData from "./modifier-data";
import ArenaData from "./arena-data";
@ -250,10 +251,8 @@ export class GameData {
this.initStarterData();
}
public saveSystem(): Promise<boolean> {
return new Promise<boolean>(resolve => {
this.scene.ui.savingIcon.show();
const data: SystemSaveData = {
public getSystemSaveData(): SystemSaveData {
return {
trainerId: this.trainerId,
secretId: this.secretId,
gender: this.gender,
@ -268,6 +267,12 @@ export class GameData {
gameVersion: this.scene.game.config.gameVersion,
timestamp: new Date().getTime()
};
}
public saveSystem(): Promise<boolean> {
return new Promise<boolean>(resolve => {
this.scene.ui.savingIcon.show();
const data = this.getSystemSaveData();
const maxIntAttrValue = Math.pow(2, 31);
const systemData = JSON.stringify(data, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v);
@ -651,6 +656,9 @@ export class GameData {
Object.keys(scene.pokeballCounts).forEach((key: string) => {
scene.pokeballCounts[key] = sessionData.pokeballCounts[key] || 0;
});
if (Overrides.POKEBALL_OVERRIDE.active) {
scene.pokeballCounts = Overrides.POKEBALL_OVERRIDE.pokeballs;
}
scene.money = sessionData.money || 0;
scene.updateMoneyText();
@ -817,6 +825,59 @@ export class GameData {
}) as SessionSaveData;
}
saveAll(scene: BattleScene, skipVerification?: boolean): Promise<boolean> {
return new Promise<boolean>(resolve => {
Utils.executeIf(!skipVerification, updateUserInfo).then(success => {
if (success !== null && !success)
return resolve(false);
this.scene.ui.savingIcon.show();
const data = this.getSystemSaveData();
const sessionData = this.getSessionSaveData(scene);
const maxIntAttrValue = Math.pow(2, 31);
const systemData = this.getSystemSaveData();
const request = {
system: systemData,
session: sessionData,
sessionSlotId: scene.sessionSlotId
};
if (!bypassLogin) {
Utils.apiPost('savedata/updateall', JSON.stringify(request, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v), undefined, true)
.then(response => response.text())
.then(error => {
this.scene.ui.savingIcon.hide();
if (error) {
if (error.startsWith('client version out of date')) {
this.scene.clearPhaseQueue();
this.scene.unshiftPhase(new OutdatedPhase(this.scene));
} else if (error.startsWith('session out of date')) {
this.scene.clearPhaseQueue();
this.scene.unshiftPhase(new ReloadSessionPhase(this.scene));
}
console.error(error);
return resolve(false);
}
resolve(true);
});
} else {
localStorage.setItem('data_bak', localStorage.getItem('data'));
localStorage.setItem('data', btoa(JSON.stringify(systemData, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v)));
localStorage.setItem(`sessionData${scene.sessionSlotId ? scene.sessionSlotId : ''}`, btoa(JSON.stringify(sessionData)));
console.debug('Session data saved');
this.scene.ui.savingIcon.hide();
resolve(true);
}
});
});
}
public tryExportData(dataType: GameDataType, slotId: integer = 0): Promise<boolean> {
return new Promise<boolean>(resolve => {
const dataKey: string = getDataTypeKey(dataType, slotId);

View File

@ -1,10 +1,10 @@
import SettingsUiHandler from "#app/ui/settings-ui-handler";
import { Mode } from "#app/ui/ui";
import i18next from "i18next";
import BattleScene from "../battle-scene";
import { hasTouchscreen } from "../touch-controls";
import { updateWindowType } from "../ui/ui-theme";
import { PlayerGender } from "./game-data";
import { Mode } from "#app/ui/ui";
import SettingsUiHandler from "#app/ui/settings-ui-handler";
export enum Setting {
Game_Speed = "GAME_SPEED",
@ -40,28 +40,28 @@ export interface SettingDefaults {
}
export const settingOptions: SettingOptions = {
[Setting.Game_Speed]: [ '1x', '1.25x', '1.5x', '2x', '2.5x', '3x', '4x', '5x' ],
[Setting.Game_Speed]: ['1x', '1.25x', '1.5x', '2x', '2.5x', '3x', '4x', '5x'],
[Setting.Master_Volume]: new Array(11).fill(null).map((_, i) => i ? (i * 10).toString() : 'Mute'),
[Setting.BGM_Volume]: new Array(11).fill(null).map((_, i) => i ? (i * 10).toString() : 'Mute'),
[Setting.SE_Volume]: new Array(11).fill(null).map((_, i) => i ? (i * 10).toString() : 'Mute'),
[Setting.Language]: [ 'English', 'Change' ],
[Setting.Damage_Numbers]: [ 'Off', 'Simple', 'Fancy' ],
[Setting.UI_Theme]: [ 'Default', 'Legacy' ],
[Setting.Language]: ['English', 'Change'],
[Setting.Damage_Numbers]: ['Off', 'Simple', 'Fancy'],
[Setting.UI_Theme]: ['Default', 'Legacy'],
[Setting.Window_Type]: new Array(5).fill(null).map((_, i) => (i + 1).toString()),
[Setting.Tutorials]: [ 'Off', 'On' ],
[Setting.Enable_Retries]: [ 'Off', 'On' ],
[Setting.Sprite_Set]: [ 'Consistent', 'Mixed Animated' ],
[Setting.Move_Animations]: [ 'Off', 'On' ],
[Setting.Show_Stats_on_Level_Up]: [ 'Off', 'On' ],
[Setting.EXP_Gains_Speed]: [ 'Normal', 'Fast', 'Faster', 'Skip' ],
[Setting.EXP_Party_Display]: [ 'Normal', 'Level Up Notification', 'Skip' ],
[Setting.HP_Bar_Speed]: [ 'Normal', 'Fast', 'Faster', 'Instant' ],
[Setting.Fusion_Palette_Swaps]: [ 'Off', 'On' ],
[Setting.Player_Gender]: [ 'Boy', 'Girl' ],
[Setting.Gamepad_Support]: [ 'Auto', 'Disabled' ],
[Setting.Swap_A_and_B]: [ 'Enabled', 'Disabled' ],
[Setting.Touch_Controls]: [ 'Auto', 'Disabled' ],
[Setting.Vibration]: [ 'Auto', 'Disabled' ]
[Setting.Tutorials]: ['Off', 'On'],
[Setting.Enable_Retries]: ['Off', 'On'],
[Setting.Sprite_Set]: ['Consistent', 'Mixed Animated'],
[Setting.Move_Animations]: ['Off', 'On'],
[Setting.Show_Stats_on_Level_Up]: ['Off', 'On'],
[Setting.EXP_Gains_Speed]: ['Normal', 'Fast', 'Faster', 'Skip'],
[Setting.EXP_Party_Display]: ['Normal', 'Level Up Notification', 'Skip'],
[Setting.HP_Bar_Speed]: ['Normal', 'Fast', 'Faster', 'Instant'],
[Setting.Fusion_Palette_Swaps]: ['Off', 'On'],
[Setting.Player_Gender]: ['Boy', 'Girl'],
[Setting.Gamepad_Support]: ['Auto', 'Disabled'],
[Setting.Swap_A_and_B]: ['Enabled', 'Disabled'],
[Setting.Touch_Controls]: ['Auto', 'Disabled'],
[Setting.Vibration]: ['Auto', 'Disabled']
};
export const settingDefaults: SettingDefaults = {
@ -89,7 +89,7 @@ export const settingDefaults: SettingDefaults = {
[Setting.Vibration]: 0
};
export const reloadSettings: Setting[] = [ Setting.UI_Theme, Setting.Language, Setting.Sprite_Set ];
export const reloadSettings: Setting[] = [Setting.UI_Theme, Setting.Language, Setting.Sprite_Set];
export function setSetting(scene: BattleScene, setting: Setting, value: integer): boolean {
switch (setting) {
@ -210,6 +210,10 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
label: '简体中文',
handler: () => changeLocaleHandler('zh_CN')
},
{
label: 'Português (BR)',
handler: () => changeLocaleHandler('pt_BR')
},
{
label: 'Cancel',
handler: () => cancelHandler()

View File

@ -551,7 +551,35 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.starterSelectContainer.add(this.pokemonEggMovesContainer);
this.instructionsText = addTextObject(this.scene, 4, 156, '', TextStyle.PARTY, { fontSize: '42px' });
let instructionTextSize = '42px';
// The font size should be set per language
const currentLanguage = i18next.language;
switch (currentLanguage) {
case 'en':
instructionTextSize = '42px';
break;
case 'es':
instructionTextSize = '35px';
break;
case 'fr':
instructionTextSize = '42px';
break;
case 'de':
instructionTextSize = '35px';
break;
case 'it':
instructionTextSize = '38px';
break;
case 'zh_CN':
instructionTextSize = '42px';
break;
}
this.instructionsText = addTextObject(this.scene, 4, 156, '', TextStyle.PARTY, { fontSize: instructionTextSize });
this.starterSelectContainer.add(this.instructionsText);
this.starterSelectMessageBoxContainer = this.scene.add.container(0, this.scene.game.canvas.height / 6);
@ -1137,6 +1165,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
cycleInstructionLines[0] += ' | ' + cycleInstructionLines.splice(1, 1);
if (cycleInstructionLines.length > 2)
cycleInstructionLines[1] += ' | ' + cycleInstructionLines.splice(2, 1);
if (cycleInstructionLines.length > 2)
cycleInstructionLines[2] += ' | ' + cycleInstructionLines.splice(3, 1);
}
for (let cil of cycleInstructionLines)
@ -1518,7 +1548,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite)
.setTexture(species.getIconAtlasKey(formIndex, shiny, variant), species.getIconId(female, formIndex, shiny, variant));
// Temporary fix to show pokemon's default icon if variant icon doesn't exist
if ((this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).frame.name != species.getIconId(female, formIndex, shiny, variant)) {
console.log(`${species.name}'s variant icon does not exist. Replacing with default.`);
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setTexture(species.getIconAtlasKey(formIndex, false, variant));
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setFrame(species.getIconId(female, formIndex, false, variant));
}
this.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY);
this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE);
this.canCycleAbility = [ abilityAttr & AbilityAttr.ABILITY_1, (abilityAttr & AbilityAttr.ABILITY_2) && species.ability2, abilityAttr & AbilityAttr.ABILITY_HIDDEN ].filter(a => a).length > 1;
@ -1576,6 +1611,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
if (this.starterMoveset.length < 4 && this.starterMoveset.length < availableStarterMoves.length)
this.starterMoveset.push(...availableStarterMoves.filter(sm => this.starterMoveset.indexOf(sm) === -1).slice(0, 4 - this.starterMoveset.length));
// Remove duplicate moves
this.starterMoveset = this.starterMoveset.filter(
(move, i) => {
return this.starterMoveset.indexOf(move) === i;
}) as StarterMoveset;
const speciesForm = getPokemonSpeciesForm(species.speciesId, formIndex);
const formText = species?.forms[formIndex]?.formKey.split('-');

View File

@ -20,6 +20,7 @@ import { loggedInUser } from "../account";
import { PlayerGender } from "../system/game-data";
import { Variant, getVariantTint } from "#app/data/variant";
import {Button} from "../enums/buttons";
import { Ability } from "../data/ability.js";
enum Page {
PROFILE,
@ -32,6 +33,18 @@ export enum SummaryUiMode {
LEARN_MOVE
}
/** Holds all objects related to an ability for each iteration */
interface abilityContainer {
/** An image displaying the summary label */
labelImage: Phaser.GameObjects.Image,
/** The ability object */
ability: Ability,
/** The text object displaying the name of the ability */
nameText: Phaser.GameObjects.Text,
/** The text object displaying the description of the ability */
descriptionText: Phaser.GameObjects.Text,
}
export default class SummaryUiHandler extends UiHandler {
private summaryUiMode: SummaryUiMode;
@ -54,6 +67,12 @@ export default class SummaryUiHandler extends UiHandler {
private championRibbon: Phaser.GameObjects.Image;
private statusContainer: Phaser.GameObjects.Container;
private status: Phaser.GameObjects.Image;
/** The pixel button prompt indicating a passive is unlocked */
private abilityPrompt: Phaser.GameObjects.Image;
/** Object holding everything needed to display an ability */
private abilityContainer: abilityContainer;
/** Object holding everything needed to display a passive */
private passiveContainer: abilityContainer;
private summaryPageContainer: Phaser.GameObjects.Container;
private movesContainer: Phaser.GameObjects.Container;
private moveDescriptionText: Phaser.GameObjects.Text;
@ -441,6 +460,17 @@ export default class SummaryUiHandler extends UiHandler {
this.showMoveSelect();
success = true;
}
// if we're on the PROFILE page and this pokemon has a passive unlocked..
else if (this.cursor === Page.PROFILE && this.pokemon.hasPassive()) {
// Since abilities are displayed by default, all we need to do is toggle visibility on all elements to show passives
this.abilityContainer.nameText.setVisible(!this.abilityContainer.descriptionText.visible);
this.abilityContainer.descriptionText.setVisible(!this.abilityContainer.descriptionText.visible);
this.abilityContainer.labelImage.setVisible(!this.abilityContainer.labelImage.visible);
this.passiveContainer.nameText.setVisible(!this.passiveContainer.descriptionText.visible);
this.passiveContainer.descriptionText.setVisible(!this.passiveContainer.descriptionText.visible);
this.passiveContainer.labelImage.setVisible(!this.passiveContainer.labelImage.visible);
}
} else if (button === Button.CANCEL) {
if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE)
this.hideMoveSelect();
@ -686,32 +716,62 @@ export default class SummaryUiHandler extends UiHandler {
profileContainer.add(luckText);
}
const ability = this.pokemon.getAbility(true);
this.abilityContainer = {
labelImage: this.scene.add.image(0, 0, 'summary_profile_ability'),
ability: this.pokemon.getAbility(true),
nameText: null,
descriptionText: null};
const abilityNameText = addTextObject(this.scene, 7, 66, ability.name, TextStyle.SUMMARY_ALT);
abilityNameText.setOrigin(0, 1);
profileContainer.add(abilityNameText);
const allAbilityInfo = [this.abilityContainer]; // Creates an array to iterate through
// Only add to the array and set up displaying a passive if it's unlocked
if (this.pokemon.hasPassive()) {
this.passiveContainer = {
labelImage: this.scene.add.image(0, 0, 'summary_profile_passive'),
ability: this.pokemon.getPassiveAbility(),
nameText: null,
descriptionText: null};
allAbilityInfo.push(this.passiveContainer);
const abilityDescriptionText = addTextObject(this.scene, 7, 69, ability.description, TextStyle.WINDOW_ALT, { wordWrap: { width: 1224 } });
abilityDescriptionText.setOrigin(0, 0);
profileContainer.add(abilityDescriptionText);
// Sets up the pixel button prompt image
this.abilityPrompt = this.scene.add.image(0, 0, !this.scene.gamepadSupport ? 'summary_profile_prompt_z' : 'summary_profile_prompt_a');
this.abilityPrompt.setPosition(8, 43);
this.abilityPrompt.setVisible(true);
this.abilityPrompt.setOrigin(0, 0);
profileContainer.add(this.abilityPrompt);
}
const abilityDescriptionTextMaskRect = this.scene.make.graphics({});
abilityDescriptionTextMaskRect.setScale(6);
abilityDescriptionTextMaskRect.fillStyle(0xFFFFFF);
abilityDescriptionTextMaskRect.beginPath();
abilityDescriptionTextMaskRect.fillRect(110, 90.5, 206, 31);
allAbilityInfo.forEach(abilityInfo => {
abilityInfo.labelImage.setPosition(17, 43);
abilityInfo.labelImage.setVisible(true);
abilityInfo.labelImage.setOrigin(0, 0);
profileContainer.add(abilityInfo.labelImage);
const abilityDescriptionTextMask = abilityDescriptionTextMaskRect.createGeometryMask();
abilityInfo.nameText = addTextObject(this.scene, 7, 66, abilityInfo.ability.name, TextStyle.SUMMARY_ALT);
abilityInfo.nameText.setOrigin(0, 1);
profileContainer.add(abilityInfo.nameText);
abilityDescriptionText.setMask(abilityDescriptionTextMask);
abilityInfo.descriptionText = addTextObject(this.scene, 7, 69, abilityInfo.ability.description, TextStyle.WINDOW_ALT, { wordWrap: { width: 1224 } });
abilityInfo.descriptionText.setOrigin(0, 0);
profileContainer.add(abilityInfo.descriptionText);
const abilityDescriptionLineCount = Math.floor(abilityDescriptionText.displayHeight / 14.83);
// Sets up the mask that hides the description text to give an illusion of scrolling
const descriptionTextMaskRect = this.scene.make.graphics({});
descriptionTextMaskRect.setScale(6);
descriptionTextMaskRect.fillStyle(0xFFFFFF);
descriptionTextMaskRect.beginPath();
descriptionTextMaskRect.fillRect(110, 90.5, 206, 31);
const abilityDescriptionTextMask = descriptionTextMaskRect.createGeometryMask();
abilityInfo.descriptionText.setMask(abilityDescriptionTextMask);
const abilityDescriptionLineCount = Math.floor(abilityInfo.descriptionText.displayHeight / 14.83);
// Animates the description text moving upwards
if (abilityDescriptionLineCount > 2) {
abilityDescriptionText.setY(69);
abilityInfo.descriptionText.setY(69);
this.descriptionScrollTween = this.scene.tweens.add({
targets: abilityDescriptionText,
targets: abilityInfo.descriptionText,
delay: Utils.fixedInt(2000),
loop: -1,
hold: Utils.fixedInt(2000),
@ -719,6 +779,11 @@ export default class SummaryUiHandler extends UiHandler {
y: `-=${14.83 * (abilityDescriptionLineCount - 2)}`
});
}
});
// Turn off visibility of passive info by default
this.passiveContainer?.labelImage.setVisible(false);
this.passiveContainer?.nameText.setVisible(false);
this.passiveContainer?.descriptionText.setVisible(false);
let memoString = `${getBBCodeFrag(Utils.toReadableString(Nature[this.pokemon.getNature()]), TextStyle.SUMMARY_RED)}${getBBCodeFrag(' nature,', TextStyle.WINDOW_ALT)}\n${getBBCodeFrag(`${this.pokemon.metBiome === -1 ? 'apparently ' : ''}met at Lv`, TextStyle.WINDOW_ALT)}${getBBCodeFrag(this.pokemon.metLevel.toString(), TextStyle.SUMMARY_RED)}${getBBCodeFrag(',', TextStyle.WINDOW_ALT)}\n${getBBCodeFrag(getBiomeName(this.pokemon.metBiome), TextStyle.SUMMARY_RED)}${getBBCodeFrag('.', TextStyle.WINDOW_ALT)}`;

View File

@ -117,9 +117,9 @@ export function randSeedEasedWeightedItem<T>(items: T[], easingFunction: string
}
export function getSunday(date: Date): Date {
const day = date.getDay();
const diff = date.getDate() - day;
const newDate = new Date(date.setDate(diff));
const day = date.getUTCDay();
const diff = date.getUTCDate() - day;
const newDate = new Date(date.setUTCDate(diff));
return new Date(Date.UTC(newDate.getUTCFullYear(), newDate.getUTCMonth(), newDate.getUTCDate()));
}