avoid rolling the same buff multiple times
This commit is contained in:
parent
b6cb000078
commit
f144b55570
@ -57,8 +57,10 @@ const randomiseStats = (randomModType: string, fingerprint: IUnveiledRivenFinger
|
|||||||
const numBuffs = 2 + Math.trunc(Math.random() * 2); // 2 or 3
|
const numBuffs = 2 + Math.trunc(Math.random() * 2); // 2 or 3
|
||||||
const buffEntries = meta.upgradeEntries!.filter(x => x.canBeBuff);
|
const buffEntries = meta.upgradeEntries!.filter(x => x.canBeBuff);
|
||||||
for (let i = 0; i != numBuffs; ++i) {
|
for (let i = 0; i != numBuffs; ++i) {
|
||||||
const entry = getRandomElement(buffEntries);
|
const buffIndex = Math.trunc(Math.random() * buffEntries.length);
|
||||||
|
const entry = buffEntries[buffIndex];
|
||||||
fingerprint.buffs.push({ Tag: entry.tag, Value: Math.trunc(Math.random() * 0x40000000) });
|
fingerprint.buffs.push({ Tag: entry.tag, Value: Math.trunc(Math.random() * 0x40000000) });
|
||||||
|
buffEntries.splice(buffIndex, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
fingerprint.curses = [];
|
fingerprint.curses = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user