You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
1.9 KiB
83 lines
1.9 KiB
import {GameState} from "./GameState";
|
|
|
|
export enum ElementalType {
|
|
Fire = "fire",
|
|
Water = "water",
|
|
Lightning = "lightning",
|
|
Ice = "ice",
|
|
Earth = "earth",
|
|
Wind = "wind",
|
|
Light = "light",
|
|
Dark = "dark",
|
|
Physical = "physical",
|
|
Nonelemental = "non-elemental",
|
|
Healing = "healing",
|
|
}
|
|
|
|
export enum Affinity {
|
|
Absorbs = "absorbs",
|
|
Immune = "immune",
|
|
Resistant = "resistant",
|
|
Normal = "normal",
|
|
Vulnerable = "vulnerable",
|
|
}
|
|
|
|
export enum NumberSign {
|
|
Positive = "+",
|
|
Negative = "-",
|
|
}
|
|
|
|
export enum MeteredResource {
|
|
Experience = "EXP",
|
|
Health = "HP",
|
|
Magic = "MP",
|
|
Items = "IP",
|
|
Zero = "ZP",
|
|
Blood = "BP",
|
|
Turns = "TP",
|
|
Segments = "Segments",
|
|
}
|
|
export enum UnmeteredResource {
|
|
Fabula = "FP",
|
|
Ultima = "UP",
|
|
Special = "SP",
|
|
Level = "Level",
|
|
Materials = "Materials",
|
|
Zenit = "Zenit",
|
|
}
|
|
|
|
export type Resource = MeteredResource|UnmeteredResource
|
|
|
|
export enum FailReason {
|
|
Avoid = "avoid",
|
|
Dodge = "dodge",
|
|
Miss = "miss",
|
|
Resist = "resist",
|
|
Fail = "fail",
|
|
Block = "block",
|
|
Parry = "parry",
|
|
}
|
|
|
|
export const Target: unique symbol = Symbol("target");
|
|
export const Source: unique symbol = Symbol("source");
|
|
|
|
export type Operands = Set<string|typeof Target|typeof Source>;
|
|
export function Operands<T extends string|typeof Target|typeof Source>(...items: readonly T[]): Set<T> {
|
|
return new Set<T>(items)
|
|
}
|
|
export function OperandsFrom<T extends string|typeof Target|typeof Source>(children: readonly Set<T>[]): Set<T> {
|
|
return new Set<T>([...children.flatMap((child) => [...child.values()])])
|
|
}
|
|
|
|
export interface ParseContext {
|
|
readonly timestamp: number
|
|
readonly source: readonly string[]
|
|
readonly target: readonly string[]
|
|
readonly game: GameState
|
|
}
|
|
|
|
export interface MarkdownContext extends ParseContext {}
|
|
|
|
export interface MarkdownOutput extends MarkdownContext {
|
|
readonly output: string
|
|
} |