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; export function Operands(...items: readonly T[]): Set { return new Set(items) } export function OperandsFrom(children: readonly Set[]): Set { return new Set([...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 }