chore: todos
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user