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
|
/*
* File: mutation.cc
* Summary: Functions for handling player mutations.
* Written by: Linley Henzell
*
* Change History (most recent first):
*
* <5> 7/29/00 JDJ Made give_cosmetic_mutation static
* <4> 9/25/99 CDL linuxlib -> liblinux
* <3> 9/21/99 LRH Added many new scales
* <2> 5/20/99 BWR Fixed it so demonspwan should
* always get a mutation, 3 level
* perma_mutations now work.
* <1> -/--/-- LRH Created
*/
#include "AppHdr.h"
#include "mutation.h"
#include <stdlib.h>
#include <string.h>
#ifdef DOS
#include <conio.h>
#endif
#ifdef LINUX
#include "liblinux.h"
#endif
#include "externs.h"
#include "defines.h"
#include "effects.h"
#include "ouch.h"
#include "player.h"
#include "skills2.h"
#include "stuff.h"
#include "transfor.h"
#include "view.h"
#ifdef MACROS
#include "macro.h"
#endif
int how_mutated(void);
char body_covered(void);
bool perma_mutate(int which_mut, char how_much);
char mut_string[80];
char *mutation_descrip[][3] = {
{"You have tough skin (AC +1).", "You have very tough skin (AC +2).",
"You have extremely tough skin (AC +3)."},
{"Your muscles are strong (Str +", "", ""},
{"Your mind is acute (Int +", "", ""},
{"You are agile (Dex +", "", ""},
{"You are partially covered in green scales (AC + 1).",
"You are mostly covered in green scales (AC + 3).",
"You are covered in green scales (AC + 5)."},
{"You are partially covered in thick black scales (AC + 3, dex - 1).",
"You are mostly covered in thick black scales (AC + 6, dex - 2).",
"You are completely covered in thick black scales (AC + 9, dex - 3)."},
{"You are partially covered in supple grey scales (AC + 1).",
"You are mostly covered in supple grey scales (AC + 2).",
"You are completely covered in supple grey scales (AC + 3)."},
{"You are protected by plates of bone (AC + 2, dex - 1).",
"You are protected by plates of bone (AC + 3, dex - 2).",
"You are protected by plates of bone (AC + 4, dex - 3)."},
{"You are surrounded by a mild repulsion field (ev + 1).",
"You are surrounded by a moderate repulsion field (ev + 3).",
"You are surrounded by a strong repulsion field (ev + 5; repel missiles)."},
{"Your system is immune to poisons.", "Your system is immune to poisons.",
"Your system is immune to poisons."},
// 10
{"Your digestive system is specialised to digest meat.",
"Your digestive system is specialised to digest meat.",
"You are primarily a carnivore."},
{"You digest meat inefficiently.", "You digest meat inefficiently.",
"You are primarily a herbivore."},
{"Your flesh is heat resistant.", "Your flesh is very heat resistant.",
"Your flesh is almost immune to the effects of heat."},
{"Your flesh is cold resistant.", "Your flesh is very cold resistant.",
"Your flesh is almost immune to the effects of cold."},
{"You are immune to electric shocks.", "You are immune to electric shocks.",
"You are immune to electric shocks."},
{"Your natural rate of healing is unusually fast.",
"You heal very quickly.",
"You regenerate."},
{"You have a fast metabolism.", "You have a very fast metabolism.",
"Your metabolism is lightning-fast."},
{"You have a slow metabolism.", "You have a slow metabolism.",
"You need consume almost no food."},
{"You are weak (Str -", "", ""},
{"You are dopey (Int -", "", ""},
// 20
{"You are clumsy (Dex -", "", ""},
{"You can control translocations.", "You can control translocations.",
"You can control translocations."},
{"Space occasionally distorts in your vicinity.",
"Space sometimes distorts in your vicinity.",
"Space frequently distorts in your vicinity."},
{"You are resistant to magic.", "You are highly resistant to magic.",
"You are extremely resistant to the effects of magic."},
{"You cover the ground quickly.", "You cover the ground very quickly.",
"You cover the ground extremely quickly."},
{"You have supernaturally acute eyesight.",
"You have supernaturally acute eyesight.",
"You have supernaturally acute eyesight."},
{"Armour fits poorly on your deformed body.",
"Armour fits poorly on your badly deformed body.",
"Armour fits poorly on your hideously deformed body."},
{"You can teleport at will.", "You are good at teleporting at will.",
"You can teleport instantly at will."},
{"You can spit poison.", "You can spit poison.", "You can spit poison."},
{"You can sense your immediate surroundings.",
"You can sense your surroundings.",
"You can sense a large area of your surroundings."},
// 30
{"You can breathe flames.", "You can breathe fire.",
"You can breathe blasts of fire."},
{"You can translocate small distances instantaneously.",
"You can translocate small distances instantaneously.",
"You can translocate small distances instantaneously."},
{"You have a pair of small horns on your head.",
"You have a pair of horns on your head.",
"You have a pair of large horns on your head."},
{"Your muscles are strong (Str +1), but stiff (Dex -1).",
"Your muscles are very strong (Str +2), but stiff (Dex -2).",
"Your muscles are extremely strong (Str +3), but stiff (Dex -3)."},
{"Your muscles are flexible (Dex +1), but weak (Str -1).",
"Your muscles are very flexible (Dex +2), but weak (Str -2).",
"Your muscles are extremely flexible (Dex +3), but weak (Str -3)."},
{"You occasionally forget where you are.",
"You sometimes forget where you are.",
"You frequently forget where you are."},
{"You possess an exceptional clarity of mind.",
"You possess an unnatural clarity of mind.",
"You possess a supernatural clarity of mind."},
{"You tend to lose your temper in combat.",
"You often lose your temper in combat.",
"You have an uncontrollable temper."},
{"Your body is slowly deteriorating.", "Your body is deteriorating.",
"Your body is rapidly deteriorating."},
{"Your vision is a little blurry.", "Your vision is quite blurry.",
"Your vision is extremely blurry."},
// 40
{"You are somewhat resistant to further mutation.",
"You are somewhat resistant to both further mutation and mutation removal.",
"Your current mutations are irrevocably fixed, and you can mutate no more."},
{"You are frail (-10 percent hp).", "You are very frail (-20 percent hp).",
"You are extremely frail (-30 percent hp)."},
{"You are robust (+10 percent hp).",
"You are very robust (+20 percent hp).",
"You are extremely robust (+30 percent hp)."},
{"You are immune to unholy pain and torment.", "", ""},
{"You resist negative energy.",
"You are quite resistant to negative energy.",
"You are immune to negative energy."},
/* Use find_spell in files.cc to avoid duplication */
{"You can summon minor demons to your aid.", "", ""},
{"You can summon demons to your aid.", "", ""},
{"You can hurl blasts of hellfire.", "", ""},
{"You can call on the torments of Hell.", "", ""},
{"You can raise the dead to walk for you.", "", ""},
// 50
{"You can control demons.", "", ""},
{"You can travel to (but not from) Pandemonium at will.", "", ""},
{"You can draw strength from death and destruction.", "", ""},
/* Not worshippers of Vehumet */
{"You can channel magical energy from Hell.", "", ""},
{"You can drain life in unarmed combat.", "", ""},
/* Not conjurers/worshippers of Makhleb */
{"You can throw forth the flames of Gehenna.", "", ""},
{"You can throw forth the frost of Cocytus.", "", ""},
{"You can invoke the powers of Tartarus to smite your living foes.", "", ""},
{"You have sharp fingernails.", "Your fingernails are very sharp.",
"You have claws for hands."},
{"You have hooves in place of feet.", "", ""},
// 60 - leave some space for more demonic powers...
{"You can exhale a cloud of poison.", "", ""},
{"Your tail ends in a poisonous barb.",
"Your tail ends in a sharp poisonous barb.",
"Your tail ends in a wicked poisonous barb."}, //jmf: nagas & dracos
{"Your wings are large and strong.", "", ""}, //jmf: dracos only
//jmf: these next two are for evil gods to mark their followers; good gods
// will never accept a 'marked' worhsipper
{"There is a blue sigil on each of your hands.",
"There are several blue sigils on your hands and arms.",
"Your hands, arms and shoulders are covered in intricate, arcane blue writing."},
{"There is a green sigil on your chest.",
"There are several green sigils on your chest and abdomen.",
"Your chest, abdomen and neck are covered in intricate, arcane green writing."},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
// 70
{"You are partially covered in red scales (AC + 1).",
"You are mostly covered in red scales (AC + 2).",
"You are covered in red scales (AC + 4)."},
{"You are partially covered in smooth nacreous scales (AC + 1).",
"You are mostly covered in smooth nacreous scales (AC + 3).",
"You are completely covered in smooth nacreous scales (AC + 5)."},
{"You are partially covered in ridged grey scales (AC + 2, dex - 1).",
"You are mostly covered in ridged grey scales (AC + 4, dex - 1).",
"You are completely covered in ridged grey scales (AC + 6, dex - 2)."},
{"You are partially covered in metallic scales (AC + 3, dex - 2).",
"You are mostly covered in metallic scales (AC + 7, dex - 3).",
"You are completely covered in metallic scales (AC + 10, dex - 4)."},
{"You are partially covered in black scales (AC + 1).",
"You are mostly covered in black scales (AC + 3).",
"You are completely covered in black scales (AC + 5)."},
{"You are partially covered in white scales (AC + 1).",
"You are mostly covered in white scales (AC + 3).",
"You are completely covered in white scales (AC + 5)."},
{"You are partially covered in yellow scales (AC + 2).",
"You are mostly covered in yellow scales (AC + 4, dex - 1).",
"You are completely covered in yellow scales (AC + 6, dex - 2)."},
{"You are partially covered in brown scales (AC + 2).",
"You are mostly covered in brown scales (AC + 4).",
"You are completely covered in brown scales (AC + 5)."},
{"You are partially covered in blue scales (AC + 1).",
"You are mostly covered in blue scales (AC + 2).",
"You are completely covered in blue scales (AC + 3)."},
{"You are partially covered in purple scales (AC + 2).",
"You are mostly covered in purple scales (AC + 4).",
"You are completely covered in purple scales (AC + 6)."},
// 80
{"You are partially covered in speckled scales (AC + 1).",
"You are mostly covered in speckled scales (AC + 2).",
"You are covered in speckled scales (AC + 3)."},
{"You are partially covered in orange scales (AC + 1).",
"You are mostly covered in orange scales (AC + 3).",
"You are completely covered in orange scales (AC + 4)."},
{"You are partially covered in indigo scales (AC + 2).",
"You are mostly covered in indigo scales (AC + 3).",
"You are completely covered in indigo scales (AC + 5)."},
{"You are partially covered in knobbly red scales (AC + 2).",
"You are mostly covered in knobbly red scales (AC + 5, dex - 1).",
"You are completely covered in knobbly red scales (AC + 7, dex - 2)."},
{"You are partially covered in iridescent scales (AC + 1).",
"You are mostly covered in iridescent scales (AC + 2).",
"You are completely covered in iridescent scales (AC + 3)."},
{"You are partially covered in patterned scales (AC + 1).",
"You are mostly covered in patterned scales (AC + 2).",
"You are completely covered in patterned scales (AC + 3)."},
};
/*
If giving a mutation which must succeed (eg demonspawn), must add exception
to the "resist mutation" mutation thing.
*/
char *gain_mutation[][3] = {
{"Your skin toughens.", "Your skin toughens.", "Your skin toughens."},
{"", "", ""}, // replaced with player::modify_stat() handling {dlb}
{"", "", ""}, // replaced with player::modify_stat() handling {dlb}
{"", "", ""}, // replaced with player::modify_stat() handling {dlb}
{"Green scales grow over part of your body.",
"Green scales spread over more of your body.",
"Green scales cover you completely."},
{"Thick black scales grow over part of your body.",
"Thick black scales spread over more of your body.",
"Thick black scales cover you completely."},
{"Supple grey scales grow over part of your body.",
"Supple grey scales spread over more of your body.",
"Supple grey scales cover you completely."},
{"You grow protective plates of bone.",
"You grow more protective plates of bone.",
"You grow more protective plates of bone."},
{"You begin to radiate repulsive energy.",
"Your repulsive radiation grows stronger.",
"Your repulsive radiation grows stronger."},
{"You feel healthy.", "You feel healthy.", "You feel healthy."},
// 10
{"You hunger for flesh.", "You hunger for flesh.", "You hunger for flesh."},
{"You hunger for vegetation.", "You hunger for vegetation.",
"You hunger for vegetation."},
{"You feel a sudden chill.", "You feel a sudden chill.",
"You feel a sudden chill."},
{"You feel hot for a moment.", "You feel hot for a moment.",
"You feel hot for a moment."},
{"You feel insulated.", "You feel insulated.", "You feel insulated."},
{"You begin to heal more quickly.",
"You begin to heal more quickly.",
"You begin to regenerate."},
{"You feel a little hungry.", "You feel a little hungry.",
"You feel a little hungry."},
{"Your metabolism slows.", "Your metabolism slows.",
"Your metabolism slows."},
{"You feel weaker.", "You feel weaker.", "You feel weaker."},
{"You feel less intelligent.", "You feel less intelligent",
"You feel less intelligent"},
// 20
{"You feel clumsy.", "You feel clumsy.",
"You feel clumsy."},
{"You feel controlled.", "You feel controlled.",
"You feel controlled."},
{"You feel weirdly uncertain.",
"You feel even more weirdly uncertain.",
"You feel even more weirdly uncertain."},
{"You feel resistant to magic.",
"You feel more resistant to magic.",
"You feel almost impervious to the effects of magic."},
{"You feel quick.", "You feel quick.", "You feel quick."},
{"Your vision sharpens.", "Your vision sharpens.", "Your vision sharpens."},
{"Your body twists and deforms.", "Your body twists and deforms.",
"Your body twists and deforms."},
{"You feel jumpy.", "You feel more jumpy.", "You feel even more jumpy."},
{"There is a nasty taste in your mouth for a moment.",
"There is a nasty taste in your mouth for a moment.",
"There is a nasty taste in your mouth for a moment."},
{"You feel aware of your surroundings.",
"You feel more aware of your surroundings.",
"You feel even more aware of your surroundings."},
// 30
{"Your throat feels hot.", "Your throat feels hot.",
"Your throat feels hot."},
{"You feel a little jumpy.", "You feel more jumpy.",
"You feel even more jumpy."},
{"A pair of horns grows on your head!",
"The horns on your head grow some more.",
"The horns on your head grow some more."},
{"Your muscles feel sore.", "Your muscles feel sore.",
"Your muscles feel sore."},
{"Your muscles feel loose.", "Your muscles feel loose.",
"Your muscles feel loose."},
{"You feel a little disoriented.", "You feel a little disoriented.",
"Where the Hells are you?"},
{"Your thoughts seem clearer.", "Your thoughts seem clearer.",
"Your thoughts seem clearer."},
{"You feel a little pissed off.", "You feel angry.",
"You feel extremely angry at everything!"},
{"You feel yourself wasting away.", "You feel yourself wasting away.",
"You feel your body start to fall apart."},
{"Your vision blurs.", "Your vision blurs.", "Your vision blurs."},
// 40
{"You feel genetically stable.", "You feel genetically stable.",
"You feel genetically immutable."},
{"You feel frail.", "You feel frail.", "You feel frail."},
{"You feel robust.", "You feel robust.", "You feel robust."},
{"You feel a strange anaesthesia.", "", ""},
{"You feel negative.", "You feel negative.", "You feel negative."},
{"A thousand chattering voices call out to you.", "", ""},
{"Help is not far away!", "", ""},
{"You smell fire and brimstone.", "", ""},
{"You feel a terrifying power at your call.", "", ""},
{"You feel an affinity for the dead.", "", ""},
// 50
{"You feel an affinity for all demonkind.", "", ""},
{"You feel something pulling you to a strange and terrible place.", "", ""},
{"You feel hungry for death.", "", ""},
{"You feel a flux of magical energy.", "", ""},
{"Your skin tingles in a strangely unpleasant way.", "", ""},
{"You smell the fires of Gehenna.", "", ""},
{"You feel the icy cold of Cocytus chill your soul.", "", ""},
{"A shadow passes over the world around you.", "", ""},
{"Your fingernails lengthen.", "Your fingernails sharpen.",
"Your hands twist into claws."},
{"Your feet shrivel into cloven hooves.", "", ""},
// 60
{"You taste something nasty.", "You taste something very nasty.",
"You taste something extremely nasty."},
{"A poisonous barb forms on the end of your tail.",
"The barb on your tail looks sharper.",
"The barb on your tail looks very sharp."},
{"Your wings grow larger and stronger.", "", ""},
{"Your hands itch.", "Your hands and forearms itch.",
"Your arms, hands and shoulders itch."},
{"Your chest itches.", "Your chest and abdomen itch.",
"Your chest, abdomen and neck itch."},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
// 70
{"Red scales grow over part of your body.",
"Red scales spread over more of your body.",
"Red scales cover you completely."},
{"Smooth nacreous scales grow over part of your body.",
"Smooth nacreous scales spread over more of your body.",
"Smooth nacreous scales cover you completely."},
{"Ridged grey scales grow over part of your body.",
"Ridged grey scales spread over more of your body.",
"Ridged grey scales cover you completely."},
{"Metallic scales grow over part of your body.",
"Metallic scales spread over more of your body.",
"Metallic scales cover you completely."},
{"Black scales grow over part of your body.",
"Black scales spread over more of your body.",
"Black scales cover you completely."},
{"White scales grow over part of your body.",
"White scales spread over more of your body.",
"White scales cover you completely."},
{"Yellow scales grow over part of your body.",
"Yellow scales spread over more of your body.",
"Yellow scales cover you completely."},
{"Brown scales grow over part of your body.",
"Brown scales spread over more of your body.",
"Brown scales cover you completely."},
{"Blue scales grow over part of your body.",
"Blue scales spread over more of your body.",
"Blue scales cover you completely."},
{"Purple scales grow over part of your body.",
"Purple scales spread over more of your body.",
"Purple scales cover you completely."},
// 80
{"Speckled scales grow over part of your body.",
"Speckled scales spread over more of your body.",
"Speckled scales cover you completely."},
{"Orange scales grow over part of your body.",
"Orange scales spread over more of your body.",
"Orange scales cover you completely."},
{"Indigo scales grow over part of your body.",
"Indigo scales spread over more of your body.",
"Indigo scales cover you completely."},
{"Knobbly red scales grow over part of your body.",
"Knobbly red scales spread over more of your body.",
"Knobbly red scales cover you completely."},
{"Iridescent scales grow over part of your body.",
"Iridescent scales spread over more of your body.",
"Iridescent scales cover you completely."},
{"Patterned scales grow over part of your body.",
"Patterned scales spread over more of your body.",
"Patterned scales cover you completely."},
};
char *lose_mutation[][3] = {
{"Your skin feels delicate.", "Your skin feels delicate.",
"Your skin feels delicate."},
{"You feel weaker.", "You feel weaker.", "You feel weaker."},
{"You feel less intelligent.", "You feel less intelligent",
"You feel less intelligent"},
{"You feel clumsy.", "You feel clumsy.", "You feel clumsy."},
{"Your green scales disappear.",
"Your green scales recede somewhat.",
"Your green scales recede somewhat."},
{"Your black scales disappear.", "Your black scales recede somewhat.",
"Your black scales recede somewhat."},
{"Your grey scales disappear.", "Your grey scales recede somewhat.",
"Your grey scales recede somewhat."},
{"Your bony plates shrink away.", "Your bony plates shrink.",
"Your bony plates shrink."},
{"You feel attractive.", "You feel attractive.", "You feel attractive."},
{"You feel a little less healthy.", "You feel a little less healthy.",
"You feel a little less healthy."},
{"You feel able to eat a more balanced diet.",
"You feel able to eat a more balanced diet.",
"You feel able to eat a more balanced diet."},
{"You feel able to eat a more balanced diet.",
"You feel able to eat a more balanced diet.",
"You feel able to eat a more balanced diet."},
{"You feel hot for a moment.", "You feel hot for a moment.",
"You feel hot for a moment."},
{"You feel a sudden chill.", "You feel a sudden chill.",
"You feel a sudden chill."},
{"You feel conductive.", "You feel conductive.", "You feel conductive."},
{"Your rate of healing slows.", "Your rate of healing slows.",
"Your rate of healing slows."},
{"Your metabolism slows.", "Your metabolism slows.",
"Your metabolism slows."},
{"You feel a little hungry.", "You feel a little hungry.",
"You feel a little hungry."},
{"", "", ""}, // replaced with player::modify_stat() handling {dlb}
{"", "", ""}, // replaced with player::modify_stat() handling {dlb}
// 20
{"", "", ""}, // replaced with player::modify_stat() handling {dlb}
{"You feel random.", "You feel uncontrolled.", "You feel uncontrolled."},
{"You feel stable.", "You feel stable.", "You feel stable."},
{"You feel less resistant to magic.", "You feel less resistant to magic.",
"You feel vulnerable to magic again."},
{"You feel sluggish.", "You feel sluggish.", "You feel sluggish."},
{"Your vision seems duller.", "Your vision seems duller.",
"Your vision seems duller."},
{"Your body's shape seems more normal.",
"Your body's shape seems slightly more normal.",
"Your body's shape seems slightly more normal."},
{"You feel static.", "You feel less jumpy.", "You feel less jumpy."},
{"You feel an ache in your throat.",
"You feel an ache in your throat.", "You feel an ache in your throat."},
{"You feel slightly disorientated.", "You feel slightly disorientated.",
"You feel slightly disorientated."},
// 30
{"A chill runs up and down your throat.",
"A chill runs up and down your throat.",
"A chill runs up and down your throat."},
{"You feel a little less jumpy.", "You feel less jumpy.",
"You feel less jumpy."},
{"The horns on your head shrink away.",
"The horns on your head shrink a bit.",
"The horns on your head shrink a bit."},
{"Your muscles feel loose.", "Your muscles feel loose.",
"Your muscles feel loose."},
{"Your muscles feel sore.", "Your muscles feel sore.",
"Your muscles feel sore."},
{"You feel less disoriented.", "You feel less disoriented.",
"You feel less disoriented."},
{"Your thinking seems confused.", "Your thinking seems confused.",
"Your thinking seems confused."},
{"You feel a little more calm.", "You feel a little less angry.",
"You feel a little less angry."},
{"You feel healthier.", "You feel a little healthier.",
"You feel a little healthier."},
{"Your vision sharpens.", "Your vision sharpens a little.",
"Your vision sharpens a little."},
// 40
{"You feel genetically unstable.", "You feel genetically unstable.",
"You should not be reading this message. Bug reports to zel@olis.net.au."},
{"You feel robust.", "You feel robust.", "You feel robust."},
{"You feel frail.", "You feel frail.", "You feel frail."},
/* Some demonic powers (which can't be lost) start here... */
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
// 50
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"Your fingernails shrink to normal size.",
"Your fingernails look duller.", "Your hands feel fleshier."},
{"Your hooves expand and flesh out into feet!", "", ""},
// 60
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
{"", "", ""},
// 70
{"Your red scales disappear.", "Your red scales recede somewhat.",
"Your red scales recede somewhat."},
{"Your smooth nacreous scales disappear.",
"Your smooth nacreous scales recede somewhat.",
"Your smooth nacreous scales recede somewhat."},
{"Your ridged grey scales disappear.",
"Your ridged grey scales recede somewhat.",
"Your ridged grey scales recede somewhat."},
{"Your metallic scales disappear.",
"Your metallic scales recede somewhat.",
"Your metallic scales recede somewhat."},
{"Your black scales disappear.", "Your black scales recede somewhat.",
"Your black scales recede somewhat."},
{"Your white scales disappear.", "Your white scales recede somewhat.",
"Your white scales recede somewhat."},
{"Your yellow scales disappear.", "Your yellow scales recede somewhat.",
"Your yellow scales recede somewhat."},
{"Your brown scales disappear.", "Your brown scales recede somewhat.",
"Your brown scales recede somewhat."},
{"Your blue scales disappear.", "Your blue scales recede somewhat.",
"Your blue scales recede somewhat."},
{"Your purple scales disappear.", "Your purple scales recede somewhat.",
"Your purple scales recede somewhat."},
// 80
{"Your speckled scales disappear.",
"Your speckled scales recede somewhat.",
"Your speckled scales recede somewhat."},
{"Your orange scales disappear.", "Your orange scales recede somewhat.",
"Your orange scales recede somewhat."},
{"Your indigo scales disappear.", "Your indigo scales recede somewhat.",
"Your indigo scales recede somewhat."},
{"Your knobbly red scales disappear.",
"Your knobbly red scales recede somewhat.",
"Your knobbly red scales recede somewhat."},
{"Your iridescent scales disappear.",
"Your iridescent scales recede somewhat.",
"Your iridescent scales recede somewhat."},
{"Your patterned scales disappear.",
"Your patterned scales recede somewhat.",
"Your patterned scales recede somewhat."},
};
/*
Chance out of 10 that mutation will be given/removed randomly. 0 means never.
*/
char mutation_rarity[] = {
10, // tough skin
8, // str
8, // int
8, // dex
2, // gr scales
1, // bl scales
2, // grey scales
1, // bone
1, // repuls field
4, // res poison
// 10
5, // carn
5, // herb
4, // res fire
4, // res cold
2, // res elec
3, // regen
10, // fast meta
7, // slow meta
10, // abil loss
10, // ""
// 20
10, // ""
2, // tele control
3, // teleport
5, // res magic
1, // run
2, // see invis
8, // deformation
2, // teleport at will
8, // spit poison
3, // sense surr
// 30
4, // breathe fire
3, // blink
7, // horns
10, // strong/stiff muscles
10, // weak/loose muscles
6, // forgetfulness
6, // clarity (as the amulet)
7, // berserk/temper
10, // deterioration
10, // blurred vision
// 40
4, // resist mutation
10, // frail
5, // robust
/* Some demonic powers start here: */
0,
0,
0,
0,
0,
0,
0,
// 50
0,
0,
0,
0,
0,
0,
0,
0,
2, //jmf: claws
1, //jmf: hooves
// 60
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
// 70
2, // red scales
1, // nac scales
2, // r-grey scales
1, // metal scales
2, // black scales
2, // wh scales
2, // yel scales
2, // brown scales
2, // blue scales
2, // purple scales
// 80
2, // speckled scales
2, // orange scales
2, // indigo scales
1, // kn red scales
1, // irid scales
1, // pattern scales
0, //
0, //
0, //
0 //
};
void display_mutations(void)
{
int i;
int j = 0;
// char st_prn[5];
const char *mut_title = "Innate abilities, Weirdness & Mutations";
const int num_lines = get_number_of_lines();
#ifdef DOS_TERM
char buffer[4800];
window(1, 1, 80, 25);
gettext(1, 1, 80, 25, buffer);
#endif
clrscr();
textcolor(WHITE);
// center title
i = 40 - strlen(mut_title) / 2;
if (i<1) i=1;
gotoxy(i, 1);
cprintf(mut_title);
gotoxy(1,3);
textcolor(LIGHTBLUE); //textcolor for inborn abilities and weirdness
switch (you.species) //mv: following code shows innate abilities - if any
{
case SP_MERFOLK:
cprintf("You revert to your normal form in water." EOL);
j++;
break;
case SP_NAGA:
cprintf("You can spit poison." EOL);
cprintf("You can see invisible." EOL);
cprintf("Your system is immune to poisons." EOL);
j += 3;
break;
case SP_GNOME:
cprintf("You can sense your surroundings." EOL);
j++;
break;
case SP_TROLL:
cprintf("Your body regenerates quickly." EOL);
j++;
break;
case SP_GHOUL:
cprintf("Your body is rotting away." EOL);
cprintf("You are carnivorous." EOL);
j += 2;
break;
case SP_KOBOLD:
cprintf("You are carnivorous." EOL);
j++;
break;
case SP_GREY_ELF:
if (you.experience_level > 4)
{
cprintf("You are very charming." EOL);
j++;
}
break;
case SP_KENKU:
if (you.experience_level > 4)
{
cprintf("You can fly");
cprintf((you.experience_level > 14) ? " continuously." EOL : "."
EOL);
j++;
}
break;
case SP_MUMMY:
cprintf("You are");
cprintf((you.experience_level > 25) ? " very strongly" :
((you.experience_level > 12) ? " strongly" : ""));
cprintf(" in touch with the powers of death." EOL);
j++;
if (you.experience_level >= 12)
{
cprintf("You can restore your body by infusing magicial energy." EOL);
j++;
}
break;
case SP_GREEN_DRACONIAN:
if (you.experience_level > 6)
{
cprintf("You are resistant to poison." EOL);
cprintf("You can breathe poison." EOL);
j += 2;
}
break;
case SP_RED_DRACONIAN:
if (you.experience_level > 6)
{
cprintf("You can breathe fire." EOL);
j++;
}
if (you.experience_level > 17)
{
cprintf("You are resistant to fire." EOL);
j++;
}
break;
case SP_WHITE_DRACONIAN:
if (you.experience_level > 6)
{
cprintf("You can breathe frost." EOL);
j++;
}
if (you.experience_level > 17)
{
cprintf("You are resistant to cold." EOL);
j++;
}
break;
case SP_BLACK_DRACONIAN:
if (you.experience_level > 6)
{
cprintf("You can breathe lightning." EOL);
j++;
}
if (you.experience_level > 17)
{
cprintf("You are resistant to lightning." EOL);
j++;
}
break;
case SP_GOLDEN_DRACONIAN:
if (you.experience_level > 6)
{
cprintf("You can spit acid." EOL);
j++;
}
break;
case SP_PURPLE_DRACONIAN:
if (you.experience_level > 6)
{
cprintf("You can breathe power." EOL);
j++;
}
break;
case SP_MOTTLED_DRACONIAN:
if (you.experience_level > 6)
{
cprintf("You can breathe sticky flames." EOL);
j++;
}
break;
case SP_PALE_DRACONIAN:
if (you.experience_level > 6)
{
cprintf("You can breathe steam." EOL);
j++;
}
break;
} //end switch - innate abilities
textcolor(LIGHTGREY);
for (i = 0; i < 100; i++)
{
if (you.mutation[i] != 0)
{
j++;
textcolor(LIGHTGREY);
if (j > num_lines - 4)
{
gotoxy( 1, num_lines - 1 );
cprintf("-more-");
if (getch() == 0)
getch();
clrscr();
// center title
int x = 40 - strlen(mut_title) / 2;
if (x < 1)
x = 1;
gotoxy(x, 1);
textcolor(WHITE);
cprintf(mut_title);
textcolor(LIGHTGREY);
gotoxy(1,3);
j = 1;
}
/* mutation is actually a demonic power */
if (you.demon_pow[i] != 0)
textcolor(RED);
/* same as above, but power is enhanced by mutation */
if (you.demon_pow[i] != 0 && you.demon_pow[i] < you.mutation[i])
textcolor(LIGHTRED);
cprintf( mutation_name( i ) );
cprintf(EOL);
}
}
if (j == 0)
cprintf("You aren't a mutant." EOL);
if (getch() == 0)
getch();
#ifdef DOS_TERM
puttext(1, 1, 80, 25, buffer);
#endif
//cprintf("xxxxxxxxxxxxx");
//last_requested = 0;
return;
} // end display_mutations()
bool mutate(int which_mutation, bool failMsg)
{
char mutat = which_mutation;
bool force_mutation = false; // is mutation forced?
if (which_mutation >= 1000) // must give mutation without failure
{
force_mutation = true;
mutat -= 1000;
which_mutation -= 1000;
}
//char st_prn [10];
// Undead bodies don't mutate, they fall apart. -- bwr
if (you.is_undead && (force_mutation || !one_chance_in(5)))
{
mpr( "Your body decomposes!" );
if (coinflip())
lose_stat( STAT_RANDOM, 1 );
else
{
ouch( 3, 0, KILLED_BY_ROTTING );
rot_hp( roll_dice( 1, 3 ) );
}
return (true);
}
if (wearing_amulet(AMU_RESIST_MUTATION)
&& !force_mutation && !one_chance_in(10))
{
if (failMsg)
mpr("You feel odd for a moment.");
return false;
}
if (you.mutation[MUT_MUTATION_RESISTANCE]
&& !force_mutation
&& (you.mutation[MUT_MUTATION_RESISTANCE] == 3 || !one_chance_in(3)))
{
if (failMsg)
mpr("You feel odd for a moment.");
return false;
}
if (which_mutation == 100 && random2(15) < how_mutated())
{
if (!force_mutation && !one_chance_in(3))
return false;
else
return delete_mutation(100);
}
if (which_mutation == 100)
{
do
{
mutat = random2(NUM_MUTATIONS);
if (one_chance_in(1000))
return false;
}
while ((you.mutation[mutat] >= 3
&& (mutat != MUT_STRONG && mutat != MUT_CLEVER
&& mutat != MUT_AGILE) && (mutat != MUT_WEAK
&& mutat != MUT_DOPEY
&& mutat != MUT_CLUMSY))
|| you.mutation[mutat] > 13
|| random2(10) >= mutation_rarity[mutat]);
}
if (you.mutation[mutat] >= 3
&& (mutat != MUT_STRONG && mutat != MUT_CLEVER && mutat != MUT_AGILE)
&& (mutat != MUT_WEAK && mutat != MUT_DOPEY && mutat != MUT_CLUMSY))
{
return false;
}
if (you.mutation[mutat] > 13 && !force_mutation)
return false;
// These can be forced by demonspawn
if ((mutat == MUT_TOUGH_SKIN
|| (mutat >= MUT_GREEN_SCALES && mutat <= MUT_BONEY_PLATES)
|| (mutat >= MUT_RED_SCALES && mutat <= MUT_PATTERNED_SCALES))
&& body_covered() >= 3 && !force_mutation)
{
return false;
}
if (mutat == MUT_HORNS && you.species == SP_MINOTAUR)
return false;
// nagas have see invis and res poison and can spit poison
if (you.species == SP_NAGA)
{
if (mutat == MUT_ACUTE_VISION || mutat == MUT_POISON_RESISTANCE)
return false;
// gdl: spit poison 'upgrades' to breathe poison. Why not..
if (mutat == MUT_SPIT_POISON)
{
if (coinflip())
mutat = MUT_BREATHE_POISON;
else
return false;
}
}
if (you.species == SP_GNOME && mutat == MUT_MAPPING)
return false; /* gnomes can't sense surroundings */
// spriggans already run at max speed (centaurs can get a bit faster)
if (you.species == SP_SPRIGGAN && mutat == MUT_FAST)
return false;
// this might have issues if we allowed it -- bwr
if (you.species == SP_KOBOLD
&& (mutat == MUT_CARNIVOROUS || mutat == MUT_HERBIVOROUS))
{
return (false);
}
// This one can be forced by demonspawn
if (mutat == MUT_REGENERATION
&& you.mutation[MUT_SLOW_METABOLISM] > 0 && !force_mutation)
{
return false; /* if you have a slow metabolism, no regen */
}
if (mutat == MUT_SLOW_METABOLISM && you.mutation[MUT_REGENERATION] > 0)
return false; /* if you have a slow metabolism, no regen */
// This one can be forced by demonspawn
if (mutat == MUT_ACUTE_VISION
&& you.mutation[MUT_BLURRY_VISION] > 0 && !force_mutation)
{
return false;
}
if (mutat == MUT_BLURRY_VISION && you.mutation[MUT_ACUTE_VISION] > 0)
return false; /* blurred vision/see invis */
//jmf: added some checks for new mutations
if (mutat == MUT_STINGER
&& !(you.species == SP_NAGA || player_genus(GENPC_DRACONIAN)))
{
return false;
}
// putting boots on after they are forced off. -- bwr
if (mutat == MUT_HOOVES
&& (you.species == SP_NAGA || you.species == SP_CENTAUR
|| you.species == SP_KENKU || player_genus(GENPC_DRACONIAN)))
{
return false;
}
// Preventing big wings since I doubt they work -- bwr
if (mutat == MUT_BIG_WINGS) // && !player_genus(GENPC_DRACONIAN))
return false;
//jmf: added some checks for new mutations
mpr("You mutate.", MSGCH_MUTATION);
// find where these things are actually changed
// -- do not globally force redraw {dlb}
you.redraw_hit_points = 1;
you.redraw_magic_points = 1;
you.redraw_armour_class = 1;
you.redraw_evasion = 1;
you.redraw_experience = 1;
you.redraw_gold = 1;
//you.redraw_hunger = 1;
switch (mutat)
{
case MUT_STRONG:
if (you.mutation[MUT_WEAK] > 0)
{
delete_mutation(MUT_WEAK);
return true;
}
// replaces earlier, redundant code - 12mar2000 {dlb}
modify_stat(STAT_STRENGTH, 1, false);
break;
case MUT_CLEVER:
if (you.mutation[MUT_DOPEY] > 0)
{
delete_mutation(MUT_DOPEY);
return true;
}
// replaces earlier, redundant code - 12mar2000 {dlb}
modify_stat(STAT_INTELLIGENCE, 1, false);
break;
case MUT_AGILE:
if (you.mutation[MUT_CLUMSY] > 0)
{
delete_mutation(MUT_CLUMSY);
return true;
}
// replaces earlier, redundant code - 12mar2000 {dlb}
modify_stat(STAT_DEXTERITY, 1, false);
break;
case MUT_WEAK:
if (you.mutation[MUT_STRONG] > 0)
{
delete_mutation(MUT_STRONG);
return true;
}
modify_stat(STAT_STRENGTH, -1, true);
mpr(gain_mutation[mutat][0], MSGCH_MUTATION);
break;
case MUT_DOPEY:
if (you.mutation[MUT_CLEVER] > 0)
{
delete_mutation(MUT_CLEVER);
return true;
}
modify_stat(STAT_INTELLIGENCE, -1, true);
mpr(gain_mutation[mutat][0], MSGCH_MUTATION);
break;
case MUT_CLUMSY:
if (you.mutation[MUT_AGILE] > 0)
{
delete_mutation(MUT_AGILE);
return true;
}
modify_stat(STAT_DEXTERITY, -1, true);
mpr(gain_mutation[mutat][0], MSGCH_MUTATION);
break;
case MUT_REGENERATION:
if (you.mutation[MUT_SLOW_METABOLISM] > 0)
{
// Should only get here from demonspawn, where our innate
// ability will clear away the counter-mutation.
while (delete_mutation(MUT_SLOW_METABOLISM))
;
}
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_ACUTE_VISION:
if (you.mutation[MUT_BLURRY_VISION] > 0)
{
// Should only get here from demonspawn, where our inate
// ability will clear away the counter-mutation.
while (delete_mutation(MUT_BLURRY_VISION))
;
}
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_CARNIVOROUS:
if (you.mutation[MUT_HERBIVOROUS] > 0)
{
delete_mutation(MUT_HERBIVOROUS);
return true;
}
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_HERBIVOROUS:
if (you.mutation[MUT_CARNIVOROUS] > 0)
{
delete_mutation(MUT_CARNIVOROUS);
return true;
}
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_SHOCK_RESISTANCE:
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_FAST_METABOLISM:
if (you.mutation[MUT_SLOW_METABOLISM] > 0)
{
delete_mutation(MUT_SLOW_METABOLISM);
return true;
}
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_SLOW_METABOLISM:
if (you.mutation[MUT_FAST_METABOLISM] > 0)
{
delete_mutation(MUT_FAST_METABOLISM);
return true;
}
//if (you.mutation[mutat] == 0 || you.mutation[mutat] == 2)
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_TELEPORT_CONTROL:
you.attribute[ATTR_CONTROL_TELEPORT]++;
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_HOOVES: //jmf: like horns
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
if (you.equip[EQ_BOOTS] != -1)
{
FixedVector < char, 8 > removed;
for (int i = EQ_WEAPON; i < EQ_RIGHT_RING; i++)
{
removed[i] = 0;
}
removed[EQ_BOOTS] = 1;
remove_equipment(removed);
}
break;
case MUT_CLAWS:
mpr( gain_mutation[ mutat ][ you.mutation[mutat] ], MSGCH_MUTATION );
// gloves aren't prevented until level three
if (you.mutation[ mutat ] >= 3 && you.equip[ EQ_GLOVES ] != -1)
{
FixedVector < char, 8 > removed;
for (int i = EQ_WEAPON; i < EQ_RIGHT_RING; i++)
{
removed[i] = 0;
}
removed[ EQ_GLOVES ] = 1;
remove_equipment( removed );
}
break;
case MUT_HORNS: // horns force your helmet off
{
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
if (you.equip[EQ_HELMET] != -1
&& you.inv[you.equip[EQ_HELMET]].plus2 > 1)
{
break; // horns don't push caps/wizard hats off
}
FixedVector < char, 8 > removed;
for (int i = EQ_WEAPON; i < EQ_RIGHT_RING; i++)
{
removed[i] = 0;
}
removed[EQ_HELMET] = 1;
remove_equipment(removed);
}
break;
case MUT_STRONG_STIFF:
if (you.mutation[MUT_FLEXIBLE_WEAK] > 0)
{
delete_mutation(MUT_FLEXIBLE_WEAK);
return true;
}
modify_stat(STAT_STRENGTH, 1, true);
modify_stat(STAT_DEXTERITY, -1, true);
mpr(gain_mutation[mutat][0], MSGCH_MUTATION);
break;
case MUT_FLEXIBLE_WEAK:
if (you.mutation[MUT_STRONG_STIFF] > 0)
{
delete_mutation(MUT_STRONG_STIFF);
return true;
}
modify_stat(STAT_STRENGTH, -1, true);
modify_stat(STAT_DEXTERITY, 1, true);
mpr(gain_mutation[mutat][0], MSGCH_MUTATION);
break;
case MUT_FRAIL:
if (you.mutation[MUT_ROBUST] > 0)
{
delete_mutation(MUT_ROBUST);
return true;
}
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
you.mutation[mutat]++;
calc_hp();
return true;
case MUT_ROBUST:
if (you.mutation[MUT_FRAIL] > 0)
{
delete_mutation(MUT_FRAIL);
return true;
}
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
you.mutation[mutat]++;
calc_hp();
return true;
case MUT_BLACK_SCALES:
case MUT_BONEY_PLATES:
modify_stat(STAT_DEXTERITY, -1, true);
// deliberate fall-through
default:
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_GREY2_SCALES:
if (you.mutation[mutat] != 1)
modify_stat(STAT_DEXTERITY, -1, true);
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_METALLIC_SCALES:
if (you.mutation[mutat] == 0)
modify_stat(STAT_DEXTERITY, -2, true);
else
modify_stat(STAT_DEXTERITY, -1, true);
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
case MUT_RED2_SCALES:
case MUT_YELLOW_SCALES:
if (you.mutation[mutat] != 0)
modify_stat(STAT_DEXTERITY, -1, true);
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
break;
}
you.mutation[mutat]++;
/* remember, some mutations don't get this far (eg frail) */
return true;
} // end mutation()
int how_mutated(void)
{
int j = 0;
for (int i = 0; i < 100; i++)
{
if (you.demon_pow[i] < you.mutation[i])
j += you.mutation[i];
}
return j;
} // end how_mutated()
bool delete_mutation(char which_mutation)
{
char mutat = which_mutation;
if (you.mutation[MUT_MUTATION_RESISTANCE] > 1
&& (you.mutation[MUT_MUTATION_RESISTANCE] == 3 || coinflip()))
{
mpr("You feel rather odd for a moment.");
return false;
}
if (which_mutation == 100)
{
do
{
mutat = random2(NUM_MUTATIONS);
if (one_chance_in(1000))
return false;
}
while ((you.mutation[mutat] == MUT_TOUGH_SKIN
&& (mutat != MUT_STRONG && mutat != MUT_CLEVER
&& mutat != MUT_AGILE) && (mutat != MUT_WEAK
&& mutat != MUT_DOPEY
&& mutat != MUT_CLUMSY))
|| random2(10) >= mutation_rarity[mutat]
|| you.demon_pow[mutat] >= you.mutation[mutat]);
}
if (you.mutation[mutat] == 0)
return false;
if (you.demon_pow[mutat] >= you.mutation[mutat])
return false;
mpr("You mutate.", MSGCH_MUTATION);
switch (mutat)
{
case MUT_STRONG:
/*
if ( you.mutation [MUT_WEAK] > 0 )
{
mutate(MUT_WEAK);
break;
}
*/
modify_stat(STAT_STRENGTH, -1, true);
mpr(lose_mutation[mutat][0], MSGCH_MUTATION);
break;
case MUT_CLEVER:
/*
if ( you.mutation [MUT_DOPEY] > 0 )
{
mutate(MUT_DOPEY);
break;
}
*/
modify_stat(STAT_INTELLIGENCE, -1, true);
mpr(lose_mutation[mutat][0], MSGCH_MUTATION);
break;
case MUT_AGILE:
/*
if ( you.mutation [MUT_CLUMSY] > 0 )
{
mutate(MUT_CLUMSY);
break;
}
*/
modify_stat(STAT_DEXTERITY, -1, true);
mpr(lose_mutation[mutat][0], MSGCH_MUTATION);
break;
case MUT_WEAK:
/*
if ( you.mutation [MUT_STRONG] > 0 )
{
mutate(MUT_STRONG);
break;
}
*/
// replaces earlier, redundant code - 12mar2000 {dlb}
modify_stat(STAT_STRENGTH, 1, false);
break;
case MUT_DOPEY:
/*
if ( you.mutation [MUT_CLEVER] > 0 )
{
mutate(MUT_CLEVER);
break;
}
*/
// replaces earlier, redundant code - 12mar2000 {dlb}
modify_stat(STAT_INTELLIGENCE, 1, false);
break;
case MUT_CLUMSY:
/*
if ( you.mutation [MUT_AGILE] > 0 )
{
mutate(MUT_AGILE);
break;
}
*/
// replaces earlier, redundant code - 12mar2000 {dlb}
modify_stat(STAT_DEXTERITY, 1, false);
break;
case MUT_SHOCK_RESISTANCE:
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
break;
case MUT_FAST_METABOLISM:
/*
if ( you.mutation [MUT_SLOW_METABOLISM] > 0 )
{
mutate(MUT_SLOW_METABOLISM);
break;
}
*/
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
break;
case MUT_SLOW_METABOLISM:
/*
if ( you.mutation [MUT_FAST_METABOLISM] > 0 )
{
mutate(MUT_FAST_METABOLISM);
break;
}
*/
//if ( you.mutation[mutat] == 1 || you.mutation[mutat] == 3 )
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
break;
case MUT_TELEPORT_CONTROL:
you.attribute[ATTR_CONTROL_TELEPORT]--;
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
break;
case MUT_STRONG_STIFF:
modify_stat(STAT_STRENGTH, -1, true);
modify_stat(STAT_DEXTERITY, 1, true);
mpr(lose_mutation[mutat][0], MSGCH_MUTATION);
break;
case MUT_FLEXIBLE_WEAK:
modify_stat(STAT_STRENGTH, 1, true);
modify_stat(STAT_DEXTERITY, -1, true);
mpr(lose_mutation[mutat][0], MSGCH_MUTATION);
break;
case MUT_FRAIL:
mpr(lose_mutation[mutat][0], MSGCH_MUTATION);
if (you.mutation[mutat] > 0)
you.mutation[mutat]--;
calc_hp();
return true;
case MUT_ROBUST:
mpr(lose_mutation[mutat][0], MSGCH_MUTATION);
if (you.mutation[mutat] > 0)
you.mutation[mutat]--;
calc_hp();
return true;
case MUT_BLACK_SCALES:
case MUT_BONEY_PLATES:
modify_stat(STAT_DEXTERITY, 1, true);
default:
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
break;
case MUT_GREY2_SCALES:
if (you.mutation[mutat] != 2)
modify_stat(STAT_DEXTERITY, 1, true);
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
break;
case MUT_METALLIC_SCALES:
if (you.mutation[mutat] == 1)
modify_stat(STAT_DEXTERITY, 2, true);
else
modify_stat(STAT_DEXTERITY, 1, true);
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
break;
case MUT_RED2_SCALES:
case MUT_YELLOW_SCALES:
if (you.mutation[mutat] != 1)
modify_stat(STAT_DEXTERITY, 1, true);
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
break;
}
// find where these things are actually altered
/// -- do not globally force redraw {dlb}
you.redraw_hit_points = 1;
you.redraw_magic_points = 1;
you.redraw_armour_class = 1;
you.redraw_evasion = 1;
you.redraw_experience = 1;
you.redraw_gold = 1;
//you.redraw_hunger = 1;
if (you.mutation[mutat] > 0)
you.mutation[mutat]--;
return true;
} // end delete_mutation()
char body_covered(void)
{
/* checks how much of your body is covered by scales etc */
char covered = 0;
if (you.species == SP_NAGA)
covered++;
if (player_genus(GENPC_DRACONIAN))
return 3;
covered += you.mutation[MUT_TOUGH_SKIN];
covered += you.mutation[MUT_GREEN_SCALES];
covered += you.mutation[MUT_BLACK_SCALES];
covered += you.mutation[MUT_GREY_SCALES];
covered += you.mutation[MUT_BONEY_PLATES];
covered += you.mutation[MUT_RED_SCALES];
covered += you.mutation[MUT_NACREOUS_SCALES];
covered += you.mutation[MUT_GREY2_SCALES];
covered += you.mutation[MUT_METALLIC_SCALES];
covered += you.mutation[MUT_BLACK2_SCALES];
covered += you.mutation[MUT_WHITE_SCALES];
covered += you.mutation[MUT_YELLOW_SCALES];
covered += you.mutation[MUT_BROWN_SCALES];
covered += you.mutation[MUT_BLUE_SCALES];
covered += you.mutation[MUT_PURPLE_SCALES];
covered += you.mutation[MUT_SPECKLED_SCALES];
covered += you.mutation[MUT_ORANGE_SCALES];
covered += you.mutation[MUT_INDIGO_SCALES];
covered += you.mutation[MUT_RED2_SCALES];
covered += you.mutation[MUT_IRIDESCENT_SCALES];
covered += you.mutation[MUT_PATTERNED_SCALES];
return covered;
}
char *mutation_name( char which_mutat, int level )
{
char st_prn[5];
// level == -1 means default action of current level
if (level == -1)
level = you.mutation[ which_mutat ];
if (which_mutat == MUT_STRONG || which_mutat == MUT_CLEVER
|| which_mutat == MUT_AGILE || which_mutat == MUT_WEAK
|| which_mutat == MUT_DOPEY || which_mutat == MUT_CLUMSY)
{
strcpy( mut_string, mutation_descrip[ which_mutat ][0] );
itoa( level, st_prn, 10 );
strcat( mut_string, st_prn );
strcat( mut_string, ")." );
return (mut_string);
}
// Some mutations only have one "level", and it's better
// to show the first level description than a blank description.
if (mutation_descrip[ which_mutat ][ level - 1 ][0] == '\0')
return (mutation_descrip[ which_mutat ][ 0 ]);
else
return (mutation_descrip[ which_mutat ][ level - 1 ]);
} // end mutation_name()
/* Use an attribute counter for how many demonic mutations a dspawn has */
void demonspawn(void)
{
int whichm = -1;
char howm = 1;
int counter = 0;
const int scale_levels = body_covered();
you.attribute[ATTR_NUM_DEMONIC_POWERS]++;
mpr("Your demonic ancestry asserts itself...", MSGCH_INTRINSIC_GAIN);
if (you.experience_level < 10)
{
do
{
if (!you.skills[SK_CONJURATIONS])
{ /* conjurers don't get throw fr/fl */
whichm = coinflip()? MUT_THROW_FLAMES : MUT_THROW_FROST;
howm = 1;
}
if (!you.skills[SK_SUMMONINGS] && one_chance_in(3))
{ /* summoners don't get summon imp */
whichm = MUT_SUMMON_MINOR_DEMONS;
howm = 1;
}
if (one_chance_in(4))
{
whichm = MUT_POISON_RESISTANCE;
howm = 1;
}
if (one_chance_in(4))
{
whichm = MUT_COLD_RESISTANCE;
howm = 1;
}
if (one_chance_in(4))
{
whichm = MUT_HEAT_RESISTANCE;
howm = 1;
}
if (one_chance_in(5))
{
whichm = MUT_ACUTE_VISION;
howm = 1;
}
if (one_chance_in(7))
{
whichm = MUT_SPIT_POISON;
howm = 1;
}
if (one_chance_in(10))
{
whichm = MUT_MAPPING;
howm = 3;
}
if (one_chance_in(12))
{
whichm = MUT_TELEPORT_CONTROL;
howm = 1;
}
if (one_chance_in(5))
{
whichm = MUT_BREATHE_FLAMES;
howm = 2;
}
if (one_chance_in(12))
{
whichm = MUT_BLINK;
howm = 1;
}
if (one_chance_in(10) && scale_levels < 3)
{
whichm = MUT_TOUGH_SKIN;
howm = (coinflip() ? 2 : 3);
howm = MINIMUM( 3 - scale_levels, howm );
}
if (one_chance_in(24) && scale_levels < 3)
{
whichm = MUT_GREEN_SCALES;
howm = (coinflip() ? 2 : 3);
howm = MINIMUM( 3 - scale_levels, howm );
}
if (one_chance_in(24) && scale_levels < 3)
{
whichm = MUT_BLACK_SCALES;
howm = (coinflip() ? 2 : 3);
howm = MINIMUM( 3 - scale_levels, howm );
}
if (one_chance_in(24) && scale_levels < 3)
{
whichm = MUT_GREY_SCALES;
howm = (coinflip() ? 2 : 3);
howm = MINIMUM( 3 - scale_levels, howm );
}
if (one_chance_in(12) && scale_levels < 3)
{
whichm = MUT_RED_SCALES + random2(16);
switch (whichm)
{
case MUT_RED_SCALES:
case MUT_NACREOUS_SCALES:
case MUT_BLACK2_SCALES:
case MUT_WHITE_SCALES:
case MUT_BLUE_SCALES:
case MUT_SPECKLED_SCALES:
case MUT_ORANGE_SCALES:
case MUT_IRIDESCENT_SCALES:
case MUT_PATTERNED_SCALES:
howm = (coinflip() ? 2 : 3);
break;
default:
howm = (coinflip() ? 2 : 1);
break;
}
howm = MINIMUM( 3 - scale_levels, howm );
}
if (one_chance_in(30) && scale_levels < 3)
{
whichm = MUT_BONEY_PLATES;
howm = (coinflip() ? 1 : 2);
howm = MINIMUM( 3 - scale_levels, howm );
}
if (one_chance_in(25))
{
whichm = MUT_REPULSION_FIELD;
howm = (coinflip() ? 2 : 3);
}
if (one_chance_in(5))
{
whichm = MUT_HORNS;
howm = (coinflip() ? 1 : 2);
if (you.experience_level > 4)
howm = (coinflip()? 2 : 3);
}
if (whichm != -1 && you.mutation[whichm] != 0)
whichm = -1;
counter++;
}
while (whichm == -1 && counter < 5000);
if (whichm == -1) /* unlikely but remotely possible */
{
/* I know this is a cop-out */
modify_stat(STAT_STRENGTH, 1, true);
modify_stat(STAT_INTELLIGENCE, 1, true);
modify_stat(STAT_DEXTERITY, 1, true);
mpr("You feel much better now.", MSGCH_INTRINSIC_GAIN);
return;
}
else if (perma_mutate(whichm, howm))
{
return;
}
}
do
{
if (you.skills[SK_CONJURATIONS] < 3)
{ // good conjurers don't get bolt of draining
whichm = MUT_SMITE;
howm = 1;
}
if (you.skills[SK_CONJURATIONS] < 4 && one_chance_in(4))
{ // good conjurers don't get hellfire
whichm = MUT_HURL_HELLFIRE;
howm = 1;
}
if (you.skills[SK_SUMMONINGS] < 3 && one_chance_in(3))
{ // good summoners don't get summon demon
whichm = MUT_SUMMON_DEMONS;
howm = 1;
}
if (one_chance_in(8))
{
whichm = MUT_MAGIC_RESISTANCE;
howm = 3;
}
if (one_chance_in(12))
{
whichm = MUT_FAST;
howm = 1;
}
if (one_chance_in(7))
{
whichm = MUT_TELEPORT_AT_WILL;
howm = 2;
}
if (one_chance_in(10))
{
whichm = MUT_REGENERATION;
howm = (coinflip() ? 3 : 2);
}
if (one_chance_in(12))
{
whichm = MUT_SHOCK_RESISTANCE;
howm = 1;
}
if (!you.mutation[MUT_CALL_TORMENT] && one_chance_in(15))
{
whichm = MUT_TORMENT_RESISTANCE;
howm = 1;
}
if (one_chance_in(12))
{
whichm = MUT_NEGATIVE_ENERGY_RESISTANCE;
howm = 1 + random2(3);
}
if (!you.mutation[MUT_TORMENT_RESISTANCE] && one_chance_in(20))
{
whichm = MUT_CALL_TORMENT;
howm = 1;
}
if (you.skills[SK_SUMMONINGS] < 3 && you.skills[SK_NECROMANCY] < 3
&& one_chance_in(12))
{
whichm = MUT_CONTROL_DEMONS;
howm = 1;
}
if (you.skills[SK_TRANSLOCATIONS] < 3 && one_chance_in(15))
{
whichm = MUT_PANDEMONIUM;
howm = 1;
}
if (you.religion != GOD_VEHUMET && one_chance_in(11))
{
whichm = MUT_DEATH_STRENGTH;
howm = 1;
}
if (you.religion != GOD_VEHUMET && one_chance_in(11))
{
whichm = MUT_CHANNEL_HELL;
howm = 1;
}
if (you.skills[SK_SUMMONINGS] < 3 && you.skills[SK_NECROMANCY] < 3
&& one_chance_in(10))
{
whichm = MUT_RAISE_DEAD;
howm = 1;
}
if (you.skills[SK_UNARMED_COMBAT] > 5 && one_chance_in(14))
{
whichm = MUT_DRAIN_LIFE;
howm = 1;
}
if (whichm != -1 && you.mutation[whichm] != 0)
whichm = -1;
counter++;
}
while (whichm == -1 && counter < 5000);
if (whichm == -1 || !perma_mutate(whichm, howm))
{
/* unlikely but remotely possible */
/* I know this is a cop-out */
modify_stat(STAT_STRENGTH, 1, true);
modify_stat(STAT_INTELLIGENCE, 1, true);
modify_stat(STAT_DEXTERITY, 1, true);
mpr("You feel much better now.", MSGCH_INTRINSIC_GAIN);
}
} // end demonspawn()
bool perma_mutate(int which_mut, char how_much)
{
char ret = 0;
if (mutate(which_mut + 1000))
ret++;
if (how_much >= 2 && mutate(which_mut + 1000))
ret++;
if (how_much >= 3 && mutate(which_mut + 1000))
ret++;
you.demon_pow[which_mut] = ret;
if (ret > 0)
return true;
else
return false;
} // end perma_mutate()
bool give_good_mutation(bool failMsg)
{
int temp_rand = 0; // probability determination {dlb}
int which_good_one = 0;
temp_rand = random2(25);
which_good_one = ((temp_rand >= 24) ? MUT_TOUGH_SKIN :
(temp_rand == 23) ? MUT_STRONG :
(temp_rand == 22) ? MUT_CLEVER :
(temp_rand == 21) ? MUT_AGILE :
(temp_rand == 20) ? MUT_HEAT_RESISTANCE :
(temp_rand == 19) ? MUT_COLD_RESISTANCE :
(temp_rand == 18) ? MUT_SHOCK_RESISTANCE :
(temp_rand == 17) ? MUT_REGENERATION :
(temp_rand == 16) ? MUT_TELEPORT_CONTROL :
(temp_rand == 15) ? MUT_MAGIC_RESISTANCE :
(temp_rand == 14) ? MUT_FAST :
(temp_rand == 13) ? MUT_ACUTE_VISION :
(temp_rand == 12) ? MUT_GREEN_SCALES :
(temp_rand == 11) ? MUT_BLACK_SCALES :
(temp_rand == 10) ? MUT_GREY_SCALES :
(temp_rand == 9) ? MUT_BONEY_PLATES :
(temp_rand == 8) ? MUT_REPULSION_FIELD :
(temp_rand == 7) ? MUT_POISON_RESISTANCE :
(temp_rand == 6) ? MUT_TELEPORT_AT_WILL :
(temp_rand == 5) ? MUT_SPIT_POISON :
(temp_rand == 4) ? MUT_MAPPING :
(temp_rand == 3) ? MUT_BREATHE_FLAMES :
(temp_rand == 2) ? MUT_BLINK :
(temp_rand == 1) ? MUT_CLARITY
: MUT_ROBUST);
return (mutate(which_good_one, failMsg));
} // end give_good_mutation()
bool give_bad_mutation(bool forceMutation, bool failMsg)
{
int temp_rand = 0; // probability determination {dlb}
int which_bad_one = 0;
temp_rand = random2(12);
which_bad_one = ((temp_rand >= 11) ? MUT_CARNIVOROUS :
(temp_rand == 10) ? MUT_HERBIVOROUS :
(temp_rand == 9) ? MUT_FAST_METABOLISM :
(temp_rand == 8) ? MUT_WEAK :
(temp_rand == 7) ? MUT_DOPEY :
(temp_rand == 6) ? MUT_CLUMSY :
(temp_rand == 5) ? MUT_TELEPORT :
(temp_rand == 4) ? MUT_DEFORMED :
(temp_rand == 3) ? MUT_LOST :
(temp_rand == 2) ? MUT_DETERIORATION :
(temp_rand == 1) ? MUT_BLURRY_VISION
: MUT_FRAIL);
if (forceMutation)
which_bad_one += 1000;
return (mutate(which_bad_one), failMsg);
} // end give_bad_mutation()
//jmf: might be useful somewhere (eg Xom or transmigration effect)
bool give_cosmetic_mutation()
{
int mutation = -1;
int how_much = 0;
int counter = 0;
do
{
mutation = MUT_DEFORMED;
how_much = 1 + random2(3);
if (one_chance_in(6))
{
mutation = MUT_ROBUST;
how_much = 1 + random2(3);
}
if (one_chance_in(6))
{
mutation = MUT_FRAIL;
how_much = 1 + random2(3);
}
if (one_chance_in(5))
{
mutation = MUT_TOUGH_SKIN;
how_much = 1 + random2(3);
}
if (one_chance_in(4))
{
mutation = MUT_CLAWS;
how_much = 1 + random2(3);
}
if (you.species != SP_CENTAUR && you.species != SP_NAGA
&& you.species != SP_KENKU && !player_genus(GENPC_DRACONIAN)
&& one_chance_in(5))
{
mutation = MUT_HOOVES;
how_much = 1;
}
#if 0
// don't think this works -- bwr
if (player_genus(GENPC_DRACONIAN) && one_chance_in(5))
{
mutation = MUT_BIG_WINGS;
how_much = 1;
}
#endif
if (one_chance_in(5))
{
mutation = MUT_CARNIVOROUS;
how_much = 1 + random2(3);
}
if (one_chance_in(6))
{
mutation = MUT_HORNS;
how_much = 1 + random2(3);
}
if ((you.species == SP_NAGA || player_genus(GENPC_DRACONIAN))
&& one_chance_in(4))
{
mutation = MUT_STINGER;
how_much = 1 + random2(3);
}
if (you.species == SP_NAGA && one_chance_in(6))
{
mutation = MUT_BREATHE_POISON;
how_much = 1;
}
if (!(you.species == SP_NAGA || player_genus(GENPC_DRACONIAN))
&& one_chance_in(7))
{
mutation = MUT_SPIT_POISON;
how_much = 1;
}
if (!(you.species == SP_NAGA || player_genus(GENPC_DRACONIAN))
&& one_chance_in(8))
{
mutation = MUT_BREATHE_FLAMES;
how_much = 1 + random2(3);
}
if (you.mutation[mutation] > 0)
how_much -= you.mutation[mutation];
if (how_much < 0)
how_much = 0;
}
while (how_much == 0 && counter++ < 5000);
if (how_much != 0)
return mutate(mutation);
else
return false;
} // end give_cosmetic_mutation()
|