mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-16 21:32:18 +02:00
Modify egg gacha to be even split
This commit is contained in:
parent
7061bb0d70
commit
c8961869bf
@ -95,9 +95,14 @@ export function getLegendaryGachaSpeciesForTimestamp(scene: BattleScene, timesta
|
|||||||
|
|
||||||
let ret: Species;
|
let ret: Species;
|
||||||
|
|
||||||
|
// 604800000 is the number of miliseconds in one week
|
||||||
|
const weekOffset = Utils.getSunday(new Date(timestamp)).getTime(); // Timestamp of current week
|
||||||
|
const offset = Math.floor(Math.floor(weekOffset / 604800000)/legendarySpecies.length); // Cycle number
|
||||||
|
const index = Math.floor(weekOffset / 604800000)%legendarySpecies.length // Index within cycle
|
||||||
|
|
||||||
scene.executeWithSeedOffset(() => {
|
scene.executeWithSeedOffset(() => {
|
||||||
ret = Utils.randSeedItem(legendarySpecies);
|
ret = Phaser.Math.RND.shuffle(legendarySpecies)[index];
|
||||||
}, Utils.getSunday(new Date(timestamp)).getTime(), EGG_SEED.toString());
|
}, offset, EGG_SEED.toString());
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user