Add WiP logic for daily run and fix some performance issues

This commit is contained in:
Flashfyre committed 2024-03-15 21:59:34 -04:00
1 parent eab1ba7ab9
commit 81f9e2da36
22 files changed
+213 -70

No files matched your search

+1 -2
View File
@@ -11,7 +11,6 @@ import { Type } from "../data/type";
import Move from "../data/move";
import { ArenaTag, ArenaTagSide, getArenaTag } from "../data/arena-tag";
import { ArenaTagType } from "../data/enums/arena-tag-type";
import { GameModes } from "../game-mode";
import { TrainerType } from "../data/enums/trainer-type";
import { BattlerIndex } from "../battle";
import { Moves } from "../data/enums/moves";
@@ -357,7 +356,7 @@ export class Arena {
return TimeOfDay.NIGHT;
}
const waveCycle = ((this.scene.currentBattle?.waveIndex || 0) + this.scene.getWaveCycleOffset()) % 40;
const waveCycle = ((this.scene.currentBattle?.waveIndex || 0) + this.scene.waveCycleOffset) % 40;
if (waveCycle < 15)
return TimeOfDay.DAY;
+9 -5
View File
@@ -1932,7 +1932,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
destroy(): void {
this.battleInfo.destroy();
this.battleInfo?.destroy();
super.destroy();
}
}
@@ -2046,8 +2046,10 @@ export class PlayerPokemon extends Pokemon {
this.abilityIndex = abilityCount - 1;
this.compatibleTms.splice(0, this.compatibleTms.length);
this.generateCompatibleTms();
this.scene.gameData.setPokemonSeen(this, false);
this.scene.gameData.setPokemonCaught(this, false);
if (!this.scene.gameMode.isDaily || this.metBiome > -1) {
this.scene.gameData.setPokemonSeen(this, false);
this.scene.gameData.setPokemonCaught(this, false);
}
this.loadAssets().then(() => {
this.calculateStats();
this.updateInfo(true).then(() => resolve());
@@ -2091,8 +2093,10 @@ export class PlayerPokemon extends Pokemon {
this.abilityIndex = abilityCount - 1;
this.compatibleTms.splice(0, this.compatibleTms.length);
this.generateCompatibleTms();
this.scene.gameData.setPokemonSeen(this, false);
this.scene.gameData.setPokemonCaught(this, false);
if (!this.scene.gameMode.isDaily || this.metBiome > -1) {
this.scene.gameData.setPokemonSeen(this, false);
this.scene.gameData.setPokemonCaught(this, false);
}
this.loadAssets().then(() => {
this.calculateStats();
this.scene.updateModifiers(true, true);