Revert "Revert "Fix strong trainer party members often not evolving due to dividing by 0""
This reverts commit baaa00656e
.
pull/20/head
parent
b67a3ced85
commit
7ca5cdc21b
|
@ -58,6 +58,7 @@ import { initTouchControls } from './touch-controls';
|
||||||
|
|
||||||
export const bypassLogin = false;
|
export const bypassLogin = false;
|
||||||
|
|
||||||
|
export const SEED_OVERRIDE = '';
|
||||||
export const STARTING_LEVEL_OVERRIDE = 0;
|
export const STARTING_LEVEL_OVERRIDE = 0;
|
||||||
export const STARTING_WAVE_OVERRIDE = 0;
|
export const STARTING_WAVE_OVERRIDE = 0;
|
||||||
export const STARTING_BIOME_OVERRIDE = Biome.TOWN;
|
export const STARTING_BIOME_OVERRIDE = Biome.TOWN;
|
||||||
|
@ -779,7 +780,7 @@ export default class BattleScene extends Phaser.Scene {
|
||||||
reset(clearScene?: boolean): void {
|
reset(clearScene?: boolean): void {
|
||||||
this.gameMode = gameModes[GameModes.CLASSIC];
|
this.gameMode = gameModes[GameModes.CLASSIC];
|
||||||
|
|
||||||
this.setSeed(Utils.randomString(24));
|
this.setSeed(SEED_OVERRIDE || Utils.randomString(24));
|
||||||
console.log('Seed:', this.seed);
|
console.log('Seed:', this.seed);
|
||||||
|
|
||||||
this.score = 0;
|
this.score = 0;
|
||||||
|
|
|
@ -498,8 +498,8 @@ export default class PokemonSpecies extends PokemonSpeciesForm {
|
||||||
evolutionChance = Math.min(minChance + easeInFunc(Math.min(level - ev.level, maxLevelDiff) / maxLevelDiff) * (1 - minChance), 1);
|
evolutionChance = Math.min(minChance + easeInFunc(Math.min(level - ev.level, maxLevelDiff) / maxLevelDiff) * (1 - minChance), 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let preferredMinLevel = (ev.level - 1) + ev.wildDelay * this.getStrengthLevelDiff(strength + 1);
|
let preferredMinLevel = Math.max((ev.level - 1) + ev.wildDelay * this.getStrengthLevelDiff(strength + 1), 1);
|
||||||
let evolutionLevel = ev.level > 1 ? ev.level : Math.floor(preferredMinLevel / 2);
|
let evolutionLevel = Math.max(ev.level > 1 ? ev.level : Math.floor(preferredMinLevel / 2), 1);
|
||||||
|
|
||||||
if (ev.level <= 1 && pokemonPrevolutions.hasOwnProperty(this.speciesId)) {
|
if (ev.level <= 1 && pokemonPrevolutions.hasOwnProperty(this.speciesId)) {
|
||||||
const prevolutionLevel = pokemonEvolutions[pokemonPrevolutions[this.speciesId]].find(ev => ev.speciesId === this.speciesId).level;
|
const prevolutionLevel = pokemonEvolutions[pokemonPrevolutions[this.speciesId]].find(ev => ev.speciesId === this.speciesId).level;
|
||||||
|
|
|
@ -548,6 +548,8 @@ export class GameData {
|
||||||
scene.setSeed(sessionData.seed || scene.game.config.seed[0]);
|
scene.setSeed(sessionData.seed || scene.game.config.seed[0]);
|
||||||
scene.resetSeed();
|
scene.resetSeed();
|
||||||
|
|
||||||
|
console.log('Seed:', scene.seed);
|
||||||
|
|
||||||
scene.sessionPlayTime = sessionData.playTime || 0;
|
scene.sessionPlayTime = sessionData.playTime || 0;
|
||||||
|
|
||||||
const loadPokemonAssets: Promise<void>[] = [];
|
const loadPokemonAssets: Promise<void>[] = [];
|
||||||
|
|
Loading…
Reference in New Issue