udpate to dnd

This commit is contained in:
Chris Cochrun 2024-08-28 15:27:23 -05:00
parent eb80e825e2
commit 347619eae6
2 changed files with 32 additions and 4 deletions

View file

@ -5461,6 +5461,13 @@ Using emacs to run rpg things
(add-to-list 'load-path "/home/chris/dev/emacs-rpgdm/") (add-to-list 'load-path "/home/chris/dev/emacs-rpgdm/")
(use-package rpgdm (use-package rpgdm
:config :config
(defun chris/dnd-get-table (table range)
"Get a list of the contents of any `table' and use `range' to get the info"
(with-current-buffer
(find-file-noselect "~/docs/notes/20240804T132141--dungeons-and-dragons__area_fun_personal.org")
(org-table-get-remote-range table range)))
(defun chris/dnd-skill-check (&optional skill) (defun chris/dnd-skill-check (&optional skill)
"Roll for a skill check using skill or prompting for one." "Roll for a skill check using skill or prompting for one."
(interactive) (interactive)
@ -5481,7 +5488,12 @@ Using emacs to run rpg things
skill skills skill skills
:test 'string=)) :test 'string=))
skills)))) skills))))
(message value))) (rpgdm-roll (concat "1d20" value))))
(defun chris/dnd-spell-attack-check ()
"roll for a spell attack"
(interactive)
(rpgdm-roll "1d20+9"))
:general :general
(chris/leader-keys (chris/leader-keys
@ -5489,7 +5501,9 @@ Using emacs to run rpg things
:keymaps 'override :keymaps 'override
"a" '(:ignore t :which-key "RPGDM") "a" '(:ignore t :which-key "RPGDM")
"ar" '(rpgdm-roll :which-key "roll") "ar" '(rpgdm-roll :which-key "roll")
"aa" '(hydra-rpgdm/body :which-key "hydra"))) "aa" '(hydra-rpgdm/body :which-key "hydra")
"as" '(chris/dnd-skill-check :which-key "check skill")
"ap" '(chris/dnd-spell-attack-check :which-key "Spell attack")))
#+end_src #+end_src
** Performance ** Performance

18
init.el
View file

@ -4020,6 +4020,13 @@ interfere with the default `bongo-playlist-buffer'."
(add-to-list 'load-path "/home/chris/dev/emacs-rpgdm/") (add-to-list 'load-path "/home/chris/dev/emacs-rpgdm/")
(use-package rpgdm (use-package rpgdm
:config :config
(defun chris/dnd-get-table (table range)
"Get a list of the contents of any `table' and use `range' to get the info"
(with-current-buffer
(find-file-noselect "~/docs/notes/20240804T132141--dungeons-and-dragons__area_fun_personal.org")
(org-table-get-remote-range table range)))
(defun chris/dnd-skill-check (&optional skill) (defun chris/dnd-skill-check (&optional skill)
"Roll for a skill check using skill or prompting for one." "Roll for a skill check using skill or prompting for one."
(interactive) (interactive)
@ -4040,7 +4047,12 @@ interfere with the default `bongo-playlist-buffer'."
skill skills skill skills
:test 'string=)) :test 'string=))
skills)))) skills))))
(message value))) (rpgdm-roll (concat "1d20" value))))
(defun chris/dnd-spell-attack-check ()
"roll for a spell attack"
(interactive)
(rpgdm-roll "1d20+9"))
:general :general
(chris/leader-keys (chris/leader-keys
@ -4048,7 +4060,9 @@ interfere with the default `bongo-playlist-buffer'."
:keymaps 'override :keymaps 'override
"a" '(:ignore t :which-key "RPGDM") "a" '(:ignore t :which-key "RPGDM")
"ar" '(rpgdm-roll :which-key "roll") "ar" '(rpgdm-roll :which-key "roll")
"aa" '(hydra-rpgdm/body :which-key "hydra"))) "aa" '(hydra-rpgdm/body :which-key "hydra")
"as" '(chris/dnd-skill-check :which-key "check skill")
"ap" '(chris/dnd-spell-attack-check :which-key "Spell attack")))
;; Reduce rendering/line scan work for Emacs by not rendering cursors or regions ;; Reduce rendering/line scan work for Emacs by not rendering cursors or regions
;; in non-focused windows. ;; in non-focused windows.