From 63acb6c96b8d32ff5b1f33b5bc66ff3232a0fc98 Mon Sep 17 00:00:00 2001 From: Malin Freeborn <malinfreeborn@posteo.net> Date: Wed, 11 Oct 2023 09:28:52 +0200 Subject: [PATCH] add \rollDice macro --- layout.sty | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/layout.sty b/layout.sty index 505a3018..10fa3d13 100644 --- a/layout.sty +++ b/layout.sty @@ -15,7 +15,7 @@ \RequirePackage{gfsartemisia-euler} % fancy fonts \RequirePackage{epsdice} % for dice -\RequirePackage[T1]{fontenc} % +%\RequirePackage[T1]{fontenc} % \RequirePackage{starfont} % for creature symbols \RequirePackage{wasysym} % for sq checkboxes \RequirePackage{appendix} @@ -357,6 +357,19 @@ bookmarks=true]% \fi% } +\newcounter{diceNo2} +\newcommand\rollDice[1]{% + \setcounter{track}{#1}% + \setcounter{diceNo}{1}% + \setcounter{diceNo2}{1}% + \ifnum\value{track}>7% + \setcounter{diceNo2}{6}% + \fi% + \addtocounter{track}{-\value{diceNo2}}% + \setcounter{diceNo}{\value{track}}% + \epsdice[black]{\arabic{diceNo}} \epsdice{\arabic{diceNo2}} + } + \newcounter{dlist} \newenvironment{dlist}% {\begin{list}{\Large\dicef{\value{dlist}}}{\usecounter{dlist}}}% -- GitLab