mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-27 10:42:25 +02:00
Compare commits
2 Commits
9669735d4c
...
6c2c14cb1e
Author | SHA1 | Date | |
---|---|---|---|
|
6c2c14cb1e | ||
|
6d515d58b5 |
@ -15,9 +15,10 @@ export const EGG_SEED = 1073741824;
|
|||||||
// Rates for specific random properties in 1/x
|
// Rates for specific random properties in 1/x
|
||||||
const DEFAULT_SHINY_RATE = 128;
|
const DEFAULT_SHINY_RATE = 128;
|
||||||
const GACHA_SHINY_UP_SHINY_RATE = 64;
|
const GACHA_SHINY_UP_SHINY_RATE = 64;
|
||||||
const SAME_SPECIES_EGG_SHINY_RATE = 32;
|
const SAME_SPECIES_EGG_SHINY_RATE = 24;
|
||||||
const SAME_SPECIES_EGG_HA_RATE = 16;
|
const SAME_SPECIES_EGG_HA_RATE = 8;
|
||||||
const MANAPHY_EGG_MANAPHY_RATE = 8;
|
const MANAPHY_EGG_MANAPHY_RATE = 8;
|
||||||
|
const GACHA_EGG_HA_RATE = 192;
|
||||||
|
|
||||||
// 1/x for legendary eggs, 1/x*2 for epic eggs, 1/x*4 for rare eggs, and 1/x*8 for common eggs
|
// 1/x for legendary eggs, 1/x*2 for epic eggs, 1/x*4 for rare eggs, and 1/x*8 for common eggs
|
||||||
const DEFAULT_RARE_EGGMOVE_RATE = 6;
|
const DEFAULT_RARE_EGGMOVE_RATE = 6;
|
||||||
@ -211,11 +212,12 @@ export class Egg {
|
|||||||
pokemonSpecies = getPokemonSpecies(Utils.randSeedInt(MANAPHY_EGG_MANAPHY_RATE) ? Species.PHIONE : Species.MANAPHY);
|
pokemonSpecies = getPokemonSpecies(Utils.randSeedInt(MANAPHY_EGG_MANAPHY_RATE) ? Species.PHIONE : Species.MANAPHY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets the hidden ability if a hidden ability exists and the override is set
|
// Sets the hidden ability if a hidden ability exists and
|
||||||
// or if the same species egg hits the chance
|
// the override is set or the egg hits the chance
|
||||||
let abilityIndex: number | undefined = undefined;
|
let abilityIndex: number | undefined = undefined;
|
||||||
if (pokemonSpecies.abilityHidden && (this._overrideHiddenAbility
|
const sameSpeciesEggHACheck = (this._sourceType === EggSourceType.SAME_SPECIES_EGG && !Utils.randSeedInt(SAME_SPECIES_EGG_HA_RATE));
|
||||||
|| (this._sourceType === EggSourceType.SAME_SPECIES_EGG && !Utils.randSeedInt(SAME_SPECIES_EGG_HA_RATE)))) {
|
const gachaEggHACheck = (!(this._sourceType === EggSourceType.SAME_SPECIES_EGG) && !Utils.randSeedInt(GACHA_EGG_HA_RATE));
|
||||||
|
if (pokemonSpecies.abilityHidden && (this._overrideHiddenAbility || sameSpeciesEggHACheck || gachaEggHACheck)) {
|
||||||
abilityIndex = 2;
|
abilityIndex = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,8 +398,7 @@ export class Egg {
|
|||||||
* 2 cost mons get 1.5x
|
* 2 cost mons get 1.5x
|
||||||
* 4, 6, 8 cost mons get 1.75x
|
* 4, 6, 8 cost mons get 1.75x
|
||||||
* 3, 5, 7, 9 cost mons get 1x
|
* 3, 5, 7, 9 cost mons get 1x
|
||||||
* Alolan, Galarian, and Paldean mons get 0.5x
|
* Alolan, Galarian, Hisui, and Paldean mons get 0.5x
|
||||||
* Hisui mons get 0.125x
|
|
||||||
*
|
*
|
||||||
* The total weight is also being calculated EACH time there is an egg hatch instead of being generated once
|
* The total weight is also being calculated EACH time there is an egg hatch instead of being generated once
|
||||||
* and being the same each time
|
* and being the same each time
|
||||||
@ -408,7 +409,7 @@ export class Egg {
|
|||||||
let weight = Math.floor((((maxStarterValue - speciesStarters[speciesId]) / ((maxStarterValue - minStarterValue) + 1)) * 1.5 + 1) * 100);
|
let weight = Math.floor((((maxStarterValue - speciesStarters[speciesId]) / ((maxStarterValue - minStarterValue) + 1)) * 1.5 + 1) * 100);
|
||||||
const species = getPokemonSpecies(speciesId);
|
const species = getPokemonSpecies(speciesId);
|
||||||
if (species.isRegional()) {
|
if (species.isRegional()) {
|
||||||
weight = Math.floor(weight / (species.isRareRegional() ? 8 : 2));
|
weight = Math.floor(weight / 2);
|
||||||
}
|
}
|
||||||
speciesWeights.push(totalWeight + weight);
|
speciesWeights.push(totalWeight + weight);
|
||||||
totalWeight += weight;
|
totalWeight += weight;
|
||||||
|
@ -7,7 +7,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||||
import { MovePhase, TurnEndPhase } from "#app/phases";
|
import { MovePhase, TurnEndPhase } from "#app/phases";
|
||||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||||
import { Status, StatusEffect } from "#app/data/status-effect.js";
|
import { StatusEffect } from "#app/data/status-effect.js";
|
||||||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||||
import { BattlerIndex } from "#app/battle.js";
|
import { BattlerIndex } from "#app/battle.js";
|
||||||
|
|
||||||
@ -30,6 +30,7 @@ describe("Abilities - Flash Fire", () => {
|
|||||||
game.override
|
game.override
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.ability(Abilities.FLASH_FIRE)
|
.ability(Abilities.FLASH_FIRE)
|
||||||
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.startingLevel(20)
|
.startingLevel(20)
|
||||||
.enemyLevel(20)
|
.enemyLevel(20)
|
||||||
.disableCrits();
|
.disableCrits();
|
||||||
@ -75,13 +76,11 @@ describe("Abilities - Flash Fire", () => {
|
|||||||
|
|
||||||
it("activated after being frozen", async() => {
|
it("activated after being frozen", async() => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset(SPLASH_ONLY);
|
||||||
|
game.override.statusEffect(StatusEffect.FREEZE);
|
||||||
await game.startBattle([Species.BLISSEY]);
|
await game.startBattle([Species.BLISSEY]);
|
||||||
|
|
||||||
const blissey = game.scene.getPlayerPokemon()!;
|
const blissey = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
blissey!.status = new Status(StatusEffect.FREEZE);
|
|
||||||
expect(blissey.status?.effect).toBe(StatusEffect.FREEZE);
|
|
||||||
|
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||||
|
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
@ -118,16 +118,16 @@ const languageSettings: { [key: string]: LanguageSetting } = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const starterCandyCosts: { passive: integer, costReduction: [integer, integer], egg: integer }[] = [
|
const starterCandyCosts: { passive: integer, costReduction: [integer, integer], egg: integer }[] = [
|
||||||
{ passive: 50, costReduction: [30, 75], egg: 35 }, // 1
|
{ passive: 40, costReduction: [25, 60], egg: 30 }, // 1 Cost
|
||||||
{ passive: 45, costReduction: [25, 60], egg: 35 }, // 2
|
{ passive: 40, costReduction: [25, 60], egg: 30 }, // 2 Cost
|
||||||
{ passive: 40, costReduction: [20, 50], egg: 35 }, // 3
|
{ passive: 35, costReduction: [20, 50], egg: 25 }, // 3 Cost
|
||||||
{ passive: 30, costReduction: [15, 40], egg: 30 }, // 4
|
{ passive: 30, costReduction: [15, 40], egg: 20 }, // 4 Cost
|
||||||
{ passive: 25, costReduction: [12, 35], egg: 25 }, // 5
|
{ passive: 25, costReduction: [12, 35], egg: 18 }, // 5 Cost
|
||||||
{ passive: 20, costReduction: [10, 30], egg: 20 }, // 6
|
{ passive: 20, costReduction: [10, 30], egg: 15 }, // 6 Cost
|
||||||
{ passive: 15, costReduction: [8, 20], egg: 15 }, // 7
|
{ passive: 15, costReduction: [8, 20], egg: 12 }, // 7 Cost
|
||||||
{ passive: 10, costReduction: [5, 15], egg: 10 }, // 8
|
{ passive: 10, costReduction: [5, 15], egg: 8 }, // 8 Cost
|
||||||
{ passive: 10, costReduction: [3, 10], egg: 10 }, // 9
|
{ passive: 10, costReduction: [5, 15], egg: 8 }, // 9 Cost
|
||||||
{ passive: 10, costReduction: [3, 10], egg: 10 }, // 10
|
{ passive: 10, costReduction: [5, 15], egg: 8 }, // 10 Cost
|
||||||
];
|
];
|
||||||
|
|
||||||
// Position of UI elements
|
// Position of UI elements
|
||||||
|
Loading…
Reference in New Issue
Block a user