mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
Hppefully fixed -1 sprite scale glitch
This commit is contained in:
parent
448109d10f
commit
04d1cbfa24
@ -7,8 +7,11 @@ import type { Nature } from "#enums/nature";
|
||||
* Includes abilities, nature, changed types, etc.
|
||||
*/
|
||||
export class CustomPokemonData {
|
||||
/** The scale at which to render this Pokemon's sprite. */
|
||||
public spriteScale = 1;
|
||||
// TODO: Change the default value for all these from -1 to something a bit more sensible
|
||||
/**
|
||||
* The scale at which to render this Pokemon's sprite.
|
||||
*/
|
||||
public spriteScale = -1;
|
||||
public ability: Abilities | -1;
|
||||
public passive: Abilities | -1;
|
||||
public nature: Nature | -1;
|
||||
|
@ -1215,6 +1215,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
// G-Max and starmobiles have flat 1.5x scale
|
||||
return 1.5;
|
||||
}
|
||||
|
||||
if (this.customPokemonData.spriteScale <= 0) {
|
||||
return 1;
|
||||
}
|
||||
return this.customPokemonData.spriteScale;
|
||||
}
|
||||
|
||||
|
@ -27,17 +27,14 @@ const migratePartyData: SessionSaveMigrator = {
|
||||
// only edit summondata moveset if exists
|
||||
pkmnData.summonData.moveset &&= pkmnData.summonData.moveset.filter(m => !!m).map(m => PokemonMove.loadMove(m));
|
||||
|
||||
if (pkmnData.customPokemonData) {
|
||||
// revert all "-1" sprite scales to a minimum value of 1
|
||||
pkmnData.customPokemonData.spriteScale = Math.max(1, pkmnData.customPokemonData.spriteScale);
|
||||
if (
|
||||
"hitsRecCount" in pkmnData.customPokemonData &&
|
||||
typeof pkmnData.customPokemonData["hitsRecCount"] === "number"
|
||||
) {
|
||||
// transfer old hit count stat to battleData.
|
||||
pkmnData.battleData.hitCount = pkmnData.customPokemonData["hitsRecCount"];
|
||||
pkmnData.customPokemonData["hitsRecCount"] = null;
|
||||
}
|
||||
if (
|
||||
pkmnData.customPokemonData &&
|
||||
"hitsRecCount" in pkmnData.customPokemonData &&
|
||||
typeof pkmnData.customPokemonData["hitsRecCount"] === "number"
|
||||
) {
|
||||
// transfer old hit count stat to battleData.
|
||||
pkmnData.battleData.hitCount = pkmnData.customPokemonData["hitsRecCount"];
|
||||
pkmnData.customPokemonData["hitsRecCount"] = null;
|
||||
}
|
||||
return pkmnData;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user