From d1641912837b6ed79570005761c76013115b2254 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 11 Feb 2018 12:45:36 -0700 Subject: add spwd20-roll-last --- .emacs.d/site-lisp/spwd20.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to '.emacs.d/site-lisp') diff --git a/.emacs.d/site-lisp/spwd20.el b/.emacs.d/site-lisp/spwd20.el index fafae8b1..4494d614 100644 --- a/.emacs.d/site-lisp/spwd20.el +++ b/.emacs.d/site-lisp/spwd20.el @@ -63,6 +63,7 @@ (define-key map (kbd "S-") 'spwd20-initiative-add) (define-key map (kbd "") 'spwd20-damage) (define-key map (kbd "") 'spwd20-roll) + (define-key map (kbd "S-") 'spwd20-roll-last) (define-key map (kbd "") 'spwd20-d20) map) "Keymap for `spwd20-mode'.") @@ -215,9 +216,16 @@ the best N of them, e.g., 4d6k3." Accepts roll20's extension for rolling multiple dice and keeping the best N of them, e.g., 4d6k3." (interactive "sRoll: ") + (setq spwd20-roll--last exp) (message "%s = %s" exp (int-to-string (spwd20--roll exp))) (play-sound-file spwd20-dice-sound)) +(defun spwd20-roll-last () + (interactive) + (if (boundp 'spwd20-roll--last) + (spwd20-roll spwd20-roll--last) + (call-interactively 'spwd20-roll))) + (defun spwd20-d20 () "Roll two d20, showing result with advantage and disadvantage, and with neither." (interactive) -- cgit v1.2.3