% !TeX root = ./testing/test.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This package is part of the TikZlings package
% A package to bring cute little animals and other beings into tikz
% Maintained by samcarter
%
% Project repository and bug tracker:
% https://github.com/samcarter/tikzlings
%
% Released under the LaTeX Project Public License v1.3c or later
% See https://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProvidesPackage{tikzlings-addons}[2025/12/11 version v2.5 Draw additional items for the tikzlings]

\RequirePackage{tikz}
\usetikzlibrary{patterns} % for the wizard hat
\usetikzlibrary{decorations.shapes} % for sombrero
\usetikzlibrary{decorations.pathmorphing}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% List of all TikZlings
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{tikzlings-list}

\ExplSyntaxOn
\seq_clear:N \l_tmpa_seq

\clist_map_inline:Nn \g__tikzlings_names_clist
  {
    \seq_put_right:Nn \l_tmpa_seq { /#1 }
  }

% Comma list such as '/anteater,/bat,/bear,...,/wolf' for use with the
% '.search also' handler
\clist_const:Nx \c__tikzlings_search_paths_clist
  {
    \seq_use:Nn \l_tmpa_seq { , }
  }

\cs_new_eq:NN \tikzlings@search@paths@clist \c__tikzlings_search_paths_clist
\ExplSyntaxOff

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Addons
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand*{\thing}[1][]{%
  \begin{scope}%
    \tikzset{/thing/.cd,#1}%
    \thing@draw%
  \end{scope}%
}

\def\thing@listhead{}
\def\thing@listacces{}

\ExplSyntaxOn
% based on https://topanswers.xyz/tex?q=8082#a7698
\NewDocumentCommand{\thing@ini}{om}{
  \expandafter\newif\csname ifthing@#2\endcsname
  \IfValueT{#1}{
    \tl_put_right:cn { thing@list#1 } { {#2} }
  }
}
\ExplSyntaxOff

% Hats %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\thing@ini[head]{hat}
\thing@ini[head]{tophat}
\thing@ini[head]{beret}
\thing@ini[head]{strawhat}
\thing@ini[head]{harlequin}
\thing@ini[head]{witch}
\thing@ini[head]{magichat}
\thing@ini[head]{crown}
\thing@ini[head]{queencrown}
\thing@ini[head]{kingcrown}
\thing@ini[head]{santa}
\thing@ini[head]{chef}
\thing@ini[head]{graduate}
\thing@ini[head]{sombrero}
\thing@ini[head]{alien}
% Communication %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\thing@ini[acces]{book}
\thing@ini[acces]{signpost}
\thing@ini{speech}
\thing@ini{think}
% Food %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\thing@ini[acces]{pizza}
\thing@ini{davidlikespineapplepizza}
\thing@ini[acces]{cheese}
\thing@ini[acces]{baguette}
\thing@ini[acces]{cake}
\thing@ini[acces]{icecream}
\thing@ini[acces]{milkshake}
\thing@ini[acces]{wine}
\thing@ini[acces]{cocktail}
\thing@ini[acces]{banana}
% Sport %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\thing@ini[acces]{cricket}
\thing@ini[acces]{hockey}
\thing@ini[acces]{football}
% Other %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\thing@ini[acces]{crystalball}
\thing@ini[acces]{magicwand}
\thing@ini[acces]{rollingpin}
\thing@ini[acces]{lightsaber}
\thing@ini[acces]{torch}
\thing@ini[acces]{basket}
\thing@ini[acces]{easter}
\thing@ini[acces]{crozier}
\thing@ini[acces]{shovel}
\thing@ini[acces]{pickaxe}
\thing@ini[acces]{strawbroom}
\thing@ini[acces]{broom}
\thing@ini[acces]{umbrella}
\thing@ini[acces]{umbrellaclosed}
\thing@ini[acces]{handbag}
\thing@ini[acces]{stick}
\thing@ini[acces]{towel}
\thing@ini[acces]{present}

\tikzset{%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  % General
  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  /thing/.search also/.expanded = {/tikz, /pgf, \tikzlings@search@paths@clist},
  %/thing/.unknown/.code=\relax, % bad idea, prevents tikz/pgf keys
  /thing/.cd,
  randomhead/.code        = \shufflethings,
  randomhead/.forward to  = /thing/\randomhead,
  randomaccessories/.code = \shufflethings,
  randomaccessories/.forward to = /thing/\randomaccessories,
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  % Hats
  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  hat/.code               = \thing@hattrue
                            \def\thing@hat{#1},
  hat/.default            = blue!40!black,
  tophat/.code            = \thing@tophattrue
                            \def\thing@tophat{#1},
  top hat/.forward to     = /thing/tophat,
  tophat/.default         = black!90!white,
  beret/.code             = \thing@berettrue
                            \def\thing@beret{#1},
  beret/.default          = black,
  strawhat/.code          = \thing@strawhattrue
                            \def\thing@strawhat{#1},
  straw hat/.forward to   = /thing/strawhat,
  strawhat/.default       = gray!30!white,
  ribbon/.code            = \def\thing@ribbon{#1},
  ribbon                  = black,
  harlequin/.code         = \thing@harlequintrue
                            \def\thing@harlequin{#1},
  harlequin/.default      = blue,
  niuqelrah/.code         = \def\thing@niuqelrah{#1},
  niuqelrah               = red,
  witch/.code             = \thing@witchtrue
                            \def\thing@witch{#1},
  witch/.default          = black,
  magichat/.code          = \thing@magichattrue
                            \def\thing@magichat{#1},
  magic hat/.forward to   = /thing/magichat,
  magichat/.default       = violet,
  magicstars/.code        = \def\thing@magicstars{#1},
  magic stars/.forward to = /thing/magicstars,
  magicstars              = yellow!80!brown,
  crown/.code             = \thing@crowntrue
                            \def\thing@crown{#1},
  crown/.default          = yellow!90!orange,
  queencrown/.code        = \thing@queencrowntrue
                            \def\thing@queencrown{#1},
  queen crown/.forward to = /thing/queencrown,
  queencrown/.default     = yellow,
  kingcrown/.code         = \thing@kingcrowntrue
                            \def\thing@kingcrown{#1},
  king crown/.forward to  = /thing/kingcrown,
  kingcrown/.default      = gray,
  santa/.code             = \thing@santatrue
                            \def\thing@santa{#1},
  santa/.default          = red!80!black,
  chef/.code              = \thing@cheftrue
                            \def\thing@chef{#1},
  chef/.default           = gray!20!white,
  graduate/.code          = \thing@graduatetrue
                            \def\thing@graduate{#1},
  graduate/.default       = black,
  tassel/.code            = \def\thing@tassel{#1},
  tassel                  = red,
  sombrero/.code          = \thing@sombrerotrue
                            \def\thing@sombrero{#1},
  sombrero/.default       = orange!70!yellow,
  sombreroa/.code         = \def\thing@sombreroa{#1},
  sombreroa               = green!70!blue,
  sombrerob/.code         = \def\thing@sombrerob{#1},
  sombrerob               = red,
  sombreroc/.code         = \def\thing@sombreroc{#1},
  sombreroc               = blue,
  alien/.code             = \thing@alientrue
                            \def\thing@alien{#1},
  alien/.default          = green,
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  % Communication
  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  book/.code              = \thing@booktrue
                            \def\thing@book{#1},
  bookcolour/.code        = \def\thing@bookcolour{#1},
  book colour/.forward to = /thing/bookcolour,
  book color/.forward to  = /thing/bookcolour,
  bookcolor/.forward to   = /thing/bookcolour,
  bookcolour              = brown,
  signpost/.code          = \thing@signposttrue
                            \def\thing@signpost{#1},
  sign post/.forward to   = /thing/signpost,
  signcolour/.code        = \def\thing@signcolour{#1},
  sign colour/.forward to = /thing/signcolour,
  sign color/.forward to  = /thing/signcolour,
  signcolor/.forward to   = /thing/signcolour,
  signcolour              = brown!50!black,
  signback/.code          = \def\thing@signback{#1},
  sign back/.forward to   = /thing/signback,
  signback                = green!40!black,
  speech/.code            = \thing@speechtrue
                            \def\thing@speech{#1},
  think/.code             = \thing@thinktrue
                            \def\thing@think{#1},
  bubblecolour/.code      = \def\thing@bubblecolour{#1},
  bubble colour/.forward to = /thing/bubblecolour,
  bubble color/.forward to = /thing/bubblecolour,
  bubblecolor/.forward to = /thing/bubblecolour,
  bubblecolour            = gray!30!white,
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  % Food
  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  pizza/.code             = \thing@pizzatrue,
  davidlikespineapplepizza/.code = \thing@davidlikespineapplepizzatrue
                            \thing@speechtrue
                            \def\thing@speech{\scalebox{\scalingfactor}{\scalebox{0.9}{\tiny ih, che schifo!}}},
  david likes pineapple pizza/.forward to = /thing/davidlikespineapplepizza,
  cheese/.code            = \thing@cheesetrue
                            \def\thing@cheese{#1},
  cheese/.default         = yellow!30!orange!60!white,
  baguette/.code          = \thing@baguettetrue
                            \def\thing@baguette{#1},
  baguette/.default       = brown,
  cake/.code              = \thing@caketrue
                            \def\thing@cake{#1},
  cake/.default           = violet,
  icecream/.code          = \thing@icecreamtrue
                            \def\thing@cone{#1},
  ice cream/.forward to   = /thing/icecream,
  icecream/.default       = brown!60!gray,
  flavoura/.code          = \def\thing@flavoura{#1},
  flavour a/.forward to   = /thing/flavoura,
  flavoura                = brown!50!black,
  flavourb/.code          = \def\thing@flavourb{#1},
  flavour b/.forward to   = /thing/flavourb,
  flavourb                = white!70!brown,
  flavourc/.code          = \def\thing@flavourc{#1},
  flavour c/.forward to   = /thing/flavourc,
  flavourc                = red!50!white,
  milkshake/.code         = \thing@milkshaketrue
                            \def\thing@milkshake{#1},
  milkshake/.default      = red!20!white,
  wine/.code              = \thing@winetrue
                            \def\thing@wine{#1},
  wine/.default           = red!70!black,
  cocktail/.code          = \thing@cocktailtrue,
  banana/.code            = \thing@bananatrue
                            \def\thing@banana{#1},
  banana/.default         = yellow!80!orange,
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  % Sport
  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  cricket/.code           = \thing@crickettrue
                            \def\thing@cricket{#1},
  cricket/.default        = brown,
  hockey/.code            = \thing@hockeytrue
                            \def\thing@hockey{#1},
  hockey/.default         = brown,
  football/.code          = \thing@footballtrue
                            \def\thing@football{#1},
  football/.default       = white,
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  % other items
  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  crystalball/.code       = \thing@crystalballtrue
                            \def\thing@crystalball{#1},
  crystal ball/.forward to = /thing/crystalball,
  crystalball/.default    = cyan,
  magicwand/.code         = \thing@magicwandtrue,
  magic want/.forward to  = /thing/magicwand,
  rollingpin/.code        = \thing@rollingpintrue
                            \def\thing@rollingpin{#1},
  rolling pin/.forward to = /thing/rollingpin,
  rollingpin/.default     = brown,
  lightsaber/.code        = \thing@lightsabertrue
                            \def\thing@lightsaber{#1},
  light saber/.forward to = /thing/lightsaber,
  lightsaber/.default     = green,
  torch/.code             = \thing@torchtrue
                            \def\thing@torch{#1},
  torch/.default          = gray,
  basket/.code            = \thing@baskettrue
                            \def\thing@basket{#1},
  basket/.default         = brown!70!gray,
  easter/.code            = \thing@eastertrue
                            \thing@baskettrue
                            \def\thing@basket{#1},
  easter/.default         = brown!70!gray,
  egga/.code              = \def\thing@egga{#1},
  egg a/.forward to       = /thing/egga,
  egga                    = blue,
  eggb/.code              = \def\thing@eggb{#1},
  egg b/.forward to       = /thing/eggb,
  eggb                    = green,
  eggc/.code              = \def\thing@eggc{#1},
  egg c/.forward to       = /thing/eggc,
  eggc                    = red,
  crozier/.code           = \thing@croziertrue
                            \def\thing@crozier{#1},
  crozier/.default        = brown,
  shovel/.code            = \thing@shoveltrue
                            \def\thing@shovel{#1},
  shovel/.default         = gray,
  pickaxe/.code           = \thing@pickaxetrue
                            \def\thing@pickaxe{#1},
  pickaxe/.default        = gray,
  strawbroom/.code        = \thing@strawbroomtrue
                            \def\thing@strawbroom{#1},
  strawbroom/.default     = brown!50!white,
  strawbroomstick/.code   = \def\thing@strawbroomstick{#1},
  strawbroomstick         = brown,
  strawbroomribbon/.code  = \def\thing@strawbroomribbon{#1},
  strawbroomribbon        = red!50!black,
  broom/.code             = \thing@broomtrue
                            \def\thing@broom{#1},
  broom/.default          = brown,
  broomstick/.code        = \def\thing@broomstick{#1},
  broomstick              = gray!50!black,
  umbrella/.code          = \thing@umbrellatrue
                            \def\thing@umbrella{#1},
  umbrella/.default       = cyan,
  umbrellaclosed/.code    = \thing@umbrellaclosedtrue
                            \def\thing@umbrellaclosed{#1},
  umbrellaclosed/.default = cyan,
  umbrella closed/.forward to = /thing/umbrellaclosed,
  handbag/.code           = \thing@handbagtrue
                            \def\thing@handbag{#1},
  handbag/.default        = red!70!black,
  stick/.code             = \thing@sticktrue
                            \def\thing@stick{#1},
  stick/.default          = brown!50!black,
  leaf/.store in          = \thing@leaf,
  leaf                    = green!70!red,
  towel/.code             = \thing@toweltrue
                            \def\thing@towel{#1},
  towel/.default          = violet,
  present/.code           = \thing@presenttrue
                            \def\thing@present{#1},
  present/.default        = violet,
  presenttop/.code        = \def\thing@presenttop{#1},
  presenttop              = \thing@present!70,
  present top/.forward to = /thing/presenttop,
  presentbottom/.code     = \def\thing@presentbottom{#1},
  presentbottom           = \thing@present!80,
  present bottom/.forward to = /thing/presentbottom,
  presentribbon/.code     = \def\thing@presentribbon{#1},
  presentribbon           = \thing@present,
  present ribbon/.forward to = /thing/presentribbon,
}

\def\thing@draw{%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% store the current scale factor
% from https://github.com/samcarter/tikzlings/issues/3#issuecomment-461373494
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pgfgettransformentries{\tmpscaleA}{\tmpscaleB}{\tmpscaleC}{\tmpscaleD}{\tmp}{\tmp}%
\pgfmathsetmacro{\scalingfactor}{sqrt(abs(\tmpscaleA*\tmpscaleD-\tmpscaleB*\tmpscaleC))*sqrt(abs((\pgf@xx/1cm)*(\pgf@yy/1cm)-(\pgf@xy/1cm)*(\pgf@yx/1cm)))}%
\pgfmathsetmacro{\xscalefactor}{\tmpscaleA}
\pgfmathsetmacro{\yscalefactor}{\tmpscaleD}
\pgfmathsetmacro{\decoscalefactor}{sign(\tmpscaleA)*sign(\tmpscaleD)*\scalingfactor}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Hats
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@hat
  \fill[\thing@hat,rotate around={-15:(-0.3,2.01)}] (-0.3,2.01) rectangle (0.46,2.31);
  \fill[\thing@hat] (0.05,1.92) ellipse[x radius=0.6, y radius=0.1, rotate=-15];
  \fill[\thing@hat] (0.14,2.2) ellipse[x radius=0.37, y radius=0.08, rotate=-15];
\fi
%
% Tophat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@tophat
  \fill[\thing@tophat] (0.1,1.94) ellipse[x radius=0.48, y radius=0.1, rotate=-15];
  \fill[\thing@tophat,rotate around={-15:(0.15,2.165)}] (-0.17, 1.94) -- (0.46, 1.94) -- (0.52, 2.39) -- (-0.22, 2.39) -- cycle;
  \fill[\thing@tophat] (0.21,2.385) ellipse[x radius=0.37, y radius=0.08, rotate=-15];
\fi
%
% Beret %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@beret
  \begin{scope}[xshift=-19,yshift=-2,rotate=10]
  \fill[\thing@beret,rotate=-25] (0.13,2.15) ellipse[x radius=0.5, y radius=0.17];
  \fill[\thing@beret,rotate=-25] (0.13,2.25) ellipse[x radius=0.55, y radius=0.17];
  \fill[\thing@beret,rotate=-25] (0.13,2.4) circle[radius=0.08];
  \end{scope}
\fi
%
% Straw hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@strawhat
  \begin{scope}[xshift=-16,rotate=12,yshift=-1]
  \fill[\thing@strawhat,rotate=-15] (0.44,2.0) ellipse[x radius=0.75, y radius=0.1];
  \fill[\thing@strawhat,rotate=-15] (0.1,2.05) rectangle (0.78,2.5);
  \fill[\thing@strawhat,rotate=-15] (0.44,2.5) ellipse[x radius=0.34, y radius=0.08];
  \fill[\thing@strawhat,rotate=-15] (-0.3,2.02) -- (1.18,2.02) -- (0.78,2.2) -- (0.1,2.2) -- cycle;
  \fill[\thing@ribbon,rotate=-15] (0.44,2.2) ellipse[x radius=0.34, y radius=0.08];
  \fill[\thing@ribbon,rotate=-15] (0.1,2.2) rectangle (0.78,2.3);
  \fill[\thing@strawhat,rotate=-15] (0.44,2.3) ellipse[x radius=0.34, y radius=0.08];
  \end{scope}
\fi
%
% Harlequin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@harlequin
  \begin{scope}[xshift=-26]
  \path (0.19,1.85) rectangle (1.85,2.67);
  \fill[\thing@harlequin,overlay] (0.6006,1.9719) .. controls (0.7432,1.8954) and (0.9320,1.8698) .. (0.9320,1.8698) -- (1.0404,2.3839) .. controls (0.9223,2.8873) and (0.1755,2.5634) .. (0.3019,2.2958) .. controls (0.5807,2.5024) and (0.7251,2.3376) .. (0.6006,1.9719) -- cycle;
  \fill[\thing@niuqelrah,overlay] (1.2853,1.8902) .. controls (1.1177,1.8507) and (0.9278,1.8703) .. (0.9278,1.8703) -- (1.0404,2.3839) .. controls (1.3637,2.8347) and (1.9373,2.3532) .. (1.7049,2.1284) .. controls (1.5267,2.3895) and (1.3204,2.2666) .. (1.2853,1.8902) -- cycle;
  \fill[\thing@harlequin] (1.7,2.07) circle[radius=0.1];
  \fill[\thing@niuqelrah] (0.3,2.23) circle[radius=0.1];
  \end{scope}
\fi
%
% witch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@witch
  \begin{scope}[xshift=-26]
  \fill[\thing@witch,rotate=-15] (0.44,2.13) ellipse[x radius=0.75, y radius=0.17];
  \fill[\thing@witch,rotate=-15] (0.05,2.2)--(0.45,3.2)--(0.82,2.2);
  \end{scope}
\fi
%
% magic hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@magichat
  \begin{scope}[xshift=-26]
  \path[preaction={fill, \thing@magichat!100},rotate=-5,pattern=fivepointed stars, pattern color=\thing@magicstars!100] (0.36,1.95)--(0.86,2.95)--(1.20,1.85);
    \end{scope}
\fi
%
% crown %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@crown
  \fill[\thing@crown] (-0.1885,2.0616) .. controls (-0.1885,2.0616) and (-0.1479,2.1763) .. (-0.2291,2.465) -- (-0.0355,2.2378) -- (0.1141,2.3943) -- (0.201,2.1961) -- (0.4688,2.3318) .. controls (0.2677,2.1132) and (0.2944,1.9764) .. (0.2944, 1.9764) .. controls (0.1524,1.9202) and (-0.0743,1.9601) .. (-0.1885,2.0616) -- cycle;
\fi
%
% Queen crown %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@queencrown
  \begin{scope}[xshift=-26]
  \fill[\thing@queencrown] (0.7370,2.0732) .. controls (0.6966,2.2091) and (0.6769,2.3503) ..
  (0.6354,2.4859) .. controls (0.6149,2.5164) and (0.5958,2.5732) ..
  (0.6498,2.5808) .. controls (0.6973,2.5907) and (0.7091,2.5350) ..
  (0.6926,2.5016) .. controls (0.6967,2.4544) and (0.7188,2.4109) ..
  (0.7340,2.3665) .. controls (0.7415,2.3472) and (0.7619,2.2862) ..
  (0.7676,2.3381) .. controls (0.7755,2.3852) and (0.7871,2.4329) ..
  (0.7833,2.4808) .. controls (0.7597,2.5148) and (0.7834,2.5720) ..
  (0.8294,2.5570) .. controls (0.8775,2.5457) and (0.8536,2.4937) ..
  (0.8436,2.4638) .. controls (0.8502,2.3973) and (0.8640,2.3313) ..
  (0.8798,2.2664) .. controls (0.9047,2.2750) and (0.9168,2.3261) ..
  (0.9342,2.3514) .. controls (0.9492,2.3853) and (0.9714,2.4171) ..
  (0.9773,2.4540) .. controls (0.9645,2.4873) and (0.9766,2.5358) ..
  (1.0204,2.5303) .. controls (1.0646,2.5298) and (1.0691,2.4725) ..
  (1.0443,2.4460) .. controls (1.0440,2.3935) and (1.0580,2.3419) ..
  (1.0671,2.2905) .. controls (1.0706,2.2719) and (1.0788,2.2126) ..
  (1.0985,2.2554) .. controls (1.1269,2.3087) and (1.1558,2.3623) ..
  (1.1772,2.4187) .. controls (1.1697,2.4515) and (1.1716,2.5081) ..
  (1.2210,2.5018) .. controls (1.2706,2.4969) and (1.2686,2.4403) ..
  (1.2406,2.4126) .. controls (1.2279,2.3600) and (1.2211,2.3057) ..
  (1.2172,2.2518) .. controls (1.2296,2.2439) and (1.2538,2.2943) ..
  (1.2693,2.3112) .. controls (1.2908,2.3467) and (1.3228,2.3784) ..
  (1.3316,2.4200) .. controls (1.3203,2.4624) and (1.3708,2.5014) ..
  (1.4051,2.4678) .. controls (1.4448,2.4342) and (1.3945,2.3994) ..
  (1.3765,2.3710) .. controls (1.3022,2.2536) and (1.2440,2.1265) ..
  (1.1686,2.0097) .. controls (0.9649,1.9465) and (0.8367,1.9955) ..
  (0.7370,2.0732) -- cycle;
  \end{scope}
\fi
%
% King crown %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@kingcrown
  \begin{scope}[xshift=-26]
  \fill[\thing@kingcrown]   (0.6572,2.0396) .. controls (0.6637,2.0838) and (0.6716,2.1289) ..
  (0.6684,2.1735) .. controls (0.6481,2.2496) and (0.5923,2.3131) ..
  (0.5818,2.3921) .. controls (0.5738,2.4607) and (0.6167,2.5343) ..
  (0.6862,2.5502) .. controls (0.7548,2.5703) and (0.8210,2.5304) ..
  (0.8720,2.4881) .. controls (0.8984,2.4712) and (0.9239,2.4324) ..
  (0.9486,2.4249) .. controls (0.9524,2.4691) and (0.9566,2.5158) ..
  (0.9844,2.5527) .. controls (1.0052,2.5845) and (1.0390,2.6282) ..
  (1.0820,2.6127) .. controls (1.1212,2.5899) and (1.1378,2.5421) ..
  (1.1478,2.5003) .. controls (1.1576,2.4639) and (1.1336,2.4180) ..
  (1.1349,2.3906) .. controls (1.2050,2.4269) and (1.2847,2.4629) ..
  (1.3654,2.4429) .. controls (1.4292,2.4285) and (1.4864,2.3679) ..
  (1.4793,2.2998) .. controls (1.4859,2.2404) and (1.4407,2.1925) ..
  (1.4006,2.1551) .. controls (1.3681,2.1232) and (1.3290,2.0951) ..
  (1.3072,2.0544) .. controls (1.2904,2.0121) and (1.2805,1.9674) ..
  (1.2738,1.9225) .. controls (1.1221,1.8892) and (0.9586,1.8836) ..
  (0.8112,1.9386) .. controls (0.7535,1.9608) and (0.6999,1.9945) ..
  (0.6572,2.0396) -- cycle;
  \end{scope}
\fi
%
% Santa %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@santa
  \begin{scope}[xshift=-26]
  \fill[\thing@santa] (0.430,1.803) .. controls (0.590,2.174) and (0.837,2.065) .. (1.118,1.954) .. controls (1.679,1.731) and (1.328,1.193) .. (1.647,1.057) .. controls (1.638,1.255) and (1.745,2.104) .. (1.168,2.270) .. controls (0.867,2.356) and (0.536,2.280) .. (0.430,1.803) -- cycle;
  \fill[white!80!brown] (0.44,1.733) .. controls (0.211,2.299) and (1.082,2.188) .. (1.456,1.759) .. controls (1.534,1.637) and (1.480,1.545) .. (1.400,1.566) .. controls (1.265,1.714) and (0.577,2.267) .. (0.44,1.733) -- cycle;
  \fill[white!80!brown] (1.6,1.0) circle[radius=0.17];
  \end{scope}
\fi
%
% Chef hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@chef
  \begin{scope}[xshift=-26]
  \fill[\thing@chef,rotate=-15] (0.44,2.1) ellipse[x radius=0.37, y radius=0.08];
  \fill[\thing@chef,rotate=-15] (0.07,2.1) rectangle (0.81,2.55);
  \fill[\thing@chef] (1.01,2.47) circle[radius=0.17];
  \fill[\thing@chef] (1.24,2.35) circle[radius=0.15];
  \fill[\thing@chef] (0.77,2.40) circle[radius=0.12];
  \fill[\thing@chef] (1.39,2.20) circle[radius=0.12];
  \end{scope}
\fi
%
% graduate hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@graduate
  \begin{scope}[xshift=-26]
  \fill[\thing@graduate,rotate=-15] (0.44,2.1) ellipse[x radius=0.37, y radius=0.1];
  \fill[\thing@graduate,rotate=-15] (0.07,2.1) rectangle (0.81,2.3);
  \fill[\thing@graduate] (0.3,2.25) -- (1.05,2.35) -- (1.7,1.95) -- (0.92,1.85) -- cycle;
  \fill[\thing@tassel,rounded corners=\scalingfactor*1] (1.12,1.89) -- (1.01,2.1) -- (1.09,2.11) -- (1.2,1.9) -- (1.2,1.3) -- (1.12,1.3) -- cycle;
  \fill[\thing@tassel] (1.16,1.3) ellipse[x radius=0.06, y radius=0.12];
  \end{scope}
\fi
%
% sombrero %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@sombrero
  \fill[\thing@sombrero] (-.45,2) to[in=200] (0,2.8) to[out=-20] (.45,2) -- cycle;
  \fill[\thing@sombrero] (-0.65, 1.75) .. controls (-0.85, 1.7) and (-0.85, 1.9) .. (-0.85, 1.9)  .. controls (-0.30, 2.2) and (0.30, 2.2) .. ( 0.85, 1.9)  .. controls ( 0.85, 1.9) and (0.85, 1.7) .. ( 0.65, 1.75) .. controls ( 0.30, 1.95) and (-0.30, 1.95) .. (-0.65, 1.75) -- cycle;
  \draw[\thing@sombrerob,line width=\scalingfactor*0.8pt] (-0.85, 1.9)  .. controls (-0.30, 2.2) and (0.30, 2.2) .. ( 0.85, 1.9);
  \draw[decorate,decoration={zigzag, amplitude=\decoscalefactor*1pt, segment length=\scalingfactor*6pt},\thing@sombreroa, line width=\scalingfactor*1pt] (-0.81, 1.8)  .. controls (-0.30, 2.1) and (0.30, 2.1) .. ( 0.82, 1.8);
  \begin{scope}
    \clip (-.45,2) to[in=200] (0,2.8) to[out=-20] (.45,2) -- cycle;
    \draw[decorate,decoration={zigzag, amplitude=\decoscalefactor*1pt, segment length=\scalingfactor*3pt},\thing@sombreroa, line width=\scalingfactor*1pt] (-.4,2.4) to[bend left] (.4,2.4);
    \fill[decorate,decoration={shape backgrounds,shape=circle,        shape size=\scalingfactor*2pt, shape evenly spread=7}, \thing@sombreroc] (-.3,2.6) to[bend left] (.3,2.6);
    \fill[decorate,decoration={shape backgrounds,shape=circle,shape size=\scalingfactor*2pt,shape evenly spread=9},\thing@sombreroc] (-.4,2.18) to[bend left] (.4,2.18);
  \end{scope}
\fi
%
% alien %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@alien
  \fill[\thing@alien,rotate around={15:(-0.175,2.115)}] (-0.2,1.93) rectangle (-0.15,2.3);
  \fill[\thing@alien,rotate around={-15:(0.175,2.115)}] (0.2,1.93) rectangle (0.15,2.3);
  \fill[\thing@alien] (-0.22,2.30) circle[radius=0.07];
  \fill[\thing@alien] (0.22,2.30) circle[radius=0.07];
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Communication
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% book %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@book
  \begin{scope}[xshift=-25,yshift=1]
  \fill[\thing@bookcolour,rotate=-20] (0.40,1.20) rectangle (0.80,0.60);
  \node[rotate=-20*\yscalefactor/\xscalefactor, color=white] at (0.88,0.70) {\thing@book};%
  \end{scope}
\fi
%
% signpost %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@signpost
  \begin{scope}[scale=1.7,xshift=-26,yshift=-7]
  \fill[\thing@signcolour, rounded corners=\scalingfactor*1, rotate=-20] (0.8,0.75) rectangle (0.9,1.75);
  \fill[\thing@signcolour, rounded corners=\scalingfactor*1, rotate=-20] (0.4,1.7) rectangle (1.3,2.4);
  \fill[\thing@signback, rounded corners=\scalingfactor*1, rotate=-20] (0.45,1.75) rectangle (1.25,2.35);
   \node[rotate=-20*\yscalefactor/\xscalefactor, color=white] at (1.5,1.65) {\thing@signpost};
   \end{scope}
\fi
%
% speech bubble %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@speech
  \begin{scope}[xshift=-26]
  \fill[\thing@bubblecolour] (-0.5,1.8) ellipse[x radius=0.7, y radius=0.3];
  \fill[\thing@bubblecolour] (-0.2,1.54) -- (0.2,1.35) -- (0.0,1.6) -- cycle;
  \node at (-0.5,1.8) {\thing@speech};
  \end{scope}
\fi
%
% think bubble %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@think
  \begin{scope}[xshift=-26]
  \fill[\thing@bubblecolour] (2,2.4) ellipse[x radius=0.7, y radius=0.35];
  \fill[\thing@bubblecolour] (1.55,2.35) circle[radius=0.25] (2.0,2.15) circle[radius=0.25] (2.4,2.25) circle[radius=0.25] (1.6,2.55) circle[radius=0.25] (2.0,2.6) circle[radius=0.25] (2.35,2.5) circle[radius=0.25] (1.65,1.95) circle[radius=0.1] (1.55,1.80) circle[radius=0.06] (1.47,1.70) circle[radius=0.03];
  \node at (2,2.4) {\thing@think};
  \end{scope}
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Food
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% pizza %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@pizza
  \begin{scope}[xshift=-28,yshift=2]
  \fill[brown] (1.00,0.60) ellipse[x radius=0.4, y radius=0.2];
  \fill[red!70!black] (1.00,0.60) ellipse[x radius=0.34, y radius=0.16];
  \fill[white!85!yellow] (1.15,0.65) ellipse[x radius=0.065, y radius=0.04];
  \fill[white!85!yellow] (0.81,0.57) ellipse[x radius=0.065, y radius=0.04];
  \fill[white!85!yellow] (0.95,0.68) ellipse[x radius=0.065, y radius=0.04];
  \fill[white!85!yellow] (1.02,0.54) ellipse[x radius=0.065, y radius=0.04];
  \fill[green!40!brown] (1.09,0.54) ellipse[x radius=0.07, y radius=0.02];
  \fill[green!40!brown,rotate=20] (1.0,0.34) ellipse[x radius=0.07, y radius=0.02];
  \fill[green!40!brown,rotate=-20] (0.9,1.05) ellipse[x radius=0.07, y radius=0.02];
  \fill[green!40!brown] (1.00,0.60) ellipse[x radius=0.03, y radius=0.06];
  \end{scope}
\fi
% not pizza %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@davidlikespineapplepizza
  \begin{scope}[xshift=-28,yshift=2]
  \fill[brown] (1.00,0.60) ellipse[x radius=0.4, y radius=0.2];
  \fill[red!70!black] (1.00,0.60) ellipse[x radius=0.34, y radius=0.16];
  \fill[yellow!70!brown] (1.15,0.65) ellipse[x radius=0.08, y radius=0.06];
  \fill[red!70!black] (1.15,0.65) ellipse[x radius=0.04, y radius=0.03];
  \fill[yellow!70!brown] (0.81,0.57) ellipse[x radius=0.08, y radius=0.06];
  \fill[red!70!black] (0.81,0.57) ellipse[x radius=0.04, y radius=0.03];
  \fill[yellow!70!brown] (0.95,0.68) ellipse[x radius=0.08, y radius=0.06];
  \fill[red!70!black] (0.95,0.68) ellipse[x radius=0.04, y radius=0.03];
  \fill[yellow!70!brown] (1.02,0.54) ellipse[x radius=0.08, y radius=0.06];
  \fill[red!70!black] (1.02,0.54) ellipse[x radius=0.04, y radius=0.03];
  \fill[green!40!brown] (1.09,0.54) ellipse[x radius=0.07, y radius=0.02];
  \fill[green!40!brown,rotate=20] (1.0,0.34) ellipse[x radius=0.07, y radius=0.02];
  \fill[green!40!brown,rotate=-20] (0.9,1.05) ellipse[x radius=0.07, y radius=0.02];
  \fill[green!40!brown] (1.00,0.60) ellipse[x radius=0.03, y radius=0.06];
  \end{scope}
\fi
%
% Cheese %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@cheese
  \fill[\thing@cheese] (-0.3200,0.8058) -- (0.0608,0.7220) -- (0.0608,0.6366) -- (-0.3200,0.5410) -- (0.2143,0.4236) .. controls (0.3395,0.4810) and (0.4241,0.5627) .. (0.4117,0.6253) -- (0.4117,0.7634) .. controls (0.4261,0.8618) and (0.2607,0.8954) .. (0.1907,0.8962) -- cycle;
  \fill[\thing@cheese!35!white] (-0.3200,0.8057) -- (-0.3200,0.5410) -- (0.2143,0.4236) -- (0.2143,0.7381) -- cycle;
  \fill[\thing@cheese] (-0.23,0.71) circle[radius=0.04] (0.0,0.55) circle[radius=0.04] (-0.23,0.58) circle[radius=0.02] (-0.15,0.6) circle[radius=0.02] (-0.1,0.7) circle[radius=0.02] (0.1,0.65) circle[radius=0.02] (0,0.65) circle[radius=0.02] (0.1,0.5) circle[radius=0.02] (0.07,0.55) circle[radius=0.01] (0.12,0.6) circle[radius=0.01] (-0.08,0.54) circle[radius=0.01];
\fi
%
% baguette %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@baguette
  \begin{scope}[xshift=-38,yshift=7,rotate=-20]
  \fill[\thing@baguette!70!white, rounded corners=\scalingfactor*4, rotate=-30] (0.4,0.72) rectangle (0.7,2.0);
  \fill[\thing@baguette!80!black, rotate=5] (1.44,1.1) ellipse[x radius=0.1, y radius=0.03] (1.30,0.9) ellipse[x radius=0.1, y radius=0.03] (1.16,0.7) ellipse[x radius=0.1, y radius=0.03] (1.02,0.5) ellipse[x radius=0.1, y radius=0.03];
  \end{scope}
\fi
%
% cake %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@cake
  \begin{scope}[xshift=-28]
  \fill[\thing@cake] (1.00,0.50) ellipse[x radius=0.4, y radius=0.2];
  \fill[\thing@cake] (0.6,0.5) rectangle (1.4,0.7);
  \fill[\thing@cake] (1.00,0.70) ellipse[x radius=0.4, y radius=0.2];
  \fill[\thing@cake!50!white] (0.75,0.75) rectangle (0.8,0.95);
  \fill[\thing@cake!50!white] (1.2,0.75) rectangle (1.25,0.95);
  \fill[\thing@cake!50!white] (0.975,0.65) rectangle (1.025,0.85);
  \fill[white!85!yellow] (1.0,0.93) ellipse[x radius=0.03, y radius=0.06];
  \fill[white!85!yellow] (1.225,1.03) ellipse[x radius=0.03, y radius=0.06];
  \fill[white!85!yellow] (0.775,1.03) ellipse[x radius=0.03, y radius=0.06];
  \end{scope}
\fi
%
% icecream %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@icecream
  \begin{scope}[xshift=-26]
  \fill[\thing@cone,rotate=-20] (0.35,1.20)--(0.50,0.60)--(0.75,1.20);
  \fill[\thing@flavoura] (0.85,1.03) circle[radius=0.12];
  \fill[\thing@flavourb] (1.05,0.95) circle[radius=0.12];
  \fill[\thing@flavourc] (0.95,1.1) circle[radius=0.12];
  \end{scope}
\fi
%
% milkshake %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@milkshake
  \begin{scope}[xshift=-26]
  \fill[cyan!10!white, rotate=-10] (0.8,0.50) ellipse[x radius=0.17, y radius=0.05];
  \fill[cyan!10!white, rotate=-10] (0.8,0.55) ellipse[x radius=0.12, y radius=0.03];
  \begin{scope}
    \clip[rotate=-10] (0.58,0.5) rectangle (1.02,1.03);
    \fill[cyan!10!white, rotate=-10] (0.8,0.94) ellipse[x radius=0.18, y radius=0.4];
    \fill[\thing@milkshake, rotate=-10] (0.8,0.94) ellipse[x radius=0.15, y radius=0.36];
  \end{scope}
  \fill[white!85!yellow] (0.83,0.92) circle[radius=0.05] (0.88,0.9) circle[radius=0.05] (0.93,0.92) circle[radius=0.05] (0.99,0.91) circle[radius=0.05] (1.06,0.86) circle[radius=0.05] (1.13,0.87) circle[radius=0.05] (0.85,0.99) circle[radius=0.05] (0.9,0.98) circle[radius=0.07] (1.0,0.98) circle[radius=0.07] (1.1,0.95) circle[radius=0.07];
  \fill[red!90!black] (1.0,1.1) circle[radius=0.05];
  \fill[white!85!yellow] (0.94,1.05) circle[radius=0.05] (1.03,1.03) circle[radius=0.05];
  \fill[cyan!10!white, rotate=-10] (0.8,0.50) ellipse[x radius=0.17, y radius=0.05];
  \fill[red!90!black,rotate=20] (1.2,0.58) rectangle (1.22,0.85);
  \end{scope}
\fi
%
% wine %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@wine
  \begin{scope}[xshift=-26,yshift=2]
  \fill[cyan!10!white, rotate=-10] (0.8,0.50) ellipse[x radius=0.17, y radius=0.05];
  \fill[cyan!10!white, rotate=-10] (0.8,0.55) ellipse[x radius=0.12, y radius=0.03];
  \fill[cyan!10!white, rotate=-10] (0.8,0.7) ellipse[x radius=0.03, y radius=0.2];
  \begin{scope}
    \clip[rotate=-10] (0.58,0.5) rectangle (1.02,1.03);
    \fill[cyan!10!white, rotate=-10] (0.8,1.1) ellipse[x radius=0.18, y radius=0.4];
  \end{scope}
  \begin{scope}
    \clip[rotate=-10] (0.58,0.5) rectangle (1.02,0.87);
    \fill[\thing@wine, rotate=-10] (0.8,1.1) ellipse[x radius=0.15, y radius=0.36];
  \end{scope}
  \end{scope}
\fi
%
% cocktail %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@cocktail
\begin{scope}[xshift=-26,yshift=3]
  \fill[cyan!10!white, rotate=-10] (0.8,0.50) ellipse[x radius=0.17, y radius=0.05];
  \fill[cyan!10!white, rotate=-10] (0.8,0.55) ellipse[x radius=0.12, y radius=0.03];
  \fill[cyan!10!white, rotate=-10] (0.8,0.7) ellipse[x radius=0.03, y radius=0.2];
  \fill[cyan!10!white] (0.92,0.6) -- (0.75,0.9) -- (1.18,0.83) -- cycle;
  \fill[gray!60!white] (0.928,0.64) -- (0.85,0.77) -- (1.08,0.77) -- cycle;
  \fill[green!40!brown!60!white] (0.94,0.71) circle[radius=0.04];
  \fill[red!80!black] (0.94,0.72) circle[radius=0.01];
  \end{scope}
\fi
%
% banana %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@banana
  \begin{scope}[yshift=27, xshift=7,rotate=25]
    \fill[\thing@banana!30!] (0.02,0) .. controls (0.21,0.20) and (0.21,0.40) .. (0.02,0.6) arc [start angle=60,end angle=120, radius =0.04] .. controls (0.07,0.40) and (0.07,0.20) .. (-0.02,0) --cycle ;
    %peel
    \begin{scope}
      \clip (-0.04,-0.01) rectangle (0.20,0.3);
      \fill[\thing@banana] (0.03,0) .. controls (0.22,0.20) and (0.22,0.40) .. (0.03,0.6) arc [start angle=60,end angle=120, radius =0.06] .. controls (0.06,0.40) and (0.06,0.20) .. (-0.03,0);
    \end{scope}
    \fill[\thing@banana!60!] (0.12,0.3) arc [start angle=140, end angle=-100, y radius=0.20, x radius=0.06]  arc [start angle=-90, end angle=90, y radius=0.15, x radius=0.02] (0.12,0.3) arc [start angle=60, end angle=270, y radius=0.15, x radius=0.1] arc [start angle=270, end angle=90, y radius=0.13, x radius=0.04];
  \end{scope}
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Sport
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% cricket bat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@cricket
  \begin{scope}[xshift=-26]
  \fill[\thing@cricket, rounded corners=\scalingfactor*2, rotate=-30] (0.4,1.2) rectangle (0.7,2.2);
  \fill[\thing@cricket, rounded corners=\scalingfactor*1, rotate=-30] (0.5,0.8) rectangle (0.6,1.3);
  \end{scope}
\fi
%
% Hockey stick %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@hockey
  \begin{scope}[xshift=-22]
  \fill[\thing@hockey, rounded corners=\scalingfactor*1, rotate=-30] (0.5,0.6) rectangle (0.6,2.1);
  \fill[\thing@hockey, rounded corners=\scalingfactor*3] (0.2,0.2) rectangle (0.85,0.4);
  \end{scope}
\fi
%
% football %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@football
  \begin{scope}[xshift=-26]
  \fill[\thing@football] (1.2,0.33) circle[radius=0.32];
  \begin{scope}
    \clip (1.2,0.33) circle[radius=0.32];
    \fill[black] (1.06,0.30) -- (1.01,0.17) -- (1.14,0.08) -- (1.26,0.14) -- (1.20,0.28) -- cycle (1.37,0.14) -- (1.46,0.27) -- (1.59,0.27) -- (1.41,0.04) -- cycle (1.28,0.38) -- (1.22,0.52) -- (1.33,0.61) -- (1.45,0.51) -- (1.43,0.37) -- cycle (0.87,0.44) -- (1.02,0.40) -- (1.10,0.53) -- (1.07,0.62) -- (0.94,0.57) -- cycle;
  \end{scope}
  \end{scope}
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% other items
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% crystal ball %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@crystalball
  \shade[ball color=\thing@crystalball,opacity=0.7] (0,0.8) circle[radius=0.33];
\fi
%
% magic wand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@magicwand
  \begin{scope}[xshift=-16,yshift=2]
  \fill[black,rotate=-30] (0.27,1.23) rectangle (0.37,0.65);
  \fill[white,rotate=-30] (0.27,1.13) rectangle (0.37,1.03);
  \end{scope}
\fi
%
% rollingpin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@rollingpin
  \begin{scope}[xshift=-30,yshift=2]
  \fill[\thing@rollingpin, rounded corners=\scalingfactor*2, rotate=-60] (-0.18,0.85) rectangle (0.08,1.75);
  \fill[\thing@rollingpin, rounded corners=\scalingfactor*1, rotate=-60] (-0.1,0.65) rectangle (0.0,1.95);
  \end{scope}
\fi
%
% lightsaber %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@lightsaber
  \begin{scope}[xshift=-26]
  \fill[\thing@lightsaber, rounded corners=\scalingfactor*1, rotate=-30] (0.5,0.9) rectangle (0.6,2.5);
  \fill[gray!80!black, rounded corners=\scalingfactor*1, rotate=-30] (0.47,0.7) rectangle (0.63,1.2);
  \end{scope}
\fi
%
% torch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@torch
  \begin{scope}[xshift=-26]
  \fill[red!50!yellow] (1.4338,1.025) .. controls (1.4308,0.8877) and (1.3468,0.8997) .. (1.2447,0.748) .. controls (1.1427,0.8982) and (1.0721,0.8892) .. (1.0646,1.024) .. controls (1.0541,1.1714) and (1.2642,1.1654) .. (1.2492,1.386) .. controls (1.3093,1.3110) and (1.4383,1.2705) .. (1.4338,1.025) -- cycle;
  \fill[red!25!yellow, scale=0.67, xshift=17, yshift=15] (1.4338,1.025) .. controls (1.4308,0.8877) and (1.3468,0.8997) .. (1.2447,0.748) .. controls (1.1427,0.8982) and (1.0721,0.8892) .. (1.0646,1.024) .. controls (1.0541,1.1714) and (1.2642,1.1654) .. (1.2492,1.386) .. controls (1.3093,1.3110) and (1.4383,1.2705) .. (1.4338,1.025) -- cycle;
  \fill[white!50!yellow, scale=0.4, xshift=53.5, yshift=45.3] (1.4338,1.025) .. controls (1.4308,0.8877) and (1.3468,0.8997) .. (1.2447,0.748) .. controls (1.1427,0.8982) and (1.0721,0.8892) .. (1.0646,1.024) .. controls (1.0541,1.1714) and (1.2642,1.1654) .. (1.2492,1.386) .. controls (1.3093,1.3110) and (1.4383,1.2705) .. (1.4338,1.025) -- cycle;
  \fill[\thing@torch,rounded corners=\scalingfactor*1]
    (1.1,0.96) -- (0.77,0.25) -- (0.83,0.25) -- (1.3,0.86) -- cycle;
  \fill[\thing@torch,rotate=-28] (0.62,1.32) ellipse[x radius=0.2, y radius=0.08];
  \end{scope}
\fi%
%
% basket %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@basket
  \begin{scope}[xshift=-28.5]
  \fill[\thing@basket, start angle=180, end angle=360, x radius=0.35, y radius=0.35] (0.65,0.61) arc  -- cycle;
  \fill[\thing@basket, start angle=180, end angle=0, even odd rule] [x radius=0.35, y radius=0.5] (0.65,0.6) arc  -- cycle [x radius=0.3, y radius=0.45] (0.7,0.6) arc  -- cycle;
  \fill[\thing@basket, even odd rule] (1,0.6) ellipse[x radius=0.35, y radius=0.1] (1,0.6) ellipse[x radius=0.3, y radius=0.07];
  \fill[\thing@basket!75!black] (1,0.6) ellipse[x radius=0.3, y radius=0.07];
  \end{scope}
\fi%
%
% easter basket %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@easter
  \begin{scope}[xshift=-28.5]
  \begin{scope}
    \clip [start angle=180, end angle=0, x radius=0.3, y radius=0.45] (0.7,0.6) arc  -- cycle [start angle=180, end angle=360, x radius=0.3, y radius=0.07] (0.7,0.6) arc  -- cycle;
    \fill[\thing@eggb, rotate=-5]  (0.95,0.72) ellipse[x radius=0.09, y radius=0.13];
    \fill[\thing@egga, rotate=10]  (0.94,0.42) ellipse[x radius=0.09, y radius=0.13];
    \fill[\thing@eggc, rotate=-30] (0.7,1.08) ellipse[x radius=0.09, y radius=0.13];
  \end{scope}
  \end{scope}
\fi%
%
% crozier %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@crozier
  \begin{scope}[xshift=-20]
  \begin{scope}
    \clip [rotate=-20] (0.6,2.3) rectangle (1.1,1.999);
    \fill[even odd rule,\thing@crozier] (1.5,1.6) circle[radius=0.2] (1.5,1.6) circle[radius=0.1];
  \end{scope}
  \fill[\thing@crozier,rotate=-20] (0.663,0.5) rectangle (0.763,2.0);
  \end{scope}
\fi
%
% shovel %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@shovel
  \fill[brown!80!black,rotate around={-23:(0.11, 0.8)}] (0.07,0.2) rectangle ++(0.1,1.4);
  \fill[\thing@shovel] (-0.21, 0.86) .. controls (0.02, 0.72) and (0.11, 0.66) .. (0.38, 0.58) -- (0.01, 0.04) .. controls (-0.17, 0.02) and (-0.28, 0.07) .. (-0.37, 0.21) -- cycle;
\fi
%
% pickaxe %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@pickaxe
  \fill[brown!80!black,rotate around={-23:(0.11, 0.8)}] (0.07,0.2) rectangle ++(0.1,1.4);
  \fill[\thing@pickaxe] (-0.77, 0.57) .. controls (-0.14, 0.25) and (-0.02, 0.21) .. (0.60, 0.02) .. controls (-0.12, 0.03) and (-0.22, 0.10) .. (-0.77, 0.57) -- cycle;
\fi
%
% strawbroom %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@strawbroom
  \begin{scope}[xshift=-24]
    \fill[\thing@strawbroomstick] (0.9160,0.5478) -- (1.2792,1.6574) .. controls (1.3063,1.6961) and (1.3956,1.6649) .. (1.3688,1.6176) -- (0.9508,0.5179) .. controls (0.9360,0.5142) and (0.9202,0.5331) .. (0.9160,0.5478) -- cycle;
    \fill[\thing@strawbroom] (0.5528,0.2890) .. controls (0.6449,0.3598) and (0.7460,0.5693) .. (0.8911,0.6871) .. controls (0.9481,0.7215) and (1.0395,0.6925) .. (1.0553,0.6224) .. controls (1.1219,0.4385) and (0.9965,0.2147) .. (1.0056,0.1000) .. controls (0.8926,0.0241) and (0.5950,0.2078) .. (0.5528,0.2890) -- cycle;
    \draw[\thing@strawbroomribbon,line width=\scalingfactor*0.4pt] (0.7916,0.5876) .. controls (0.7916,0.5876) and (0.8210,0.5404) .. (0.8451,0.5304) .. controls (0.8708,0.5197) and (0.9021,0.5419) .. (0.9284,0.5329) .. controls (0.9544,0.5240) and (0.9663,0.4903) .. (0.9919,0.4806) .. controls (1.0148,0.4720) and (1.0653,0.4781) .. (1.0653,0.4781);
    \draw[\thing@strawbroomribbon,line width=\scalingfactor*0.4pt] (0.7565,0.5493) .. controls (0.7565,0.5493) and (0.7897,0.4961) .. (0.8169,0.4848) .. controls (0.8458,0.4727) and (0.8812,0.4978) .. (0.9109,0.4876) .. controls (0.9401,0.4776) and (0.9535,0.4396) .. (0.9824,0.4287) .. controls (1.0083,0.4189) and (1.0652,0.4259) .. (1.0652,0.4259);
  \end{scope}
\fi
%
% broom %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@broom
  \begin{scope}[rotate=-10,xshift=-23,yshift=-4]
    \draw[\thing@broomstick,line width=\scalingfactor*1.8pt] (0.9, 1.8) -- ++(0,-1.4);
    \draw[\thing@broomstick,line width=\scalingfactor*1.8pt] (0.6, 0.42) -- ++(0.6,0);
    \fill[\thing@broom] (0.6, 0.40) -- ++(-0.05,-0.1) -- ++(0.7,0) -- ++(-0.05, 0.1) -- cycle;
  \end{scope}
\fi
%
% umbrella %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@umbrella
  \path (-0.8, 0.4) rectangle (1.2200000000000002, 2.7);
  \begin{pgfinterruptboundingbox}
    \fill[gray] (-0.3078, 0.5942) -- (-0.2574, 0.6103) .. controls (-0.1724, 0.3884) and (-0.1145, 0.4523) .. (-0.0667, 0.6543) -- (-0.0666, 0.6545) -- (-0.0665, 0.6547) .. controls (0.0347, 1.0671) and (0.2906, 1.9565) .. (0.2906, 1.9565) -- (0.3415, 1.9419) .. controls (0.3415, 1.9419) and (0.0855, 1.0519) .. (-0.0151, 0.6423) -- (-0.0152, 0.642) .. controls (-0.076, 0.3633) and (-0.2126, 0.3312) .. (-0.3078, 0.5942) -- cycle;
    \fill[\thing@umbrella] (-0.7815, 1.9927) .. controls (-0.6441, 2.1962) and (-0.3163, 2.072) .. (-0.3239, 1.824) .. controls (-0.1602, 2.0111) and (0.1891, 1.9216) .. (0.1685, 1.6915) .. controls (0.3000, 1.8765) and (0.6639, 1.7626) .. (0.6607, 1.5356) .. controls (0.7865, 1.7271) and (1.135, 1.695) .. (1.1626, 1.4589) .. controls (1.4996, 2.5771) and (-0.4356, 3.2631) .. (-0.7815, 1.9927) -- cycle;
  \end{pgfinterruptboundingbox}
\fi
%
% closed umbrella %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@umbrellaclosed
  \fill[gray] (0.5401, 0.7996) -- (0.4872, 0.8019) .. controls (0.484, 1.0395) and (0.4076, 0.9995) .. (0.293, 0.8264) -- (0.2929, 0.8262) -- (0.2928, 0.8261) .. controls (0.0555, 0.4739) and (0.1223, 0.5608) .. (0.1223, 0.5608) -- (0.0795, 0.592) .. controls (0.0795, 0.592) and (0.0131, 0.5057) .. (0.2488, 0.8554) -- (0.2489, 0.8556) .. controls (0.4022, 1.0963) and (0.5414, 1.0793) .. (0.5401, 0.7996) -- cycle;
   \fill[\thing@umbrellaclosed] (-0.1173, 0.2263) -- (0.0038, 0.7188) -- (0.1548, 0.7494) -- (0.152, 0.9231) -- (0.3945, 0.7529) -- (0.2218, 0.6885) -- (0.2465, 0.5566) -- cycle;
\fi
%
% handbag %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@handbag
  \fill[\thing@handbag] (0.5189, 0.1751) -- (-0.1913, 0.3097) -- (-0.0315, 0.7086) -- (0.5168, 0.6152) -- cycle;
  \fill[\thing@handbag!70!black] (0.4143, 0.4354) .. controls (0.5139, 0.9811) and (0.1204, 1.0719) .. (0.0134, 0.5155) -- (0.0957, 0.4996) .. controls (0.1753, 0.8952) and (0.3949, 0.8883) .. (0.3324, 0.4536) -- cycle;
\fi
%
% stick %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@stick
  \begin{scope}[rotate=-30,yshift=26,xshift=-7]
    %leaf
    \begin{scope}[rotate=60, xshift=8.2,yshift=8.1]
    \fill[\thing@leaf] (-0.01,0) .. controls (-0.1,0) and (-0.02, 0.2) .. (0,0.2) .. controls (0.02, 0.2) and (0.1,0) .. (0.01,0.0);
    \path[clip] (-0.04,-0.04)-- (-0.01,0) .. controls (-0.1,0) and (-0.02, 0.2) .. (0,0.2) .. controls (0.02, 0.2) and (0.1,0) .. (0.01,0)-- (0.04,-0.04) --cycle;
    \draw[\thing@leaf!80!, line width=0.1] (0,-0.04) --  (0,0.2) \foreach \i in {0.02,0.04,...,0.2} {(0,\i) -- ++(0.1,\i) (0,\i) -- ++(-0.1,\i)} ;
    \end{scope}
    %stick itself
    \fill[\thing@stick!90!red] (-0.04,0.8) -- (-0.04,0.4) arc[start angle=345,end angle=270,radius=0.03] -- ++(0,-0.01) arc[start angle=90,end angle=15,radius=0.03] -- (-0.04,0) arc [start angle=180, end angle=360 ,x radius=0.04, y radius=0.02] -- (0.04, 0.4) arc [start angle=180, end angle=120, radius=0.08] arc [start angle=-90, end angle=90, x radius=0.02, y radius=0.04] arc [start angle=240, end angle=180, radius=0.08] -- (0.04,0.75) arc [start angle=0, end angle=120 ,x radius=0.04, y radius=0.02] --cycle;
    \fill[\thing@stick!90!] (0.08, 0.51) ellipse [x radius=0.02, y radius=0.04] (0,0.75) ellipse [x radius=0.04, y radius=0.02] ;
    \draw[\thing@stick!90!red, line width=0.06] (0.08, 0.51) ellipse [x radius=0.016, y radius=0.032]
    ellipse [x radius=0.012, y radius=0.024] ellipse [x radius=0.008, y radius=0.016] (0,0.75) ellipse [y radius=0.016, x radius=0.032] ellipse [y radius=0.012, x radius=0.024]  ellipse [y radius=0.008, x radius=0.016] ;
    \fill[\thing@stick!90!red] (0.08, 0.51) ellipse [x radius=0.004, y radius=0.008] (0,0.75) ellipse [x radius=0.008, y radius=0.004];
  \end{scope}
\fi
%
% towel %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@towel
  \begin{scope}[xshift=-26]
    \fill[\thing@towel]  (0.6457, 0.9482).. controls (0.6509, 1.028) and (1.3581, 1.0564) .. (1.3736, 0.9841).. controls (1.4459, 0.6474) and (1.3166, 0.8398) .. (1.4272, 0.3739).. controls (1.3567, 0.243) and (1.2095, 0.2817) .. (1.0938, 0.2664).. controls (0.9612, 0.2488) and (0.9142, 0.1883) .. (0.693, 0.286).. controls (0.7014, 0.7758) and (0.6221, 0.5838) .. (0.6457, 0.9482) -- cycle;
  \end{scope}
\fi
%
% present %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthing@present
  \fill[\thing@presentbottom] (-0.3, 0.35) rectangle (0.3, 0.9);
  \fill[\thing@presenttop] (-0.32, 0.75) rectangle (0.32, 0.95);
  \fill[\thing@presentribbon] (-0.05, 0.35) rectangle (0.05, 0.95);
  \draw[\thing@presentribbon,line width=\scalingfactor*0.8pt, in=0, out=40,loop,min distance=12] (0, 0.95) to (0, 0.95);
  \draw[\thing@presentribbon,line width=\scalingfactor*0.8pt, in=40, out=80,loop,min distance=12] (0, 0.95) to (0, 0.95);
  \draw[\thing@presentribbon,line width=\scalingfactor*0.8pt,in=100, out=140,loop,min distance=12] (0, 0.95) to (0, 0.95);
  \draw[\thing@presentribbon,line width=\scalingfactor*0.8pt,in=140, out=180,loop,min distance=12] (0, 0.95) to (0, 0.95);
\fi
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Random items
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pgfmathdeclarerandomlist{head}{\thing@listhead}
\pgfmathdeclarerandomlist{accessories}{\thing@listacces}

\def\shufflethings{%
 \pgfmathrandomitem{\head}{head}%
 \edef\randomhead{\head}%
 \pgfmathrandomitem{\accessories}{accessories}%
 \edef\randomaccessories{\accessories}%
}
