WIP: goblin/radar #112

Closed
Dandaedre wants to merge 2 commits from goblin/radar into review
6 changed files with 470 additions and 5 deletions

View File

@ -1,7 +1,50 @@
\section{Specialiste de Armes Lourdes}
Excelle à infliger de lourds dégâts et à incapaciter ses cibles. Le spécialiste des Armes Lourdes souffre d’importants problèmes de manœuvrabilité et de défense, qu’il compense par ses grandes Capacités de Contrôle.\\
Mécanique exclusive : \mecanique{Delicate destruction}.
\section{Spécialiste des Armes Lourdes}
\begin{wrapfigure}{r}{0.35\textwidth}
\begin{asy}
settings.outformat="pdf";
size(160);
real[] data={
3.006912442,
3.977338421,
0.2530541012,
0.001,
5,
2.696019019,
1.916932907,
};
pen op=opacity(0.8);
pen[] Pens={
op+rgb(0.467, 0.455, 0.231),
op+rgb(0.682, 0.365, 0.251),
op+rgb(0.702, 0.647, 0.333),
op+rgb(0.549, 0.671, 0.631),
op+rgb(0.82, 0.694, 0.529),
op+rgb(0.341, 0.282, 0.322),
op+rgb(0.549, 0.671, 0.631),
};
string[] Legend={
"Support",
"Dégats",
"Survivabilité",
"Mobilité",
"C.C.",
"Altérations",
"QoL",
};
RadarPlot rp=RadarPlot(data,Legend,Pens,maxY=5,Step=1);
rp.draw();
\end{asy}
\end{wrapfigure}
Excelle à infliger de lourds dégâts et à neutraliser ses cibles. Le spécialiste des Armes Lourdes souffre d’importants problèmes de manœuvrabilité et de défense, qu’il compense par ses grandes Capacités de Contrôle.\\
Mécanique exclusive : \mecanique{Delicate destruction}.
\input{Tables/SpecialisteArmesLourdes-data.tex}

99
Misc/Radar.tex Normal file
View File

@ -0,0 +1,99 @@
\begin{asydef}
struct RadarPlot{
real[] data;
string[] Legend;
pen[] Pens;
pen gridPen;
pen axisPen;
pen labelPen;
pen legendPen;
int n,m;
real pieAngle;
int maxX;
int maxY;
real step;
real Step;
pair O=(0,0);
void drawSectors(){
guide g;
for(int i=0;i<n;++i){
g=arc(0,data[i],i*pieAngle,(i+1)*pieAngle);
fill(O--g--cycle,Pens[i%m]);
}
}
void drawGrid(){
for(int i=1;i<=(int)(maxY/step);++i){
draw(circle(O,i*step),gridPen);
}
for(int i=0;i<maxX;++i){
draw(rotate(i*360/maxX)*(O--(maxY,0)),gridPen);
}
}
void drawLabels(){
for(int i=1;i<=(int)(maxY/Step);++i){
draw(Label(string(i*Step),(i*Step,0)),roundbox,filltype=UnFill,labelPen);
}
}
void drawLegend(){
transform t;
real a;
pair v;
for(int i=0;i<n;++i){
a=(i-1.25)*pieAngle;
t=rotate(a+90);
v=t*(5,0);
if(a<90 || a>270){
label(rotate(-90)*t*Legend[i],v,unit(v),legendPen);
}else{
label(rotate(a-180)*Legend[i],v,unit(v),legendPen);
}
}
}
void draw(){
drawGrid();
drawSectors();
drawLabels();
drawLegend();
}
void putText(string s, real x, real y, pair pos=O, pen p=currentpen){
label(s,rotate(x*pieAngle)*(y,0),pos,p);
}
void operator init(real[] data, string[] Legend, pen[] Pens
,int maxX=2data.length
,int maxY=(int)max(data)+1
,pen gridPen=rgb(0.912,0.9,0.876)
,pen axisPen=black
,pen labelPen=black
,pen legendPen=black
,real step=1
,real Step=2step
){
this.data=copy(data);
this.Pens=copy(Pens);
this.Legend=copy(Legend);
this.n=data.length;
this.m=Pens.length;
this.pieAngle=360/n;
this.maxX=maxX;
this.maxY=maxY;
this.gridPen=gridPen;
this.axisPen=axisPen;
this.labelPen=labelPen;
this.legendPen=legendPen;
this.step=step;
this.Step=Step;
}
};
\end{asydef}

View File

@ -25,9 +25,11 @@
\usepackage{tabularray} % Greatest tables so far
\usepackage{tkz-graph} % Great tkz graphs !
\usepackage[inline]{asymptote} % /!\ Hazardous ! Adds the radar package. Very cursed.
% How our graphics behave
\epstopdfDeclareGraphicsRule{.pdf}{png}{.png}{convert #1 \OutputFile}
\DeclareGraphicsExtensions{.png,.pdf}
%\epstopdfDeclareGraphicsRule{.pdf}{png}{.png}{convert #1 \OutputFile}
%\DeclareGraphicsExtensions{.png,.pdf}
% How our glossaries behave
\usepackage[nopostdot, style=super, nonumberlist, toc]{glossaries}
@ -65,3 +67,6 @@
\usepackage{lmodern} % Changes font for a microtype font
\usepackage{microtype} % Adds microtype features (reduces overflow by 50%)
\usepackage{hyperref} % Adds the \nameref command % Best practice says: load last
% Radar
\input{Misc/Radar.tex}

149
Ravenous-1.asy Normal file
View File

@ -0,0 +1,149 @@
if(!settings.multipleView) settings.batchView=false;
settings.tex="pdflatex";
settings.inlinetex=true;
deletepreamble();
defaultfilename="Ravenous-1";
if(settings.render < 0) settings.render=4;
settings.outformat="";
settings.inlineimage=true;
settings.embed=true;
settings.toolbar=false;
viewportmargin=(2,2);
struct RadarPlot{
real[] data;
string[] Legend;
pen[] Pens;
pen gridPen;
pen axisPen;
pen labelPen;
pen legendPen;
int n,m;
real pieAngle;
int maxX;
int maxY;
real step;
real Step;
pair O=(0,0);
void drawSectors(){
guide g;
for(int i=0;i<n;++i){
g=arc(0,data[i],i*pieAngle,(i+1)*pieAngle);
fill(O--g--cycle,Pens[i%m]);
}
}
void drawGrid(){
for(int i=1;i<=(int)(maxY/step);++i){
draw(circle(O,i*step),gridPen);
}
for(int i=0;i<maxX;++i){
draw(rotate(i*360/maxX)*(O--(maxY,0)),gridPen);
}
}
void drawLabels(){
for(int i=1;i<=(int)(maxY/Step);++i){
draw(Label(string(i*Step),(i*Step,0)),roundbox,filltype=UnFill,labelPen);
}
}
void drawLegend(){
transform t;
real a;
pair v;
for(int i=0;i<n;++i){
a=(i-1.25)*pieAngle;
t=rotate(a+90);
v=t*(5,0);
if(a<90 || a>270){
label(rotate(-90)*t*Legend[i],v,unit(v),legendPen);
}else{
label(rotate(a-180)*Legend[i],v,unit(v),legendPen);
}
}
}
void draw(){
drawGrid();
drawSectors();
drawLabels();
drawLegend();
}
void putText(string s, real x, real y, pair pos=O, pen p=currentpen){
label(s,rotate(x*pieAngle)*(y,0),pos,p);
}
void operator init(real[] data, string[] Legend, pen[] Pens
,int maxX=2data.length
,int maxY=(int)max(data)+1
,pen gridPen=rgb(0.912,0.9,0.876)
,pen axisPen=black
,pen labelPen=black
,pen legendPen=black
,real step=1
,real Step=2step
){
this.data=copy(data);
this.Pens=copy(Pens);
this.Legend=copy(Legend);
this.n=data.length;
this.m=Pens.length;
this.pieAngle=360/n;
this.maxX=maxX;
this.maxY=maxY;
this.gridPen=gridPen;
this.axisPen=axisPen;
this.labelPen=labelPen;
this.legendPen=legendPen;
this.step=step;
this.Step=Step;
}
};
settings.outformat="pdf";
size(160);
real[] data={
3.006912442,
3.977338421,
0.2530541012,
0.001,
5,
2.696019019,
1.916932907,
};
pen op=opacity(0.8);
pen[] Pens={
op+rgb(0.467, 0.455, 0.231),
op+rgb(0.682, 0.365, 0.251),
op+rgb(0.702, 0.647, 0.333),
op+rgb(0.549, 0.671, 0.631),
op+rgb(0.82, 0.694, 0.529),
op+rgb(0.341, 0.282, 0.322),
op+rgb(0.549, 0.671, 0.631),
};
string[] Legend={
"Support",
"Dégats",
"Survivabilité",
"Mobilité",
"C.C.",
"Altérations",
"QoL",
};
RadarPlot rp=RadarPlot(data,Legend,Pens,maxY=5,Step=1);
rp.draw();

164
Ravenous-1.tex Normal file
View File

@ -0,0 +1,164 @@
\setlength{\unitlength}{1pt}%
\makeatletter%
\let\ASYencoding\f@encoding%
\let\ASYfamily\f@family%
\let\ASYseries\f@series%
\let\ASYshape\f@shape%
\makeatother%
{\catcode`"=12%
\includegraphics{\ASYprefix\jobname-1_0}%
}%
\special{pdf:q}%
\begin{picture}( 155.315301, 160.600000)%
\special{pdf:\ASYraw{
-142.100800 17.416920 m
-12.587146 17.416920 l
-12.587146 142.758562 l
-142.100800 142.758562 l
-142.100800 17.416920 l
h
-21.931170 77.393217 m
-21.931170 82.782265 l
-21.931170 84.247591 -20.743289 85.435472 -19.277963 85.435472 c
-15.740353 85.435472 l
-14.275027 85.435472 -13.087146 84.247591 -13.087146 82.782265 c
-13.087146 77.393217 l
-13.087146 75.927891 -14.275027 74.740010 -15.740353 74.740010 c
-19.277963 74.740010 l
-20.743289 74.740010 -21.931170 75.927891 -21.931170 77.393217 c
h
W* n
}%
}%
\special{pdf:q}%
\special{pdf:\ASYraw{
-142.100800 17.416920 m
-16.759158 17.416920 l
-16.759158 142.758562 l
-142.100800 142.758562 l
-142.100800 17.416920 l
h
-34.315335 77.393217 m
-34.315335 82.782265 l
-34.315335 84.247591 -33.127453 85.435472 -31.662127 85.435472 c
-28.124517 85.435472 l
-26.659191 85.435472 -25.471310 84.247591 -25.471310 82.782265 c
-25.471310 77.393217 l
-25.471310 75.927891 -26.659191 74.740010 -28.124517 74.740010 c
-31.662127 74.740010 l
-33.127453 74.740010 -34.315335 75.927891 -34.315335 77.393217 c
h
W* n
}%
}%
\special{pdf:q}%
\special{pdf:\ASYraw{
-142.100800 17.416920 m
-16.759158 17.416920 l
-16.759158 142.758562 l
-142.100800 142.758562 l
-142.100800 17.416920 l
h
-46.699499 77.393217 m
-46.699499 82.782265 l
-46.699499 84.247591 -45.511617 85.435472 -44.046291 85.435472 c
-40.508681 85.435472 l
-39.043355 85.435472 -37.855474 84.247591 -37.855474 82.782265 c
-37.855474 77.393217 l
-37.855474 75.927891 -39.043355 74.740010 -40.508681 74.740010 c
-44.046291 74.740010 l
-45.511617 74.740010 -46.699499 75.927891 -46.699499 77.393217 c
h
W* n
}%
}%
\special{pdf:q}%
\special{pdf:\ASYraw{
-142.100800 17.416920 m
-16.759158 17.416920 l
-16.759158 142.758562 l
-142.100800 142.758562 l
-142.100800 17.416920 l
h
-59.083663 77.393217 m
-59.083663 82.782265 l
-59.083663 84.247591 -57.895782 85.435472 -56.430456 85.435472 c
-52.892846 85.435472 l
-51.427520 85.435472 -50.239638 84.247591 -50.239638 82.782265 c
-50.239638 77.393217 l
-50.239638 75.927891 -51.427520 74.740010 -52.892846 74.740010 c
-56.430456 74.740010 l
-57.895782 74.740010 -59.083663 75.927891 -59.083663 77.393217 c
h
W* n
}%
}%
\special{pdf:q}%
\special{pdf:\ASYraw{
-142.100800 17.416920 m
-16.759158 17.416920 l
-16.759158 142.758562 l
-142.100800 142.758562 l
-142.100800 17.416920 l
h
-71.467827 77.393217 m
-71.467827 82.782265 l
-71.467827 84.247591 -70.279946 85.435472 -68.814620 85.435472 c
-65.277010 85.435472 l
-63.811684 85.435472 -62.623802 84.247591 -62.623802 82.782265 c
-62.623802 77.393217 l
-62.623802 75.927891 -63.811684 74.740010 -65.277010 74.740010 c
-68.814620 74.740010 l
-70.279946 74.740010 -71.467827 75.927891 -71.467827 77.393217 c
h
W* n
}%
}%
\special{pdf:Q}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%
\ASYalign(-67.297237,80.388070)(-0.500000,-0.500000){1}%
\special{pdf:Q}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%
\ASYalign(-54.866632,80.388070)(-0.500000,-0.500000){2}%
\special{pdf:Q}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%
\ASYalign(-42.436027,80.388070)(-0.500000,-0.500000){3}%
\special{pdf:Q}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%
\ASYalign(-30.005422,80.388070)(-0.500000,-0.500000){4}%
\end{picture}%
\kern -155.315301pt%
\special{pdf:Q}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%
\ASYalign(-17.574817,80.388070)(-0.500000,-0.500000){5}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\ASYalignT(-20.486414,108.917238)(-0.500000,0.221517){0.433884 -0.900969 0.900969 0.433884}{Support}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\ASYalignT(-65.096417,144.492529)(-0.500000,0.218749){0.974928 -0.222521 0.222521 0.974928}{Dégats}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\ASYalignT(-120.724182,131.795854)(-0.500000,0.000000){0.781831 0.623490 -0.623490 0.781831}{Survivabilité}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\ASYalignT(-145.480866,80.388070)(-0.500000,-1.000000){0.000000 -1.000000 1.000000 0.000000}{Mobilité}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\ASYalignT(-120.724182,28.980286)(-0.500000,-1.000000){0.781831 -0.623490 0.623490 0.781831}{C.C.}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\ASYalignT(-65.096417,16.283611)(-0.500000,-1.000000){0.974928 0.222521 -0.222521 0.974928}{Altérations}%
\special{pdf:0.000000 g}%
\fontsize{12.000000}{14.400000}\selectfont%
\ASYalignT(-20.486414,51.858902)(-0.500000,-0.778483){0.433884 0.900969 -0.900969 0.433884}{QoL}%

5
latexmkrc Normal file
View File

@ -0,0 +1,5 @@
sub asy {return system("asy -o '$_[0]' '$_[0]'");}
add_cus_dep("asy","eps",0,"asy");
add_cus_dep("asy","pdf",0,"asy");
add_cus_dep("asy","tex",0,"asy");
push @generated_exts, "pre", "%R-[0-9]*.pdf", "%R-[0-9]*.prc", "%R-[0-9]*.tex", "%R-[0-9]*.out", "%R-[0-9]*.pbsdat", "%R.pbsdat", "%R-[0-9]*.eps", "%R-*.asy"