✨feature: Initial code setup
This commit is contained in:
215
src/types/content.ts
Normal file
215
src/types/content.ts
Normal file
@@ -0,0 +1,215 @@
|
||||
import type { ContentReference, DiceKind, RuleEffect } from "./rules";
|
||||
|
||||
export type TableCategory =
|
||||
| "generic"
|
||||
| "random-list"
|
||||
| "loot"
|
||||
| "level"
|
||||
| "optional"
|
||||
| "town"
|
||||
| "room";
|
||||
|
||||
export type TableEntry = {
|
||||
key: string;
|
||||
min?: number;
|
||||
max?: number;
|
||||
exact?: number;
|
||||
d66?: number;
|
||||
label: string;
|
||||
text?: string;
|
||||
effects?: RuleEffect[];
|
||||
references?: ContentReference[];
|
||||
};
|
||||
|
||||
export type TableDefinition = {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
category: TableCategory;
|
||||
level?: number;
|
||||
page: number;
|
||||
diceKind: DiceKind;
|
||||
usesModifiedRangesRule?: boolean;
|
||||
entries: TableEntry[];
|
||||
notes?: string[];
|
||||
mvp: boolean;
|
||||
};
|
||||
|
||||
export type WeaponCategory = "melee" | "ranged";
|
||||
|
||||
export type WeaponDefinition = {
|
||||
id: string;
|
||||
name: string;
|
||||
category: WeaponCategory;
|
||||
handedness: "one-handed" | "two-handed";
|
||||
baseDamage: number;
|
||||
allowedManoeuvreIds: string[];
|
||||
tags: string[];
|
||||
startingOption: boolean;
|
||||
};
|
||||
|
||||
export type ManoeuvreDefinition = {
|
||||
id: string;
|
||||
name: string;
|
||||
weaponCategories: WeaponCategory[];
|
||||
shiftCost?: number;
|
||||
disciplineModifier?: number;
|
||||
precisionModifier?: number;
|
||||
damageModifier?: number;
|
||||
exactStrikeBonus?: boolean;
|
||||
interruptRule?: string;
|
||||
effectText?: string;
|
||||
mvp: boolean;
|
||||
};
|
||||
|
||||
export type ArmourDefinition = {
|
||||
id: string;
|
||||
name: string;
|
||||
armourValue: number;
|
||||
penalties?: {
|
||||
shift?: number;
|
||||
discipline?: number;
|
||||
precision?: number;
|
||||
};
|
||||
deflectionRule?: string;
|
||||
startingOption: boolean;
|
||||
valueGp?: number;
|
||||
mvp: boolean;
|
||||
};
|
||||
|
||||
export type ItemType =
|
||||
| "gear"
|
||||
| "treasure"
|
||||
| "quest"
|
||||
| "herb"
|
||||
| "rune"
|
||||
| "misc"
|
||||
| "ration"
|
||||
| "light-source";
|
||||
|
||||
export type ItemDefinition = {
|
||||
id: string;
|
||||
name: string;
|
||||
itemType: ItemType;
|
||||
stackable: boolean;
|
||||
consumable: boolean;
|
||||
valueGp?: number;
|
||||
weight?: number;
|
||||
rulesText?: string;
|
||||
effects?: RuleEffect[];
|
||||
mvp: boolean;
|
||||
};
|
||||
|
||||
export type PotionUseTiming = "combat" | "exploration" | "town" | "any";
|
||||
|
||||
export type PotionDefinition = {
|
||||
id: string;
|
||||
name: string;
|
||||
tableSource: string;
|
||||
useTiming: PotionUseTiming;
|
||||
effects: RuleEffect[];
|
||||
valueGp?: number;
|
||||
mvp: boolean;
|
||||
};
|
||||
|
||||
export type ScrollDefinition = {
|
||||
id: string;
|
||||
name: string;
|
||||
tableSource: string;
|
||||
castCheck?: {
|
||||
diceKind: Extract<DiceKind, "d6" | "2d6">;
|
||||
successMin?: number;
|
||||
successMax?: number;
|
||||
};
|
||||
onSuccess: RuleEffect[];
|
||||
onFailureTableCode?: string;
|
||||
valueGp?: number;
|
||||
startingOption: boolean;
|
||||
mvp: boolean;
|
||||
};
|
||||
|
||||
export type CreatureDefinition = {
|
||||
id: string;
|
||||
name: string;
|
||||
level: number;
|
||||
category: string;
|
||||
hp: number;
|
||||
attackProfile: {
|
||||
discipline: number;
|
||||
precision: number;
|
||||
damage: number;
|
||||
numberAppearing?: string;
|
||||
};
|
||||
defenceProfile?: {
|
||||
armour?: number;
|
||||
specialRules?: string[];
|
||||
};
|
||||
xpReward?: number;
|
||||
lootTableCodes?: string[];
|
||||
interruptRules?: string[];
|
||||
traits?: string[];
|
||||
sourcePage: number;
|
||||
mvp: boolean;
|
||||
};
|
||||
|
||||
export type ExitType = "open" | "door" | "locked" | "secret" | "shaft" | "stairs";
|
||||
|
||||
export type ExitTemplate = {
|
||||
direction?: "north" | "east" | "south" | "west";
|
||||
exitType: ExitType;
|
||||
destinationLevel?: number;
|
||||
};
|
||||
|
||||
export type RoomClass = "normal" | "small" | "large" | "special" | "start" | "stairs";
|
||||
|
||||
export type RoomTemplate = {
|
||||
id: string;
|
||||
level: number;
|
||||
roomClass: RoomClass;
|
||||
tableCode: string;
|
||||
tableEntryKey: string;
|
||||
title: string;
|
||||
text?: string;
|
||||
dimensions?: {
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
exits?: ExitTemplate[];
|
||||
encounterRefs?: ContentReference[];
|
||||
objectRefs?: ContentReference[];
|
||||
tags: string[];
|
||||
mvp: boolean;
|
||||
};
|
||||
|
||||
export type TownServiceType =
|
||||
| "market"
|
||||
| "temple"
|
||||
| "tavern"
|
||||
| "healer"
|
||||
| "smith"
|
||||
| "quest";
|
||||
|
||||
export type TownServiceDefinition = {
|
||||
id: string;
|
||||
name: string;
|
||||
serviceType: TownServiceType;
|
||||
tableCodes?: string[];
|
||||
costRules?: string[];
|
||||
effects?: RuleEffect[];
|
||||
mvp: boolean;
|
||||
};
|
||||
|
||||
export type ContentPack = {
|
||||
version: string;
|
||||
sourceBooks: string[];
|
||||
tables: TableDefinition[];
|
||||
weapons: WeaponDefinition[];
|
||||
manoeuvres: ManoeuvreDefinition[];
|
||||
armour: ArmourDefinition[];
|
||||
items: ItemDefinition[];
|
||||
potions: PotionDefinition[];
|
||||
scrolls: ScrollDefinition[];
|
||||
creatures: CreatureDefinition[];
|
||||
roomTemplates: RoomTemplate[];
|
||||
townServices: TownServiceDefinition[];
|
||||
};
|
||||
Reference in New Issue
Block a user