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] = "【"+oMap.DESCRIPT+"】"; } $.each(equipexdatatable,function(key,map){ var tr = $(""); $("#equipTable tbody").append(tr); var equipName = $(""+map.NAME+""); var x = parseInt(map.ICON%15); var y = parseInt(map.ICON/15); var descript = map.DESCRIPT; var equipAttrRange = equipAttr(map); var equipAttrRangeTd = "
" + equipAttr(map,"#ff6600") + "
"; descript += "
=======属性范围=========
" + equipAttrRange; var icon2 = $("
"); var mtpis=getMtpis(descript); mtpisListener(icon2,mtpis); equipName.prepend(icon2); var equipTypeDiv = $("
"+equipTypeData[map["分类"]]+"
"); if(map["分类"]=="0"){ equipTypeDiv = $("
"+equipTypeData[map["分类"]][map["子分类"]]+"
"); } var equipLevelDiv = $("
Lv:"+map["Level"]+"
"); equipName.append(equipLevelDiv); equipName.append(equipTypeDiv); var limit = $("").append(findSkillUseLimit(map)); var suitNameTd = $(""); var suit = $("").append(findSuitTips(map["套装"])); var equipFrom = $(""); $.each(map.SOURCE_FROM,function(key,sourceId){ //是否有隐藏产物的配方来源 if(hideProduct[sourceId]){ return; } equipFrom.append($("
").append(findMapTips(sourceId))); }); tr.append($(""+map.INDEX+"")); tr.append(equipName); tr.append(equipAttrRangeTd); tr.append(suit); tr.append(limit); tr.append(equipFrom); icon2.append(""+map["PY"]+""); index++; }); /*equipTable*/ $('#equipTable').dataTable( { "pagingType": "full_numbers", "language": { "lengthMenu": "每页 _MENU_ 条记录", "zeroRecords": "没有找到装备,一定是你没充值VIP!", "info": "第 _PAGE_ 页 ( 总共 _PAGES_ 页 )", "infoEmpty": "没有装备", "infoFiltered": "(从 _MAX_ 条装备过滤)", "search": "搜索(可用名称首字母):", "paginate": { "first": "首页(W)", "last": "末页(S)", "next": "下一页(D)", "previous": "上一页(A)" }, }, // 默认按照索引排序,且隐藏索引列 "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 += "
" + 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 ""+str+""; }else{ return str; } }