%!TEX pdflatex

\documentclass{article}
\usepackage{tikz,simplekv,xstring,calc}

\def\samplestrutletters{AZERTYUIOPSDFGHKLMWXCVBN}
\def\sampledstrutletters{azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN}
\defKV[pictodball]{height=\def\pictodballheight{#1},strut=\def\pictodballstrut{#1},dstrut=\def\pictodballdstrut{#1},maincolor=\colorlet{maindball}{#1},starcolor=\colorlet{stardball}{#1}}
\setKVdefault[pictodball]{height=dauto,dstrut=\sampledstrutletters,strut=\samplestrutletters,bw=false,maincolor=orange,starcolor=purple!75!red}

\makeatletter
\newlength\dragonb@total@height
\newlength\dragonb@depth
\def\dballbigradius{0.12}
\def\dballsmallradius{0.05}
\tikzstyle{scorestars}=[star,star points=5,star point ratio=2.25]%
\colorlet{maindball}{orange}
\colorlet{stardball}{purple!50!red}

\newcommand\intdballstar[1]{%1 = pos
	\begin{scope}[shift={#1},rotate=18]
		\draw[dball stars] 
		(0:\dballbigradius\dragonb@total@height) -- 
		(36:\dballsmallradius\dragonb@total@height) -- 
		(72:\dballbigradius\dragonb@total@height) -- 
		(108:\dballsmallradius\dragonb@total@height) -- 
		(144:\dballbigradius\dragonb@total@height) -- 
		(180:\dballsmallradius\dragonb@total@height) -- 
		(216:\dballbigradius\dragonb@total@height) -- 
		(252:\dballsmallradius\dragonb@total@height) -- 
		(288:\dballbigradius\dragonb@total@height) -- 
		(324:\dballsmallradius\dragonb@total@height) -- 
		cycle;
	\end{scope}
}

\NewDocumentCommand\pictodragonball{ O{} D<>{} m }{%
	\restoreKV[pictodball]%
	\setKV[pictodball]{#1}%
	\if\relax\detokenize{#3}\relax%
	\def\dballnbstars{0}%
	\else%
	\def\dballnbstars{#3}%
	\fi%
	\IfStrEqCase{\pictodballheight}{%
		{dauto}%
		{%
			\settototalheight\dragonb@total@height{\hbox{\pictodballdstrut}}%
			\settodepth\dragonb@depth{\hbox{\pictodballdstrut}}%
			\begin{tikzpicture}[baseline=-0.5\dragonb@total@height+\dragonb@depth,x=\dragonb@total@height,y=\dragonb@total@height,line width=0.03\dragonb@total@height,#2]
		}%
		{auto}%
		{%
			\settototalheight\dragonb@total@height{\hbox{\pictodballstrut}}%
			\settodepth\dragonb@depth{\hbox{\pictodballstrut}}%
			\begin{tikzpicture}[baseline=-0.5\dragonb@total@height+\dragonb@depth,x=\dragonb@total@height,y=\dragonb@total@height,line width=0.03\dragonb@total@height,#2]
			}%
		}[%
			\setlength\dragonb@total@height{\pictodballheight}%
			\begin{tikzpicture}[x=\dragonb@total@height,y=\dragonb@total@height,line width=0.03\dragonb@total@height,#2]
		]%
		%styles
		\ifboolKV[pictodball]{bw}%
			{%
			\tikzset{dball background/.style={lightgray!15}}
			\tikzset{dball dark background/.style={gray!50}}
			\tikzset{dball stars/.style={line width=0.005\dragonb@total@height,fill=darkgray!50!black,draw=darkgray!25!black,rounded corners=0.01\dragonb@total@height}}
			\tikzset{dball shadow/.style={lightgray!37!white}}
			\tikzset{dball border/.style={black}}
			}%
			{%
			\tikzset{dball background/.style={maindball!75}}
			\tikzset{dball dark background/.style={maindball!75!gray}}
			\tikzset{dball stars/.style={line width=0.005\dragonb@total@height,fill=stardball!88,draw=stardball,rounded corners=0.01\dragonb@total@height}}
			\tikzset{dball shadow/.style={lightgray!50!white}}
			\tikzset{dball border/.style={maindball!10!black}}
			}%
		%beginball
		\fill[dball dark background] (0,0) circle[radius=0.5\dragonb@total@height] ;
		\begin{scope}
			\clip (0,0) circle[radius=0.5\dragonb@total@height] ;
			\fill[dball background] (-0.2\dragonb@total@height,0.125\dragonb@total@height) circle[radius=0.55\dragonb@total@height] ;
		\end{scope}
		\fill[dball shadow,rotate=20] (0,0.375\dragonb@total@height) circle[x radius=0.15\dragonb@total@height,y radius=0.075\dragonb@total@height] ;
		\fill[dball shadow,rotate=105] (0,0.425\dragonb@total@height) circle[x radius=0.10\dragonb@total@height,y radius=0.025\dragonb@total@height] ;
		\draw[dball border] (0,0) circle[radius=0.485\dragonb@total@height] ;
		%endball
		%beginstars
		\ifnum\dballnbstars=1
			\intdballstar{(0,0)}
		\fi
			\ifnum\dballnbstars=2
			\intdballstar{(135:0.15\dragonb@total@height)}
			\intdballstar{(-45:0.15\dragonb@total@height)}
		\fi
		\ifnum\dballnbstars=3
			\intdballstar{(90:0.175\dragonb@total@height)}
			\intdballstar{(-30:0.175\dragonb@total@height)}
			\intdballstar{(-150:0.175\dragonb@total@height)}
		\fi
		\ifnum\dballnbstars=4
			\intdballstar{(45:0.175\dragonb@total@height)}
			\intdballstar{(-45:0.2\dragonb@total@height)}
			\intdballstar{(-135:0.175\dragonb@total@height)}
			\intdballstar{(135:0.2\dragonb@total@height)}
		\fi
		\ifnum\dballnbstars=5
			\intdballstar{(10:0.235\dragonb@total@height)}
			\intdballstar{(82:0.235\dragonb@total@height)}
			\intdballstar{(154:0.235\dragonb@total@height)}
			\intdballstar{(226:0.235\dragonb@total@height)}
			\intdballstar{(298:0.235\dragonb@total@height)}
		\fi
		\ifnum\dballnbstars=6
			\intdballstar{(0,0)}
			\intdballstar{(10:0.235\dragonb@total@height)}
			\intdballstar{(82:0.235\dragonb@total@height)}
			\intdballstar{(154:0.235\dragonb@total@height)}
			\intdballstar{(226:0.235\dragonb@total@height)}
			\intdballstar{(298:0.235\dragonb@total@height)}
		\fi
		\ifnum\dballnbstars=7
			\intdballstar{(0,0)}
			\intdballstar{(0:0.235\dragonb@total@height)}
			\intdballstar{(60:0.235\dragonb@total@height)}
			\intdballstar{(120:0.235\dragonb@total@height)}
			\intdballstar{(180:0.235\dragonb@total@height)}
			\intdballstar{(240:0.235\dragonb@total@height)}
			\intdballstar{(300:0.235\dragonb@total@height)}
		\fi
		%endstars
	\end{tikzpicture}%
}
\makeatother

\begin{document}

{\large%
q\pictodragonball{}%
\pictodragonball{1}%
\pictodragonball{2}%
\pictodragonball{3}%
\pictodragonball{4}%
\pictodragonball{5}%
\pictodragonball{6}%
\pictodragonball{7}B%
}

\end{document}