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 = $(""); 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 += "

地图名称:"+bornName+"

"; mtpis += "

地图等级:"+bornLevel+"

"; mtpis += "

推荐境界:"+bornSuggest+"

"; //mtpis += discover?"

发现:"+discover+"

":""; //mtpis += unlock?"

解锁:"+unlock+"

":""; mtpis += "

地图描述:"+bornDescript+"

"; bornName = bornName+""; }else if(isFromPeifang){ bornName ="配方:"+map.NAME; mtpis += "

配方名称:"+bornName+"

"; if(downloadFile[curVersionIndex].hideItemMakeRecipe && map.IGNORE){ //隐藏 mtpis += "

请从游戏中获取配方详细

"; }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"; }else{ mtpis += "

原料"+i+":"+material.NAME+"×"+needNum+"

"; } } } } }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 += "

怪物名称:"+bornName+"

"; mtpis += "

等级:"+monsterLevel+"

"; mtpis += "

五行:"+monsterWuxing+"

"; mtpis += "

来源:"+monsterFrom+"

"; //mtpis += "

描述:"+bornDescript+"

"; }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+ ""+itemFromType +"; "; }); //var limit = findLimitDescript(map); var limit = $("
").append(findLimitDescript(map)).html(); var itemUseStr = itemTypeData[map["分类"]][map["子分类"]]; var x = parseInt(map.ICON%15); var y = parseInt(map.ICON/15); mtpis += "
"; mtpis += "

名称:"+bornName+"

"; mtpis += "

用处:"+itemUseStr+"

"; mtpis += "

限制:"+limit+"

"; mtpis += "

堆叠:"+map["最大叠加"]+"

"; mtpis += "

来源:"+itemFrom+"

"; mtpis += "

描述:"+bornDescript+"

"; }else if(isFromPet){//来源为宠物 return findPetTip(id).append(jumpTabHref(map)); }else if(isFromAchive){//来源为成就 bornName = "成就:"+map.NAME; mtpis += "

名称:"+bornName+"

"; mtpis += "

描述:"+map.DESCRIPT+"

"; }else{//来源为装备 if(!map){ //console.log(id); return bornDiv; } return findEquipTips(id).append(jumpTabHref(map)); } var bornData = $(""+bornName+""); mtpisListener(bornData,mtpis); bornDiv.append(bornData).append(jumpTabHref(map)); return bornDiv; } //宠物技能ID获取tip function findPetSkillTips(id){ var giftDiv = $(""); 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+"
"+findSkillRewardInfo(map); var giftType = map["触发"]; var giftManaCost = map["耗蓝"]; if(giftType=="0"){ giftType = "被动"; }else{ giftType = "主动"; } var wuxingName = wuxing[map["五行"]]; var mtpis = ""; var skillIcon = "
"; mtpis += skillIcon; mtpis += "

名称:"+giftName+"

"; mtpis += "

五行:"+wuxingName+"

"; mtpis += "

类型:"+giftType+"

"; if(giftManaCost != "0"){ mtpis += "

耗蓝:"+giftManaCost+"%

"; } mtpis += "

效果:"+gitfDescript+"

"; var giftData = $(""+giftName+""); mtpisListener(giftData,mtpis); giftDiv.append(giftData); return giftDiv; } } //宠物ID获取tip function findPetTip(id){ var giftPetDataDiv = $(""); 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 += "
"; mtpis += "

名称:"+map.NAME+"

"; mtpis += "
成长:"+map.grow+"
"; mtpis += "
天赋:"+(map["天赋"]!="0"?petskilldata[map["天赋"]].NAME:"")+"
"; mtpis += "
御力:"+map["御力"]+"
"; mtpis += "
出处:"+born+"
"; mtpis += getMtpis(map.DESCRIP?map.DESCRIP:""); var giftPetData = $(""+map.NAME+""); mtpisListener(giftPetData,mtpis); giftPetDataDiv.append(giftPetData); return giftPetDataDiv; } //Buff获取提示 function findBuffTips(skillmap){ var id = skillmap["效果1-类型"]; var stateDiv = $(""); 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 += "
"; } //有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 += "

名称:"+map.NAME+"

"; mtpis += "

目标:"+skillTarget[skillmap["目标"]]+"

"; mtpis += "

几率:"+calcBuffRateFormual(skillmap)+"%

"; mtpis += "

类型:"+(map["是否增益"] == "0" ? "减益" : "增益")+"

"; mtpis += "

效果:"+effectTotal+"

"; mtpis += "

持续:"+map["持续回合"]+"

"; mtpis += "

最大层数:"+map["最大层数"]+"

"; mtpis += "

公式:"+ (formual ? ("" + targetEffectName+" = "+formual) : "") +"

"; //mtpis += getMtpis(map.DESCRIPT)"; var stateData = $(""+map.NAME+""); mtpisListener(stateData,mtpis); stateDiv.append(stateData); } } return stateDiv; } function findPrefixTip(map){ var stateDiv = $(""); 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 += "
"; } //有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 += "

"+effectTotal+"

"; var stateData = $(""+map.NAME+""); 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 = $("
"); 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 + ""+itemFromType +"; "; } }); var mtpis = ""; if(map["ICON"] > 0 ){ var x = parseInt(map["ICON"]%15); var y = parseInt(map["ICON"]/15); mtpis += "
"; } mtpis += "

名称:"+map.NAME+"

"; if(map["五行"]){ mtpis += "

五行:"+wuxing[map["五行"]]+"

"; } var itemUseStr = itemTypeData[map["分类"]][map["子分类"]]; if(itemUseStr){ mtpis += "

用处:"+itemUseStr+"

"; } //物品来源,使用限制 if(fromItem){ var condition = map["条件"]; var judge = map["判断"]; var target = map["条件值"]; if(condition == "51"){ mtpis += "
限制:"+ablestagerewardtable[target].NAME+"
"; }else if(condition == "52"){ if(!skilldata[target]){ console.log(map.NAME+map.ID+":条件值错误:"+target); mtpis += "
限制:作者这里有bug
"; }else{ if(map["分类"] == "0"){ mtpis += "
限制:"+skilldata[target].NAME+judge+"重
"; }else{ mtpis += "
限制:"+skilldata[target].NAME+judge+"级
"; } } }else{ } } mtpis += "

来源:"+sourceFrom+"

"; mtpis += getMtpis(map.DESCRIPT); var dataDiv = $(""+map.NAME+""); mtpisListener(dataDiv,mtpis); div.append(dataDiv).append(jumpTabHref(map)); } return div; } function findSkillTipsFromGatePass(gateId){ var div = $("
"); var map = gatetable[gateId]; if(map){ return findMapTips(gateId).prepend("通关副本:
"); } 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 + "" + useConditionNum + ""; } //生命、法力比例 else if(useCondition == "3" || useCondition == "4"){ useLimitStr = skillTarget[map["目标"]] + useConditionName + useConditionJudge + "" + useConditionNum + "%" + ""; } //宠物等级 else if(useCondition == "50" ){ useLimitStr = useConditionName + "" + useConditionJudge + "【" + useConditionNum + "】" ; } //使用者的境界等级 else if(useCondition == "51" ){ useLimitStr = useConditionName + useConditionJudge + "【" + ablestagerewardtable[useConditionNum].NAME + "】" ; } //技能本身的等级 else if(useCondition == "52" ){ useLimitStr = $("").append(findSkillTips(skilldata[useConditionNum])).append("("+map["判断"]+")"); } //装备的武器类型 else if(useCondition == "53" ){ var equipTypeName = equipTypeSimple[useConditionNum]; //如果不是普通装备,则去装备中找名字 if(! equipTypeName ){ //equipTypeName = equipexdatatable[useConditionNum].NAME; useLimitStr = $(""+useConditionName + useConditionJudge + "").append(findMapTips(useConditionNum)); }else{ useLimitStr = useConditionName + useConditionJudge + "【" + equipTypeName + "】"; } } //当前激活的内功 else if(useCondition == "54" ){ useLimitStr = $(""+useConditionName + useConditionJudge+"").append(findSkillTips(skilldata[useConditionNum])); } //施法者是否拥有指定BUFF else if(useCondition == "55" ){ useLimitStr = useConditionName + useConditionJudge + "【" + buffdatatable[useConditionNum].NAME + "】"; } //当前目标是否拥有指定BUFF else if(useCondition == "56" ){ useLimitStr = skillTarget[map["目标"]] + useConditionName + "【" + buffdatatable[useConditionNum].NAME + "】"; } //身上是否穿着指定装备 else if(useCondition == "57" ){ useLimitStr = $(""+useConditionName + useConditionJudge + "").append(findMapTips(useConditionNum)); } //当前宠物是否特定类型 else if(useCondition == "58" ){ useLimitStr = $(""+useConditionName + "").append(findMapTips(useConditionNum)); } //使用者指定属性大于等于指定属性 else if(useCondition == "59" ){ useLimitStr = "【" + gameattribstringtable[map["判断"]]["属性"] +"】" + useConditionNum + ""; } else{ useLimitStr = useConditionName; } } return useLimitStr; } //套装tips function findSuitTips (id){ var 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 += "

套装名称:"+map.NAME+"

"; mtpis += "

包含组件:"+suitEquips+"

"; mtpis += "
属性:"+suitAttr+"
"; var dataDiv = $(""+map.NAME+""); mtpisListener(dataDiv,mtpis); div.append(dataDiv); } return div; } //获取装备提示 function findEquipTips (id){ var map = equipexdatatable[id]; if(!map){ return; } var quality = "quality_"+map["品阶"]; var div = $(""); 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 += "
"; } mtpis += "

名称:"+map.NAME+"

"; mtpis += "

类型:"+getEquipType(map)+"

"; mtpis += "

等级:"+map["Level"]+"

"; //物品来源,使用限制 var condition = map["条件"]; var judge = map["判断"]; var target = map["条件值"]; if(condition == "51"){ var limitMap = ablestagerewardtable[target]; if(limitMap){ mtpis += "
限制:"+limitMap.NAME+"
"; } }else if(condition == "52"){ var limitMap = skilldata[target]; if(limitMap){ if(map["分类"] == "0"){ mtpis += "
限制:"+limitMap.NAME+judge+"重
"; }else{ mtpis += "
限制:"+limitMap.NAME+judge+"级
"; } } }else{ } mtpis += "

来源:"+sourceFrom+"

"; mtpis += "

描述:

"; 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 += "
套装名称:"+suitMap.NAME+"
"; mtpis += "
组件:"+suitEquips+"
"; mtpis += "
属性:"+findSuitAttr(suitMap)+"
"; } } var dataDiv = $(""+map.NAME+" "); 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;i0){ 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 += "
["+num+"]:"+effect+"
"; } } 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 += "
类型:【" + skillType[category] + "】"; if(giftManaCost != "0"){ resultDescript += "
耗蓝:" + giftManaCost + "%"; } if(category == "12"){ var comboL = map["威力2"]; var comboH = map["成长2"]; var comboDescript = "
连击次数:"; if(comboL == comboH){ comboDescript += comboL; }else{ comboDescript += comboL + "~" + comboH; } resultDescript += comboDescript; } if(map["伤害因子"] != "0"){ var dmgTypeName = dmgType[map["伤害因子"]]; resultDescript += "
伤害因子:【" + dmgTypeName + "】"; } //功法类 if(map["分类"] == "0"){ resultDescript += "
启用加成:
"+foreverReward(map,true,"#ff6600")+"
"; } resultDescript += "
被动加成:
"+foreverReward(map,false,"#ff6600")+"
"; 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 += "" + xAttr+"("+getCalcMethod(formual,k,b,levelTarget)+")
"; } } 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)+"%
"; }else{ result += xAttr+rewardNum+"
"; } } } return result; } //获取格式化的mtpis function getMtpis(descript){ return "
" +descript +"
"; } /*获取装备类型*/ 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%敌人的伤害
体格越强壮反震越厉害(${dt})", "7":"反击d%敌人的+c%自身的伤害(${dt})", "8":"防御+a
护甲+b
防御提升d%", "9":"防御提高+a%
护甲+b
并对敌人造成d%的${dt}", "10":"吸收所收到的伤害:
每点法力吸收d点伤害
最大吸收c%", "11":"功法:不在此列", "12":"对敌人造成a~b次d%的${dt}", "13":"防御提高+a%
护甲+b
并对敌人造成受到伤害的d%的${dt}", "14":"物伤提高d%,
并恢复造成伤害的c%的生命(${dt})", "15":"对目标造成d%的${dt},
目标所附带的[a]状态时额外造成c%的伤害,
并刷新状态持续回合", "16":"对目标造成d%的${dt},
目标所附带的[a]状态时额外造成c%的伤害,
并刷新状态持续回合", "17":"普通攻击一次,并额外附带a点~b点${wx}系伤害", "19":"光环 被动", "20":"为最虚弱的队友恢复d%的法术伤害", "22":"防御提高+a
护甲+b
并把防御抵消的伤害的d%转成体力恢复", "23":"防御提高+a
护甲+b
并把防御抵消的伤害的d%转成法力恢复", "24":"对目标造成d%${dt},并受法术伤害影响(c%)", "25":"心法等级提升时随机提升${wx}系灵根a~b点", "27":"有d%基础几率闪避对手的攻击", "28":"把一枚铜钱作为暗器丢向敌人,
造成d%的${dt},
并且本次攻击如果暴击的话,
暴击伤害额外提高c%", "29":"把口袋力所有铜钱的1%丢向敌人,
对目标造成d%的基础${dt}。
丢的越多伤害越高", "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"? "
耗蓝:"+giftManaCost+"%
" : "")+"伤害关联:"+dmgType[hasSkill["伤害因子"]]+"
" + 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 = $("
"); $.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($("

"+ "第" + learnLv + "重领悟:

").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 += "
"; } mtpis += "

名称:"+skill.NAME+"

"; if(skill["五行"]){ mtpis += "

五行:"+wuxing[skill["五行"]]+"

"; } mtpis += "

"+findSkillRewardInfo(skill) +"

"; //mtpis += "

来源:"+map.NAME+"

"; mtpis += getMtpis(skill.DESCRIPT); var dataDiv = $(""+skill.NAME+""); 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 = $(""); 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 + "" + useConditionNum + ""; } //生命、法力比例 else if(useCondition == "3" || useCondition == "4"){ useLimitStr = skillTarget[map["目标"]] + useConditionName + useConditionJudge + "" + useConditionNum + "%" + ""; } //宠物等级 else if(useCondition == "50" ){ useLimitStr = useConditionName + "
" + useConditionJudge + "【" + useConditionNum + "】" ; } //使用者的境界等级 else if(useCondition == "51" ){ useLimitStr = useConditionName + useConditionJudge + "
【" + ablestagerewardtable[useConditionNum].NAME + "】" ; } //技能本身的等级 else if(useCondition == "52" ){ useLimitStr = $("").append(findSkillTips(skilldata[useConditionNum])).append("
("+map["判断"]+")").append(jumpTabHref(skilldata[useConditionNum])); } //装备的武器类型 else if(useCondition == "53" ){ var equipTypeName = equipTypeSimple[useConditionNum]; //如果不是普通装备,则去装备中找名字 if(! equipTypeName ){ //equipTypeName = equipexdatatable[useConditionNum].NAME; useLimitStr = $(""+useConditionName + useConditionJudge + "
").append(findMapTips(useConditionNum)); }else{ useLimitStr = useConditionName + useConditionJudge + "
【" + equipTypeName + "】"; } } //当前激活的内功 else if(useCondition == "54" ){ useLimitStr = $(""+useConditionName + useConditionJudge+"
").append(findSkillTips(skilldata[useConditionNum])).append(jumpTabHref(skilldata[useConditionNum])); } //施法者是否拥有指定BUFF else if(useCondition == "55" ){ useLimitStr = useConditionName + useConditionJudge + "
【" + buffdatatable[useConditionNum].NAME + "】"; } //当前目标是否拥有指定BUFF else if(useCondition == "56" ){ useLimitStr = skillTarget[map["目标"]] + useConditionName + "
【" + buffdatatable[useConditionNum].NAME + "】"; } //身上是否穿着指定装备 else if(useCondition == "57" ){ //useLimitStr = useConditionName + "
【" + equipexdatatable[useConditionNum].NAME + "】"; useLimitStr = $(""+useConditionName + useConditionJudge + "
").append(findMapTips(useConditionNum)); } //当前宠物是否特定类型 else if(useCondition == "58" ){ useLimitStr = $(""+useConditionName + "
").append(findMapTips(useConditionNum)).append(jumpTabHref(pettable[useConditionNum])); } //使用者指定属性大于等于指定属性 else if(useCondition == "59" ){ useLimitStr = "【" + gameattribstringtable[map["判断"]]["属性"] +"】
" + useConditionNum + "
"; } 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) + "
"; } } }); var giftData = $(""+map.NAME+""); mtpisListener(giftData,mtpis); var giftDiv = $(""); 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 = $("
"); 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("
"+attrName+":"+val+"
"); } } } }); 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("
"); } div.append($("
" + rate_500 + "%几率触发:
").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("
"); } div.append($("
" + buff.rate + "%几率触发:
").append(findBuffTips({"效果1-类型":buff.buffId,"目标":"0"}))); } }); } return div; } /* 宠物初始属性值 */ function findPetInitAttr(map){ var descript = "
"; var gift = petskilldata[map["天赋"]]; descript += "

名称:"+map["NAME"]+"

"; descript += "

初始品阶:"+map["品阶"]+"

"; descript += "

御力要求:"+map["御力"]+"

"; descript += "

体力:"+map["HP"]+"

"; descript += "

法力:"+map["MP"]+"

"; descript += "

攻击:"+map["AttackL"]+"-"+map["AttackH"]+"

"; descript += "

法攻:"+map["MAttack"]+"

"; descript += "

防御:"+map["Def"]+"

"; descript += "

护甲:"+map["Arm"]+"

"; descript += "

速度:"+map["Speed"]+"

"; descript += "

暴击率:不知道怎么算

";//map["CritOdds"] descript += "

暴击伤害:不知道怎么算

";//map["CritL"]) descript += "

成长:"+map["grow"]+"

"; descript += "

天赋:"+(gift?gift.NAME:"")+"

"; return descript; } function jumpTabHref(from){ if(from){ var map = globalsearch[from.ID]; if(map){ return ""; } } return ""; } //超链接包裹跳转 function jumpTabHref2(obj,from){ if(from){ var map = globalsearch[from.ID]; if(map){ return $("").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 = $(""); label.addClass("label"); label.html("转世保留"); label.css("background-color","#CD4F39"); return label; }