Spaces:
Runtime error
Runtime error
File size: 64,013 Bytes
3b8d454 |
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 |
var preArr = ["脱裤子","卖屁股","擦屁股","提裤子","画大饼","吹水管","秋名山飙车","进入坦克","弹鸡鸡","扭屁屁","卖假货"];
var nameArr = ["卡贼","空心菜","楠楠","毛哥","修罗","黑往事"];
var endArr = ["雅蠛蝶","本次消费打五折","其实我是处男……座","再来一个客户","我要打10个","奥利给","今晚消费由我买单"];
function randomTip(){
var p1 = preArr[Math.round(Math.random()*preArr.length)];
var p2 = nameArr[Math.round(Math.random()*nameArr.length)];
var p3 = endArr[Math.round(Math.random()*endArr.length)];
return "正在" + (p1 ? p1 : preArr[0]) + "的" + (p2 ? p2 : nameArr[0]) + ",忽然来了一句:" +(p3 ? p3:endArr[0]);
}
//技能释放条件
var skillCondition = {
"1":"生命值",//使用者生命值
"2":"法力值",//使用者法力值
"3":"生命比例",//使用者生命比例
"4":"使用者法力比例",//使用者法力比例
"50":"宠物等级",//使用者的实际等级,宠物有效
"51":"境界",//使用者的境界等级
"52":"技能等级",//技能本身的等级
"53":"装备的武器类型",//装备的武器类型
"54":"当前激活的内功",//当前激活的内功ID
"55":"施法者拥有Buff",//施法者是否拥有指定BUFF
"56":"拥有Buff",//当前目标是否拥有指定BUFF
"57":"身上穿戴装备",//身上是否穿着指定装备
"58":"当前宠物",//当前宠物是否特定类型
"59":"属性",//使用者指定属性大于等于指定属性
"60":"左手为空",//使用者左手为空
"61":"派遣宠物类型为什么宠物(只适用于蛮荒)",//派遣宠物类型为什么宠物(只适用于蛮荒)
"62":"本次蛮荒触发事件的次数大于等于多少次(只适用于蛮荒)",//本次蛮荒触发事件的次数小于多少次(只适用于蛮荒)
"63":"本次蛮荒触发事件的次数小于多少次(只适用于蛮荒)",//本次蛮荒触发事件的次数小于多少次(只适用于蛮荒)
};
//技能施放目标,仆从目前不包含宠物,队友为玩家和宠物
var skillTarget = {
"0":"敌人",//随机敌人
"1":"敌人",//全部敌人
"2":"自己",
"3":"拥有者",
"4":"宠物",//随机仆从,不包含自己,目前仅限宠物
"5":"宠物",//全部仆从,也就是宠物,目前只支持1只宠物出战
"6":"随机队友 ",
"7":"全部队友 ",
"10":"血量最低的队友",
"11":"阵亡的队友",
"20":"攻击者"
};
var updateTarget = {
"82":"技能等级",
"83":"宠物等级",
"85":"人物境界"
};
//人物技能类型
var roleSkillType = {
"0":"功法",
"1":"武技",
"2":"仙法",
"3":"生活",
"4":"宠物技能",
};
//五行
var wuxing = {
"0":"普通",
"1":"金",
"2":"木",
"3":"水",
"4":"火",
"5":"土",
"6":"混沌",
};
//触发
var chufa = {
"0":"被动",
"1":"主动",//攻击时触发
"2":"主动",//防御时触发
};
var updateLevelType = {
"0":{
"0":"修为",
"1":"修为",
"2":"修为",
"3":"修为",
"4":"修为",
},
"1":{
"0":"历练",
"1":"熟练度",
"2":"熟练度",
"3":"熟练度",
"4":"熟练度",
}
};
//物品类型
var itemTypeData = {
"0":{
"name":"装备",
},
"1":{
"name":"消耗品",
"0":"人物增加修为的丹药",
"3":"提升境界的辅助丹药",
"4":"人物提升境界的丹药",
"5":"可开启的箱子",
"6":"宠物服用的丹药",
"7":"人物提升灵根的丹药",
"9":"人物提升基础属性的丹药",
"11":"宠物领悟技能的丹药",
"12":"宠物提升亲密度的丹药",
"13":"宠物遗忘技能的丹药",
"14":"地图门票",
"15":"人物转生的丹药",
"16":"宠物取消领悟技能的丹药",
"17":"人物增加寿命或修为的丹药",
"18":"宠物减少等级的丹药",
"19":"法宝提高魂力的丹药",
"20":"人物减少寿命的丹药",
"21":"鬼修重入轮回的丹药",
"22":"种植or配方",
"23":"变更境界的丹药",
"26":"人物增加灵根的丹药",
"27":"增加宠物献祭值",
"28":"人物减少寿命的丹药",
"29":"人物增加六围的丹药"
},
"2":{
"name":"材料",
"0":"不可直接使用的成品",
"1":"可炼制的材料",
"2":"可直接使用的成品",
"4":"蛮荒食物",
"5":"洞府灵物"
},
"3":{
"name":"书卷",
"0":"人物用书卷",
"1":"突破技能等级书卷",
"2":"进阶技能书卷",
"3":"宠物用书卷",
}
};
//从分类
var itemType3Data = {
"0":"根骨",
"1":"真气",
"2":"武术",
"3":"灵力",
"4":"灵巧",
"5":"机缘",
}
var equipTypeSimple = {
"0":"剑",
"1":"刀",
"2":"镖",
"3":"盾牌",
"4":"匕首",
"5":"法器",
"6":"斧",
"7":"双手棍",
"8":"双手弓",
"9":"双手弩",
}
//装备类型
var equipTypeData = {
"0":{
"0":"武器,左手,剑",
"1":"武器,左手,刀",
"2":"武器,左手,镖",
"3":"武器,副手,盾牌",
"4":"武器,副手,匕首",
"5":"武器,副手,法器",
"6":"武器,双手,斧",
"7":"武器,双手棍",
"8":"武器,双手弓",
"9":"武器,双手弩",
"10":"武器,奇兵异宝",
"1001":"武器,奇兵异宝",
"1002":"武器,奇兵异宝",
"1003":"武器,奇兵异宝",
"1004":"武器,奇兵异宝",
"1005":"武器,奇兵异宝",
"1006":"武器,奇兵异宝",
"1007":"武器,奇兵异宝",
"1008":"霸王绝刀",
"1009":"诛仙剑阵",
"1010":"武器,奇兵异宝",
"1011":"武器,奇兵异宝",
"1012":"武器,奇兵异宝",
},
"1":"防具,帽子",
"2":"防具,衣服",
"3":"防具,鞋子",
"4":"首饰,项链",
"5":"首饰,戒指",
"10":"不可装备,奇兵异宝",
};
//是否攻击技能
var isAttackSkillType = {
//"0":"只有被动附加属性",
"1":"物攻倍击 主动 ",
"2":"物攻倍击附伤害 主动",
"3":"法功倍击 主动",
"4":"法功倍击附伤害 主动",
"5":"反击 被动",
"6":"反震 被动",
//"7":"反击+反震 被动",//人物技能:高级反击
//"8":"防御 被动",
//"9":"防御+反击 被动",//人物技能:移花接木
//"10":"魔法盾 被动",
//"11":"基本心法 功法",
"12":"连击 主动",
//"13":"防御+反震 被动",//坐忘无我
"14":"吸血 主动",
"15":"结算物功 主动",
"16":"结算法功 主动",
//"17":"附加伤害 主动",
//"18":"buff 主动",
//"19":"光环 回合前自动触发",
"20":"加血 主动",
"21":"加蓝 主动",
//"22":"吸血盾 被动",
//"23":"吸蓝盾 被动",
"24":"双攻倍击 主动",
//"25":"优化灵根 被动 升级时改变对应五行的灵根",
"26":"速差攻击 主动",
//"27":"闪避 被动",
"28":"丢钱 主动 固定丢1块钱",
"29":"丢钱 主动 固定丢1%的钱",
"30":"吸钱 被动",
"31":"参数倍攻 主动 配合因子使用可以实现多种效果",
"32":"随机次数连击 主动",
"33":"护盾 主动",
//"100":"监听炼药成功事件 被动",
//"101":"监听锻造破碎事件 被动",
};
//技能类型
var skillType = {
"0":"只有被动附加属性",
"1":"物攻倍击 主动 ",
"2":"物攻倍击附伤害 主动",
"3":"法功倍击 主动",
"4":"法功倍击附伤害 主动",
"5":"反击 被动",
"6":"反震 被动",
"7":"反击+反震 被动",//人物技能:高级反击
"8":"防御 被动",
"9":"防御+反击 被动",//人物技能:移花接木
"10":"魔法盾 被动",
"11":"基本心法 功法",
"12":"连击 主动",
"13":"防御+反震 被动",//坐忘无我
"14":"吸血 主动",
"15":"结算物功 主动",
"16":"结算法功 主动",
"17":"附加伤害 主动",
"18":"buff 主动",
"19":"光环 回合前自动触发",
"20":"加血 主动",
"21":"加蓝 主动",
"22":"吸血盾 被动",
"23":"吸蓝盾 被动",
"24":"双攻倍击 主动",
"25":"优化灵根 被动 升级时改变对应五行的灵根",
"26":"速差攻击 主动",
"27":"闪避 被动",
"28":"丢钱 主动 固定丢1块钱",
"29":"丢钱 主动 固定丢1%的钱",
"30":"吸钱 被动",
"31":"参数倍攻 主动 配合因子使用可以实现多种效果",
"32":"随机次数连击 主动",
"33":"护盾 主动",
"100":"监听炼药成功事件 被动",
"101":"监听锻造破碎事件 被动",
};
//伤害因子
var dmgType = {
"0":"无系数",
"1":"物攻系数",
"2":"法攻系数",
"3":"物攻+法攻*",
"4":"武术*",
"5":"灵力*",
"6":"防御*",
"7":"速度*",
"8":"自身加敌人",
"9":"敌人攻击",
"10":"目标buff物伤",
"11":"目标buff法伤",
"12":"附加伤害",
"13":"自身血量百分比越高,伤害越高",
"14":"自身血量百分比越低,伤害越高",
"15":"目标血量百分比越高,伤害越高",
"16":"目标血量百分比越低,伤害越高",
"17":"根据目标血量来结算",
};
var judgeType = {
"1":"永久不成立",
"2":"之后",//大于
"3":"之前",//小于
"4":"",//等于
"5":"或者更高",//大于等于
"6":"或者更低",//小于等于
"7":"约等于",//约等于
"8":"包含"
};
var judgeType2 = {
"1":"不为",
"2":"大于",
"3":"小于",
"4":"",
"5":"不低于",
"6":"不大于",
"7":"约等于",
"8":"包含"
};
var damageCategory = {
"0":"近战物理伤害",
"1":"法术伤害",
"2":"远程物理伤害",
"3":"治疗",
};
//将URL中的UTF-8字符串转成中文字符串
function getCharFromUtf8(str) {
var cstr = "";
var nOffset = 0;
if (str == "")
return "";
str = str.toLowerCase();
nOffset = str.indexOf("%e");
if (nOffset == -1)
return str;
while (nOffset != -1) {
cstr += str.substr(0, nOffset);
str = str.substr(nOffset, str.length - nOffset);
if (str == "" || str.length < 9)
return cstr;
cstr += utf8ToChar(str.substr(0, 9));
str = str.substr(9, str.length - 9);
nOffset = str.indexOf("%e");
}
return cstr + str;
}
//将编码转换成字符
function utf8ToChar(str) {
var iCode, iCode1, iCode2;
iCode = parseInt("0x" + str.substr(1, 2));
iCode1 = parseInt("0x" + str.substr(4, 2));
iCode2 = parseInt("0x" + str.substr(7, 2));
return String.fromCharCode(((iCode & 0x0F) << 12) | ((iCode1 & 0x3F) << 6) | (iCode2 & 0x3F));
}
//获取url的参数
function getUrlParams(name){
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) return unescape(r[2]); return null; //返回参数值
}
//获取url的参数(value為中文的情況)
function getUrlParamsCn(name){
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
//replace 是为了替换 · 造成的乱码问题
if (r != null) return unescape(getCharFromUtf8(r[2].replace("%C2%B7"," "))); return null; //返回参数值
}
//mtpis监听,动态添加溢出,避免搜索的时候连带搜索了mtpis
function mtpisListener(obj,mtpis){
obj.mouseenter(function(){
obj.attr("data-mtpis",mtpis);
});
obj.mouseleave(function(){
obj.attr("data-mtpis","");
});
}
//宠物,物品 来源ID获取tip
function findMapTips(id){
var bornDiv = $("<span></span>");
var mtpis = "";
var bornName = "";
if(id == "x"){
return bornDiv.append("蛮荒");
}
var isFromMap = true;//是否来源为地图
var isFromPeifang = false;//配方
var isFromMonster = false;//怪物
var isFromItem = false;//物品
var isFromPet = false;//宠物
var isFromAchive = false;//成就
var map = maptable[id];
if(!map){
map = gatetable[id];
}
if(!map){
map = makerecipedata[id];
isFromMap = false;
isFromPeifang = true;
}
if(!map){
map = monstertable[id];
isFromPeifang = false;
isFromMonster = true;
}
if(!map){
map = itemtable[id];
isFromMonster = false;
isFromItem = true;
}
if(!map){
map = pettable[id];
isFromItem = false;
isFromPet = true;
}
if(!map){
map = achievementdata[id];
isFromPet = false;
isFromAchive = true;
}
if(!map){
map = equipexdatatable[id];
isFromAchive = false;
}
if(isFromMap){
bornName =map.NAME;
var bornDescript = map.DESCRIPT;
var bornLevel = map["Level"];
var bornSuggest = map["推荐境界"];
mtpis += "<p>地图名称:"+bornName+"</p>";
mtpis += "<p>地图等级:"+bornLevel+"</p>";
mtpis += "<p>推荐境界:"+bornSuggest+"</p>";
//mtpis += discover?"<p>发现:"+discover+"</p>":"";
//mtpis += unlock?"<p>解锁:"+unlock+"</p>":"";
mtpis += "<p style='width: 200px;height: auto;word-wrap:break-word;word-break:break-all;overflow: hidden;'>地图描述:"+bornDescript+"</p>";
bornName = bornName+"<a href='other.html?id="+map.ID+"' target='blank'><span class='glyphicon glyphicon-send'></span></a>";
}else if(isFromPeifang){
bornName ="配方:"+map.NAME;
mtpis += "<p>配方名称:"+bornName+"</p>";
if(downloadFile[curVersionIndex].hideItemMakeRecipe && map.IGNORE){
//隐藏
mtpis += "<p>请从游戏中获取配方详细</p>";
}else{
for(var i=1;i<=9;i++){
if(map["原料"+i] && map["原料"+i] != "NA"){
var materialSplit = map["原料"+i].split(":");
var materialId = materialSplit[0];
var material = itemtable[materialId];
if(!material){
material = pettable[materialId];
}
if(!material){
material = equipexdatatable[materialId];
}
if(!material){
//console.log(id)
continue;
}
var needNum = materialSplit[1];
if(map.ID >peifangLimitID){
if(needNum){
if(needNum>10){
var needStr = "";
for(j=1;j<needNum.length;j++){
needStr += "?";
}
needNum = needStr + (needNum%10);
}else{
needNum = "?";
}
}
}
//是否隐藏配方
if(peifangNotShowIds[map.ID]){
mtpis += "<p>原料"+i+":毛哥说摸索去</p>";
}else{
mtpis += "<p>原料"+i+":"+material.NAME+"×"+needNum+"</p>";
}
}
}
}
}else if(isFromMonster){
bornName =map.NAME;
var monsterLevel = map["Level"];
var monsterWuxing = wuxing[map["五行"]];
var monsterFrom = "";
$.each(map.SOURCE_FROM,function(key,sourceId){
//是否有隐藏产物的配方来源
if(hideProduct[sourceId]){
return;
}
var fromMap = maptable[sourceId];
if(!fromMap){
fromMap = gatetable[sourceId];
}
//实在没有,直接返回
if(!fromMap){
console.log("缺少数据,直接返回,ID:"+sourceId);
return bornDiv;
}
monsterFrom += fromMap.NAME +" ";
});
mtpis += "<p>怪物名称:"+bornName+"</p>";
mtpis += "<p>等级:"+monsterLevel+"</p>";
mtpis += "<p>五行:"+monsterWuxing+"</p>";
mtpis += "<p>来源:"+monsterFrom+"</p>";
//mtpis += "<p style='width: 200px;height: auto;word-wrap:break-word;word-break:break-all;overflow: hidden;'>描述:"+bornDescript+"</p>";
}else if(isFromItem){//来源为物品
bornName =map.NAME;
//如果物品是兽决、技能卡牌,那么追加 技能描述
if(map.type1 == "203"){
petSkillMap = petskilldata[map.value1];
if(petSkillMap){
bornName += ":"+petSkillMap.NAME;
}else{
console.log("兽决定位不到技能:"+map.value1)
}
}else if(map.type1 == "123"){
var taskMap = tasktable[map.value1];
if(taskMap){
var itemMap = itemtable[taskMap["产物"]];
if(itemMap){
bornName += ":"+itemMap.NAME;
}else{
console.log("种植物品定位不到:"+taskMap["产物"])
}
}else{
var makerecipeMap = makerecipedata[map.value1];
if(makerecipeMap){
bornName += ":【配方】"+makerecipeMap.NAME;
}else{
console.log(map);
}
}
}else if(map.type1 == "115"){
//地图门票
var mapMap = gatetable[map.value1];
if(!mapMap){
mapMap = maptable[map.value1];
}
if(mapMap){
bornName += ":"+mapMap.NAME;
}
}else if(/技能卡牌/.test(map.NAME)){
skillMap = skilldata[map.value1];
if(skillMap){
bornName += ":"+skillMap.NAME;
}else{
console.log("技能卡牌定位不到技能:"+map.value1)
}
}
var bornDescript = map.DESCRIPT;
//对于丹方、配方,隐藏掉描述内容,避免泄露组成方式
if(/的.*(丹方|配方)/.test(map.NAME)){//的.*丹方|的.*配方
bornDescript = "不许偷看";
}
var itemFrom = "";
var itemFromType = "";
$.each(map.SOURCE_FROM,function(key,sourceId){
//是否有隐藏产物的配方来源
if(hideProduct[sourceId]){
return;
}
var fromMap = maptable[sourceId];
itemFromType = "[地图]";
if(!fromMap){
fromMap = gatetable[sourceId];
itemFromType = "[副本]";
}
if(!fromMap){
fromMap = makerecipedata[sourceId];
itemFromType = "[配方]";
}
if(!fromMap){
fromMap = monstertable[sourceId];
itemFromType = "[怪物]";
}
if(!fromMap){
fromMap = itemtable[sourceId];
if(fromMap){
if(fromMap["分类"] == "2" && fromMap["子分类"] == "1" && fromMap["从分类"] == "0"){
itemFromType = "[炼药]";
}else{
itemFromType = "[物品]";
}
}
}
if(!fromMap){
itemFromType = "";
//console.log(sourceId);
return ;
}
itemFrom += fromMap.NAME+ "<font color=yellow>"+itemFromType +"</font>; ";
});
//var limit = findLimitDescript(map);
var limit = $("<div></div>").append(findLimitDescript(map)).html();
var itemUseStr = itemTypeData[map["分类"]][map["子分类"]];
var x = parseInt(map.ICON%15);
var y = parseInt(map.ICON/15);
mtpis += "<div class='item' style='background:url(images/itemIcon.bmp) -"+(x*40)+"px -"+(y*40)+"px no-repeat;'></div>";
mtpis += "<p>名称:"+bornName+"</p>";
mtpis += "<p>用处:"+itemUseStr+"</p>";
mtpis += "<p>限制:"+limit+"</p>";
mtpis += "<p>堆叠:"+map["最大叠加"]+"</p>";
mtpis += "<p>来源:"+itemFrom+"</p>";
mtpis += "<p style='width: 200px;height: auto;word-wrap:break-word;word-break:break-all;overflow: hidden;'>描述:"+bornDescript+"</p>";
}else if(isFromPet){//来源为宠物
return findPetTip(id).append(jumpTabHref(map));
}else if(isFromAchive){//来源为成就
bornName = "成就:"+map.NAME;
mtpis += "<p>名称:"+bornName+"</p>";
mtpis += "<p>描述:"+map.DESCRIPT+"</p>";
}else{//来源为装备
if(!map){
//console.log(id);
return bornDiv;
}
return findEquipTips(id).append(jumpTabHref(map));
}
var bornData = $("<span style='color:green'>"+bornName+"</span>");
mtpisListener(bornData,mtpis);
bornDiv.append(bornData).append(jumpTabHref(map));
return bornDiv;
}
//宠物技能ID获取tip
function findPetSkillTips(id){
var giftDiv = $("<span></span>");
if(id!="0"){
var map = petskilldata[id];
if(!map){
console.log("不存在的宠物技能ID:"+id);
return giftDiv;
}
var giftName =map.NAME;
var skill_x = parseInt(map.ICON%15);
var skill_y = parseInt(map.ICON/15);
var gitfDescript = map.DESCRIPT+"<br>"+findSkillRewardInfo(map);
var giftType = map["触发"];
var giftManaCost = map["耗蓝"];
if(giftType=="0"){
giftType = "被动";
}else{
giftType = "主动";
}
var wuxingName = wuxing[map["五行"]];
var mtpis = "";
var skillIcon = "<div class='skill' style='background:url(images/PetSkillIcon.bmp) -"+(skill_x*32)+"px -"+(skill_y*32)+"px no-repeat;'></div>";
mtpis += skillIcon;
mtpis += "<p>名称:"+giftName+"</p>";
mtpis += "<p>五行:"+wuxingName+"</p>";
mtpis += "<p>类型:"+giftType+"</p>";
if(giftManaCost != "0"){
mtpis += "<p>耗蓝:"+giftManaCost+"%</p>";
}
mtpis += "<p style='width: 200px;height: auto;word-wrap:break-word;word-break:break-all;overflow: hidden;'>效果:"+gitfDescript+"</p>";
var giftData = $("<span style='color:green'>"+giftName+"</span>");
mtpisListener(giftData,mtpis);
giftDiv.append(giftData);
return giftDiv;
}
}
//宠物ID获取tip
function findPetTip(id){
var giftPetDataDiv = $("<span></span>");
var map = pettable[id];
if(!map){
console.log("宠物ID不存在:"+id);
return giftPetDataDiv;
}
var pet_x = parseInt(map.ICON%15);
var pet_y = parseInt(map.ICON/15);
var born = "";
$.each(map.SOURCE_FROM,function(index,from){
//是否有隐藏产物的配方来源
if(hideProduct[from]){
return;
}
var fromMap = maptable[from];
if(!fromMap){
fromMap = gatetable[from];
}
if(!fromMap){
fromMap = makerecipedata[from];
}
//实在没有,直接返回
if(!fromMap){
console.log("缺少数据,直接返回,ID:"+from);
return giftPetDataDiv;
}
born += fromMap.NAME+" ";
});
if(map["天赋"]!="0" && !petskilldata[map["天赋"]]){
console.log(map.NAME+"-天赋技能不存在-"+map["天赋"]);
return giftPetDataDiv;
}
var mtpis = "";
mtpis += "<div class='pet' style='background:url(images/PetIcon.bmp) -"+(pet_x*40)+"px -"+(pet_y*40)+"px no-repeat;'></div>";
mtpis += "<p>名称:"+map.NAME+"</p>";
mtpis += "<div>成长:"+map.grow+"</div>";
mtpis += "<div>天赋:"+(map["天赋"]!="0"?petskilldata[map["天赋"]].NAME:"")+"</div>";
mtpis += "<div>御力:"+map["御力"]+"</div>";
mtpis += "<div>出处:"+born+"</div>";
mtpis += getMtpis(map.DESCRIP?map.DESCRIP:"");
var giftPetData = $("<span style='color:green'>"+map.NAME+"</span>");
mtpisListener(giftPetData,mtpis);
giftPetDataDiv.append(giftPetData);
return giftPetDataDiv;
}
//Buff获取提示
function findBuffTips(skillmap){
var id = skillmap["效果1-类型"];
var stateDiv = $("<span></span>");
if(id){
var map = buffdatatable[id];
if(map && map.NAME !="无"){
var mtpis = "";
if(map["ICON"] >= 0 ){
var state_x = parseInt(map["ICON"]%15);
var state_y = parseInt(map["ICON"]/15);
mtpis += "<div class='state' style='background:url(images/BuffIcon.bmp) -"+(state_x*40)+"px -"+(state_y*40)+"px no-repeat;'></div>";
}
//有8个效果值
var effectTotal = "";
var targetEffectName;
for(var i=1;i<=8;i++){
var effectNo = map["效果"+i];
if(effectNo == "0"){continue;}
var effect = gameattribstringtable[effectNo]["属性"];
var num = map["数值"+i];
//300为限制效果,无数值
if(map["效果1"] == "300"){
}else{
//0不显示
if(num!="0"){
//如果不包含负号,则前面多个+号
if(!/-/.test(num)){
num = "+"+num;
}
if(/%/.test(effect)){
effect = effect.replace("%",num+"%");
}else{
effect+= num;
}
}
}
effectTotal += effect+" ";
if(i == 1){
targetEffectName = effect;
}
}
var formual = calcBuffFormual(skillmap);
var effectColor = map["是否增益"] == "0" ? "pink" : "lightGreen";
mtpis += "<p>名称:"+map.NAME+"</p>";
mtpis += "<p>目标:"+skillTarget[skillmap["目标"]]+"</p>";
mtpis += "<p>几率:"+calcBuffRateFormual(skillmap)+"%</p>";
mtpis += "<p>类型:"+(map["是否增益"] == "0" ? "<span style='color:pink'>减益</span>" : "<span style='color:lightGreen'>增益</span>")+"</p>";
mtpis += "<p>效果:"+effectTotal+"</p>";
mtpis += "<p>持续:"+map["持续回合"]+"</p>";
mtpis += "<p>最大层数:"+map["最大层数"]+"</p>";
mtpis += "<p>公式:"+ (formual ? ("<span style='color:" + (map["是否增益"] == "0" ? "pink" : "lightGreen") + "'>" + targetEffectName+"</span> = "+formual) : "") +"</p>";
//mtpis += getMtpis(map.DESCRIPT)";
var stateData = $("<span style='color:green'>"+map.NAME+"</span>");
mtpisListener(stateData,mtpis);
stateDiv.append(stateData);
}
}
return stateDiv;
}
function findPrefixTip(map){
var stateDiv = $("<span></span>");
if(map && map.NAME !="无"){
var mtpis = "";
if(map["ICON"] >= 0 ){
var state_x = parseInt(map["ICON"]%15);
var state_y = parseInt(map["ICON"]/15);
mtpis += "<div class='state' style='background:url(images/BuffIcon.bmp) -"+(state_x*40)+"px -"+(state_y*40)+"px no-repeat;'></div>";
}
//有8个效果值
var effectTotal = "";
for(var i=1;i<=8;i++){
var effectNo = map["效果"+i];
if(effectNo == "0"){continue;}
var effect = gameattribstringtable[effectNo]["属性"];
var num = map["数值"+i];
//300为限制效果,无数值
if(map["效果1"] == "300"){
}else{
//0不显示
if(num!="0"){
//如果不包含负号,则前面多个+号
if(!/-/.test(num)){
num = "+"+num;
}
if(/%/.test(effect)){
effect = effect.replace("%",num+"%");
}else{
effect+= num;
}
}
}
effectTotal += effect+" ";
}
mtpis += "<p>"+effectTotal+"</p>";
var stateData = $("<span style='color:green'>"+map.NAME+"</span>");
mtpisListener(stateData,mtpis);
stateDiv.append(stateData);
}
return stateDiv;
}
function dealPrefixAttr(map){
var param = {};
for(var i=1;i<=8;i++){
var effectNo = map["效果"+i];
if(effectNo == "0"){continue;}
var attrMap = gameattribstringtable[effectNo];
var num = map["数值"+i];
//300为限制效果,无数值
if(map["效果1"] == "300"){
}else{
//0不显示
if(num && num!="0"){
param[attrMap.ID] = {ID:attrMap.ID,NAME:attrMap["属性"],NUM:num};
}
}
}
return param;
}
//Buff计算公式
function calcBuffFormual(map){
var formualNo = map["效果1-公式"];
var formual = "无";
attrMap = gameattribstringtable[map["效果1-xID"]];
if(attrMap){
//formual = attrMap["属性"]+"×系数+基础系数";
//formual = attrMap["属性"];
formual= getCalcMethod(map["效果1-公式"],
map["效果1-xK"],
map["效果1-xB"],
attrMap["属性"]);
}
return formual;
}
//Buff几率计算公式
function calcBuffRateFormual(map){
var formualNo = map["几率-公式"];
var formual = "无";
attrMap = gameattribstringtable[map["几率-xID"]];
if(attrMap){
formual= getCalcMethod(map["几率-公式"],
map["几率-xK"],
map["几率-xB"],
attrMap["属性"]);
}
return formual;
}
//人物技能来源Tips
function findRollSkillFromTips(id){
var map = gatetable[id];
if(map){
//来源通关事件
return findSkillTipsFromGatePass(id);
}else {
//来源技能、物品
return findSkillTipsFromSkill(id);
}
}
function findSkillTipsFromSkill(id){
var map = skilldata[id];
var pic = "SkillIcon.bmp";
var className = "roleSkill";
var quality = "";
var fromItem = false;
if(!map){
map = itemtable[id];
pic = "itemIcon.bmp";
className = "item";
try{
quality = "quality_"+map["品质"];
fromItem = true;
}catch(e){
console.log("不存在技能id:"+id);
}
}
var div = $("<div></div>");
if(map){
var sourceFrom = "";
$.each(map.SOURCE_FROM,function(i,sourceId){
var from = skilldata[sourceId];
var itemFromType = "";
if(!from){
from = itemtable[sourceId];
if(from){
if(from["分类"] == "2" && from["子分类"] == "1" && from["从分类"] == "0"){
itemFromType = "[炼药]";
}else{
itemFromType = "[物品]";
}
}
}
if(!from){
from = makerecipedata[sourceId];
itemFromType = "[配方]";
}
if(!from){
from = maptable[sourceId];
itemFromType = "[地图]";
}
if(!from){
from = gatetable[sourceId];
itemFromType = "[地图]";
}
if(!from){
from = monstertable[sourceId];
itemFromType = "[怪物]";
}
if(from){
sourceFrom += from.NAME + "<font color=yellow>"+itemFromType +"</font>; ";
}
});
var mtpis = "";
if(map["ICON"] > 0 ){
var x = parseInt(map["ICON"]%15);
var y = parseInt(map["ICON"]/15);
mtpis += "<div class='"+className+" "+quality+"' style='background:url(images/"+pic+") -"+(x*40)+"px -"+(y*40)+"px no-repeat;'></div>";
}
mtpis += "<p>名称:"+map.NAME+"</p>";
if(map["五行"]){
mtpis += "<p>五行:"+wuxing[map["五行"]]+"</p>";
}
var itemUseStr = itemTypeData[map["分类"]][map["子分类"]];
if(itemUseStr){
mtpis += "<p>用处:"+itemUseStr+"</p>";
}
//物品来源,使用限制
if(fromItem){
var condition = map["条件"];
var judge = map["判断"];
var target = map["条件值"];
if(condition == "51"){
mtpis += "<div>限制:"+ablestagerewardtable[target].NAME+"</div>";
}else if(condition == "52"){
if(!skilldata[target]){
console.log(map.NAME+map.ID+":条件值错误:"+target);
mtpis += "<div>限制:作者这里有bug</div>";
}else{
if(map["分类"] == "0"){
mtpis += "<div>限制:"+skilldata[target].NAME+judge+"重</div>";
}else{
mtpis += "<div>限制:"+skilldata[target].NAME+judge+"级</div>";
}
}
}else{
}
}
mtpis += "<p>来源:"+sourceFrom+"</p>";
mtpis += getMtpis(map.DESCRIPT);
var dataDiv = $("<span style='color:green'>"+map.NAME+"</span>");
mtpisListener(dataDiv,mtpis);
div.append(dataDiv).append(jumpTabHref(map));
}
return div;
}
function findSkillTipsFromGatePass(gateId){
var div = $("<div></div>");
var map = gatetable[gateId];
if(map){
return findMapTips(gateId).prepend("通关副本:<br>");
}
return div;
}
//限制类型,限制条件,限制等级
function findLimitDescript(map){
/*
var type = map["分类"];
var condition = map["条件"];
var judge = map["判断"];
var target = map["条件值"];
if(condition=="51"){//境界限制
var roleLevel = ablestagerewardtable[target];
if(roleLevel){
var roleLevelName = roleLevel.NAME;
roleLevelName += judgeType[judge];
return roleLevelName;
}
}else if(condition=="52"){//功法限制
if(!skilldata[target]){
console.log(map.NAME+map.ID+":条件值错误:"+target);
return "作者这里有bug";
}else if(type == "0"){
return skilldata[target].NAME+"("+judge+"重)";
}else{
return skilldata[target].NAME+"("+judge+"级)";
}
}else{
return findSkillUseLimit(map);
}
return "无";
*/
var useCondition = map["条件"];
var useLimitStr = "";
if(useCondition > 0){
var useConditionName = skillCondition[useCondition];
var useConditionNum = map["条件值"];
var useConditionJudge = judgeType2[map["判断"]];
var useLimitStr = "";
if(!useConditionName){
useConditionName = "未知条件"+useCondition;
}
//生命、法力值
if(useCondition == "1" || useCondition == "2"){
useLimitStr = skillTarget[map["目标"]] + useConditionName + useConditionJudge + "<font color=yellow>" + useConditionNum + "</font>";
}
//生命、法力比例
else if(useCondition == "3" || useCondition == "4"){
useLimitStr = skillTarget[map["目标"]] + useConditionName + useConditionJudge + "<font color=yellow>" + useConditionNum + "%" + "</font>";
}
//宠物等级
else if(useCondition == "50" ){
useLimitStr = useConditionName + "" + useConditionJudge + "<font color=yellow>【" + useConditionNum + "】</font>" ;
}
//使用者的境界等级
else if(useCondition == "51" ){
useLimitStr = useConditionName + useConditionJudge + "<font color=yellow>【" + ablestagerewardtable[useConditionNum].NAME + "】</font>" ;
}
//技能本身的等级
else if(useCondition == "52" ){
useLimitStr = $("<span><span>").append(findSkillTips(skilldata[useConditionNum])).append("("+map["判断"]+")");
}
//装备的武器类型
else if(useCondition == "53" ){
var equipTypeName = equipTypeSimple[useConditionNum];
//如果不是普通装备,则去装备中找名字
if(! equipTypeName ){
//equipTypeName = equipexdatatable[useConditionNum].NAME;
useLimitStr = $("<span>"+useConditionName + useConditionJudge + "</span>").append(findMapTips(useConditionNum));
}else{
useLimitStr = useConditionName + useConditionJudge + "<font color=yellow>【" + equipTypeName + "】</font>";
}
}
//当前激活的内功
else if(useCondition == "54" ){
useLimitStr = $("<span>"+useConditionName + useConditionJudge+"<span>").append(findSkillTips(skilldata[useConditionNum]));
}
//施法者是否拥有指定BUFF
else if(useCondition == "55" ){
useLimitStr = useConditionName + useConditionJudge + "<font color=yellow>【" + buffdatatable[useConditionNum].NAME + "】</font>";
}
//当前目标是否拥有指定BUFF
else if(useCondition == "56" ){
useLimitStr = skillTarget[map["目标"]] + useConditionName + "<font color=yellow>【" + buffdatatable[useConditionNum].NAME + "】</font>";
}
//身上是否穿着指定装备
else if(useCondition == "57" ){
useLimitStr = $("<span>"+useConditionName + useConditionJudge + "</span>").append(findMapTips(useConditionNum));
}
//当前宠物是否特定类型
else if(useCondition == "58" ){
useLimitStr = $("<span>"+useConditionName + "</span>").append(findMapTips(useConditionNum));
}
//使用者指定属性大于等于指定属性
else if(useCondition == "59" ){
useLimitStr = "<font color=yellow>【" + gameattribstringtable[map["判断"]]["属性"] +"】" + useConditionNum + "</font>";
}
else{
useLimitStr = useConditionName;
}
}
return useLimitStr;
}
//套装tips
function findSuitTips (id){
var div = $("<div></div>");
if(id>0){
var map = equipsettable[id];
if(!map){
return;
}
var suitAttr = findSuitAttr(map);
var mtpis = "";
var suitMap = equipsettable[map["套装"]];
var suitEquips = "";
$.each(map["组件"].split(";"),function(index,equipId){
if(equipexdatatable[equipId]){
suitEquips += equipexdatatable[equipId].NAME+" ";
}else{
console.log("套装【"+map.NAME+"】装备缺失ID:"+equipId);
}
});
mtpis += "<p>套装名称:"+map.NAME+"</p>";
mtpis += "<p>包含组件:"+suitEquips+"</p>";
mtpis += "<div>属性:"+suitAttr+"</div>";
var dataDiv = $("<span style='color:green'>"+map.NAME+"</span>");
mtpisListener(dataDiv,mtpis);
div.append(dataDiv);
}
return div;
}
//获取装备提示
function findEquipTips (id){
var map = equipexdatatable[id];
if(!map){
return;
}
var quality = "quality_"+map["品阶"];
var div = $("<span></span>");
if(map){
var sourceFrom = "";
$.each(map.SOURCE_FROM,function(i,sourceId){
//是否有隐藏产物的配方来源
if(hideProduct[sourceId]){
return;
}
var from = makerecipedata[sourceId];
if(!from){
from = maptable[sourceId];
}
if(!from){
from = gatetable[sourceId];
}
if(!from){
from = itemtable[sourceId];
}
if(from){
sourceFrom += from.NAME +" ";
}
});
var mtpis = "";
if(map["ICON"] >= 0 ){
var x = parseInt(map["ICON"]%15);
var y = parseInt(map["ICON"]/15);
mtpis += "<div class='item "+quality+"' style='background:url(images/itemIconEx.bmp) -"+(x*40)+"px -"+(y*40)+"px no-repeat;'></div>";
}
mtpis += "<p>名称:"+map.NAME+"</p>";
mtpis += "<p>类型:"+getEquipType(map)+"</p>";
mtpis += "<p>等级:"+map["Level"]+"</p>";
//物品来源,使用限制
var condition = map["条件"];
var judge = map["判断"];
var target = map["条件值"];
if(condition == "51"){
var limitMap = ablestagerewardtable[target];
if(limitMap){
mtpis += "<div>限制:"+limitMap.NAME+"</div>";
}
}else if(condition == "52"){
var limitMap = skilldata[target];
if(limitMap){
if(map["分类"] == "0"){
mtpis += "<div>限制:"+limitMap.NAME+judge+"重</div>";
}else{
mtpis += "<div>限制:"+limitMap.NAME+judge+"级</div>";
}
}
}else{
}
mtpis += "<p>来源:"+sourceFrom+"</p>";
mtpis += "<p>描述:<div style='margin-left:2em;'"+getMtpis(map.DESCRIPT)+"</div></p>";
if(map["套装"]>0){
var suitMap = equipsettable[map["套装"]];
var suitEquips = "";
if(!suitMap){
console.log(map);
console.log("上面map套装属性不存在"+map["套装"]);
}else{
$.each(suitMap["组件"].split(";"),function(index,equipId){
if(equipexdatatable[equipId]){
suitEquips += equipexdatatable[equipId].NAME+" ";
}else{
console.log("套装【"+suitMap.NAME+"】装备缺失ID:"+equipId);
}
});
mtpis += "<div>套装名称:"+suitMap.NAME+"</div>";
mtpis += "<div>组件:"+suitEquips+"</div>";
mtpis += "<div>属性:"+findSuitAttr(suitMap)+"</div>";
}
}
var dataDiv = $("<span style='color:green'>"+map.NAME+" </span>");
mtpisListener(dataDiv,mtpis);
div.append(dataDiv);
}
return div;
}
//套装属性文本
function findSuitAttr (map){
if(!map){
return;
}
var headArr = ["激活","属性","数值","激活2","属性3","数值4","激活5","属性6","数值7","激活8","属性9","数值10","激活11","属性12","数值13","激活14","属性15","数值16"];
var suitAttr = "";
for(var i=0;i<headArr.length;){
var num = map[headArr[i++]];
var attr = map[headArr[i++]];
var attrNum = map[headArr[i++]];
if(num>0){
if(!gameattribstringtable[attr]){
console.log("不存在属性:"+attr)
continue;
}
var effect = gameattribstringtable[attr]["属性"];
//0不显示
if(attrNum!="0"){
if(/%/.test(effect)){
//如果不包含负号,则前面多个+号
if(!/-/.test(attrNum)){
attrNum = "+"+attrNum;
}
effect = effect.replace("%",attrNum+"%");
}else{
//如果不包含负号,则前面多个+号
attrNum = formateNum(attrNum);
if(!/-/.test(attrNum)){
attrNum = "+"+attrNum;
}
effect+= attrNum;
}
}
suitAttr += "<div>["+num+"]:"+effect+"</div>";
}
}
return suitAttr;
}
//法宝描述
function findTreasureDescript(id){
var map = equipskilldata[id];
var descript = "";
if(map){
var mapType = map["类型"];
descript = map.DESCRIPT;
var attr = "";
if(mapType=="0"){
for(index=1;index<=4;index++){
if(map["奖励"+index+"-类型"] && map["奖励"+index+"-类型"]>0){
var rewardInfo = "";
var rewardXId = map["奖励"+index+"-xID"];
var rewardX = "威力";//402
if(rewardXId != "402"){
rewardX = gameattribstringtable[rewardXId]["属性"];
}
//如果会根据威力增长
var xB = map["奖励"+index+"-xB"]?map["奖励"+index+"-xB"]:"";
var xK = map["奖励"+index+"-xK"]?map["奖励"+index+"-xK"]:"";
if(xK>0){
if(Number(xB) == 0 ){
xB = "";
}else{
xB = xB + "+";
}
rewardInfo = "("+xB+xK+"×"+rewardX+")";
}else if(xK<0){
if(Number(xB) == 0 ){
xB = "";
}
rewardInfo = "("+xB+xK+"×"+rewardX+")";
}else{
rewardInfo = xB;
}
descript = descript.replace(/%d/i,rewardInfo);
}
}
}else if(mapType == "18"){
var rewardXId = map["效果1-xID"];
var rewardX = "威力";//402
if(rewardXId != "402"){
rewardX = gameattribstringtable[rewardXId]["属性"];
}
descript = descript.replace(/%d/g,map["效果1-xB"]);
descript += ",成长:"+map["效果1-xK"]+"×"+rewardX+"";
}else{
descript = descript.replace(/%d/g,map["威力1"]);
if(map["冷却"] >0){
descript += ",冷却:"+map["冷却"]+"回合";
}else if(map["冷却"] <0){
descript += ",准备:"+map["冷却"].replace("-","")+"回合";
}
}
descript = descript.replace(/%%/g,"%");
}
return descript;
}
//获取技能永久属性奖励提示
function findSkillRewardInfo(map){
var category = map["类型"];
var rewardDescript = isAttackSkillType[category]?""+"伤害系数:"+map["威力1"]+"% ":"";
//var passiveDescript = foreverReward(map,false);
var resultDescript = rewardDescript;
var giftManaCost = map["耗蓝"];
resultDescript += "<br>类型:【" + skillType[category] + "】";
if(giftManaCost != "0"){
resultDescript += "<br>耗蓝:" + giftManaCost + "%";
}
if(category == "12"){
var comboL = map["威力2"];
var comboH = map["成长2"];
var comboDescript = "<br>连击次数:";
if(comboL == comboH){
comboDescript += comboL;
}else{
comboDescript += comboL + "~" + comboH;
}
resultDescript += comboDescript;
}
if(map["伤害因子"] != "0"){
var dmgTypeName = dmgType[map["伤害因子"]];
resultDescript += "<br>伤害因子:【" + dmgTypeName + "】";
}
//功法类
if(map["分类"] == "0"){
resultDescript += "<br>启用加成:<div style='margin-left:2em;'>"+foreverReward(map,true,"#ff6600")+"</div>";
}
resultDescript += "<br>被动加成:<div style='margin-left:2em;'>"+foreverReward(map,false,"#ff6600")+"</div>";
return resultDescript;
}
/*
奖励计算公式:
0:y=x*k+b
1:y=x*x*k+b
2:y=(x/k + 1)*b
3:y=x*x*k+b
4:y=int(x/k + 1)*b
5:y=x*k+int(x/k)+b
6:等比数列 1 2 2 3 3 3 4 4 4 4
7:y=x * (k - 1) + b
8:y=x * (x + k) + b
*/
var calcMethodArr = [
[["","b"],["x×k","x×k+b"]],//k和b为0,k为0,b为0,k和b都不为0
[["","b"],["x×x*k","x×x*k+b"]],
[["","b"],["0","(x÷k+1)×b"]],
[["","b"],["x×x×k","x×x×k+b"]],
[["","b"],["0","Int(x÷k+1)×b"]],
[["","b"],["x×k+Int(x÷k)","x×k+int(x÷k)+b"]],
[["","等比数列"],["等比数列","等比数列"]],
[["","-x+b"],["x×(k-1)","x×(k-1)+b"]],
[["","b"],["x×(x+k)","x×(x+k)+b"]],
];
//获取公式
function getCalcMethod(formual,k,b,levelTarget){
//method 索引
var x = k=="0"?0:1;
var y = b=="0"?0:1;
if(!calcMethodArr[formual]){
console.log("没有启用奖励,或公式不存在:"+formual);
return "公式缺失";
}
var caleMethod = calcMethodArr[formual][x][y];
var result = caleMethod
.replace(/x/g,levelTarget)
.replace(/k/g,k)
.replace(/b/g,b)
.replace(/[+][-]/g,"-") //加负数,变为减法
;
return result;
}
//获取计算结果
function getCalcMethodNum(formual,k,b,level){
//乘除号替换
return getCalcMethod(formual,k,b,level).replace(/×/g,"*").replace(/÷/g,"/");
}
//奖励公式
//功法技能,奖励1是永久属性奖励,2~4 是启动属性
//其他技能,奖励1~4 都是永久奖励
//map 技能数据 isStart 区分获取的是永久奖励还是启用奖励
function foreverReward(map,isStart, fontColor){
var result = "";
var iInit = 1;
var iLimit = 1;
//启用奖励
if(isStart){
if(map["分类"] == "0" && map["类型"] == "25"){//灵根功法
var wx = wuxing[map["五行"]];
var a = map["伤害L"];
var b = map["伤害H"];
result = "(无需启用)"+wx + "灵根每级随机提升("+a+"~"+b+")点";
return result;
}else if(map["分类"] == "0"){
iInit =2;
iLimit = 4;
}else if(map["分类"] == "5"){//法宝
iInit =2;
iLimit = 4;
}else{
//技能没有启用奖励
return result;
}
}else{//永久奖励
if(map["分类"] != "0"){
iLimit = 4;
}
}
for(var i=iInit;i<=iLimit;i++){
var rewardId = map["奖励"+i+"-类型"];
if(rewardId != "0"){
if(!gameattribstringtable[rewardId]){
console.log(map);
console.log("技能"+map.ID+"不存在的奖励"+i+"-类型:"+rewardId);
continue;
}
var xAttr = gameattribstringtable[rewardId]["属性"];
//升级方式
var passiveType = map["奖励"+i+"-xID"];
if(!gameattribstringtable[passiveType]){
console.log("不存在的属性ID:"+passiveType);
continue;
}
var levelTarget = gameattribstringtable[passiveType]["属性"];
var k = map["奖励"+i+"-xK"];
var b = map["奖励"+i+"-xB"];
var formual = map["奖励"+i+"-公式"];
result += "<span style='color:"+ (fontColor ? fontColor : "brown") + ";font-size:1.5rem;'>" + xAttr+"</span>("+getCalcMethod(formual,k,b,levelTarget)+")<br>";
}
}
return result;
}
//奖励数值
//功法技能,奖励1是永久属性奖励,2~4 是启动属性
//其他技能,奖励1~4 都是永久奖励
//map 技能数据 isStart 区分获取的是永久奖励还是启用奖励
function foreverRewardNum(map,skillLv,roleLv,isStart){
var result = "";
var iInit = 1;
var iLimit = 1;
//启用奖励
if(isStart){
if(map["分类"] == "0"){
iInit =2;
iLimit = 4;
}else{
//技能没有启用奖励
return result;
}
}else{//永久奖励
if(map["分类"] != "0"){
iLimit = 4;
}
}
for(var i=iInit;i<=iLimit;i++){
var rewardId = map["奖励"+i+"-类型"];
if(rewardId != "0"){
var xAttr = gameattribstringtable[rewardId]["属性"];
//升级方式
var passiveType = map["奖励"+i+"-xID"];
var k = map["奖励"+i+"-xK"];
var b = map["奖励"+i+"-xB"];
var formual = map["奖励"+i+"-公式"];
if(/82|83/.test(passiveType)){
var levelTarget = skillLv;
var evalFormual = getCalcMethodNum(formual,k,b,levelTarget);
if(evalFormual == "公式缺失"){
console.log("公式缺失", map);
return "公式缺失";
}
var rewardNum = eval(evalFormual);
//计算结果,并注意将结果插入到%号前面,正数多个+号
//如果有小数,则保留2位
if((rewardNum+"").indexOf(".")>0){
rewardNum = rewardNum.toFixed(2);
}
if(Number(rewardNum)>0){
rewardNum = "+"+rewardNum;
}
}else if (/85/.test(passiveType)){
var levelTarget = roleLv;
var evalFormual = getCalcMethodNum(formual,k,b,levelTarget);
if(evalFormual == "公式缺失"){
console.log("公式缺失", map);
return "公式缺失";
}
var rewardNum = eval(evalFormual);
//计算结果,并注意将结果插入到%号前面,正数多个+号
//如果有小数,则保留2位
if((rewardNum+"").indexOf(".")>0){
rewardNum = rewardNum.toFixed(2);
}
if(Number(rewardNum)>0){
rewardNum = "+"+rewardNum;
}
}else{
//根据属性值
levelTarget = gameattribstringtable[passiveType]["属性"];
console.log("属性="+levelTarget);
rewardNum = getCalcMethod(formual,k,b,levelTarget);
}
//百分号所在 索引
var centIndex = xAttr.indexOf("%");
if(centIndex>0){
result += xAttr.replace("%",rewardNum)+"%<br>";
}else{
result += xAttr+rewardNum+"<br>";
}
}
}
return result;
}
//获取格式化的mtpis
function getMtpis(descript){
return "<div style='max-width: 300px;height: auto;word-wrap:break-word;word-break:break-all;overflow: hidden;'>"
+descript
+"</div>";
}
/*获取装备类型*/
function getEquipType(map){
var equipType = equipTypeData[map["分类"]];
if(map["分类"]=="0"){
equipType =equipType[map["子分类"]];
}
return equipType;
}
//d :威力1 ,c :威力2 , a 伤害L , b伤害H
var skillEffectArr = {
"0":"被动技能",
"1":"对目标造成d%${dt}",
"2":"对目标造成d%$(+a~b)${dt}",
"3":"对目标造成d%${dt}",
"4":"对目标造成d%(+a~b)${dt}",
"5":"造成d%自身的伤害,额外暴伤+c%(${dt})",
"6":"反震来自d%敌人的伤害<BR>体格越强壮反震越厉害(${dt})",
"7":"反击d%敌人的+c%自身的伤害(${dt})",
"8":"防御+a<BR>护甲+b<BR>防御提升d%",
"9":"防御提高+a%<BR>护甲+b<BR>并对敌人造成d%的${dt}",
"10":"吸收所收到的伤害:<BR>每点法力吸收d点伤害<BR>最大吸收c%",
"11":"功法:不在此列",
"12":"对敌人造成a~b次d%的${dt}",
"13":"防御提高+a%<BR>护甲+b<BR>并对敌人造成受到伤害的d%的${dt}",
"14":"物伤提高d%,<BR>并恢复造成伤害的c%的生命(${dt})",
"15":"对目标造成d%的${dt},<BR>目标所附带的[a]状态时额外造成c%的伤害,<BR>并刷新状态持续回合",
"16":"对目标造成d%的${dt},<BR>目标所附带的[a]状态时额外造成c%的伤害,<BR>并刷新状态持续回合",
"17":"普通攻击一次,并额外附带a点~b点${wx}系伤害",
"19":"光环 被动",
"20":"为最虚弱的队友恢复d%的法术伤害",
"22":"防御提高+a<BR>护甲+b<BR>并把防御抵消的伤害的d%转成体力恢复",
"23":"防御提高+a<BR>护甲+b<BR>并把防御抵消的伤害的d%转成法力恢复",
"24":"对目标造成d%${dt},并受法术伤害影响(c%)",
"25":"心法等级提升时随机提升${wx}系灵根a~b点",
"27":"有d%基础几率闪避对手的攻击",
"28":"把一枚铜钱作为暗器丢向敌人,<BR>造成d%的${dt},<BR>并且本次攻击如果暴击的话,<BR>暴击伤害额外提高c%",
"29":"把口袋力所有铜钱的1%丢向敌人,<BR>对目标造成d%的基础${dt}。<BR>丢的越多伤害越高",
"30":"敲诈对方对你造成伤害数值的d%作为补偿",
"31":"参数倍攻,主动",
"32":"连击 主动",
"33":"护盾 主动"
};
function getSkillEffect(hasSkill,curNum){
var skillCategory = hasSkill["类型"];
var skillEffect = "";
switch(skillCategory){
case "11":skillEffect = foreverRewardNum(hasSkill,curNum,$("#roleLevel").val(),true);break;
case "18":skillEffect = hasSkill.DESCRIPT;break;
case "100":
case "101":break;
case "0":skillEffect = getSkillEffectAct(hasSkill,skillCategory,1);//"当我不存在把!" ;
break;
default:skillEffect = getSkillEffectAct(hasSkill,skillCategory,curNum);break;
}
return skillEffect;
}
/*获取技能实际效果*/
function getSkillEffectAct(hasSkill,skillCategory,curNum){
curNum -= 1;
var skillEffect = skillEffectArr[skillCategory];
var skillWuxing = wuxing[hasSkill["五行"]];
var power_1 = hasSkill["威力1"];
var power_2 = hasSkill["威力2"];
var grow_1 = hasSkill["成长1"];
var grow_2 = hasSkill["成长2"];
var dmgL = hasSkill["伤害L"];
var dmgH = hasSkill["伤害H"];
var dmgGrowL = hasSkill["成长L"];
var dmgGrowH = hasSkill["成长H"];
var dmgCategory = damageCategory[hasSkill["伤害类型"]];
var giftManaCost = hasSkill["耗蓝"];
//console.log("蓝:"+giftManaCost);
//实际威力、成长 1:
var power_1_Act;
//实际威力、成长 2:
var power_2_Act;
try{
power_1_Act = eval("k*x+b".replace("x",curNum).replace("k",grow_1).replace("b",power_1));
power_2_Act = eval("k*x+b".replace("x",curNum).replace("k",grow_2).replace("b",power_2));
}catch(e){
return "";
}
//伤害范围
var dmgLAct = eval("k*x+b".replace("x",curNum).replace("k",dmgGrowL).replace("b",dmgL));
var dmgHAct = eval("k*x+b".replace("x",curNum).replace("k",dmgGrowH).replace("b",dmgH));
//特殊情况:法力盾
if(skillCategory == "10"){
power_1_Act = (power_1_Act/100).toFixed(1);
}
//特殊情况:连击技能(疾风剑)
else if(skillCategory == "12"){
dmgLAct = power_2;
dmgHAct = grow_2
}
//特殊情况:清算型(若敌方附带buff则提高伤害)
else if(skillCategory == "15" || skillCategory == "16"){
dmgLAct = buffdatatable[dmgL]["NAME"];
}
//特殊情况:幻影步
else if(skillCategory == "27"){
curNum = curNum + parseInt((curNum+1)/5);
power_1_Act = eval("k*x+b".replace("x",curNum).replace("k",grow_1).replace("b",power_1));
}
//替换结果
if(!skillEffect){
console.log("错误,不存在的技能类型:技能ID:"+hasSkill.ID+",技能名称:"+hasSkill.NAME+","+skillCategory+"===(被動0主動1):"+hasSkill["触发"]);
return "";
}
var skillEffectAct = skillEffect.replace("d",power_1_Act).replace("c",power_2_Act).replace("a",dmgLAct).replace("b",dmgHAct)
.replace("${dt}",dmgCategory).replace("${wx}",skillWuxing).replace(dmgLAct + "~"+ dmgLAct +"次",dmgLAct + "次");
skillEffectAct = (giftManaCost != "0"? "<br>耗蓝:"+giftManaCost+"%<br>" : "")+"<font color='#ff6600'>伤害关联:"+dmgType[hasSkill["伤害因子"]]+"</font><br>" + skillEffectAct;
//console.log(skillEffectAct)
return skillEffectAct;
}
/*格式化数字*/
function formateNum(num){
if(num){
var minusChar = (num<0?"-":"");
var num = (num<0?0-num : num)+"";
var numTemp = num;
if(num.length>8){
var n = num.substring(0,num.length-8);
//少于10亿,补充万单位
if(Number(n) < 10){
//避免出现0000
var m = num.substring(num.length-8,num.length-4);
mLength = m.length > 2 ? "2":m.length;//最多保留2位小数
if(Number(m) > 0){
m = "."+m;
}else{
m = "";
}
numTemp = parseFloat(n+m).toFixed(mLength) + "亿";
}else{
numTemp = n + "亿";
}
}else if(num.length>4){
var n = num.substring(0,num.length-4);
//少于5万,补充个单位
if(Number(n) < 5){
//避免出现0000
var m = num.substring(num.length-4,num.length);
mLength = m.length > 2 ? "2":m.length;//最多保留2位小数
if(Number(m) > 0){
m = "."+m;
numTemp = parseFloat(n+m).toFixed(mLength) + "万";
}else{
m = "";
numTemp = parseInt(n+m) + "万";
}
}else{
numTemp = n + "万";
}
}
return minusChar+numTemp;
}else{
return "0";
}
}
//功法可习得技能
function baseLearnSkill(map){
var keyArr = [
["威力1","成长1"],
["威力2","成长2"],
["伤害L","伤害H"],
["成长L","成长H"]
];
var div = $("<div></div>");
$.each(keyArr,function(index,arr){
var skillId = map[arr[0]];
var learnLv = map[arr[1]];
if(skillId != "0"){
var skill = skilldata[skillId];
if(skill){
div.append($("<p>"+ "第" + learnLv + "重领悟:</p>").append(findSkillTips(skill)));
//console.log(findSkillRewardInfo(skill));
}else{
console.log("人物技能不存在:"+skillId);
}
}
});
return div;
}
function findSkillTips(skill){
if(!skill){
console.log(skill)
return "";
}
var pic = "SkillIcon.bmp";
var className = "roleSkill";
var quality = "quality_"+skill["品质"];
var mtpis = "";
if(skill["ICON"] > 0 ){
var x = parseInt(skill["ICON"]%15);
var y = parseInt(skill["ICON"]/15);
mtpis += "<div class='"+className+" "+quality+"' style='background:url(images/"+pic+") -"+(x*40)+"px -"+(y*40)+"px no-repeat;'></div>";
}
mtpis += "<p>名称:"+skill.NAME+"</p>";
if(skill["五行"]){
mtpis += "<p>五行:"+wuxing[skill["五行"]]+"</p>";
}
mtpis += "<p>"+findSkillRewardInfo(skill) +"</p>";
//mtpis += "<p>来源:"+map.NAME+"</p>";
mtpis += getMtpis(skill.DESCRIPT);
var dataDiv = $("<span style='color:green'>"+skill.NAME+"</span>");
mtpisListener(dataDiv,mtpis);
return dataDiv;
}
function conditionStr(condition){
switch(condition){
case "1":return "永久不成立";
case "2":return "大于";
case "3":return "小于";
case "4":return "等于";
case "5":return "大于等于";
case "6":return "小于等于";
case "7":return "约等于";
default :return "-";
}
}
function formatWuxingLabel(wxID){
var label = $("<span></span>");
label.addClass("label");
label.html(wuxing[wxID]);
switch(wxID){
case "0":label.css("background-color","#777");break;//普通
case "1":label.css("background-color","#FFE153");break;//金
case "2":label.css("background-color","#5cb85c");break;//木
case "3":label.css("background-color","#337ab7");break;//水
case "4":label.css("background-color","#d9534f");break;//火
case "5":label.css("background-color","#977C00");break;//土
case "6":label.css("background-color","#9805ff");break;//混沌
default:break;
}
return label;
}
/*技能使用限制*/
function findSkillUseLimit(map){
var useCondition = map["条件"];
var useLimitStr = "";
if(useCondition > 0){
var useConditionName = skillCondition[useCondition];
var useConditionNum = map["条件值"];
var useConditionJudge = judgeType2[map["判断"]];
var useLimitStr = "";
if(!useConditionName){
useConditionName = "未知条件"+useCondition;
}
//生命、法力值
if(useCondition == "1" || useCondition == "2"){
useLimitStr = skillTarget[map["目标"]] + useConditionName + useConditionJudge + "<font color=blue>" + useConditionNum + "</font>";
}
//生命、法力比例
else if(useCondition == "3" || useCondition == "4"){
useLimitStr = skillTarget[map["目标"]] + useConditionName + useConditionJudge + "<font color=blue>" + useConditionNum + "%" + "</font>";
}
//宠物等级
else if(useCondition == "50" ){
useLimitStr = useConditionName + "<br>" + useConditionJudge + "<font color=blue>【" + useConditionNum + "】</font>" ;
}
//使用者的境界等级
else if(useCondition == "51" ){
useLimitStr = useConditionName + useConditionJudge + "<br><font color=blue>【" + ablestagerewardtable[useConditionNum].NAME + "】</font>" ;
}
//技能本身的等级
else if(useCondition == "52" ){
useLimitStr = $("<span><span>").append(findSkillTips(skilldata[useConditionNum])).append("<br>("+map["判断"]+")").append(jumpTabHref(skilldata[useConditionNum]));
}
//装备的武器类型
else if(useCondition == "53" ){
var equipTypeName = equipTypeSimple[useConditionNum];
//如果不是普通装备,则去装备中找名字
if(! equipTypeName ){
//equipTypeName = equipexdatatable[useConditionNum].NAME;
useLimitStr = $("<span>"+useConditionName + useConditionJudge + "<br></span>").append(findMapTips(useConditionNum));
}else{
useLimitStr = useConditionName + useConditionJudge + "<br><font color=blue>【" + equipTypeName + "】</font>";
}
}
//当前激活的内功
else if(useCondition == "54" ){
useLimitStr = $("<span>"+useConditionName + useConditionJudge+"<br><span>").append(findSkillTips(skilldata[useConditionNum])).append(jumpTabHref(skilldata[useConditionNum]));
}
//施法者是否拥有指定BUFF
else if(useCondition == "55" ){
useLimitStr = useConditionName + useConditionJudge + "<br><font color=blue>【" + buffdatatable[useConditionNum].NAME + "】</font>";
}
//当前目标是否拥有指定BUFF
else if(useCondition == "56" ){
useLimitStr = skillTarget[map["目标"]] + useConditionName + "<br><font color=blue>【" + buffdatatable[useConditionNum].NAME + "】</font>";
}
//身上是否穿着指定装备
else if(useCondition == "57" ){
//useLimitStr = useConditionName + "<br><font color=blue>【" + equipexdatatable[useConditionNum].NAME + "】</font>";
useLimitStr = $("<span>"+useConditionName + useConditionJudge + "<br></span>").append(findMapTips(useConditionNum));
}
//当前宠物是否特定类型
else if(useCondition == "58" ){
useLimitStr = $("<span>"+useConditionName + "<br></span>").append(findMapTips(useConditionNum)).append(jumpTabHref(pettable[useConditionNum]));
}
//使用者指定属性大于等于指定属性
else if(useCondition == "59" ){
useLimitStr = "<font color=blue>【" + gameattribstringtable[map["判断"]]["属性"] +"】<br>" + useConditionNum + "</font>";
}
else{
useLimitStr = useConditionName;
}
}
return useLimitStr;
}
function item203Tips(map){
//指向宠物技能
if(/4[0-9]{4}/.test(map.value1)){
return map.NAME + ":"+ item203ShouJueTips(map.value1);
}
//指向多个宠物技能表
else if(/[0-9]{1,4}/.test(map.value1)){
var psoddMap = petskilloddsdata[map.value1];
if(psoddMap){
var mtpis = "";
mtpis += "";
$.each(psoddMap,function(key,value){
if(/4[0-9]{4}/.test(key)){
if(value>0){
mtpis += item203ShouJueTips(key) + "<br>";
}
}
});
var giftData = $("<span style='color:green'>"+map.NAME+"</span>");
mtpisListener(giftData,mtpis);
var giftDiv = $("<span></span>");
giftDiv.append(giftData);
return giftDiv;
}else{
console.log("兽决定位不到技能:"+map.value1)
}
}
}
function item203ShouJueTips(id){
var petSkillMap = petskilldata[id];
if(petSkillMap){
return petSkillMap.NAME;
}else{
console.log("兽决定位不到技能:"+id)
}
}
/*
怪物扩展属性tips
*/
function findExtraAttrTips(str){
var div = $("<div></div>");
if(str && str != "0"){
//属性ID:值
//值可能是几率、buffID
//500 附加状态几率 501 附加状态ID
//属性ID> 60000为buffID,值为 几率( 除以100)即,1500 / 100 = 15%
var rate_500 = "";
var extra_501_arr = [];
var buff_arr = [];
$.each(str.split(";"),function(index,attr){
var attrArr = attr.split(":");
var id = attrArr[0];
var val = attrArr[1];
if("500" == id){
rate_500 = val;
}else if("501" == id){
extra_501_arr.push(val);
}else{
// buffID
if(parseInt(id) > 60000){
buff_arr.push({"buffId":id,"rate":(parseInt(val/100))});
}else{
var attrMap = gameattribstringtable[id];
var attrName = "未知属性";
if(attrMap){
attrName = attrMap["属性"];
div.append("<div>"+attrName+":"+val+"</div>");
}
}
}
});
var hrFlag = true;
//同时存在500和501
if(extra_501_arr.length > 0){
$.each(extra_501_arr,function(index,buffId){
var buffMap = buffdatatable[buffId];
if(buffMap){
if(div.html() && hrFlag){
hrFlag = false;
div.append("<hr>");
}
div.append($("<div>" + rate_500 + "%几率触发:</div>").append(findBuffTips({"效果1-类型":buffId,"目标":"0"})));
}
});
}
$.each(buff_arr,function(index,buff){
var buffMap = buffdatatable[buff.buffId];
if(buffMap){
if(div.html() && hrFlag){
hrFlag = false;
div.append("<hr>");
}
div.append($("<div>" + buff.rate + "%几率触发:</div>").append(findBuffTips({"效果1-类型":buff.buffId,"目标":"0"})));
}
});
}
return div;
}
/*
宠物初始属性值
*/
function findPetInitAttr(map){
var descript = "<hr>";
var gift = petskilldata[map["天赋"]];
descript += "<p>名称:"+map["NAME"]+"</p>";
descript += "<p>初始品阶:"+map["品阶"]+"</p>";
descript += "<p>御力要求:"+map["御力"]+"</p>";
descript += "<p>体力:"+map["HP"]+"</p>";
descript += "<p>法力:"+map["MP"]+"</p>";
descript += "<p>攻击:"+map["AttackL"]+"-"+map["AttackH"]+"</p>";
descript += "<p>法攻:"+map["MAttack"]+"</p>";
descript += "<p>防御:"+map["Def"]+"</p>";
descript += "<p>护甲:"+map["Arm"]+"</p>";
descript += "<p>速度:"+map["Speed"]+"</p>";
descript += "<p>暴击率:不知道怎么算</p>";//map["CritOdds"]
descript += "<p>暴击伤害:不知道怎么算</p>";//map["CritL"])
descript += "<p>成长:"+map["grow"]+"</p>";
descript += "<p>天赋:"+(gift?gift.NAME:"")+"</p>";
return descript;
}
function jumpTabHref(from){
if(from){
var map = globalsearch[from.ID];
if(map){
return "<a target='_blank' href="+map.url+"?tab="+map.panel+"&&searchName="+from.NAME+ "%20" +map.py+"><span class='glyphicon glyphicon-send'></span></a>";
}
}
return "";
}
//超链接包裹跳转
function jumpTabHref2(obj,from){
if(from){
var map = globalsearch[from.ID];
if(map){
return $("<a target='_blank' href="+map.url+"?tab="+map.panel+"&&searchName="+from.NAME+ "%20" +map.py+"></a>").append(obj);
}
}
return obj;
}
/*
* 激活Tab页
*/
function activeTab(href){
if(href){
href = href.replace(/[#-]/g,"");
href = href.replace(/^panel/,"");
href = tabSpecMap[href] == undefined ? href : tabSpecMap[href];
if(tabFlagMap[href] != undefined && tabFlagMap[href] == false){
tabFlagMap[href] = true;
tabFuncMap[href]();
}
}
}
function tableSearch(){
if(curVersionIndex != -1){
setTimeout(function(){
$().UItoTop({ easingType: 'easeOutQuart' });
//初始化搜索欄
var tab = getUrlParams("tab");
var tabId = "#"+tab;
if(tab && $(tabId).length>0 ){
//先激活Tab页
activeTab(tab);
$("#panel-tab li").addClass("active");
$("#panel-tab div").addClass("active");
$("#panel-tab div .active:not("+tabId+")").removeClass("active");
$("#panel-tab li .active").removeClass("active");
$("a[href='"+tabId+"']").parent().addClass("active");
var searchName = getUrlParamsCn("searchName");
if(searchName){
var searchInput = $("input",$(tabId));
searchInput.val(searchName);
searchInput.keyup();
}
}else{
$("#panel-tab li .active:not(:first-child)").removeClass("active");
$("#panel-tab div .active:not(:first-child)").removeClass("active");
}
},500);
}
}
/*
"58":"当前宠物类型"//当前宠物是否特定类型
"59":"属性",//使用者指定属性大于等于指定属性
function findFromMap(id){
//发现,解锁
var discover = map["发现"];
discover = map[discover];
discover = discover?discover:
var unlock = map["解锁"];
var map = maptable[id];
if(!map){
map = gate
}
}
*/
function formatRememberLabel(){
var label = $("<span></span>");
label.addClass("label");
label.html("转世保留");
label.css("background-color","#CD4F39");
return label;
} |