Skip to content

Type Alias: NotationProblem ​

ts
type NotationProblem = 
  | "shape"
  | "count"
  | "sides"
  | "bonus"
  | "twice"
  | "keep"
  | "reroll"
  | "explode"
  | "kinds"
  | "minus"
  | "times"
  | "custom"
  | "successes"
  | "clamp"
  | "marks"
  | "unique"
  | "math"
  | "fraction"
  | "zero"
  | "label"
  | "weights";

Defined in: src/notation.ts:88

Dice notation, the way a character sheet writes it.

set = [times "#"] roll [ "#" label ] the roll thrown several times: 6#4d6dl1 times = 1 to 100 roll = dice { "+" dice } [bonus] dice = [count] "d" sides { modifier } count = 1 to 10 over the whole roll, and 1 when left out sides = 2 to 1000, "%" for 100, or "F" for a Fate die | number "{" face ":" weight { "," face ":" weight } "}" a loaded die | "[" face { "," face } "]" a custom die face = words [ "=" value ] [ "#" colour ] in a custom die; a number alone is worth itself modifier = "!" | "!!" | "!p" | "!!p" the dice explode: each a die of its own, compounding, penetrating, or both [ compare ] … on these faces and not only the highest: !>=5 | "r" [point] reroll until clear: r<3, r=1, r1, r>=5; "r" alone is the lowest face | "ro" [point] reroll once: ro<3, ro=1 | "kh" [n] | "kl" [n] keep the highest or lowest n (1 when left out); "k" and "b" are kh, "w" is kl | "dh" [n] | "dl" [n] drop the highest or lowest n; "d" alone is dl | "min" n | "max" n a die counts for at least, or at most, n | compare count successes: the total is how many dice meet it | "f" point with a count: each die meeting it takes a success away | "cs" [point] | "cf" [point] mark dice as critical successes or failures; alone, the highest and the lowest face | "sa" | "sd" | "s" show the dice sorted, ascending (or "s") or descending compare = ( "=" | "<" | ">" | "<=" | ">=" | "<>" ) number point = compare | "!=" number | number a bare number is "=" bonus = "+" or "-", then 0 to 99 label = up to 40 characters, saying what the roll is for; "[label]" in front of the roll is read too

Letters in either case, spaces anywhere between the parts. Up to four kinds of dice are added together, each with its own modifiers, and the bonus comes last. 6# in front throws the whole roll six times as a set (rollMany); it is a prefix so that it can never be read as arithmetic. A kind's modifiers may come in any order and each at most once; whatever order they are written in, a die is rerolled first, then explodes, and keeping or dropping is decided last. Exploding dice are not kept or dropped.

A loaded die is a numbered die with some faces weighted: d6{6:3} shows its 6 three times in eight, and every face not named weighs 1. A custom die is its faces: d[Yes,No,Maybe], d[Hit=1,Miss=0,Miss=0], and a face written twice comes up twice as often. Neither can be written, read or shared as a fair die: the braces and the brackets are part of its name. A custom die takes no modifiers.

r follows Roll20 and the dice libraries that follow it: it rerolls until the die is clear, and ro rerolls once. Until 1.4.0 this package's r rerolled once; parseNotation(text, { legacyReroll: true }) reads text written then.

MIT © John Morris