summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/rpgicons/rpgicons-l3.sty
blob: 491d05b17d0e2cdf85d21fa519896af2bc099fdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
% File: rpgicons-l3.sty 
% Copyright 2024 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'.
% 
\ProvidesExplPackage {rpgicons-l3} {2024-04-28} {1.8.2} 
    {rpg Icons Package (l3 Variant)}

\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
}

\bool_new:N \l__rpgicons_compat_mode_bool
\bool_new:N \l__rpgicons_use_opacity_bool
\keys_define:nn { rpgicons / package ~ options } { 
    compat      .bool_set:N = \l__rpgicons_compat_mode_bool ,
    compat      .default:n  = { true } ,
    opacity     .bool_set:N = \l__rpgicons_use_opacity_bool ,
    opacity     .default:n  = { true } ,
}
\ProcessKeyOptions [ rpgicons / package ~ options ]

\msg_new:nnn { rpgicons } { documentmetadata-missing } {
    \msg_warning_text:n { dnicons } \iow_newline:
    In ~ order ~ to ~ use ~ opacity, ~ \token_to_str:N \DocumentMetadata \c_space_tl must ~ be ~ set.
}
\msg_new:nnn { rpgicons } { opacity-option-missing } {
    \msg_warning_text:n { dnicons } \iow_newline:
    In ~ order ~ to ~ use ~ opacity, ~ the ~ package ~ must ~ be ~ loaded ~ with ~ the ~ `opacity' ~ option.
}
\msg_new:nnn { rpgicons } { l3draw-old } {
    \msg_warning_text:n { dnicons } \iow_newline:
    The ~ version ~ of ~ the ~ `l3draw' ~  package ~ is ~ older ~ than ~ 2024-03-14. ~
    Consider ~ using ~ the ~ `compat' ~ option.
}

\bool_if:NT \l__rpgicons_use_opacity_bool {
    \IfDocumentMetadataTF { } {
        \msg_error:nn { rpgicons } { documentmetadata-missing }
    }
    \RequirePackage { l3opacity }
    \bool_if:NT \l__rpgicons_compat_mode_bool {
        % l3opacity fix
        \tl_set:Nn \l__opacity_backend_fill_tl { 1 }
        \tl_set:Nn \l__opacity_backend_stroke_tl { 1 }
    }
}

\RequirePackage { l3draw }

\IfPackageAtLeastTF { l3draw } { 2024/03/14 } { } {
    \bool_if:NF \l__rpgicons_compat_mode_bool {
        \msg_warning:nn { rpgicons } { l3draw-old }
    }
}

% DICE

\cs_new:Npn \rpgicons_draw_shape_twoside: {
    \draw_path_ellipse:nnn { 0cm , 0cm } { 0cm , .25cm } { .425cm , 0cm }
}

\cs_new:Npn \rpgicons_draw_shape_fourside: {
    \draw_path_moveto:n { 0cm , .35cm }
    \draw_path_lineto:n { .433cm , -.4cm }
    \draw_path_lineto:n { -.433cm , -.4cm }
    \draw_path_close:
}

\cs_new:Npn \rpgicons_draw_shape_sixside: {
    \bool_if:NTF \l__rpgicons_compat_mode_bool {
        % l3draw rectangle fix
        \draw_path_moveto:n { -.4cm , -.4cm }
        \draw_path_lineto:n { -.4cm , .4cm }
        \draw_path_lineto:n { .4cm , .4cm }
        \draw_path_lineto:n { .4cm , -.4cm }
        \draw_path_close:
    } {
        \draw_path_rectangle_corners:nn { -.4cm , -.4cm } { .4cm , .4cm }
    }
}

\cs_new:Npn \rpgicons_draw_shape_eightside: {
    \draw_path_moveto:n { 0cm , .5cm }
    \draw_path_lineto:n { .433cm , .25cm }
    \draw_path_lineto:n { .433cm , -.25cm }
    \draw_path_lineto:n { 0cm , -.5cm }
    \draw_path_lineto:n { -.433cm , -.25cm }
    \draw_path_lineto:n { -.433cm , .25cm }
    \draw_path_close:
    \draw_path_lineto:n { .433cm , -.25cm }
    \draw_path_lineto:n { -.433cm , -.25cm }
    \draw_path_close:
}

\cs_new:Npn \rpgicons_draw_shape_tenside: {
    \draw_path_moveto:n { 0cm , .5cm }
    \draw_path_lineto:n { .475cm , .1cm }
    \draw_path_lineto:n { .475cm , -.1cm }
    \draw_path_lineto:n { 0cm , -.5cm }
    \draw_path_lineto:n { -.475cm , -.1cm }
    \draw_path_lineto:n { -.475cm , .1cm }
    \draw_path_close:
    \draw_path_lineto:n { .294cm , -.154cm }
    \draw_path_lineto:n { 0cm , -.3cm }
    \draw_path_lineto:n { -.294cm , -.154cm }
    \draw_path_close:
    \draw_path_moveto:n { .294cm , -.154cm }
    \draw_path_lineto:n { .475cm , -.1cm }
    \draw_path_moveto:n { -.475cm , -.1cm }
    \draw_path_lineto:n { -.294cm , -.154cm }
    \draw_path_moveto:n { 0cm , -.5cm }
    \draw_path_lineto:n { 0cm , -.3cm }
}

\cs_new:Npn \rpgicons_draw_shape_twelveside: {
    \draw_path_moveto:n { 0cm , .5cm }
    \draw_path_lineto:n { 0.294cm , .405cm }
    \draw_path_lineto:n { .475cm , .173cm }
    \draw_path_lineto:n { .475cm , -.173cm }
    \draw_path_lineto:n { .294cm , -.405cm }
    \draw_path_lineto:n { 0cm , -.5cm }
    \draw_path_lineto:n { -.294cm , -.405cm }
    \draw_path_lineto:n { -.475cm , -.173cm }
    \draw_path_lineto:n { -.475cm , .173cm }
    \draw_path_lineto:n { -.294cm , .405cm }
    \draw_path_close:
    \draw_path_moveto:n { 0cm , .349cm }
    \draw_path_lineto:n { .332cm , .108cm }
    \draw_path_lineto:n { .205cm , -.282cm }
    \draw_path_lineto:n { -.205cm , -.282cm }
    \draw_path_lineto:n { -.332cm , .108cm }
    \draw_path_close:
    \draw_path_lineto:n { 0cm , .5cm }
    \draw_path_moveto:n { .475cm , .173cm }
    \draw_path_lineto:n { .332cm , .108cm }
    \draw_path_moveto:n { .294cm , -.405cm }
    \draw_path_lineto:n { .205cm , -.282cm }
    \draw_path_moveto:n { -.294cm , -.405cm }
    \draw_path_lineto:n { -.205cm , -.282cm }
    \draw_path_moveto:n { -.475cm , .173cm }
    \draw_path_lineto:n { -.332cm , .108cm }
}

\cs_new:Npn \rpgicons_draw_shape_twentyside: {
    \draw_path_moveto:n { 0cm , .5cm }
    \draw_path_lineto:n { .454cm , .262cm }
    \draw_path_lineto:n { .454cm , -.262cm }
    \draw_path_lineto:n { 0cm , -.5cm }
    \draw_path_lineto:n { -.454cm , -.262cm }
    \draw_path_lineto:n { -.454cm , .262cm }
    \draw_path_close:
    \draw_path_moveto:n { 0cm , .292cm }
    \draw_path_lineto:n { .253cm , -.146cm }
    \draw_path_lineto:n { -.253cm , -.146cm }
    \draw_path_close:
    \draw_path_lineto:n { .454cm , .262cm }
    \draw_path_lineto:n { .253cm , -.146cm }
    \draw_path_lineto:n { 0cm , -.5cm }
    \draw_path_lineto:n { -.253cm , -.146cm }
    \draw_path_lineto:n { -.454cm , .262cm }
    \draw_path_close:
    \draw_path_lineto:n { 0cm , .5cm }
    \draw_path_moveto:n { .454cm , -.262cm }
    \draw_path_lineto:n { .253cm , -.146cm }
    \draw_path_moveto:n { -.454cm , -.262cm }
    \draw_path_lineto:n { -.253cm , -.146cm }
}

\cs_new:Npn \rpgicons_draw_shape_hundredside: {
    \draw_path_circle:nn { 0cm, 0cm } { .425cm }
    \draw_path_moveto:n { .425cm , 0cm }
    \draw_path_arc:nnnn { 180 } { 50 } { -.425cm } { -.2cm }
    \draw_path_moveto:n { 0cm , -.425cm }
    \draw_path_arc:nnnn { 270 } { 140 } { -.2cm } { .425cm } 
}

\clist_new:N \l_rpgnicons_pips_clist
\fp_new:N \l_rpgnicons_pips_coordx_fp
\fp_new:N \l_rpgnicons_pips_coordy_fp
\cs_new:Npn \rpgicons_draw_shape_sixside_pips:n #1 {
    \str_case:nn {#1} {
        { one } { \clist_set:Nn \l_rpgnicons_pips_clist {
            { 0cm , 0cm }
        } }
        { two } { \clist_set:Nn \l_rpgnicons_pips_clist {
            { -.2cm , .2cm } , { .2cm , -.2cm }
        } }
        { three } { \clist_set:Nn \l_rpgnicons_pips_clist {
            { -.2cm , .2cm } , { 0cm , 0cm } , { .2cm , -.2cm }
        } }
        { four } { \clist_set:Nn \l_rpgnicons_pips_clist {
            { -.2cm , .2cm } , { .2cm , .2cm } ,
            { -.2cm , -.2cm } , { .2cm , -.2cm }
        } }
        { five } { \clist_set:Nn \l_rpgnicons_pips_clist {
            { -.2cm , .2cm } , { .2cm , .2cm } ,
            { 0cm , 0cm } ,
            { -.2cm , -.2cm } , { .2cm , -.2cm }
        } }
        { six } { \clist_set:Nn \l_rpgnicons_pips_clist {
            { -.2cm , .2cm } , { .2cm , .2cm } ,
            { -.2cm , 0cm } , { .2cm , 0cm } ,
            { -.2cm , -.2cm } , { .2cm , -.2cm }
        } }
        { seven } { \clist_set:Nn \l_rpgnicons_pips_clist {
            { -.2cm , .2cm } , { .2cm , .2cm } ,
            { -.2cm , 0cm } , { 0cm , 0cm } , { .2cm , 0cm } ,
            { -.2cm , -.2cm } , { .2cm , -.2cm }
        } }
        { eight } { \clist_set:Nn \l_rpgnicons_pips_clist {
            { -.2cm , .2cm } , { 0cm , .2cm } , { .2cm , .2cm } ,
            { -.2cm , 0cm } , { .2cm , 0cm } ,
            { -.2cm , -.2cm } , { 0cm , -.2cm } , { .2cm , -.2cm }
        } }
        { nine } { \clist_set:Nn \l_rpgnicons_pips_clist {
            { -.2cm , .2cm } , { 0cm , .2cm } , { .2cm , .2cm } ,
            { -.2cm , 0cm } , { 0cm , 0cm } , { .2cm , 0cm } ,
            { -.2cm , -.2cm } , { 0cm , -.2cm } , { .2cm , -.2cm }
        } }
    }
    \clist_map_inline:Nn \l_rpgnicons_pips_clist {
        \fp_set:Nn \l_rpgnicons_pips_coordx_fp { \clist_item:nn {##1} { 1 } }
        \fp_set:Nn \l_rpgnicons_pips_coordy_fp { \clist_item:nn {##1} { 2 } }
        \draw_path_circle:nn { \l_rpgnicons_pips_coordx_fp , \l_rpgnicons_pips_coordy_fp } { 2pt }
    }
    \draw_path_use_clear:n { fill }
    \rpgicons_draw_shape_sixside:
}

\cs_new:Npn \rpgicons_draw_shape_fudge: {
    \rpgicons_draw_shape_sixside:
    \draw_path_moveto:n { -.15cm , .1cm }
    \draw_path_lineto:n { .15cm , .1cm }
    \draw_path_moveto:n { 0cm , .25cm }
    \draw_path_lineto:n { 0cm , -.05cm }
    \draw_path_moveto:n { -.15cm , -.2cm }
    \draw_path_lineto:n { .15cm , -.2cm }
}

\cs_new:Npn \rpgicons_draw_shape_fudge_plus: {
    \rpgicons_draw_shape_sixside:
    \draw_path_moveto:n { 0cm , .15cm }
    \draw_path_lineto:n { 0cm , -.15cm }
    \draw_path_moveto:n { -.15cm , 0cm }
    \draw_path_lineto:n { .15cm , 0cm }
}

\cs_new:Npn \rpgicons_draw_shape_fudge_minus: {
    \rpgicons_draw_shape_sixside:
    \draw_path_moveto:n { -.15cm , 0cm }
    \draw_path_lineto:n { .15cm , 0cm }
}

% ABILITIES

\cs_new:Npn \rpgicons_draw_shape_strength: {
    \draw_path_moveto:n { ( 0cm , -.075cm ) + ( \draw_point_polar:nn { .425cm } { 90 } ) }
    \draw_path_arc:nnn { 90 } { 60 } { .425cm }
    \draw_path_arc:nnn { 200 } { -40 } { .1cm }
    \draw_path_moveto:n { ( 0cm , -.075cm ) + ( \draw_point_polar:nn { .425cm } { 45 } ) }
    \draw_path_arc:nnn { 45 } { -20 } { .425cm }
    \draw_path_arc:nnn { -50 } { -80 } { .35cm }
    \draw_path_moveto:n { ( 0cm , -.075cm ) + ( \draw_point_polar:nn { .425cm } { 90 } ) }
    \draw_path_arc:nnn { 90 } { 120 } { .425cm }
    \draw_path_arc:nnn { -20 } { 220 } { .1cm }
    \draw_path_moveto:n { ( 0cm , -.075cm ) + ( \draw_point_polar:nn { .425cm } { 135 } ) }
    \draw_path_arc:nnn { 135 } { 200 } { .425cm }
    \draw_path_arc:nnn { 230 } { 260 } { .35cm }
    \draw_path_moveto:n { -.2cm , -.025cm }
    \draw_path_lineto:n { -.1cm , -.05cm }
    \draw_path_lineto:n { -.125cm , -.325cm }
    \draw_path_arc:nnnn { 180 } { 360 } { .125cm } { .1cm }
    \draw_path_lineto:n { .1cm , -.05cm }
    \draw_path_lineto:n { .2cm , -.025cm }
    \draw_path_moveto:n { 0cm , -.3cm }
    \draw_path_arc:nnn { 90 } { 70 } { .1cm }
    \draw_path_moveto:n { 0cm , -.3cm }
    \draw_path_arc:nnn { 90 } { 110 } { .1cm }
}

\cs_new:Npn \rpgicons_draw_shape_constitution: {
    \draw_path_moveto:n { 0cm , .25cm }
    \draw_path_lineto:n { .125cm , .25cm }
    \draw_path_arc:nnn { -90 } { -30 } { .325cm }
    \draw_path_arc:nnn { 0 } { -80 } { .3cm }
    \draw_path_moveto:n { 0cm , .25cm }
    \draw_path_lineto:n { -.125cm , .25cm }
    \draw_path_arc:nnn { 270 } { 210 } { .325cm }
    \draw_path_arc:nnn { 180 } { 260 } { .3cm }
    \draw_path_moveto:n { .325cm , .1cm }
    \draw_path_lineto:n { .425cm , .075cm }
    \draw_path_arc:nnnn { 0 } { -90 } { .175cm } { .1cm }
    \draw_path_lineto:n { .2cm , -.15cm }
    \draw_path_moveto:n { -.325cm , .1cm }
    \draw_path_lineto:n { -.425cm , .075cm }
    \draw_path_arc:nnnn { 180 } { 270 } { .175cm } { .1cm }
    \draw_path_lineto:n { -.2cm , -.15cm }
    \draw_path_moveto:n { -.15cm , -.225cm }
    \draw_path_arc:nnn { 90 } { 270 } { .1cm }
    \draw_path_lineto:n { .15cm , -.425cm }
    \draw_path_arc:nnn { -90 } { 90 } { .1cm }
    \draw_path_moveto:n { -.125cm , -.35cm }
    \draw_path_arc:nnn { -90 } { 0 } { .05cm }
    \draw_path_moveto:n { .125cm , -.35cm }
    \draw_path_arc:nnn { 90 } { 0 } { -.05cm }
    \draw_path_moveto:n { -.125cm , -.025cm }
    \draw_path_lineto:n { -.075cm , -.05cm }
    \draw_path_lineto:n { -.075cm , -.1cm }
    \draw_path_moveto:n { .125cm , -.025cm }
    \draw_path_lineto:n { .075cm , -.05cm }
    \draw_path_lineto:n { .075cm , -.1cm }
}

\cs_new:Npn \rpgicons_draw_shape_wisdom: {
    \draw_path_moveto:n { 0cm , .175cm }
    \draw_path_arc:nnn { 60 } { 90 } { .425cm }
    \draw_path_arc:nnn { 270 } { 240 } { .425cm }
    \draw_path_moveto:n { 0cm , .175cm }
    \draw_path_arc:nnn { 120 } { 90 } { .425cm }
    \draw_path_arc:nnn { 270 } { 300 } { .425cm }
    \draw_path_circle:nn { -.175cm , 0cm } { .075cm }
    \draw_path_circle:nn { .175cm , 0cm } { .075cm }
    \draw_path_moveto:n { .075cm , -.125cm }
    \draw_path_lineto:n { 0cm , -.325cm }
    \draw_path_lineto:n { -.075cm , -.125cm }
    \draw_path_moveto:n { -.375cm , .125cm }
    \draw_path_arc:nnn { 150 } { 270 } { .25cm }
    \draw_path_moveto:n { .375cm , .125cm }
    \draw_path_arc:nnn { 30 } { -90 } { .25cm }
}

\cs_new:Npn \rpgicons_draw_shape_charisma: {
    \draw_path_moveto:n { 0cm , .15cm }
    \draw_path_arc:nnnn { 270 } { 190 } { .15cm } { .1cm }
    \draw_path_arc:nnnn { 10 } { 90 } { .175cm } { .225cm }
    \draw_path_arc:nnnn { 40 } { 0 } { .125cm } { .175cm }
    \draw_path_moveto:n { 0cm , .15cm }
    \draw_path_arc:nnnn { 270 } { 350 } { .15cm } { .1cm }
    \draw_path_arc:nnnn { 170 } { 90 } { .175cm } { .225cm }
    \draw_path_arc:nnnn { 140 } { 180 } { .125cm } { .175cm }
    \draw_path_moveto:n { -.2cm , .125cm }
    \draw_path_arc:nnnn { 0 } { 90 } { .175cm } { .1cm }
    \draw_path_arc:nnnn { 180 } { 270 } { .15cm } { .2cm }
    \draw_path_lineto:n { -.25cm , -.05cm }
    \draw_path_arc:nnn { 40 } { 0 } { .45cm }
    \draw_path_lineto:n { 0cm , -.425cm }
    \draw_path_moveto:n { .2cm , .125cm }
    \draw_path_arc:nnnn { 180 } { 90 } { .175cm } { .1cm }
    \draw_path_arc:nnnn { 0 } { -90 } { .15cm } { .2cm }
    \draw_path_lineto:n { .25cm , -.05cm }
    \draw_path_arc:nnn { 140 } { 180 } { .45cm }
    \draw_path_lineto:n { 0cm , -.425cm }
    \draw_path_moveto:n { -.05cm , -.275cm }
    \draw_path_arc:nnn { -30 } { 60 } { .05cm }
    \draw_path_moveto:n { .05cm , -.275cm }
    \draw_path_arc:nnn { 210 } { 120 } { .05cm }
    \draw_path_moveto:n { -.125cm , -.05cm }
    \draw_path_lineto:n { -.05cm , -.075cm }
    \draw_path_moveto:n { .125cm , -.05cm }
    \draw_path_lineto:n { .05cm , -.075cm }
    \draw_path_moveto:n { -.35cm , -.05cm }
    \draw_path_lineto:n { -.425cm , -.05cm }
    \draw_path_arc:nnn { 30 } { -30 } { .15cm }
    \draw_path_arc:nnn { 80 } { 10 } { .15cm }
    \draw_path_lineto:n { -.25cm , -.275cm }
    \draw_path_moveto:n { .35cm , -.05cm }
    \draw_path_lineto:n { .425cm , -.05cm }
    \draw_path_arc:nnn { 150 } { 210 } { .15cm }
    \draw_path_arc:nnn { 100 } { 170 } { .15cm }
    \draw_path_lineto:n { .25cm , -.275cm }
}

\cs_new:Npn \rpgicons_draw_shape_dexterity: {
    \draw_path_moveto:n { ( 0cm , -.075cm ) + ( \draw_point_polar:nn { .425cm } { 90 } ) }
    \draw_path_arc:nnn { 90 } { 65 } { .425cm }
    \draw_path_arc:nnnn { 200 } { 90 } { .1cm } { .075cm }
    \draw_path_arc:nnnn { 90 } { -30 } { .1cm } { .075cm }
    \draw_path_moveto:n { ( 0cm , -.075cm ) + ( \draw_point_polar:nn { .425cm } { 45 } ) }
    \draw_path_arc:nnnn { 45 } { -20 } { .425cm } { .35cm }
    \draw_path_arc:nnn { 110 } { 160 } { .175cm }
    \draw_path_moveto:n { ( 0cm , -.075cm ) + ( \draw_point_polar:nn { .425cm } { 90 } ) }
    \draw_path_arc:nnn { 90 } { 115 } { .425cm }
    \draw_path_arc:nnnn { -20 } { 90 } { .1cm } { .075cm }
    \draw_path_arc:nnnn { 90 } { 220 } { .1cm } { .075cm }
    \draw_path_moveto:n { ( 0cm , -.075cm ) + ( \draw_point_polar:nn { .425cm } { 135 } ) }
    \draw_path_arc:nnnn { 135 } { 200 } { .425cm } { .35cm }
    \draw_path_arc:nnn { 70 } { 20 } { .175cm }    
    \draw_path_moveto:n { -.075cm , -.175cm }
    \draw_path_arc:nnnn { 180 } { 360 } { .075cm } { .05cm }
    \draw_path_moveto:n { 0cm , -.225cm }
    \draw_path_lineto:n { 0cm , -.25cm }
    \draw_path_moveto:n { -.2cm , .025cm }
    \draw_path_lineto:n { -.075cm , 0cm }
    \draw_path_lineto:n { -.125cm , -.075cm }
    \draw_path_moveto:n { .125cm , -.075cm }
    \draw_path_lineto:n { .075cm , 0cm }
    \draw_path_lineto:n { .2cm , .025cm }
    \draw_path_moveto:n { 0cm , -.25cm }
    \draw_path_arc:nnnn { 360 } { 140 } { .1cm } { .075cm }
    \draw_path_moveto:n { 0cm , -.25cm }
    \draw_path_arc:nnnn { 180 } { 400 } { .1cm } { .075cm }
    \draw_path_moveto:n { -.1cm , -.325cm }
    \draw_path_lineto:n { -.1cm , -.375cm }
    \draw_path_arc:nnnn { 180 } { 360 } { .1cm } { .05cm }
    \draw_path_lineto:n { .1cm , -.325cm }
}

\cs_new:Npn \rpgicons_draw_shape_dexterity_alt: {
    \draw_path_moveto:n { ( 0cm , -.15cm ) + ( \draw_point_polar:nn { .425cm } { 90 } ) }
    \draw_path_arc:nnn { 90 } { 75 } { .425cm }
    \draw_path_moveto:n { ( 0cm , -.15cm ) + ( \draw_point_polar:nn { .425cm } { 90 } ) }
    \draw_path_arc:nnn { 90 } { 105 } { .425cm }
    \draw_path_moveto:n { .125cm , .175cm }
    \draw_path_lineto:n { .375cm , .425cm }
    \draw_path_arc:nnn { 30 } { -20 } { .25cm }
    \draw_path_lineto:n { ( 0cm , -.1cm ) + ( \draw_point_polar:nn { .425cm } { 30 } ) }
    \draw_path_arc:nnnn { 30 } { -45 } { .425cm } { .35cm }
    \draw_path_moveto:n { -.125cm , .175cm }
    \draw_path_lineto:n { -.375cm , .425cm }
    \draw_path_arc:nnn { 150 } { 200 } { .25cm }
    \draw_path_lineto:n { ( 0cm , -.1cm ) + ( \draw_point_polar:nn { .425cm } { 150 } ) }
    \draw_path_arc:nnnn { 150 } { 225 } { .425cm } { .35cm }
    \draw_path_moveto:n { .075cm , -.075cm }
    \draw_path_arc:nnnn { 170 } { 90 } { .15cm } { .05cm }  
    \draw_path_moveto:n { -.075cm , -.075cm }
    \draw_path_arc:nnnn { 10 } { 90 } { .15cm } { .05cm } 
    \draw_path_moveto:n { 0cm , -.275cm }
    \draw_path_arc:nnnn { 0 } { 90 } { .075cm } { .05cm }
    \draw_path_moveto:n { 0cm , -.275cm }
    \draw_path_arc:nnnn { 180 } { 90 } { .075cm } { .05cm }
    \draw_path_moveto:n { 0cm , -.275cm }
    \draw_path_arc:nnnn { 360 } { 180 } { .1cm } { .075cm }
    \draw_path_moveto:n { 0cm , -.275cm }
    \draw_path_arc:nnnn { 180 } { 360 } { .1cm } { .075cm }
    \draw_path_moveto:n { -.1cm , -.35cm }
    \draw_path_lineto:n { -.1cm , -.375cm }
    \draw_path_arc:nnnn { 180 } { 360 } { .1cm } { .05cm }
    \draw_path_lineto:n { .1cm , -.35cm }
}

\cs_new:Npn \rpgicons_draw_shape_intelligence: {
    \draw_path_moveto:n { ( 0cm , -.2cm ) + ( \draw_point_polar:nn { .425cm } { 90 } ) }
    \draw_path_arc:nnn { 90 } { 60 } { .25cm }
    \draw_path_lineto:n { ( 0cm , -.1cm ) + ( \draw_point_polar:nn { .6cm } { 60 } ) }
    \draw_path_arc:nnn { 40 } { -2.5 } { .425cm }
    \draw_path_moveto:n { ( 0cm , -.2cm ) + ( \draw_point_polar:nn { .425cm } { 90 } ) }
    \draw_path_arc:nnn { 90 } { 120 } { .25cm }
    \draw_path_lineto:n { ( 0cm , -.1cm ) + ( \draw_point_polar:nn { .6cm } { 120 } ) }
    \draw_path_arc:nnn { 140 } { 182.5 } { .425cm }
    \draw_path_moveto:n { ( 0cm , -.2cm ) + ( \draw_point_polar:nn { .425cm } { 45 } ) }
    \draw_path_arc:nnn { 45 } { 0 } { .425cm }
    \draw_path_lineto:n { .2cm , -.275cm }
    \draw_path_moveto:n { ( 0cm , -.2cm ) + ( \draw_point_polar:nn { .425cm } { 135 } ) }
    \draw_path_arc:nnn { 135 } { 180 } { .425cm }
    \draw_path_lineto:n { -.2cm , -.275cm }
    \draw_path_moveto:n { -.2cm , -.075cm }
    \draw_path_lineto:n { -.1cm , -.1cm }
    \draw_path_lineto:n { -.075cm , -.375cm }
    \draw_path_arc:nnnn { 180 } { 360 } { .075cm } { .05cm }
    \draw_path_lineto:n { .1cm , -.1cm }
    \draw_path_lineto:n { .2cm , -.075cm }
}

\cs_new:Npn \rpgicons_draw_shape_resilience: {
    \draw_path_moveto:n { ( -.425cm , -.475cm ) + ( \draw_point_polar:nn { .5cm } { 65 } ) }
    \draw_path_arc:nnn { 65 } { 90 } { .5cm }
    \draw_path_lineto:n { ( 0cm , -.075cm ) + ( \draw_point_polar:nn { .55cm } { 135 } ) }
    \draw_path_arc:nnn { 135 } { 45 } { .55cm }
    \draw_path_lineto:n { .425cm , .025cm }
    \draw_path_arc:nnn { 90 } { 115 } { .5cm }
    \draw_path_moveto:n { .2cm , .3cm }
    \draw_path_lineto:n { .125cm , .275cm }
    \draw_path_lineto:n { .2cm , .15cm }
    \draw_path_moveto:n { .125cm , .075cm }
    \draw_path_lineto:n { .05cm , .05cm }
    \draw_path_moveto:n { .15cm , -.1cm }
    \draw_path_arc:nnn { 200 } { 230 } { .4cm }
    \draw_path_moveto:n { -.2cm , .3cm }
    \draw_path_lineto:n { -.125cm , .275cm }
    \draw_path_lineto:n { -.2cm , .15cm }
    \draw_path_moveto:n { -.125cm , .075cm }
    \draw_path_lineto:n { -.05cm , .05cm }
    \draw_path_moveto:n { -.15cm , -.1cm }
    \draw_path_arc:nnn { 340 } { 310 } { .4cm }
    \draw_path_moveto:n { -.065cm , -.075cm }
    \draw_path_lineto:n { -.045cm , -.425cm }
    \draw_path_lineto:n { .045cm , -.425cm }
    \draw_path_lineto:n { .065cm , -.075cm }
}

\cs_new:Npn \rpgicons_draw_shape_sanity: {
    \draw_path_moveto:n { ( -.125cm + .175cm * sind(30) , .425cm - .175cm * cosd(30) ) + 
        ( \draw_point_polar:nn { .175cm } { 210 } ) }
    \draw_path_arc:nnn { 210 } { 120 } { .175cm }
    \draw_path_lineto:n { \draw_point_polar:nn { .25cm } { 110 } }
    \draw_path_arc:nnn { 110 } { 70 } { .25cm }
    \draw_path_lineto:n { .125cm , .425cm }
    \draw_path_arc:nnn { 420 } { 330 } { .175cm }
    \draw_path_moveto:n { .25cm , .1cm }
    \draw_path_arc:nnn { 390 } { 305 } { .15cm }
    \draw_path_moveto:n { -.25cm , .1cm }
    \draw_path_arc:nnn { 150 } { 235 } { .15cm }
    \draw_path_moveto:n { -.15cm , .075cm }
    \draw_path_lineto:n { -.1cm , .05cm }
    \draw_path_lineto:n { -.1cm , .025cm }
    \draw_path_moveto:n { .15cm , .075cm }
    \draw_path_lineto:n { .1cm , .05cm }
    \draw_path_lineto:n { .1cm , .025cm }
    \draw_path_moveto:n { ( -.55cm , -.35cm ) + ( \draw_point_polar:nnn { .125cm } { .075cm} { 135 } ) +
        ( \draw_point_polar:nn { .55cm } { 20 } ) }
    \draw_path_arc:nnn { 380 } { 360 } { .55cm } 
    \draw_path_arc:nnnn { 135 } { 405 } { .125cm } { .075cm }
    \draw_path_arc:nnn { 180 } { 160 } { .55cm }
}

\cs_new:Npn \rpgicons_draw_shape_perception: {
    \draw_path_moveto:n { ( 0cm , .35cm ) + ( \draw_point_polar:nn { .125cm } { 150 } ) }
    \draw_path_arc:nnn { 150 } { 390 } { .125cm } 
    \draw_path_moveto:n { -.3cm , .425cm }
    \draw_path_arc:nnnn { 180 } { 360 } { .3cm } { .2cm }
    \draw_path_moveto:n { ( 0cm , .425cm ) + ( \draw_point_polar:nnn { .3cm } { .2cm } { 330 } ) }
    \draw_path_arc:nnnn { 270 } { 350 } { .15cm } { .1cm }
    \draw_path_moveto:n { ( 0cm , .425cm ) + ( \draw_point_polar:nnn { .3cm } { .2cm } { 210 } ) }
    \draw_path_arc:nnnn { 270 } { 190 } { .15cm } { .1cm }
    \draw_path_moveto:n { -.2cm , .15cm }
    \draw_path_lineto:n { -.375cm , .125cm }
    \draw_path_arc:nnn { 210 } { 250 } { .225cm }
    \draw_path_moveto:n { .2cm , .15cm }
    \draw_path_lineto:n { .375cm , .125cm }
    \draw_path_arc:nnn { 330 } { 290 } { .225cm }
    \draw_path_moveto:n { -.15cm , 0cm }
    \draw_path_lineto:n { -.075cm , -.025cm }
    \draw_path_lineto:n { -.075cm , -.05cm }
    \draw_path_moveto:n { .15cm , 0cm }
    \draw_path_lineto:n { .075cm , -.025cm }
    \draw_path_lineto:n { .075cm , -.05cm }
    \draw_path_moveto:n { ( -.075cm , ( -.35cm + .075cm * ( 2 + sqrt(3) ) ) ) + 
        ( \draw_point_polar:nnn { .1cm } { .075cm } { 195 } ) } 
    \draw_path_lineto:n { ( 0cm , -.35cm ) + ( \draw_point_polar:nnn { .1cm } { .075cm } { 195 } ) }
    \draw_path_arc:nnnn { 195 } { 345 } { .1cm } { .075cm }
    \draw_path_lineto:n { ( .075cm , ( -.35cm + .075cm * ( 2 + sqrt(3) ) ) ) + 
        ( \draw_point_polar:nnn { .1cm } { .075cm } { 345 } ) } 
    \draw_path_moveto:n { .025cm , -.325cm }
    \draw_path_arc:nnn { 0 } { 180 } { .025cm } 
}

\cs_new:Npn \rpgicons_draw_shape_luck: {
    \draw_path_moveto:n { .1cm , .15cm }
    \draw_path_lineto:n { .1cm , -.05cm }
    \draw_path_arc:nnn { -75 } { -15 } { .425cm }
    \draw_path_arc:nnn { 40 } { 85 } { .425cm }
    \draw_path_moveto:n { -.1cm , .15cm }
    \draw_path_lineto:n { -.1cm , -.05cm }
    \draw_path_arc:nnn { -105 } { -165 } { .425cm }
    \draw_path_arc:nnn { 140 } { 95 } { .425cm }
    \draw_path_moveto:n { ( 0cm , -.05cm ) + ( \draw_point_polar:nn { .425cm } { 15 } ) } 
    \draw_path_arc:nnnn { 15 } { -55 } { .425cm } { .3cm }
    \draw_path_moveto:n { ( 0cm , -.05cm ) + ( \draw_point_polar:nn { .425cm } { 165 } ) } 
    \draw_path_arc:nnnn { 165 } { 235 } { .425cm } { .3cm }
    \draw_path_moveto:n { 0cm , -.175cm }
    \draw_path_arc:nnnn { 90 } { 250 } { .175cm } { .125cm }
    \draw_path_lineto:n { -.05cm , -.325cm }
    \draw_path_moveto:n { 0cm , -.175cm }
    \draw_path_arc:nnnn { 90 } { -70 } { .175cm } { .125cm }
    \draw_path_lineto:n { .05cm , -.325cm }
}

\cs_new:Npn \rpgicons_draw_shape_armor: {
    \draw_path_moveto:n { -.25cm , -.425cm }
    \draw_path_lineto:n { .25cm , -.425cm }
    \draw_path_lineto:n { .2cm , -.225cm }
    \draw_path_lineto:n { .25cm , .125cm }
    \draw_path_lineto:n { .425cm , .125cm }
    \draw_path_arc:nnn { 0 } { 90 } { .3cm }
    \draw_path_lineto:n { .125cm , .35cm }
    \draw_path_arc:nnn { 360 } { 180 } { .125cm }
    \draw_path_lineto:n { -.125cm , .425cm }
    \draw_path_arc:nnn { 90 } { 180 } { .3cm }
    \draw_path_lineto:n { -.25cm , .125cm }
    \draw_path_lineto:n { -.2cm , -.225cm }
    \draw_path_close:
    \draw_path_moveto:n { .125cm , .425cm }
    \draw_path_lineto:n { .125cm , .25cm }
    \draw_path_arc:nnn { 180 } { 270 } { .125cm }
    \draw_path_moveto:n { -.125cm , .425cm }
    \draw_path_lineto:n { -.125cm , .25cm }
    \draw_path_arc:nnn { 360 } { 270 } { .125cm }
    \draw_path_moveto:n { 0cm , .225cm }
    \draw_path_lineto:n { 0cm , -.275cm }
    \draw_path_moveto:n { -.2cm , -.225cm }
    \draw_path_lineto:n { 0cm , -.275cm }
    \draw_path_lineto:n { .2cm , -.225cm }
}

\cs_new:Npn \rpgicons_draw_shape_proficiency: {
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 90 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 126 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 162 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 198 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 234 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 270 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 306 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 342 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 18 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 54 } }
    \draw_path_close:
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 270 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 270 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 342 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 342 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 54 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 54 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm } { 126 }}
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 126 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 198 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 198 } }
}

\cs_new:Npn \rpgicons_draw_shape_linear: {
    \draw_path_circle:nn { -.4cm , 0cm } { 2pt }
    \draw_path_use_clear:n { fill }
    \draw_path_moveto:n { -.4cm , 0cm }
    \draw_path_lineto:n { .4cm , 0cm }
}

\cs_new:Npn \rpgicons_draw_shape_conic: {
    \draw_path_circle:nn { -.425cm , 0cm } { 2pt }
    \draw_path_use_clear:n { fill }
    \draw_path_ellipse:nnn { .2125cm , 0cm } { .2cm , 0cm } { 0cm , .425cm }
    \draw_path_moveto:n { .2125cm - .2cm * sin( asin( .2cm / .6375cm ) ) , 
        -.425cm * cos( asin( .2cm / ( .6375cm ) ) ) }
    \draw_path_lineto:n { -.425cm , 0cm }
    \draw_path_lineto:n { .2125cm - .2cm * sin( asin( .2cm / .6375cm ) ) , 
        .425cm * cos( asin( .2cm / ( .6375cm ) ) ) }
}

\cs_new:Npn \rpgicons_draw_shape_quadratic: {
    \draw_path_circle:nn { 0cm , 0cm } { 2pt }
    \draw_path_use_clear:n { fill }
    \bool_if:NTF \l__rpgicons_compat_mode_bool {
        % l3draw rectangle fix
        \draw_path_moveto:n { -.4cm , -.4cm }
        \draw_path_lineto:n { -.4cm , .4cm }
        \draw_path_lineto:n { .4cm , .4cm }
        \draw_path_lineto:n { .4cm , -.4cm }
        \draw_path_close:
    } {
        \draw_path_rectangle_corners:nn { -.4cm , -.4cm } { .4cm , .4cm }
    }
}

\cs_new:Npn \rpgicons_draw_shape_cubic: {
    \draw_path_circle:nn { .1125cm , -.1125cm } { 2pt }
    \draw_path_use_clear:n { fill }
    \draw_path_moveto:n { -.425cm , .425cm }
    \draw_path_lineto:n { -.425cm , -.2cm }
    \draw_path_lineto:n { -.2cm , -.425cm }
    \draw_path_lineto:n { .425cm , -.425cm }
    \draw_path_lineto:n { .425cm , .2cm }
    \draw_path_lineto:n { .2cm , .425cm }
    \draw_path_close:
    \draw_path_lineto:n { -.2cm , .2cm }
    \draw_path_lineto:n { -.2cm , -.425cm }
    \draw_path_moveto:n { -.2cm , .2cm }
    \draw_path_lineto:n { .425cm , .2cm }
}

\cs_new:Npn \rpgicons_draw_shape_spheric: {
    \draw_path_circle:nn { 0cm , 0cm } { 2pt }
    \draw_path_use_clear:n { fill }
    \draw_path_circle:nn { 0cm , 0cm } { .425cm }
    \draw_path_moveto:n { .425cm , 0cm }
    \draw_path_arc:nnnn { 180 } { 50 } { -.425cm } { -.2cm }
    \draw_path_moveto:n { 0cm , -.425cm }
    \draw_path_arc:nnnn { 270 } { 140 } { -.2cm } { .425cm }
}

\cs_new:Npn \rpgicons_draw_shape_cylindric: {
    \draw_path_circle:nn { 0cm , -.2125cm } { 2pt }
    \draw_path_use_clear:n { fill }
    \draw_path_ellipse:nnn { 0cm , .2125cm } { 0cm , .2cm } { .425cm , 0cm }
    \draw_path_moveto:n { -.425cm , .2125cm }
    \draw_path_lineto:n { -.425cm , -.2125cm }
    \draw_path_arc:nnnn { 0 } { 180 } { -.425cm } { -.2cm }
    \draw_path_lineto:n { .425cm , .2125cm }
}

\cs_new:Npn \rpgicons_draw_shape_verbal: {
    \draw_path_moveto:n { -.35cm , 0cm }
    \draw_path_arc:nnn { 180 } { -115 } { .35cm }
    \draw_path_lineto:n { -.4cm , -.4cm }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm } { 215 } }
}

\cs_new:Npn \rpgicons_draw_shape_somatic: {
    \draw_path_moveto:n { -.425cm , 0cm }
    \draw_path_arc:nnnn { 0 } { 270 } { -.425cm } { -.2cm }
    \draw_path_moveto:n { 0cm , -.425cm }
    \draw_path_arc:nnnn { 90 } { 360 } { -.2cm } { -.425cm }
}

\cs_new:Npn \rpgicons_draw_shape_material: {
    \draw_path_moveto:n { -.4cm , .2cm }
    \draw_path_lineto:n { -.4cm , -.2cm }
    \draw_path_lineto:n { 0cm , -.4cm }
    \draw_path_lineto:n { .4cm , -.2cm }
    \draw_path_lineto:n { .4cm , .2cm }
    \draw_path_lineto:n { 0cm , .4cm }
    \draw_path_close:
    \draw_path_lineto:n { 0cm , 0cm }
    \draw_path_lineto:n { .4cm , .2cm }
    \draw_path_moveto:n { 0cm , 0cm }
    \draw_path_lineto:n { 0cm , -.4cm }
}

\cs_new:Npn \rpgicons_draw_shape_focus: {
    \draw_path_circle:nn { 0cm , 0cm } { .35cm }
    \draw_path_moveto:n { -.15cm , 0 }
    \draw_path_lineto:n { -.425cm , 0 }
    \draw_path_moveto:n { .15cm , 0 }
    \draw_path_lineto:n { .425cm , 0 }
    \draw_path_moveto:n { 0cm , -.15cm }
    \draw_path_lineto:n { 0cm , -.425cm }
    \draw_path_moveto:n { 0cm , .15cm }
    \draw_path_lineto:n { 0cm , .425cm }
}

% SPELLSCHOOLS

\cs_new:Npn \rpgicons_draw_shape_abjuration: {
    \draw_path_moveto:n { 0cm , .025cm }
    \draw_path_arc:nnnn { 270 } { 390 } { .275cm } { .175cm }
    \draw_path_arc:nnn { 210 } { 120 } { .095cm }
    \draw_path_moveto:n { 0cm , .025cm }
    \draw_path_arc:nnnn { 270 } { 150 } { .275cm } { .175cm }
    \draw_path_arc:nnn { -30 } { 60 } { .095cm }
    \draw_path_moveto:n { 0cm , .25cm }
    \draw_path_lineto:n { 0cm , -.425cm }
    \draw_path_moveto:n { -.25cm , -.125cm }
    \draw_path_lineto:n { .25cm , -.125cm }
    \draw_path_moveto:n { -.25cm , -.3cm }
    \draw_path_lineto:n { .25cm , -.3cm }
}

\cs_new:Npn \rpgicons_draw_shape_conjuration: {
    \draw_path_moveto:n { -.425cm , .425cm }
    \draw_path_lineto:n { 0cm , -.425cm }
    \draw_path_lineto:n { .425cm , .425cm }
    \draw_path_moveto:n { -.225cm , .05cm }
    \draw_path_lineto:n { .225cm , .05cm }
    \draw_path_moveto:n { 0cm , -.15cm }
    \draw_path_arc:nnn { 110 } { 70 } { .5cm }
    \draw_path_moveto:n { 0cm , -.15cm }
    \draw_path_arc:nnn { 110 } { 70 } { -.5cm }
}

\cs_new:Npn \rpgicons_draw_shape_divination: {
    \draw_path_moveto:n { -.35cm , -.175cm }
    \draw_path_arc:nnnn { 180 } { 0 } { .15cm } { -.25cm }
    \draw_path_arc:nnn { 180 } { 90 } { .4cm }
    \draw_path_moveto:n { -.05cm , -.175cm }
    \draw_path_lineto:n { -.05cm , 0cm }
    \draw_path_arc:nnn { 180 } { 90 } { .4cm }
}

\cs_new:Npn \rpgicons_draw_shape_enchantment: {
    \draw_path_moveto:n { -.2cm , -.425cm }
    \draw_path_lineto:n { -.2cm , .425cm }
    \draw_path_moveto:n { -.425cm , .175cm }
    \draw_path_lineto:n { .025cm , .175cm }
    \draw_path_moveto:n { -.2cm , -.225cm }
    \draw_path_arc:nnnn { 180 } { 0 } { .1cm } { .2cm }
    \draw_path_arc:nnnn { 180 } { 0 } { .1cm } { .2cm }
    \draw_path_arc:nnnn { 180 } { 0 } { .1cm } { -.2cm }
}

\cs_new:Npn \rpgicons_draw_shape_evocation: {
    \draw_path_ellipse:nnn { 0cm , 0cm } { .325cm , 0cm } { 0cm , .225cm }
    \draw_path_moveto:n { 0cm , .425cm }
    \draw_path_lineto:n { 0cm , -.425cm }
    \draw_path_moveto:n { -.425cm , 0cm }
    \draw_path_lineto:n { .425cm , 0cm }
    \draw_path_moveto:n { \draw_point_polar:nnn { 30 } { .325cm } { .225cm } }
    \draw_path_lineto:n { \draw_point_polar:nn { 30 } { .4cm} }
    \draw_path_moveto:n { \draw_point_polar:nnn { 60 } { .325cm } { .225cm } }
    \draw_path_lineto:n { \draw_point_polar:nn { 60 } { .4cm} }
    \draw_path_moveto:n { \draw_point_polar:nnn { 120 } { .325cm } { .225cm } }
    \draw_path_lineto:n { \draw_point_polar:nn { 120 } { .4cm} }
    \draw_path_moveto:n { \draw_point_polar:nnn { 150 } { .325cm } { .225cm } }
    \draw_path_lineto:n { \draw_point_polar:nn { 150 } { .4cm} }
    \draw_path_moveto:n { \draw_point_polar:nnn { 210 } { .325cm } { .225cm } }
    \draw_path_lineto:n { \draw_point_polar:nn { 210 } { .4cm} }
    \draw_path_moveto:n { \draw_point_polar:nnn { 240 } { .325cm } { .225cm } }
    \draw_path_lineto:n { \draw_point_polar:nn { 240 } { .4cm} }
    \draw_path_moveto:n { \draw_point_polar:nnn { 300 } { .325cm } { .225cm } }
    \draw_path_lineto:n { \draw_point_polar:nn { 300 } { .4cm} }
    \draw_path_moveto:n { \draw_point_polar:nnn { 330 } { .325cm } { .225cm } }
    \draw_path_lineto:n { \draw_point_polar:nn { 330 } { .4cm} }
}

\cs_new:Npn \rpgicons_draw_shape_illusion: {
    \draw_path_moveto:n { 0cm , .225cm }
    \draw_path_arc:nnn { 90 } { 30 } { .45cm }
    \draw_path_arc:nnn { 330 } { 210 } { .45cm }
    \draw_path_arc:nnn { 150 } { 90 } { .45cm }
    \draw_path_moveto:n { ( 0cm , .225cm ) + ( \draw_point_polar:nn { .45cm } { 270 } ) } 
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 270 } }
    \draw_path_moveto:n { ( 0cm , .225cm ) + ( \draw_point_polar:nn { .45cm } { 240 } ) }
    \draw_path_lineto:n { \draw_point_polar:nn { .4cm} { 225 } }
    \draw_path_moveto:n { ( 0cm , .225cm ) + ( \draw_point_polar:nn { .45cm } { 300 } ) }
    \draw_path_lineto:n { \draw_point_polar:nn { .4cm} { 315 } }
    \draw_path_moveto:n { 0cm , .225cm }
    \draw_path_circle:nn { 0cm , .075cm } { .15cm }
}

\cs_new:Npn \rpgicons_draw_shape_necromancy: {
    \draw_path_moveto:n { \draw_point_polar:nn { .25cm} { 210 } }
    \draw_path_arc:nnn { 210 } { -30 } { .25cm }
    \draw_path_arc:nnn { 150 } { 390 } { .1cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .25cm} { 210 } }
    \draw_path_arc:nnn { 390 } { 150 } { .1cm }
}

\cs_new:Npn \rpgicons_draw_shape_transmutation: {
    \draw_path_moveto:n { -.25cm , .35cm }
    \draw_path_lineto:n { -.25cm , -.35cm }
    \draw_path_moveto:n { 0cm , .35cm }
    \draw_path_lineto:n { 0cm , -.35cm }
    \draw_path_moveto:n { -.425cm , .35cm }
    \draw_path_lineto:n { .15cm , .35cm }
    \draw_path_arc:nnn { 90 } { -45 } { .1cm }
    \draw_path_arc:nnn { 135 } { 360 } { .1cm }
}

% DAMAGES

\cs_new:Npn \rpgicons_draw_shape_acid: {
    \draw_path_moveto:n { ( -.175cm , .05cm ) + ( \draw_point_polar:nn { .175 } { -20 } ) }
    \draw_path_arc:nnn { -20 } { 200 } { -.175cm }
    \draw_path_lineto:n { 0cm , .425cm }
    \draw_path_close:
    \draw_path_moveto:n { 
      \draw_point_intersect_lines:nnnn 
        { ( 0cm , -.175cm ) + ( \draw_point_polar:nn { -.25cm } { 20 } ) } 
        { ( 0cm , -.175cm ) + ( \draw_point_polar:nn { -.25cm } { 160 } ) } 
        { -.425cm , -.425cm } { -.425cm , .425cm } 
    }
    \draw_path_lineto:n { ( 0cm , -.175cm ) + ( \draw_point_polar:nn { -.25cm } { 20 } ) }
    \draw_path_arc:nnn { 20 } { 160 } { -.25cm }
    \draw_path_lineto:n { 
      \draw_point_intersect_lines:nnnn 
        { ( 0cm , -.175cm ) + ( \draw_point_polar:nn { -.25cm } { 20 } ) } 
        { ( 0cm , -.175cm ) + ( \draw_point_polar:nn { -.25cm } { 160 } ) } 
        { .425cm , -.425cm } { .425cm , .425cm } 
    }
}

\cs_new:Npn \rpgicons_draw_shape_bludgeoning: {
    \draw_path_moveto:n { -.2cm , .225cm }
    \draw_path_lineto:n { 0cm , .425cm }
    \draw_path_lineto:n { .425cm , 0cm }
    \draw_path_lineto:n { .225cm , -.2cm }
    \draw_path_close:
    \draw_path_moveto:n { .05cm , -.025cm }
    \draw_path_lineto:n { -.35cm , -.425cm }
    \draw_path_lineto:n { -.425cm , -.35cm }
    \draw_path_lineto:n { -.025cm , .05cm }
    \draw_path_moveto:n { .2375cm , .1875cm }
    \draw_path_arc:nnn { 135 } { 315 } { -.05cm }
}

\cs_new:Npn \rpgicons_draw_shape_cold: {
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 90 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 270 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 110 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .25cm} { 90 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 70 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 250 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .25cm} { 270 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 290 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 30 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 210 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 50 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .25cm} { 30 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 10 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 190 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .25cm} { 210 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 230 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 150 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 330 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 130 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .25cm} { 150 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 170 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .35cm} { 310 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .25cm} { 330 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 350 } }
}

\cs_new:Npn \rpgicons_draw_shape_fire: {
    \draw_path_moveto:n { .15cm , -.425cm }
    \draw_path_arc:nnnn { -60 } { 0 } { .45cm } { .375cm }
    \draw_path_curveto:nnn { .375cm , .15cm } { .15cm , .375cm } { -.05cm , .425cm }
    \draw_path_moveto:n { -.15cm , -.425cm }
    \draw_path_arc:nnnn { 240 } { 135 } { .45cm } { .35cm } 
    \draw_path_curveto:nnn { -.15cm , .2cm } { 0cm , .25cm } { -.05cm , .425cm }
    \draw_path_moveto:n { .075cm , -.3cm }
    \draw_path_curveto:nnn { .2cm , -.2cm } { .2cm , -.05cm } { .05cm , .1cm }
    \draw_path_moveto:n { -.075cm , -.3cm }
    \draw_path_arc:nnnn { 220 } { 150 } { .35cm } { .2cm }
    \draw_path_curveto:nnn { 0cm , -.2cm } { .05cm , -.1cm } { .05cm , .1cm }
}

\cs_new:Npn \rpgicons_draw_shape_force: {
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 90 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 120 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 150 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 180 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 210 } } 
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 240 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 270 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 300 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 330 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 0 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 30 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .15cm} { 60 } }
    \draw_path_close:
}

\cs_new:Npn \rpgicons_draw_shape_lightning: {
    \draw_path_moveto:n { 0cm , .425cm }
    \draw_path_lineto:n { -.25cm , -.15cm }
    \draw_path_lineto:n { .25cm , .15cm }
    \draw_path_lineto:n { 0cm , -.425cm }
}

\cs_new:Npn \rpgicons_draw_shape_necrotic: {
    \draw_path_moveto:n { -.35cm , -.425cm }
    \draw_path_lineto:n { -.35cm , .075cm }
    \draw_path_arc:nnn { 180 } { 0 } { .35cm }
    \draw_path_lineto:n { .35cm , -.425cm }
    \draw_path_close:
    \draw_path_moveto:n { 0cm , -.2cm }
    \draw_path_lineto:n { 0cm , .25cm }
    \draw_path_moveto:n { -.15cm , .1cm }
    \draw_path_lineto:n { .15cm , .1cm }
}

\cs_new:Npn \rpgicons_draw_shape_piercing: {
    \draw_path_moveto:n { -.425cm , .075cm }
    \draw_path_lineto:n { .3cm , .075cm }
    \draw_path_lineto:n { .425cm , 0cm }
    \draw_path_lineto:n { .3cm , -.075cm }
    \draw_path_lineto:n { -.425cm , -.075cm }
    \draw_path_moveto:n { .25cm , .2cm }
    \draw_path_lineto:n { -.05cm , .35cm }
    \draw_path_moveto:n { .25cm , -.2cm }
    \draw_path_lineto:n { -.05cm , -.35cm }
    \draw_path_moveto:n { .425cm , .15cm }
    \draw_path_lineto:n { .25cm , .425cm }
    \draw_path_moveto:n { .425cm , -.15cm }
    \draw_path_lineto:n { .25cm , -.425cm }
}

\cs_new:Npn \rpgicons_draw_shape_poison: {
    \draw_path_moveto:n { ( 0cm , .175cm ) + ( \draw_point_polar:nn { .25cm } { -40 } ) }
    \draw_path_arc:nnn { -40 } { 220 } { .25cm }
    \draw_path_lineto:n { -.15cm , -.1cm }
    \draw_path_lineto:n { .15cm , -.1cm }
    \draw_path_close:
    \draw_path_circle:nn { -.1cm , .15cm } { .05cm }
    \draw_path_circle:nn { .1cm , .15cm } { .05cm }
    \draw_path_moveto:n { .425cm , -.2cm }
    \draw_path_lineto:n { -.425cm , -.425cm }
    \draw_path_moveto:n { -.425cm , -.2cm }
    \draw_path_lineto:n { .425cm , -.425cm }
}

\cs_new:Npn \rpgicons_draw_shape_psychic: {
    \draw_path_moveto:n { .075cm , .4cm }
    \draw_path_arc:nnn { 90 } { 180 } { .425cm }
    \draw_path_arc:nnn { 180 } { 270 } { .375cm }
    \draw_path_arc:nnn { 270 } { 360 } { .325cm }
    \draw_path_arc:nnn { 0 } { 90 } { .275cm }
    \draw_path_arc:nnn { 90 } { 180 } { .225cm }
    \draw_path_arc:nnn { 180 } { 270 } { .175cm }
    \draw_path_arc:nnn { 270 } { 360 } { .125cm }
}

\cs_new:Npn \rpgicons_draw_shape_radiant: {
    \draw_path_circle:nn { 0cm , 0cm } { .225cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 15 } }
    \draw_path_arc:nnn { 15 } { 45 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 75 } }
    \draw_path_arc:nnn { 75 } { 105 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 135 } }
    \draw_path_arc:nnn { 135 } { 165 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 195 } }
    \draw_path_arc:nnn { 195 } { 225 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 255 } }
    \draw_path_arc:nnn { 255 } { 285 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 315 } }
    \draw_path_arc:nnn { 315 } { 345 } { .425cm }
}

\cs_new:Npn \rpgicons_draw_shape_slashing: {
    \draw_path_moveto:n { -.15cm , .225cm }
    \draw_path_lineto:n { -.275cm , .35cm }
    \draw_path_arc:nnn { 0 } { 240 } { .075cm }
    \draw_path_lineto:n { -.35cm , .275cm }
    \draw_path_lineto:n { -.225cm , .15cm }
    \draw_path_lineto:n { -.425cm , -.05cm }
    \draw_path_lineto:n { -.35cm , -.125cm }
    \draw_path_lineto:n { .125cm , .35cm }
    \draw_path_lineto:n { .05cm , .425cm }
    \draw_path_close:
    \draw_path_moveto:n { -.2cm , .025cm }
    \draw_path_lineto:n { .225cm , -.425cm }
    \draw_path_lineto:n { .425cm , -.425cm }
    \draw_path_lineto:n { .425cm , -.225cm }
    \draw_path_lineto:n { -.025cm , .2cm }
    \draw_path_moveto:n { .325cm , -.325cm }
    \draw_path_lineto:n { 0cm , 0cm }
    \draw_path_moveto:n { .425cm , .3cm }
    \draw_path_lineto:n { .425cm , 0cm }
    \draw_path_moveto:n { .275cm , .425cm }
    \draw_path_lineto:n { .275cm , .1cm }
}

\cs_new:Npn \rpgicons_draw_shape_thunder: {
    \draw_path_moveto:n { .225cm , -.075cm }
    \draw_path_arc:nnn { -90 } { 120 } { .2cm }
    \draw_path_arc:nnn { 30 } { 180 } { .225cm }
    \draw_path_lineto:n { -.3cm , .125cm + cosd( 30 ) * .2cm - sind( 30 ) * .225cm }
    \draw_path_arc:nnn { 90 } { 180 } { .125cm }
    \draw_path_lineto:n { -.425cm , .05cm }
    \draw_path_arc:nnn { 180 } { 270 } { .125cm }
    \draw_path_close:
    \draw_path_moveto:n { -.1cm , -.225cm }
    \draw_path_arc:nnn { 240 } { 300 } { .3cm }
    \draw_path_moveto:n { -.2cm , -.35cm }
    \draw_path_arc:nnn { 240 } { 300 } { .5cm }
}

\cs_new:Npn \rpgicons_draw_shape_healing: {
     \draw_path_moveto:n { 0cm , .125cm }
    \draw_path_arc:nnn { 0 } { 225 } { .2cm }
    \draw_path_lineto:n { 0cm , -.375cm }
    \draw_path_moveto:n { 0cm , .125cm }
    \draw_path_arc:nnn { 180 } { -45 } { .2cm }
    \draw_path_lineto:n { 0cm , -.375cm }
}

% ATTACKS

\cs_new:Npn \rpgicons_draw_shape_melee: {
    \draw_path_moveto:n { -.15cm , -.225cm }
    \draw_path_lineto:n { -.275cm , -.35cm }
    \draw_path_arc:nnn { 360 } { 90 } { .075cm }
    \draw_path_lineto:n { -.35cm , -.275cm }
    \draw_path_lineto:n { -.225cm , -.15cm }
    \draw_path_lineto:n { -.425cm , .05cm }
    \draw_path_lineto:n { -.35cm , .125cm }
    \draw_path_lineto:n { .125cm , -.35cm }
    \draw_path_lineto:n { .05cm , -.425cm }
    \draw_path_close:
    \draw_path_moveto:n { -.2cm , -.025cm }
    \draw_path_lineto:n { .225cm , .425cm }
    \draw_path_lineto:n { .425cm , .425cm }
    \draw_path_lineto:n { .425cm , .225cm }
    \draw_path_lineto:n { -.025cm , -.2cm }
    \draw_path_moveto:n { .325cm , .325cm }
    \draw_path_lineto:n { 0cm , 0cm }
}

\cs_new:Npn \rpgicons_draw_shape_ranged: {
    \draw_path_moveto:n { 0cm , 0cm }
    \draw_path_lineto:n { 0cm , -.225cm }
    \draw_path_arc:nnn { 0 } { -30 } { .4cm }
    \draw_path_arc:nnn { -45 } { 0 } { .6cm }
    \draw_path_moveto:n { 0cm , 0cm }
    \draw_path_lineto:n { 0cm , .225cm }
    \draw_path_arc:nnn { 0 } { 30 } { .4cm }
    \draw_path_arc:nnn { 45 } { 0 } { .6cm }
    \draw_path_moveto:n { -.425cm , 0cm }
    \draw_path_lineto:n { .425cm , 0cm }
    \draw_path_moveto:n { .275cm , .1cm }
    \draw_path_lineto:n { .425cm , 0cm }
    \draw_path_lineto:n { .275cm , -.1cm }
    \draw_path_moveto:n { ( -.4cm , -.225cm ) + ( \draw_point_polar:nn { .4cm } { -20 } ) }
    \draw_path_lineto:n { -.425cm , 0cm }
    \draw_path_lineto:n { ( -.4cm , .225cm ) + ( \draw_point_polar:nn { .4cm } { 20 } ) }
}

\cs_new:Npn \rpgicons_draw_shape_magic: {
    \draw_path_moveto:n { -.225cm , -.425cm }
    \draw_path_lineto:n { -.425cm , -.225cm }
    \draw_path_lineto:n { -.3cm , -.1cm }
    \draw_path_lineto:n { -.3cm , .125cm }
    \draw_path_lineto:n { 0cm , .425cm }
    \draw_path_arc:nnn { 405 } { 315 } { .1cm }
    \draw_path_lineto:n { -.15cm , .1cm }
    \draw_path_lineto:n { -.15cm , -.05cm }
    \draw_path_arc:nnn { 180 } { 360 } { .05cm }
    \draw_path_lineto:n { -.05cm , 0cm }
    \draw_path_arc:nnn { 180 } { 90 } { .1cm }
    \draw_path_lineto:n { .05cm , -.1cm }
    \draw_path_arc:nnn { 360 } { 315 } { .125cm }
    \draw_path_close:
    \draw_path_moveto:n { -.225cm , -.25cm }
    \draw_path_lineto:n { -.325cm , -.15cm }
    \draw_path_moveto:n { .2cm , .2cm }
    \draw_path_arc:nnn { 180 } { 360 } { .1cm }
    \draw_path_arc:nnn { 0 } { 45 } { .1cm }
    \draw_path_arc:nnn { 225 } { 180 } { .2cm }
    \draw_path_circle:nn { .3cm , -.075cm } { .075cm }
}

\cs_new:Npn \rpgicons_draw_shape_singlehanded: {
    \draw_path_moveto:n { -.25cm , -.425cm }
    \draw_path_lineto:n { .025cm , -.425cm }
    \draw_path_lineto:n { .325cm , -.125cm }
    \draw_path_arc:nnn { 45 } { 135 } { .1cm }
    \draw_path_lineto:n { 0cm , -.275cm }
    \draw_path_lineto:n { -.15cm , -.275cm }
    \draw_path_arc:nnn { 270 } { 90 } { .05cm }
    \draw_path_lineto:n { -.1cm , -.175cm }
    \draw_path_arc:nnn { 270 } { 360 } { .1cm }
    \draw_path_lineto:n { -.2cm , -.075cm }
    \draw_path_arc:nnn { 90 } { 135 } { .125cm }
    \draw_path_lineto:n { -.425cm , -.25cm }
}

\cs_new:Npn \rpgicons_draw_shape_doublehanded: {
    \draw_path_moveto:n { -.25cm , -.425cm }
    \draw_path_lineto:n { .025cm , -.425cm }
    \draw_path_lineto:n { .325cm , -.125cm }
    \draw_path_arc:nnn { 45 } { 135 } { .1cm }
    \draw_path_lineto:n { 0cm , -.275cm }
    \draw_path_lineto:n { -.15cm , -.275cm }
    \draw_path_arc:nnn { 270 } { 90 } { .05cm }
    \draw_path_lineto:n { -.1cm , -.175cm }
    \draw_path_arc:nnn { 270 } { 360 } { .1cm }
    \draw_path_lineto:n { -.2cm , -.075cm }
    \draw_path_arc:nnn { 90 } { 135 } { .125cm }
    \draw_path_lineto:n { -.425cm , -.25cm }
    \draw_path_moveto:n { .25cm , .425cm }
    \draw_path_lineto:n { -.025cm , .425cm }
    \draw_path_lineto:n { -.325cm , .125cm }
    \draw_path_arc:nnn { 225 } { 315 } { .1cm }
    \draw_path_lineto:n { 0cm , .275cm }
    \draw_path_lineto:n { .15cm , .275cm }
    \draw_path_arc:nnn { 450 } { 270 } { .05cm }
    \draw_path_lineto:n { .1cm , .175cm }
    \draw_path_arc:nnn { 90 } { 180 } { .1cm }
    \draw_path_lineto:n { .2cm , .075cm }
    \draw_path_arc:nnn { 270 } { 315 } { .125cm }
    \draw_path_lineto:n { .425cm , .25cm }
}

% CONDITIONS

\cs_new:Npn \rpgicons_draw_shape_buff: {
    \draw_path_moveto:n { -.425cm , -.225cm }
    \draw_path_lineto:n { -.225cm , -.425cm }
    \draw_path_lineto:n { -.1cm , -.3cm }
    \draw_path_lineto:n { .125cm , -.3cm }
    \draw_path_lineto:n { .425cm , 0cm }
    \draw_path_arc:nnn { 45 } { 135 } { .1cm }
    \draw_path_lineto:n { .1cm , -.15cm }
    \draw_path_lineto:n { -.05cm , -.15cm }
    \draw_path_arc:nnn { 270 } { 90 } { .05cm }
    \draw_path_lineto:n { 0cm , -.05cm }
    \draw_path_arc:nnn { 270 } { 360 } { .1cm }
    \draw_path_lineto:n { -.1cm , .05cm }
    \draw_path_arc:nnn { 90 } { 135 } { .125cm }
    \draw_path_close:
    \draw_path_moveto:n { -.25cm , -.225cm }
    \draw_path_lineto:n { -.15cm , -.325cm }
    \draw_path_moveto:n { 0cm , .425cm }
    \draw_path_lineto:n { .25cm , .425cm }
    \draw_path_lineto:n { .25cm , .275cm }
    \draw_path_arc:nnn { 360 } { 180 } { .125cm }
    \draw_path_close:
    
}

\cs_new:Npn \rpgicons_draw_shape_blinded: {
    \draw_path_moveto:n { 0cm , .225cm }
    \draw_path_arc:nnn { 90 } { 30 } { .45cm }
    \draw_path_arc:nnn { 330 } { 210 } { .45cm }
    \draw_path_arc:nnn { 150 } { 90 } { .45cm }
    \draw_path_moveto:n { 0cm , .225cm }
    \draw_path_circle:nn { 0cm , 0cm } { .15cm }
    \draw_path_moveto:n { -.425cm , -.425cm }
    \draw_path_lineto:n { -.25cm , -.25cm }
    \draw_path_moveto:n { 0cm , 0cm }
    \draw_path_lineto:n { .425cm , .425cm }
}

\cs_new:Npn \rpgicons_draw_shape_charmed: {
    \draw_path_circle:nn { 0cm , 0cm } { .425cm }
    \draw_path_moveto:n { -.175cm , -.1cm }
    \draw_path_arc:nnn { 180 } { 360 } { .175cm }
    \draw_path_close:
    \draw_path_moveto:n { -.175cm , .15cm }
    \draw_path_arc:nnn { 0 } { 225 } { .0625cm }
    \draw_path_lineto:n { -.175cm , 0cm }
    \draw_path_moveto:n { -.175cm , .15cm }
    \draw_path_arc:nnn { 180 } { -45 } { .0625cm }
    \draw_path_lineto:n { -.175cm , 0cm }
    \draw_path_moveto:n { .175cm , .15cm }
    \draw_path_arc:nnn { 0 } { 225 } { .0625cm }
    \draw_path_lineto:n { .175cm , 0cm }
    \draw_path_moveto:n { .175cm , .15cm }
    \draw_path_arc:nnn { 180 } { -45 } { .0625cm }
    \draw_path_lineto:n { .175cm , 0cm }
}

\cs_new:Npn \rpgicons_draw_shape_deafened: {
    \draw_path_moveto:n { -.175cm , -.275cm }
    \draw_path_arc:nnn { 180 } { 360 } { .15cm }
    \draw_path_lineto:n { .125cm , -.225cm }
    \draw_path_arc:nnn { 180 } { 135 } { .25cm }
    \draw_path_arc:nnn { 315 } { 360 } { .25cm }
    \draw_path_arc:nnn { 0 } { 180 } { .275cm }
    \draw_path_moveto:n { -.15cm , -.1cm }
    \draw_path_arc:nnn { -90 } { 90 } { .075cm }
    \draw_path_lineto:n { -.15cm , .125cm }
    \draw_path_arc:nnn { 180 } { 45 } { .15cm }
    \draw_path_moveto:n { -.425cm , -.425cm }
    \draw_path_lineto:n { -.2cm , -.2cm }
    \draw_path_moveto:n { 0cm , 0cm }
    \draw_path_lineto:n { .425cm , .425cm }
}

\cs_new:Npn \rpgicons_draw_shape_exhausted: {
    \draw_path_circle:nn { 0cm , 0cm } { .425cm }
    \draw_path_moveto:n { -.175cm , -.225cm }
    \draw_path_arc:nnn { 180 } { 0 } { .175cm }
    \draw_path_close:
    \draw_path_moveto:n { .275cm , .15cm }
    \draw_path_arc:nnn { 180 } { 0 } { -.1cm }
    \draw_path_moveto:n { -.075cm , .15cm }
    \draw_path_arc:nnn { 180 } { 0 } { -.1cm }
}

\cs_new:Npn \rpgicons_draw_shape_frightened: {
    \draw_path_circle:nn { 0cm , 0cm } { .425cm }
    \draw_path_moveto:n { -.175cm , -.225cm }
    \draw_path_arc:nnn { 180 } { 0 } { .175cm }
    \draw_path_close:
    \draw_path_circle:nn { -.175cm , .125cm } { .075cm }
    \draw_path_circle:nn { .175cm , .125cm } { .075cm }
}

\cs_new:Npn \rpgicons_draw_shape_grappled: {
    \draw_path_moveto:n { -.25cm , .3cm }
    \draw_path_arc:nnn { 90 } { -90 } { .075cm }
    \draw_path_lineto:n { -.35cm , .15cm }
    \draw_path_arc:nnn { 270 } { 90 } { .075cm }
    \draw_path_close:
    \draw_path_moveto:n { -.2cm , .15cm }
    \draw_path_arc:nnn { 90 } { -90 } { .075cm }
    \draw_path_lineto:n { -.35cm , 0cm }
    \draw_path_arc:nnn { 270 } { 90 } { .075cm }
    \draw_path_close:
    \draw_path_moveto:n { -.2cm , 0cm }
    \draw_path_arc:nnn { 90 } { -90 } { .075cm }
    \draw_path_lineto:n { -.35cm , -.15cm }
    \draw_path_arc:nnn { 270 } { 90 } { .075cm }
    \draw_path_close:
    \draw_path_moveto:n { -.2cm , -.15cm }
    \draw_path_arc:nnn { 90 } { -90 } { .075cm }
    \draw_path_lineto:n { -.3cm , -.3cm }
    \draw_path_arc:nnn { 270 } { 90 } { .075cm }
    \draw_path_close:
    \draw_path_moveto:n { .425cm , .05cm }
    \draw_path_arc:nnn { 0 } { 90 } { .25cm }
    \draw_path_lineto:n { -.05cm , .3cm }
    \draw_path_arc:nnn { 180 } { 270 } { .15cm }
    \draw_path_lineto:n { .175cm , .15cm }
    \draw_path_lineto:n { .175cm , -.425cm }
    \draw_path_moveto:n { .175cm , -.275cm }
    \draw_path_lineto:n { .425cm , -.275cm }
    \draw_path_moveto:n { .175cm , .3cm }
    \draw_path_lineto:n { .175cm , .425cm }
    \draw_path_moveto:n { -.3cm , .3cm }
    \draw_path_lineto:n { -.3cm , .425cm }
    \draw_path_moveto:n { -.3cm , -.3cm }
    \draw_path_lineto:n { -.3cm , -.425cm }
}

\cs_new:Npn \rpgicons_draw_shape_incapacitated: {
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 30 } }
    \draw_path_arc:nnn { 270 } { 210 } { .425cm }
    \draw_path_lineto:n { \draw_point_polar:nn { -.425cm} { 90 } }
    \draw_path_arc:nnn { 30 } { 90 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 90 } }
    \draw_path_arc:nnn { 330 } { 270 } { .425cm }
    \draw_path_lineto:n { \draw_point_polar:nn { -.425cm} { 150 } }
    \draw_path_arc:nnn { 90 } { 150 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 150 } }
    \draw_path_arc:nnn { 30 } { -30 } { .425cm }
    \draw_path_lineto:n { \draw_point_polar:nn { -.425cm} { 210 } }
    \draw_path_arc:nnn { 150 } { 210 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .25cm} { 30 } }
    \draw_path_arc:nnn { 270 } { 210 } { .25cm }
    \draw_path_arc:nnn { 330 } { 270 } { .25cm }
    \draw_path_arc:nnn { 30 } { -30 } { .25cm }
    \draw_path_arc:nnn { 90 } { 30 } { .25cm }
    \draw_path_arc:nnn { 150 } { 90 } { .25cm }
    \draw_path_arc:nnn { 210 } { 150 } { .25cm }
}

\cs_new:Npn \rpgicons_draw_shape_invisible: {
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { -15 } }
    \draw_path_arc:nnn { -15 } { 15 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 30 } }
    \draw_path_arc:nnn { 30 } { 60 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 75 } }
    \draw_path_arc:nnn { 75 } { 105 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 120 } }
    \draw_path_arc:nnn { 120 } { 150 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 165 } }
    \draw_path_arc:nnn { 165 } { 195 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 210 } }
    \draw_path_arc:nnn { 210 } { 240 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 255 } }
    \draw_path_arc:nnn { 255 } { 285 } { .425cm }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 300 } }
    \draw_path_arc:nnn { 300 } { 330 } { .425cm }
}

\cs_new:Npn \rpgicons_draw_shape_paralyzed: {
    \draw_path_circle:nn { 0cm , 0cm } { .425cm }
    \draw_path_moveto:n { -.175cm , -.225cm }
    \draw_path_arc:nnn { 180 } { 0 } { .175cm }
    \draw_path_close:
    \draw_path_moveto:n { .25cm , .2cm }
    \draw_path_lineto:n { .1cm , .05cm }
    \draw_path_moveto:n { .25cm , .05cm }
    \draw_path_lineto:n { .1cm , .2cm }
    \draw_path_moveto:n { -.25cm , .2cm }
    \draw_path_lineto:n { -.1cm , .05cm }
    \draw_path_moveto:n { -.25cm , .05cm }
    \draw_path_lineto:n { -.1cm , .2cm }
}

\cs_new:Npn \rpgicons_draw_shape_petrified: {
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 45 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 100 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 135 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 190 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 230 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 250 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 300 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .425cm} { 350 } }
    \draw_path_close:
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 135 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 130 } }
    \draw_path_lineto:n { -.25cm , .075cm }
    \draw_path_lineto:n { \draw_point_polar:nn { .2cm} { 220 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .325cm} { 240 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 300 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .3cm} { 330 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .225cm} { 350 } }
    \draw_path_moveto:n { \draw_point_polar:nn { .425cm} { 45 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .3cm} { 60 } }
    \draw_path_lineto:n { \draw_point_polar:nn { .35cm} { 130 } }
    \draw_path_moveto:n { -.15cm , -.175cm }
    \draw_path_lineto:n { .075cm , -.15cm }
    \draw_path_lineto:n { .125cm , -.2cm }
    \draw_path_moveto:n { -.25cm , .075cm }
    \draw_path_lineto:n { -.1cm , .1cm }
    \draw_path_moveto:n { .25cm , .075cm }
    \draw_path_lineto:n { .1cm , .1cm }
}

\cs_new:Npn \rpgicons_draw_shape_poisoned: {
    \draw_path_circle:nn { 0cm , 0cm } { .425cm }
    \draw_path_moveto:n { -.15cm , -.2cm }
    \draw_path_lineto:n { -.075cm , -.125cm }
    \draw_path_lineto:n { 0cm , -.2cm }
    \draw_path_lineto:n { .075cm , -.125cm }
    \draw_path_lineto:n { .15cm , -.2cm }
    \draw_path_moveto:n { .25cm , .175cm }
    \draw_path_lineto:n { .1cm , .1cm }
    \draw_path_lineto:n { .25cm , .025cm }
    \draw_path_moveto:n { -.25cm , .175cm }
    \draw_path_lineto:n { -.1cm , .1cm }
    \draw_path_lineto:n { -.25cm , .025cm }
}
    
\cs_new:Npn \rpgicons_draw_shape_prone: {
    \draw_path_circle:nn { .2cm , -.125cm } { .125cm }
    \draw_path_moveto:n { -.425cm , 0cm }
    \draw_path_lineto:n { -.15cm , 0cm }
    \draw_path_arc:nnn { 90 } { -90 } { .125cm }
    \draw_path_lineto:n { -.425cm , -.25cm }
    \draw_path_moveto:n { .225cm , .15cm }
    \draw_path_arc:nnn { 270 } { 360 } { .1cm }
    \draw_path_arc:nnn { 180 } { 270 } { .1cm }
    \draw_path_arc:nnn { 90 } { 180 } { .1cm }
    \draw_path_arc:nnn { 0 } { 90 } { .1cm }
    \draw_path_moveto:n { 0cm , .25cm }
    \draw_path_arc:nnn { 270 } { 360 } { .1cm }
    \draw_path_arc:nnn { 180 } { 270 } { .1cm }
    \draw_path_arc:nnn { 90 } { 180 } { .1cm }
    \draw_path_arc:nnn { 0 } { 90 } { .1cm }
}

\cs_new:Npn \rpgicons_draw_shape_restrained: {
    \draw_path_moveto:n { -.075cm , -.225cm }
    \draw_path_lineto:n { -.075cm , .225cm }
    \draw_path_arc:nnn { 90 } { 180 } { .125cm }
    \draw_path_lineto:n { -.2cm , 0cm }
    \draw_path_arc:nnn { 270 } { 180 } { .1cm }
    \draw_path_lineto:n { -.3cm , .3cm }
    \draw_path_arc:nnn { 0 } { 90 } { .125cm }
    \draw_path_lineto:n { -.425cm , -.075cm }
    \draw_path_arc:nnn { 180 } { 235 } { .1cm }
    \draw_path_lineto:n { -.3cm , -.225cm }
    \draw_path_moveto:n { .075cm , -.225cm }
    \draw_path_lineto:n { .075cm , .225cm }
    \draw_path_arc:nnn { 90 } { 0 } { .125cm }
    \draw_path_lineto:n { .2cm , 0cm }
    \draw_path_arc:nnn { -90 } { 0 } { .1cm }
    \draw_path_lineto:n { .3cm , .3cm }
    \draw_path_arc:nnn { 180 } { 90 } { .125cm }
    \draw_path_lineto:n { .425cm , -.075cm }
    \draw_path_arc:nnn { 360 } { 330 } { .1cm }
    \draw_path_lineto:n { .3cm , -.225cm }
    \draw_path_moveto:n { .35cm , -.225cm }
    \draw_path_arc:nnn { 90 } { -90 } { .05cm }
    \draw_path_lineto:n { -.35cm , -.325cm }
    \draw_path_arc:nnn { 270 } { 90 } { .05cm }
    \draw_path_close:
    \draw_path_moveto:n { .35cm , -.325cm }
    \draw_path_arc:nnn { 90 } { -90 } { .05cm }
    \draw_path_lineto:n { -.35cm , -.425cm }
    \draw_path_arc:nnn { 270 } { 90 } { .05cm }
    \draw_path_close:   
}

\cs_new:Npn \rpgicons_draw_shape_stunned: {
    \draw_path_circle:nn { 0cm , 0cm } { .425cm }
    \draw_path_ellipse:nnn { 0cm , -.175cm } { 0cm , .1cm } { .175cm , 0cm }
    \draw_path_moveto:n { ( -.175cm , .125cm ) + ( \draw_point_polar:nn { .125cm } { 90 } ) }
    \draw_path_lineto:n { ( -.175cm , .125cm ) + ( \draw_point_polar:nn { .05cm } { 126 } ) }
    \draw_path_lineto:n { ( -.175cm , .125cm ) + ( \draw_point_polar:nn { .125cm } { 162 } ) }
    \draw_path_lineto:n { ( -.175cm , .125cm ) + ( \draw_point_polar:nn { .05cm } { 198 } ) }
    \draw_path_lineto:n { ( -.175cm , .125cm ) + ( \draw_point_polar:nn { .125cm } { 234 } ) }
    \draw_path_lineto:n { ( -.175cm , .125cm ) + ( \draw_point_polar:nn { .05cm } { 270 } ) }
    \draw_path_lineto:n { ( -.175cm , .125cm ) + ( \draw_point_polar:nn { .125cm } { 306 } ) }
    \draw_path_lineto:n { ( -.175cm , .125cm ) + ( \draw_point_polar:nn { .05cm } { 342 } ) }
    \draw_path_lineto:n { ( -.175cm , .125cm ) + ( \draw_point_polar:nn { .125cm } { 18 } ) }
    \draw_path_lineto:n { ( -.175cm , .125cm ) + ( \draw_point_polar:nn { .05cm } { 54 } ) }
    \draw_path_close:
    \draw_path_moveto:n { ( .175cm , .125cm ) + ( \draw_point_polar:nn { .125cm } { 90 } ) }
    \draw_path_lineto:n { ( .175cm , .125cm ) + ( \draw_point_polar:nn { .05cm } { 126 } ) }
    \draw_path_lineto:n { ( .175cm , .125cm ) + ( \draw_point_polar:nn { .125cm } { 162 } ) }
    \draw_path_lineto:n { ( .175cm , .125cm ) + ( \draw_point_polar:nn { .05cm } { 198 } ) }
    \draw_path_lineto:n { ( .175cm , .125cm ) + ( \draw_point_polar:nn { .125cm } { 234 } ) }
    \draw_path_lineto:n { ( .175cm , .125cm ) + ( \draw_point_polar:nn { .05cm } { 270 } ) }
    \draw_path_lineto:n { ( .175cm , .125cm ) + ( \draw_point_polar:nn { .125cm } { 306 } ) }
    \draw_path_lineto:n { ( .175cm , .125cm ) + ( \draw_point_polar:nn { .05cm } { 342 } ) }
    \draw_path_lineto:n { ( .175cm , .125cm ) + ( \draw_point_polar:nn { .125cm } { 18 } ) }
    \draw_path_lineto:n { ( .175cm , .125cm ) + ( \draw_point_polar:nn { .05cm } { 54 } ) }
    \draw_path_close:
}

\cs_new:Npn \rpgicons_draw_shape_unconscious: {
    \draw_path_moveto:n { 0cm , .15cm }
    \draw_path_arc:nnnn { 90 } { -30 } { .425cm } { .15cm }
    \draw_path_moveto:n { 0cm , -.15cm }
    \draw_path_arc:nnnn { 270 } { 150 } { .425cm } { .15cm }
    \draw_path_moveto:n { -.35cm , .15cm }
    \draw_path_arc:nnn { 270 } { 360 } { .125cm }
    \draw_path_arc:nnn { 180 } { 270 } { .125cm }
    \draw_path_arc:nnn { 90 } { 180 } { .125cm }
    \draw_path_arc:nnn { 0 } { 90 } { .125cm }
    \draw_path_moveto:n { .1cm , -.15cm }
    \draw_path_arc:nnn { 270 } { 360 } { .125cm }
    \draw_path_arc:nnn { 180 } { 270 } { .125cm }
    \draw_path_arc:nnn { 90 } { 180 } { .125cm }
    \draw_path_arc:nnn { 0 } { 90 } { .125cm }
}

\cs_new:Npn \rpgicons_draw_shape_hearing: {
    \draw_path_moveto:n { -.175cm , -.275cm }
    \draw_path_arc:nnn { 180 } { 360 } { .15cm }
    \draw_path_lineto:n { .125cm , -.225cm }
    \draw_path_arc:nnn { 180 } { 135 } { .25cm }
    \draw_path_arc:nnn { 315 } { 360 } { .25cm }
    \draw_path_arc:nnn { 0 } { 180 } { .275cm }
    \draw_path_moveto:n { -.15cm , -.1cm }
    \draw_path_arc:nnn { -90 } { 90 } { .075cm }
    \draw_path_lineto:n { -.15cm , .125cm }
    \draw_path_arc:nnn { 180 } { 45 } { .15cm }
}

\cs_new:Npn \rpgicons_draw_shape_seeing: {
    \draw_path_moveto:n { 0cm , .225cm }
    \draw_path_arc:nnn { 90 } { 30 } { .45cm }
    \draw_path_arc:nnn { 330 } { 210 } { .45cm }
    \draw_path_arc:nnn { 150 } { 90 } { .45cm }
    \draw_path_moveto:n { 0cm , .225cm }
    \draw_path_circle:nn { 0cm , 0cm } { .15cm }
}

% FRAMES

\cs_new:Npn \rpgicons_draw_frame_ability: {
    \draw_path_circle:nn { 0cm , 0cm } { .45cm }
}

\cs_new:Npn \rpgicons_draw_frame_saving: {
    \draw_path_moveto:n { -.45cm, . 45cm }
    \draw_path_lineto:n { .45cm , .45cm }
    \draw_path_lineto:n { .45cm , -.05cm }
    \draw_path_arc:nnn { 360 } { 180 } { .45cm }
    \draw_path_close:
}

\cs_new:Npn \rpgicons_draw_frame_spellschool: {
    \draw_path_moveto:n { -.475cm, . 35cm }
    \draw_path_lineto:n { -.35cm , .475cm }
    \draw_path_lineto:n { .35cm , .475cm }
    \draw_path_lineto:n { .475cm , .35cm }
    \draw_path_lineto:n { .425cm , -.375cm }
    \draw_path_lineto:n { 0cm , -.475cm }
    \draw_path_lineto:n { -.425cm , -.375cm }
    \draw_path_close:
}

\cs_new:Npn \rpgicons_draw_frame_damage: {
    \draw_path_circle:nn { 0cm , 0cm } { .45cm }
}

% USER COMMANDS

\NewDocumentCommand { \rpgiconsset } { m } {
    \keys_set:nn { rpgicons / local ~ options } {#1}
}

\dim_new:N \l_rpgicons_icon_before_sep_dim
\dim_new:N \l_rpgicons_icon_after_sep_dim
\dim_new:N \l_rpgicons_icon_baseline_dim
\dim_new:N \l_rpgicons_icon_linewidth_dim

\tl_new:N \l_rpgicons_icon_frame_tl
\tl_new:N \l_rpgicons_icon_color_stroke_tl
\tl_new:N \l_rpgicons_icon_color_fill_tl
\tl_new:N \l_rpgicons_icon_color_text_tl
\tl_new:N \l_rpgicons_icon_color_background_tl

\fp_new:N \l_rpgicons_icon_opacity_stroke_fp
\fp_set:Nn \l_rpgicons_icon_opacity_stroke_fp { 1.0 }
\fp_new:N \l_rpgicons_icon_opacity_fill_fp
\fp_set:Nn \l_rpgicons_icon_opacity_fill_fp { 1.0 }
\fp_new:N \l_rpgicons_icon_opacity_text_fp
\fp_set:Nn \l_rpgicons_icon_opacity_text_fp { 1.0 }
\fp_new:N \l_rpgicons_icon_opacity_background_fp
\fp_set:Nn \l_rpgicons_icon_opacity_background_fp { 1.0 }

\fp_new:N \l_rpgicons_icon_transform_scale_fp
\fp_new:N \l_rpgicons_icon_transform_scale_inner_fp
\fp_new:N \l_rpgicons_icon_transform_rotate_fp

\bool_new:N \l_rpgicons_icon_accessible_basic_bool
\bool_new:N \l_rpgicons_icon_accessible_full_bool

\cs_generate_variant:Nn \color_select:n { V }
\cs_generate_variant:Nn \color_stroke:n { V }
\cs_generate_variant:Nn \color_fill:n { V }

\bool_new:N \l__rpgicons_opacity_warning_bool
\cs_new:Npn \__rpgicons_opacity_check: {
    \bool_lazy_and:nnT { 
        \bool_not_p:n { \l__rpgicons_opacity_warning_bool }
    } {
        \bool_not_p:n { \l__rpgicons_use_opacity_bool } 
    } {
        \msg_warning:nn { rpgicons } { opacity-option-missing }
        \bool_set_true:N \l__rpgicons_opacity_warning_bool
    }
}
\cs_new:Npn \__rpgicons_accessible_check: {
    \IfDocumentMetadataTF { } {
        \msg_error:nn { rpgicons } { documentmetadata-missing }
    }
}

\cs_generate_variant:Nn \bool_set:Nn { Ne }
\keys_define:nn { rpgicons / local ~ options } {
    before ~ sep         .groups:n   = { extra } , 
    before ~ sep         .dim_set:N  = \l_rpgicons_icon_before_sep_dim ,
    before ~ sep         .initial:n  = { 0.05em } ,
    after ~ sep          .groups:n   = { extra } , 
    after ~ sep          .dim_set:N  = \l_rpgicons_icon_after_sep_dim ,
    after ~ sep          .initial:n  = { 0.05em } ,
    accessible           .choice:    ,
    accessible / false   .code:n     = {
        \bool_set_false:N \l_rpgicons_icon_accessible_basic_bool
        \bool_set_false:N \l_rpgicons_icon_accessible_full_bool
    } ,
    accessible / basic   .code:n     = {
        \bool_set_true:N \l_rpgicons_icon_accessible_basic_bool
        \bool_set_false:N \l_rpgicons_icon_accessible_full_bool
    } ,
    accessible / full    .code:n     = {
        \bool_set_true:N \l_rpgicons_icon_accessible_basic_bool
        \bool_set_true:N \l_rpgicons_icon_accessible_full_bool
    } ,
    accessible           .default:n  = { basic } ,
    baseline             .dim_set:N  = \l_rpgicons_icon_baseline_dim ,
    baseline             .initial:n  = { -3.5pt } ,
    frame                .tl_set:N   = \l_rpgicons_icon_frame_tl ,
    frame                .initial:n  = { } ,
    stroke               .tl_set:N   = \l_rpgicons_icon_color_stroke_tl ,
    stroke               .initial:n  = { . } ,
    fill                 .tl_set:N   = \l_rpgicons_icon_color_fill_tl ,
    fill                 .initial:n  = { . } ,
    text                 .tl_set:N   = \l_rpgicons_icon_color_text_tl ,
    text                 .initial:n  = { . } ,
    color                .code:n     = {
        \tl_set:Nn \l_rpgicons_icon_color_stroke_tl {#1}
        \tl_set:Nn \l_rpgicons_icon_color_fill_tl {#1}
        \tl_set:Nn \l_rpgicons_icon_color_text_tl {#1}
    } ,
    background           .tl_set:N   = \l_rpgicons_icon_color_background_tl ,
    background           .initial:n  = { white } ,
    stroke ~ opacity     .code:n     = { 
        \__rpgicons_opacity_check: 
        \fp_set:Nn \l_rpgicons_icon_opacity_stroke_fp {#1}
    } ,
    fill ~ opacity       .code:n     = { 
        \__rpgicons_opacity_check: 
        \fp_set:Nn \l_rpgicons_icon_opacity_fill_fp {#1}
    } ,
    text ~ opacity       .code:n     = { 
        \__rpgicons_opacity_check: 
        \fp_set:Nn \l_rpgicons_icon_opacity_text_fp {#1}
    } ,
    opacity              .code:n     = { 
        \__rpgicons_opacity_check: 
        \fp_set:Nn \l_rpgicons_icon_opacity_stroke_fp {#1}
        \fp_set:Nn \l_rpgicons_icon_opacity_fill_fp {#1}
        \fp_set:Nn \l_rpgicons_icon_opacity_text_fp {#1}
    } ,
    background ~ opacity .code:n     = { 
        \__rpgicons_opacity_check: 
        \fp_set:Nn \l_rpgicons_icon_opacity_background_fp {#1}
    } ,
    line ~ width         .dim_set:N  = \l_rpgicons_icon_linewidth_dim , 
    line ~ width         .initial:n  = { \l_draw_default_linewidth_dim } , 
    scale                .fp_set:N   = \l_rpgicons_icon_transform_scale_fp ,
    scale                .initial:n  = { 1.0 } ,
    scale ~ inner        .fp_set:N   = \l_rpgicons_icon_transform_scale_inner_fp ,
    scale ~ inner        .initial:n  = { 0.675 } ,
    rotate               .fp_set:N   = \l_rpgicons_icon_transform_rotate_fp ,
    rotate               .initial:n  = { 0.0 } ,
}

\clist_const:Nn \c__rpgicons_types_clist {
    die , ability , saving , spell , spellschool , damage , attack , condition
}

\str_new:N \l__rpgicons_icon_shape_name_str
\clist_map_inline:Nn \c__rpgicons_types_clist {
    \str_set:Nn \l__rpgicons_icon_shape_name_str {#1}
    \str_replace_all:Nnn \l__rpgicons_icon_shape_name_str { ~ } { _ }
    \clist_new:c { l_rpgicons_types_every_ \l__rpgicons_icon_shape_name_str _style_clist }
    \keys_define:nn { rpgicons / local ~ options } {
        every ~ #1 .code:n = { 
            \clist_set:cn { 
                l_rpgicons_types_every_ \l__rpgicons_icon_shape_name_str _style_clist
            } {##1}   
        } 
    }
}

\clist_const:Nn \c__rpgicons_shapes_clist {
    twoside , fourside , sixside , eightside , tenside , twelveside , twentyside , hundredside ,
    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 ~ alt , constitution , intelligence , wisdom , charisma , 
    resilience , sanity , perception , luck , armor , proficiency ,
    linear , conic , quadratic , cubic , spheric , cylindric , verbal , somatic , material , focus ,
    abjuration , conjuration , divination , enchantment , evocation , illusion , necromancy , transmutation ,
    acid , bludgeoning , cold , fire , force , lightning , necrotic , piercing , poison , psychic ,
    radiant , slashing , thunder , healing , 
    melee , ranged , magic , singlehanded , doublehanded ,
    buff , blinded , charmed , deafened , exhausted , frightened , grappled , incapacitated , invisible ,
    paralyzed , petrified , poisoned , prone , restrained , stunned , unconscious , hearing , seeing
}

\clist_map_inline:Nn \c__rpgicons_shapes_clist {
    \str_set:Nn \l__rpgicons_icon_shape_name_str {#1}
    \str_replace_all:Nnn \l__rpgicons_icon_shape_name_str { ~ } { _ }
    \clist_new:c { l_rpgicons_shapes_every_ \l__rpgicons_icon_shape_name_str _style_clist }
    \keys_define:nn { rpgicons / local ~ options } {
        every ~ #1 .code:n = { 
            \clist_set:cn { 
                l_rpgicons_shapes_every_ \l__rpgicons_icon_shape_name_str _style_clist
            } {##1}   
        } 
    }
}

\seq_new:N \l__rpgicons_icon_shape_name_parts_seq
\coffin_new:N \l__rpgicons_icon_accessible_coffin
\coffin_new:N \l__rpgicons_icon_label_coffin
\bool_if:NT \l__rpgicons_compat_mode_bool {
    % l3keys cs name fix
    \cs_generate_variant:Nn \keys_set:nn { ne }
    \cs_generate_variant:Nn \str_set:Nn { Ne }
    \cs_generate_variant:Nn \seq_set_split:Nnn { Nee }
}
\prg_generate_conditional_variant:Nnn \clist_if_in:nn { ne } { T , TF }
\cs_generate_variant:Nn \hcoffin_set:Nn { Ne }
\cs_generate_variant:Nn \keys_set_groups:nnn { nne }
\cs_generate_variant:Nn \keys_set_exclude_groups:nnn { nne }
\NewDocumentCommand \RPGIconsUseIcon { s O{} o m } {
    \bool_if:NT \l_rpgicons_icon_accessible_full_bool { 
        \__rpgicons_accessible_check:
        \pdf_bdc:nn { Span } { /Alt ~ ( #4 ) }
    }
    \draw_begin:
        \draw_cap_round:
        \draw_join_round:
        \bool_if:NTF \l__rpgicons_compat_mode_bool {
            % l3keys cs name fix
            \keys_set:ne { rpgicons / local ~ options } {#2}
        } {
            \keys_set_exclude_groups:nne { rpgicons / local ~ options } { extra } {#2}
        } 
        \str_set:Ne \l__rpgicons_icon_shape_name_str {#4}
        \str_replace_all:Nnn \l__rpgicons_icon_shape_name_str { ~ } { _ }
        \str_if_empty:NF \l__rpgicons_icon_shape_name_str {
            \clist_if_exist:cT { l_rpgicons_shapes_every_ \l__rpgicons_icon_shape_name_str _style_clist } {
                \keys_set:ne { rpgicons / local ~ options } { 
                    \clist_use:cn { l_rpgicons_shapes_every_ \l__rpgicons_icon_shape_name_str _style_clist } { , } 
                }
            }
        }
        \color_stroke:V { \l_rpgicons_icon_color_stroke_tl }
        \color_fill:V { \l_rpgicons_icon_color_fill_tl }
        \bool_if:NT \l__rpgicons_use_opacity_bool {
            \opacity_stroke:n { \l_rpgicons_icon_opacity_stroke_fp }
            \opacity_fill:n { \l_rpgicons_icon_opacity_fill_fp }
        }
        \draw_linewidth:n { \l_rpgicons_icon_linewidth_dim }
        \draw_transform_scale:n { \l_rpgicons_icon_transform_scale_fp }
        \draw_transform_rotate:n { \l_rpgicons_icon_transform_rotate_fp }
        \draw_baseline:n { \l_rpgicons_icon_baseline_dim }
        \bool_if:NT \l_rpgicons_icon_accessible_basic_bool { 
            \draw_scope_begin:
                \bool_if:NTF \l__rpgicons_compat_mode_bool {
                    % l3draw rectangle fix
                    % l3draw bounding box workaround
                    \draw_path_moveto:n { -.5cm , .5cm }
                    \draw_path_lineto:n { -.5cm , .5cm }
                    \draw_path_lineto:n { .5cm , .5cm }
                    \draw_path_lineto:n { .5cm , .5cm }
                    \draw_path_close:
                    \draw_path_use_clear:n { clip }
                } {
                    \draw_path_rectangle_corners:nn 
                        { -.5cm , .5cm }
                        { .5cm , .5cm }
                    \draw_path_use_clear:n { clip }
                }
                \bool_if:NTF \l_rpgicons_icon_accessible_full_bool { 
                    \hcoffin_set:Nn \l__rpgicons_icon_accessible_coffin { \pdffakespace #4 \pdffakespace }
                } {
                    \hcoffin_set:Nn \l__rpgicons_icon_accessible_coffin {#4}
                }
                \coffin_resize:Nnn \l__rpgicons_icon_accessible_coffin { 1cm } { 1cm }
                \draw_coffin_use:Nnnn \l__rpgicons_icon_accessible_coffin { hc } { vc } { 0cm , 0cm }
            \draw_scope_end:
        }
        \bool_if:NTF \l__rpgicons_compat_mode_bool {
            % l3draw rectangle fix
            % l3draw bounding box workaround
            \draw_path_moveto:n { -.5cm , -.5cm - \l_rpgicons_icon_linewidth_dim / 2 }
            \draw_path_lineto:n { -.5cm , .5cm + \l_rpgicons_icon_linewidth_dim / 2 }
            \draw_path_lineto:n { .5cm , .5cm + \l_rpgicons_icon_linewidth_dim / 2 }
            \draw_path_lineto:n { .5cm , -.5cm - \l_rpgicons_icon_linewidth_dim / 2 }
            \draw_path_close:
            \draw_path_use_clear:n { clip }
        } {
            \draw_path_rectangle_corners:nn 
                { -.5cm , -.5cm - \l_rpgicons_icon_linewidth_dim / 2 }
                { .5cm , .5cm + \l_rpgicons_icon_linewidth_dim / 2 }
            \draw_path_replace_bb:
            \bool_set_false:N \l_draw_bb_update_bool    
        }
        \draw_scope_begin: 
            \clist_if_in:neT { ability , saving , spellschool , damage } { \l_rpgicons_icon_frame_tl } {
                \use:c { rpgicons_draw_frame_ \l_rpgicons_icon_frame_tl : }
                \IfBooleanTF {#1} {
                    \draw_path_use_clear:n { fill }
                    \color_select:V { \l_rpgicons_icon_color_background_tl }
                    \bool_if:NT \l__rpgicons_use_opacity_bool {
                        \opacity_select:n { \l_rpgicons_icon_opacity_background_fp }
                    }            
                } {
                    \draw_path_use_clear:n { stroke }
                }
                \draw_transform_scale:n { \l_rpgicons_icon_transform_scale_inner_fp } 
            } 
            \clist_if_in:neTF { sixside ~ one , sixside ~ two , sixside ~ three , sixside ~ four , 
                sixside ~ five , sixside ~ six , sixside ~ seven , sixside ~ eight , sixside ~ nine } {#4} {
                \seq_set_split:Nee \l__rpgicons_icon_shape_name_parts_seq 
                    { \c_underscore_str } { \l__rpgicons_icon_shape_name_str }
                \exp_args:Ne \rpgicons_draw_shape_sixside_pips:n { 
                    \seq_item:Nn \l__rpgicons_icon_shape_name_parts_seq { 2 } 
                }
            } {
                \use:c { rpgicons_draw_shape_ \l__rpgicons_icon_shape_name_str : }
            }
            \draw_path_use_clear:n { stroke }
            \IfValueT {#3} {
                \draw_scope_begin:
                    \color_select:V { \l_rpgicons_icon_color_text_tl }
                    \bool_if:NT \l__rpgicons_use_opacity_bool {
                        \opacity_select:n { \l_rpgicons_icon_opacity_text_fp }
                    }
                    \hcoffin_set:Ne \l__rpgicons_icon_label_coffin {#3}
                    \draw_coffin_use:Nnn \l__rpgicons_icon_label_coffin { hc } { vc } 
                \draw_scope_end:
            }
        \draw_scope_end:
    \draw_end:
    \bool_if:NT \l_rpgicons_icon_accessible_full_bool { 
        \pdf_emc:
    }
}

\str_new:N \l__rpgicons_icon_integer_str
\cs_generate_variant:Nn \str_if_eq:nnTF { ne }
\NewDocumentCommand { \RPGIconsDie } { O{normal} m O{} m } {
    \group_begin: 
        \keys_set_groups:nne { rpgicons / local ~ options } { extra } {#3}
        \keys_set:ne { rpgicons / local ~ options } { \clist_use:Nn \l_rpgicons_types_every_die_style_clist { , } }
        \str_set:Ne \l__rpgicons_icon_integer_str {#4}
        \hspace { \l_rpgicons_icon_before_sep_dim }
        \str_if_eq:neTF { large } {#1} {
            \RPGIconsUseIcon[scale=.675, #3][#4]{#2}
        } {
            \str_if_empty:NF \l__rpgicons_icon_integer_str { \str_use:N \l__rpgicons_icon_integer_str \, }
            \RPGIconsUseIcon[scale=.333, #3]{#2}
        }
        \hspace { \l_rpgicons_icon_after_sep_dim }
    \group_end:
}
\cs_if_exist:NF \die { \cs_new_eq:NN \die \RPGIconsDie }

\NewDocumentCommand { \RPGIconsAbility } { O{positive} m O{} } {
    \group_begin:
        \keys_set_groups:nne { rpgicons / local ~ options } { extra } {#3}
        \keys_set:ne { rpgicons / local ~ options } { \clist_use:Nn \l_rpgicons_types_every_ability_style_clist { , } }
        \hspace { \l_rpgicons_icon_before_sep_dim }
        \str_if_eq:neTF { negative } {#1} {
            \RPGIconsUseIcon*[frame=ability, scale=.333, #3]{#2} 
        } {
            \RPGIconsUseIcon[scale=.333, #3]{#2}
        }
        \hspace { \l_rpgicons_icon_after_sep_dim }
    \group_end:
}
\cs_if_exist:NF \ability { \cs_new_eq:NN \ability \RPGIconsAbility }

\NewDocumentCommand { \RPGIconsSaving } { O{} m O{} } {
    \group_begin:
        \keys_set_groups:nne { rpgicons / local ~ options } { extra } {#3}
        \keys_set:ne { rpgicons / local ~ options } { \clist_use:Nn \l_rpgicons_types_every_saving_style_clist { , } }
        \hspace { \l_rpgicons_icon_before_sep_dim }
        \str_if_eq:neTF { empty } {#1} {
            \RPGIconsUseIcon[frame=saving, scale=.333, #3]{} 
        } {
            \RPGIconsUseIcon[frame=saving, scale=.333, #3]{#2}
        }
        \hspace { \l_rpgicons_icon_after_sep_dim }
    \group_end:
}
\cs_if_exist:NF \saving { \cs_new_eq:NN \saving \RPGIconsSaving }

\NewDocumentCommand { \RPGIconsSpell } { m O{} } {
    \group_begin:
        \keys_set_groups:nne { rpgicons / local ~ options } { extra } {#2}
        \keys_set:ne { rpgicons / local ~ options } { \clist_use:Nn \l_rpgicons_types_every_spell_style_clist { , } }
        \hspace { \l_rpgicons_icon_before_sep_dim }
        \RPGIconsUseIcon[scale=.333, #2]{#1} 
        \hspace { \l_rpgicons_icon_after_sep_dim }
    \group_end:
}
\cs_if_exist:NF \spell { \cs_new_eq:NN \spell \RPGIconsSpell }

\NewDocumentCommand { \RPGIconsSpellschool } { O{positive} m O{} } {
    \group_begin:
        \keys_set_groups:nne { rpgicons / local ~ options } { extra } {#3}
        \keys_set:ne { rpgicons / local ~ options } { \clist_use:Nn \l_rpgicons_types_every_spellschool_style_clist { , } }
        \hspace { \l_rpgicons_icon_before_sep_dim }
        \str_if_eq:neTF { negative } {#1} {
            \RPGIconsUseIcon*[frame=spellschool, scale=.333, #3]{#2} 
        } {
            \RPGIconsUseIcon[frame=spellschool, scale=.333, #3]{#2}
        }
        \hspace { \l_rpgicons_icon_after_sep_dim }
    \group_end:
}
\cs_if_exist:NF \spellschool { \cs_new_eq:NN \spellschool \RPGIconsSpellschool }

\NewDocumentCommand { \RPGIconsDamage } { m O{} } {
    \group_begin:
        \keys_set_groups:nne { rpgicons / local ~ options } { extra } {#2}
        \keys_set:ne { rpgicons / local ~ options } { \clist_use:Nn \l_rpgicons_types_every_damage_style_clist { , } }
        \hspace { \l_rpgicons_icon_before_sep_dim }
        \RPGIconsUseIcon[frame=damage, scale=.333, #2]{#1} 
        \hspace { \l_rpgicons_icon_after_sep_dim }
    \group_end:
}
\cs_if_exist:NF \damage { \cs_new_eq:NN \damage \RPGIconsDamage }

\NewDocumentCommand { \RPGIconsAttack } { m O{} } {
    \group_begin:
        \keys_set_groups:nne { rpgicons / local ~ options } { extra } {#2}
        \keys_set:ne { rpgicons / local ~ options } { \clist_use:Nn \l_rpgicons_types_every_attack_style_clist { , } }
        \hspace { \l_rpgicons_icon_before_sep_dim }
        \RPGIconsUseIcon[scale=.333, #2]{#1} 
        \hspace { \l_rpgicons_icon_after_sep_dim }
    \group_end:
}
\cs_if_exist:NF \attack { \cs_new_eq:NN \attack \RPGIconsAttack }

\NewDocumentCommand { \RPGIconsCondition } { m O{} } {
    \group_begin:
        \keys_set_groups:nne { rpgicons / local ~ options } { extra } {#2}
        \keys_set:ne { rpgicons / local ~ options } { \clist_use:Nn \l_rpgicons_types_every_condition_style_clist { , } }
        \hspace { \l_rpgicons_icon_before_sep_dim }
        \RPGIconsUseIcon[scale=.333, #2]{#1} 
        \hspace { \l_rpgicons_icon_after_sep_dim }
    \group_end:
}
\cs_if_exist:NF \condition { \cs_new_eq:NN \condition \RPGIconsCondition }

% ROLL SYNTAX

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

\keys_define:nn { rpgicons / local ~ options } {
    roll ~ syntax        .code:n     = { \rpgicons_roll_syntax_die_set:n {#1} } ,
    roll ~ syntax        .initial:n  = { d , D } ,
}

\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: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 }
    }
}

\NewDocumentCommand{\RPGIconsRoll}{ m }{
    \rpgicons_roll_syntax_parse:n {#1}   
}
\cs_if_exist:NF \roll { \cs_new_eq:NN \roll \RPGIconsRoll }

% EOF