mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 07:52:17 +02:00
Apply suggested safety measures
This commit is contained in:
parent
26110091fd
commit
a6088ea0ee
@ -197,7 +197,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
this.fusionVariant = dataSource.fusionVariant || 0;
|
||||
this.fusionGender = dataSource.fusionGender;
|
||||
this.fusionLuck = dataSource.fusionLuck;
|
||||
this.usedTMs = dataSource.usedTMs || [];
|
||||
this.usedTMs = dataSource.usedTMs ?? [];
|
||||
} else {
|
||||
this.id = Utils.randSeedInt(4294967296);
|
||||
this.ivs = ivs || Utils.getIvsFromId(this.id);
|
||||
@ -936,7 +936,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
if (this.metBiome === -1 && !this.scene.gameMode.isFreshStartChallenge() && !this.scene.gameMode.isDaily) {
|
||||
levelMoves = this.getUnlockedEggMoves().concat(levelMoves);
|
||||
}
|
||||
levelMoves = this.usedTMs?.length? this.usedTMs.filter(m => !levelMoves.includes(m)).concat(levelMoves) : levelMoves;
|
||||
if (Array.isArray(this.usedTMs) && this.usedTMs.length > 0) {
|
||||
levelMoves = this.usedTMs.filter(m => !levelMoves.includes(m)).concat(levelMoves);
|
||||
}
|
||||
levelMoves = levelMoves.filter(lm => !this.moveset.some(m => m?.moveId === lm));
|
||||
return levelMoves;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
||||
super(scene, partyMemberIndex);
|
||||
|
||||
this.moveId = moveId;
|
||||
this.fromTM = fromTM || false;
|
||||
this.fromTM = fromTM ?? false;
|
||||
}
|
||||
|
||||
start() {
|
||||
|
@ -99,7 +99,7 @@ export default class PokemonData {
|
||||
this.fusionVariant = source.fusionVariant;
|
||||
this.fusionGender = source.fusionGender;
|
||||
this.fusionLuck = source.fusionLuck !== undefined ? source.fusionLuck : (source.fusionShiny ? source.fusionVariant + 1 : 0);
|
||||
this.usedTMs = source.usedTMs || [];
|
||||
this.usedTMs = source.usedTMs ?? [];
|
||||
|
||||
if (!forHistory) {
|
||||
this.boss = (source instanceof EnemyPokemon && !!source.bossSegments) || (!this.player && !!source.boss);
|
||||
|
Loading…
Reference in New Issue
Block a user