Compare commits

...

3 Commits

Author SHA1 Message Date
Matthew Olker
300aa1163a fix geticonatlaskey and geticonid for pokemon with forms 2024-05-27 00:03:15 -04:00
snnh
233911c462
Fix Chinese translation (#1417)
* Fix Chinese translation

* Fix Chinese translation

* Fix Chinese translation
2024-05-26 19:44:19 -05:00
Xavion3
72c7e9c194
Prevent duplicate evolutions crashing the game (#1416) 2024-05-27 00:14:38 +01:00
3 changed files with 27 additions and 5 deletions

View File

@ -271,8 +271,28 @@ export abstract class PokemonSpeciesForm {
abstract getFormSpriteKey(formIndex?: integer): string;
/**
* Variant Data key/index is either species id or species id followed by -formkey
* @param formIndex optional form index for pokemon with different forms
* @returns species id if no additional forms, index with formkey if a pokemon with a form
*/
getVariantDataIndex(formIndex?: integer) {
let formkey = null;
let variantDataIndex: integer|string = this.speciesId;
const species = getPokemonSpecies(this.speciesId);
if (species.forms.length > 0) {
formkey = species.forms[formIndex]?.formKey;
if (formkey) {
variantDataIndex = `${this.speciesId}-${formkey}`;
}
}
return variantDataIndex;
}
getIconAtlasKey(formIndex?: integer, shiny?: boolean, variant?: integer): string {
const isVariant = shiny && variantData[this.speciesId] && variantData[this.speciesId][variant];
const variantDataIndex = this.getVariantDataIndex(formIndex);
const isVariant = shiny && variantData[variantDataIndex] && variantData[variantDataIndex][variant];
return `pokemon_icons_${this.generation}${isVariant ? "v" : ""}`;
}
@ -281,9 +301,11 @@ export abstract class PokemonSpeciesForm {
formIndex = this.formIndex;
}
const variantDataIndex = this.getVariantDataIndex(formIndex);
let ret = this.speciesId.toString();
const isVariant = shiny && variantData[this.speciesId] && variantData[this.speciesId][variant];
const isVariant = shiny && variantData[variantDataIndex] && variantData[variantDataIndex][variant];
if (shiny && !isVariant) {
ret += "s";
@ -736,7 +758,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
const allEvolvingPokemon = Object.keys(pokemonEvolutions);
for (const p of allEvolvingPokemon) {
for (const e of pokemonEvolutions[p]) {
if (e.speciesId === this.speciesId && (!this.forms.length || !e.evoFormKey || e.evoFormKey === this.forms[this.formIndex].formKey)) {
if (e.speciesId === this.speciesId && (!this.forms.length || !e.evoFormKey || e.evoFormKey === this.forms[this.formIndex].formKey) && prevolutionLevels.every(pe => pe[0] !== parseInt(p))) {
const speciesId = parseInt(p) as Species;
const level = e.level;
prevolutionLevels.push([ speciesId, level ]);

View File

@ -214,7 +214,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
"SHINY_CHARM": { name: "闪耀护符", description: "显著增加野生宝可梦的闪光概率" },
"ABILITY_CHARM": { name: "特性护符", description: "显著增加野生宝可梦有隐藏特性的概率" },
"IV_SCANNER": { name: "个体值探测器", description: "允许扫描野生宝可梦的个体值。 每个次显示\n2个个体值. 最好的个体值优先显示" },
"IV_SCANNER": { name: "个体值探测器", description: "允许扫描野生宝可梦的个体值。可叠加,每多拥有一个多显示\n2项个体值. 最好的个体值优先显示" },
"DNA_SPLICERS": { name: "基因之楔" },

View File

@ -26,7 +26,7 @@ export const tutorial: SimpleTranslationEntries = {
$在训练家战斗之前和进入新的宝可梦群落之\n前
$您还可以通过按住C或Shift键来查看\n场上宝可梦的能力变化`,
"selectItem": `每次战斗后,您都可以选择 3 个随机物品。\n您只能选择其中一个。
"selectItem": `每次战斗后,您都可以从多个随机物品中\n选择其中一个。
$这些物品包括消耗品\n久被动道具
$大多数非消耗品的效果会以各种方式叠加
$某些物品只有在可以使用时才会出现\n进化物品