Dice calc: yellow base + black stress dice (Alien RPG rules)
Base dice (yellow) = attribute + skill Stress dice (black) = current stress level, added on top Menu shows: "Close Combat 5 zlute + 2 cerne = 7 celkem" Buffer shows breakdown after selection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
20
alien-rpg.el
20
alien-rpg.el
@@ -1238,25 +1238,23 @@ Průlezy G<->H: G3<->H3, G4<->H4, G7<->H7, G8<->H8, G9<->H9
|
|||||||
(name (cdr (assq key alien-rpg-skill-names)))
|
(name (cdr (assq key alien-rpg-skill-names)))
|
||||||
(attr-val (plist-get (plist-get alien-rpg-character :attributes) attr-key))
|
(attr-val (plist-get (plist-get alien-rpg-character :attributes) attr-key))
|
||||||
(skill-val (plist-get (plist-get alien-rpg-character :skills) key))
|
(skill-val (plist-get (plist-get alien-rpg-character :skills) key))
|
||||||
(total (+ attr-val skill-val))
|
(base (+ attr-val skill-val))
|
||||||
(effective (max 0 (- total stress)))
|
|
||||||
(attr-abbr (cdr (assq attr-key alien-rpg-attr-abbrevs))))
|
(attr-abbr (cdr (assq attr-key alien-rpg-attr-abbrevs))))
|
||||||
(cons (format "%-18s %d kostek (%s %d + %d - stress %d)"
|
(cons (format "%-18s %d zlute + %d cerne = %d celkem"
|
||||||
name effective attr-abbr attr-val skill-val stress)
|
name base stress (+ base stress))
|
||||||
(list name total effective attr-abbr attr-val skill-val))))
|
(list name base attr-abbr attr-val skill-val))))
|
||||||
alien-rpg-skill-attributes))
|
alien-rpg-skill-attributes))
|
||||||
(choice (completing-read "Hod na: " choices nil t))
|
(choice (completing-read "Hod na: " choices nil t))
|
||||||
(data (cdr (assoc choice choices)))
|
(data (cdr (assoc choice choices)))
|
||||||
(name (nth 0 data))
|
(name (nth 0 data))
|
||||||
(total (nth 1 data))
|
(base (nth 1 data)))
|
||||||
(effective (nth 2 data)))
|
|
||||||
(with-current-buffer (get-buffer-create "*Alien RPG*")
|
(with-current-buffer (get-buffer-create "*Alien RPG*")
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(insert (format "%s: %d kostek\n" name effective))
|
(insert (format "%s\n" name))
|
||||||
(insert (format "Základ: %d (atribut + dovednost)\n" total))
|
(insert (format "%d zlutych kostek (zaklad)\n" base))
|
||||||
(insert (format "Stress: -%d\n" stress))
|
(insert (format "%d cernych kostek (stress)\n" stress))
|
||||||
(insert (format "Výsledek: %d kostek k hodu\n" effective)))
|
(insert (format "%d kostek celkem\n" (+ base stress))))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(special-mode))
|
(special-mode))
|
||||||
(switch-to-buffer "*Alien RPG*")))
|
(switch-to-buffer "*Alien RPG*")))
|
||||||
|
|||||||
Reference in New Issue
Block a user