aboutsummaryrefslogtreecommitdiff
path: root/org-d20.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-11-12 21:53:08 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-11-12 21:53:08 -0700
commita3734368cd5a36541dab2fa8f7404cb850991b5b (patch)
tree57bf1833d1b474b359481b9c009cfbf6cc402aac /org-d20.el
parentaf5e2afb8c862f348da75c25cb0a71fb444fe2a7 (diff)
downloadorg-d20-a3734368cd5a36541dab2fa8f7404cb850991b5b.tar.gz
org-d20-d20: show d4 in case Bless spell is active
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'org-d20.el')
-rw-r--r--org-d20.el13
1 files changed, 11 insertions, 2 deletions
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)))