Add Trees and Masteries in the feature editor. Add some items.

This commit is contained in:
Clément Pons
2026-01-14 22:40:58 +01:00
parent 796b335b2e
commit ce3dbb0d6e
6 changed files with 108 additions and 12187 deletions

View File

@@ -61,8 +61,7 @@ export type TreeStructure = {
name: string;
nodes: FeatureID[];
// { 'from_id': { 'pathname': 'to_id' } };
paths: Record<number, Record<string, number>>;
paths: Record<number, number | number[]>;
};
type CommonState = {
capacity?: number;
@@ -199,16 +198,22 @@ export type FeatureEquipment = {
id: FeatureID;
category: "value";
operation: "add" | "set" | "min";
property: `item/${RecursiveKeyOf<(ArmorState | WeaponState | WondrousState | MundaneState) & CommonState>}`;
property: `item/${RecursiveKeyOf<ArmorState & WeaponState & WondrousState & MundaneState & CommonState>}`;
value: number | `modifier/${MainStat}` | false;
}
};
export type FeatureList = {
id: FeatureID;
category: "list";
list: "spells" | "sickness" | "action" | "reaction" | "freeaction" | "passive";
list: "spells" | "sickness" | "action" | "reaction" | "freeaction" | "passive" | "mastery";
action: "add" | "remove";
item: string;
};
export type FeatureTree = {
id: FeatureID;
category: "tree";
tree: string;
option?: number;
};
export type FeatureChoice = {
id: FeatureID;
category: "choice";
@@ -217,9 +222,9 @@ export type FeatureChoice = {
amount: number;
exclusive: boolean; //Disallow to pick the same option twice
};
options: Array<{ text: string, effects: Array<FeatureValue | FeatureList> }>; //TODO -> TextID
options: Array<{ text: string, effects: Array<FeatureValue | FeatureList | FeatureTree> }>; //TODO -> TextID
};
export type FeatureItem = FeatureValue | FeatureList | FeatureChoice;
export type FeatureItem = FeatureValue | FeatureList | FeatureChoice | FeatureTree;
export type Feature = {
id: FeatureID;
description: string; //TODO -> TextID
@@ -246,6 +251,7 @@ export type CompiledCharacter = {
bonus?: Partial<CompiledCharacter['bonus']>;
};
mastery: Array<`weapon/${WeaponType}` | `armor/${'light' | 'medium' | 'heavy'}`>;
speed: number | false;
capacity: number | false;
initiative: number;
@@ -263,18 +269,6 @@ export type CompiledCharacter = {
passivedodge: number;
};
mastery: {
strength: number;
dexterity: number;
shield: number;
armor: number;
multiattack: number;
magicpower: number;
magicspeed: number;
magicelement: number;
magicinstinct: number;
};
bonus: {
defense: Partial<Record<MainStat, number>>; //Defense aux jets de resistance
abilities: Partial<Record<Ability, number>>;