Training viewer and properties manager preparation

This commit is contained in:
Clément Pons
2025-06-04 17:42:47 +02:00
parent 42915d699f
commit 218b68db60
10 changed files with 123 additions and 3991 deletions

View File

@@ -8,7 +8,6 @@ export const TRAINING_LEVELS = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] as const;
export const SPELL_TYPES = ["precision","knowledge","instinct","arts"] as const; export type SpellType = typeof SPELL_TYPES[number];
export const CATEGORIES = ["action","reaction","freeaction","misc"] as const; export type Category = typeof CATEGORIES[number];
export const SPELL_ELEMENTS = ["fire","ice","thunder","earth","arcana","air","nature","light","psyche"] as const; export type SpellElement = typeof SPELL_ELEMENTS[number];
export const RESISTANCES = ["stun","bleed","poison","fear","influence","charm","possesion","precision","knowledge","instinct"] as const; export type Resistance = typeof RESISTANCES[number];
export type DoubleIndex<T extends number | string> = [T, number];
@@ -109,7 +108,6 @@ export type CharacterConfig = {
peoples: Race[],
training: Record<MainStat, Record<TrainingLevel, TrainingOption[]>>;
abilities: Record<Ability, AbilityConfig>;
resistances: Record<Resistance, ResistanceConfig>;
spells: SpellConfig[];
};
export type SpellConfig = {
@@ -128,10 +126,6 @@ export type AbilityConfig = {
name: string;
description: string;
};
export type ResistanceConfig = {
name: string;
statistic: MainStat;
};
export type Race = {
name: string;
description: string;
@@ -150,12 +144,19 @@ export type RaceOption = {
spellslots?: number;
};
export type FeatureItem = {
category: "freeaction" | "misc";
category: "misc";
text: string;
} | {
category: "action" | "reaction";
category: "action";
cost: 1 | 2 | 3;
text: string;
} | {
category: "reaction";
cost: 1 | 2;
text: string;
} | {
category: "freeaction";
text: string;
} | {
category: "value";
type: "add" | "remove" | "set";
@@ -167,12 +168,7 @@ export type FeatureItem = {
kind: "spells";
asset: string;
}
export type Feature = {
id: number;
name?: string
text?: string;
list?: FeatureItem[];
};
type FeatureCategory = FeatureItem["category"];
export type TrainingOption = {
description: Array<{
text: string;
@@ -189,7 +185,8 @@ export type TrainingOption = {
mastery?: keyof CompiledCharacter["mastery"];
spellrank?: SpellType;
defense?: Array<keyof CompiledCharacter["defense"]>;
resistance?: [Resistance, "attack" | "defense"][];
resistance?: Record<MainStat, number>;
bonus?: Record<string, number>;
spell?: string;
//Used during character creation, not used by compiler
@@ -240,13 +237,13 @@ export type CompiledCharacter = {
magicinstinct: number;
};
//First is attack, second is defense
resistance: Record<Resistance, [number, number]>;
bonus: Record<string, number>; //Any special bonus goes here
resistance: Record<MainStat, number>;
modifier: Record<MainStat, number>;
abilities: Partial<Record<Ability, number>>;
level: number;
features: Record<Category, string[]>; //Currently: List of training option as text. TODO: Update to a more complex structure later
features: { [K in FeatureCategory]: Array<Extract<FeatureItem, { category: K }>> };
notes: string;
};