You've already forked obsidian-visualiser
New feature system for training and homebrew
This commit is contained in:
@@ -38,18 +38,18 @@ export const mainStatTexts: Record<MainStat, string> = {
|
||||
"curiosity": "Curiosité",
|
||||
"charisma": "Charisme",
|
||||
"psyche": "Psyché",
|
||||
}
|
||||
};
|
||||
export const elementTexts: Record<SpellElement, { class: string, text: string }> = {
|
||||
fire: { class: 'text-light-red dark:text-dark-red', text: 'Feu' },
|
||||
ice: { class: 'text-light-blue dark:text-dark-blue', text: 'Glace' },
|
||||
thunder: { class: 'text-light-yellow dark:text-dark-yellow', text: 'Foudre' },
|
||||
earth: { class: 'text-light-orange dark:text-dark-orange', text: 'Terre' },
|
||||
arcana: { class: 'text-light-purple dark:text-dark-purple', text: 'Arcane' },
|
||||
air: { class: 'text-light-green dark:text-dark-green', text: 'Air' },
|
||||
nature: { class: 'text-light-green dark:text-dark-green', text: 'Nature' },
|
||||
light: { class: 'text-light-yellow dark:text-dark-yellow', text: 'Lumière' },
|
||||
psyche: { class: 'text-light-purple dark:text-dark-purple', text: 'Psy' },
|
||||
}
|
||||
fire: { class: 'text-light-red dark:text-dark-red border-light-red dark:border-dark-red bg-light-red dark:bg-dark-red', text: 'Feu' },
|
||||
ice: { class: 'text-light-blue dark:text-dark-blue border-light-blue dark:border-dark-blue bg-light-blue dark:bg-dark-blue', text: 'Glace' },
|
||||
thunder: { class: 'text-light-yellow dark:text-dark-yellow border-light-yellow dark:border-dark-yellow bg-light-yellow dark:bg-dark-yellow', text: 'Foudre' },
|
||||
earth: { class: 'text-light-orange dark:text-dark-orange border-light-orange dark:border-dark-orange bg-light-orange dark:bg-dark-orange', text: 'Terre' },
|
||||
arcana: { class: 'text-light-indigo dark:text-dark-indigo border-light-indigo dark:border-dark-indigo bg-light-indigo dark:bg-dark-indigo', text: 'Arcane' },
|
||||
air: { class: 'text-light-lime dark:text-dark-lime border-light-lime dark:border-dark-lime bg-light-lime dark:bg-dark-lime', text: 'Air' },
|
||||
nature: { class: 'text-light-green dark:text-dark-green border-light-green dark:border-dark-green bg-light-green dark:bg-dark-green', text: 'Nature' },
|
||||
light: { class: 'text-light-yellow dark:text-dark-yellow border-light-yellow dark:border-dark-yellow bg-light-yellow dark:bg-dark-yellow', text: 'Lumière' },
|
||||
psyche: { class: 'text-light-purple dark:text-dark-purple border-light-purple dark:border-dark-purple bg-light-purple dark:bg-dark-purple', text: 'Psy' },
|
||||
};
|
||||
export const spellTypeTexts: Record<SpellType, string> = { "instinct": "Instinct", "knowledge": "Savoir", "precision": "Précision", "arts": "Oeuvres" };
|
||||
|
||||
export const CharacterValidation = z.object({
|
||||
@@ -79,7 +79,7 @@ export const CharacterValidation = z.object({
|
||||
username: z.string().optional(),
|
||||
visibility: z.enum(["public", "private"]),
|
||||
thumbnail: z.any(),
|
||||
})
|
||||
});
|
||||
export type Character = {
|
||||
id: number;
|
||||
|
||||
@@ -115,7 +115,7 @@ export type CharacterConfig = {
|
||||
export type SpellConfig = {
|
||||
id: string;
|
||||
name: string;
|
||||
rank: 1 | 2 | 3;
|
||||
rank: 1 | 2 | 3 | 4;
|
||||
type: SpellType;
|
||||
cost: number;
|
||||
speed: "action" | "reaction" | number;
|
||||
@@ -149,31 +149,29 @@ export type RaceOption = {
|
||||
abilities?: number;
|
||||
spellslots?: number;
|
||||
};
|
||||
export type Feature = {
|
||||
text?: string;
|
||||
} & (ActionFeature | ReactionFeature | FreeActionFeature | BonusFeature | MiscFeature);
|
||||
type ActionFeature = {
|
||||
type: "action";
|
||||
export type FeatureItem = {
|
||||
category: "freeaction" | "misc";
|
||||
text: string;
|
||||
} | {
|
||||
category: "action" | "reaction";
|
||||
cost: 1 | 2 | 3;
|
||||
text: string;
|
||||
};
|
||||
type ReactionFeature = {
|
||||
type: "reaction";
|
||||
text: string;
|
||||
};
|
||||
type FreeActionFeature = {
|
||||
type: "freeaction";
|
||||
text: string;
|
||||
};
|
||||
type BonusFeature = {
|
||||
type: "bonus";
|
||||
action: "add" | "remove" | "set" | "cap";
|
||||
value: number;
|
||||
} | {
|
||||
category: "value";
|
||||
type: "add" | "remove" | "set";
|
||||
value: number | false;
|
||||
property: string;
|
||||
};
|
||||
type MiscFeature = {
|
||||
type: "misc";
|
||||
text: string;
|
||||
} | {
|
||||
category: "asset";
|
||||
type: "add" | "remove";
|
||||
kind: "spells";
|
||||
asset: string;
|
||||
}
|
||||
export type Feature = {
|
||||
id: number;
|
||||
name?: string
|
||||
text?: string;
|
||||
list?: FeatureItem[];
|
||||
};
|
||||
export type TrainingOption = {
|
||||
description: Array<{
|
||||
@@ -192,16 +190,16 @@ export type TrainingOption = {
|
||||
spellrank?: SpellType;
|
||||
defense?: Array<keyof CompiledCharacter["defense"]>;
|
||||
resistance?: [Resistance, "attack" | "defense"][];
|
||||
spell?: string;
|
||||
spell?: string;
|
||||
|
||||
//Used during character creation, not used by compiler
|
||||
modifier?: number;
|
||||
ability?: number;
|
||||
spec?: number;
|
||||
spec?: number;
|
||||
spellslot?: number | MainStat;
|
||||
arts?: number | MainStat;
|
||||
|
||||
features?: Feature[]; //TODO
|
||||
features?: FeatureItem[]; //TODO
|
||||
};
|
||||
export type CompiledCharacter = {
|
||||
id: number;
|
||||
@@ -222,6 +220,7 @@ export type CompiledCharacter = {
|
||||
values: CharacterValues,
|
||||
|
||||
defense: {
|
||||
hardcap: number;
|
||||
static: number;
|
||||
activeparry: number;
|
||||
activedodge: number;
|
||||
@@ -238,6 +237,7 @@ export type CompiledCharacter = {
|
||||
magicpower: number;
|
||||
magicspeed: number;
|
||||
magicelement: number;
|
||||
magicinstinct: number;
|
||||
};
|
||||
|
||||
//First is attack, second is defense
|
||||
|
||||
Reference in New Issue
Block a user