forked from phenom/healer-man
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,4 +1,5 @@
|
||||
import catalog from "../game/dungeonRaceBotCatalog.json";
|
||||
import { dungeonRaceAffixPace, type DungeonRaceAffixPair } from "../game/dungeonRaceAffixes";
|
||||
|
||||
export type RaceBotTier = "novice" | "regular" | "veteran" | "elite";
|
||||
export type RaceBotSource = "wow" | "rom";
|
||||
@@ -18,14 +19,17 @@ export function hashRaceSeed(value: string): number {
|
||||
return hash >>> 0;
|
||||
}
|
||||
|
||||
export function createRaceBot(seed: string, tierId: RaceBotTier, source: RaceBotSource): RaceBot {
|
||||
export function createRaceBot(seed: string, tierId: RaceBotTier, source: RaceBotSource,
|
||||
affixIds?: DungeonRaceAffixPair): RaceBot {
|
||||
const tier = catalog.tiers.find((entry) => entry.id === tierId) ?? catalog.tiers[1];
|
||||
const variance = 0.92 + (hashRaceSeed(`${seed}:pace`) % 161) / 1000;
|
||||
const pace = affixIds ? dungeonRaceAffixPace(affixIds) : 1;
|
||||
const finishMs = Math.round(catalog.baselineMs * tier.multiplier * variance * pace);
|
||||
return { type: "bot", name: `${tier.label} ${source === "rom" ? "RuneWaker" : "Azeroth"} Team`,
|
||||
tier: tier.id as RaceBotTier, source, roster: catalog.teams[source],
|
||||
finishMs: Math.round(catalog.baselineMs * tier.multiplier * variance),
|
||||
finishMs,
|
||||
milestones: catalog.milestones.map((entry) => ({ ...entry,
|
||||
atMs: Math.round(catalog.baselineMs * tier.multiplier * variance * entry.at) })) };
|
||||
atMs: Math.round(finishMs * entry.at) })) };
|
||||
}
|
||||
|
||||
export function raceBotProgress(elapsedMs: number, bot: RaceBot): number {
|
||||
|
||||
Reference in new issue
Block a user