From 79d29bae850442a143eadb87931c1ad102ba486c Mon Sep 17 00:00:00 2001 From: sirzento Date: Tue, 25 Jun 2024 16:19:24 +0200 Subject: [PATCH] [BUG] Egg pity should take owned eggs into account if rolled for species (#2584) * Fixed Bug that causes multiple pity eggs in a row * Bugfix that eggpity wont be increased if pokemon is not cought but exists as an egg --- src/data/egg.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/egg.ts b/src/data/egg.ts index eba3bab0d87..bb952d71fb0 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -372,7 +372,7 @@ export class Egg { // If this is the 10th egg without unlocking something new, attempt to force it. if (scene.gameData.unlockPity[this.tier] >= 9) { - const lockedPool = speciesPool.filter(s => !scene.gameData.dexData[s].caughtAttr); + const lockedPool = speciesPool.filter(s => !scene.gameData.dexData[s].caughtAttr && !scene.gameData.eggs.some(e => e.species === s)); if (lockedPool.length) { // Skip this if everything is unlocked speciesPool = lockedPool; } @@ -417,7 +417,7 @@ export class Egg { } } - if (!!scene.gameData.dexData[species].caughtAttr) { + if (!!scene.gameData.dexData[species].caughtAttr || scene.gameData.eggs.some(e => e.species === species)) { scene.gameData.unlockPity[this.tier] = Math.min(scene.gameData.unlockPity[this.tier] + 1, 10); } else { scene.gameData.unlockPity[this.tier] = 0;