Change shared files naming. Rework tree structure and item management rendering.

This commit is contained in:
Clément Pons
2026-01-20 18:14:07 +01:00
parent 1a71637ebb
commit 777443471c
66 changed files with 984 additions and 447 deletions

View File

@@ -1,4 +1,4 @@
import type { MAIN_STATS, ABILITIES, LEVELS, TRAINING_LEVELS, SPELL_TYPES, CATEGORIES, SPELL_ELEMENTS, ALIGNMENTS, RESISTANCES, DAMAGE_TYPES, WEAPON_TYPES, PropertySum, ITEM_BUFFER_KEYS } from "#shared/character.util";
import type { MAIN_STATS, ABILITIES, LEVELS, TRAINING_LEVELS, SPELL_TYPES, CATEGORIES, SPELL_ELEMENTS, ALIGNMENTS, RESISTANCES, DAMAGE_TYPES, WEAPON_TYPES, PropertySum, ITEM_BUFFER_KEYS } from "#shared/character";
import type { Localized } from "../types/general";
export type MainStat = typeof MAIN_STATS[number];
@@ -57,11 +57,19 @@ export type CharacterVariables = {
money: number;
};
export enum TreeFlag {
AUTOMATIC = 1 << 0,
REPEATING = 1 << 1,
};
export type TreeLeaf = {
id: FeatureID;
to?: FeatureID | Array<FeatureID> | Record<string, FeatureID>;
flags?: number; //Flags from TreeFlag
};
export type TreeStructure = {
name: string;
nodes: FeatureID[];
paths: Record<number, number | number[]>;
starts: FeatureID;
nodes: Record<FeatureID, TreeLeaf>;
};
type CommonState = {
capacity?: number;
@@ -212,7 +220,7 @@ export type FeatureTree = {
id: FeatureID;
category: "tree";
tree: string;
option?: number;
option?: string;
};
export type FeatureChoice = {
id: FeatureID;