Skip to content
Snippets Groups Projects
arms.sty 4.60 KiB
\ProvidesPackage{config/arms}
%%%%% Weapons
%
% Weapon entries do two things.
% When used in creatures, they raise stats.
% When used in the  weapons chart, they display stats.
%
% Use this 'weapon entry' command to place items in the weapons table, like this:
%\weapon[optional arguments]{Name}%
%{Bonus}
%{Dam}
%
% The AP cost ('heft') = ( Att + Dam ) / 2
% The Weight Rating = ( Att + Dam ) - 3

\newcounter{weaponBonus}

\newcommand\weapon[4][]{%
  \setcounter{weaponBonus}{#3}%
  \setcounter{damage}{#4}%
  \setcounter{heft}{#4}%
  \setcounter{weight}{#4}%
  \ifnum#3>-1% If the weapon's attack bonus is positive,
    \addtocounter{heft}{#3}% add it to the AP cost and 
    \addtocounter{weight}{#3}% weight rating,
  \roundUp{heft}% then the AP cost by 2.
  \addtocounter{weight}{-2}% And reduce the weight by 3.
  \fi%
  \ignorespaces #1%
  \iftoggle{creatureBox}{%
    \addtocounter{att}{\value{weaponBonus}}%
    #2%
  }{%
    #2 &%
    \ifnum\value{weaponBonus}>0 +\fi%
    \arabic{weaponBonus} &%
    \ifnum\value{damage}>0 +\fi\arabic{damage}%
    & \arabic{heft} &%
    \arabic{weight}%
  }%
}

% Shields work much like weapons, except that their Bonus is high, their initiative cost is low, but their attack is poor.

\newcommand\shield[3][]{
  \setcounter{shieldBonus}{#3}
  \addtocounter{shieldBonus}{2}
  \setcounter{shieldWeight}{#3}
  \setcounter{shieldInit}{#3}
  \stepcounter{shieldInit}
  \setcounter{cost}{87}
  #1 
  \iftoggle{creatureBox}%
    {#2 shield (+\arabic{shieldBonus}/ \arabic{shieldInit})}{
      #2 Shield &
      +\arabic{shieldBonus} &
      \arabic{shieldInit} &
      \arabic{shieldWeight}
    }%
}

\newcommand{\boulder}{\weapon[\addtocounter{weight}{3}]{Boulder}{-3}{5}}
\newcommand{\chair}{\weapon{Chair}{2}{1}}
\newcommand{\club}{\weapon[\addtocounter{damage}{-1}]{Club}{1}{1}}
\newcommand{\cudgel}{\weapon[\addtocounter{damage}{-1}]{Cudgel}{0}{0}}
\newcommand{\Dagger}{\weapon{Dagger}{0}{2}}
\newcommand{\firepoker}{\weapon{Firepoker}{1}{0}}
\newcommand{\giantsword}{\weapon{Giant Sword}{4}{3}}
\newcommand{\greataxe}{\weapon{Great Axe}{2}{3}}
\newcommand{\greatsword}{\weapon{Greatsword}{2}{3}}
\newcommand{\greatclub}{\weapon[\addtocounter{damage}{-1}]{Great Club}{3}{4}}
\newcommand{\javelin}{\weapon{Javelin}{2}{1}}
\newcommand{\knife}{\weapon{Knife}{0}{1}}
\newcommand{\Log}{\weapon[\addtocounter{damage}{-3}]{Log}{1}{0}}
\newcommand{\rapier}{\weapon{Rapier}{1}{1}}
\newcommand{\largerock}{\weapon[\addtocounter{weight}{3}]{Rock (large)}{-1}{2}}
\newcommand{\longsword}{\weapon{Longsword}{2}{2}}
\newcommand{\maul}{\weapon{Maul}{1}{3}}
\newcommand{\poleaxe}{\weapon{Poleaxe}{4}{2}}
\newcommand{\quarterstaff}{\weapon{Quarterstaff}{3}{0}}
\newcommand{\rock}{\weapon[\addtocounter{heft}{1}]{Rock}{-1}{0}}
\newcommand{\shortsword}{\weapon{Shortsword}{1}{1}}
\newcommand{\skillet}{\weapon[\addtocounter{heft}{1}]{Frying Pan}{1}{2}}
\newcommand{\spear}{\weapon{Spear}{3}{1}}
\newcommand{\glaive}{\weapon{Glaive}{3}{2}}
\newcommand{\stick}{\weapon{Stick}{1}{0}}
\newcommand{\whip}{\weapon[\addtocounter{damage}{-1}\addtocounter{heft}{1}]{Whip}{2}{0}}
\newcommand{\warhammer}{\weapon{Warhammer}{1}{4}}
\newcommand{\woodaxe}{\weapon[\addtocounter{heft}{1}]{Wood Axe}{1}{2}}

% SHIELDS
\newcommand{\longbow}{Longbow}
\newcommand{\bucklar}{\shield{Bucklar}{0}}
\newcommand{\roundshield}{\shield{Round}{1}}
\newcommand{\kiteshield}{\shield{Kite}{2}}

% ARMOUR

%% For perfect armour, stick \perfect Armour in the additional notes category of a \person (#9).

\newcommand{\perfectArmour}{\gdef\armourtype{(Perfect)}}

\newcommand{\partialelvish}{partial leather armour%
	\ifnumcomp{\value{dr}}{>}{2}%
	{\addtocounter{dr}{1}}%
	{\divide\value{dr} by 2 \addtocounter{dr}{2}}%
}

\newcommand{\partialleather}{partial leather armour%
	\ifnumcomp{\value{dr}}{>}{3}%
	{\addtocounter{dr}{2}}%
	{\divide\value{dr} by 2 \addtocounter{dr}{3}}%
}

\newcommand{\completeleather}{full leather armour\gdef\armourtype{C}%
	\ifnumcomp{\value{dr}}{>}{3}%
	{\addtocounter{dr}{2}}%
	{\divide\value{dr} by 2 \addtocounter{dr}{3}}%
}

\newcommand{\partialchain}{partial chainmail%
	\ifnumcomp{\value{dr}}{>}{4}%
	{\addtocounter{dr}{2}}%
	{\divide\value{dr} by 2 \addtocounter{dr}{4}}%
}

\newcommand{\completechain}{complete chain armour\gdef\armourtype{C}%
	\ifnumcomp{\value{dr}}{>}{4}%
	{\addtocounter{dr}{2}}%
	{\divide\value{dr} by 2 \addtocounter{dr}{4}}%
}

\newcommand{\partialplate}{partial plate armour%
	\ifnumcomp{\value{dr}}{>}{5}%
	{\addtocounter{dr}{3}}%
	{\divide\value{dr} by 2 \addtocounter{dr}{5}}%
}

\newcommand{\completeplate}{complete plate armour\gdef\armourtype{C}%
	\ifnumcomp{\value{dr}}{>}{5}%
	{\addtocounter{dr}{3}}%
	{\divide\value{dr} by 2 \addtocounter{dr}{5}}%
}