File: monster.pkg

package info (click to toggle)
tome 2.2.7-1
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 19,908 kB
  • ctags: 15,840
  • sloc: ansic: 172,881; xml: 8,387; sh: 210; makefile: 96
file content (2324 lines) | stat: -rw-r--r-- 63,195 bytes parent folder | download | duplicates (4)
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
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
/* File: monster.pkg */

/*
 * Purpose: Lua interface defitions for monsters.
 * To be processed by tolua to generate C source code.
 */

$#include "angband.h"

/** @typedef cptr
 * @note String
 */
typedef char* cptr;
/** @typedef errr
 * @note Number
 */
typedef int errr;
/** @typedef bool
 * @note Boolean
 */
typedef unsigned char bool;
/** @typedef byte
 * @note Number
 */
typedef unsigned char byte;
/** @typedef s16b
 * @note Number
 */
typedef signed short s16b;
/** @typedef u16b
 * @note Number
 */
typedef unsigned short u16b;
/** @typedef s32b
 * @note Number
 */
typedef signed int s32b;
/** @typedef u32b
 * @note Number
 */
typedef unsigned int u32b;

/* To make easy object creations */
$static monster_type lua_monster_forge;
/** @var  monster_forge;
 * @brief monster_type
 */
static monster_type lua_monster_forge @ monster_forge;

/** @name Monster status
 * @note Player POV
 * @{ */
/** @def MSTATUS_ENEMY */
#define MSTATUS_ENEMY           -2

/** @def MSTATUS_NEUTRAL_M */
#define MSTATUS_NEUTRAL_M       -1

/** @def MSTATUS_NEUTRAL */
#define MSTATUS_NEUTRAL         0

/** @def MSTATUS_NEUTRAL_P */
#define MSTATUS_NEUTRAL_P       1

/** @def MSTATUS_FRIEND */
#define MSTATUS_FRIEND          2

/** @def MSTATUS_PET */
#define MSTATUS_PET             3

/** @def MSTATUS_COMPANION */
#define MSTATUS_COMPANION       4
/** @} */

/** @name Race flags #1
 * @{ */
/** @def RF1_UNIQUE
 * @note Unique Monster 
 */
#define RF1_UNIQUE                      0x00000001      
/** @def RF1_QUESTOR
 * @note Quest Monster 
 */
#define RF1_QUESTOR                     0x00000002      
/** @def RF1_MALE
 * @note Male gender 
 */
#define RF1_MALE                        0x00000004      
/** @def RF1_FEMALE
 * @note Female gender 
 */
#define RF1_FEMALE                      0x00000008      
/** @def RF1_CHAR_CLEAR
 * @note Absorbs symbol 
 */
#define RF1_CHAR_CLEAR          0x00000010      
/** @def RF1_CHAR_MULTI
 * @note Changes symbol 
 */
#define RF1_CHAR_MULTI          0x00000020      
/** @def RF1_ATTR_CLEAR
 * @note Absorbs color 
 */
#define RF1_ATTR_CLEAR          0x00000040      
/** @def RF1_ATTR_MULTI
 * @note Changes color 
 */
#define RF1_ATTR_MULTI          0x00000080      
/** @def RF1_FORCE_DEPTH
 * @note Start at "correct" depth 
 */
#define RF1_FORCE_DEPTH         0x00000100      
/** @def RF1_FORCE_MAXHP
 * @note Start with max hitpoints 
 */
#define RF1_FORCE_MAXHP         0x00000200      
/** @def RF1_FORCE_SLEEP
 * @note Start out sleeping 
 */
#define RF1_FORCE_SLEEP         0x00000400      
/** @def RF1_FORCE_EXTRA
 * @note Start out something 
 */
#define RF1_FORCE_EXTRA         0x00000800      
/** @def RF1_FRIEND
 * @note Arrive with a friend 
 */
#define RF1_FRIEND              0x00001000      
/** @def RF1_FRIENDS
 * @note Arrive with some friends 
 */
#define RF1_FRIENDS             0x00002000      
/** @def RF1_ESCORT
 * @note Arrive with an escort 
 */
#define RF1_ESCORT              0x00004000      
/** @def RF1_ESCORTS
 * @note Arrive with some escorts 
 */
#define RF1_ESCORTS             0x00008000      
/** @def RF1_NEVER_BLOW
 * @note Never make physical blow 
 */
#define RF1_NEVER_BLOW          0x00010000      
/** @def RF1_NEVER_MOVE
 * @note Never make physical move 
 */
#define RF1_NEVER_MOVE          0x00020000      
/** @def RF1_RAND_25
 * @note Moves randomly (25%) 
 */
#define RF1_RAND_25             0x00040000      
/** @def RF1_RAND_50
 * @note Moves randomly (50%) 
 */
#define RF1_RAND_50             0x00080000      
/** @def RF1_ONLY_GOLD
 * @note Drop only gold 
 */
#define RF1_ONLY_GOLD           0x00100000      
/** @def RF1_ONLY_ITEM
 * @note Drop only items 
 */
#define RF1_ONLY_ITEM           0x00200000      
/** @def RF1_DROP_60
 * @note Drop an item/gold (60%) 
 */
#define RF1_DROP_60             0x00400000      
/** @def RF1_DROP_90
 * @note Drop an item/gold (90%) 
 */
#define RF1_DROP_90             0x00800000      
/** @def RF1_DROP_1D2
 * @note Drop 1d2 items/gold 
 */
#define RF1_DROP_1D2            0x01000000      
/** @def RF1_DROP_2D2
 * @note Drop 2d2 items/gold 
 */
#define RF1_DROP_2D2            0x02000000      
/** @def RF1_DROP_3D2
 * @note Drop 3d2 items/gold 
 */
#define RF1_DROP_3D2            0x04000000      
/** @def RF1_DROP_4D2
 * @note Drop 4d2 items/gold 
 */
#define RF1_DROP_4D2            0x08000000      
/** @def RF1_DROP_GOOD
 * @note Drop good items 
 */
#define RF1_DROP_GOOD           0x10000000      
/** @def RF1_DROP_GREAT
 * @note Drop great items 
 */
#define RF1_DROP_GREAT          0x20000000      
/** @def RF1_DROP_USEFUL
 * @note Drop "useful" items 
 */
#define RF1_DROP_USEFUL         0x40000000      
/** @def RF1_DROP_CHOSEN
 * @note Drop "chosen" items 
 */
#define RF1_DROP_CHOSEN         0x80000000      
/** @} */

/** @name Race flags #2
 * @note New monster race bit flags
 * @{ */
/** @def RF2_STUPID
 * @note Monster is stupid 
 */
#define RF2_STUPID                      0x00000001      
/** @def RF2_SMART
 * @note Monster is smart 
 */
#define RF2_SMART                       0x00000002      
/** @def RF2_CAN_SPEAK
 * @note TY: can speak 
 */
#define RF2_CAN_SPEAK            0x00000004  
/** @def RF2_REFLECTING
 * @note Reflects bolts 
 */
#define RF2_REFLECTING                  0x00000008      
/** @def RF2_INVISIBLE
 * @note Monster avoids vision 
 */
#define RF2_INVISIBLE           0x00000010      
/** @def RF2_COLD_BLOOD
 * @note Monster avoids infra 
 */
#define RF2_COLD_BLOOD          0x00000020      
/** @def RF2_EMPTY_MIND
 * @note Monster avoids telepathy 
 */
#define RF2_EMPTY_MIND          0x00000040      
/** @def RF2_WEIRD_MIND
 * @note Monster avoids telepathy? 
 */
#define RF2_WEIRD_MIND          0x00000080      
/** @def RF2_DEATH_ORB
 * @note Death Orb 
 */
#define RF2_DEATH_ORB           0x00000100      
/** @def RF2_REGENERATE
 * @note Monster regenerates 
 */
#define RF2_REGENERATE          0x00000200      
/** @def RF2_SHAPECHANGER
 * @note TY: shapechanger 
 */
#define RF2_SHAPECHANGER        0x00000400  
/** @def RF2_ATTR_ANY
 * @note TY: Attr_any 
 */
#define RF2_ATTR_ANY            0x00000800  
/** @def RF2_POWERFUL
 * @note Monster has strong breath 
 */
#define RF2_POWERFUL            0x00001000      
/** @def RF2_ELDRITCH_HORROR
 * @note Sanity-blasting horror    
 */
#define RF2_ELDRITCH_HORROR             0x00002000      
/** @def RF2_AURA_FIRE
 * @note Burns in melee 
 */
#define RF2_AURA_FIRE                   0x00004000      
/** @def RF2_AURA_ELEC
 * @note Shocks in melee 
 */
#define RF2_AURA_ELEC                   0x00008000      
/** @def RF2_OPEN_DOOR
 * @note Monster can open doors 
 */
#define RF2_OPEN_DOOR           0x00010000      
/** @def RF2_BASH_DOOR
 * @note Monster can bash doors 
 */
#define RF2_BASH_DOOR           0x00020000      
/** @def RF2_PASS_WALL
 * @note Monster can pass walls 
 */
#define RF2_PASS_WALL           0x00040000      
/** @def RF2_KILL_WALL
 * @note Monster can destroy walls 
 */
#define RF2_KILL_WALL           0x00080000      
/** @def RF2_MOVE_BODY
 * @note Monster can move monsters 
 */
#define RF2_MOVE_BODY           0x00100000      
/** @def RF2_KILL_BODY
 * @note Monster can kill monsters 
 */
#define RF2_KILL_BODY           0x00200000      
/** @def RF2_TAKE_ITEM
 * @note Monster can pick up items 
 */
#define RF2_TAKE_ITEM           0x00400000      
/** @def RF2_KILL_ITEM
 * @note Monster can crush items 
 */
#define RF2_KILL_ITEM           0x00800000      
/** @def RF2_BRAIN_1 */
#define RF2_BRAIN_1                     0x01000000

/** @def RF2_BRAIN_2 */
#define RF2_BRAIN_2                     0x02000000

/** @def RF2_BRAIN_3 */
#define RF2_BRAIN_3                     0x04000000

/** @def RF2_BRAIN_4 */
#define RF2_BRAIN_4                     0x08000000

/** @def RF2_BRAIN_5 */
#define RF2_BRAIN_5                     0x10000000

/** @def RF2_BRAIN_6 */
#define RF2_BRAIN_6                     0x20000000

/** @def RF2_BRAIN_7 */
#define RF2_BRAIN_7                     0x40000000

/** @def RF2_BRAIN_8 */
#define RF2_BRAIN_8                     0x80000000
/** @} */

/** @name Race flags #3
 * @note New monster race bit flags
 * @{ */
/** @def RF3_ORC
 * @note Orc 
 */
#define RF3_ORC                         0x00000001      
/** @def RF3_TROLL
 * @note Troll 
 */
#define RF3_TROLL                       0x00000002      
/** @def RF3_GIANT
 * @note Giant 
 */
#define RF3_GIANT                       0x00000004      
/** @def RF3_DRAGON
 * @note Dragon 
 */
#define RF3_DRAGON                      0x00000008      
/** @def RF3_DEMON
 * @note Demon 
 */
#define RF3_DEMON                       0x00000010      
/** @def RF3_UNDEAD
 * @note Undead 
 */
#define RF3_UNDEAD                      0x00000020      
/** @def RF3_EVIL
 * @note Evil 
 */
#define RF3_EVIL                        0x00000040      
/** @def RF3_ANIMAL
 * @note Animal 
 */
#define RF3_ANIMAL                      0x00000080      
/** @def RF3_THUNDERLORD
 * @note DG: Thunderlord 
 */
#define RF3_THUNDERLORD            0x00000100  
/** @def RF3_GOOD
 * @note Good 
 */
#define RF3_GOOD                        0x00000200      
/** @def RF3_AURA_COLD
 * @note Freezes in melee 
 */
#define RF3_AURA_COLD                        0x00000400      
/** @def RF3_NONLIVING
 * @note TY: Non-Living (?) 
 */
#define RF3_NONLIVING           0x00000800  
/** @def RF3_HURT_LITE
 * @note Hurt by lite 
 */
#define RF3_HURT_LITE           0x00001000      
/** @def RF3_HURT_ROCK
 * @note Hurt by rock remover 
 */
#define RF3_HURT_ROCK           0x00002000      
/** @def RF3_SUSCEP_FIRE
 * @note Hurt badly by fire 
 */
#define RF3_SUSCEP_FIRE           0x00004000      
/** @def RF3_SUSCEP_COLD
 * @note Hurt badly by cold 
 */
#define RF3_SUSCEP_COLD           0x00008000      
/** @def RF3_IM_ACID
 * @note Resist acid a lot 
 */
#define RF3_IM_ACID                     0x00010000      
/** @def RF3_IM_ELEC
 * @note Resist elec a lot 
 */
#define RF3_IM_ELEC                     0x00020000      
/** @def RF3_IM_FIRE
 * @note Resist fire a lot 
 */
#define RF3_IM_FIRE                     0x00040000      
/** @def RF3_IM_COLD
 * @note Resist cold a lot 
 */
#define RF3_IM_COLD                     0x00080000      
/** @def RF3_IM_POIS
 * @note Resist poison a lot 
 */
#define RF3_IM_POIS                     0x00100000      
/** @def RF3_RES_TELE
 * @note Resist teleportation 
 */
#define RF3_RES_TELE                    0x00200000      
/** @def RF3_RES_NETH
 * @note Resist nether a lot 
 */
#define RF3_RES_NETH            0x00400000      
/** @def RF3_RES_WATE
 * @note Resist water 
 */
#define RF3_RES_WATE            0x00800000      
/** @def RF3_RES_PLAS
 * @note Resist plasma 
 */
#define RF3_RES_PLAS            0x01000000      
/** @def RF3_RES_NEXU
 * @note Resist nexus 
 */
#define RF3_RES_NEXU            0x02000000      
/** @def RF3_RES_DISE
 * @note Resist disenchantment 
 */
#define RF3_RES_DISE            0x04000000      
/** @def RF3_UNIQUE_4
 * @note Is a "Nazgul" unique 
 */
#define RF3_UNIQUE_4                    0x08000000      
/** @def RF3_NO_FEAR
 * @note Cannot be scared 
 */
#define RF3_NO_FEAR                     0x10000000      
/** @def RF3_NO_STUN
 * @note Cannot be stunned 
 */
#define RF3_NO_STUN                     0x20000000      
/** @def RF3_NO_CONF
 * @note Cannot be confused 
 */
#define RF3_NO_CONF                     0x40000000      
/** @def RF3_NO_SLEEP
 * @note Cannot be slept 
 */
#define RF3_NO_SLEEP            0x80000000      
/** @} */

/** @name Race flags #4
 * @note New monster race bit flags
 * @{ */
/** @def RF4_SHRIEK
 * @note Shriek for help 
 */
#define RF4_SHRIEK                      0x00000001  
/** @def RF4_MULTIPLY
 * @note Monster reproduces 
 */
#define RF4_MULTIPLY                    0x00000002  
/** @def RF4_S_ANIMAL
 * @note Summon animals 
 */
#define RF4_S_ANIMAL                    0x00000004  
/** @def RF4_ROCKET
 * @note TY: Rocket 
 */
#define RF4_ROCKET                      0x00000008  
/** @def RF4_ARROW_1
 * @note Fire an arrow (light) 
 */
#define RF4_ARROW_1                     0x00000010  
/** @def RF4_ARROW_2
 * @note Fire an arrow (heavy) 
 */
#define RF4_ARROW_2                     0x00000020  
/** @def RF4_ARROW_3
 * @note Fire missiles (light) 
 */
#define RF4_ARROW_3                     0x00000040  
/** @def RF4_ARROW_4
 * @note Fire missiles (heavy) 
 */
#define RF4_ARROW_4                     0x00000080  
/** @def RF4_BR_ACID
 * @note Breathe Acid 
 */
#define RF4_BR_ACID                     0x00000100  
/** @def RF4_BR_ELEC
 * @note Breathe Elec 
 */
#define RF4_BR_ELEC                     0x00000200  
/** @def RF4_BR_FIRE
 * @note Breathe Fire 
 */
#define RF4_BR_FIRE                     0x00000400  
/** @def RF4_BR_COLD
 * @note Breathe Cold 
 */
#define RF4_BR_COLD                     0x00000800  
/** @def RF4_BR_POIS
 * @note Breathe Poison 
 */
#define RF4_BR_POIS                     0x00001000  
/** @def RF4_BR_NETH
 * @note Breathe Nether 
 */
#define RF4_BR_NETH                     0x00002000  
/** @def RF4_BR_LITE
 * @note Breathe Lite 
 */
#define RF4_BR_LITE                     0x00004000  
/** @def RF4_BR_DARK
 * @note Breathe Dark 
 */
#define RF4_BR_DARK                     0x00008000  
/** @def RF4_BR_CONF
 * @note Breathe Confusion 
 */
#define RF4_BR_CONF                     0x00010000  
/** @def RF4_BR_SOUN
 * @note Breathe Sound 
 */
#define RF4_BR_SOUN                     0x00020000  
/** @def RF4_BR_CHAO
 * @note Breathe Chaos 
 */
#define RF4_BR_CHAO                     0x00040000  
/** @def RF4_BR_DISE
 * @note Breathe Disenchant 
 */
#define RF4_BR_DISE                     0x00080000  
/** @def RF4_BR_NEXU
 * @note Breathe Nexus 
 */
#define RF4_BR_NEXU                     0x00100000  
/** @def RF4_BR_TIME
 * @note Breathe Time 
 */
#define RF4_BR_TIME                     0x00200000  
/** @def RF4_BR_INER
 * @note Breathe Inertia 
 */
#define RF4_BR_INER                     0x00400000  
/** @def RF4_BR_GRAV
 * @note Breathe Gravity 
 */
#define RF4_BR_GRAV                     0x00800000  
/** @def RF4_BR_SHAR
 * @note Breathe Shards 
 */
#define RF4_BR_SHAR                     0x01000000  
/** @def RF4_BR_PLAS
 * @note Breathe Plasma 
 */
#define RF4_BR_PLAS                     0x02000000  
/** @def RF4_BR_WALL
 * @note Breathe Force 
 */
#define RF4_BR_WALL                     0x04000000  
/** @def RF4_BR_MANA
 * @note Breathe Mana 
 */
#define RF4_BR_MANA                     0x08000000  
/** @def RF4_BA_NUKE
 * @note TY: Nuke Ball 
 */
#define RF4_BA_NUKE                     0x10000000  
/** @def RF4_BR_NUKE
 * @note TY: Toxic Breath 
 */
#define RF4_BR_NUKE                     0x20000000  
/** @def RF4_BA_CHAO
 * @note Chaos Ball 
 */
#define RF4_BA_CHAO                     0x40000000  
/** @def RF4_BR_DISI
 * @note Breathe Disintegration 
 */
#define RF4_BR_DISI                     0x80000000  
/** @} */

/** @name Race flags #5
 * @note New monster race bit flags
 * @{ */
/** @def RF5_BA_ACID
 * @note Acid Ball 
 */
#define RF5_BA_ACID                     0x00000001      
/** @def RF5_BA_ELEC
 * @note Elec Ball 
 */
#define RF5_BA_ELEC                     0x00000002      
/** @def RF5_BA_FIRE
 * @note Fire Ball 
 */
#define RF5_BA_FIRE                     0x00000004      
/** @def RF5_BA_COLD
 * @note Cold Ball 
 */
#define RF5_BA_COLD                     0x00000008      
/** @def RF5_BA_POIS
 * @note Poison Ball 
 */
#define RF5_BA_POIS                     0x00000010      
/** @def RF5_BA_NETH
 * @note Nether Ball 
 */
#define RF5_BA_NETH                     0x00000020      
/** @def RF5_BA_WATE
 * @note Water Ball 
 */
#define RF5_BA_WATE                     0x00000040      
/** @def RF5_BA_MANA
 * @note Mana Storm 
 */
#define RF5_BA_MANA                     0x00000080      
/** @def RF5_BA_DARK
 * @note Darkness Storm 
 */
#define RF5_BA_DARK                     0x00000100      
/** @def RF5_DRAIN_MANA
 * @note Drain Mana 
 */
#define RF5_DRAIN_MANA          0x00000200      
/** @def RF5_MIND_BLAST
 * @note Blast Mind 
 */
#define RF5_MIND_BLAST          0x00000400      
/** @def RF5_BRAIN_SMASH
 * @note Smash Brain 
 */
#define RF5_BRAIN_SMASH         0x00000800      
/** @def RF5_CAUSE_1
 * @note Cause Light Wound 
 */
#define RF5_CAUSE_1                     0x00001000      
/** @def RF5_CAUSE_2
 * @note Cause Serious Wound 
 */
#define RF5_CAUSE_2                     0x00002000      
/** @def RF5_CAUSE_3
 * @note Cause Critical Wound 
 */
#define RF5_CAUSE_3                     0x00004000      
/** @def RF5_CAUSE_4
 * @note Cause Mortal Wound 
 */
#define RF5_CAUSE_4                     0x00008000      
/** @def RF5_BO_ACID
 * @note Acid Bolt 
 */
#define RF5_BO_ACID                     0x00010000      
/** @def RF5_BO_ELEC
 * @note Elec Bolt (unused) 
 */
#define RF5_BO_ELEC                     0x00020000      
/** @def RF5_BO_FIRE
 * @note Fire Bolt 
 */
#define RF5_BO_FIRE                     0x00040000      
/** @def RF5_BO_COLD
 * @note Cold Bolt 
 */
#define RF5_BO_COLD                     0x00080000      
/** @def RF5_BO_POIS
 * @note Poison Bolt (unused) 
 */
#define RF5_BO_POIS                     0x00100000      
/** @def RF5_BO_NETH
 * @note Nether Bolt 
 */
#define RF5_BO_NETH                     0x00200000      
/** @def RF5_BO_WATE
 * @note Water Bolt 
 */
#define RF5_BO_WATE                     0x00400000      
/** @def RF5_BO_MANA
 * @note Mana Bolt 
 */
#define RF5_BO_MANA                     0x00800000      
/** @def RF5_BO_PLAS
 * @note Plasma Bolt 
 */
#define RF5_BO_PLAS                     0x01000000      
/** @def RF5_BO_ICEE
 * @note Ice Bolt 
 */
#define RF5_BO_ICEE                     0x02000000      
/** @def RF5_MISSILE
 * @note Magic Missile 
 */
#define RF5_MISSILE                     0x04000000      
/** @def RF5_SCARE
 * @note Frighten Player 
 */
#define RF5_SCARE                       0x08000000      
/** @def RF5_BLIND
 * @note Blind Player 
 */
#define RF5_BLIND                       0x10000000      
/** @def RF5_CONF
 * @note Confuse Player 
 */
#define RF5_CONF                        0x20000000      
/** @def RF5_SLOW
 * @note Slow Player 
 */
#define RF5_SLOW                        0x40000000      
/** @def RF5_HOLD
 * @note Paralyze Player 
 */
#define RF5_HOLD                        0x80000000      
/** @} */

/** @name Race flags #6
 * @note New monster race bit flags
 * @{ */
/** @def RF6_HASTE
 * @note Speed self 
 */
#define RF6_HASTE                       0x00000001      
/** @def RF6_HAND_DOOM
 * @note Hand of Doom 
 */
#define RF6_HAND_DOOM                   0x00000002      
/** @def RF6_HEAL
 * @note Heal self 
 */
#define RF6_HEAL                        0x00000004      
/** @def RF6_S_ANIMALS
 * @note Summon animals 
 */
#define RF6_S_ANIMALS                   0x00000008      
/** @def RF6_BLINK
 * @note Teleport Short 
 */
#define RF6_BLINK                       0x00000010      
/** @def RF6_TPORT
 * @note Teleport Long 
 */
#define RF6_TPORT                       0x00000020      
/** @def RF6_TELE_TO
 * @note Move player to monster 
 */
#define RF6_TELE_TO                     0x00000040      
/** @def RF6_TELE_AWAY
 * @note Move player far away 
 */
#define RF6_TELE_AWAY                   0x00000080      
/** @def RF6_TELE_LEVEL
 * @note Move player vertically 
 */
#define RF6_TELE_LEVEL                  0x00000100      
/** @def RF6_DARKNESS
 * @note Create Darkness 
 */
#define RF6_DARKNESS                    0x00000200      
/** @def RF6_TRAPS
 * @note Create Traps 
 */
#define RF6_TRAPS                       0x00000400      
/** @def RF6_FORGET
 * @note Cause amnesia 
 */
#define RF6_FORGET                      0x00000800      
/** @def RF6_RAISE_DEAD
 * @note Raise Dead 
 */
#define RF6_RAISE_DEAD                  0x00001000      
/** @def RF6_S_BUG
 * @note Summon Software bug 
 */
#define RF6_S_BUG                       0x00002000      
/** @def RF6_S_RNG
 * @note Summon RNG 
 */
#define RF6_S_RNG                       0x00004000      
/** @def RF6_S_THUNDERLORD
 * @note Summon Thunderlords 
 */
#define RF6_S_THUNDERLORD               0x00008000      
/** @def RF6_S_KIN
 * @note Summon "kin" 
 */
#define RF6_S_KIN                       0x00010000      
/** @def RF6_S_HI_DEMON
 * @note Summon greater demons! 
 */
#define RF6_S_HI_DEMON                  0x00020000      
/** @def RF6_S_MONSTER
 * @note Summon Monster 
 */
#define RF6_S_MONSTER                   0x00040000      
/** @def RF6_S_MONSTERS
 * @note Summon Monsters 
 */
#define RF6_S_MONSTERS                  0x00080000      
/** @def RF6_S_ANT
 * @note Summon Ants 
 */
#define RF6_S_ANT                       0x00100000      
/** @def RF6_S_SPIDER
 * @note Summon Spiders 
 */
#define RF6_S_SPIDER                    0x00200000      
/** @def RF6_S_HOUND
 * @note Summon Hounds 
 */
#define RF6_S_HOUND                     0x00400000      
/** @def RF6_S_HYDRA
 * @note Summon Hydras 
 */
#define RF6_S_HYDRA                     0x00800000      
/** @def RF6_S_ANGEL
 * @note Summon Angel 
 */
#define RF6_S_ANGEL                     0x01000000      
/** @def RF6_S_DEMON
 * @note Summon Demon 
 */
#define RF6_S_DEMON                     0x02000000      
/** @def RF6_S_UNDEAD
 * @note Summon Undead 
 */
#define RF6_S_UNDEAD            0x04000000      
/** @def RF6_S_DRAGON
 * @note Summon Dragon 
 */
#define RF6_S_DRAGON            0x08000000      
/** @def RF6_S_HI_UNDEAD
 * @note Summon Greater Undead 
 */
#define RF6_S_HI_UNDEAD         0x10000000      
/** @def RF6_S_HI_DRAGON
 * @note Summon Ancient Dragon 
 */
#define RF6_S_HI_DRAGON         0x20000000      
/** @def RF6_S_WRAITH
 * @note Summon Unique Wraith 
 */
#define RF6_S_WRAITH            0x40000000      
/** @def RF6_S_UNIQUE
 * @note Summon Unique Monster 
 */
#define RF6_S_UNIQUE            0x80000000      
/** @} */

/** @name Race flags #7
 * @note New monster race bit flags
 * @{ */
/** @def RF7_AQUATIC
 * @note Aquatic monster 
 */
#define RF7_AQUATIC             0x00000001  
/** @def RF7_CAN_SWIM
 * @note Monster can swim 
 */
#define RF7_CAN_SWIM            0x00000002  
/** @def RF7_CAN_FLY
 * @note Monster can fly 
 */
#define RF7_CAN_FLY             0x00000004  
/** @def RF7_FRIENDLY
 * @note Monster is friendly 
 */
#define RF7_FRIENDLY            0x00000008  
/** @def RF7_PET
 * @note Monster is a pet 
 */
#define RF7_PET                 0x00000010  
/** @def RF7_MORTAL
 * @note Monster is a mortal being 
 */
#define RF7_MORTAL              0x00000020  
/** @def RF7_SPIDER
 * @note Monster is a spider (can pass webs) 
 */
#define RF7_SPIDER              0x00000040  
/** @def RF7_NAZGUL
 * @note Monster is a Nazgul 
 */
#define RF7_NAZGUL              0x00000080  
/** @def RF7_DG_CURSE
 * @note If killed the monster grant a DG Curse to the player 
 */
#define RF7_DG_CURSE            0x00000100  
/** @def RF7_POSSESSOR
 * @note Is it a dreaded possessor monster ? 
 */
#define RF7_POSSESSOR           0x00000200  
/** @def RF7_NO_DEATH
 * @note Cannot be killed 
 */
#define RF7_NO_DEATH            0x00000400  
/** @def RF7_NO_TARGET
 * @note Cannot be targeted 
 */
#define RF7_NO_TARGET           0x00000800  
/** @def RF7_AI_ANNOY
 * @note Try to tease the player 
 */
#define RF7_AI_ANNOY            0x00001000  
/** @def RF7_AI_SPECIAL
 * @note For quests 
 */
#define RF7_AI_SPECIAL          0x00002000  
/** @def RF7_NO_THEFT
 * @note Monster is immune to theft 
 */
#define RF7_NO_THEFT			0x00040000  
/** @def RF7_SPIRIT
 * @note This is a Spirit, coming from the Void 
 */
#define RF7_SPIRIT		0x00080000  
/** @def RF7_IM_MELEE
 * @note IM melee 
 */
#define RF7_IM_MELEE            0x00100000  
/** @} */

/** @name Race flags #8
 * @note New monster race bit flags
 * @{ */
/** @def RF8_DUNGEON */
#define RF8_DUNGEON             0x00000001

/** @def RF8_WILD_TOWN */
#define RF8_WILD_TOWN           0x00000002

/** @def RF8_XXX8X02 */
#define RF8_XXX8X02             0x00000004

/** @def RF8_WILD_SHORE */
#define RF8_WILD_SHORE          0x00000008

/** @def RF8_WILD_OCEAN */
#define RF8_WILD_OCEAN          0x00000010

/** @def RF8_WILD_WASTE */
#define RF8_WILD_WASTE          0x00000020

/** @def RF8_WILD_WOOD */
#define RF8_WILD_WOOD           0x00000040

/** @def RF8_WILD_VOLCANO */
#define RF8_WILD_VOLCANO        0x00000080

/** @def RF8_XXX8X08 */
#define RF8_XXX8X08             0x00000100

/** @def RF8_WILD_MOUNTAIN */
#define RF8_WILD_MOUNTAIN       0x00000200

/** @def RF8_WILD_GRASS */
#define RF8_WILD_GRASS          0x00000400

/********* FREE *********/
/** @def RF8_CTHANGBAND */
#define RF8_CTHANGBAND          0x00001000

/********* FREE *********/
/** @def RF8_ZANGBAND */
#define RF8_ZANGBAND            0x00004000

/** @def RF8_JOKEANGBAND */
#define RF8_JOKEANGBAND         0x00008000

/** @def RF8_ANGBAND */
#define RF8_ANGBAND             0x00010000


/** @def RF8_WILD_TOO */
#define RF8_WILD_TOO            0x80000000
/** @} */

/** @name Race flags #9
 * @note New monster race bit flags
 * @{ */
/** @def RF9_DROP_CORPSE */
#define RF9_DROP_CORPSE         0x00000001

/** @def RF9_DROP_SKELETON */
#define RF9_DROP_SKELETON       0x00000002

/** @def RF9_HAS_LITE
 * @note Carries a lite 
 */
#define RF9_HAS_LITE            0x00000004      
/** @def RF9_MIMIC
 * @note *REALLY* looks like an object ... only nastier 
 */
#define RF9_MIMIC               0x00000008      
/** @def RF9_HAS_EGG
 * @note Can be monster's eggs 
 */
#define RF9_HAS_EGG             0x00000010      
/** @def RF9_IMPRESED
 * @note The monster can follow you on each level until he dies 
 */
#define RF9_IMPRESED            0x00000020      
/** @def RF9_SUSCEP_ACID
 * @note Susceptible to acid 
 */
#define RF9_SUSCEP_ACID         0x00000040      
/** @def RF9_SUSCEP_ELEC
 * @note Susceptible to lightning 
 */
#define RF9_SUSCEP_ELEC         0x00000080      
/** @def RF9_SUSCEP_POIS
 * @note Susceptible to poison 
 */
#define RF9_SUSCEP_POIS         0x00000100      
/** @def RF9_KILL_TREES
 * @note Monster can eat trees 
 */
#define RF9_KILL_TREES          0x00000200      
/** @def RF9_WYRM_PROTECT
 * @note The monster is protected by great wyrms of power: They'll be summoned if it's killed 
 */
#define RF9_WYRM_PROTECT        0x00000400      
/** @def RF9_DOPPLEGANGER
 * @note The monster looks like you 
 */
#define RF9_DOPPLEGANGER        0x00000800      
/** @def RF9_ONLY_DEPTH
 * @note The monster can only be generated at the GIVEN depth 
 */
#define RF9_ONLY_DEPTH          0x00001000      
/** @def RF9_SPECIAL_GENE
 * @note The monster can only be generated in special conditions like quests, special dungeons, ... 
 */
#define RF9_SPECIAL_GENE        0x00002000      
/** @def RF9_NEVER_GENE
 * @note The monster cannot be normaly generated 
 */
#define RF9_NEVER_GENE          0x00004000      
/** @} */

/** @name Monster flags
 * @{ */
/** @def MFLAG_VIEW
 * @note Monster is in line of sight 
 */
#define MFLAG_VIEW      0x00000001    
/** @def MFLAG_QUEST
 * @note Monster is subject to a quest 
 */
#define MFLAG_QUEST     0x00000002    
/** @def MFLAG_PARTIAL
 * @note Monster is a partial summon 
 */
#define MFLAG_PARTIAL   0x00000004    
/** @def MFLAG_CONTROL
 * @note Monster is controlled 
 */
#define MFLAG_CONTROL   0x00000008    
/** @def MFLAG_BORN
 * @note Monster is still being born 
 */
#define MFLAG_BORN      0x00000010    
/** @def MFLAG_NICE
 * @note Monster is still being nice 
 */
#define MFLAG_NICE      0x00000020    
/** @def MFLAG_SHOW
 * @note Monster is recently memorized 
 */
#define MFLAG_SHOW      0x00000040    
/** @def MFLAG_MARK
 * @note Monster is currently memorized 
 */
#define MFLAG_MARK      0x00000080    
/** @def MFLAG_NO_DROP
 * @note Monster wont drop obj/corpse 
 */
#define MFLAG_NO_DROP   0x00000100    
/** @def MFLAG_QUEST2
 * @note Monster is subject to a quest 
 */
#define MFLAG_QUEST2    0x00000200    
/** @} */

/** @struct monster_blow
 * @brief Monster blows (attacks)
 */
struct monster_blow
{
	/** @structvar method
	 * @brief Number
	 */
	byte method;
	/** @structvar effect
	 * @brief Number
	 */
	byte effect;
	/** @structvar d_dice
	 * @brief Number
	 */
	byte d_dice;
	/** @structvar d_side
	 * @brief Number
	 */
	byte d_side;
};

/** @struct monster_race
 * @brief Monster race
 */
struct monster_race
{
	/** @structvar name
	 * @brief Number
	 * @note Name (offset) 
	 */
	u32b name;
	/** @structvar text
	 * @brief Number
	 * @note Text (offset) 
	 */
	u32b text;

	/** @structvar hdice
	 * @brief Number
	 * @note Creatures hit dice count 
	 */
	byte hdice;
	/** @structvar hside
	 * @brief Number
	 * @note Creatures hit dice sides 
	 */
	byte hside;

	/** @structvar ac
	 * @brief Number
	 * @note Armour Class 
	 */
	s16b ac;

	/** @structvar sleep
	 * @brief Number
	 * @note Inactive counter (base) 
	 */
	s16b sleep;
	/** @structvar aaf
	 * @brief Number
	 * @note Area affect radius (1-100) 
	 */
	byte aaf;
	/** @structvar speed
	 * @brief Number
	 * @note Speed (normally 110) 
	 */
	byte speed;

	/** @structvar mexp
	 * @brief Number
	 * @note Exp value for kill 
	 */
	s32b mexp;

	/** @structvar weight
	 * @brief Number
	 * @note Weight of the monster 
	 */
	s32b weight;

	/** @structvar freq_inate
	 * @brief Number
	 * @note Inate spell frequency 
	 */
	byte freq_inate;
	/** @structvar freq_spell
	 * @brief Number
	 * @note Other spell frequency 
	 */
	byte freq_spell;

	/** @structvar flags1
	 * @brief Number
	 * @note Flags 1 (general) 
	 */
	u32b flags1;
	/** @structvar flags2
	 * @brief Number
	 * @note Flags 2 (abilities) 
	 */
	u32b flags2;
	/** @structvar flags3
	 * @brief Number
	 * @note Flags 3 (race/resist) 
	 */
	u32b flags3;
	/** @structvar flags4
	 * @brief Number
	 * @note Flags 4 (inate/breath) 
	 */
	u32b flags4;
	/** @structvar flags5
	 * @brief Number
	 * @note Flags 5 (normal spells) 
	 */
	u32b flags5;
	/** @structvar flags6
	 * @brief Number
	 * @note Flags 6 (special spells) 
	 */
	u32b flags6;
	/** @structvar flags7
	 * @brief Number
	 * @note Flags 7 (movement related abilities) 
	 */
	u32b flags7;
	/** @structvar flags8
	 * @brief Number
	 * @note Flags 8 (wilderness info) 
	 */
	u32b flags8;
	/** @structvar flags9
	 * @brief Number
	 * @note Flags 9 (drops info) 
	 */
	u32b flags9;

	/** @structvar blow[4]
	 * @brief magic_power
	 * @note Up to four blows per round 
	 */
	monster_blow blow[4];

	/** @structvar body_parts[BODY_MAX]
	 * @brief Number
	 * @note To help to decide what to use when body changing 
	 */
	byte body_parts[BODY_MAX];

	/** @structvar level
	 * @brief Number
	 * @note Level of creature 
	 */
	byte level;
	/** @structvar rarity
	 * @brief Number
	 * @note Rarity of creature 
	 */
	byte rarity;


	/** @structvar d_attr
	 * @brief Number
	 * @note Default monster attribute 
	 */
	byte d_attr;
	/** @structvar d_char
	 * @brief String
	 * @note Default monster character 
	 */
	char d_char;


	/** @structvar x_attr
	 * @brief Number
	 * @note Desired monster attribute 
	 */
	byte x_attr;
	/** @structvar x_char
	 * @brief String
	 * @note Desired monster character 
	 */
	char x_char;


	/** @structvar max_num
	 * @brief Number
	 * @note Maximum population allowed per level 
	 */
	s16b max_num;

	/** @structvar cur_num
	 * @brief Number
	 * @note Monster population on current level 
	 */
	byte cur_num;


	/** @structvar r_sights
	 * @brief Number
	 * @note Count sightings of this monster 
	 */
	s16b r_sights;
	/** @structvar r_deaths
	 * @brief Number
	 * @note Count deaths from this monster 
	 */
	s16b r_deaths;

	/** @structvar r_pkills
	 * @brief Number
	 * @note Count monsters killed in this life 
	 */
	s16b r_pkills;
	/** @structvar r_tkills
	 * @brief Number
	 * @note Count monsters killed in all lives 
	 */
	s16b r_tkills;

	/** @structvar r_wake
	 * @brief Number
	 * @note Number of times woken up (?) 
	 */
	byte r_wake;
	/** @structvar r_ignore
	 * @brief Number
	 * @note Number of times ignored (?) 
	 */
	byte r_ignore;

	/** @structvar r_xtra1
	 * @brief Number
	 * @note Something (unused) 
	 */
	byte r_xtra1;
	/** @structvar r_xtra2
	 * @brief Number
	 * @note Something (unused) 
	 */
	byte r_xtra2;

	/** @structvar r_drop_gold
	 * @brief Number
	 * @note Max number of gold dropped at once 
	 */
	byte r_drop_gold;
	/** @structvar r_drop_item
	 * @brief Number
	 * @note Max number of item dropped at once 
	 */
	byte r_drop_item;

	/** @structvar r_cast_inate
	 * @brief Number
	 * @note Max number of inate spells seen 
	 */
	byte r_cast_inate;
	/** @structvar r_cast_spell
	 * @brief Number
	 * @note Max number of other spells seen 
	 */
	byte r_cast_spell;

	/** @structvar r_blows[4]
	 * @brief Number
	 * @note Number of times each blow type was seen 
	 */
	byte r_blows[4];

	/** @structvar r_flags1
	 * @brief Number
	 * @note Observed racial flags 
	 */
	u32b r_flags1;
	/** @structvar r_flags2
	 * @brief Number
	 * @note Observed racial flags 
	 */
	u32b r_flags2;
	/** @structvar r_flags3
	 * @brief Number
	 * @note Observed racial flags 
	 */
	u32b r_flags3;
	/** @structvar r_flags4
	 * @brief Number
	 * @note Observed racial flags 
	 */
	u32b r_flags4;
	/** @structvar r_flags5
	 * @brief Number
	 * @note Observed racial flags 
	 */
	u32b r_flags5;
	/** @structvar r_flags6
	 * @brief Number
	 * @note Observed racial flags 
	 */
	u32b r_flags6;
	/** @structvar r_flags7
	 * @brief Number
	 * @note Observed racial flags 
	 */
	u32b r_flags7;
	/** @structvar r_flags8
	 * @brief Number
	 * @note Observed racial flags 
	 */
	u32b r_flags8;
	/** @structvar r_flags9
	 * @brief Number
	 * @note Observed racial flags 
	 */
	u32b r_flags9;

	/** @structvar on_saved
	 * @brief Boolean
	 * @note Is the (unique) on a saved level ? 
	 */
	bool on_saved;

	/** @structvar total_visible
	 * @brief Number
	 * @note Amount of this race that are visible 
	 */
	byte total_visible;

	/** @structvar drops
	 * @brief obj_theme
	 * @note The drops type 
	 */
	obj_theme drops;
};

/** @struct monster_type
 * @brief Monster type
 */
struct monster_type
{
	/** @structvar r_idx
	 * @brief Number
	 * @note Monster race index 
	 */
	s16b r_idx;

	/** @structvar ego
	 * @brief Number
	 * @note Ego monster type 
	 */
	u16b ego;

	/** @structvar fy
	 * @brief Number
	 * @note Y location on map 
	 */
	byte fy;
	/** @structvar fx
	 * @brief Number
	 * @note X location on map 
	 */
	byte fx;

	/** @structvar hp
	 * @brief Number
	 * @note Current Hit points 
	 */
	s16b hp;
	/** @structvar maxhp
	 * @brief Number
	 * @note Max Hit points 
	 */
	s16b maxhp;

	/** @structvar blow[4]
	 * @brief magic_power
	 * @note Up to four blows per round 
	 */
	monster_blow blow[4];

	/** @structvar speed
	 * @brief Number
	 * @note Speed (normally 110) 
	 */
	byte speed;
	/** @structvar level
	 * @brief Number
	 * @note Level of creature 
	 */
	byte level;
	/** @structvar ac
	 * @brief Number
	 * @note Armour Class 
	 */
	s16b ac;
	/** @structvar exp
	 * @brief Number
	 * @note Experience 
	 */
	u32b exp;

	/** @structvar csleep
	 * @brief Number
	 * @note Inactive counter 
	 */
	s16b csleep;

	/** @structvar mspeed
	 * @brief Number
	 * @note Monster "speed" 
	 */
	byte mspeed;
	/** @structvar energy
	 * @brief Number
	 * @note Monster "energy" 
	 */
	byte energy;

	/** @structvar stunned
	 * @brief Number
	 * @note Monster is stunned 
	 */
	byte stunned;
	/** @structvar confused
	 * @brief Number
	 * @note Monster is confused 
	 */
	byte confused;
	/** @structvar monfear
	 * @brief Number
	 * @note Monster is afraid 
	 */
	byte monfear;

	/** @structvar bleeding
	 * @brief Number
	 * @note Monster is bleeding 
	 */
	s16b bleeding;
	/** @structvar poisoned
	 * @brief Number
	 * @note Monster is poisoned 
	 */
	s16b poisoned;

	/** @structvar cdis
	 * @brief Number
	 * @note Current dis from player 
	 */
	byte cdis;

	/** @structvar mflag
	 * @brief Number
	 * @note Extra monster flags 
	 */
	s32b mflag;

	/** @structvar ml
	 * @brief Boolean
	 * @note Monster is "visible" 
	 */
	bool ml;

	/** @structvar hold_o_idx
	 * @brief Number
	 * @note Object being held (if any) 
	 */
	s16b hold_o_idx;

	/** @structvar smart
	 * @brief Number
	 * @note Field for "smart_learn" 
	 */
	u32b smart;

	/** @structvar status
	 * @brief Number
	 * @note Status(friendly, pet, companion, ..) 
	 */
	s16b status;

	/** @structvar target
	 * @brief Number
	 * @note Monster target 
	 */
	s16b target;

	/** @structvar possessor
	 * @brief Number
	 * @note Is it under the control of a possessor ? 
	 */
	s16b possessor;
};

$static monster_type *lua_get_monster(int m_idx){return (&m_list[m_idx]);}
/** @fn monster(int m_idx);
 * @brief Return the monster with index "m_idx" in the monster list.\n
 * @param m_idx Number \n the index of the monster in the monster list
 * @brief Monster index
 * @return monster_type \n The monster.
 * @note (see file w_mnster.c)
 */
static monster_type *lua_get_monster @ monster(int m_idx);

/** @var m_list[max_m_idx]
 * @brief monster_type
 * @note List of monsters
 */
extern monster_type m_list[max_m_idx];

/** @fn race_info_idx(int r_idx, int ego)
 * @brief Get monster info and ego info for monster with monster index "r_idx"
 * and monster ego "ego".\n
 * @param r_idx Number \n the index of the race in the monster race array
 * @brief Race index
 * @param ego Number \n the index of the ego in the monster ego array
 * @brief Ego index
 * @return monster_race \n The monster race.
 * @note
 * If "ego" > 0, the ego information is applied to the monster information and
 * the new monster information is returned.
 * @note
 * For example, race_info_idx(141,7) will create a brown yeek (monster)
 * shaman (ego).
 * @note (see file monster2.c)
 */
extern monster_race* race_info_idx(int r_idx, int ego);

/** @fn delete_monster_idx(int i)
 * @brief Delete monster "i" from the monster array.\n
 * @param i Number \n the index of the monster in the monster list
 * @brief Monster index
 * @note (see file monster2.c)
 */
extern void delete_monster_idx(int i);

/** @fn m_pop(void)
 * @brief Get an empty slot in the monster list.
 * @return Number \n The index of an empty slot the monster list.
 * @note
 * If there are no empty slots, a slot will be reclaimed from a "dead"
 * monster. If all slots are full, 0 is returned, which means the function
 * has failed ("Too many monsters!").
 * @note (see file monster2.c)
 */
extern s16b m_pop(void);

/** @fn get_mon_num_prep(void)
 * @brief Apply a "monster restriction function" to the "monster allocation
 * table".
 * @return Number \n 0 (success) always.
 * @note
 * There are no parameters, but there are some other variables which will
 * need to be set. They are get_mon_num_hook and get_mon_num2_hook. They
 * are pointers to functions.
 * @note
 * For example, get_mon_num_hook = monster_volcano means when
 * get_mon_num_hook is called (*get_mon_num_hook)(index), the actual
 * function called is monster_volcano(index). This particular function
 * returns TRUE if the monster indicated by "index" has the
 * RF8_WILD_VOLCANO flag set.
 * @note
 * It is a good idea to store the old value of get_mon_num_hook before
 * setting a new one, and restoring it when your function is finished.
 * @note
 * Following is a list of functions which can be assigned to
 * get_mon_num_hook:\n
 * create_molds_hook\n
 * create_townpeople_hook\n
 * mon_hook_bounty\n
 * monster_dungeon\n
 * monster_grass\n
 * monster_mountain\n
 * monster_ocean\n
 * monster_quest\n
 * monster_shore\n
 * monster_town\n
 * monster_volcano\n
 * monster_waste\n
 * monster_wood\n
 * mutate_monster_okay\n
 * place_monster_okay\n
 * summon_specific_okay\n
 * vault_aux_animal\n
 * vault_aux_chapel\n
 * vault_aux_clone\n
 * vault_aux_demon\n
 * vault_aux_dragon\n
 * vault_aux_giant\n
 * vault_aux_jelly\n
 * vault_aux_kennel\n
 * vault_aux_orc\n
 * vault_aux_symbol\n
 * vault_aux_treasure\n
 * vault_aux_troll\n
 * vault_aux_undead
 * @note
 * Or you can write your own. The function must take an integer (index)
 * as a parameter and return boolean (TRUE if the monster is selected,
 * or FALSE if it is not).
 * @note (see file monster2.c)
 */
extern errr get_mon_num_prep(void);

/** @fn get_mon_num(int level)
 * @brief For the given level "level", return the index of an appropriate
 * monster race.\n
 * @param level Number \n a dungeon level (which is adjusted before
 * it is used).
 * @brief Dungeon level
 * @return Number \n The index of a monster race in the monster race array.
 * @note
 * This function uses the "prob2" field of the "monster allocation table",
 * and various local information, to calculate the "prob3" field of the
 * same table, which is then used to choose an "appropriate" monster, in
 * a relatively efficient manner.
 * @note
 * Note that "town" monsters will *only* be created in the town, and
 * "normal" monsters will *never* be created in the town, unless the
 * "level" is "modified", for example, by polymorph or summoning.
 * @note
 * There is a small chance (1/50) of "boosting" the given depth by
 * a small amount (up to four levels), except in the town.
 * @note
 * It is (slightly) more likely to acquire a monster of the given level
 * than one of a lower level.  This is done by choosing several monsters
 * appropriate to the given level and keeping the "hardest" one.
 * @note
 * Note that if no monsters are "appropriate", then this function will
 * fail, and return zero, but this should *almost* never happen.
 * @note (see file monster2.c)
 */
extern s16b get_mon_num(int level);

$static char *lua_monster_desc(monster_type *m_ptr, int mode){static char buf[200]; monster_desc(buf, m_ptr, mode); return buf;}
/** @fn monster_desc(monster_type *m_ptr, int mode);
 * @brief Return a monster description for monster "monster_type" using flag
 * "mode".\n
 * @param *m_ptr monster_type \n the monster
 * @brief Monster
 * @param mode Number \n description mode (see below)
 * @brief Description mode
 * @return String \n The description of the monster.
 * @note
 * We can correctly describe monsters based on their visibility.\n
 * We can force all monsters to be treated as visible or invisible.\n
 * We can build nominatives, objectives, possessives, or reflexives.\n
 * We can selectively pronominalize hidden, visible, or all monsters.\n
 * We can use definite or indefinite descriptions for hidden monsters.\n
 * We can use definite or indefinite descriptions for visible monsters.
 * @note
 * Pronominalization involves the gender whenever possible and allowed,
 * so that by cleverly requesting pronominalization / visibility, you
 * can get messages like "You hit someone.  She screams in agony!".
 * @note
 * Reflexives are acquired by requesting Objective plus Possessive.
 * @note
 * If no m_ptr arg is given (?), the monster is assumed to be hidden,
 * unless the "Assume Visible" mode is requested.
 * @note
 * If no r_ptr arg is given, it is extracted from m_ptr and r_info
 * If neither m_ptr nor r_ptr is given, the monster is assumed to
 * be neuter, singular, and hidden (unless "Assume Visible" is set),
 * in which case you may be in trouble... :-)
 * @note
 * I am assuming that no monster name is more than 70 characters long,
 * so that "char desc[80];" is sufficiently large for any result.
 * @note
 * Mode Flags:\n
 *   0x01 --> Objective (or Reflexive)\n
 *   0x02 --> Possessive (or Reflexive)\n
 *   0x04 --> Use indefinites for hidden monsters ("something")\n
 *   0x08 --> Use indefinites for visible monsters ("a kobold")\n
 *   0x10 --> Pronominalize hidden monsters\n
 *   0x20 --> Pronominalize visible monsters\n
 *   0x40 --> Assume the monster is hidden\n
 *   0x80 --> Assume the monster is visible
 * @note
 * Useful Modes:\n
 *   0x00 --> Full nominative name ("the kobold") or "it"\n
 *   0x04 --> Full nominative name ("the kobold") or "something"\n
 *   0x80 --> Genocide resistance name ("the kobold")\n
 *   0x88 --> Killing name ("a kobold")\n
 *   0x22 --> Possessive, genderized if visible ("his") or "its"\n
 *   0x23 --> Reflexive, genderized if visible ("himself") or "itself"
 * @note (see file monster2.c)
 */
static char *lua_monster_desc @ monster_desc(monster_type *m_ptr, int mode);

$static char *lua_monster_race_desc(int r_idx, int ego){static char buf[200]; monster_race_desc(buf, r_idx, ego); return buf;}
/** @fn monster_race_desc(int r_idx, int ego);
 * @brief Return the monster description for monster with monster index
 * "r_idx" and monster ego "ego".\n
 * @param r_idx Number \n the index of the race in the monster race array
 * @brief Race index
 * @param ego Number \n the index of the ego in the monster ego array
 * @brief Ego index
 * @return String \n The description of the monster race.
 * @note
 * The monster description is made up of the ego name (if any) and monster
 * name, or the unique name.
 * @note (see file w_mnster.c)
 */
static char *lua_monster_race_desc @ monster_race_desc(int r_idx, int ego);

/** @fn monster_race_desc(char *desc, int r_idx, int ego)
 * @brief Return the monster description "desc" for monster with monster index
 * "r_idx" and monster ego "ego".\n
 * @param *desc String
 * @brief Description
 * @param r_idx Number \n the index of the race in the monster race array
 * @brief Race index
 * @param ego Number \n the index of the ego in the monster ego array
 * @brief Ego index
 * @return *desc String \n The description of the monster race.
 * @note
 * The monster description is made up of the ego name (if any) and monster
 * name, or the unique name.
 * @note (see file monster2.c)
 */
extern void monster_race_desc(char *desc, int r_idx, int ego);

/** @fn monster_carry(monster_type *m_ptr, int m_idx, object_type *q_ptr)
 * @brief Allow monster "m_ptr" with monster index "m_idx" to carry object
 * "q_ptr".\n
 * @param *m_ptr monster_type \n the monster
 * @brief Monster
 * @param m_idx Number \n the index of the monster in the monster list
 * @brief Monster index
 * @param *q_ptr object_type \n the object
 * @brief Object
 * @note
 * The monster can only carry the object if there is room for the object in the
 * object list.
 * @note (see file monster2.c)
 */
extern void monster_carry(monster_type *m_ptr, int m_idx, object_type *q_ptr);

/** @fn place_monster_aux(int y, int x, int r_idx, bool slp, bool grp, int status)
 * @brief Attempt to place a monster with monster race index "r_idx" and status
 * "status" at grid "y", "x". The monster may be asleep ("slp") or surrounded
 * by a group of identical monsters ("grp").\n
 * @param y Number \n the y coordinate of the target grid
 * @brief Y-coordinate
 * @param x Number \n the x coordinate of the target grid
 * @brief X-coordinate
 * @param r_idx Number \n the index of the race in the monster race array
 * @brief Race index
 * @param slp Boolean \n TRUE if monster is asleep, otherwise FALSE
 * @brief Asleep?
 * @param grp Boolean \n TRUE if monster appears in a group, otherwise FALSE
 * @brief Group?
 * @param status Number \n the status of the monster from the player's point
 * of view (see MSTATUS_foo flags)
 * @brief Monster status
 * @return Boolean \n TRUE if the monster is placed successfully, otherwise
 * FALSE.
 * @note
 * Note that certain monsters are now marked as requiring "friends".
 * These monsters, if successfully placed, and if the "grp" parameter
 * is TRUE, will be surrounded by a "group" of identical monsters.
 * @note
 * Note that certain monsters are now marked as requiring an "escort",
 * which is a collection of monsters with similar "race" but lower
 * level.
 * @note
 * Some monsters induce a fake "group" flag on their escorts.
 * @note
 * Note the "bizarre" use of non-recursion to prevent annoying output
 * when running a code profiler.
 * @note
 * Note the use of the new "monster allocation table" code to restrict
 * the "get_mon_num()" function to "legal" escort types.
 * @note (see file monster2.c)
 */
extern bool place_monster_aux(int y, int x, int r_idx, bool slp, bool grp, int status);

/** @fn place_monster(int y, int x, bool slp, bool grp)
 * @brief Attempt to place a monster at grid "y", "x". The monster may be
 * asleep ("slp") or surrounded by a group of identical monsters ("grp").\n
 * @param y Number \n the y coordinate of the target grid
 * @brief Y-coordinate
 * @param x Number \n the x coordinate of the target grid
 * @brief X-coordinate
 * @param slp Boolean \n TRUE if monster is asleep, otherwise FALSE
 * @brief Asleep?
 * @param grp Boolean \n TRUE if monster appears in a group, otherwise FALSE
 * @brief Group?
 * @return Boolean \n TRUE if the monster is placed successfully, otherwise
 * FALSE.
 * @note
 * Attempt to find a monster appropriate to the "monster_level"
 * @note (see file monster2.c)
 */
extern bool place_monster(int y, int x, bool slp, bool grp);

/** @fn place_monster_one(int y, int x, int r_idx, int ego, bool slp, int status)
 * @brief Attempt to place a monster with monster race index "r_idx", monster
 * ego "ego" and status "status" at grid "y", "x". The monster may be asleep
 * ("slp").\n
 * @param y Number \n the y coordinate of the target grid
 * @brief Y-coordinate
 * @param x Number \n the x coordinate of the target grid
 * @brief X-coordinate
 * @param r_idx Number \n the index of the race in the monster race array
 * @brief Race index
 * @param ego Number \n the index of the ego in the monster ego array
 * @brief Ego index
 * @param slp Boolean \n TRUE if monster is asleep, otherwise FALSE
 * @brief Asleep?
 * @param status Number \n the status of the monster from the player's point
 * of view (see MSTATUS_foo flags)
 * @brief Monster status
 * @return Number \n The index of the placed monster in the monster list.
 * @note
 * To give the player a sporting chance, any monster that appears in
 * line-of-sight and is extremely dangerous can be marked as
 * "FORCE_SLEEP", which will cause them to be placed with low energy,
 * which often (but not always) lets the player move before they do.
 * @note
 * This routine refuses to place out-of-depth "FORCE_DEPTH" monsters.
 * @note
 * XXX XXX XXX Use special "here" and "dead" flags for unique monsters,
 * remove old "cur_num" and "max_num" fields.
 * @note
 * XXX XXX XXX Actually, do something similar for artifacts, to simplify
 * the "preserve" mode, and to make the "what artifacts" flag more useful.
 * @note
 * This is the only function which may place a monster in the dungeon,
 * except for the savefile loading code.
 * @note (see file monster2.c)
 */
extern s16b place_monster_one(int y, int x, int r_idx, int ego, bool slp, int status);

/** @fn is_friend(monster_type *m_ptr)
 * @brief Return a value to indicate the status of monster "m_ptr".\n
 * @param *m_ptr monster_type \n the monster
 * @brief Monster
 * @return Number \n -1 if monster is an enemy, 0 if it is neutral, and 1 if
 * it is friendly.
 * @note (see file monster3.c)
 */
extern int is_friend(monster_type *m_ptr);

/** @fn is_enemy(monster_type *m_ptr, monster_type *t_ptr)
 * @brief Determine if monster "m_ptr" should attack monster "t_ptr".\n
 * @param *m_ptr monster_type \n the monster
 * @brief Monster
 * @param *t_ptr monster_type \n the target monster
 * @brief Target monster
 * @return Boolean \n TRUE if monster "m_ptr" should attack monster "t_ptr",
 * otherwise FALSE.
 * @note
 * If "m_ptr" is stupid and "r_ptr" is a different type of monster then the
 * function will return TRUE.\n
 * If "m_ptr" is not neutral and "r_ptr" is a breeder, and "r_ptr" is a
 * different type of monster then the function will return TRUE (and vice
 * versa).\n
 * If both monsters are not neutral and one is friendly and the other isn't
 * then the function will return TRUE.
 * @note (see file monster3.c)
 */
extern bool is_enemy(monster_type *m_ptr, monster_type *t_ptr);

/** @fn change_side(monster_type *m_ptr)
 * @brief Change the status of monster "m_ptr" from friendly to unfriendly and
 * vice versa. 
 * @param *m_ptr monster_type \n the monster
 * @brief Monster
 * @return Boolean \n TRUE if the status changed, otherwise FALSE.
 * @note
 * Friends and pets become enemies.\n
 * Neutral monsters become neutral pets and vice versa.\n
 * Companions are unaffected.
 * @note (see file monster3.c)
 */
extern bool change_side(monster_type *m_ptr);

/** @fn find_position(int y, int x, int *yy = 0, int *xx = 0)
 * @brief Find a new grid "yy", "xx" within 6 grids of target grid "y", "x".\n
 * @param y Number \n the y coordinate of the origin grid
 * @brief Origin y-coordinate
 * @param x Number \n the x coordinate of the origin grid
 * @brief Origin x-coordinate
 * @param yy Number \n the y coordinate of the target grid
 * @brief Target y-coordinate
 * @param xx Number \n the x coordinate of the target grid
 * @brief Target x-coordinate
 * @note
 * The new grid must be within line-of-sight of the target grid. A
 * maximum of 5000 attempts is made.
 * @note (see file lua_bind.c)
 */
extern void find_position(int y, int x, int *yy = 0, int *xx = 0);

/** @var summon_specific_level
 * @brief Number
 * @note
 * Force summoned monsters to be at this level.
 */
extern int summon_specific_level;

/** @var summon_kin_type
 * @brief String
 * @note
 * The monster character for those monsters who can summon kin.
 */
extern char summon_kin_type;

/** @fn summon_specific(int y1, int x1, int lev, int type)
 * @brief Place a monster of type "type" near grid "y","x".\n 
 * @param y1 Number \n the y coordinate of the target grid
 * @brief Y-coordinate
 * @param x1 Number \n the x coordinate of the target grid
 * @brief X-coordinate
 * @param lev Number \n the monster level of the summoning monster
 * @brief Summoner level
 * @param type Number \n the type of summoned monster
 * @brief Monster type
 * @return Boolean \n TRUE if a monster was summoned, otherwise FALSE.
 * @note
 * We will attempt to place the monster up to 20 times before giving up.
 * @note
 * Note: SUMMON_UNIQUE and SUMMON_WRAITH (XXX) will summon Unique's\n
 * Note: SUMMON_HI_UNDEAD and SUMMON_HI_DRAGON may summon Unique's\n
 * Note: None of the other summon codes will ever summon Unique's.
 * @note
 * This function has been changed.  We now take the "monster level"
 * of the summoning monster as a parameter, and use that, along with
 * the current dungeon level, to help determine the level of the
 * desired monster.  Note that this is an upper bound, and also
 * tends to "prefer" monsters of that level.  Currently, we use
 * the average of the dungeon and monster levels, and then add
 * five to allow slight increases in monster power.
 * @note
 * Note that we use the new "monster allocation table" creation code
 * to restrict the "get_mon_num()" function to the set of "legal"
 * monsters, making this function much faster and more reliable.
 * @note
 * Note that this function may not succeed, though this is very rare.
 * @note (see file monster2.c)
 */
extern bool summon_specific(int y1, int x1, int lev, int type);

/** @fn summon_specific_friendly(int y1, int x1, int lev, int type, bool Group_ok)
 * @brief Place a friendly monster of type "type" near grid "y","x". The
 * monster may be surrounded by a group of identical monsters ("Group_ok").\n 
 * @param y1 Number \n the y coordinate of the target grid
 * @brief Y-coordinate
 * @param x1 Number \n the x coordinate of the target grid
 * @brief X-coordinate
 * @param lev Number \n the monster level of the summoning monster
 * @brief Summoner level
 * @param type Number \n the type of summoned monster
 * @brief Monster type
 * @param Group_ok Boolean \n TRUE if monster appears in a group, otherwise
 * FALSE
 * @brief Group?
 * @return Boolean \n TRUE if a monster was summoned, otherwise FALSE.
 * @note (see file monster2.c)
 */
extern bool summon_specific_friendly(int y1, int x1, int lev, int type, bool Group_ok);

/** @fn summon_monster_aux(int y, int x, int lev, bool friend, char *fct);
 * @brief Place a monster near grid "y","x".\n 
 * @param y Number \n the y coordinate of the target grid
 * @brief Y-coordinate
 * @param x Number \n the x coordinate of the target grid
 * @brief X-coordinate
 * @param lev Number \n the monster level of the summoning monster
 * @brief Summoner level
 * @param friend Boolean \n TRUE if friendly monsters are to be summoned,
 * otherwise FALSE
 * @brief Friendly?
 * @param *fct String \n the function which determines which type of monster
 * will be summoned
 * @brief Monster type function
 * @return Boolean \n TRUE if a monster was summoned, otherwise FALSE.
 * @note (see file w_mnster.c)
 */
extern bool lua_summon_monster @ summon_monster_aux(int y, int x, int lev, bool friend, char *fct);

/** @fn can_create_companion()
 * @brief Determine if a companion can be created.
 * @return Boolean \n TRUE if a companion can be created, otherwise FALSE.
 * @note
 * The companions are counted. If this is less than the number allowed by
 * the player monster lore skill, the function returns TRUE, otherwise the
 * function returns FALSE.
 * @note (see file monster3.c)
 */
extern bool can_create_companion();

/** @fn monster_set_level(int m_idx, int level)
 * @brief Set a new level for monster with monster index "m_idx".\n
 * @param m_idx Number \n the index of the monster in the monster list
 * @brief Monster index
 * @param level Number \n the new level of the monster
 * @brief Monster level
 * @note
 * The new level can not exceed 150. If the new level is higher than the
 * monster level, the monster experience value is recalculated.
 * @note (see file monster2.c)
 */
extern void monster_set_level(int m_idx, int level);

/** @name Summon types
 * @note Legal restrictions for "summon_specific()"
 */
/** @def SUMMON_ANT
 * @note Summon giant ant (a) excluding uniques.
 */
#define SUMMON_ANT                  11

/** @def SUMMON_SPIDER
 * @note Summon spider/scorpion/tick (S) excluding uniques.
 */
#define SUMMON_SPIDER               12

/** @def SUMMON_HOUND
 * @note Summon canine (C) or zephyr hound (Z) excluding uniques.
 */
#define SUMMON_HOUND                13

/** @def SUMMON_HYDRA
 * @note Summon multi-headed hydra (M) excluding uniques.
 */
#define SUMMON_HYDRA                14

/** @def SUMMON_ANGEL
 * @note Summon angelic being (A) excluding uniques.
 */
#define SUMMON_ANGEL                15

/** @def SUMMON_DEMON
 * @note Summon demon (RF3_DEMON) excluding uniques.
 */
#define SUMMON_DEMON                16

/** @def SUMMON_UNDEAD
 * @note Summon undead (RF3_UNDEAD) excluding uniques.
 */
#define SUMMON_UNDEAD               17

/** @def SUMMON_DRAGON
 * @note Summon dragon (RF3_DRAGON) excluding uniques.
 */
#define SUMMON_DRAGON               18

/** @def SUMMON_HI_UNDEAD
 * @note Summon lich (L) or vampire (V) or wight/wraith (W) including uniques.
 */
#define SUMMON_HI_UNDEAD            21

/** @def SUMMON_HI_DRAGON
 * @note Summon ancient dragon (D) including uniques.
 */
#define SUMMON_HI_DRAGON            22

/** @def SUMMON_WRAITH
 * @note Summon wight/wraith (W) including uniques.
 */
#define SUMMON_WRAITH               31

/** @def SUMMON_UNIQUE
 * @note Summon unique (RF1_UNIQUE).
 */
#define SUMMON_UNIQUE               32

/** @def SUMMON_BIZARRE1
 * @note Summon mold (m) excluding uniques.
 */
#define SUMMON_BIZARRE1             33

/** @def SUMMON_BIZARRE2
 * @note Summon giant bat (b) excluding uniques.
 */
#define SUMMON_BIZARRE2             34

/** @def SUMMON_BIZARRE3
 * @note Summon quylthulg (Q) excluding uniques.
 */
#define SUMMON_BIZARRE3             35

/** @def SUMMON_BIZARRE4
 * @note Summon vortex (v) excluding uniques.
 */
#define SUMMON_BIZARRE4             36

/** @def SUMMON_BIZARRE5
 * @note Summon creeping coins ($) excluding uniques.
 */
#define SUMMON_BIZARRE5             37

/** @def SUMMON_BIZARRE6
 * @note Summon mimic (!?=$|) excluding uniques.
 */
#define SUMMON_BIZARRE6             38

/** @def SUMMON_HI_DEMON
 * @note Summon demon (RF3_DEMON) and major demon (U) excluding uniques.
 */
#define SUMMON_HI_DEMON             39

/** @def SUMMON_KIN
 * @note Summon monster of the same character type excluding uniques.
 */
#define SUMMON_KIN                  40

/** @def SUMMON_DAWN
 * @note Summon monster with "the Dawn" in the name excluding uniques.
 */
#define SUMMON_DAWN                 41

/** @def SUMMON_ANIMAL
 * @note Summon animal (RF3_ANIMAL) excluding uniques.
 */
#define SUMMON_ANIMAL               42

/** @def SUMMON_ANIMAL_RANGER
 * @note Summon animal (RF3_ANIMAL) and giant ant, giant bat, centipede,
 * feline,giant louse, quadruped, rodent, worm or worm mass, bird, canine,
 * insect, snake, killer beetle, multi-headed hydra, reptile/amphibian,
 * spider/scorpion/tick (abcflqrwBCIJKMRS) and not dragon (RF3_DRAGON) and not
 * evil (RF3_EVIL) and not undead (RF3_UNDEAD) and not demon (RF3_DEMON) and
 * not inate/breath and not normal spells and not special spells excluding
 * uniques.
 */
#define SUMMON_ANIMAL_RANGER        43

/** @def SUMMON_HI_UNDEAD_NO_UNIQUES
 * @note Summon lich (L) or vampire (V) or wight/wraith (W) excluding uniques.
 */
#define SUMMON_HI_UNDEAD_NO_UNIQUES 44

/** @def SUMMON_HI_DRAGON_NO_UNIQUES
 * @note Summon ancient dragon (D) excluding uniques.
 */
#define SUMMON_HI_DRAGON_NO_UNIQUES 45

/** @def SUMMON_NO_UNIQUES
 * @note Summon non-uniques (not RF1_UNIQUE).
 */
#define SUMMON_NO_UNIQUES           46

/** @def SUMMON_PHANTOM
 * @note Summon monster with "Phantom" in the name excluding uniques.
 */
#define SUMMON_PHANTOM              47

/** @def SUMMON_ELEMENTAL
 * @note Summon monster with "lemental" in the name excluding uniques.
 */
#define SUMMON_ELEMENTAL            48

/** @def SUMMON_THUNDERLORD
 * @note Summon thunderlords (RF3_THUNDERLORD) including uniques.
 */
#define SUMMON_THUNDERLORD          49

/** @def SUMMON_BLUE_HORROR
 * @note Summon monster with "lue horror" in the name excluding uniques.
 */
#define SUMMON_BLUE_HORROR          50

/** @def SUMMON_BUG
 * @note Summon monster with "Software bug" in the name excluding uniques.
 */
#define SUMMON_BUG                  51

/** @def SUMMON_RNG
 * @note Summon monster with "Random Number Generator" in the name excluding
 * uniques.
 */
#define SUMMON_RNG                  52

/** @def SUMMON_MINE
 * @note Summon mines (RF1_NEVER_MOVE) including uniques.
 */
#define SUMMON_MINE                 53

/** @def SUMMON_HUMAN
 * @note Summon (p) excluding uniques.
 */
#define SUMMON_HUMAN                54

/** @def SUMMON_SHADOWS
 * @note Summon ghost (G) excluding uniques.
 */
#define SUMMON_SHADOWS              55

/** @def SUMMON_GHOST
 * @note Summon ghost (G) including uniques.
 */
#define SUMMON_GHOST                56

/** @def SUMMON_QUYLTHULG
 * @note Summon (Q) excluding uniques.
 */
#define SUMMON_QUYLTHULG            57

/** @def SUMMON_LUA
 * @note Summon monsters according to a Lua script.
 */
#define SUMMON_LUA                  58
/** @} */

/** @fn do_control_reconnect()
 * @brief Find the controlled monster and reconnect to it.
 * @return Boolean \n TRUE if there is a controlled monster, otherwise FALSE.
 * @note
 * The monster list is scanned for a monster with MFLAG_CONTROL. If it is
 * found, the function returns TRUE.
 * @note (see file monster3.c)
 */
extern bool do_control_reconnect();

/* monster thing */
/** @var m_max
 * @brief Number
 * @note The number of monsters currently in the monster list.
 */
extern s16b m_max;