Update Healer Man server
This commit is contained in:
1 parent
ab1434a3b8
commit
e284f4fc76
60 files changed
+2704
-118
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import catalog from "../src/game/generated/dungeonLeaderboardCatalog.generated.json" with { type: "json" };
|
||||
import bots from "../src/game/dungeonRaceBotCatalog.json" with { type: "json" };
|
||||
import affixes from "../src/game/dungeonRaceAffixes.json" with { type: "json" };
|
||||
|
||||
export const RACE_QUEUE_WAIT_MS = 5_000;
|
||||
export const RACE_PREPARE_MS = 5 * 60_000;
|
||||
@@ -31,6 +32,19 @@ export function hashRaceSeed(value) {
|
||||
return hash >>> 0;
|
||||
}
|
||||
|
||||
export function rollRaceAffixes(seed) {
|
||||
return [
|
||||
affixes.kill[hashRaceSeed(`${seed}:kill-affix`) % affixes.kill.length].id,
|
||||
affixes.movement[hashRaceSeed(`${seed}:movement-affix`) % affixes.movement.length].id,
|
||||
];
|
||||
}
|
||||
|
||||
export function raceAffixPace(pair = []) {
|
||||
return pair.reduce((factor, id) => factor * (
|
||||
[...affixes.kill, ...affixes.movement].find((entry) => entry.id === id)?.botMultiplier ?? 1
|
||||
), 1);
|
||||
}
|
||||
|
||||
export function botTierForRecord(wins, losses, seed) {
|
||||
const total = wins + losses;
|
||||
const rate = total < 5 ? 0.5 : wins / total;
|
||||
@@ -39,11 +53,11 @@ export function botTierForRecord(wins, losses, seed) {
|
||||
return bots.tiers[Math.max(0, Math.min(3, base + (roll === 0 ? -1 : roll === 3 ? 1 : 0)))].id;
|
||||
}
|
||||
|
||||
export function botOpponent(seed, tierId, source = null) {
|
||||
export function botOpponent(seed, tierId, source = null, affixIds = []) {
|
||||
const tier = bots.tiers.find((entry) => entry.id === tierId) ?? bots.tiers[1];
|
||||
const resolvedSource = source ?? (hashRaceSeed(`${seed}:source`) % 2 ? "rom" : "wow");
|
||||
const variance = 0.92 + (hashRaceSeed(`${seed}:pace`) % 161) / 1000;
|
||||
const finishMs = Math.round(bots.baselineMs * tier.multiplier * variance);
|
||||
const finishMs = Math.round(bots.baselineMs * tier.multiplier * variance * raceAffixPace(affixIds));
|
||||
return { type: "bot", name: `${tier.label} ${resolvedSource === "rom" ? "RuneWaker" : "Azeroth"} Team`,
|
||||
tier: tier.id, source: resolvedSource, roster: bots.teams[resolvedSource], finishMs,
|
||||
milestones: bots.milestones.map((entry) => ({ ...entry, atMs: Math.round(finishMs * entry.at) })) };
|
||||
|
||||
Reference in new issue
Block a user