Add action variants and cursed items.

This commit is contained in:
Clément Pons
2026-02-03 17:39:21 +01:00
parent 3081c05b55
commit 8335871883
4 changed files with 1205 additions and 188 deletions

View File

@@ -72,6 +72,7 @@ export type TreeStructure = {
type CommonState = {
capacity?: number;
powercost?: number;
analysed?: boolean;
};
type ArmorState = { loss: number, health?: number, absorb: { flat?: number, percent?: number } };
type WeaponState = { attack?: number | string, hit?: number };
@@ -94,17 +95,17 @@ export type CharacterConfig = {
features: Record<FeatureID, Feature>;
enchantments: Record<string, EnchantementConfig>;
items: Record<string, ItemConfig>;
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 }>;
action: Record<string, { id: string, name: string, description: string, cost?: number, variants?: string[], parent?: string }>;
reaction: Record<string, { id: string, name: string, description: string, cost?: number, variants?: string[], parent?: string }>;
freeaction: Record<string, { id: string, name: string, description: string, variants?: string[], parent?: string }>;
passive: Record<string, { id: string, name: string, description: string, variants?: string[], parent?: string }>;
texts: Record<i18nID, Localized>;
trees: Record<string, TreeStructure>;
//Each of these groups extend an existing feature as they all use the same properties
sickness: Record<FeatureID, { name: string, stage: number }>; //TODO
poisons: Record<FeatureID, { name: string, difficulty: number, efficienty: number, solubility: number }>; //TODO
dedications: Record<FeatureID, { name: string, requirement: Array<{ stat: MainStat, amount: number }> }>; //TODO
poison: Record<FeatureID, { name: string, difficulty: number, efficienty: number, solubility: number }>; //TODO
dedication: Record<FeatureID, { name: string, requirement: Array<{ stat: MainStat, amount: number }> }>; //TODO
};
export type EnchantementConfig = {
id: string;
@@ -113,6 +114,7 @@ export type EnchantementConfig = {
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.
cursed: boolean;
}
export type ItemConfig = CommonItemConfig & (ArmorConfig | WeaponConfig | WondrousConfig | MundaneConfig);
type CommonItemConfig = {
@@ -211,7 +213,7 @@ export type FeatureEquipment = {
export type FeatureList = {
id: FeatureEffectID;
category: "list";
list: "spells" | "sickness" | "action" | "reaction" | "freeaction" | "passive" | "mastery";
list: "spells" | "sickness" | "action" | "reaction" | "freeaction" | "passive" | "mastery" | "poison" | "dedication";
action: "add" | "remove";
item: string;
};