hhhwmws's picture
Upload 79 files
56e6e25 verified
$(function(){
var index = 0;
/*itemTable*/
var oldTable = $('#itemTable').dataTable( {
"pagingType": "full_numbers",
"language": {
"lengthMenu": "每页 _MENU_ 条记录",
"zeroRecords": randomTip(),//"<h1><img src='../images/a1.gif'>正在初始化中,你信不信<img src='../images/a2.gif'></h1>",
"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(A)",
},
},
// 默认按照索引排序,且隐藏索引列
"order": [[ 0, "asc" ]],
"columnDefs": [
{
"targets": [ 0 ],
"visible": false,
"searchable": false
},
]
});
$('#itemTable th').css("text-align","center");
setTimeout(function(){
oldTable.fnClearTable(); //清空数据
oldTable.fnDestroy(); //销毁datatable
$.each(itemtable,function(key,map){
var tr = $("<tr align='center'></tr>");
//如果物品是兽决、技能卡牌,那么追加 技能描述
var itemName = map.NAME;
var type1 = map["type1"];
var value1 = map["value1"];
var x = parseInt(map.ICON%15);
var y = parseInt(map.ICON/15);
var descript = map.DESCRIPT;
if(type1 == "302"){
itemName += "("+value1+")";
}
if(type1 == "203"){
//itemName = item203Tips(map);
}else if(type1 == "123"){
var taskMap = tasktable[value1];
if(taskMap){
var itemMap = itemtable[taskMap["产物"]];
if(itemMap){
itemName += ":"+itemMap.NAME;
var costTime = "";
var taskTime = taskMap["总进度"];
if(taskTime < 60){
costTime = taskTime + "秒";
}else if(taskTime < 3600){
costTime = (parseInt(taskTime / 60)) + "分钟";
}else{
costTimeTemp = (taskTime/3600).toFixed(1);
//末尾是0,则不保留小数位
if(costTimeTemp.charAt((costTimeTemp+"").length-1) == "0"){
costTime = (taskTime/3600).toFixed(0) + "小时";
}else{
costTime = (taskTime/3600).toFixed(1) + "小时";
}
}
descript += "<font color=yellow>"
+ "<br>产物:" + itemMap.NAME
+ "<br>每次消耗灵气:"+taskMap["消耗灵气"]
+ "<br>产量:" + taskMap["产物数量L"] +"-"+ taskMap["产物数量H"]
+ "<br>预计时长:" + costTime
+ "</font>"
;
}else{
console.log("种植物品定位不到:"+taskMap["产物"])
}
}else{
var makerecipeMap = makerecipedata[value1];
if(makerecipeMap){
itemName += ":【配方】"+makerecipeMap.NAME;
}else{
console.log(map);
}
}
}else if(type1 == "115"){
//地图门票
var mapMap = gatetable[value1];
if(!mapMap){
mapMap = maptable[value1];
}
if(mapMap){
itemName += ":"+mapMap.NAME;
}
}else if(/技能卡牌/.test(map.NAME)){
var skillMap = skilldata[value1];
if(skillMap){
itemName += ":"+skillMap.NAME;
}else{
console.log("技能卡牌定位不到技能:"+value1)
}
}
//对于丹方、配方,隐藏掉描述内容,避免泄露组成方式
if(/的.*(丹方|配方)/.test(map.NAME)){//的.*丹方|的.*配方
descript = "不许偷看";
}
if(type1 == "110" || (type1 == "105" && value1 != 0) ){
descript += "<br><font color=yellow>【药效:"+value1+",上限:"+map["Level"]+"】</font>";
}else if(type1 == "118"){
descript += "<br><font color=yellow>【药效:"+value1+" ,上限:"+map["Level"]+"】<br>【或修为:"+formateNum(value1*100000)+"】</font>";
}else if(type1 == "126"){
descript += "<br><font color=yellow>境界变更至:"+ablestagerewardtable[value1].NAME+"</font>";
}else if(type1 == "129"){
var linggenName = "随机";
var linggenType = map["从分类"]
if(linggenType < 5){
linggenName = wuxing[parseInt(linggenType) + 1];
}
descript += "<br><font color=yellow>增加"+linggenName+"灵根"+ value1 +"点,上限"+map["Level"]+"点</font>";
}else if(type1 == "130"){
descript += "<br><font color=yellow>献祭值:"+map["value1"]+"</font>";
}else if(type1 == "132"){
var attrName = itemType3Data[map["从分类"]];
var attrNum = value1;
var attrTimes = map["Level"];
descript += "<br><font color=yellow>每次增加"+attrNum+"点"+attrName+"<br>最多服用"+attrTimes+"次<br>总计:"+formateNum(parseInt(attrNum) * parseInt(attrTimes))+"点"+attrName+"</font>";
}
var icon = $("<div style='margin-bottom:1rem;'><div class='item quality_"+map["品质"]+"' style='background:url(images/itemIcon.bmp) -"+(x*40+2)+"px -"+(y*40+2)+"px no-repeat;margin:0 25px 0 25px;' ></div></div>");
var mtpis=getMtpis(descript);
mtpisListener(icon,mtpis);
if(!itemTypeData[map["分类"]]){
console.error(map);
return;
}
var itemType = $("<td>"+itemTypeData[map["分类"]]["name"]+"</td>");
var itemUseLimit = findSkillUseLimit(map);
var itemUseStr = itemTypeData[map["分类"]][map["子分类"]];
var itemUse = $("<td>"+(type1 == "123" ? (taskMap?"种植":"配方") : (itemUseStr?itemUseStr:"我也不知道!"))+"</td>");
if(type1 == "200" || type1 == "202"){
itemUse.append(findSkillTipsFromSkill(value1));
} else if(type1 == "203" ){
//指向宠物技能
if(/4[0-9]{4}/.test(map.value1)){
itemUse.append($("<div></div>").append(findPetSkillTips(value1)));
}
//指向多个宠物技能表
else if(/[0-9]{1,4}/.test(map.value1)){
var psoddMap = petskilloddsdata[map.value1];
if(psoddMap){
$.each(psoddMap,function(psoddkey,psoddvalue){
if(/4[0-9]{4}/.test(psoddkey)){
if(psoddvalue>0){
itemUse.append($("<div></div>").append(findPetSkillTips(psoddkey)));
}
}
});
}else{
console.log("兽决定位不到技能:"+map.value1)
}
}
} else if(type1 == "201" ){
itemUse.append($("<div>最大突破等级:</div>").append(map.value2));
itemUse.append(findSkillTipsFromSkill(value1));
}
var itemFrom = $("<td></td>");
$.each(map.SOURCE_FROM,function(key,sourceId){
//是否有隐藏产物的配方来源
if(hideProduct[sourceId]){
return;
}
itemFrom.append($("<div></div>").append(findMapTips(sourceId)));
});
var equipLevelDiv = $("<div style='color:#ff6600;'>Lv:"+map["Level"]+"</div>");
var itemNameTd = $("<td></td>").append(icon).append("<span style='color:brown;font-size:2rem;'></span>").append(itemName).append(equipLevelDiv);
tr.append($("<td>"+map.INDEX+"</td>"));
//tr.append(icon);
tr.append(itemNameTd);
tr.append(itemType);
tr.append(itemUse);
tr.append($("<td></td>").append(itemUseLimit));
tr.append("<td>"+map["最大叠加"]+"</td>");
tr.append(itemFrom);
icon.append("<span style='display:none;'>"+map["PY"]+"</span>");
index++;
$("#itemTable tbody").append(tr);
});
/*itemTable*/
$('#itemTable').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(A)",
},
},
// 默认按照索引排序,且隐藏索引列
"order": [[ 0, "asc" ]],
"columnDefs": [
{
"targets": [ 0 ],
"visible": false,
"searchable": false
},
]
});
$('#itemTable th').css("text-align","center");
tableSearch();
},1000);
});