Character creation UI fixes, updates and resistances are displayed.

This commit is contained in:
2025-04-23 22:44:34 +02:00
parent 0771d5ebd1
commit 7a11c5382c
9 changed files with 135 additions and 100 deletions

29
types/character.d.ts vendored
View File

@@ -2,7 +2,7 @@ export type MainStat = "strength" | "dexterity" | "constitution" | "intelligence
export type Ability = "athletics" | "acrobatics" | "intimidation" | "sleightofhand" | "stealth" | "survival" | "investigation" | "history" | "religion" | "arcana" | "understanding" | "perception" | "performance" | "medecine" | "persuasion" | "animalhandling" | "deception";
export type Level = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
export type TrainingLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
export type SpellType = "precision" | "knowledge" | "instinct";
export type SpellType = "precision" | "knowledge" | "instinct" | "arts";
export type Category = "action" | "reaction" | "freeaction" | "misc";
export type Resistance = keyof CompiledCharacter["resistance"];
@@ -30,13 +30,18 @@ export type Character = {
export type CharacterConfig = {
peoples: Race[],
training: Record<MainStat, Record<TrainingLevel, TrainingOption[]>>;
ability: Record<Ability, AbilityConfig>;
abilities: Record<Ability, AbilityConfig>;
resistances: Record<Resistance, ResistanceConfig>;
};
export type AbilityConfig = {
max: [MainStat, MainStat];
name: string;
description: string;
}
};
export type ResistanceConfig = {
name: string;
statistic: MainStat;
};
export type Race = {
name: string;
description: string;
@@ -49,9 +54,9 @@ export type RaceOption = {
training?: number;
health?: number;
mana?: number;
spec?: number;
shaping?: number;
modifier?: number;
abilities?: number;
};
export type Feature = {
text?: string;
@@ -86,17 +91,24 @@ export type TrainingOption = {
replaced?: boolean;
category?: Category;
}>;
//Automatically calculated by compiler
mana?: number;
health?: number;
modifier?: number;
ability?: number;
speed?: false | number;
initiative?: number;
mastery?: keyof CompiledCharacter["mastery"];
spellrank?: SpellType;
spellslot?: number | MainStat;
defense?: Array<keyof CompiledCharacter["defense"]>;
resistance?: [Resistance, "attack" | "defense"][];
//Used during character creation, not used by compiler
modifier?: number;
ability?: number;
spec?: number;
spellslot?: number | MainStat;
arts?: number | MainStat;
features?: Feature[]; //TODO
};
export type CompiledCharacter = {
@@ -108,6 +120,7 @@ export type CompiledCharacter = {
mana: number;
race: number;
spellslots: number;
artslots: number;
spellranks: Record<SpellType, 0 | 1 | 2 | 3>;
aspect: string;
speed: number | false;
@@ -135,7 +148,7 @@ export type CompiledCharacter = {
resistance: { //First is attack, second is defense
stun: [number, number];
bleed: [number, number];
posion: [number, number];
poison: [number, number];
fear: [number, number];
influence: [number, number];
charm: [number, number];