diff --git a/src/endWeek/saPorn.js b/src/endWeek/saPorn.js index 593c435bb36096387553bb2b0ef22333104c9147..e5b71af2f88ada3a66883cf9c0e0454614a62560 100644 --- a/src/endWeek/saPorn.js +++ b/src/endWeek/saPorn.js @@ -285,11 +285,13 @@ App.SlaveAssignment.porn = (function() { if (slave.porn.prestige === 0 && slave.porn.viewerCount >= 100000) { const pornFameGrabBag = App.Porn.getAllGenres().filter((g) => slave.porn.fame[g.fameVar] >= 10000); if (pornFameGrabBag.length > 0) { - const genre = pornFameGrabBag.pluck(); + const weightedGrabBagIndices = {}; + pornFameGrabBag.forEach((g, i) => weightedGrabBagIndices[i] = slave.porn.fame[g.fameVar]); // Attach weights to the indices of pornFameGrabBag + const genre = pornFameGrabBag[hashChoice(weightedGrabBagIndices)]; // hashChoice selects an index according to the weights slave.porn.fameType = genre.fameName; slave.porn.prestige = 1; - r += `<span style="green">${He} has gained a following in ${slave.porn.fameType} pornography!</span> ${genre.prestigeDesc1}, but ${he} isn't famous enough to be called prestigious yet. `; + r += `<span class="green">${He} has gained a following in ${slave.porn.fameType} pornography!</span> ${genre.prestigeDesc1}, but ${he} isn't famous enough to be called prestigious yet. `; slave.porn.prestigeDesc = `$He has a following in slave pornography. ${genre.prestigeDesc1}.`; if (genre.type === App.Porn.GenreType.fetish && slave.fetishKnown !== 1) { slave.fetishKnown = 1;