chore: todos

This commit is contained in:
hyper 2026-04-16 19:14:46 +08:00
parent 51da1e5308
commit b18e232cc8
2 changed files with 10 additions and 0 deletions

View File

@ -9,6 +9,9 @@ export type TriggerContext = {
rng: { nextInt: (n: number) => number };
};
// TODO add an onCardDrawn trigger
// TODO refactor this to NOT implicitly correspond to an effect type, but generic event handler
// TODO also, refactor this to be async to support prompts and produceAsync
export type BuffTriggerBehavior = {
onTurnStart?: (ctx: TriggerContext, entityKey: "player" | string, stacks: number) => void;
onTurnEnd?: (ctx: TriggerContext, entityKey: "player" | string, stacks: number) => void;
@ -21,6 +24,7 @@ export type BuffTriggerBehavior = {
onCardDiscarded?: (ctx: TriggerContext, cardId: string, stacks: number) => void;
};
// TODO refactor this to be keyed by event type
export type CombatTriggerRegistry = Record<string, BuffTriggerBehavior>;
export function createCombatTriggerRegistry(): CombatTriggerRegistry {

View File

@ -1,3 +1,4 @@
// TODO shouldn't rely on csv types. Use interfaces and expect csv types to match.
import type { EnemyDesert } from "../data/enemyDesert.csv";
import type { EnemyIntentDesert } from "../data/enemyIntentDesert.csv";
import type { EffectDesert } from "../data/effectDesert.csv";
@ -6,6 +7,7 @@ import type { PlayerState } from "../progress/types";
export type BuffTable = Record<string, number>;
// TODO rename this to "lifecycle". Should use lifecycle in csv as well.
export type EffectTiming = EffectDesert["timing"];
export type EffectTarget = "self" | "target" | "all" | "random" | "player" | "team";
@ -58,9 +60,13 @@ export type CombatState = {
player: PlayerCombatState;
phase: CombatPhase;
turnNumber: number;
// TODO: "fled" is a per-enemy state. Should remove it here and expand the isAlive property on enemy instead.
// TODO: CombatResult should just be "victory" "defeat" or null.
result: CombatResult | null;
loot: LootEntry[];
// TODO: I think this belongs to the player combat state.
itemBuffs: ItemBuff[];
// TODO: Also belongs to the player combat state.
fatigueAddedCount: number;
enemyTemplateData: Record<string, EnemyDesert>;
};