mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 16:26:25 +00:00
[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:
parent
8e6cbad3fc
commit
79d29bae85
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user