Start implementing ItemEditor

This commit is contained in:
2025-10-13 13:19:50 +02:00
parent 16cc3ee438
commit d187957915
9 changed files with 337 additions and 22 deletions

15
types/character.d.ts vendored
View File

@@ -82,36 +82,33 @@ export type EnchantementConfig = {
export type ItemConfig = CommonItemConfig & (ArmorConfig | WeaponConfig | WondrousConfig | MundaneConfig);
type CommonItemConfig = {
id: string;
name: string; //TODO -> TextID
description: i18nID;
rarity: 'common' | 'uncommon' | 'rare' | 'legendary';
weight?: number; //Optionnal but highly recommended
price?: number; //Optionnal but highly recommended
power?: number; //Optionnal as most mundane items should not receive enchantments (potions, herbal heals, etc...)
charge?: number //Max amount of charges
enchantments?: string[]; //Enchantment ID
effects?: Array<FeatureValue | FeatureEquipment | FeatureList>;
equippable: boolean;
}
type ArmorConfig = {
category: 'armor';
name: string; //TODO -> TextID
description: i18nID;
health: number;
type: 'light' | 'medium' | 'heavy';
absorb: { static: number, percent: number };
};
type WeaponConfig = {
category: 'weapon';
name: string; //TODO -> TextID
description: i18nID;
type: Array<'classic' | 'light' | 'throw' | 'natural' | 'heavy' | 'twohanded' | 'finesse' | 'reach' | 'projectile' | 'shield'>;
damage: string; //Dice formula
};
type WondrousConfig = {
category: 'wondrous';
name: string; //TODO -> TextID
description: i18nID;
effect: FeatureItem[];
};
type MundaneConfig = {
category: 'mundane';
name: string; //TODO -> TextID
description: i18nID;
};
export type SpellConfig = {
id: string;