mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 09:19:31 +02:00
Update logger.ts
New IVs display
This commit is contained in:
parent
118e98703d
commit
e28c10780c
@ -602,7 +602,11 @@ function updateLog(drpd: DRPD): DRPD {
|
|||||||
drpd.version = "1.1.0b"
|
drpd.version = "1.1.0b"
|
||||||
for (var i = 0; i < drpd.waves.length; i++) {
|
for (var i = 0; i < drpd.waves.length; i++) {
|
||||||
if (drpd.waves[i] && drpd.waves[i].pokemon) {
|
if (drpd.waves[i] && drpd.waves[i].pokemon) {
|
||||||
|
for (var j = 0; j < drpd.waves[i].pokemon!.length; j++) {
|
||||||
|
drpd.waves[i].pokemon![j].iv_raw = drpd.waves[i].pokemon![j].ivs
|
||||||
|
drpd.waves[i].pokemon![j].ivs = undefined
|
||||||
|
drpd.waves[i].pokemon![j].iv = formatIVs(drpd.waves[i].pokemon![j].ivs)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // 1.1.0a → 1.1.0b
|
} // 1.1.0a → 1.1.0b
|
||||||
@ -1028,7 +1032,7 @@ export interface PokeData {
|
|||||||
/** The Pokémon's IVs, printed as ordered text. */
|
/** The Pokémon's IVs, printed as ordered text. */
|
||||||
iv: string[],
|
iv: string[],
|
||||||
/** @deprecated */
|
/** @deprecated */
|
||||||
ivs: IVData,
|
ivs?: IVData,
|
||||||
/** The Pokémon that was used to generate this `PokeData`. Not exported.
|
/** The Pokémon that was used to generate this `PokeData`. Not exported.
|
||||||
* @see Pokemon
|
* @see Pokemon
|
||||||
*/
|
*/
|
||||||
@ -1053,7 +1057,8 @@ export function exportPokemon(pokemon: Pokemon, encounterRarity?: string): PokeD
|
|||||||
captured: false,
|
captured: false,
|
||||||
level: pokemon.level,
|
level: pokemon.level,
|
||||||
items: pokemon.getHeldItems().map((item, idx) => exportItem(item)),
|
items: pokemon.getHeldItems().map((item, idx) => exportItem(item)),
|
||||||
ivs: exportIVs(pokemon.ivs)
|
iv_raw: exportIVs(pokemon.ivs),
|
||||||
|
iv: formatIVs(pokemon.ivs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -1113,7 +1118,7 @@ function printPoke(inData: string, indent: string, pokemon: PokeData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
inData += ",\n" + indent + " \"ivs\": "
|
inData += ",\n" + indent + " \"ivs\": "
|
||||||
inData = printIV(inData, indent + " ", pokemon.ivs)
|
inData = printIV(inData, indent + " ", pokemon.iv_raw)
|
||||||
//inData += ",\n" + indent + " \"rarity\": " + pokemon.rarity
|
//inData += ",\n" + indent + " \"rarity\": " + pokemon.rarity
|
||||||
inData += "\n" + indent + "}"
|
inData += "\n" + indent + "}"
|
||||||
return inData;
|
return inData;
|
||||||
@ -1230,14 +1235,14 @@ export function exportIVs(ivs: integer[]): IVData {
|
|||||||
speed: ivs[5]
|
speed: ivs[5]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export function formatIVs(ivs: integer[]): IVData {
|
export function formatIVs(ivs: integer[] | IVData): string[] {
|
||||||
return [
|
return [
|
||||||
`HP: `,
|
`HP: ${Array.isArray(ivs) ? ivs[0] : ivs.hp}`,
|
||||||
`Attack: `,
|
`Attack: ${Array.isArray(ivs) ? ivs[1] : ivs.hp}`,
|
||||||
`Defense: `,
|
`Defense: ${Array.isArray(ivs) ? ivs[2] : ivs.hp}`,
|
||||||
`Sp. Atk: `,
|
`Sp. Atk: ${Array.isArray(ivs) ? ivs[3] : ivs.hp}`,
|
||||||
`Sp. Def: `,
|
`Sp. Def: ${Array.isArray(ivs) ? ivs[4] : ivs.hp}`,
|
||||||
`Speed: `,
|
`Speed: ${Array.isArray(ivs) ? ivs[5] : ivs.hp}`,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user