Spaces:
Runtime error
Runtime error
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; | |
} | |
} |