Skip to content
Snippets Groups Projects
market.sty 1.02 KiB
Newer Older
  • Learn to ignore specific revisions
  • \newcommand\mkPrice[2][sp]{%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \randomize%
    
      \setcounter{track}{#2}%
    
      \ifnum\value{track}<7%
        \ifnum\value{temperature}=0%
          \addtocounter{track}{3}
        \fi%
    
      \else%
        \addtocounter{track}{\value{r2}}%
        \ifnum\value{track}<14%
          \addtocounter{track}{\value{r3c}}%
        \else%
          \ifnum\value{track}<34%
            \addtocounter{track}{\value{r4}}%
          \else%
            \addtocounter{track}{\value{r12}}%
          \fi%
        \fi%
      \fi%
      \ifnum0<\value{track}%
        \arabic{track}~\glspl{#1}%
      \else%
        \textit{free}!
      \fi%
    }
    
    \newcommand\marketItem[4][sp]{
    
      \randomize%
    
      #2 &% Name
      #3 &% Weight
      \mkPrice[#1]{#4} % Price
      \\
    }
    
    \newcommand\rareMarketItem[4][9]{%
    
      \randomize%
    
      \ifnum\value{r12}>#1%
        \marketItem{#2}{#3}{#4}%
      \fi%
    }
    
    \newcommand\showArmourPrice[2]{%
    
      #1\expandafter\MakeUppercase\armourName & \arabic{armourDR} & \arabic{covering} & \arabic{armourWeight} & \mkPrice{#2} \\%
    
    \newcommand\rareArmour[3][9]{%
      \ifnumcomp{\value{r12}}{>}{#1}{ \showArmour{#2} & \mkPrice{#3} \\ }{}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \randomize%