[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
This commit is contained in:
sirzento 2024-06-25 16:19:24 +02:00 committed by GitHub
parent 8e6cbad3fc
commit 79d29bae85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -372,7 +372,7 @@ export class Egg {
// If this is the 10th egg without unlocking something new, attempt to force it. // If this is the 10th egg without unlocking something new, attempt to force it.
if (scene.gameData.unlockPity[this.tier] >= 9) { 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 if (lockedPool.length) { // Skip this if everything is unlocked
speciesPool = lockedPool; 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); scene.gameData.unlockPity[this.tier] = Math.min(scene.gameData.unlockPity[this.tier] + 1, 10);
} else { } else {
scene.gameData.unlockPity[this.tier] = 0; scene.gameData.unlockPity[this.tier] = 0;