diff --git a/backpage.tex b/backpage.tex index 970ed604977f991460cbbb30fa67aff0df7520ac..e1e2a97c7a97dec65d190532dd56f11aef2cdd5e 100644 --- a/backpage.tex +++ b/backpage.tex @@ -10,8 +10,11 @@ \begin{tabularx}{\linewidth}{Xr} \hiderowcolors + \randomize% + \setcounter{diceNo2}{\value{rn4tn1}}% + \addtocounter{diceNo2}{5}% \textbf{Birthday:} - \showSeason[\value{diceNo2}]~\arabic{r12} + \showCycle[\value{diceNo2}]~\arabic{r12} \par \Huge \Glsfmtplural{storypoint}~\Repeat{5}{\Square} & diff --git a/seasons.sty b/seasons.sty index b702e968a58f1b104b0939b9b1ad7c7bd5dc1753..e368da31ade27f6471c3f5d75c19c858a1fe65f9 100644 --- a/seasons.sty +++ b/seasons.sty @@ -1,16 +1,62 @@ \newcounter{season} \setcounter{season}{\month} - \setcounter{season}{\month} \newcounter{temperature} \newcommand\season{} \newcounter{cycle} -\setcounter{cycle}{\year} -\multiply\value{cycle} by 3 -\addtocounter{cycle}{0} +\setcounter{cycle}{\month} + \roundUp{cycle} -%%% State a Season's name. +\newcommand\cycleDesc{} + +\newcommand\setCycle[2]{% + \setcounter{cycle}{#1}% Month + \ifnum\value{cycle}>6% + \addtocounter{cycle}{-6}% + \fi% + \ifnum\value{cycle}>3% + \addtocounter{cycle}{-3}% + \fi% + \addtocounter{cycle}{-1}% + \multiply\value{cycle} by 30% + \addtocounter{cycle}{#2}% Day + \divide\value{cycle} by 14% + \addtocounter{cycle}{0}% +} + +%%% State a Cycle's name. + +\newcommand\showCycle[1][\value{cycle}]{% + \ifcase#1% + \glsentrytext{cOne}% + \setTemperature% + \renewcommand\cycleDesc{\glsentrydesc{cOne}}% + \or% + \glsentrytext{cTwo}% + \setTemperature% + \renewcommand\cycleDesc{\glsentrydesc{cTwo}}% + \or% + \glsentrytext{cThree}% + \setTemperature% + \renewcommand\cycleDesc{\glsentrydesc{cThree}}% + \or% + \glsentrytext{cFour}% + \setTemperature% + \renewcommand\cycleDesc{\glsentrydesc{cFour}}% + \or% + \glsentrytext{cFive}% + \setTemperature% + \renewcommand\cycleDesc{\glsentrydesc{cFive}}% + \else + \glsentrytext{cSix}% + \setTemperature% + \renewcommand\cycleDesc{\glsentrydesc{cSix}}% + \fi% +} + + +%%% Remove %%% \newcommand\showSeason[1][\value{season}]{% \ifcase#1\or% @@ -60,20 +106,10 @@ \fi% } -\newcommand\showTemperature{% - \ifcase\value{temperature}% - cold% - \or% - mild% - \else% - hot% - \fi% -} +%%% \newcommand\setTemperature{ - \ifcase\value{season}\or% - \setcounter{temperature}{1}% - \or% + \ifcase\value{cycle}% \setcounter{temperature}{1}% \or% \setcounter{temperature}{0}% @@ -82,25 +118,24 @@ \or% \setcounter{temperature}{2}% \or% - \setcounter{temperature}{1}% - \or% - \setcounter{temperature}{1}% - \or% - \setcounter{temperature}{1}% - \or% + \setcounter{temperature}{3}% + \else \setcounter{temperature}{2}% + \fi% +} + +\newcommand\showTemperature{% + \ifcase\value{temperature}% + cold% \or% - \setcounter{temperature}{1}% + mild% \or% - \setcounter{temperature}{0}% - \else - \setcounter{temperature}{1}% + hot% + \else% + scorching% \fi% - } -\setTemperature - \newcommand\showInterval[1]{% \ifcase#1% \gls{morning}% diff --git a/test.tex b/test.tex index 1592e695ab5b056dcc4def1ecbadc6d00cce7a6a..ba9177ce3b9d233ef346f6d901b7837a361d47e4 100644 --- a/test.tex +++ b/test.tex @@ -22,7 +22,7 @@ Words are needed after each subsection to avoid the boxes making problems. This is a test document, to make sure new code works before sticking it in a project. Current day should equal \arabic{r4b}. -That means the season in Fenestra is \showSeason, which means it's \showTemperature. +That means the season in Fenestra is \showCycle, which means it's \showTemperature. \Person{\npc{\M\Hu}{Random Guy}}% {{1}{1}{0}}% BODY