mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 10:21:27 +00:00
max of 3 modifiers for special (4 was confusing to me)
This commit is contained in:
@@ -453,19 +453,11 @@ export class MapPlaylist {
|
||||
count?: number,
|
||||
countReduction: number = 0,
|
||||
): PublicGameModifiers {
|
||||
// Roll how many modifiers to pick: 30% → 1, 40% → 2, 20% → 3, 10% → 4
|
||||
const modifierCountRoll = Math.floor(Math.random() * 10) + 1;
|
||||
const k = Math.max(
|
||||
0,
|
||||
(count ??
|
||||
(modifierCountRoll <= 3
|
||||
? 1
|
||||
: modifierCountRoll <= 7
|
||||
? 2
|
||||
: modifierCountRoll <= 9
|
||||
? 3
|
||||
: 4)) - countReduction,
|
||||
);
|
||||
// Roll how many modifiers to pick: 30% → 1, 50% → 2, 20% → 3
|
||||
const modifierCounts = [1, 1, 1, 2, 2, 2, 2, 2, 3, 3];
|
||||
const rolled =
|
||||
modifierCounts[Math.floor(Math.random() * modifierCounts.length)];
|
||||
const k = Math.max(0, (count ?? rolled) - countReduction);
|
||||
|
||||
// Shuffle the pool, then pick the first k unique modifier keys.
|
||||
const pool = SPECIAL_MODIFIER_POOL.filter(
|
||||
|
||||
Reference in New Issue
Block a user