Skip to content

WIP: Directive Interfaces

Max Rothman edited this page Jun 26, 2016 · 7 revisions

Spells

Using options

.. spell:: Burning Hands
    :level: 1
    :school: evocation
    :casting-time: 1 action
    :range: self
    :area: 15 foot cone
    :components: V, S
    :duration: instantaneous

    As you hold your hands with thumbs touching and fingers spread, a thin sheet of flames shoots forth from your
    outstretched fingertips. Each creature in a 15 foot Cone must make a Dexterity saving throw. A creature takes 3d6
    fire damage on a failed save, or half as much damage on a successful one.

    The fire ignites any flammable objects in the area that aren’t being worn or carried.

Advantages:

  • uses existing directive parser, so less fiddly
  • easy to implement

Disadvantages:

  • can't nest options, so forces us to flatten interface and parse some things out
  • potentially more difficult to get semantic markup (have to parse option text, e.g. 15 foot cone into {num: 15, unit: feet, shape: cone})
  • how to handle "at higher levels"? That section could potentially contain markup, and I don't think options can contain markup (verify) and I think they can only be 1 line (also verify)

Using a serialization syntax (JSON/YAML/whatever)

Using special roles/directives in the directive body

Using a new custom syntax

Clone this wiki locally