54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
import { BOSS_DEFINITIONS } from "./bossCatalog";
|
|
import {
|
|
advanceMechanicLoadout,
|
|
BOSS_MECHANIC_REGISTRY,
|
|
BULL_CHARGE,
|
|
BULL_POUNCE,
|
|
handleMechanicDispel,
|
|
upcomingLoadoutMechanic,
|
|
} from "./bosses/mechanicPool";
|
|
import { createBaseMotion } from "./bosses/shared";
|
|
import type { BossMechanicContext, BossMechanicResult } from "./bosses/types";
|
|
import type { BossId, BossMotionState, BossState, MemberId, WorldPosition } from "./types";
|
|
|
|
export { BOSS_MECHANIC_REGISTRY, BULL_CHARGE, BULL_POUNCE };
|
|
|
|
export function createBossState(bossId: BossId = "bulldrome"): BossState {
|
|
const definition = BOSS_DEFINITIONS[bossId];
|
|
return {
|
|
id: bossId,
|
|
name: definition.name,
|
|
maxHp: definition.maxHp,
|
|
hp: definition.maxHp,
|
|
nextMeleeAt: 2,
|
|
};
|
|
}
|
|
|
|
export function createBossMotionState(bossId: BossId = "bulldrome"): BossMotionState {
|
|
return {
|
|
...createBaseMotion(bossId),
|
|
position: [0, -6.8],
|
|
chargeStart: [0, -6.8],
|
|
nextMechanicAt: 5,
|
|
};
|
|
}
|
|
|
|
export function advanceBossMechanics(context: BossMechanicContext): BossMechanicResult {
|
|
return advanceMechanicLoadout(context, BOSS_DEFINITIONS[context.boss.id].mechanicIds);
|
|
}
|
|
|
|
export function handleBossDispel(
|
|
_bossId: BossId,
|
|
motion: BossMotionState,
|
|
memberId: MemberId,
|
|
position: WorldPosition,
|
|
time: number,
|
|
debuffNames: readonly string[],
|
|
) {
|
|
return handleMechanicDispel(motion, memberId, position, time, debuffNames);
|
|
}
|
|
|
|
export function upcomingMechanic(boss: BossState, motion: BossMotionState, time: number) {
|
|
return upcomingLoadoutMechanic(BOSS_DEFINITIONS[boss.id].mechanicIds, motion, time);
|
|
}
|