aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS.md1
-rw-r--r--org-d20.el13
2 files changed, 12 insertions, 2 deletions
diff --git a/NEWS.md b/NEWS.md
index e28052b..8ba0aef 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
----------------
- New defcustom, `org-d20-display-rolls-buffer`.
+- `org-d20-d20` shows the result of rolling a d4 in case /Bless/ is active.
- Replace some calls to `loop` with calls to `cl-loop`.
- Other code cleanup.
diff --git a/org-d20.el b/org-d20.el
index 198b585..28ab294 100644
--- a/org-d20.el
+++ b/org-d20.el
@@ -210,16 +210,25 @@ the best N of them, e.g., 4d6k3."
(interactive)
(let* ((fst (cdr (org-d20--roll "1d20")))
(snd (cdr (org-d20--roll "1d20")))
+ (bls (cdr (org-d20--roll "1d4")))
(fst* (int-to-string fst))
(snd* (int-to-string snd))
+ (bls* (int-to-string bls))
(adv (if (>= fst snd)
(concat (propertize fst* 'face 'bold) " " snd*)
(concat fst* " " (propertize snd* 'face 'bold))))
(disadv (if (<= fst snd)
(concat (propertize fst* 'face 'bold) " " snd*)
(concat fst* " " (propertize snd* 'face 'bold)))))
- (org-d20--record-roll "No adv./disadv.: %s\tAdv.: %s\tDisadv.: %s"
- fst* adv disadv))
+ (org-d20--record-roll
+ "No adv./disadv.: %s%sAdv.: %s%sDisadv.: %s%sBless: %s"
+ fst*
+ (make-string (- 4 (length fst*)) ?\ )
+ adv
+ (make-string (- 8 (length adv)) ?\ )
+ disadv
+ (make-string (- 10 (length disadv)) ?\ )
+ bls*))
(when org-d20-dice-sound
(play-sound-file org-d20-dice-sound)))