Skip to content
Snippets Groups Projects
market.sty 1.94 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%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
        \addtocounter{track}{\value{rn3t3}}%
    
        \ifnum\value{track}<14%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
          \addtocounter{track}{\value{r3b}}%
          \addtocounter{track}{\value{rn1t2}}%
    
        \else%
          \ifnum\value{track}<34%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
            \addtocounter{track}{\value{r4t6}}%
    
          \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%
    
      \ifnumcomp{\value{r12}}{>}{#1}{\marketItem{#2}{#3}{#4}}{}%
    
    }
    
    \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%
    
    %%%%% Seller Names
    % 
    % By default, each guild hall curator receives a random name, composed
    % with the standard '\composeHumanName' command.  However, individual
    % modules might change these names to showcase local NPCs.
    
    \newcommand\marketWeaver{\composeHumanName}
    \newcommand\marketDoula{\composeHumanName}
    \newcommand\marketBeastSeller{\composeHumanName}
    \newcommand\marketBoatman{\composeHumanName}
    \newcommand\marketBard{\composeHumanName}
    \newcommand\marketFence{\composeHumanName}
    \newcommand\marketInnOne{\composeHumanName's Inn}
    \newcommand\marketInnTwo{\composeHumanName's Inn}
    \newcommand\marketTavernOne{\composeHumanName's Tavern}
    \newcommand\marketTavernTwo{\composeHumanName's Tavern}
    \newcommand\marketMixer{\composeHumanName}
    \newcommand\marketWeaponsSeller{\composeHumanName}
    \newcommand\marketArmourSeller{\composeHumanName}
    \newcommand\marketTanner{\composeHumanName}