Skip to content

Commit

Permalink
feat: support special movement types with different keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
xeals committed Jul 16, 2019
1 parent 8ae2cb7 commit 31a7e0e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Heading on first line of block, subtitle on second line of block.
- =ATTR_MONSTER_BASICS= :: Basic stat block; all optional:
- =:ac= (armor class)
- =:hp= (hit dice; given as dice notation, e.g., 3d8+3)
- =:speed=
- =:speed=; for ground speed. For other types of speed, additionally use =:fly=, =:burrow=, =:climb=, =:swim=, or =:hover=
- =ATTR_MONSTER_STATS= :: Monster stats; modifiers are calculated
automatically; all optional:
- =:con=
Expand Down
17 changes: 14 additions & 3 deletions ox-dnd.el
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,23 @@ contextual information."
;; Basics
(let ((ac (org-export-read-attribute :attr_monster_basics monster :ac))
(hp (org-export-read-attribute :attr_monster_basics monster :hp))
(speed (org-export-read-attribute :attr_monster_basics monster :speed)))
(speed (org-export-read-attribute :attr_monster_basics monster :speed))
;; Special speed attributes
(burrow (org-export-read-attribute :attr_monster_basics monster :burrow))
(climb (org-export-read-attribute :attr_monster_basics monster :climb))
(fly (org-export-read-attribute :attr_monster_basics monster :fly))
(hover (org-export-read-attribute :attr_monster_basics monster :hover))
(swim (org-export-read-attribute :attr_monster_basics monster :swim)))
(concat "\\basics[%\n"
(format "armorclass = %s,\n" (or ac 0))
(format "hitpoints = \\dice{%s},\n" (or hp 0))
(format "speed = {%s ft.},\n" (or speed 0))
"]\n"))
(format "speed = {%s ft." (or speed 0))
(when burrow (format ", burrow %s ft." burrow))
(when climb (format ", climb %s ft." climb))
(when fly (format ", fly %s ft." fly))
(when hover (format ", fly %s ft. (hover)" hover))
(when swim (format ", swim %s ft." swim))
"},\n]\n"))
"\\dndline%\n"
;; Stats
(let ((con (org-export-read-attribute :attr_monster_stats monster :con))
Expand Down

0 comments on commit 31a7e0e

Please sign in to comment.