Mass updates

This commit is contained in:
2026-01-05 11:33:32 +01:00
parent 32b6cf4af7
commit 04534b2530
36 changed files with 1886 additions and 12036 deletions

View File

@@ -4,7 +4,7 @@ import type { Serialize } from 'nitropack';
export type CampaignVariables = {
money: number;
inventory: ItemState[];
items: ItemState[];
};
export type Campaign = {
id: number;
@@ -16,11 +16,4 @@ export type Campaign = {
characters: Array<Partial<{ character: { id: number, name: string, owner: number } }>>;
public_notes: string;
dm_notes: string;
logs: CampaignLog[];
} & CampaignVariables;
export type CampaignLog = {
target: number;
timestamp: Serialize<Date>;
type: 'ITEM' | 'CHARACTER' | 'PLACE' | 'FIGHT' | 'TEXT';
details: string;
};
} & CampaignVariables;

View File

@@ -57,39 +57,54 @@ export type CharacterVariables = {
money: number;
};
type CommonState = {
capacity?: number;
powercost?: number;
};
type ArmorState = { health?: number };
type WeaponState = { attack?: number | string, hit?: number };
type WondrousState = { };
type MundaneState = { };
type ItemState = {
id: string;
amount: number;
enchantments?: string[];
charges?: number;
equipped?: boolean;
state?: any;
state?: (ArmorState | WeaponState | WondrousState | MundaneState) & CommonState;
};
export type CharacterConfig = {
peoples: Record<string, RaceConfig>;
training: Record<MainStat, Record<TrainingLevel, FeatureID[]>>;
spells: Record<string, SpellConfig>;
spells: Record<string, SpellConfig | ArtConfig>;
aspects: Record<string, AspectConfig>;
features: Record<FeatureID, Feature>;
enchantments: Record<string, EnchantementConfig>; //TODO
enchantments: Record<string, EnchantementConfig>;
items: Record<string, ItemConfig>;
sickness: Record<string, { id: string, name: string, description: string, effect: FeatureID[] }>;
action: Record<string, { id: string, name: string, description: string, cost: number }>;
reaction: Record<string, { id: string, name: string, description: string, cost: number }>;
freeaction: Record<string, { id: string, name: string, description: string }>;
passive: Record<string, { id: string, name: string, description: string }>;
texts: Record<i18nID, Localized>;
//Each of these groups extend an existing feature as they all use the same properties
sickness: Record<FeatureID, { stage: number }>; //TODO
poisons: Record<FeatureID, { difficulty: number, efficienty: number, solubility: number }>; //TODO
dedications: Record<FeatureID, { id: string, name: string, description: i18nID, effect: FeatureID[], requirement: Array<{ stat: MainStat, amount: number }> }>; //TODO
};
export type EnchantementConfig = {
id: string;
name: string; //TODO -> TextID
description: i18nID;
effect: Array<FeatureEquipment | FeatureValue | FeatureList>;
power: number;
restrictions?: Array<'armor' | 'mundane' | 'wondrous' | 'weapon' | `armor/${ArmorConfig['type']}` | `weapon/${WeaponConfig['type'][number]}`>; // Need to respect *any* of the restriction, not every restrictions.
}
export type ItemConfig = CommonItemConfig & (ArmorConfig | WeaponConfig | WondrousConfig | MundaneConfig);
type CommonItemConfig = {
id: string;
name: string; //TODO -> TextID
flavoring: i18nID;
flavoring?: i18nID;
description: i18nID;
rarity: 'common' | 'uncommon' | 'rare' | 'legendary';
weight?: number; //Optionnal but highly recommended
@@ -101,6 +116,7 @@ type CommonItemConfig = {
effects?: Array<FeatureValue | FeatureEquipment | FeatureList>;
equippable: boolean;
consummable: boolean;
craft?: { mineral: number, natural: number, processed: number, magical: number };
}
type ArmorConfig = {
category: 'armor';
@@ -126,7 +142,7 @@ export type SpellConfig = {
id: string;
name: string; //TODO -> TextID
rank: 1 | 2 | 3 | 4;
type: SpellType;
type: Exclude<SpellType, "arts">;
cost: number;
speed: "action" | "reaction" | number;
elements: Array<SpellElement>;
@@ -135,6 +151,15 @@ export type SpellConfig = {
range: 'personnal' | number;
tags?: string[];
};
export type ArtConfig = {
id: string;
name: string; //TODO -> TextID
rank: 1 | 2 | 3;
type: "arts";
difficulty: number;
description: string; //TODO -> TextID
tags?: string[];
};
export type RaceConfig = {
id: string;
name: string; //TODO -> TextID
@@ -204,16 +229,19 @@ export type CompiledCharacter = {
spellslots: number; //Max
artslots: number; //Max
spellranks: Record<SpellType, 0 | 1 | 2 | 3>;
aspect: string; //ID
aspect: {
id: string,
amount: number;
duration: number;
bonus: number;
tier: 0 | 1 | 2;
};
speed: number | false;
capacity: number | false;
initiative: number;
exhaust: number;
itempower: number;
action: number;
reaction: number;
variables: CharacterVariables,
defense: {
@@ -238,10 +266,18 @@ export type CompiledCharacter = {
};
bonus: {
defense: Partial<Record<MainStat, number>>;
defense: Partial<Record<MainStat, number>>; //Defense aux jets de resistance
abilities: Partial<Record<Ability, number>>;
spells: {
type: Partial<Record<SpellType, number>>;
rank: Partial<Record<1 | 2 | 3 | 4, number>>;
elements: Partial<Record<SpellElement, number>>;
};
weapon: Partial<Record<WeaponType, number>>;
}; //Any special bonus goes here
resistance: Record<string, number>;
resistance: Partial<Record<Resistance, number>>; //Bonus à l'attaque
craft: { level: number, bonus: number };
modifier: Record<MainStat, number>;
abilities: Partial<Record<Ability, number>>;

View File

@@ -17,5 +17,4 @@ type CanvasPreferences = {
export type Localized = {
fr_FR?: string;
en_US?: string;
default: string;
}