Merge branch 'beta' into formChangeLocale

This commit is contained in:
Lugiad 2024-09-19 00:28:52 +02:00 committed by GitHub
commit 65ea5486ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 14 deletions

View File

@ -1,6 +1,6 @@
import BattleScene from "../battle-scene"; import BattleScene from "../battle-scene";
import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./pokemon-species"; import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./pokemon-species";
import { VariantTier } from "../enums/variant-tiers"; import { VariantTier } from "../enums/variant-tier";
import * as Utils from "../utils"; import * as Utils from "../utils";
import Overrides from "#app/overrides"; import Overrides from "#app/overrides";
import { pokemonPrevolutions } from "./pokemon-evolutions"; import { pokemonPrevolutions } from "./pokemon-evolutions";
@ -178,7 +178,7 @@ export class Egg {
// be done because species with no variants get filtered at rollSpecies but if the // be done because species with no variants get filtered at rollSpecies but if the
// species is set via options or the legendary gacha pokemon gets choosen the check never happens // species is set via options or the legendary gacha pokemon gets choosen the check never happens
if (this._species && !getPokemonSpecies(this._species).hasVariants()) { if (this._species && !getPokemonSpecies(this._species).hasVariants()) {
this._variantTier = VariantTier.COMMON; this._variantTier = VariantTier.STANDARD;
} }
// Needs this._tier so it needs to be generated afer the tier override if bought from same species // Needs this._tier so it needs to be generated afer the tier override if bought from same species
this._eggMoveIndex = eggOptions?.eggMoveIndex ?? this.rollEggMoveIndex(); this._eggMoveIndex = eggOptions?.eggMoveIndex ?? this.rollEggMoveIndex();
@ -494,12 +494,12 @@ export class Egg {
// place but I don't want to touch the pokemon class. // place but I don't want to touch the pokemon class.
private rollVariant(): VariantTier { private rollVariant(): VariantTier {
if (!this.isShiny) { if (!this.isShiny) {
return VariantTier.COMMON; return VariantTier.STANDARD;
} }
const rand = Utils.randSeedInt(10); const rand = Utils.randSeedInt(10);
if (rand >= 4) { if (rand >= 4) {
return VariantTier.COMMON; // 6/10 return VariantTier.STANDARD; // 6/10
} else if (rand >= 1) { } else if (rand >= 1) {
return VariantTier.RARE; // 3/10 return VariantTier.RARE; // 3/10
} else { } else {

View File

@ -1,5 +0,0 @@
export enum VariantTier {
COMMON,
RARE,
EPIC
}

View File

@ -6,7 +6,7 @@ import { PokeballType } from "#enums/pokeball";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
import { TimeOfDay } from "#enums/time-of-day"; import { TimeOfDay } from "#enums/time-of-day";
import { VariantTier } from "#enums/variant-tiers"; import { VariantTier } from "#enums/variant-tier";
import { WeatherType } from "#enums/weather-type"; import { WeatherType } from "#enums/weather-type";
import { type PokeballCounts } from "./battle-scene"; import { type PokeballCounts } from "./battle-scene";
import { Gender } from "./data/gender"; import { Gender } from "./data/gender";

View File

@ -1,6 +1,6 @@
import { EggTier } from "#enums/egg-type"; import { EggTier } from "#enums/egg-type";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { VariantTier } from "#enums/variant-tiers"; import { VariantTier } from "#enums/variant-tier";
import { EGG_SEED, Egg } from "../data/egg"; import { EGG_SEED, Egg } from "../data/egg";
import { EggSourceType } from "#app/enums/egg-source-types"; import { EggSourceType } from "#app/enums/egg-source-types";

View File

@ -1,7 +1,7 @@
import { Egg, getLegendaryGachaSpeciesForTimestamp } from "#app/data/egg"; import { Egg, getLegendaryGachaSpeciesForTimestamp } from "#app/data/egg";
import { EggSourceType } from "#app/enums/egg-source-types"; import { EggSourceType } from "#app/enums/egg-source-types";
import { EggTier } from "#app/enums/egg-type"; import { EggTier } from "#app/enums/egg-type";
import { VariantTier } from "#app/enums/variant-tiers"; import { VariantTier } from "#app/enums/variant-tier";
import EggData from "#app/system/egg-data"; import EggData from "#app/system/egg-data";
import * as Utils from "#app/utils"; import * as Utils from "#app/utils";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -136,9 +136,9 @@ describe("Egg Generation Tests", () => {
expect(result).toBe(expectedResult); expect(result).toBe(expectedResult);
}); });
it("should return a shiny common variant", () => { it("should return a shiny standard variant", () => {
const scene = game.scene; const scene = game.scene;
const expectedVariantTier = VariantTier.COMMON; const expectedVariantTier = VariantTier.STANDARD;
const result = new Egg({ scene, isShiny: true, variantTier: expectedVariantTier, species: Species.BULBASAUR }).generatePlayerPokemon(scene).variant; const result = new Egg({ scene, isShiny: true, variantTier: expectedVariantTier, species: Species.BULBASAUR }).generatePlayerPokemon(scene).variant;