mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 17:29:30 +02:00
Prevent shinies from altering runs
Places variant rolls inside of an ExecuteWithSeedOffset block, using the current floor's RNG seed as the seed and the Pokémon's ID as the offset.
This commit is contained in:
parent
93ff4adc30
commit
5c30f5cfdd
@ -1913,10 +1913,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
if (!this.shiny || (!variantData.hasOwnProperty(variantDataIndex) && !variantData.hasOwnProperty(this.species.speciesId))) {
|
if (!this.shiny || (!variantData.hasOwnProperty(variantDataIndex) && !variantData.hasOwnProperty(this.species.speciesId))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const rand = Utils.randSeedInt(10);
|
const rand = new Utils.IntegerHolder(0);
|
||||||
if (rand >= 4) {
|
this.scene.executeWithSeedOffset(() => {
|
||||||
|
rand.value = Utils.randSeedInt(10);
|
||||||
|
}, this.id, this.scene.waveSeed);
|
||||||
|
if (rand.value >= 4) {
|
||||||
return 0; // 6/10
|
return 0; // 6/10
|
||||||
} else if (rand >= 1) {
|
} else if (rand.value >= 1) {
|
||||||
return 1; // 3/10
|
return 1; // 3/10
|
||||||
} else {
|
} else {
|
||||||
return 2; // 1/10
|
return 2; // 1/10
|
||||||
|
@ -2448,9 +2448,9 @@ export class ModifierTypeOption {
|
|||||||
*/
|
*/
|
||||||
export function getPartyLuckValue(party: Pokemon[]): integer {
|
export function getPartyLuckValue(party: Pokemon[]): integer {
|
||||||
if (party[0].scene.gameMode.isDaily) {
|
if (party[0].scene.gameMode.isDaily) {
|
||||||
let DailyLuck: integer = 0;
|
const DailyLuck = new Utils.IntegerHolder(0);
|
||||||
party[0].scene.executeWithSeedOffset(() => {
|
party[0].scene.executeWithSeedOffset(() => {
|
||||||
DailyLuck = Utils.randSeedInt(15); // Random number between 0 and 14
|
DailyLuck.value = Utils.randSeedInt(15); // Random number between 0 and 14
|
||||||
}, 0, party[0].scene.seed);
|
}, 0, party[0].scene.seed);
|
||||||
return DailyLuck;
|
return DailyLuck;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user