% File: rpgicons-pgf.sty
% Copyright 2024-2026 Jasper Habicht (mail(at)jasperhabicht.de).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.
%
% This file is part of the `rpgicons'  package (The Work in LPPL)
% and all files in that bundle must be distributed together.
%
% This work has the LPPL maintenance status `maintained'.
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{rpgicons-pgf}[2026-04-30 RPG Icons Package (PGF Variant) (2.9.0)]

% provide pics option
\newif\ifrpgicons@pics\rpgicons@picsfalse
\DeclareOption{pics}{\rpgicons@picstrue}
\ProcessOptions\relax

\RequirePackage{tikz}
\newlength{\rpgicons@beforesep}
\newlength{\rpgicons@aftersep}
\newlength{\rpgicons@baseline}

\def\rpgicons@allshapes{%
  twoside, fourside, sixside, eightside, tenside, twelveside, twentyside, hundredside,
  d2, d4, d6, d8, d10, d12, d20, d100,
  fudge, sixside one, sixside two, sixside three, sixside four, sixside five,
  sixside six, sixside seven, sixside eight, sixside nine, fudge plus, fudge minus,
  strength, dexterity, dexterity i, constitution, intelligence, wisdom, wisdom i, charisma,
  resilience, sanity, perception, luck, armour, armor, proficiency,
  linear, conic, quadratic, cubic, spheric, cylindric, emanation,
  verbal, somatic, material, ritual, focus,
  abjuration, conjuration, divination, enchantment, evocation, illusion, necromancy, transmutation,
  acid, bludgeoning, cold, fire, force, lightning, necrotic, necrotic i, piercing, poison,
  psychic, radiant, slashing, thunder, healing,
  melee, melee i, ranged, magic, singlehanded, doublehanded,
  buff, blinded, charmed, deafened, exhausted, frightened, grappled, incapacitated, invisible,
  paralyzed, petrified, poisoned, prone, restrained, restrained i, stunned, unconscious,
  hearing, seeing,
  artificer, artificer i, barbarian, bard, bard i, cleric, cleric i, cleric ii,
  druid, druid i, druid ii, fighter, gunslinger, monk, monk i, paladin, paladin i,
  psion, psion i, ranger, ranger i, rogue, rogue i, sorcerer, sorcerer i, warlock,
  wizard, wizard i,
  lawful good, neutral good, chaotic good, lawful neutral, true neutral,
  chaotic neutral, lawful evil, neutral evil, chaotic evil,
  copper, silver, gold, electrum, platinum, gem, jewellery, jewelry, jewellery i, jewelry i,
  upward, downward, leftward, rightward, forward, backward,
  % === backward compatibility
  dexterity alt, wisdom alt, necrotic alt, melee alt, restrained alt,
  artificer alt, bard alt, cleric alt, druid alt, monk alt, paladin alt,
  psion alt, ranger alt, rogue alt, sorcerer alt, wizard alt,
  jewellery alt, jewelry alt%
  % ===
}

\tikzset{
  rpg icons/background/.code={
    \colorlet{rpgicons@bg}{#1}
  },
  rpg icons/background={white},
  rpg icons/before sep/.code={
    \setlength{\rpgicons@beforesep}{#1}
  },
  rpg icons/before sep={.05em},
  rpg icons/after sep/.code={
    \setlength{\rpgicons@aftersep}{#1}
  },
  rpg icons/after sep={.05em},
  rpg icons/baseline/.code={
    \setlength{\rpgicons@baseline}{#1}
  },
  rpg icons/baseline={-3.5pt},
  rpg icons/variant/.code={
    \pgfmathtruncatemacro{\rpgicons@variant}{#1}
  },
  rpg icons/variant/.default={1},
  rpg icons/variant={0},
  rpg icons/.style={},
  rpg icons/.append style={
    every node/.style={
      line cap=round,
      line join=round
    }
  },
  %
  rpg icons/every die/.style={},
  rpg icons/every ability/.style={},
  rpg icons/every saving/.style={},
  rpg icons/every spell/.style={},
  rpg icons/every spellschool/.style={},
  rpg icons/every damage/.style={},
  rpg icons/every attack/.style={},
  rpg icons/every condition/.style={},
  rpg icons/every class/.style={},
  rpg icons/every alignment/.style={},
  rpg icons/every currency/.style={},
  rpg icons/every movement/.style={},
  %
  rpg icons/create every style/.code={
    \tikzset{
      rpg icons/every #1/.style={}
    }
  },
  rpg icons/create every style/.list/.expanded={%
    \rpgicons@allshapes%
  }
}

% === backward compatiliy
\tikzset{
  dexterity alt/.style={dexterity i},
  wisdom alt/.style={wisdom i},
  necrotic alt/.style={necrotic i},
  melee alt/.style={melee i},
  restrained alt/.style={restrained i},
  artificer alt/.style={artificer i},
  bard alt/.style={bard i},
  cleric alt/.style={cleric i},
  druid alt/.style={druid i},
  monk alt/.style={monk i},
  paladin alt/.style={paladin i},
  psion alt/.style={psion i},
  ranger alt/.style={ranger i},
  rogue alt/.style={rogue i},
  sorcerer alt/.style={sorcerer i},
  wizard alt/.style={wizard i},
  jewellery alt/.style={jewellery i},
  jewelry alt/.style={jewelry i},
  rpg icons/background color/.forward to={/tikz/rpg icons/background}
}
% ===

\def\rpgicons@shape@variant#1{%
  \pgfutil@ifundefined{pgf@sh@s@#1 \romannumeral\rpgicons@variant}{%
    #1%
  }{%
    #1 \romannumeral\rpgicons@variant%
  }%
}

% temporary fix to allow for tagging
\pgfkeysifassignable{/tikz/actualtext}{}{
  \pgfkeysdef{/tikz/actualtext}{}
}

% make tikz icons usable inside tikz environments
\NewDocumentCommand{\provideprotectedrpgicon}{ m o m O{} m }{%
  \expandafter\newsavebox\csname rpgicons@protectbox@#5\endcsname%
  \expandafter\savebox\csname rpgicons@protectbox@#5\endcsname{%
    \IfValueTF{#2}{%
      \csname #1\endcsname[#2]{#3}[#4]{}%
    }{%
      \csname #1\endcsname{#3}[#4]{}%
    }%
  }%
}

\NewDocumentCommand{\useprotectedrpgicon}{ m }{%
  \expandafter\usebox\csname rpgicons@protectbox@#1\endcsname%
}

% DICE

% disc
\pgfdeclareshape{twoside}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0cm}{.25cm}}{\pgfpoint{.425cm}{0cm}}
  }
}

\pgfdeclareshape{d2}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={twoside}]
}

% code for shapes of d4, d6, d8, d10, d12 and d20
% based on the idea of John Kormylo:
% https://tex.stackexchange.com/a/144474/47927

% tetrahedron
\pgfdeclareshape{fourside}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.35cm}}
    \pgfpathlineto{\pgfpoint{.433cm}{-.4cm}}
    \pgfpathlineto{\pgfpoint{-.433cm}{-.4cm}}
    \pgfpathclose
  }
}

\pgfdeclareshape{d4}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={fourside}]
}

% cube
\pgfdeclareshape{sixside}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

\pgfdeclareshape{d6}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={sixside}]
}

% octahedron
\pgfdeclareshape{eightside}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.5cm}}
    \pgfpathlineto{\pgfpoint{.433cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{.433cm}{-.25cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.5cm}}
    \pgfpathlineto{\pgfpoint{-.433cm}{-.25cm}}
    \pgfpathlineto{\pgfpoint{-.433cm}{.25cm}}
    \pgfpathclose
    \pgfpathlineto{\pgfpoint{.433cm}{-.25cm}}
    \pgfpathlineto{\pgfpoint{-.433cm}{-.25cm}}
    \pgfpathclose
  }
}

\pgfdeclareshape{d8}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={eightside}]
}

% decahedron
\pgfdeclareshape{tenside}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.5cm}}
    \pgfpathlineto{\pgfpoint{.475cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.475cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.5cm}}
    \pgfpathlineto{\pgfpoint{-.475cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{-.475cm}{.1cm}}
    \pgfpathclose
    \pgfpathlineto{\pgfpoint{.294cm}{-.154cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.3cm}}
    \pgfpathlineto{\pgfpoint{-.294cm}{-.154cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.294cm}{-.154cm}}
    \pgfpathlineto{\pgfpoint{.475cm}{-.1cm}}
    \pgfpathmoveto{\pgfpoint{-.475cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{-.294cm}{-.154cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{-.5cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.3cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\pgfdeclareshape{d10}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={tenside}]
}

% dodecahedron
\pgfdeclareshape{twelveside}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.5cm}}
    \pgfpathlineto{\pgfpoint{0.294cm}{.405cm}}
    \pgfpathlineto{\pgfpoint{.475cm}{.173cm}}
    \pgfpathlineto{\pgfpoint{.475cm}{-.173cm}}
    \pgfpathlineto{\pgfpoint{.294cm}{-.405cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.5cm}}
    \pgfpathlineto{\pgfpoint{-.294cm}{-.405cm}}
    \pgfpathlineto{\pgfpoint{-.475cm}{-.173cm}}
    \pgfpathlineto{\pgfpoint{-.475cm}{.173cm}}
    \pgfpathlineto{\pgfpoint{-.294cm}{.405cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{0cm}{.349cm}}
    \pgfpathlineto{\pgfpoint{.332cm}{.108cm}}
    \pgfpathlineto{\pgfpoint{.205cm}{-.282cm}}
    \pgfpathlineto{\pgfpoint{-.205cm}{-.282cm}}
    \pgfpathlineto{\pgfpoint{-.332cm}{.108cm}}
    \pgfpathclose
    \pgfpathlineto{\pgfpoint{0cm}{.5cm}}
    \pgfpathmoveto{\pgfpoint{.475cm}{.173cm}}
    \pgfpathlineto{\pgfpoint{.332cm}{.108cm}}
    \pgfpathmoveto{\pgfpoint{.294cm}{-.405cm}}
    \pgfpathlineto{\pgfpoint{.205cm}{-.282cm}}
    \pgfpathmoveto{\pgfpoint{-.294cm}{-.405cm}}
    \pgfpathlineto{\pgfpoint{-.205cm}{-.282cm}}
    \pgfpathmoveto{\pgfpoint{-.475cm}{.173cm}}
    \pgfpathlineto{\pgfpoint{-.332cm}{.108cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\pgfdeclareshape{d12}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={twelveside}]
}

% icosahedron
\pgfdeclareshape{twentyside}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.5cm}}
    \pgfpathlineto{\pgfpoint{.454cm}{.262cm}}
    \pgfpathlineto{\pgfpoint{.454cm}{-.262cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.5cm}}
    \pgfpathlineto{\pgfpoint{-.454cm}{-.262cm}}
    \pgfpathlineto{\pgfpoint{-.454cm}{.262cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{0cm}{.292cm}}
    \pgfpathlineto{\pgfpoint{.253cm}{-.146cm}}
    \pgfpathlineto{\pgfpoint{-.253cm}{-.146cm}}
    \pgfpathclose
    \pgfpathlineto{\pgfpoint{.454cm}{.262cm}}
    \pgfpathlineto{\pgfpoint{.253cm}{-.146cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.5cm}}
    \pgfpathlineto{\pgfpoint{-.253cm}{-.146cm}}
    \pgfpathlineto{\pgfpoint{-.454cm}{.262cm}}
    \pgfpathclose
    \pgfpathlineto{\pgfpoint{0cm}{.5cm}}
    \pgfpathmoveto{\pgfpoint{.454cm}{-.262cm}}
    \pgfpathlineto{\pgfpoint{.253cm}{-.146cm}}
    \pgfpathmoveto{\pgfpoint{-.454cm}{-.262cm}}
    \pgfpathlineto{\pgfpoint{-.253cm}{-.146cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\pgfdeclareshape{d20}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={twentyside}]
}

% sphere
\pgfdeclareshape{hundredside}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpointorigin}{.425cm}
    \pgfpathmoveto{\pgfpoint{.425cm}{0cm}}
    \pgfpatharc{180}{50}{-.425cm and -.2cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.425cm}}
    \pgfpatharc{270}{140}{-.2cm and .425cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\pgfdeclareshape{d100}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={hundredside}]
}

% cube (one)
\pgfdeclareshape{sixside one}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \foreach \x/\y in {
      0cm/0cm
    } {
      \pgfpathcircle{\pgfpoint{\x}{\y}}{2pt}
    }
    \pgfusepath{fill}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (two)
\pgfdeclareshape{sixside two}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \foreach \x/\y in {
      .2cm/-.2cm, -.2cm/.2cm
    } {
      \pgfpathcircle{\pgfpoint{\x}{\y}}{2pt}
    }
    \pgfusepath{fill}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (three)
\pgfdeclareshape{sixside three}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \foreach \x/\y in {
      .2cm/-.2cm, 0cm/0cm, -.2cm/.2cm
    } {
      \pgfpathcircle{\pgfpoint{\x}{\y}}{2pt}
    }
    \pgfusepath{fill}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (four)
\pgfdeclareshape{sixside four}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \foreach \x/\y in {
      -.2cm/.2cm, .2cm/.2cm,
      -.2cm/-.2cm, .2cm/-.2cm
    } {
      \pgfpathcircle{\pgfpoint{\x}{\y}}{2pt}
    }
    \pgfusepath{fill}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (five)
\pgfdeclareshape{sixside five}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \foreach \x/\y in {
      -.2cm/.2cm, .2cm/.2cm,
      0cm/0cm,
      -.2cm/-.2cm, .2cm/-.2cm
    } {
      \pgfpathcircle{\pgfpoint{\x}{\y}}{2pt}
    }
    \pgfusepath{fill}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (six)
\pgfdeclareshape{sixside six}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \foreach \x/\y in {
      -.2cm/.2cm, .2cm/.2cm,
      -.2cm/0cm, .2cm/0cm,
      -.2cm/-.2cm, .2cm/-.2cm
    } {
      \pgfpathcircle{\pgfpoint{\x}{\y}}{2pt}
    }
    \pgfusepath{fill}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (seven)
\pgfdeclareshape{sixside seven}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \foreach \x/\y in {
      -.2cm/.2cm, .2cm/.2cm,
      -.2cm/0cm, 0cm/0cm, .2cm/0cm,
      -.2cm/-.2cm, .2cm/-.2cm
    } {
      \pgfpathcircle{\pgfpoint{\x}{\y}}{2pt}
    }
    \pgfusepath{fill}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (eight)
\pgfdeclareshape{sixside eight}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \foreach \x/\y in {
      -.2cm/.2cm, 0cm/.2cm, .2cm/.2cm,
      -.2cm/0cm, .2cm/0cm,
      -.2cm/-.2cm, 0cm/-.2cm, .2cm/-.2cm
    } {
      \pgfpathcircle{\pgfpoint{\x}{\y}}{2pt}
    }
    \pgfusepath{fill}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (nine)
\pgfdeclareshape{sixside nine}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \foreach \x/\y in {
      -.2cm/.2cm, 0cm/.2cm, .2cm/.2cm,
      -.2cm/0cm, 0cm/0cm, .2cm/0cm,
      -.2cm/-.2cm, 0cm/-.2cm, .2cm/-.2cm
    } {
      \pgfpathcircle{\pgfpoint{\x}{\y}}{2pt}
    }
    \pgfusepath{fill}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (fudge)
\pgfdeclareshape{fudge}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \pgfpathmoveto{\pgfpoint{-.15cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{.1cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.05cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{-.2cm}}
    \pgfusepath{draw}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (fudge plus)
\pgfdeclareshape{fudge plus}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.15cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{0cm}}
    \pgfusepath{draw}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cube (fudge)
\pgfdeclareshape{fudge minus}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \pgfpathmoveto{\pgfpoint{-.15cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{0cm}}
    \pgfusepath{draw}
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

\ExplSyntaxOn
\NewDocumentCommand { \rpgicons@ifEmptyF } { m m } {
    \tl_if_empty:nF {#1} {#2}
}
\NewDocumentCommand { \rpgicons@ifEmptyTF } { m m m } {
    \tl_if_empty:nTF {#1} {#2} {#3}
}
\ExplSyntaxOff

\NewDocumentCommand{\rpgiconsdie}{ O{normal} m O{} m }{%
  \edef\rpgicons@dieiconnrmlrg{#1}%
  \edef\rpgicons@dieiconlrg{large}%
  \ifx\rpgicons@dieiconnrmlrg\rpgicons@dieiconlrg%
    \def\rpgicons@dieiconfg{fglrg}\else%
    \def\rpgicons@dieiconfg{fgnrm}\fi%
  \ifx\rpgicons@dieiconnrmlrg\rpgicons@dieiconlrg%
    \rpgicons@ifEmptyTF{#4}{%
      \def\rpgicons@dieactualtext{#2}%
    }{%
      \def\rpgicons@dieactualtext{#4 #2}%
    }%
  \else%
    \def\rpgicons@dieactualtext{#2}%
    \rpgicons@ifEmptyF{#4}{#4\,}%
  \fi%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every die,
    rpg icons/every #2,
    actualtext=\rpgicons@dieactualtext,
    baseline=\rpgicons@baseline,
    fgnrm/.style={scale=.333},
    fglrg/.style={scale=.675},
    #3
  ] {
    \node[
      \rpgicons@shape@variant{#2},
      draw,
      \rpgicons@dieiconfg,
      font={\footnotesize}
    ] at (0cm,0cm)
      {\ifx\rpgicons@dieiconnrmlrg\rpgicons@dieiconlrg\textbf{#4}\fi};
    \path[draw=none, \rpgicons@dieiconfg] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{die}{\NewCommandCopy\die\rpgiconsdie}{}

% ABILITIES

% strength
\pgfdeclareshape{strength}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.075cm}}{\pgfpointpolar{90}{.425cm}}}
    \pgfpatharc{90}{60}{.425cm}
    \pgfpatharc{200}{-40}{.1cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.075cm}}{\pgfpointpolar{45}{.425cm}}}
    \pgfpatharc{45}{-20}{.425cm}
    \pgfpatharc{-50}{-80}{.35cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.075cm}}{\pgfpointpolar{90}{.425cm}}}
    \pgfpatharc{90}{120}{.425cm}
    \pgfpatharc{-20}{220}{.1cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.075cm}}{\pgfpointpolar{135}{.425cm}}}
    \pgfpatharc{135}{200}{.425cm}
    \pgfpatharc{230}{260}{.35cm}
    \pgfpathmoveto{\pgfpoint{-.2cm}{-.025cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{-.125cm}{-.325cm}}
    \pgfpatharc{180}{360}{.125cm and .1cm}
    \pgfpathlineto{\pgfpoint{.1cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{-.025cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{-.3cm}}
    \pgfpatharc{90}{70}{.1cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.3cm}}
    \pgfpatharc{90}{110}{.1cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% dexterity
\pgfdeclareshape{dexterity}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.075cm}}{\pgfpointpolar{90}{.425cm}}}
    \pgfpatharc{90}{65}{.425cm}
    \pgfpatharc{200}{90}{.1cm and .075cm}
    \pgfpatharc{90}{-30}{.1cm and .075cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.075cm}}{\pgfpointpolar{45}{.425cm}}}
    \pgfpatharc{45}{-20}{.425cm and .35cm}
    \pgfpatharc{110}{160}{.175cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.075cm}}{\pgfpointpolar{90}{.425cm}}}
    \pgfpatharc{90}{115}{.425cm}
    \pgfpatharc{-20}{90}{.1cm and .075cm}
    \pgfpatharc{90}{220}{.1cm and .075cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.075cm}}{\pgfpointpolar{135}{.425cm}}}
    \pgfpatharc{135}{200}{.425cm and .35cm}
    \pgfpatharc{70}{20}{.175cm}
    \pgfpathmoveto{\pgfpoint{-.075cm}{-.175cm}}
    \pgfpatharc{180}{360}{.075cm and .05cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.25cm}}
    \pgfpathmoveto{\pgfpoint{-.2cm}{.025cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.125cm}{-.075cm}}
    \pgfpathmoveto{\pgfpoint{.125cm}{-.075cm}}
    \pgfpathlineto{\pgfpoint{.075cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{.025cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{-.25cm}}
    \pgfpatharc{360}{140}{.1cm and .075cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.25cm}}
    \pgfpatharc{180}{400}{.1cm and .075cm}
    \pgfpathmoveto{\pgfpoint{-.1cm}{-.325cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.375cm}}
    \pgfpatharc{180}{360}{.1cm and .05cm}
    \pgfpathlineto{\pgfpoint{.1cm}{-.325cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% dexterity i
\pgfdeclareshape{dexterity i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{90}{.425cm}}}
    \pgfpatharc{90}{80}{.425cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{90}{.425cm}}}
    \pgfpatharc{90}{100}{.425cm}
    \pgfpathmoveto{\pgfpoint{.125cm}{.175cm}}
    \pgfpathlineto{\pgfpoint{.375cm}{.425cm}}
    \pgfpatharc{30}{-20}{.25cm}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.1cm}}{\pgfpointpolar{30}{.425cm}}}
    \pgfpatharc{30}{-45}{.425cm and .35cm}
    \pgfpathmoveto{\pgfpoint{-.125cm}{.175cm}}
    \pgfpathlineto{\pgfpoint{-.375cm}{.425cm}}
    \pgfpatharc{150}{200}{.25cm}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.1cm}}{\pgfpointpolar{150}{.425cm}}}
    \pgfpatharc{150}{225}{.425cm and .35cm}
    \pgfpathmoveto{\pgfpoint{.075cm}{-.075cm}}
    \pgfpatharc{170}{90}{.15cm and .05cm}
    \pgfpathmoveto{\pgfpoint{-.075cm}{-.075cm}}
    \pgfpatharc{10}{90}{.15cm and .05cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.275cm}}
    \pgfpatharc{0}{90}{.075cm and .05cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.275cm}}
    \pgfpatharc{180}{90}{.075cm and .05cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.275cm}}
    \pgfpatharc{360}{180}{.1cm and .075cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.275cm}}
    \pgfpatharc{180}{360}{.1cm and .075cm}
    \pgfpathmoveto{\pgfpoint{-.1cm}{-.35cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.375cm}}
    \pgfpatharc{180}{360}{.1cm and .05cm}
    \pgfpathlineto{\pgfpoint{.1cm}{-.35cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% constitution
\pgfdeclareshape{constitution}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{.25cm}}
    \pgfpatharc{-90}{-30}{.325cm}
    \pgfpatharc{0}{-80}{.3cm}
    \pgfpathmoveto{\pgfpoint{0cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{-.125cm}{.25cm}}
    \pgfpatharc{270}{210}{.325cm}
    \pgfpatharc{180}{260}{.3cm}
    \pgfpathmoveto{\pgfpoint{.325cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.075cm}}
    \pgfpatharc{0}{-90}{.175cm and .1cm}
    \pgfpathlineto{\pgfpoint{.2cm}{-.15cm}}
    \pgfpathmoveto{\pgfpoint{-.325cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{.075cm}}
    \pgfpatharc{180}{270}{.175cm and .1cm}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.15cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.225cm}}
    \pgfpatharc{90}{270}{.1cm}
    \pgfpathlineto{\pgfpoint{.15cm}{-.425cm}}
    \pgfpatharc{-90}{90}{.1cm}
    \pgfpathmoveto{\pgfpoint{-.125cm}{-.35cm}}
    \pgfpatharc{-90}{0}{.05cm}
    \pgfpathmoveto{\pgfpoint{.125cm}{-.35cm}}
    \pgfpatharc{90}{0}{-.05cm}
    \pgfpathmoveto{\pgfpoint{-.125cm}{-.025cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.1cm}}
    \pgfpathmoveto{\pgfpoint{.125cm}{-.025cm}}
    \pgfpathlineto{\pgfpoint{.075cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{.075cm}{-.1cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% intelligence
\pgfdeclareshape{intelligence}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.2cm}}{\pgfpointpolar{90}{.425cm}}}
    \pgfpatharc{90}{60}{.25cm}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.1cm}}{\pgfpointpolar{60}{.6cm}}}
    \pgfpatharc{40}{-2.5}{.425cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.2cm}}{\pgfpointpolar{90}{.425cm}}}
    \pgfpatharc{90}{120}{.25cm}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.1cm}}{\pgfpointpolar{120}{.6cm}}}
    \pgfpatharc{140}{182.5}{.425cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.2cm}}{\pgfpointpolar{45}{.425cm}}}
    \pgfpatharc{45}{0}{.425cm}
    \pgfpathlineto{\pgfpoint{.2cm}{-.275cm}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.2cm}}{\pgfpointpolar{135}{.425cm}}}
    \pgfpatharc{135}{180}{.425cm}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.275cm}}
    \pgfpathmoveto{\pgfpoint{-.2cm}{-.075cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.375cm}}
    \pgfpatharc{180}{360}{.075cm and .05cm}
    \pgfpathlineto{\pgfpoint{.1cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{-.075cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% wisdom
\pgfdeclareshape{wisdom}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.175cm+.425cm+.425cm}}{\pgfpointpolar{240}{.425cm+.425cm}}}
    \pgfpatharc{240}{270}{.425cm}
    \pgfpatharc{90}{60}{.425cm}
    \pgfpatharc{120}{90}{.425cm}
    \pgfpatharc{270}{300}{.425cm}
    \pgfpathcircle{\pgfpoint{-.175cm}{0cm}}{.075cm}
    \pgfpathcircle{\pgfpoint{.175cm}{0cm}}{.075cm}
    \pgfpathmoveto{\pgfpoint{.075cm}{-.125cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.325cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.125cm}}
    \pgfpathmoveto{\pgfpoint{-.375cm}{.125cm}}
    \pgfpatharc{150}{270}{.25cm}
    \pgfpathmoveto{\pgfpoint{.375cm}{.125cm}}
    \pgfpatharc{30}{-90}{.25cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% wisdom i
\pgfdeclareshape{wisdom i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.125cm}}{\pgfpointpolar{110}{.55cm}}}
    \pgfpatharc{110}{70}{.55cm}
    \pgfpathmoveto{\pgfpoint{-.425cm}{.125cm}}
    \pgfpatharc{180}{270}{.1cm and .175cm}
    \pgfpatharc{330}{420}{.1cm and .2cm}
    \pgfpathmoveto{\pgfpoint{.425cm}{.125cm}}
    \pgfpatharc{360}{270}{.1cm and .175cm}
    \pgfpatharc{210}{120}{.1cm and .2cm}
    \pgfpathmoveto{\pgfpoint{-.3cm}{.3cm}}
    \pgfpatharc{110}{30}{.1cm and .25cm}
    \pgfpathmoveto{\pgfpoint{.3cm}{.3cm}}
    \pgfpatharc{70}{150}{.1cm and .25cm}
    \pgfpathmoveto{\pgfpoint{-.075cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.05cm}}
    \pgfpathmoveto{\pgfpoint{.075cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{-.05cm}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{2*sin(30)*-.3cm}{-.3cm}}{\pgfpointpolar{120}{.1cm and .175cm}}}
    \pgfpatharc{180}{240}{.1cm and .175cm}
    \pgfpatharc{120}{60}{.3cm and .5cm}
    \pgfpatharc{120}{60}{.3cm and .5cm}
    \pgfpatharc{300}{360}{.1cm and .175cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.125cm}}{\pgfpointpolar{245}{.55cm}}}
    \pgfpatharc{245}{295}{.55cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% charisma
\pgfdeclareshape{charisma}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.15cm}}
    \pgfpatharc{270}{190}{.15cm and .1cm}
    \pgfpatharc{10}{90}{.175cm and .225cm}
    \pgfpatharc{40}{0}{.125cm and .175cm}
    \pgfpathmoveto{\pgfpoint{0cm}{.15cm}}
    \pgfpatharc{270}{350}{.15cm and .1cm}
    \pgfpatharc{170}{90}{.175cm and .225cm}
    \pgfpatharc{140}{180}{.125cm and .175cm}
    \pgfpathmoveto{\pgfpoint{-.2cm}{.125cm}}
    \pgfpatharc{0}{90}{.175cm and .1cm}
    \pgfpatharc{180}{270}{.15cm and .2cm}
    \pgfpathlineto{\pgfpoint{-.25cm}{-.05cm}}
    \pgfpatharc{40}{0}{.45cm}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.25cm-.45cm}{-.05cm}}{\pgfpointpolar{-40}{.45cm}}}
    \pgfpatharc{180}{140}{.45cm}
    \pgfpathlineto{\pgfpoint{.2cm+.175cm-.15cm}{.125cm+.1cm-.2cm}}
    \pgfpatharc{-90}{0}{.15cm and .2cm}
    \pgfpatharc{90}{180}{.175cm and .1cm}
    \pgfpathmoveto{\pgfpoint{-.05cm}{-.275cm}}
    \pgfpatharc{-30}{60}{.05cm}
    \pgfpathmoveto{\pgfpoint{.05cm}{-.275cm}}
    \pgfpatharc{210}{120}{.05cm}
    \pgfpathmoveto{\pgfpoint{-.125cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.075cm}}
    \pgfpathmoveto{\pgfpoint{.125cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{-.075cm}}
    \pgfpathmoveto{\pgfpoint{-.35cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.05cm}}
    \pgfpatharc{30}{-30}{.15cm}
    \pgfpatharc{80}{10}{.15cm}
    \pgfpathlineto{\pgfpoint{-.25cm}{-.275cm}}
    \pgfpathmoveto{\pgfpoint{.35cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{-.05cm}}
    \pgfpatharc{150}{210}{.15cm}
    \pgfpatharc{100}{170}{.15cm}
    \pgfpathlineto{\pgfpoint{.25cm}{-.275cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% resilience
\pgfdeclareshape{resilience}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{-.425cm}{-.475cm}}{\pgfpointpolar{65}{.5cm}}}
    \pgfpatharc{65}{90}{.5cm}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.075cm}}{\pgfpointpolar{135}{.55cm}}}
    \pgfpatharc{135}{45}{.55cm}
    \pgfpathlineto{\pgfpoint{.425cm}{.025cm}}
    \pgfpatharc{90}{115}{.5cm}
    \pgfpathmoveto{\pgfpoint{.2cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{.275cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{.15cm}}
    \pgfpathmoveto{\pgfpoint{.125cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{.05cm}}
    \pgfpathmoveto{\pgfpoint{.15cm}{-.1cm}}
    \pgfpatharc{200}{230}{.4cm}
    \pgfpathmoveto{\pgfpoint{-.2cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{-.125cm}{.275cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{.15cm}}
    \pgfpathmoveto{\pgfpoint{-.125cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{.05cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.1cm}}
    \pgfpatharc{340}{310}{.4cm}
    \pgfpathmoveto{\pgfpoint{-.065cm}{-.075cm}}
    \pgfpathlineto{\pgfpoint{-.045cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.045cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.065cm}{-.075cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% sanity
\pgfdeclareshape{sanity}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{-.125cm + .175cm * sin(30)}{.425cm - .175cm * cos(30)}}
      {\pgfpointpolar{210}{.175cm}}}
    \pgfpatharc{210}{120}{.175cm}
    \pgfpathlineto{\pgfpointpolar{110}{.25cm}}
    \pgfpatharc{110}{70}{.25cm}
    \pgfpathlineto{\pgfpoint{.125cm}{.425cm}}
    \pgfpatharc{420}{330}{.175cm}
    \pgfpathmoveto{\pgfpoint{.25cm}{.1cm}}
    \pgfpatharc{390}{305}{.15cm}
    \pgfpathmoveto{\pgfpoint{-.25cm}{.1cm}}
    \pgfpatharc{150}{235}{.15cm}
    \pgfpathmoveto{\pgfpoint{-.15cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{.025cm}}
    \pgfpathmoveto{\pgfpoint{.15cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{.025cm}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{-.55cm}{-.35cm}}
      {\pgfpointadd{\pgfpointpolar{135}{.125cm and .075cm}}{\pgfpointpolar{20}{.55cm}}}}
    \pgfpatharc{380}{360}{.55cm}
    \pgfpatharc{135}{405}{.125cm and .075cm}
    \pgfpatharc{180}{160}{.55cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% perception
\pgfdeclareshape{perception}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.35cm}}{\pgfpointpolar{150}{.125cm}}}
    \pgfpatharc{150}{390}{.125cm}
    \pgfpathmoveto{\pgfpoint{-.3cm}{.425cm}}
    \pgfpatharc{180}{360}{.3cm and .2cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.425cm}}{\pgfpointpolar{330}{.3cm and .2cm}}}
    \pgfpatharc{270}{350}{.15cm and .1cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.425cm}}{\pgfpointpolar{210}{.3cm and .2cm}}}
    \pgfpatharc{270}{190}{.15cm and .1cm}
    \pgfpathmoveto{\pgfpoint{-.2cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{-.375cm}{.125cm}}
    \pgfpatharc{210}{250}{.225cm}
    \pgfpathmoveto{\pgfpoint{.2cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{.375cm}{.125cm}}
    \pgfpatharc{330}{290}{.225cm}
    \pgfpathmoveto{\pgfpoint{-.15cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.025cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.05cm}}
    \pgfpathmoveto{\pgfpoint{.15cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.075cm}{-.025cm}}
    \pgfpathlineto{\pgfpoint{.075cm}{-.05cm}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{-.075cm}{-.35cm + .075cm * ( 2 + sqrt(3) )}}
      {\pgfpointpolar{195}{.1cm and .075cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.35cm}}{\pgfpointpolar{195}{.1cm and .075cm}}}
    \pgfpatharc{195}{345}{.1cm and .075cm}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.075cm}{-.35cm + .075cm * ( 2 + sqrt(3) )}}
      {\pgfpointpolar{345}{.1cm and .075cm}}}
    \pgfpathmoveto{\pgfpoint{.025cm}{-.325cm}}
    \pgfpatharc{0}{180}{.025cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% luck
\pgfdeclareshape{luck}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.1cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{-.05cm}}
    \pgfpatharc{-75}{-15}{.425cm}
    \pgfpatharc{40}{85}{.425cm}
    \pgfpathmoveto{\pgfpoint{-.1cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.05cm}}
    \pgfpatharc{-105}{-165}{.425cm}
    \pgfpatharc{140}{95}{.425cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.05cm}}{\pgfpointpolar{15}{.425cm}}}
    \pgfpatharc{15}{-55}{.425cm and .3cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.05cm}}{\pgfpointpolar{165}{.425cm}}}
    \pgfpatharc{165}{235}{.425cm and .3cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.175cm}}
    \pgfpatharc{90}{250}{.175cm and .125cm}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.325cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{-.175cm}}
    \pgfpatharc{90}{-70}{.175cm and .125cm}
    \pgfpathlineto{\pgfpoint{.05cm}{-.325cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% armour
\pgfdeclareshape{armour}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.25cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.125cm}}
    \pgfpatharc{0}{90}{.3cm}
    \pgfpathlineto{\pgfpoint{.125cm}{.35cm}}
    \pgfpatharc{360}{180}{.125cm}
    \pgfpathlineto{\pgfpoint{-.125cm}{.425cm}}
    \pgfpatharc{90}{180}{.3cm}
    \pgfpathlineto{\pgfpoint{-.25cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.225cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.125cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{.25cm}}
    \pgfpatharc{180}{270}{.125cm}
    \pgfpathmoveto{\pgfpoint{-.125cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.125cm}{.25cm}}
    \pgfpatharc{360}{270}{.125cm}
    \pgfpathmoveto{\pgfpoint{0cm}{.225cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.275cm}}
    \pgfpathmoveto{\pgfpoint{-.2cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.275cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{-.225cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\pgfdeclareshape{armor}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={armour}]
}

% proficiency
\pgfdeclareshape{proficiency}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointpolar{90}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{126}{.15cm}}
    \pgfpathlineto{\pgfpointpolar{162}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{198}{.15cm}}
    \pgfpathlineto{\pgfpointpolar{234}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{270}{.15cm}}
    \pgfpathlineto{\pgfpointpolar{306}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{342}{.15cm}}
    \pgfpathlineto{\pgfpointpolar{18}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{54}{.15cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpointpolar{270}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{270}{.425cm}}
    \pgfpathmoveto{\pgfpointpolar{342}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{342}{.425cm}}
    \pgfpathmoveto{\pgfpointpolar{54}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{54}{.425cm}}
    \pgfpathmoveto{\pgfpointpolar{126}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{126}{.425cm}}
    \pgfpathmoveto{\pgfpointpolar{198}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{198}{.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\NewDocumentCommand{\rpgiconsability}{ O{positive} m O{} }{%
  \edef\rpgicons@abilityiconposneg{#1}%
  \edef\rpgicons@abilityiconneg{negative}%
  \ifx\rpgicons@abilityiconposneg\rpgicons@abilityiconneg%
    \def\rpgicons@abilityiconfg{fgneg}\else%
    \def\rpgicons@abilityiconfg{fgpos}\fi%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every ability,
    rpg icons/every #2,
    actualtext={#2},
    baseline=\rpgicons@baseline,
    fgpos/.style={draw},
    fgneg/.style={draw=rpgicons@bg, line width=.6pt},
    #3
  ] {
    \ifx\rpgicons@abilityiconposneg\rpgicons@abilityiconneg%
      \path[scale=.333, fill] (0cm,0cm) circle[radius=.45cm];
      \node[\rpgicons@shape@variant{#2}, \rpgicons@abilityiconfg, scale=.225] at (0cm,0cm) {};
    \else
      \node[\rpgicons@shape@variant{#2}, \rpgicons@abilityiconfg, scale=.333] at (0cm,0cm) {};
    \fi%
    \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{ability}{\NewCommandCopy\ability\rpgiconsability}{}

\NewDocumentCommand{\rpgiconssaving}{ O{normal} m O{} }{%
  \edef\rpgicons@abilityiconnrmemp{#1}%
  \edef\rpgicons@abilityiconemp{empty}%
  \ifx\rpgicons@abilityiconnrmemp\rpgicons@abilityiconemp%
    \def\rpgicons@savingstyle{}%
    \def\rpgicons@savingactualtext{saving}%
  \else%
    \def\rpgicons@savingstyle{rpg icons/every #2}%
    \def\rpgicons@savingactualtext{#2 saving}%
  \fi%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every saving,
    \rpgicons@savingstyle,
    actualtext=\rpgicons@savingactualtext,
    baseline=\rpgicons@baseline,
    #3
  ] {
    \path[draw, scale=.333] (-.45cm,.45cm) -- (.45cm,.45cm) -- (.45cm,-.05cm)
      arc[start angle=360, end angle=180, radius=.45cm] -- cycle;
    \ifx\rpgicons@abilityiconnrmemp\rpgicons@abilityiconemp\else%
      \node[\rpgicons@shape@variant{#2}, draw, scale=.225] at (0cm,0cm) {};
    \fi%
    \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{saving}{\NewCommandCopy\saving\rpgiconssaving}{}

% SPELLS

% linear
\pgfdeclareshape{linear}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \pgfpathcircle{\pgfpoint{-.4cm}{0cm}}{2pt}
    \pgfusepath{fill} % draw origin
  }
  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.4cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.4cm}{0cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% conic
\pgfdeclareshape{conic}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \pgfpathcircle{\pgfpoint{-.425cm}{0cm}}{2pt}
    \pgfusepath{fill} % draw origin
  }
  \backgroundpath{
    \def\rx{.425cm}
    \def\ry{.2cm}
    \def\z{(.425cm+.2125cm)}
    \pgfpathellipse{\pgfpoint{\z-.425cm}{0cm}}{\pgfpoint{\ry}{0cm}}{\pgfpoint{0cm}{\rx}}
    \pgfmathparse{asin(\ry/\z)}
    \let\angle\pgfmathresult
    \pgfmathparse{-\rx*cos(\angle)}
    \let\coordya\pgfmathresult
    \pgfmathparse{\rx*cos(\angle)}
    \let\coordyb\pgfmathresult
    \pgfmathparse{\z-\ry*sin(\angle)}
    \let\coordx\pgfmathresult
    \pgfpathmoveto{\pgfpoint{\coordx-.425cm}{\coordya}}
    \pgfpathlineto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{\coordx-.425cm}{\coordyb}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% quadratic
\pgfdeclareshape{quadratic}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \pgfpathcircle{\pgfpointorigin}{2pt}
    \pgfusepath{fill} % draw origin
  }
  \backgroundpath{
    \pgfpathrectanglecorners{\pgfpoint{.4cm}{.4cm}}{\pgfpoint{-.4cm}{-.4cm}}
  }
}

% cubic
\pgfdeclareshape{cubic}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \pgfpathcircle{\pgfpoint{.1125cm}{-.1125cm}}{2pt}
    \pgfusepath{fill} % draw origin
  }
  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{.425cm}}
    \pgfpathclose
    \pgfpathlineto{\pgfpoint{-.2cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.425cm}}
    \pgfpathmoveto{\pgfpoint{-.2cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.2cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% spheric
\pgfdeclareshape{spheric}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \pgfpathcircle{\pgfpointorigin}{2pt}
    \pgfusepath{fill} % draw origin
  }
  \backgroundpath{
    \pgfpathcircle{\pgfpointorigin}{.425cm}
    \pgfpathmoveto{\pgfpoint{.425cm}{0cm}}
    \pgfpatharc{180}{50}{-.425cm and -.2cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.425cm}}
    \pgfpatharc{270}{140}{-.2cm and .425cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% cylindric
\pgfdeclareshape{cylindric}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \behindbackgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{-.2125cm}}{2pt}
    \pgfusepath{fill} % draw origin
  }
  \backgroundpath{
    \pgfpathellipse{\pgfpoint{0cm}{.2125cm}}{\pgfpoint{0cm}{.2cm}}{\pgfpoint{.425cm}{0cm}}
    \pgfpathmoveto{\pgfpoint{-.425cm}{.2125cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.2125cm}}
    \pgfpatharc{0}{180}{-.425cm and -.2cm}
    \pgfpathlineto{\pgfpoint{.425cm}{.2125cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% emanation
\pgfdeclareshape{emanation}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{.1cm}}{.075cm}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.15cm}}
    \pgfpatharc{180}{90}{.075cm}
    \pgfpathlineto{\pgfpoint{.075cm}{-.075cm}}
    \pgfpatharc{90}{0}{.075cm}
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.425cm}
  }
}

% verbal
\pgfdeclareshape{verbal}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.35cm}{0cm}}
    \pgfpatharc{180}{-115}{.35cm}
    \pgfpathlineto{\pgfpoint{-.4cm}{-.4cm}}
    \pgfpathlineto{\pgfpointpolar{215}{.35cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% somatic
\pgfdeclareshape{somatic}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{0cm}}
    \pgfpatharc{0}{270}{-.425cm and -.2cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.425cm}}
    \pgfpatharc{90}{360}{-.2cm and -.425cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% material
\pgfdeclareshape{material}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.4cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{-.4cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.4cm}}
    \pgfpathlineto{\pgfpoint{.4cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{.4cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.4cm}}
    \pgfpathclose
    \pgfpathlineto{\pgfpoint{0cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.4cm}{.2cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{0cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.4cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% ritual
\pgfdeclareshape{ritual}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointpolar{90}{.425cm}}
    \pgfpatharc{90}{-198}{.425cm}
    \pgfpathlineto{\pgfpointpolar{306}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{90}{.425cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpointadd{\pgfpointpolar{90}{.425cm}}{\pgfpointpolar{72}{-.225cm}}}
    \pgfpathlineto{\pgfpointpolar{234}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{378}{.425cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpointpolar{162}{.425cm}}{\pgfpointpolar{180}{-.225cm}}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% focus
\pgfdeclareshape{focus}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpointorigin}{.35cm}
    \pgfpathmoveto{\pgfpoint{-.15cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathmoveto{\pgfpoint{.15cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\NewDocumentCommand{\rpgiconsspell}{ m O{} }{%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every spell,
    rpg icons/every #1,
    actualtext={#1},
    baseline=\rpgicons@baseline,
    #2
  ] {
    \node[\rpgicons@shape@variant{#1}, draw, scale=.333] at (0cm,0cm) {};
    \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{spell}{\NewCommandCopy\spell\rpgiconsspell}{}

% SPELLSCHOOLS

% abjuration
\pgfdeclareshape{abjuration}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.025cm}}
    \pgfpatharc{270}{390}{.275cm and .175cm}
    \pgfpatharc{210}{120}{.095cm}
    \pgfpathmoveto{\pgfpoint{0cm}{.025cm}}
    \pgfpatharc{270}{150}{.275cm and .175cm}
    \pgfpatharc{-30}{60}{.095cm}
    \pgfpathmoveto{\pgfpoint{0cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathmoveto{\pgfpoint{-.25cm}{-.125cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{-.125cm}}
    \pgfpathmoveto{\pgfpoint{-.25cm}{-.3cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{-.3cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% conjuration
\pgfdeclareshape{conjuration}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.425cm}}
    \pgfpathmoveto{\pgfpoint{-.225cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{.225cm}{.05cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{-.15cm}}
    \pgfpatharc{110}{70}{.5cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.15cm}}
    \pgfpatharc{110}{70}{-.5cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% divination
\pgfdeclareshape{divination}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.35cm}{-.175cm}}
    \pgfpatharc{180}{0}{.15cm and -.25cm}
    \pgfpatharc{180}{90}{.4cm}
    \pgfpathmoveto{\pgfpoint{-.05cm}{-.175cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{0cm}}
    \pgfpatharc{180}{90}{.4cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% enchantment
\pgfdeclareshape{enchantment}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.2cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{.425cm}}
    \pgfpathmoveto{\pgfpoint{-.425cm}{.175cm}}
    \pgfpathlineto{\pgfpoint{.025cm}{.175cm}}
    \pgfpathmoveto{\pgfpoint{-.2cm}{-.225cm}}
    \pgfpatharc{180}{0}{.1cm and .2cm}
    \pgfpatharc{180}{0}{.1cm and .2cm}
    \pgfpatharc{180}{0}{.1cm and -.2cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% evocation
\pgfdeclareshape{evocation}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{.325cm}{0cm}}{\pgfpoint{0cm}{.225cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathmoveto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathmoveto{\pgfpointpolar{30}{.325cm and .225cm}}
    \pgfpathlineto{\pgfpointpolar{30}{.4cm}}
    \pgfpathmoveto{\pgfpointpolar{60}{.325cm and .225cm}}
    \pgfpathlineto{\pgfpointpolar{60}{.4cm}}
    \pgfpathmoveto{\pgfpointpolar{120}{.325cm and .225cm}}
    \pgfpathlineto{\pgfpointpolar{120}{.4cm}}
    \pgfpathmoveto{\pgfpointpolar{150}{.325cm and .225cm}}
    \pgfpathlineto{\pgfpointpolar{150}{.4cm}}
    \pgfpathmoveto{\pgfpointpolar{210}{.325cm and .225cm}}
    \pgfpathlineto{\pgfpointpolar{210}{.4cm}}
    \pgfpathmoveto{\pgfpointpolar{240}{.325cm and .225cm}}
    \pgfpathlineto{\pgfpointpolar{240}{.4cm}}
    \pgfpathmoveto{\pgfpointpolar{300}{.325cm and .225cm}}
    \pgfpathlineto{\pgfpointpolar{300}{.4cm}}
    \pgfpathmoveto{\pgfpointpolar{330}{.325cm and .225cm}}
    \pgfpathlineto{\pgfpointpolar{330}{.4cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% illusion
\pgfdeclareshape{illusion}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.225cm}}
    \pgfpatharc{90}{30}{.45cm}
    \pgfpatharc{330}{210}{.45cm}
    \pgfpatharc{150}{90}{.45cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.225cm}}{\pgfpointpolar{270}{.45cm}}}
    \pgfpathlineto{\pgfpointpolar{270}{.35cm}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.225cm}}{\pgfpointpolar{240}{.45cm}}}
    \pgfpathlineto{\pgfpointpolar{225}{.4cm}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.225cm}}{\pgfpointpolar{300}{.45cm}}}
    \pgfpathlineto{\pgfpointpolar{315}{.4cm}}
    \pgfpathcircle{\pgfpoint{0cm}{.075cm}}{.15cm}
  }
}

% necromancy
\pgfdeclareshape{necromancy}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointpolar{210}{.25cm}}
    \pgfpatharc{210}{-30}{.25cm}
    \pgfpatharc{150}{390}{.1cm}
    \pgfpathmoveto{\pgfpointpolar{210}{.25cm}}
    \pgfpatharc{390}{150}{.1cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% transmutation
\pgfdeclareshape{transmutation}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.25cm}{.35cm}}
    \pgfpathlineto{\pgfpoint{-.25cm}{-.35cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{.35cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.35cm}}
    \pgfpathmoveto{\pgfpoint{-.425cm}{.35cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{.35cm}}
    \pgfpatharc{90}{-45}{.1cm}
    \pgfpatharc{135}{360}{.1cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\NewDocumentCommand{\rpgiconsspellschool}{ O{negative} m O{} }{%
  \edef\rpgicons@spellschooliconposneg{#1}%
  \edef\rpgicons@spellschooliconpos{positive}%
  \ifx\rpgicons@spellschooliconposneg\rpgicons@spellschooliconpos%
    \def\rpgicons@spellschooliconfg{fgneg}\else%
    \def\rpgicons@spellschooliconfg{fgpos}\fi%
  \ifx\rpgicons@spellschooliconposneg\rpgicons@spellschooliconpos%
    \def\rpgicons@spellschooliconbg{bgneg}\else%
    \def\rpgicons@spellschooliconbg{bgpos}\fi%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every spellschool,
    rpg icons/every #2,
    actualtext={#2},
    baseline=\rpgicons@baseline,
    fgpos/.style={draw=rpgicons@bg, line width=.6pt},
    fgneg/.style={draw},
    bgpos/.style={fill},
    bgneg/.style={draw},
    #3
  ] {
    \path[scale=.333, \rpgicons@spellschooliconbg] (-.475cm,.35cm)
      -- (-.35cm,.475cm) -- (.35cm,.475cm) -- (.475cm,.35cm) -- (.425cm,-.375cm) -- (0cm,-.475cm) -- (-.425cm,-.375cm) -- cycle;
    \node[\rpgicons@shape@variant{#2}, \rpgicons@spellschooliconfg, scale=.225] at (0cm,0cm) {};
    \path[draw=none, scale=.333] ([yshift=-1pt].425,.425) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{spellschool}{\NewCommandCopy\spellschool\rpgiconsspellschool}{}

% DAMAGES

% acid
\pgfdeclareshape{acid}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{-.175cm}{.05cm}}{\pgfpointpolar{-20}{.175}}}
    \pgfpatharc{-20}{200}{-.175cm}
    \pgfpathlineto{\pgfpoint{0cm}{.425cm}}
    \pgfpathclose
    \newdimen\rpgicons@py
    \pgfextracty{\rpgicons@py}{\pgfpointadd{\pgfpoint{0cm}{-.175cm}}{\pgfpointpolar{20}{-.25cm}}}
    \pgfpathmoveto{\pgfpoint{-.425cm}{\rpgicons@py}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.175cm}}{\pgfpointpolar{20}{-.25cm}}}
    \pgfpatharc{20}{160}{-.25cm}
    \pgfpathlineto{\pgfpoint{.425cm}{\rpgicons@py}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% bludgeoning
\pgfdeclareshape{bludgeoning}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.2cm}{.225cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.225cm}{-.2cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.05cm}{-.025cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.35cm}}
    \pgfpathlineto{\pgfpoint{-.025cm}{.05cm}}
    \pgfpathmoveto{\pgfpoint{.175cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{.275cm}}
    \pgfpatharc{315}{135}{sqrt(2)*-.0375cm}
    \pgfpathlineto{\pgfpoint{.25cm}{.175cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% cold
\pgfdeclareshape{cold}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointpolar{90}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{270}{.425cm}}
    \pgfpathmoveto{\pgfpointpolar{110}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{90}{.25cm}}
    \pgfpathlineto{\pgfpointpolar{70}{.35cm}}
    \pgfpathmoveto{\pgfpointpolar{250}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{270}{.25cm}}
    \pgfpathlineto{\pgfpointpolar{290}{.35cm}}
    \pgfpathmoveto{\pgfpointpolar{30}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{210}{.425cm}}
    \pgfpathmoveto{\pgfpointpolar{50}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{30}{.25cm}}
    \pgfpathlineto{\pgfpointpolar{10}{.35cm}}
    \pgfpathmoveto{\pgfpointpolar{190}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{210}{.25cm}}
    \pgfpathlineto{\pgfpointpolar{230}{.35cm}}
    \pgfpathmoveto{\pgfpointpolar{150}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{330}{.425cm}}
    \pgfpathmoveto{\pgfpointpolar{130}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{150}{.25cm}}
    \pgfpathlineto{\pgfpointpolar{170}{.35cm}}
    \pgfpathmoveto{\pgfpointpolar{310}{.35cm}}
    \pgfpathlineto{\pgfpointpolar{330}{.25cm}}
    \pgfpathlineto{\pgfpointpolar{350}{.35cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% fire
\pgfdeclareshape{fire}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.425cm}}
    \pgfpatharc{240}{135}{.45cm and .35cm}
    \pgfpathcurveto{\pgfpoint{-.15cm}{.2cm}}{\pgfpoint{0cm}{.25cm}}{\pgfpoint{-.05cm}{.425cm}}
    \pgfpathcurveto{\pgfpoint{.15cm}{.375cm}}{\pgfpoint{.375cm}{.15cm}}
      {\pgfpointadd{\pgfpoint{.15cm}{-.425cm}}{\pgfpointpolar{60}{.45cm and .375cm}}}
    \pgfpatharc{0}{-60}{.45cm and .375cm}
    \pgfpathmoveto{\pgfpoint{-.075cm}{-.3cm}}
    \pgfpatharc{220}{150}{.35cm and .2cm}
    \pgfpatharc{225}{360}{.1cm and .25cm}
    \pgfpathcurveto{\pgfpoint{.2cm}{-.05cm}}{\pgfpoint{.2cm}{-.2cm}}{\pgfpoint{.075cm}{-.3cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% force
\pgfdeclareshape{force}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointpolar{90}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{120}{.15cm}}
    \pgfpathlineto{\pgfpointpolar{150}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{180}{.15cm}}
    \pgfpathlineto{\pgfpointpolar{210}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{240}{.15cm}}
    \pgfpathlineto{\pgfpointpolar{270}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{300}{.15cm}}
    \pgfpathlineto{\pgfpointpolar{330}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{0}{.15cm}}
    \pgfpathlineto{\pgfpointpolar{30}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{60}{.15cm}}
    \pgfpathclose
  }
}

% lightning
\pgfdeclareshape{lightning}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.25cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% necrotic
\pgfdeclareshape{necrotic}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.35cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{.075cm}}
    \pgfpatharc{180}{0}{.35cm}
    \pgfpathlineto{\pgfpoint{.35cm}{-.425cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{0cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.25cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{.1cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% necrotic i
\pgfdeclareshape{necrotic i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.35cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{.075cm}}
    \pgfpatharc{180}{0}{.35cm}
    \pgfpathlineto{\pgfpoint{.35cm}{-.425cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.1cm}{-.075cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{-.075cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{.125cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% piercing
\pgfdeclareshape{piercing}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{.3cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.3cm}{-.075cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.075cm}}
    \pgfpathmoveto{\pgfpoint{.25cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{.35cm}}
    \pgfpathmoveto{\pgfpoint{.25cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.35cm}}
    \pgfpathmoveto{\pgfpoint{.425cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.425cm}}
    \pgfpathmoveto{\pgfpoint{.425cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{-.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% poison
\pgfdeclareshape{poison}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.175cm}}{\pgfpointpolar{-40}{.25cm}}}
    \pgfpatharc{-40}{220}{.25cm}
    \pgfpathlineto{\pgfpoint{-.15cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{-.1cm}}
    \pgfpathclose
    \pgfpathcircle{\pgfpoint{-.1cm}{.15cm}}{.05cm}
    \pgfpathcircle{\pgfpoint{.1cm}{.15cm}}{.05cm}
    \pgfpathmoveto{\pgfpoint{.425cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.425cm}}
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{-.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% psychic
\pgfdeclareshape{psychic}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.075cm}{.4cm}}
    \pgfpatharc{90}{180}{.425cm}
    \pgfpatharc{180}{270}{.375cm}
    \pgfpatharc{270}{360}{.325cm}
    \pgfpatharc{0}{90}{.275cm}
    \pgfpatharc{90}{180}{.225cm}
    \pgfpatharc{180}{270}{.175cm}
    \pgfpatharc{270}{360}{.125cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% radiant
\pgfdeclareshape{radiant}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpointorigin}{.225cm}
    \pgfpathmoveto{\pgfpointpolar{15}{.425cm}}
    \pgfpatharc{15}{45}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{75}{.425cm}}
    \pgfpatharc{75}{105}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{135}{.425cm}}
    \pgfpatharc{135}{165}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{195}{.425cm}}
    \pgfpatharc{195}{225}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{255}{.425cm}}
    \pgfpatharc{255}{285}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{315}{.425cm}}
    \pgfpatharc{315}{345}{.425cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% slashing
\pgfdeclareshape{slashing}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.15cm}{.225cm}}
    \pgfpathlineto{\pgfpoint{-.275cm}{.35cm}}
    \pgfpatharc{0}{270}{.075cm}
    \pgfpathlineto{\pgfpoint{-.225cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{-.125cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{.35cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{.425cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.2cm}{.025cm}}
    \pgfpathlineto{\pgfpoint{.225cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{-.025cm}{.2cm}}
    \pgfpathmoveto{\pgfpoint{.325cm}{-.325cm}}
    \pgfpathlineto{\pgfpoint{0cm}{0cm}}
    \pgfpathmoveto{\pgfpoint{.425cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathmoveto{\pgfpoint{.275cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.275cm}{.1cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% thunder
\pgfdeclareshape{thunder}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.225cm}{-.075cm}}
    \pgfpatharc{-90}{120}{.2cm}
    \pgfpatharc{30}{180}{.225cm}
    \newdimen\rpgicons@qy
    \pgfmathparse{.125cm+cos(30)*.2cm-sin(30)*.225cm}
    \rpgicons@qy=\pgfmathresult pt
    \pgfpathlineto{\pgfpoint{-.3cm}{\rpgicons@qy}}
    \pgfpatharc{90}{180}{.125cm}
    \pgfpathlineto{\pgfpoint{-.425cm}{.05cm}}
    \pgfpatharc{180}{270}{.125cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.1cm}{-.225cm}}
    \pgfpatharc{240}{300}{.3cm}
    \pgfpathmoveto{\pgfpoint{-.2cm}{-.35cm}}
    \pgfpatharc{240}{300}{.5cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% healing
\pgfdeclareshape{healing}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{-.375cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.2cm}{.125cm}}{\pgfpointpolar{-45}{.2cm}}}
    \pgfpatharc{-45}{180}{.2cm}
    \pgfpatharc{0}{225}{.2cm}
    \pgfpathclose
  }
}

\NewDocumentCommand{\rpgiconsdamage}{ m O{} }{%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every damage,
    rpg icons/every #1,
    actualtext={#1},
    baseline=\rpgicons@baseline,
    #2
  ] {
    \path[draw, scale=.333] (0cm,0cm) circle[radius=.5cm];
    \node[\rpgicons@shape@variant{#1}, draw, scale=.225] at (0cm,0cm) {};
    \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{damage}{\NewCommandCopy\damage\rpgiconsdamage}{}

% ATTACKS

% melee
\pgfdeclareshape{melee}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{-.275cm}{-.35cm}}
    \pgfpatharc{360}{90}{.075cm}
    \pgfpathlineto{\pgfpoint{-.225cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{-.35cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{-.425cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.2cm}{-.025cm}}
    \pgfpathlineto{\pgfpoint{.225cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.225cm}}
    \pgfpathlineto{\pgfpoint{-.025cm}{-.2cm}}
    \pgfpathmoveto{\pgfpoint{.325cm}{.325cm}}
    \pgfpathlineto{\pgfpoint{0cm}{0cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% melee i
\pgfdeclareshape{melee i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.15cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{.275cm}{.325cm}}
    \pgfpatharc{180}{-90}{.075cm}
    \pgfpathlineto{\pgfpoint{.225cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{.325cm}{.025cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{-.025cm}{.225cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{.3cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.175cm}{.025cm}}
    \pgfpathlineto{\pgfpoint{-.175cm}{-.325cm}}
    \pgfpatharc{315}{225}{.175cm}
    \pgfpathlineto{\pgfpoint{.05cm}{.15cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% ranged
\pgfdeclareshape{ranged}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{0cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.225cm}}
    \pgfpatharc{0}{-30}{.4cm}
    \pgfpatharc{-45}{0}{.6cm}
    \pgfpathmoveto{\pgfpoint{0cm}{0cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.225cm}}
    \pgfpatharc{0}{30}{.4cm}
    \pgfpatharc{45}{0}{.6cm}
    \pgfpathmoveto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathmoveto{\pgfpoint{.275cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.275cm}{-.1cm}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{-.4cm}{-.225cm}}{\pgfpointpolar{-20}{.4cm}}}
    \pgfpathlineto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.4cm}{.225cm}}{\pgfpointpolar{20}{.4cm}}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% magic
\pgfdeclareshape{magic}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.225cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{-.3cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{-.3cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.425cm}}
    \pgfpatharc{405}{315}{.1cm}
    \pgfpathlineto{\pgfpoint{-.15cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{-.15cm}{-.05cm}}
    \pgfpatharc{180}{360}{.05cm}
    \pgfpathlineto{\pgfpoint{-.05cm}{0cm}}
    \pgfpatharc{180}{90}{.1cm}
    \pgfpathlineto{\pgfpoint{.05cm}{-.1cm}}
    \pgfpatharc{360}{315}{.125cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.225cm}{-.25cm}}
    \pgfpathlineto{\pgfpoint{-.325cm}{-.15cm}}
    \pgfpathmoveto{\pgfpoint{.2cm}{.2cm}}
    \pgfpatharc{180}{360}{.1cm}
    \pgfpatharc{0}{45}{.1cm}
    \pgfpatharc{225}{180}{.2cm}
    \pgfpathcircle{\pgfpoint{.3cm}{-.075cm}}{.075cm}
  }
}

% singlehanded
\pgfdeclareshape{singlehanded}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.25cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.025cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.325cm}{-.125cm}}
    \pgfpatharc{45}{135}{.1cm}
    \pgfpathlineto{\pgfpoint{0cm}{-.275cm}}
    \pgfpathlineto{\pgfpoint{-.15cm}{-.275cm}}
    \pgfpatharc{270}{90}{.05cm}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.175cm}}
    \pgfpatharc{270}{360}{.1cm}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.075cm}}
    \pgfpatharc{90}{135}{.125cm}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.25cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% doublehanded
\pgfdeclareshape{doublehanded}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.25cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.025cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.325cm}{-.125cm}}
    \pgfpatharc{45}{135}{.1cm}
    \pgfpathlineto{\pgfpoint{0cm}{-.275cm}}
    \pgfpathlineto{\pgfpoint{-.15cm}{-.275cm}}
    \pgfpatharc{270}{90}{.05cm}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.175cm}}
    \pgfpatharc{270}{360}{.1cm}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.075cm}}
    \pgfpatharc{90}{135}{.125cm}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.25cm}}
    \pgfpathmoveto{\pgfpoint{.25cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.025cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.325cm}{.125cm}}
    \pgfpatharc{225}{315}{.1cm}
    \pgfpathlineto{\pgfpoint{0cm}{.275cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{.275cm}}
    \pgfpatharc{450}{270}{.05cm}
    \pgfpathlineto{\pgfpoint{.1cm}{.175cm}}
    \pgfpatharc{90}{180}{.1cm}
    \pgfpathlineto{\pgfpoint{.2cm}{.075cm}}
    \pgfpatharc{270}{315}{.125cm}
    \pgfpathlineto{\pgfpoint{.425cm}{.25cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\NewDocumentCommand{\rpgiconsattack}{ m O{} }{%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every attack,
    rpg icons/every #1,
    actualtext={#1},
    baseline=\rpgicons@baseline,
    #2
  ] {
    \node[\rpgicons@shape@variant{#1}, draw, scale=.333] at (0cm,0cm) {};
    \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{attack}{\NewCommandCopy\attack\rpgiconsattack}{}

% CONDITIONS

% buff
\pgfdeclareshape{buff}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{-.225cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.3cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{-.3cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpatharc{45}{135}{.1cm}
    \pgfpathlineto{\pgfpoint{.1cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.15cm}}
    \pgfpatharc{270}{90}{.05cm}
    \pgfpathlineto{\pgfpoint{0cm}{-.05cm}}
    \pgfpatharc{270}{360}{.1cm}
    \pgfpathlineto{\pgfpoint{-.1cm}{.05cm}}
    \pgfpatharc{90}{135}{.125cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.25cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{-.15cm}{-.325cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.275cm}}
    \pgfpatharc{360}{180}{.125cm}
    \pgfpathclose
  }
}

% blinded
\pgfdeclareshape{blinded}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.225cm}}
    \pgfpatharc{90}{30}{.45cm}
    \pgfpatharc{330}{210}{.45cm}
    \pgfpatharc{150}{90}{.45cm}
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.15cm}
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.25cm}{-.25cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% charmed
\pgfdeclareshape{charmed}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.425cm}
    \pgfpathmoveto{\pgfpoint{-.175cm}{-.1cm}}
    \pgfpatharc{180}{360}{.175cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.175cm}{0cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm+.0625cm}{.15cm}}{\pgfpointpolar{-45}{.0635cm}}}
    \pgfpatharc{-45}{180}{.0625cm}
    \pgfpatharc{0}{225}{.0625cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.175cm}{0cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.175cm+.0625cm}{.15cm}}{\pgfpointpolar{-45}{.0635cm}}}
    \pgfpatharc{-45}{180}{.0625cm}
    \pgfpatharc{0}{225}{.0625cm}
    \pgfpathclose
  }
}

% deafened
\pgfdeclareshape{deafened}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.175cm}{-.275cm}}
    \pgfpatharc{180}{360}{.15cm}
    \pgfpathlineto{\pgfpoint{.125cm}{-.225cm}}
    \pgfpatharc{180}{135}{.25cm}
    \pgfpatharc{315}{360}{.25cm}
    \pgfpatharc{0}{180}{.275cm}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.1cm}}
    \pgfpatharc{-90}{90}{.075cm}
    \pgfpathlineto{\pgfpoint{-.15cm}{.125cm}}
    \pgfpatharc{180}{45}{.15cm}
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.2cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% exhausted
\pgfdeclareshape{exhausted}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.425cm}
    \pgfpathmoveto{\pgfpoint{-.175cm}{-.225cm}}
    \pgfpatharc{180}{0}{.175cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.275cm}{.15cm}}
    \pgfpatharc{180}{0}{-.1cm}
    \pgfpathmoveto{\pgfpoint{-.075cm}{.15cm}}
    \pgfpatharc{180}{0}{-.1cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% frightened
\pgfdeclareshape{frightened}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.425cm}
    \pgfpathmoveto{\pgfpoint{-.175cm}{-.225cm}}
    \pgfpatharc{180}{0}{.175cm}
    \pgfpathclose
    \pgfpathcircle{\pgfpoint{-.175cm}{.125cm}}{.075cm}
    \pgfpathcircle{\pgfpoint{.175cm}{.125cm}}{.075cm}
  }
}

% grappled
\pgfdeclareshape{grappled}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.25cm}{.3cm}}
    \pgfpatharc{90}{-90}{.075cm}
    \pgfpathlineto{\pgfpoint{-.35cm}{.15cm}}
    \pgfpatharc{270}{90}{.075cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.2cm}{.15cm}}
    \pgfpatharc{90}{-90}{.075cm}
    \pgfpathlineto{\pgfpoint{-.35cm}{0cm}}
    \pgfpatharc{270}{90}{.075cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.2cm}{0cm}}
    \pgfpatharc{90}{-90}{.075cm}
    \pgfpathlineto{\pgfpoint{-.35cm}{-.15cm}}
    \pgfpatharc{270}{90}{.075cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.2cm}{-.15cm}}
    \pgfpatharc{90}{-90}{.075cm}
    \pgfpathlineto{\pgfpoint{-.3cm}{-.3cm}}
    \pgfpatharc{270}{90}{.075cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.425cm}{.05cm}}
    \pgfpatharc{0}{90}{.25cm}
    \pgfpathlineto{\pgfpoint{-.05cm}{.3cm}}
    \pgfpatharc{180}{270}{.15cm}
    \pgfpathlineto{\pgfpoint{.175cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{.175cm}{-.425cm}}
    \pgfpathmoveto{\pgfpoint{.175cm}{-.275cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{-.275cm}}
    \pgfpathmoveto{\pgfpoint{.175cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{.175cm}{.425cm}}
    \pgfpathmoveto{\pgfpoint{-.3cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{-.3cm}{.425cm}}
    \pgfpathmoveto{\pgfpoint{-.3cm}{-.3cm}}
    \pgfpathlineto{\pgfpoint{-.3cm}{-.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% incapacitated
\pgfdeclareshape{incapacitated}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointpolar{30}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{30}{-.425cm}}
    \pgfpathmoveto{\pgfpointpolar{90}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{90}{-.425cm}}
    \pgfpathmoveto{\pgfpointpolar{150}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{150}{-.425cm}}
    \pgfpathmoveto{\pgfpointpolar{30}{.425cm}}
    \pgfpatharc{270}{210}{.425cm}
    \pgfpatharc{330}{270}{.425cm}
    \pgfpatharc{30}{-30}{.425cm}
    \pgfpatharc{90}{30}{.425cm}
    \pgfpatharc{150}{90}{.425cm}
    \pgfpatharc{210}{150}{.425cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpointpolar{30}{.25cm}}
    \pgfpatharc{270}{210}{.25cm}
    \pgfpatharc{330}{270}{.25cm}
    \pgfpatharc{30}{-30}{.25cm}
    \pgfpatharc{90}{30}{.25cm}
    \pgfpatharc{150}{90}{.25cm}
    \pgfpatharc{210}{150}{.25cm}
    \pgfpathclose
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% invisible
\pgfdeclareshape{invisible}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointpolar{-15}{.425cm}}
    \pgfpatharc{-15}{15}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{30}{.425cm}}
    \pgfpatharc{30}{60}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{75}{.425cm}}
    \pgfpatharc{75}{105}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{120}{.425cm}}
    \pgfpatharc{120}{150}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{165}{.425cm}}
    \pgfpatharc{165}{195}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{210}{.425cm}}
    \pgfpatharc{210}{240}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{255}{.425cm}}
    \pgfpatharc{255}{285}{.425cm}
    \pgfpathmoveto{\pgfpointpolar{300}{.425cm}}
    \pgfpatharc{300}{330}{.425cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% paralyzed
\pgfdeclareshape{paralyzed}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.425cm}
    \pgfpathmoveto{\pgfpoint{-.175cm}{-.225cm}}
    \pgfpatharc{180}{0}{.175cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.25cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{.05cm}}
    \pgfpathmoveto{\pgfpoint{.25cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{.2cm}}
    \pgfpathmoveto{\pgfpoint{-.25cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{.05cm}}
    \pgfpathmoveto{\pgfpoint{-.25cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{.2cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% petrified
\pgfdeclareshape{petrified}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointpolar{45}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{100}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{135}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{190}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{230}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{250}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{300}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{350}{.425cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpointpolar{135}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{130}{.35cm}}
    \pgfpathlineto{\pgfpoint{-.25cm}{.075cm}}
    \pgfpathlineto{\pgfpointpolar{220}{.2cm}}
    \pgfpathlineto{\pgfpointpolar{240}{.325cm}}
    \pgfpathmoveto{\pgfpointpolar{300}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{330}{.3cm}}
    \pgfpathlineto{\pgfpointpolar{350}{.225cm}}
    \pgfpathmoveto{\pgfpointpolar{45}{.425cm}}
    \pgfpathlineto{\pgfpointpolar{60}{.3cm}}
    \pgfpathlineto{\pgfpointpolar{130}{.35cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.175cm}}
    \pgfpathlineto{\pgfpoint{.075cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{-.2cm}}
    \pgfpathmoveto{\pgfpoint{-.25cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{.1cm}}
    \pgfpathmoveto{\pgfpoint{.25cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{.1cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% poisoned
\pgfdeclareshape{poisoned}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.425cm}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.125cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{.075cm}{-.125cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{-.2cm}}
    \pgfpathmoveto{\pgfpoint{.25cm}{.175cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.025cm}}
    \pgfpathmoveto{\pgfpoint{-.25cm}{.175cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{-.25cm}{.025cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% prone
\pgfdeclareshape{prone}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{.2cm}{-.125cm}}{.125cm}
    \pgfpathmoveto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.15cm}{0cm}}
    \pgfpatharc{90}{-90}{.125cm}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.25cm}}
    \pgfpathmoveto{\pgfpoint{.225cm}{.15cm}}
    \pgfpatharc{270}{360}{.1cm}
    \pgfpatharc{180}{270}{.1cm}
    \pgfpatharc{90}{180}{.1cm}
    \pgfpatharc{0}{90}{.1cm}
    \pgfpathmoveto{\pgfpoint{0cm}{.25cm}}
    \pgfpatharc{270}{360}{.1cm}
    \pgfpatharc{180}{270}{.1cm}
    \pgfpatharc{90}{180}{.1cm}
    \pgfpatharc{0}{90}{.1cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% restrained
\pgfdeclareshape{restrained}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.075cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{.225cm}}
    \pgfpatharc{90}{180}{.125cm}
    \pgfpathlineto{\pgfpoint{-.2cm}{0cm}}
    \pgfpatharc{270}{180}{.1cm}
    \pgfpathlineto{\pgfpoint{-.3cm}{.3cm}}
    \pgfpatharc{0}{90}{.125cm}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.075cm}}
    \pgfpatharc{180}{235}{.1cm}
    \pgfpathlineto{\pgfpoint{-.3cm}{-.225cm}}
    \pgfpathmoveto{\pgfpoint{.075cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{.075cm}{.225cm}}
    \pgfpatharc{90}{0}{.125cm}
    \pgfpathlineto{\pgfpoint{.2cm}{0cm}}
    \pgfpatharc{-90}{0}{.1cm}
    \pgfpathlineto{\pgfpoint{.3cm}{.3cm}}
    \pgfpatharc{180}{90}{.125cm}
    \pgfpathlineto{\pgfpoint{.425cm}{-.075cm}}
    \pgfpatharc{360}{330}{.1cm}
    \pgfpathlineto{\pgfpoint{.3cm}{-.225cm}}
    \pgfpathmoveto{\pgfpoint{.35cm}{-.225cm}}
    \pgfpatharc{90}{-90}{.05cm}
    \pgfpathlineto{\pgfpoint{-.35cm}{-.325cm}}
    \pgfpatharc{270}{90}{.05cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.35cm}{-.325cm}}
    \pgfpatharc{90}{-90}{.05cm}
    \pgfpathlineto{\pgfpoint{-.35cm}{-.425cm}}
    \pgfpatharc{270}{90}{.05cm}
    \pgfpathclose
  }
}

% restrained i
\pgfdeclareshape{restrained i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.35cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.35cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{-.425cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.075cm}{-.325cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.1cm}}{\pgfpointpolar{-60}{.075cm}}}
    \pgfpatharc{-60}{240}{.075cm}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.325cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.225cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.225cm}{.2cm}}
    \pgfpatharc{0}{180}{.225cm}
    \pgfpathlineto{\pgfpoint{-.225cm}{.1cm}}
    \pgfpathmoveto{\pgfpoint{.125cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{.2cm}}
    \pgfpatharc{0}{180}{.125cm}
    \pgfpathlineto{\pgfpoint{-.125cm}{.1cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% stunned
\pgfdeclareshape{stunned}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.425cm}
    \pgfpathellipse{\pgfpoint{0cm}{-.175cm}}{\pgfpoint{0cm}{.1cm}}{\pgfpoint{.175cm}{0cm}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{-.175cm}{.125cm}}{\pgfpointpolar{90}{.125cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm}{.125cm}}{\pgfpointpolar{126}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm}{.125cm}}{\pgfpointpolar{162}{.125cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm}{.125cm}}{\pgfpointpolar{198}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm}{.125cm}}{\pgfpointpolar{234}{.125cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm}{.125cm}}{\pgfpointpolar{270}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm}{.125cm}}{\pgfpointpolar{306}{.125cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm}{.125cm}}{\pgfpointpolar{342}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm}{.125cm}}{\pgfpointpolar{18}{.125cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm}{.125cm}}{\pgfpointpolar{54}{.05cm}}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{.175cm}{.125cm}}{\pgfpointpolar{90}{.125cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.175cm}{.125cm}}{\pgfpointpolar{126}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.175cm}{.125cm}}{\pgfpointpolar{162}{.125cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.175cm}{.125cm}}{\pgfpointpolar{198}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.175cm}{.125cm}}{\pgfpointpolar{234}{.125cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.175cm}{.125cm}}{\pgfpointpolar{270}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.175cm}{.125cm}}{\pgfpointpolar{306}{.125cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.175cm}{.125cm}}{\pgfpointpolar{342}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.175cm}{.125cm}}{\pgfpointpolar{18}{.125cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.175cm}{.125cm}}{\pgfpointpolar{54}{.05cm}}}
    \pgfpathclose
  }
}

% unconscious
\pgfdeclareshape{unconscious}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.15cm}}
    \pgfpatharc{90}{-30}{.425cm and .15cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.15cm}}
    \pgfpatharc{270}{150}{.425cm and .15cm}
    \pgfpathmoveto{\pgfpoint{-.35cm}{.15cm}}
    \pgfpatharc{270}{360}{.125cm}
    \pgfpatharc{180}{270}{.125cm}
    \pgfpatharc{90}{180}{.125cm}
    \pgfpatharc{0}{90}{.125cm}
    \pgfpathmoveto{\pgfpoint{.1cm}{-.15cm}}
    \pgfpatharc{270}{360}{.125cm}
    \pgfpatharc{180}{270}{.125cm}
    \pgfpatharc{90}{180}{.125cm}
    \pgfpatharc{0}{90}{.125cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% hearing
\pgfdeclareshape{hearing}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.175cm}{-.275cm}}
    \pgfpatharc{180}{360}{.15cm}
    \pgfpathlineto{\pgfpoint{.125cm}{-.225cm}}
    \pgfpatharc{180}{135}{.25cm}
    \pgfpatharc{315}{360}{.25cm}
    \pgfpatharc{0}{180}{.275cm}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.1cm}}
    \pgfpatharc{-90}{90}{.075cm}
    \pgfpathlineto{\pgfpoint{-.15cm}{.125cm}}
    \pgfpatharc{180}{45}{.15cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% seeing
\pgfdeclareshape{seeing}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.225cm}}
    \pgfpatharc{90}{30}{.45cm}
    \pgfpatharc{330}{210}{.45cm}
    \pgfpatharc{150}{90}{.45cm}
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.15cm}
  }
}

\NewDocumentCommand{\rpgiconscondition}{ m O{} }{%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every condition,
    rpg icons/every #1,
    actualtext={#1},
    baseline=\rpgicons@baseline,
    #2
  ] {
    \node[\rpgicons@shape@variant{#1}, draw, scale=.333] at (0cm,0cm) {};
    \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{condition}{\NewCommandCopy\condition\rpgiconscondition}{}

% CLASSES

% artificer
\pgfdeclareshape{artificer}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.05cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{.3cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{.3cm}}
    \pgfpathmoveto{\pgfpoint{-.1cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{.15cm}}
    \pgfsetcornersarced{\pgfpoint{.05cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{-.425cm}}
    \pgfsetcornersarced{\pgfpointorigin}
    \pgfpathlineto{\pgfpoint{.1cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{.3cm}}
    \pgfpathmoveto{\pgfpoint{-.125cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{-.25cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.25cm}}
    \pgfpathclose
  }
}

% artificer i
\pgfdeclareshape{artificer i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{-.075cm}{.15cm}}{\pgfpointpolar{350}{.275cm}}}
    \pgfpatharc{350}{acos(.275cm/.5cm)}{.275cm}
    \pgfpathlineto{\pgfpoint{.425cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{.375cm}{.05cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.075cm}{-.125cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.425cm}}
    \pgfpathmoveto{\pgfpoint{.275cm}{-.425cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.075cm}{.15cm}}{\pgfpointpolar{330}{.275cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.075cm}{.15cm}}{\pgfpointpolar{210}{.275cm}}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% barbarian
\pgfdeclareshape{barbarian}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.05cm}{-.375cm}}
    \pgfpatharc{360}{180}{.05cm}
    \pgfpathlineto{\pgfpoint{-.05cm}{.375cm}}
    \pgfpatharc{180}{0}{.05cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.05cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{.15cm}}
    \pgfpathmoveto{\pgfpoint{-.05cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{0cm}}
    \pgfpathmoveto{\pgfpoint{.05cm}{.2cm}}
    \pgfpatharc{270}{360}{.15cm}
    \pgfpatharc{90}{-90}{.225cm}
    \pgfpatharc{0}{90}{.15cm}
    \pgfpathmoveto{\pgfpoint{-.05cm}{.2cm}}
    \pgfpatharc{270}{180}{.15cm}
    \pgfpatharc{90}{270}{.225cm}
    \pgfpatharc{180}{90}{.15cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% bard
\pgfdeclareshape{bard}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{-.35cm}{.35cm}}{.075cm}
    \pgfpathmoveto{\pgfpoint{-.275cm}{.35cm}}
    \pgfpatharc{0}{-45}{sin(45)*.3cm and sin(45)*.45cm}
    \pgfpatharc{135}{180}{sin(45)*.3cm and sin(45)*.45cm}
    \pgfpathlineto{\pgfpoint{-.4cm}{-.2cm}}
    \pgfpatharc{180}{360}{.4cm and .225cm}
    \pgfpathlineto{\pgfpoint{.4cm}{-.1cm}}
    \pgfpatharc{0}{45}{sin(45)*.3cm and sin(45)*.45cm}
    \pgfpatharc{225}{180}{sin(45)*.3cm and sin(45)*.45cm}
    \pgfpathcircle{\pgfpoint{.35cm}{.35cm}}{.075cm}
    \pgfpathmoveto{\pgfpoint{-.275cm}{.35cm}}
    \pgfpathlineto{\pgfpoint{-.275cm}{-.15cm}}
    \pgfpatharc{180}{360}{.275cm and .1cm}
    \pgfpathlineto{\pgfpoint{.275cm}{.35cm}}
    \pgfpathmoveto{\pgfpoint{-.275cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{.275cm}{.2cm}}
    \pgfpathmoveto{\pgfpoint{-.125cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{-.125cm}{sqrt(1-(-.125cm/.275cm)^2)*-.1cm-.15cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.25cm}}
    \pgfpathmoveto{\pgfpoint{.125cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{sqrt(1-(.125cm/.275cm)^2)*-.1cm-.15cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% bard i
\pgfdeclareshape{bard i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.425cm}}
    \pgfpatharc{180}{90}{.85cm}
    \pgfpatharc{360}{270}{.45cm}
    \pgfpatharc{240}{270}{.35cm}
    \pgfpatharc{310}{280}{.85cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% cleric
\pgfdeclareshape{cleric}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.075cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{0cm}}
    \pgfarc{240}{-60}{.2cm and .225cm}
    \pgfpathlineto{\pgfpoint{.35cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.35cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{.075cm}{-.425cm}}
    \pgfpathclose
    \pgfpathellipse{\pgfpoint{0cm}{.2cm}}{\pgfpoint{-.075cm}{0cm}}{\pgfpoint{0cm}{-.125cm}}
  }
}

% cleric i
\pgfdeclareshape{cleric i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \foreach \x in {-1,0,1} {
      \pgfpathmoveto{\pgfpoint{\x*.325cm-.05cm}{-.05cm}}
      \pgfpathlineto{\pgfpoint{\x*.325cm-.05cm}{.175cm}}
      \pgfpathlineto{\pgfpoint{\x*.325cm+.05cm}{.175cm}}
      \pgfpathlineto{\pgfpoint{\x*.325cm+.05cm}{-.05cm}}
      \pgfpathmoveto{\pgfpoint{\x*.325cm-.05cm}{.3cm}}
      \pgfpatharc{180}{405}{.05cm}
      \pgfpatharc{215}{180}{.15cm}
      \pgfpathmoveto{\pgfpoint{\x*.325cm+.1cm}{-.05cm}}
      \pgfpatharc{360}{180}{.1cm}
      \pgfpathclose
    }
    \pgfpathmoveto{\pgfpoint{-.325cm}{-.15cm}}
    \pgfpatharc{180}{360}{.15cm and .1cm}
    \pgfpathmoveto{\pgfpoint{.325cm}{-.15cm}}
    \pgfpatharc{360}{180}{.15cm and .1cm}
    \pgfpathmoveto{\pgfpoint{0cm}{-.15cm}}
    \pgfpatharc{0}{-90}{.225cm}
    \pgfpathlineto{\pgfpoint{-.225cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.225cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.225cm}{-.375cm}}
    \pgfpatharc{270}{180}{.225cm}
    \pgfpathclose
  }
}

% cleric ii
\pgfdeclareshape{cleric ii}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.325cm}}
    \pgfpathlineto{\pgfpoint{-.15cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.325cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{.25cm}}
    \pgfpatharc{180}{405}{.075cm}
    \pgfpatharc{215}{180}{.225cm}
    \pgfpathmoveto{\pgfpoint{.225cm}{-.325cm}}
    \pgfpathlineto{\pgfpoint{-.375cm}{-.325cm}}
    \pgfpatharc{180}{270}{.1cm}
    \pgfpathlineto{\pgfpoint{.125cm}{-.425cm}}
    \pgfpatharc{270}{360}{.1cm}
    \pgfpatharc{180}{-90}{.1cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% druid
\pgfdeclareshape{druid}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{.1cm}{-.1cm}}{\pgfpointpolar{45}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.35cm}{-.35cm}}{\pgfpointpolar{45}{.05cm}}}
    \pgfpatharc{45}{-135}{.05cm}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.1cm}{-.1cm}}{\pgfpointpolar{-135}{.05cm}}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{.125cm}{-.075cm}}{\pgfpointpolar{-135}{.05cm}}}
    \pgfpatharc{315}{80}{.3cm}
    \pgfpathlineto{\pgfpointadd{\pgfpointadd{\pgfpoint{-.075cm}{.125cm}}{\pgfpointpolar{45}{.05cm}}}
        {\pgfpointpolar{90}{.2cm}}}
    \pgfpatharc{90}{315}{.2cm}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.125cm}{-.075cm}}{\pgfpointpolar{45}{.05cm}}}
    \pgfpathclose
  }
}

% druid i
\pgfdeclareshape{druid i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.375cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.375cm}{-.1cm}}
    \pgfpatharc{180}{270}{.225cm}
    \pgfpathlineto{\pgfpoint{-.175cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.175cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{-.325cm}}
    \pgfpatharc{270}{360}{.225cm}
    \pgfpathlineto{\pgfpoint{.375cm}{0cm}}
    \pgfpathmoveto{\pgfpoint{.375cm}{.1cm}}
    \pgfpatharc{90}{-90}{.05cm}
    \pgfpathlineto{\pgfpoint{-.375cm}{0cm}}
    \pgfpatharc{270}{90}{.05cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.225cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.325cm}}
    \pgfpathlineto{\pgfpoint{.325cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.025cm}{.1cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% druid ii
\pgfdeclareshape{druid ii}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.425cm}}
    \pgfpatharc{180}{120}{1cm and 0.75cm}
    \pgfpathmoveto{\pgfpoint{.425cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{.425cm}}
    \pgfpatharc{90}{330}{.5cm * tan(30)}
    \pgfpathclose
  }
}

% fighter
\pgfdeclareshape{fighter}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.05cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{.2cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.05cm}{.375cm}}
    \pgfpatharc{90}{0}{.275cm}
    \pgfpathlineto{\pgfpoint{.325cm}{-.25cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{-.15cm}}
    \pgfpatharc{180}{145}{.35cm}
    \pgfpathlineto{\pgfpoint{.2cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{.025cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{-.025cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{.1cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.5cm}{-.15cm}}{\pgfpointpolar{35}{.35cm}}}
    \pgfpatharc{35}{0}{.35cm}
    \pgfpathlineto{\pgfpoint{-.15cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.325cm}{-.25cm}}
    \pgfpathlineto{\pgfpoint{-.325cm}{.1cm}}
    \pgfpatharc{180}{90}{.275cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% gunslinger
\pgfdeclareshape{gunslinger}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.125cm}{-.125cm}}
    \pgfpatharc{90}{180}{.075cm}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.325cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.325cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.225cm}}
    \pgfpatharc{180}{90}{.3cm}
    \pgfpathlineto{\pgfpoint{-.125cm}{.075cm}}
    \pgfpathmoveto{\pgfpoint{-.125cm}{.225cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{.225cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{-.025cm}}
    \pgfpatharc{360}{270}{.125cm}
    \pgfpathlineto{\pgfpoint{-.125cm}{-.15cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.125cm}{.175cm}}
    \pgfpathlineto{\pgfpoint{-.175cm}{.175cm}}
    \pgfpatharc{270}{180}{.075cm}
    \pgfpathmoveto{\pgfpoint{.125cm}{.175cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.175cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.05cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{.05cm}}
    \pgfpathmoveto{\pgfpoint{.425cm}{.175cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.25cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% monk
\pgfdeclareshape{monk}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{-.125cm}{.425cm}}
    \pgfpatharc{45}{-45}{.1cm}
    \pgfpathlineto{\pgfpoint{-.275cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{-.275cm}{-.05cm}}
    \pgfpatharc{180}{360}{.05cm}
    \pgfpathlineto{\pgfpoint{-.175cm}{0cm}}
    \pgfpatharc{180}{90}{.1cm}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.1cm}}
    \pgfpatharc{0}{-45}{.125cm}
    \pgfpathlineto{\pgfpoint{-.35cm}{-.425cm}}
    \pgfpathmoveto{\pgfpoint{.425cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{.425cm}}
    \pgfpatharc{135}{215}{.1cm}
    \pgfpathlineto{\pgfpoint{.275cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.275cm}{-.05cm}}
    \pgfpatharc{360}{180}{.05cm}
    \pgfpathlineto{\pgfpoint{.175cm}{0cm}}
    \pgfpatharc{0}{90}{.1cm}
    \pgfpathlineto{\pgfpoint{.075cm}{-.1cm}}
    \pgfpatharc{180}{215}{.125cm}
    \pgfpathlineto{\pgfpoint{.35cm}{-.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% monk i
\pgfdeclareshape{monk i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.35cm}
    \pgftransformrotate{45}
    \pgfpathmoveto{
      \pgfpointpolar{
        180-acos(
          sqrt(
            .330625*(.0225/.1225-1)/
            (.0225-.330625)
          )
        )
      }{.35cm}
    }
    \pgfpatharc{
      180-acos(
        sqrt(
          .330625*(.0225/.1225-1)/
          (.0225-.330625)
        )*.35cm/.575cm
      )
    }{
      360+acos(
        sqrt(
          .330625*(.0225/.1225-1)/
          (.0225-.330625)
        )*.35cm/.575cm
      )
    }{.575cm and .15cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% paladin
\pgfdeclareshape{paladin}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{-.15cm}}{.275cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{60}{.275cm}}}
    \pgfpathlineto{\pgfpoint{.05cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{-.1cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{30}{.275cm}}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{-30}{.275cm}}}
    \pgfpathlineto{\pgfpoint{.15cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{-.3cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{-60}{.275cm}}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{120}{.275cm}}}
    \pgfpathlineto{\pgfpoint{-.05cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{-.15cm}{-.1cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{150}{.275cm}}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{210}{.275cm}}}
    \pgfpathlineto{\pgfpoint{-.15cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.3cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{240}{.275cm}}}
    \pgfpathcircle{\pgfpoint{0cm}{.2cm}}{.075cm}
    \pgfpathmoveto{\pgfpointintersectionofcircles{\pgfpoint{0cm}{.2cm}}{\pgfpoint{0cm}{.7cm}}
        {.075cm}{.5cm}{1}}
    \pgfpatharc{280}{325}{.5cm}
    \pgfpathmoveto{\pgfpointintersectionofcircles{\pgfpoint{0cm}{.2cm}}{\pgfpoint{0cm}{.7cm}}
        {.075cm}{.5cm}{2}}
    \pgfpatharc{260}{215}{.5cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% paladin i
\pgfdeclareshape{paladin i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.25cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.25cm}{.2cm}}
    \pgfpatharc{180}{360}{.25cm}
    \pgfpathlineto{\pgfpoint{.25cm}{.425cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.25cm}{.325cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.325cm}}
    \pgfpathmoveto{\pgfpoint{-.05cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.325cm}}
    \pgfpathmoveto{\pgfpoint{.05cm}{-.05cm}}
    \pgfpathlineto{\pgfpoint{.05cm}{-.325cm}}
    \pgfpathmoveto{\pgfpoint{-.2cm}{-.425cm}}
    \pgfpatharc{180}{90}{.1cm}
    \pgfpathlineto{\pgfpoint{.125cm}{-.325cm}}
    \pgfpatharc{90}{0}{.1cm}
    \pgfpathclose
  }
}

% psion
\pgfdeclareshape{psion}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.425cm}}
    \pgfpatharc{180}{90}{.15cm}
    \pgfpathlineto{\pgfpoint{.275cm}{-.275cm}}
    \pgfpatharc{90}{0}{.15cm}
    \pgfpathclose
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.025cm}}{\pgfpointpolar{270-acos(.3cm/.4cm)}{.4cm}}}
    \pgfpatharc{270-acos(.3cm/.4cm)}{acos(.3cm/.4cm)-90}{.4cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{.025cm}}{\pgfpointpolar{95}{.25cm}}}
    \pgfpatharc{95}{175}{.25cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% psion i
\pgfdeclareshape{psion i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.025cm}}
    \pgfpatharc{90}{30}{.45cm}
    \pgfpatharc{330}{210}{.45cm}
    \pgfpatharc{150}{90}{.45cm}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.175cm}}
    \pgfpatharc{180}{270}{.15cm}
    \pgfpatharc{270}{360}{.125cm}
    \pgfpatharc{0}{90}{.1cm}
    \pgfpatharc{90}{180}{.075cm}
    \pgfpatharc{180}{270}{.05cm}
    \pgfpatharc{270}{360}{.025cm}
    \pgfpathmoveto{\pgfpoint{0cm}{.175cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.425cm}}
    \pgfpathmoveto{\pgfpoint{.275cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.325cm}}
    \pgfpathmoveto{\pgfpoint{-.275cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{.325cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% ranger
\pgfdeclareshape{ranger}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.425cm}
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.325cm}
    \pgfpathmoveto{\pgfpointpolar{0}{.325cm}}
    \pgfpathlineto{\pgfpointpolar{0}{.225cm}}
    \pgfpathmoveto{\pgfpointpolar{90}{.325cm}}
    \pgfpathlineto{\pgfpointpolar{90}{.225cm}}
    \pgfpathmoveto{\pgfpointpolar{180}{.325cm}}
    \pgfpathlineto{\pgfpointpolar{180}{.225cm}}
    \pgfpathmoveto{\pgfpointpolar{270}{.325cm}}
    \pgfpathlineto{\pgfpointpolar{270}{.225cm}}
    \pgfpathmoveto{\pgfpointpolar{45}{.225cm}}
    \pgfpathlineto{\pgfpointpolar{135}{.1cm}}
    \pgfpathlineto{\pgfpointpolar{225}{.225cm}}
    \pgfpathlineto{\pgfpointpolar{315}{.1cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpointpolar{135}{.1cm}}
    \pgfpathlineto{\pgfpointpolar{315}{.1cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% ranger i
\pgfdeclareshape{ranger i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{.325cm}}
    \pgfpathlineto{\pgfpoint{-.275cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.175cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.425cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.2cm}{-.2cm}}
    \pgfpathlineto{\pgfpoint{.3cm}{-.3cm}}
    \pgfpathmoveto{\pgfpoint{.2cm}{-.3cm}}
    \pgfpathlineto{\pgfpoint{.3cm}{-.2cm}}
    \pgfpathmoveto{\pgfpoint{.125cm}{-.125cm}}
    \pgfpatharc{45}{90}{.325cm}
    \pgfpatharc{270}{150}{.2cm}
    \pgfpathmoveto{\pgfpoint{-.1cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{.1cm}{.15cm}}
    \pgfpathmoveto{\pgfpoint{.05cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{.2cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.1cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% rogue
\pgfdeclareshape{rogue}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{.15cm}{.15cm}}{\pgfpointpolar{-45}{.05cm}}}
    \pgfpatharc{135}{405}{.125cm}
    \pgfpatharc{-45}{135}{.175cm}
    \pgfpatharc{45}{315}{.125cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{-.275cm}{-.275cm}}{\pgfpointpolar{315}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.175cm}{-.375cm}}{\pgfpointpolar{315}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{0cm}{-.2cm}}{\pgfpointpolar{315}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.1cm}{-.1cm}}{\pgfpointpolar{315}{.05cm}}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{.2cm}{.2cm}}{\pgfpointpolar{135}{.05cm}}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.325cm}{-.325cm}}{\pgfpointpolar{135}{.05cm}}}
    \pgfpatharc{135}{315}{.05cm}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.2cm}{.2cm}}{\pgfpointpolar{315}{.05cm}}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% rogue i
\pgfdeclareshape{rogue i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.225cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.025cm}}
    \pgfpathlineto{\pgfpoint{.325cm}{-.025cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{.375cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{.3cm}{.025cm}}
    \pgfpathlineto{\pgfpoint{-.05cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{.325cm}}
    \pgfpathmoveto{\pgfpoint{-.075cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{-.325cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.025cm}}
    \pgfpathlineto{\pgfpoint{-.175cm}{.1cm}}
    \pgfpathmoveto{\pgfpoint{0cm}{-.125cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathmoveto{\pgfpoint{-.225cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.25cm}}
    \pgfpathlineto{\pgfpoint{.225cm}{-.425cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% sorcerer
\pgfdeclareshape{sorcerer}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.25cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.025cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.325cm}{-.125cm}}
    \pgfpatharc{45}{135}{.1cm}
    \pgfpathlineto{\pgfpoint{0cm}{-.275cm}}
    \pgfpathlineto{\pgfpoint{-.15cm}{-.275cm}}
    \pgfpatharc{270}{90}{.05cm}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.175cm}}
    \pgfpatharc{270}{360}{.1cm}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.075cm}}
    \pgfpatharc{90}{135}{.125cm}
    \pgfpathlineto{\pgfpoint{-.425cm}{-.25cm}}
    \pgfpathmoveto{\pgfpoint{-.125cm}{.175cm}}
    \pgfpatharc{180}{360}{.125cm}
    \pgfpatharc{0}{45}{.125cm}
    \pgfpatharc{225}{180}{.225cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% sorcerer i
\pgfdeclareshape{sorcerer i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.325cm}{.4cm}}
    \pgfpathlineto{\pgfpoint{-.375cm}{.4cm}}
    \pgfpatharc{90}{270}{.05cm}
    \pgfpathlineto{\pgfpoint{-.325cm}{.3cm}}
    \pgfpathmoveto{\pgfpoint{.3cm}{.4cm}}
    \pgfpathlineto{\pgfpoint{.35cm}{.4cm}}
    \pgfpatharc{90}{-90}{.05cm}
    \pgfpathlineto{\pgfpoint{.3cm}{.3cm}}
    \pgfpathrectanglecorners{\pgfpoint{-.325cm}{.425cm}}{\pgfpoint{.3cm}{.275cm}}
    \pgfpathmoveto{\pgfpoint{.275cm}{.275cm}}
    \pgfpathlineto{\pgfpoint{.275cm}{-.325cm}}
    \pgfpathlineto{\pgfpoint{-.1cm}{-.325cm}}
    \pgfpatharc{360}{180}{.1cm}
    \pgfpathlineto{\pgfpoint{-.3cm}{.275cm}}
    \pgfpathmoveto{\pgfpoint{-.2cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.325cm}{-.425cm}}
    \pgfpatharc{270}{360}{.1cm}
    \pgfpathlineto{\pgfpoint{.275cm}{-.325cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{.125cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{.125cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{0cm}}
    \pgfpathlineto{\pgfpoint{0cm}{0cm}}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.125cm}}
    \pgfpathlineto{\pgfpoint{.125cm}{-.125cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% warlock
\pgfdeclareshape{warlock}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpointpolar{150}{.4cm}}
    \pgfpatharc{150}{30}{.4cm}
    \pgfpatharc{-30}{-150}{.4cm}
    \pgfpathclose
    \pgfpathcircle{\pgfpoint{0cm}{.2cm}}{.1cm}
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.425cm}}
    \pgfpatharc{180}{150}{.75cm}
    \pgfpathmoveto{\pgfpoint{.425cm}{-.425cm}}
    \pgfpatharc{0}{30}{.75cm}
    \pgfpathcircle{\pgfpoint{0cm}{-.175cm}}{.075cm}
    \pgfpathmoveto{\pgfpoint{-.15cm}{-.425cm}}
    \pgfpatharc{180}{90}{.075cm}
    \pgfpathlineto{\pgfpoint{.075cm}{-.35cm}}
    \pgfpatharc{90}{0}{.075cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% wizard
\pgfdeclareshape{wizard}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.4cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.3cm}{-.425cm}}
    \pgfpatharc{270}{90}{.1cm}
    \pgfpathlineto{\pgfpoint{.4cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{.4cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.3cm}{.425cm}}
    \pgfpatharc{90}{180}{.1cm}
    \pgfpathlineto{\pgfpoint{-.4cm}{-.325cm}}
    \pgfpathmoveto{\pgfpoint{-.25cm}{-.325cm}}
    \pgfpathlineto{\pgfpoint{.35cm}{-.325cm}}
    \pgfpathmoveto{\pgfpoint{-.2cm}{.325cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{-.125cm}}
    \pgfpathmoveto{\pgfpoint{.2cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.4cm}{.225cm}}
    \pgfpathmoveto{\pgfpoint{.2cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{.4cm}{-.025cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% wizard i
\pgfdeclareshape{wizard i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.375cm}}
    \pgfpathlineto{\pgfpoint{-.375cm}{-.425cm}}
    \pgfpathlineto{
      \pgfpointadd{
        \pgfpoint{.125cm}{.125cm}
      }{
        \pgfpointpolar{-atan2(sqrt(.25cm+.3025cm),.1cm)}{.1cm}
      }
    }
    \pgfpatharc{-atan2(sqrt(.25cm+.3025cm),.1cm)}{90+atan2(sqrt(.3025cm+.25cm),.1cm)}{.1cm}
    \pgfpathclose
    \foreach \a in {-65,-10,...,180}{
      \pgfpathmoveto{
        \pgfpointadd{\pgfpoint{.125cm}{.125cm}}{\pgfpointpolar{\a}{.225cm}}
      }
      \pgfpathlineto{
        \pgfpointadd{\pgfpoint{.125cm}{.125cm}}{\pgfpointpolar{\a}{.3cm}}
      }
    }
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\NewDocumentCommand{\rpgiconsclass}{ O{positive} m O{} }{%
  \edef\rpgicons@classiconposneg{#1}%
  \edef\rpgicons@classiconpos{positive}%
  \ifx\rpgicons@classiconposneg\rpgicons@classiconpos%
    \def\rpgicons@classiconfg{fgneg}\else%
    \def\rpgicons@classiconfg{fgpos}\fi%
  \ifx\rpgicons@classiconposneg\rpgicons@classiconpos%
    \def\rpgicons@classiconbg{bgneg}\else%
    \def\rpgicons@classiconbg{bgpos}\fi%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every class,
    rpg icons/every #2,
    actualtext={#2},
    baseline=\rpgicons@baseline,
    fgpos/.style={draw=rpgicons@bg, line width=.6pt},
    fgneg/.style={draw},
    bgpos/.style={fill},
    bgneg/.style={draw},
    #3
  ] {
    \path[scale=.333, \rpgicons@classiconbg] (-.45cm,-.45cm) rectangle (.45cm,.45cm);
    \node[\rpgicons@shape@variant{#2}, \rpgicons@classiconfg, scale=.225] at (0cm,0cm) {};
    \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{class}{\NewCommandCopy\class\rpgiconsclass}{}

% ALIGNMENT

% lawful good
\pgfdeclareshape{lawful good}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.4cm}{-.1cm}}
    \pgfpathlineto{\pgfpoint{-.4cm}{-.1cm}}
    \pgfpathmoveto{\pgfpoint{.4cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.4cm}}
    \pgfpathlineto{\pgfpoint{-.4cm}{.15cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% neutral good
\pgfdeclareshape{neutral good}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{-.1cm}}{.2cm}
    \pgfpathmoveto{\pgfpoint{.4cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.4cm}}
    \pgfpathlineto{\pgfpoint{-.4cm}{.15cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% chaotic good
\pgfdeclareshape{chaotic good}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.4cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.4cm}}
    \pgfpathmoveto{\pgfpoint{.4cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.4cm}}
    \pgfpathlineto{\pgfpoint{-.4cm}{.15cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% lawful neutral
\pgfdeclareshape{lawful neutral}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.2cm}
    \pgfpathmoveto{\pgfpoint{.4cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.4cm}{0cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% true neutral
\pgfdeclareshape{true neutral}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.2cm}
  }
}

% chaotic neutral
\pgfdeclareshape{chaotic neutral}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.2cm}
    \pgfpathmoveto{\pgfpoint{0cm}{.4cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.4cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% lawful evil
\pgfdeclareshape{lawful evil}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.4cm}{.1cm}}
    \pgfpathlineto{\pgfpoint{-.4cm}{.1cm}}
    \pgfpathmoveto{\pgfpoint{.4cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.4cm}}
    \pgfpathlineto{\pgfpoint{-.4cm}{-.15cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% neutral evil
\pgfdeclareshape{neutral evil}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{.1cm}}{.2cm}
    \pgfpathmoveto{\pgfpoint{.4cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.4cm}}
    \pgfpathlineto{\pgfpoint{-.4cm}{-.15cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% chaotic evil
\pgfdeclareshape{chaotic evil}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.4cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.4cm}}
    \pgfpathmoveto{\pgfpoint{.4cm}{-.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.4cm}}
    \pgfpathlineto{\pgfpoint{-.4cm}{-.15cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\NewDocumentCommand{\rpgiconsalignment}{ O{positive} m O{} }{%
  \edef\rpgicons@alignmenticonposneg{#1}%
  \edef\rpgicons@alignmenticonpos{positive}%
  \ifx\rpgicons@alignmenticonposneg\rpgicons@alignmenticonpos%
    \def\rpgicons@alignmenticonfg{fgneg}\else%
    \def\rpgicons@alignmenticonfg{fgpos}\fi%
  \ifx\rpgicons@alignmenticonposneg\rpgicons@alignmenticonpos%
    \def\rpgicons@alignmenticonbg{bgneg}\else%
    \def\rpgicons@alignmenticonbg{bgpos}\fi%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every alignment,
    rpg icons/every #2,
    actualtext={#2},
    baseline=\rpgicons@baseline,
    fgpos/.style={draw=rpgicons@bg, line width=.6pt},
    fgneg/.style={draw},
    bgpos/.style={fill},
    bgneg/.style={draw},
    #3
  ] {
    \path[scale=.333, \rpgicons@alignmenticonbg] (30:.525cm)
      -- (90:.525cm) -- (150:.525cm) -- (210:.525cm) -- (270:.525cm) -- (330:.525cm) -- cycle;
    \node[\rpgicons@shape@variant{#2}, \rpgicons@alignmenticonfg, scale=.225] at (0cm,0cm) {};
    \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{alignment}{\NewCommandCopy\alignment\rpgiconsalignment}{}

% CURRENCY

% copper
\pgfdeclareshape{copper}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.375cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{-.375cm}{.225cm}}
    \pgfpathlineto{\pgfpoint{-.225cm}{.375cm}}
    \pgfpathlineto{\pgfpoint{.225cm}{.375cm}}
    \pgfpathlineto{\pgfpoint{.375cm}{.225cm}}
    \pgfpathlineto{\pgfpoint{.375cm}{-.225cm}}
    \pgfpathlineto{\pgfpoint{.225cm}{-.375cm}}
    \pgfpathlineto{\pgfpoint{-.225cm}{-.375cm}}
    \pgfpathclose
    \pgfpathcircle{\pgfpoint{0cm}{0cm}}{.075cm}
  }
}

% silver
\pgfdeclareshape{silver}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{0cm}{.35cm}}
    \pgfpathlineto{\pgfpoint{.433cm}{-.4cm}}
    \pgfpathlineto{\pgfpoint{-.433cm}{-.4cm}}
    \pgfpathclose
    \pgfpathcircle{\pgfpoint{0cm}{-.15cm}}{.075cm}
  }
}

% gold
\pgfdeclareshape{gold}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.375cm}{-.375cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{-.5375cm}{0cm}}{\pgfpointpolar{-60}{.325cm}}}
    \pgfpatharc{-60}{60}{.325cm}
    \pgfpathlineto{\pgfpoint{-.375cm}{.375cm}}
    \pgfpathlineto{\pgfpoint{.375cm}{.375cm}}
    \pgfpathlineto{\pgfpointadd{\pgfpoint{.5375cm}{0cm}}{\pgfpointpolar{120}{.325cm}}}
    \pgfpatharc{120}{240}{.325cm}
    \pgfpathlineto{\pgfpoint{.375cm}{-.375cm}}
    \pgfpathclose
  }
}

% electrum
\pgfdeclareshape{electrum}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.225cm}{-.325cm}}
    \pgfpatharc{240}{120}{.375cm}
    \pgfpathlineto{\pgfpoint{.225cm}{.325cm}}
    \pgfpatharc{60}{-60}{.375cm}
    \pgfpathclose
    \pgfpathcircle{\pgfpoint{0cm}{-.125cm}}{.075cm}
  }
}

% platinum
\pgfdeclareshape{platinum}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.075cm}{.4cm}}
    \pgfpathlineto{\pgfpoint{.35cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{.35cm}{-.075cm}}
    \pgfpathlineto{\pgfpoint{.075cm}{-.4cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{-.4cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{-.075cm}}
    \pgfpathlineto{\pgfpoint{-.35cm}{.075cm}}
    \pgfpathlineto{\pgfpoint{-.075cm}{.4cm}}
    \pgfpathclose
  }
}

% gem
\pgfdeclareshape{gem}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.25cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{.15cm}}
    \pgfpathclose
    \pgfpathmoveto{\pgfpoint{-.425cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.15cm}}
    \pgfpathmoveto{\pgfpoint{-.25cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.425cm}}
    \pgfpathmoveto{\pgfpoint{-.2cm}{.15cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{.15cm}}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

% jewellery
\pgfdeclareshape{jewellery}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathellipse{\pgfpoint{0cm}{-.15cm}}{\pgfpoint{.175cm}{0cm}}{\pgfpoint{0cm}{.275cm}}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.15cm}}{\pgfpointpolar{0}{.075cm and .175cm}}}
    \pgfpatharc{0}{-60}{.075cm and .175cm}
    \pgfpathcircle{\pgfpoint{0cm}{.2cm}}{.075cm}
    \pgfpathmoveto{\pgfpointintersectionofcircles{\pgfpoint{0cm}{.2cm}}{\pgfpoint{0cm}{.7cm}}
      {.075cm}{.5cm}{1}}
    \pgfpatharc{280}{325}{.5cm}
    \pgfpathmoveto{\pgfpointintersectionofcircles{\pgfpoint{0cm}{.2cm}}{\pgfpoint{0cm}{.7cm}}
      {.075cm}{.5cm}{2}}
    \pgfpatharc{260}{215}{.5cm}
    \pgfsetarrowsstart{}
    \pgfsetarrowsend{}
  }
}

\pgfdeclareshape{jewelry}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={jewellery}]
}

% jewellery i
\pgfdeclareshape{jewellery i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathcircle{\pgfpoint{0cm}{-.075cm}}{.225cm}
    \pgfpathmoveto{\pgfpointadd{\pgfpoint{0cm}{-.075cm}}{\pgfpointpolar{120}{.35cm}}}
    \pgfpatharc{120}{420}{.35cm}
    \pgfpathmoveto{\pgfpoint{0cm}{.225cm}}
    \pgfpathlineto{\pgfpoint{.2cm}{.35cm}}
    \pgfpathlineto{\pgfpoint{.15cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.15cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.2cm}{.35cm}}
    \pgfpathclose
  }
}

\pgfdeclareshape{jewelry i}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \inheritbackgroundpath[from={jewellery i}]
}

\NewDocumentCommand{\rpgiconscurrency}{ m O{} m }{%
  \rpgicons@ifEmptyF{#3}{#3\,}%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every currency,
    rpg icons/every #1,
    actualtext={#1},
    baseline=\rpgicons@baseline,
    #2
  ] {
    \node[\rpgicons@shape@variant{#1}, draw, scale=.333] at (0cm,0cm) {};
    \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{currency}{\NewCommandCopy\currency\rpgiconscurrency}{}

% MOVEMENT

% upward
\pgfdeclareshape{upward}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.25cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.25cm}{0cm}}
    \pgfpathclose
  }
}

% downward
\pgfdeclareshape{downward}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.25cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.25cm}{0cm}}
    \pgfpathclose
  }
}

% leftward
\pgfdeclareshape{leftward}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{.425cm}{-.25cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.25cm}}
    \pgfpathclose
  }
}

% rightward
\pgfdeclareshape{rightward}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.425cm}{-.25cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.25cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.425cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.425cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.25cm}}
    \pgfpathclose
  }
}

% forward
\pgfdeclareshape{forward}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.325cm}{-.3cm}}
    \pgfpathlineto{\pgfpoint{.325cm}{-.3cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{0cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.25cm}{0cm}}
    \pgfpathclose
  }
}

% backward
\pgfdeclareshape{backward}{
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

  \backgroundpath{
    \pgfpathmoveto{\pgfpoint{-.175cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{.175cm}{.3cm}}
    \pgfpathlineto{\pgfpoint{.25cm}{0cm}}
    \pgfpathlineto{\pgfpoint{.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{0cm}{-.3cm}}
    \pgfpathlineto{\pgfpoint{-.425cm}{0cm}}
    \pgfpathlineto{\pgfpoint{-.25cm}{0cm}}
    \pgfpathclose
  }
}

\NewDocumentCommand{\rpgiconsmovement}{ O{normal} m O{} m }{%
  \edef\rpgicons@movementiconnrmlrg{#1}%
  \edef\rpgicons@movementiconlrg{large}%
  \ifx\rpgicons@movementiconnrmlrg\rpgicons@movementiconlrg%
    \def\rpgicons@movementiconfg{fglrg}\else%
    \def\rpgicons@movementiconfg{fgnrm}\fi%
  \ifx\rpgicons@movementiconnrmlrg\rpgicons@movementiconlrg%
    \rpgicons@ifEmptyTF{#4}{%
      \def\rpgicons@movementactualtext{#2}%
    }{%
      \def\rpgicons@movementactualtext{#4 #2}%
    }%
  \else%
    \def\rpgicons@movementactualtext{#2}%
    \rpgicons@ifEmptyF{#4}{#4\,}%
  \fi%
  \hspace{\rpgicons@beforesep}%
  \tikz[
    rpg icons,
    rpg icons/every movement,
    rpg icons/every #2,
    actualtext=\rpgicons@movementactualtext,
    baseline=\rpgicons@baseline,
    fgnrm/.style={scale=.333},
    fglrg/.style={scale=.675},
    #3
  ] {
    \node[
      \rpgicons@shape@variant{#2},
      draw,
      \rpgicons@movementiconfg,
      font={\footnotesize}
    ] at (0cm,0cm)
      {\ifx\rpgicons@movementiconnrmlrg\rpgicons@movementiconlrg\textbf{#4}\fi};
    \path[draw=none, \rpgicons@movementiconfg] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
  }%
  \hspace{\rpgicons@aftersep}%
}
\@ifundefined{movement}{\NewCommandCopy\movement\rpgiconsmovement}{}

% make tikz icons available as pics
\ifrpgicons@pics

\tikzset{
  rpg icons/create pic from shape/.code={%
    \tikzset{
      rpg icons #1/.pic={
        \begin{scope}[every node/.append style={#1}, rpg icons/every #1]
          \node[draw, scale=.333] at (0cm,0cm) (-node) {};
          \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
        \end{scope}
      },
    }%
  },
  rpg icons/create pic from ability shape/.code={%
    \tikzset{
      rpg icons #1 ability/.pic={
        \begin{scope}[every node/.append style={#1}, rpg icons/every ability, rpg icons/every #1]
          \path[draw, scale=.333, pic actions] (0cm,0cm) circle[radius=.45cm];
          \node[draw, scale=.225] at (0cm,0cm) (-node) {};
          \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
        \end{scope}
      }
    }%
  },
  rpg icons/create pic from saving shape/.code={%
    \tikzset{
      rpg icons #1 saving/.pic={
        \begin{scope}[every node/.append style={#1}, rpg icons/every saving, rpg icons/every #1]
          \path[draw, scale=.333, pic actions] (-.45cm,.45cm) -- (.45cm,.45cm) -- (.45cm,-.05cm)
            arc[start angle=360, end angle=180, radius=.45cm] -- cycle;
          \node[draw, scale=.225] at (0cm,0cm) (-node) {};
          \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
        \end{scope}
      }
    }%
  },
  rpg icons/create pic from spellschool shape/.code={%
    \tikzset{
      rpg icons #1 spellschool/.pic={
        \begin{scope}[every node/.append style={#1}, rpg icons/every spellschool, rpg icons/every #1]
          \path[draw, scale=.333, pic actions] (-.475cm,.35cm)
            -- (-.35cm,.475cm) -- (.35cm,.475cm) -- (.475cm,.35cm) -- (.425cm,-.375cm) -- (0cm,-.475cm) -- (-.425cm,-.375cm) -- cycle;
          \node[draw, scale=.225] at (0cm,0cm) (-node) {};
          \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
        \end{scope}
      }
    }%
  },
  rpg icons/create pic from damage shape/.code={
    \tikzset{
      rpg icons #1 damage/.pic={
        \begin{scope}[every node/.append style={#1}, rpg icons/every damage, rpg icons/every #1]
          \path[draw, scale=.333, pic actions] (0cm,0cm) circle[radius=.5cm];
          \node[draw, scale=.225] at (0cm,0cm) (-node) {};
          \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
        \end{scope}
      }
    }
  },
  rpg icons/create pic from class shape/.code={
    \tikzset{
      rpg icons #1 class/.pic={
        \begin{scope}[every node/.append style={#1}, rpg icons/every class, rpg icons/every #1]
          \path[draw, scale=.333, pic actions] (-.45cm,-.45cm) rectangle (.45cm,.45cm);
          \node[draw, scale=.225] at (0cm,0cm) (-node) {};
          \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
        \end{scope}
      }
    }
  },
  rpg icons/create pic from alignment shape/.code={
    \tikzset{
      rpg icons #1 alignment/.pic={
        \begin{scope}[every node/.append style={#1}, rpg icons/every alignment, rpg icons/every #1]
          \path[draw, scale=.333, pic actions] (30:.475cm)
            -- (90:.475cm) -- (150:.475cm) -- (210:.475cm) -- (270:.475cm) -- (330:.475cm) -- cycle;
          \node[draw, scale=.225] at (0cm,0cm) (-node) {};
          \path[draw=none, scale=.333] ([yshift=-1pt].425cm,.425cm) rectangle ([yshift=1pt]-.425cm,-.425cm);
        \end{scope}
      }
    }
  },
  rpg icons/create pic from shape/.list/.expanded={%
    \rpgicons@allshapes%
  },
  rpg icons/create pic from ability shape/.list={%
    strength, dexterity, dexterity i, constitution, intelligence, wisdom, wisdom i, charisma,
    resilience, sanity, perception, luck, armour, armor, proficiency,
    % === backward compatibility
    dexterity alt, wisdom alt%
    % ===
  },
  rpg icons/create pic from saving shape/.list={%
    strength, dexterity, dexterity i, constitution, intelligence, wisdom, wisdom i, charisma,
    resilience, sanity, perception, luck, armour, armor, proficiency,
    % === backward compatibility
    dexterity alt, wisdom alt%
    % ===
  },
  rpg icons/create pic from spellschool shape/.list={%
    abjuration, conjuration, divination, enchantment, evocation, illusion, necromancy, transmutation%
  },
  rpg icons/create pic from damage shape/.list={%
    acid, bludgeoning, cold, fire, force, lightning, necrotic, necrotic i, piercing, poison, psychic,
    radiant, slashing, thunder, healing,
    % === backward compatibility
    necrotic alt%
    % ===
  },
  rpg icons/create pic from class shape/.list={%
    artificer, artificer i, barbarian, bard, cleric, cleric i, cleric ii, druid, druid i, druid ii, fighter, gunslinger,
    monk, monk i, paladin, paladin i, psion, psion i, ranger, ranger i, rogue, rogue i, sorcerer, sorcerer i, warlock, wizard, wizard i,
    % === backward compatibility
    artificer alt, cleric alt, druid alt, monk alt, paladin alt, psion alt, ranger alt, rogue alt, sorcerer alt, wizard alt%
    % ===
  },
  rpg icons/create pic from alignment shape/.list={%
    lawful good, neutral good, chaotic good, lawful neutral, true neutral,
    chaotic neutral, lawful evil, neutral evil, chaotic evil%
  }
}

\fi

% ROLL SYNTAX

\ExplSyntaxOn

\msg_if_exist:nnF { rpgicons } { tagging-unsupported } {
  \msg_new:nnn { rpgicons } { tagging-unsupported } {
    This ~ LaTeX ~ version ~ does ~ not ~ support ~ tagging.
  }
}

\cs_if_exist:NTF \NewTaggingSocket {
  \cs_generate_variant:Nn \tag_socket_use:nn { nV }

  \IfSocketExistsF { tagsupport/rpgicons/roll/before } {
    \NewTaggingSocket { rpgicons/roll/before } { 1 }
    \NewTaggingSocketPlug { rpgicons/roll/before } { actualtext } {
      \tag_mc_end_push:
      \tag_struct_begin:n {
        tag = Span ,
        actualtext = { ~ #1 ~ }
      }
      \tag_mc_begin:n { }
    }
    \AssignTaggingSocketPlug { rpgicons/roll/before } { actualtext }
  }

  \IfSocketExistsF { tagsupport/rpgicons/roll/after } {
    \NewTaggingSocket { rpgicons/roll/after } { 0 }
    \NewTaggingSocketPlug { rpgicons/roll/after } { actualtext } {
      \tag_mc_end:
      \tag_struct_end:
      \tag_mc_begin_pop:n { }
    }
    \AssignTaggingSocketPlug { rpgicons/roll/after } { actualtext }
  }
} {
  \msg_warning:nn { rpgicons } { tagging-unsupported }
  \cs_if_exist:NF \tag_socket_use:n {
    \cs_new:Npn \tag_socket_use:n #1 { }
  }
  \cs_if_exist:NF \tag_socket_use:nn {
    \cs_new:Npn \tag_socket_use:nn #1#2 { }
  }
  \cs_if_exist:NF \tag_suspend:n {
    \cs_new:Npn \tag_suspend:n #1 { }
  }
  \cs_if_exist:NF \tag_resume:n {
    \cs_new:Npn \tag_resume:n #1 { }
  }
}

\cs_if_exist:NF \__rpgicons_roll_syntax_parse:n {

  \bool_new:N \l__rpgicons_unicode_mode_bool
  \sys_if_engine_luatex:T {
    \bool_set_true:N \l__rpgicons_unicode_mode_bool
  }
  \sys_if_engine_xetex:T {
    \bool_set_true:N \l__rpgicons_unicode_mode_bool
  }

  \regex_new:N \l__rpgicons_roll_syntax_die_regex
  \cs_generate_variant:Nn \regex_set:Nn { Ne }
  \cs_new_protected:Npn \__rpgicons_roll_syntax_die_set:n #1 {
    \regex_set:Ne \l__rpgicons_roll_syntax_die_regex { [ \clist_use:nn {#1} { } ] }
  }

  \cs_new:Npn \__rpgicons_roll_syntax_convert:n #1 {
    \str_case:nnF {#1} {
      { 2 } { twoside }
      { 4 } { fourside }
      { 6 } { sixside }
      { 8 } { eightside }
      { 10 } { tenside }
      { 12 } { twelveside }
      { 20 } { twentyside }
      { 100 } { hundredside }
      { F } { fudge }
    }
    {#1}
  }

  \seq_new:N \l__rpgicons_roll_syntax_seq
  \tl_new:N \l__rpgicons_roll_syntax_part_tl
  \regex_new:N \l__rpgicons_roll_syntax_split_regex
  \regex_new:N \l__rpgicons_roll_syntax_plusminus_regex
  \regex_new:N \l__rpgicons_roll_syntax_times_regex
  \bool_if:NTF \l__rpgicons_unicode_mode_bool {
    \regex_set:Nn \l__rpgicons_roll_syntax_split_regex { \s* ([ \+ \- \x{ 2212 } x \* \x{ 00D7 } ]) \s* }
    \regex_set:Nn \l__rpgicons_roll_syntax_plusminus_regex { \A ([ \+ \- \x{ 2212 } ]) \Z }
    \regex_set:Nn \l__rpgicons_roll_syntax_times_regex { \A ([ x \* \x{ 00D7 } ]) \Z }
  } {
    \regex_set:Nn \l__rpgicons_roll_syntax_split_regex { \s* ([ \+ \- x \* \x{ 00D7 } ]) \s* }
    \regex_set:Nn \l__rpgicons_roll_syntax_plusminus_regex { \A ([ \+ \- ]) \Z }
    \regex_set:Nn \l__rpgicons_roll_syntax_times_regex { \A ([ x \* \x{ 00D7 } ]) \Z }
  }
  \regex_new:N \l__rpgicons_roll_syntax_dice_regex
  \cs_new_protected:Npn \__rpgicons_roll_syntax_parse:n #1 {
    \regex_set:Nn \l__rpgicons_roll_syntax_dice_regex { \A (\d*) \ur{ l__rpgicons_roll_syntax_die_regex } ([ F \d ]+) \Z }
    \regex_split:NnN \l__rpgicons_roll_syntax_split_regex {#1} \l__rpgicons_roll_syntax_seq
    \seq_map_inline:Nn \l__rpgicons_roll_syntax_seq {
      \tl_set:Ne \l__rpgicons_roll_syntax_part_tl {##1}
      \regex_replace_case_once:nNTF {
        { \l__rpgicons_roll_syntax_plusminus_regex } { \c{ , } $ \1 $ \c{ , } }
        { \l__rpgicons_roll_syntax_times_regex } { \c{ , } $ \c{ times } $ \c{ , } }
        { \l__rpgicons_roll_syntax_dice_regex }
          { \c{ rpgiconsdie } { \c{ __rpgicons_roll_syntax_convert:n } { \2 } } { \1 } }
      } \l__rpgicons_roll_syntax_part_tl
      { \tl_use:N \l__rpgicons_roll_syntax_part_tl }
      { \tl_use:N \l__rpgicons_roll_syntax_part_tl }
    }
  }

  \cs_generate_variant:Nn \__rpgicons_roll_syntax_parse:n { e }

}

\tl_if_exist:NF \l__rpgicons_roll_actualtext_tl {
  \tl_new:N \l__rpgicons_roll_actualtext_tl
}
\cs_if_exist:NF \__rpgicons_roll_prepare_actualtext:Nn {
  \cs_new_protected:Npn \__rpgicons_roll_prepare_actualtext:Nn #1#2 {
    \tl_set:Nn #1 {#2}
    \tl_replace_all:Nne #1 { - } { \codepoint_generate:nn { "2212 } { 12 } }
    \tl_replace_all:Nne #1 { * } { \codepoint_generate:nn { "00D7 } { 12 } }
    \tl_replace_all:Nne #1 { x } { \codepoint_generate:nn { "00D7 } { 12 } }
  }
}

\tikzset {
  rpg ~ icons / roll ~ syntax / .code = {
    \__rpgicons_roll_syntax_die_set:n {#1}
  } ,
  rpg ~ icons / roll ~ syntax         = { d , D }
}

\NewDocumentCommand { \rpgiconsroll } { m } {
  \mode_leave_vertical:
  \__rpgicons_roll_prepare_actualtext:Nn \l__rpgicons_roll_actualtext_tl {#1}
  \tag_socket_use:nV { rpgicons/roll/before } \l__rpgicons_roll_actualtext_tl
  \tag_suspend:n { \rpgiconsroll }
  \__rpgicons_roll_syntax_parse:e {#1}
  \tag_resume:n { \rpgiconsroll }
  \tag_socket_use:n { rpgicons/roll/after }
}

\ExplSyntaxOff

\@ifundefined{roll}{\NewCommandCopy\roll\rpgiconsroll}{}

\endinput

% EOF
