Spaces:
Runtime error
Runtime error
File size: 5,825 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 |
var equipattriboddsMap = {};
$(function(){
tabFlagMap["equip"] = false;
tabFuncMap.equip = function(){
var index = 0;
for(var o in equipattribodds){
var oMap = equipattribodds[o];
var attrNameArr = [];
var keys = Object.keys(oMap);
for(var key in keys){
var attrId = keys[key];
var oData = oMap[attrId];
if(oData > 0){
var attrMap = gameattribstringtable[attrId];
if(attrMap){
attrNameArr.push(attrMap["属性"]);
}
}
}
equipattriboddsMap[oMap.ID] = "<span style='color:red' title='" + attrNameArr.join(",") + "'>【"+oMap.DESCRIPT+"】</span>";
}
$.each(equipexdatatable,function(key,map){
var tr = $("<tr align='center'></tr>");
$("#equipTable tbody").append(tr);
var equipName = $("<td><span style='color:brown;font-size:2rem;'>"+map.NAME+"</span></td>");
var x = parseInt(map.ICON%15);
var y = parseInt(map.ICON/15);
var descript = map.DESCRIPT;
var equipAttrRange = equipAttr(map);
var equipAttrRangeTd = "<td><div style='margin-left:30%;text-align:left;'>" + equipAttr(map,"#ff6600") + "</div></td>";
descript += "<br>=======属性范围=========<br>" + equipAttrRange;
var icon2 = $("<div style='margin-bottom:1rem;'><div class='item quality_"+map["品阶"]+"' style='background:url(images/itemIconEx.bmp) -"+(x*40+2)+"px -"+(y*40+2)+"px no-repeat;margin:0 25px 0 25px;' ></div></div>");
var mtpis=getMtpis(descript);
mtpisListener(icon2,mtpis);
equipName.prepend(icon2);
var equipTypeDiv = $("<div style='color:gray;'>"+equipTypeData[map["分类"]]+"</div>");
if(map["分类"]=="0"){
equipTypeDiv = $("<div style='color:gray;'>"+equipTypeData[map["分类"]][map["子分类"]]+"</div>");
}
var equipLevelDiv = $("<div style='color:#ff6600;'>Lv:"+map["Level"]+"</div>");
equipName.append(equipLevelDiv);
equipName.append(equipTypeDiv);
var limit = $("<td></td>").append(findSkillUseLimit(map));
var suitNameTd = $("<td></td>");
var suit = $("<td></td>").append(findSuitTips(map["套装"]));
var equipFrom = $("<td></td>");
$.each(map.SOURCE_FROM,function(key,sourceId){
//是否有隐藏产物的配方来源
if(hideProduct[sourceId]){
return;
}
equipFrom.append($("<div></div>").append(findMapTips(sourceId)));
});
tr.append($("<td>"+map.INDEX+"</td>"));
tr.append(equipName);
tr.append(equipAttrRangeTd);
tr.append(suit);
tr.append(limit);
tr.append(equipFrom);
icon2.append("<span style='display:none;'>"+map["PY"]+"</span>");
index++;
});
/*equipTable*/
$('#equipTable').dataTable( {
"pagingType": "full_numbers",
"language": {
"lengthMenu": "每页 _MENU_ 条记录",
"zeroRecords": "没有找到装备,一定是你没充值VIP!",
"info": "第 _PAGE_ 页 ( 总共 _PAGES_ 页 )",
"infoEmpty": "没有装备",
"infoFiltered": "(从 _MAX_ 条装备过滤)",
"search": "搜索(可用<font color='red'>名称</font>首字母):",
"paginate": {
"first": "首页<font color=red>(W)</font>",
"last": "末页<font color=red>(S)</font>",
"next": "下一页<font color=red>(D)</font>",
"previous": "上一页<font color=red>(A)</font>"
},
},
// 默认按照索引排序,且隐藏索引列
"order": [[ 0, "asc" ]],
"columnDefs": [
{
"targets": [ 0 ],
"visible": false,
"searchable": false
},
]
});
$('#equipTable th').css("text-align","center");
}
});
/*
装备属性波动(上限需要减1)
*/
function equipAttr(map, color){
var attr1 = ["分类2","生成","属性","范围L","范围L3","范围H","范围H4"];
var str = "";
//第一个属性
if(map['生成'] != "0"){
var attrName = "";
if(map['生成'] == "1") {
var attrMap = gameattribstringtable[map["属性"]];
attrName = attrMap ? attrMap["属性"] :"未知属性";
}else if (map['生成'] == "2" ) {
attrName = equipattriboddsMap[map["属性"]];
}
attrName += ":";
var rangeL = "";
var rangeH = "";
if(map["范围L"] != 0 && map["范围L3"] != 0 ){
if(map["范围L"] != map["范围L3"]){
rangeL = "("+map["范围L"] + "~" + map["范围L3"] + ")";
}else{
rangeL = map["范围L"];
}
}
if(map["范围H"] != 0 && map["范围H4"] != 0 ){
if(map["范围H"] != map["范围H4"]){
rangeH = "("+map["范围H"] + "~" + map["范围H4"] + ")";
}else{
rangeH = map["范围H"];
}
}
str = attrName + rangeL + (rangeL && rangeH ? (" - " + rangeH ):rangeH);
str = fontColor(map["分类2"],str, color) ;
}
//第2~第5个属性
var index = 0;
var keyArr = ["分类5","生成6","属性7","范围","范围8",
"分类9","生成10","属性11","范围12","范围13",
"分类14","生成15","属性16","范围17","范围18",
"分类19","生成20","属性21","范围22","范围23"];
for(var i = 0;i<4;i++){
var fenlei = map[keyArr[5*i]];
var shengcheng = map[keyArr[5*i+1]];
var shuxing = map[keyArr[5*i+2]];
var rangeL = map[keyArr[5*i+3]];
var rangeH = map[keyArr[5*i+4]];
var attrName = "";
if(shengcheng == "1") {
var attrMap = gameattribstringtable[shuxing];
attrName = attrMap ? attrMap["属性"] :"未知属性";
}else if (shengcheng == "2" ) {
attrName = equipattriboddsMap[shuxing];
}
if(shengcheng != "0"){
str += "<br>" + fontColor(fenlei,attrName + ":" + (rangeL==rangeH ? rangeL : (rangeL + (rangeL && rangeH ? (" - " + rangeH ):rangeH))) , color);
}
}
return str;
}
/*
属性
0 基本属性
1 附加属性
2 强化属性
3 套装属性
生成
0 无效属性
1 指定属性
2 随机属性
*/
function fontColor(type,str,color){
if(type == "1"){
return "<font color="+ (color ? color : "yellow") +">"+str+"</font>";
}else{
return str;
}
} |