Merge branch 'pagefaultgames:main' into main

pull/783/head
DustinLin 2024-05-13 14:24:29 -07:00 committed by GitHub
commit 444659fba7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
38 changed files with 6665 additions and 102 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -991,6 +991,42 @@ export class MoveTypeChangeAttr extends PreAttackAbAttr {
} }
} }
/**
* Class for abilities that boost the damage of moves
* For abilities that boost the base power of moves, see VariableMovePowerAbAttr
* @param damageMultiplier the amount to multiply the damage by
* @param condition the condition for this ability to be applied
*/
export class DamageBoostAbAttr extends PreAttackAbAttr {
private damageMultiplier: number;
private condition: PokemonAttackCondition;
constructor(damageMultiplier: number, condition: PokemonAttackCondition){
super(true);
this.damageMultiplier = damageMultiplier;
this.condition = condition;
}
/**
*
* @param pokemon the attacker pokemon
* @param passive N/A
* @param defender the target pokemon
* @param move the move used by the attacker pokemon
* @param args Utils.NumberHolder as damage
* @returns true if the function succeeds
*/
applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean {
if (this.condition(pokemon, defender, move.getMove())) {
const power = args[0] as Utils.NumberHolder;
power.value = Math.floor(power.value * this.damageMultiplier);
return true;
}
return false;
}
}
export class MovePowerBoostAbAttr extends VariableMovePowerAbAttr { export class MovePowerBoostAbAttr extends VariableMovePowerAbAttr {
private condition: PokemonAttackCondition; private condition: PokemonAttackCondition;
private powerMultiplier: number; private powerMultiplier: number;
@ -3121,7 +3157,7 @@ export function initAbilities() {
.attr(IgnoreOpponentStatChangesAbAttr) .attr(IgnoreOpponentStatChangesAbAttr)
.ignorable(), .ignorable(),
new Ability(Abilities.TINTED_LENS, 4) new Ability(Abilities.TINTED_LENS, 4)
.attr(MovePowerBoostAbAttr, (user, target, move) => target.getAttackTypeEffectiveness(move.type, user) <= 0.5, 2), .attr(DamageBoostAbAttr, 2, (user, target, move) => target.getAttackTypeEffectiveness(move.type, user) <= 0.5),
new Ability(Abilities.FILTER, 4) new Ability(Abilities.FILTER, 4)
.attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type, user) >= 2, 0.75) .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type, user) >= 2, 0.75)
.ignorable(), .ignorable(),
@ -3427,9 +3463,9 @@ export function initAbilities() {
.attr(UnsuppressableAbilityAbAttr) .attr(UnsuppressableAbilityAbAttr)
.attr(NoFusionAbilityAbAttr), .attr(NoFusionAbilityAbAttr),
new Ability(Abilities.POWER_CONSTRUCT, 7) // TODO: 10% Power Construct Zygarde isn't accounted for yet. If changed, update Zygarde's getSpeciesFormIndex entry accordingly new Ability(Abilities.POWER_CONSTRUCT, 7) // TODO: 10% Power Construct Zygarde isn't accounted for yet. If changed, update Zygarde's getSpeciesFormIndex entry accordingly
.attr(PostBattleInitFormChangeAbAttr, p => p.getHpRatio() <= 0.5 ? 4 : 2) .attr(PostBattleInitFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === 'complete' ? 4 : 2)
.attr(PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 ? 4 : 2) .attr(PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === 'complete' ? 4 : 2)
.attr(PostTurnFormChangeAbAttr, p => p.getHpRatio() <= 0.5 ? 4 : 2) .attr(PostTurnFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === 'complete' ? 4 : 2)
.attr(UncopiableAbilityAbAttr) .attr(UncopiableAbilityAbAttr)
.attr(UnswappableAbilityAbAttr) .attr(UnswappableAbilityAbAttr)
.attr(UnsuppressableAbilityAbAttr) .attr(UnsuppressableAbilityAbAttr)

View File

@ -1353,6 +1353,25 @@ export class BypassSleepAttr extends MoveAttr {
} }
} }
/**
* Attribute used for moves that bypass the burn damage reduction of physical moves, currently only facade
* Called during damage calculation
* @param user N/A
* @param target N/A
* @param move Move with this attribute
* @param args Utils.BooleanHolder for burnDamageReductionCancelled
* @returns true if the function succeeds
*/
export class BypassBurnDamageReductionAttr extends MoveAttr {
/** Prevents the move's damage from being reduced by burn */
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
(args[0] as Utils.BooleanHolder).value = true;
return true;
}
}
export class WeatherChangeAttr extends MoveEffectAttr { export class WeatherChangeAttr extends MoveEffectAttr {
private weatherType: WeatherType; private weatherType: WeatherType;
@ -4904,7 +4923,8 @@ export function initMoves() {
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -2), .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -2),
new AttackMove(Moves.FACADE, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 3) new AttackMove(Moves.FACADE, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 3)
.attr(MovePowerMultiplierAttr, (user, target, move) => user.status .attr(MovePowerMultiplierAttr, (user, target, move) => user.status
&& (user.status.effect === StatusEffect.BURN || user.status.effect === StatusEffect.POISON || user.status.effect === StatusEffect.TOXIC || user.status.effect === StatusEffect.PARALYSIS) ? 2 : 1), && (user.status.effect === StatusEffect.BURN || user.status.effect === StatusEffect.POISON || user.status.effect === StatusEffect.TOXIC || user.status.effect === StatusEffect.PARALYSIS) ? 2 : 1)
.attr(BypassBurnDamageReductionAttr),
new AttackMove(Moves.FOCUS_PUNCH, Type.FIGHTING, MoveCategory.PHYSICAL, 150, 100, 20, -1, -3, 3) new AttackMove(Moves.FOCUS_PUNCH, Type.FIGHTING, MoveCategory.PHYSICAL, 150, 100, 20, -1, -3, 3)
.punchingMove() .punchingMove()
.ignoresVirtual() .ignoresVirtual()

View File

@ -4,7 +4,7 @@ import { Variant, VariantSet, variantColorCache } from '#app/data/variant';
import { variantData } from '#app/data/variant'; import { variantData } from '#app/data/variant';
import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from '../ui/battle-info'; import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from '../ui/battle-info';
import { Moves } from "../data/enums/moves"; import { Moves } from "../data/enums/moves";
import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, MultiHitAttr, StatusMoveTypeImmunityAttr, MoveTarget, VariableDefAttr, AttackMove, ModifiedDamageAttr, VariableMoveTypeMultiplierAttr, IgnoreOpponentStatChangesAttr, SacrificialAttr, VariableMoveTypeAttr, VariableMoveCategoryAttr, CounterDamageAttr, StatChangeAttr, RechargeAttr, ChargeAttr, IgnoreWeatherTypeDebuffAttr } from "../data/move"; import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, MultiHitAttr, StatusMoveTypeImmunityAttr, MoveTarget, VariableDefAttr, AttackMove, ModifiedDamageAttr, VariableMoveTypeMultiplierAttr, IgnoreOpponentStatChangesAttr, SacrificialAttr, VariableMoveTypeAttr, VariableMoveCategoryAttr, CounterDamageAttr, StatChangeAttr, RechargeAttr, ChargeAttr, IgnoreWeatherTypeDebuffAttr, BypassBurnDamageReductionAttr } from "../data/move";
import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from '../data/pokemon-species'; import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from '../data/pokemon-species';
import * as Utils from '../utils'; import * as Utils from '../utils';
import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from '../data/type'; import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from '../data/type';
@ -27,7 +27,7 @@ import { TempBattleStat } from '../data/temp-battle-stat';
import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from '../data/arena-tag'; import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from '../data/arena-tag';
import { ArenaTagType } from "../data/enums/arena-tag-type"; import { ArenaTagType } from "../data/enums/arena-tag-type";
import { Biome } from "../data/enums/biome"; import { Biome } from "../data/enums/biome";
import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr } from '../data/ability'; import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr } from '../data/ability';
import { Abilities } from "#app/data/enums/abilities"; import { Abilities } from "#app/data/enums/abilities";
import PokemonData from '../system/pokemon-data'; import PokemonData from '../system/pokemon-data';
import Battle, { BattlerIndex } from '../battle'; import Battle, { BattlerIndex } from '../battle';
@ -1225,24 +1225,18 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
} }
if (this.level >= 25) { // No egg moves below level 25 if (this.level >= 60) { // No egg moves below level 60
for (let i = 0; i < 3; i++) { for (let i = 0; i < 3; i++) {
const moveId = speciesEggMoves[this.species.getRootSpeciesId()][i]; const moveId = speciesEggMoves[this.species.getRootSpeciesId()][i];
if (!movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)')) if (!movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)'))
movePool.push([moveId, Math.min(this.level * 0.5, 40)]); movePool.push([moveId, Math.min(this.level * 0.5, 40)]);
} }
const moveId = speciesEggMoves[this.species.getRootSpeciesId()][3];
if (this.level >= 60 && !movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)')) // No rare egg moves before level 60
movePool.push([moveId, Math.min(this.level * 0.2, 20)]);
if (this.fusionSpecies) { if (this.fusionSpecies) {
for (let i = 0; i < 3; i++) { for (let i = 0; i < 3; i++) {
const moveId = speciesEggMoves[this.fusionSpecies.getRootSpeciesId()][i]; const moveId = speciesEggMoves[this.fusionSpecies.getRootSpeciesId()][i];
if (!movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)')) if (!movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)'))
movePool.push([moveId, Math.min(this.level * 0.5, 30)]); movePool.push([moveId, Math.min(this.level * 0.5, 30)]);
} }
const moveId = speciesEggMoves[this.fusionSpecies.getRootSpeciesId()][3];
if (this.level >= 60 && !movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)')) // No rare egg moves before level 60
movePool.push([moveId, Math.min(this.level * 0.2, 20)]);
} }
} }
} }
@ -1540,11 +1534,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (!isTypeImmune) { if (!isTypeImmune) {
damage.value = Math.ceil(((((2 * source.level / 5 + 2) * power.value * sourceAtk.value / targetDef.value) / 50) + 2) * stabMultiplier.value * typeMultiplier.value * arenaAttackTypeMultiplier.value * screenMultiplier.value * ((this.scene.randBattleSeedInt(15) + 85) / 100) * criticalMultiplier.value); damage.value = Math.ceil(((((2 * source.level / 5 + 2) * power.value * sourceAtk.value / targetDef.value) / 50) + 2) * stabMultiplier.value * typeMultiplier.value * arenaAttackTypeMultiplier.value * screenMultiplier.value * ((this.scene.randBattleSeedInt(15) + 85) / 100) * criticalMultiplier.value);
if (isPhysical && source.status && source.status.effect === StatusEffect.BURN) { if (isPhysical && source.status && source.status.effect === StatusEffect.BURN) {
if(!move.getAttrs(BypassBurnDamageReductionAttr).length) {
const burnDamageReductionCancelled = new Utils.BooleanHolder(false); const burnDamageReductionCancelled = new Utils.BooleanHolder(false);
applyAbAttrs(BypassBurnDamageReductionAbAttr, source, burnDamageReductionCancelled); applyAbAttrs(BypassBurnDamageReductionAbAttr, source, burnDamageReductionCancelled);
if (!burnDamageReductionCancelled.value) if (!burnDamageReductionCancelled.value)
damage.value = Math.floor(damage.value / 2); damage.value = Math.floor(damage.value / 2);
} }
}
applyPreAttackAbAttrs(DamageBoostAbAttr, source, this, battlerMove, damage);
move.getAttrs(HitsTagAttr).map(hta => hta as HitsTagAttr).filter(hta => hta.doubleDamage).forEach(hta => { move.getAttrs(HitsTagAttr).map(hta => hta as HitsTagAttr).filter(hta => hta.doubleDamage).forEach(hta => {
if (this.getTag(hta.tagType)) if (this.getTag(hta.tagType))
damage.value *= 2; damage.value *= 2;

View File

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

View File

@ -1,10 +1,10 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n"; import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const growth: SimpleTranslationEntries = { export const growth: SimpleTranslationEntries = {
"Erratic": "Erratic", "Erratic": "Unregelmäßig",
"Fast": "Fast", "Fast": "Schnell",
"Medium_Fast": "Medium Fast", "Medium_Fast": "Schneller",
"Medium_Slow": "Medium Slow", "Medium_Slow": "Langsamer",
"Slow": "Slow", "Slow": "Langsam",
"Fluctuating": "Fluctuating" "Fluctuating": "Schwankend"
} as const; } as const;

View File

@ -28,5 +28,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"cycleNature": "N: Wesen Ändern", "cycleNature": "N: Wesen Ändern",
"cycleVariant": "V: Seltenheit ändern", "cycleVariant": "V: Seltenheit ändern",
"enablePassive": "Passiv-Skill aktivieren", "enablePassive": "Passiv-Skill aktivieren",
"disablePassive": "Passiv-Skill deaktivieren" "disablePassive": "Passiv-Skill deaktivieren",
"locked": "Gesperrt",
"disabled": "Deaktiviert"
} }

View File

@ -475,7 +475,7 @@ export const ability: AbilityTranslationEntries = {
}, },
frisk: { frisk: {
name: "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: { reckless: {
name: "Reckless", name: "Reckless",

View File

@ -28,5 +28,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"cycleNature": 'N: Cycle Nature', "cycleNature": 'N: Cycle Nature',
"cycleVariant": 'V: Cycle Variant', "cycleVariant": 'V: Cycle Variant',
"enablePassive": "Enable Passive", "enablePassive": "Enable Passive",
"disablePassive": "Disable Passive" "disablePassive": "Disable Passive",
"locked": "Locked",
"disabled": "Disabled"
} }

View File

@ -475,7 +475,7 @@ export const ability: AbilityTranslationEntries = {
}, },
"frisk": { "frisk": {
name: "Cacheo", 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": { "reckless": {
name: "Audaz", name: "Audaz",

View File

@ -28,5 +28,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"cycleNature": 'N: Cambiar Naturaleza', "cycleNature": 'N: Cambiar Naturaleza',
"cycleVariant": 'V: Cambiar Variante', "cycleVariant": 'V: Cambiar Variante',
"enablePassive": "Activar Pasiva", "enablePassive": "Activar Pasiva",
"disablePassive": "Desactivar Pasiva" "disablePassive": "Desactivar Pasiva",
"locked": "Locked",
"disabled": "Disabled"
} }

View File

@ -475,7 +475,7 @@ export const ability: AbilityTranslationEntries = {
}, },
frisk: { frisk: {
name: "Fouille", 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: { reckless: {
name: "Téméraire", name: "Téméraire",

View File

@ -28,5 +28,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"cycleNature": "N: » Natures", "cycleNature": "N: » Natures",
"cycleVariant": "V: » Variants", "cycleVariant": "V: » Variants",
"enablePassive": "Activer Passif", "enablePassive": "Activer Passif",
"disablePassive": "Désactiver Passif" "disablePassive": "Désactiver Passif",
"locked": "Verrouillé",
"disabled": "Désactivé"
} }

View File

@ -475,7 +475,7 @@ export const ability: AbilityTranslationEntries = {
}, },
frisk: { frisk: {
name: "Indagine", 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: { reckless: {
name: "Temerarietà", name: "Temerarietà",

View File

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

View File

@ -1,10 +1,10 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n"; import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const growth: SimpleTranslationEntries = { export const growth: SimpleTranslationEntries = {
"Erratic": "Erratic", "Erratic": "Irregolare",
"Fast": "Fast", "Fast": "Veloce",
"Medium_Fast": "Medium Fast", "Medium_Fast": "Medio-Veloce",
"Medium_Slow": "Medium Slow", "Medium_Slow": "Medio-Lenta",
"Slow": "Slow", "Slow": "Lenta",
"Fluctuating": "Fluctuating" "Fluctuating": "Fluttuante"
} as const; } as const;

View File

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

View File

@ -28,5 +28,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"cycleNature": 'N: Alterna Natura', "cycleNature": 'N: Alterna Natura',
"cycleVariant": 'V: Alterna Variante', "cycleVariant": 'V: Alterna Variante',
"enablePassive": "Attiva Passiva", "enablePassive": "Attiva Passiva",
"disablePassive": "Disattiva Passiva" "disablePassive": "Disattiva Passiva",
"locked": "Locked",
"disabled": "Disabled"
} }

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,34 @@
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",
"locked": "Bloqueado",
"disabled": "Desativado",
}

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: { frisk: {
name: "察觉", name: "察觉",
description: "出场时,可以察觉对手的持\n有物。", description: "进入战斗时,神奇宝贝可以检查对方神奇宝贝的能力。",
}, },
reckless: { reckless: {
name: "舍身", name: "舍身",

View File

@ -28,5 +28,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"cycleNature": 'N: 切换性格', "cycleNature": 'N: 切换性格',
"cycleVariant": 'V: 切换变种', "cycleVariant": 'V: 切换变种',
"enablePassive": "启用被动", "enablePassive": "启用被动",
"disablePassive": "禁用被动" "disablePassive": "禁用被动",
"locked": "Locked",
"disabled": "Disabled"
} }

View File

@ -6,6 +6,7 @@ import { enConfig } from '#app/locales/en/config.js';
import { esConfig } from '#app/locales/es/config.js'; import { esConfig } from '#app/locales/es/config.js';
import { frConfig } from '#app/locales/fr/config.js'; import { frConfig } from '#app/locales/fr/config.js';
import { itConfig } from '#app/locales/it/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'; import { zhCnConfig } from '#app/locales/zh_CN/config.js';
export interface SimpleTranslationEntries { export interface SimpleTranslationEntries {
@ -59,7 +60,7 @@ export function initI18n(): void {
i18next.use(LanguageDetector).init({ i18next.use(LanguageDetector).init({
lng: lang, lng: lang,
fallbackLng: 'en', fallbackLng: 'en',
supportedLngs: ['en', 'es', 'fr', 'it', 'de', 'zh_CN'], supportedLngs: ['en', 'es', 'fr', 'it', 'de', 'zh_CN','pt_BR'],
debug: true, debug: true,
interpolation: { interpolation: {
escapeValue: false, escapeValue: false,
@ -80,6 +81,9 @@ export function initI18n(): void {
de: { de: {
...deConfig ...deConfig
}, },
pt_BR: {
...ptBrConfig
},
zh_CN: { zh_CN: {
...zhCnConfig ...zhCnConfig
} }

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 i18next from "i18next";
import BattleScene from "../battle-scene"; import BattleScene from "../battle-scene";
import { hasTouchscreen } from "../touch-controls"; import { hasTouchscreen } from "../touch-controls";
import { updateWindowType } from "../ui/ui-theme"; import { updateWindowType } from "../ui/ui-theme";
import { PlayerGender } from "./game-data"; import { PlayerGender } from "./game-data";
import { Mode } from "#app/ui/ui";
import SettingsUiHandler from "#app/ui/settings-ui-handler";
export enum Setting { export enum Setting {
Game_Speed = "GAME_SPEED", Game_Speed = "GAME_SPEED",
@ -206,6 +206,10 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
label: 'Deutsch', label: 'Deutsch',
handler: () => changeLocaleHandler('de') handler: () => changeLocaleHandler('de')
}, },
{
label: 'Português (BR)',
handler: () => changeLocaleHandler('pt_BR')
},
{ {
label: '简体中文', label: '简体中文',
handler: () => changeLocaleHandler('zh_CN') handler: () => changeLocaleHandler('zh_CN')
@ -214,7 +218,8 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
label: 'Cancel', label: 'Cancel',
handler: () => cancelHandler() handler: () => cancelHandler()
} }
] ],
maxOptions: 7
}); });
return false; return false;
} }

View File

@ -357,6 +357,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
icon.setScale(0.5); icon.setScale(0.5);
icon.setOrigin(0, 0); icon.setOrigin(0, 0);
icon.setFrame(species.getIconId(defaultProps.female, defaultProps.formIndex, defaultProps.shiny, defaultProps.variant)); icon.setFrame(species.getIconId(defaultProps.female, defaultProps.formIndex, defaultProps.shiny, defaultProps.variant));
this.checkIconId(icon, species, defaultProps.female, defaultProps.formIndex, defaultProps.shiny, defaultProps.variant);
icon.setTint(0); icon.setTint(0);
this.starterSelectGenIconContainers[g].add(icon); this.starterSelectGenIconContainers[g].add(icon);
this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.NONE); this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.NONE);
@ -551,7 +552,35 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.starterSelectContainer.add(this.pokemonEggMovesContainer); 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.starterSelectContainer.add(this.instructionsText);
this.starterSelectMessageBoxContainer = this.scene.add.container(0, this.scene.game.canvas.height / 6); this.starterSelectMessageBoxContainer = this.scene.add.container(0, this.scene.game.canvas.height / 6);
@ -764,6 +793,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
const props = this.scene.gameData.getSpeciesDexAttrProps(species, this.dexAttrCursor); const props = this.scene.gameData.getSpeciesDexAttrProps(species, this.dexAttrCursor);
this.starterIcons[this.starterCursors.length].setTexture(species.getIconAtlasKey(props.formIndex, props.shiny, props.variant)); this.starterIcons[this.starterCursors.length].setTexture(species.getIconAtlasKey(props.formIndex, props.shiny, props.variant));
this.starterIcons[this.starterCursors.length].setFrame(species.getIconId(props.female, props.formIndex, props.shiny, props.variant)); this.starterIcons[this.starterCursors.length].setFrame(species.getIconId(props.female, props.formIndex, props.shiny, props.variant));
this.checkIconId(this.starterIcons[this.starterCursors.length], species, props.female, props.formIndex, props.shiny, props.variant);
this.starterGens.push(this.getGenCursorWithScroll()); this.starterGens.push(this.getGenCursorWithScroll());
this.starterCursors.push(this.cursor); this.starterCursors.push(this.cursor);
this.starterAttr.push(this.dexAttrCursor); this.starterAttr.push(this.dexAttrCursor);
@ -1137,6 +1167,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
cycleInstructionLines[0] += ' | ' + cycleInstructionLines.splice(1, 1); cycleInstructionLines[0] += ' | ' + cycleInstructionLines.splice(1, 1);
if (cycleInstructionLines.length > 2) if (cycleInstructionLines.length > 2)
cycleInstructionLines[1] += ' | ' + cycleInstructionLines.splice(2, 1); cycleInstructionLines[1] += ' | ' + cycleInstructionLines.splice(2, 1);
if (cycleInstructionLines.length > 2)
cycleInstructionLines[2] += ' | ' + cycleInstructionLines.splice(3, 1);
} }
for (let cil of cycleInstructionLines) for (let cil of cycleInstructionLines)
@ -1276,6 +1308,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
const props = this.scene.gameData.getSpeciesDexAttrProps(this.lastSpecies, dexAttr); const props = this.scene.gameData.getSpeciesDexAttrProps(this.lastSpecies, dexAttr);
const lastSpeciesIcon = (this.starterSelectGenIconContainers[this.lastSpecies.generation - 1].getAt(this.genSpecies[this.lastSpecies.generation - 1].indexOf(this.lastSpecies)) as Phaser.GameObjects.Sprite); const lastSpeciesIcon = (this.starterSelectGenIconContainers[this.lastSpecies.generation - 1].getAt(this.genSpecies[this.lastSpecies.generation - 1].indexOf(this.lastSpecies)) as Phaser.GameObjects.Sprite);
lastSpeciesIcon.setTexture(this.lastSpecies.getIconAtlasKey(props.formIndex, props.shiny, props.variant), this.lastSpecies.getIconId(props.female, props.formIndex, props.shiny, props.variant)); lastSpeciesIcon.setTexture(this.lastSpecies.getIconAtlasKey(props.formIndex, props.shiny, props.variant), this.lastSpecies.getIconId(props.female, props.formIndex, props.shiny, props.variant));
this.checkIconId(lastSpeciesIcon, this.lastSpecies, props.female, props.formIndex, props.shiny, props.variant);
this.iconAnimHandler.addOrUpdate(lastSpeciesIcon, PokemonIconAnimMode.NONE); this.iconAnimHandler.addOrUpdate(lastSpeciesIcon, PokemonIconAnimMode.NONE);
} }
@ -1518,12 +1551,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite) (this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite)
.setTexture(species.getIconAtlasKey(formIndex, shiny, variant), species.getIconId(female, formIndex, shiny, variant)); .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 this.checkIconId((this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite), species, female, formIndex, shiny, variant);
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.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY);
this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE); 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; this.canCycleAbility = [ abilityAttr & AbilityAttr.ABILITY_1, (abilityAttr & AbilityAttr.ABILITY_2) && species.ability2, abilityAttr & AbilityAttr.ABILITY_HIDDEN ].filter(a => a).length > 1;
@ -1550,7 +1578,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.pokemonAbilityText.setShadowColor(this.getTextColor(!isHidden ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GOLD, true)); this.pokemonAbilityText.setShadowColor(this.getTextColor(!isHidden ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GOLD, true));
const passiveAttr = this.scene.gameData.starterData[species.speciesId].passiveAttr; const passiveAttr = this.scene.gameData.starterData[species.speciesId].passiveAttr;
this.pokemonPassiveText.setText(passiveAttr & PassiveAttr.UNLOCKED ? passiveAttr & PassiveAttr.ENABLED ? allAbilities[starterPassiveAbilities[this.lastSpecies.speciesId]].name : 'Disabled' : 'Locked'); this.pokemonPassiveText.setText(passiveAttr & PassiveAttr.UNLOCKED ? passiveAttr & PassiveAttr.ENABLED ? allAbilities[starterPassiveAbilities[this.lastSpecies.speciesId]].name : i18next.t("starterSelectUiHandler:disabled") : i18next.t("starterSelectUiHandler:locked"));
this.pokemonPassiveText.setColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY)); this.pokemonPassiveText.setColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY));
this.pokemonPassiveText.setShadowColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY, true)); this.pokemonPassiveText.setShadowColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY, true));
@ -1797,4 +1825,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
if (this.statsMode) if (this.statsMode)
this.toggleStatsMode(false); this.toggleStatsMode(false);
} }
checkIconId(icon: Phaser.GameObjects.Sprite, species: PokemonSpecies, female, formIndex, shiny, variant) {
if (icon.frame.name != species.getIconId(female, formIndex, shiny, variant)) {
console.log(`${species.name}'s variant icon does not exist. Replacing with default.`);
icon.setTexture(species.getIconAtlasKey(formIndex, false, variant));
icon.setFrame(species.getIconId(female, formIndex, false, variant));
}
}
} }