54 lines
1.2 KiB
TypeScript
54 lines
1.2 KiB
TypeScript
export interface CombatState {
|
|
/** The unit currently taking their turn */
|
|
activeUnit: UnitStatus | null;
|
|
|
|
/** Sorted list of units acting next */
|
|
turnQueue: QueueEntry[];
|
|
|
|
/** Is the player currently targeting a skill? */
|
|
targetingMode: boolean;
|
|
|
|
/** Global combat info */
|
|
roundNumber: number;
|
|
}
|
|
|
|
export interface UnitStatus {
|
|
id: string;
|
|
name: string;
|
|
portrait: string;
|
|
hp: { current: number; max: number };
|
|
ap: { current: number; max: number };
|
|
charge: number; // 0-100
|
|
statuses: StatusIcon[];
|
|
skills: SkillButton[];
|
|
}
|
|
|
|
export interface QueueEntry {
|
|
unitId: string;
|
|
portrait: string;
|
|
team: "PLAYER" | "ENEMY";
|
|
/** 0-100 progress to next turn */
|
|
initiative: number;
|
|
}
|
|
|
|
export interface StatusIcon {
|
|
id: string;
|
|
icon: string; // URL or Emoji
|
|
turnsRemaining: number;
|
|
description: string;
|
|
}
|
|
|
|
export interface SkillButton {
|
|
id: string;
|
|
name: string;
|
|
icon: string;
|
|
costAP: number;
|
|
cooldown: number; // 0 = Ready
|
|
isAvailable: boolean; // True if affordable and ready
|
|
}
|
|
|
|
export interface CombatEvents {
|
|
"skill-click": { skillId: string };
|
|
"end-turn": void;
|
|
"hover-skill": { skillId: string }; // For showing range grid
|
|
}
|