Progress on tree features

This commit is contained in:
Clément Pons
2026-01-13 17:47:18 +01:00
parent f761e44569
commit 796b335b2e
5 changed files with 12182 additions and 70 deletions

View File

@@ -58,14 +58,16 @@ export type CharacterVariables = {
money: number;
};
export type TreeStructure = {
name: string;
nodes: FeatureID[];
// { 'from_id': { 'pathname': 'to_id' } };
paths: Record<number, Record<string, number>>;
};
type CommonState = {
capacity?: number;
powercost?: number;
};
type StateBufferKeys = typeof ITEM_BUFFER_KEYS[number];
type ArmorState = { loss: number, health?: number, absorb?: { flat?: number, percent?: number } };
type WeaponState = { attack?: number | string, hit?: number };
type WondrousState = { };
@@ -77,7 +79,6 @@ type ItemState = {
charges?: number;
equipped?: boolean;
state?: (ArmorState | WeaponState | WondrousState | MundaneState) & CommonState;
buffer?: Partial<Record<StateBufferKeys, PropertySum>>;
};
export type CharacterConfig = {
peoples: Record<string, RaceConfig>;
@@ -198,7 +199,7 @@ export type FeatureEquipment = {
id: FeatureID;
category: "value";
operation: "add" | "set" | "min";
property: StateBufferKeys;
property: `item/${RecursiveKeyOf<(ArmorState | WeaponState | WondrousState | MundaneState) & CommonState>}`;
value: number | `modifier/${MainStat}` | false;
}
export type FeatureList = {