var cj={

show:function(){cj.xuanxiang(cjxuanxiang[cj_kuang.num]);
cj_kuang.style.display="";
},
xuanxiang:function(obj){  //切换选项
if(obj.id!="cjxuanxiang")return;cj_kuang.num=obj.num;
for(var i=0;i<cjxuanxiang.length;i++){cjxuanxiang[i].style.color="";cjxuanxiang[i].style.fontWeight="normal";}
obj.style.color="red";obj.style.fontWeight="bold"
cj1.style.display="none";cj2.style.display="none";

switch(parseInt(obj.num)){
case 1:  //怪物手册
shouce.allgw(showzu.value);cj1.style.display="";
break;
case 2:  //游戏数据
var tempallzy="";for(var i=0;i<rpg.zy.length;i++){tempallzy+=rpg.zy[i]+" ";if((i+1)%6==0)tempallzy+="<br>"}
var tempqn1=[],tempqn2="伤害加深-%,暗杀-%,魔攻-%,魔法恢复-,生命吸收-,毁灭敌人魔法-,概率双倍伤害-%,概率击晕-%,无视魔防-%,无视防御-%,伤害减免-%,额外洗劫金币-%,额外经验加成-%,额外元灵加成-%,反戈一击-,怒火增长加快-,负面状态免疫-%,危险感知-".split(",");
var tempallqn="";for(var i=0;i<tempqn2.length;i++){tempallqn+=tempqn2[i].split("-")[0]+"=<font style='font-size:15px;color:red;font-weight:bold'>"+getqianneng(tempqn2[i].split("-")[0])+tempqn2[i].split("-")[1]+"</font>  ";if((i+1)%4==0)tempallqn+="<p></p>"}
cj2.innerHTML="<font style='font-size:20px;font-weight:bold;color:orange;background-color:black'>【人物潜能属性,本版合计设计了="+tempqn2.length+"个】</font><br>&nbsp;<br>"+tempallqn+"<br>&nbsp;<br><font style='font-size:20px;font-weight:bold;color:orange;background-color:black'>【本版合计设计了"+rwdom.getElementsByTagName("rw").length+"个任务,目前完成了"+rpg.rw.length+"个,达成率=<font style='color:red;font-size:20px;font-weight:bold;'>"+Math.floor((rpg.rw.length/rwdom.getElementsByTagName('rw').length)*100)+"%</font>】</font><br>&nbsp;<br>"+rpg.rw.join(",").replace(/\=(\d+)/g,"=<font style='color:red;weight:bold'>$1</font>")+"<br>&nbsp;<br><font style='font-size:20px;font-weight:bold;color:orange;background-color:black'>【拥有的所有名衔数="+rpg.zy.length+"个】</font><br>&nbsp;<br>"+tempallzy+"<br>&nbsp;<br><font style='font-size:20px;font-weight:bold;color:orange;background-color:black'>【部分特殊游戏成果统计数据】</font><br>历史武将俘获数目=<font style='color:red;weight:bold'>"+rpg.fuhuoshu+"</font>个<br>二次元后BOSS退治数=<font style='color:red;weight:bold'>"+rpg.cykillboss+"</font>匹 二次元后杂鱼退治数=<font style='color:red;weight:bold'>"+rpg.cykillnoboss+"</font>匹<br>&nbsp;<br>"
cj2.style.display="";
break;
case 3:  //文献记载
var thedom=wpdom.getElementsByTagName("wp"),temptxt=[],tempshu1=0,tempshu2=0,tempi=0
for(var i=0;i<thedom.length;i++){var tempname=thedom[i].getAttribute("n")
if(tempname.match(/石板\:|诗歌\:|资料\:|神说\:/g)!=null){temptxt[temptxt.length]="<img src='img/wp/"+thedom[i].getAttribute('src')+"' style='position:static;border:1 solid black' onmousemove=\"showtmk('wupin or zhuangbei%#&@!-$^=wp="+tempname+"')\" value='"+tempname+"' onclick='if(rpg.wenxian.indexOf(this.value)!=-1)usewp(this.value)'> "
tempshu1++;
if(rpg.wenxian.indexOf(tempname)!=-1){temptxt[temptxt.length-1]+="<font style='font-size:15px;color:red'>已记载</font> ";tempshu2++}else{temptxt[temptxt.length-1]+="未发现 "}
tempi++;if((tempi+7)%7==0)temptxt[temptxt.length-1]+="<p></p>"
}
}
cj2.innerHTML="<font style='font-size:20px;font-weight:bold;color:orange;background-color:black'>合计 "+tempshu1+" 份文献,已阅读过 "+tempshu2+" 份,达成率=<font style='font-size:20px;font-weight:bold;color:red'>"+Math.floor(tempshu2/tempshu1*100)+"%</font></font><br>注:已记载过的文献物品,扔掉以后,仍可以在这里单击图标进行阅读<br>注:如某些任务需要这些文献,也只需记载过即可,无需保留文献物品实物<p></p>"+temptxt.join("")
cj2.style.display=""
break;
case 4:  //cg回忆
var cgtext=[],jiyilen=0;for(var i=0;i<rpg.cg.length;i++){if(i>0&&(i+6)%6==0)cgtext[cgtext.length-1]+="</tr><tr height=150>";
var thesplit=rpg.cg[i].split("=")
if(thesplit[1]==0){cgtext[i]="<td style='width:16%'><img style='position:static;width:100%;height:130' src='img/background/liuxing4.gif'><br><font style='color:red;font-size:15px;'>"+(i+1)+"</font> <font style='font-size:15px'>未经历</font></td>";continue;}else{jiyilen++
cgtext[i]="<td style='width:16%' show='"+thesplit[0]+"'><img style='position:static;width:100%;height:130' src='img/cg/"+thesplit[0]+".jpg'><br><font style='color:red;font-size:15px;'>"+(i+1)+"</font> "+thesplit[0]+"-"+thesplit[1]+"</td>"}
}

cj2.innerHTML="<font style='font-size:20px;font-weight:bold;color:orange;background-color:black'>合计 "+rpg.cg.length+" 副CG,已记忆 "+jiyilen+" 副,达成率=<font style='font-size:20px;color:red;font-weight:bold'>"+Math.floor(jiyilen/rpg.cg.length*100)+"%</font></font><p></p><table id='cgtable' bordercolordark=blue bordercolorlight=blue cellspacing=2 cellpadding=0 border=2 style='table-Layout:fixed;width:100%;cursor:hand;text-align:center;'><tr height=150>"+cgtext.join("")+"</tr></table>";
shouce.addmove(cgtable);
cgtable.onclick=function(){var obj=event.srcElement  //单击
if(obj.tagName=="TD"){}else if(obj.tagName=="IMG"){obj=obj.parentElement}else{return;}
if(obj.show==null){return gdtext(event.x,event.y,"这尚未达成该副CG回忆！")}
cg_kuang.src="img/cg/"+obj.show+".jpg";
cg_kuang.style.filter="revealtrans(duration=0.5,transition="+round(random()*23)+")"
cg_kuang.filters[0].apply();cg_kuang.style.display="";cg_kuang.filters[0].play();
}
cj2.style.display=""
break;
} //end  swthch
}
}


var rmwg={  //为玩家开发的函数库
xunwu:function(xuyao,bujian){
xuyao=xuyao.split(",");var leiji=0;for(var i=0;i<xuyao.length;i++){var xuyao1=xuyao[i].split("=")[0],shu1=parseInt(xuyao[i].split("=")[1])
if(wpzb.findwp("wp",xuyao1)>=shu1||wpzb.findwp("zb",xuyao1)>=shu1)leiji+=1;
}if(leiji!=xuyao.length)return false;
for(var i=0;i<xuyao.length;i++){var xuyao1=xuyao[i].split("=")[0],shu1=parseInt(xuyao[i].split("=")[1])
if(bujian==null){
if(wpzb.findwp("wp",xuyao1)>=shu1)wp_add("wp",xuyao1,-shu1)
if(wpzb.findwp("zb",xuyao1)>=shu1)wp_add("zb",xuyao1,-shu1)
}
}return true;
},
kill:function(xuyao,changqifindrw){xuyao=xuyao.split(",");var leiji=0;
for(var i=0;i<xuyao.length;i++){var xuyao1=xuyao[i].split("=")[0],shu1=parseInt(xuyao[i].split("=")[1]);
if(changqifindrw!=null)shu1*=(changqifindrw+1)  //长期任务中,数量递增
if(shouce.getkill(xuyao1)>=shu1)leiji+=1
}if(leiji!=xuyao.length){return false;}else{return true;}
},
findwj:function(wjname){for(var i=1;i<wj.length;i++){if(wj[i].yuanming==wjname)return wj[i];}
return false
}
}

var shouce={
addcg:function(addsrc){  //往内存追加CG
for(var i=0;i<rpg.cg.length;i++){if(rpg.cg[i].split("=")[0]==addsrc)return rpg.cg[i]=addsrc+"="+shuzhidtname.innerHTML}
},
allgw:function(showtext,issousuo){  //怪物图鉴
var temp1=[],gwxml=gwdom.getElementsByTagName("document")[0].childNodes,tempjishu=0
if(showzu.value=="初始化"){var tempzu="全部显示",oldzu=""  //分组工程
for(var i=0;i<gwxml.length;i++){var tempzu1=gwxml[i].getAttribute("zu");
if(oldzu!=tempzu1){tempzu+=","+tempzu1;oldzu=tempzu1}
}
tempzu+=",所有E级敌人,所有D级敌人,所有C级敌人,所有B级敌人,所有A级敌人,所有S级敌人,所有R级敌人";
tempzu=tempzu.split(",");var tempsel1=[];
for(var i=0;i<tempzu.length;i++){tempsel1[i]="<option value='"+tempzu[i]+"'>"+tempzu[i];
showzu.outerHTML="<select id='showzu' onchange='shouce.allgw(this.value);shouce_div1.focus();'>"+tempsel1.join("")+"</select>"}
}

var tempboos=false;if(showtext.indexOf("所有")==0){tempboos=showtext.substr(2,2);
switch(tempboos){
case "E级":tempboos=null;break;
case "D级":tempboos="经典级";break;
case "C级":tempboos="帝王级";break;
case "B级":tempboos="传说级";break;
case "A级":tempboos="神魔级";break;
case "S级":tempboos="神说级";break;
case "R级":tempboos="神葩级";break;
}
}
for(var i=0;i<gwxml.length;i++){var killlen=rpg.kill[i].split("=")[1],push1={}
if(issousuo==null){
if(tempboos!=false){if(tempboos!=gwxml[i].getAttribute("boos"))continue;}else{
if(showtext!=gwxml[i].getAttribute("zu")&&showzu.selectedIndex!=0)continue;}
}else{
if(gwxml[i].tagName.indexOf(showtext)==-1)continue;

}

if(killlen==0){
push1.htm="<td width='20%'>"+gwxml[i].tagName+"<br>Lv:? 胜:0<br><img src='img/wp/bumingwu.gif' style='position:static;'></td>";push1.lv=i+1000
}else{tempjishu++;
push1.htm="<td width='20%' show='"+gwxml[i].tagName+"'>"+gwxml[i].tagName+"<br>Lv:"+gwxml[i].getAttribute("lv")+" 胜:"+killlen+"<br><img src='img/gw/"+gwxml[i].getAttribute("src")+"' style='position:static;width:100%;height:70%;'></td>";push1.lv=parseInt(gwxml[i].getAttribute("lv"))
}temp1.push(push1); //插入json
}
 //if(shoucepaixu.checked==true)temp1.sort(function(sorta,sortb){return sorta.lv-sortb.lv})
var temp1htm=[];for(var i=0;i<temp1.length;i++){
temp1htm[i]=temp1[i].htm;
if(i>0&&(i+5)%5==0)temp1htm[i]="</tr><tr height=100>"+temp1htm[i];
}

shouce_div1.innerHTML="<table id='gwtable' bordercolordark=white bordercolorlight=gray cellspacing=0 cellpadding=0 border=1 style='table-Layout:fixed;width:100%;cursor:hand;padding-top:2;text-align:center;color:gray;font-size:11px'><tr height=100>"+temp1htm.join("")+"</tr></table>";
shouce.addmove(gwtable)

shouce_div2.innerHTML="<center>请选定一个怪物查看<p>合计击败:"+rpg.allkilllen+"怪<p>合计掌握:"+tempjishu+"-"+gwxml.length+"怪信息,达成率=<font style='color:red;font-weight:bold'>"+Math.floor(tempjishu/gwxml.length*100)+"%</font><p>俘获价值:越是强大、越是BOSS、越是有名、越是稀有的敌人,俘获后能力值越强,培养价值也越高,厉害程度视其等级、属性,以及武将是何种程度BOSS,依顺序实力从低到高分为E/D/C/B/A/S/R级,但中后期你没实力是很难打败并俘获她们的<p>怪物也升级:今后,当你的级别超出怪级别35级,那么,怪物的能力值将改变(大幅强化),强化到与你的才能界限等级持平!你如果问这是为什么,只能说怪物也是在一直升级^-^,这是为了让本游戏无论玩到何时,均保持最佳难度、最强可玩性、挑战性!</center>";
shouce_img.src="img/ico/touming.gif";shouce_pingji.innerHTML="";
gwtable.onclick=function(){var obj=event.srcElement  //单击
if(obj.tagName=="TD"){}else if(obj.tagName=="IMG"){obj=obj.parentElement}else{return;}
if(obj.show==null){shouce_img.src="img/ico/touming.gif";shouce_pingji.innerHTML="";return shouce_div2.innerHTML="这个怪物你未战胜过,一切数据不详"}



var gobj=shouce.guainl(obj.show)
var col1="black";shouce_pingji.innerHTML="E";if(gobj.sboos=="经典级"){col1="#FD7AF2";shouce_pingji.innerHTML="D"}
else if(gobj.sboos=="帝王级"){col1="#D2D619";shouce_pingji.innerHTML="C"}else if(gobj.sboos=="传说级"){col1="green";shouce_pingji.innerHTML="B"}else if(gobj.sboos=="神魔级"){col1="#ED6A44";shouce_pingji.innerHTML="A"}else if(gobj.sboos=="神说级"){col1="red";shouce_pingji.innerHTML="S"}
else if(gobj.sboos=="神葩级"){col1="blue";shouce_pingji.innerHTML="R"}
shouce_pingji.style.color=col1;
var booshelp=gobj.sboos==null?" &nbsp;Boos头目:不是":" &nbsp;Boos头目:<font style='color:"+col1+"'>"+gobj.sboos+"</font>";

if(gobj.sjn==null){gobj.sjn="无"}else{gobj.sjn=gobj.sjn.split(",");
for(var j=0;j<gobj.sjn.length;j++){var sjn2=gobj.sjn[j].split("=")
gobj.sjn[j]="<font style='color:green;font-weight:normal;font-size:11px' onmousemove=\"showtmk('jnobj1 or jnobj2%#&@!-$^="+sjn2[0]+"="+(sjn2[1]-1)+"')\">"+sjn2[0]+sjn2[1]+"级="+sjn2[2]+"</font>"
}
gobj.sjn=gobj.sjn.join(",")}
if(gobj.swp==null){gobj.swp="无"}else{gobj.swp=gobj.swp.split(",");
for(var j=0;j<gobj.swp.length;j++){var swp2=gobj.swp[j].split("=");
if(shouce.find_dropwp(obj.show,swp2[0])==true){
gobj.swp[j]="<font style='color:red;font-weight:normal;font-size:11px' onmousemove=\"showtmk('wupin or zhuangbei%#&@!-$^="+swp2[0].substr(0,2)+"="+swp2[0].substr(2)+"')\">"+swp2[0].substr(2)+"="+swp2[1]+"</font>"
}else{gobj.swp[j]="<font style='color:blue' onmousemove=\"showtmk('它掉这种东西,但从未爆出过,有待你完善')\">?????</font>"}
}
gobj.swp=gobj.swp.join(",")}
var newdiaoluo=gobj.newdiaoluo==null?"":" &nbsp;<font style='font-size:15px;font-weight:bold;color:purple' onmousemove=\"showtmk('这家伙看来经常练级,实力不断在变强呦,你必须小心它!<br>极限暴走的敌人,【不屈】状态将失效<br>神说、神葩级的最强敌人,不会极限暴走!','关于极限暴走','red')\">极限暴走</font>";
var tempzhongzu=gobj.sheng==null?"魔物":gobj.sheng;
var tempszt=gobj.szt=="无"?"无":gobj.szt.join("").replace(/\=\d+\=\d+/g,",");
shouce_div2.innerHTML="<center>Lv"+gobj.slv+":"+obj.show+booshelp+" 种族:"+tempzhongzu+"</center><br><span style='font-weight:normal;'>生 &nbsp;命:"+gobj.shp+" &nbsp;魔法值:"+gobj.smp+" &nbsp;速 &nbsp;度:"+gobj.ssu+" &nbsp;毅 &nbsp;力:"+gobj.syili+"<br>攻击力:"+gobj.sact1+"-"+gobj.sact2+" &nbsp;魔 &nbsp;力:"+gobj.smct1+"-"+gobj.smct2+"<br>防 &nbsp;御:"+gobj.sdef+" &nbsp;魔 &nbsp;防:"+gobj.smef+"<br>精 &nbsp;确:"+gobj.sjq+"% &nbsp;闪 &nbsp;避"+gobj.ssb+"% &nbsp;暴 &nbsp;击:"+gobj.sbj+"%<br>经 &nbsp;验:"+gobj.sexp+" &nbsp;金 &nbsp;币:"+gobj.scold+"</span>"+newdiaoluo+"<br>&nbsp;<br>状 &nbsp;态:"+tempszt+"<br>技 &nbsp;能:"+gobj.sjn+"<br>掉 &nbsp;落:"+gobj.swp
shouce_img.src="img/gw/"+gobj.src;
if(tempzhongzu=="魔物"){yinxiao("怪攻声")}else if(tempzhongzu=="男性"){yinxiao("男攻声")}else if(tempzhongzu=="女性"){yinxiao("女攻声")}else if(tempzhongzu=="神裔"){yinxiao("神攻声")}else {yinxiao("机攻声")}

shouce_img.style.width=2;shouce_img.style.height=2;
shouce_img.style.left=shouce_img.parentElement.offsetLeft+(shouce_img.parentElement.offsetWidth/2)
shouce_img.style.top=shouce_img.parentElement.offsetTop+(shouce_img.parentElement.offsetHeight/2)
if(shouce_img.go!=null){clearInterval(shouce_img.go);shouce_img.go=null}
shouce_img.go=setInterval(function(){if(shouce_img.offsetHeight<shouce_img.parentElement.offsetHeight-15){
shouce_img.style.left=shouce_img.offsetLeft-6;shouce_img.style.top=shouce_img.offsetTop-6;
shouce_img.style.width=shouce_img.offsetWidth+12;shouce_img.style.height=shouce_img.offsetHeight+12;
}else{
clearInterval(shouce_img.go);shouce_img.go=null
}
},25)
}

},
yanhua:function(){  //烟火
if(rwbutton.go!=null)return;yinxiao("烟花")
rwbutton.dex=0;rwbutton.go=setInterval(function(){var obj=document.createElement("IMG"),suiji1=50+round(random()*300);obj.style.zIndex=99999-suiji1;
obj.src="img/rw/yanhuo"+Math.ceil(random()*3)+".gif";
obj.style.width=suiji1;obj.style.height=suiji1;obj.style.left=bodywid*random()-(suiji1/2);obj.style.top=bodyhei/3*random();
obj.go=setTimeout(function(){obj.removeNode(true);},1000);document.body.appendChild(obj);
if(++rwbutton.dex>20){clearInterval(rwbutton.go);rwbutton.dex=0;rwbutton.go=null;
for(var i=0;i<30;i++){var obj2=document.createElement("IMG");obj2.src="img/rw/qiqiu"+Math.ceil(random()*3)+".gif";
var tempx=bodywid*random();obj2.style.left=tempx;tempx>bodywid/2?obj2.jiax=-(3+(random()*7)):
obj2.jiax=3+(random()*5);obj2.jiay=-(6+(random()*10));obj2.style.top=bodyhei-(200-(400*random()));
shouce.qiqiu(obj2);document.body.appendChild(obj2);
}}
},100)
},
qiqiu:function(obj){  //气球
obj.go=setInterval(function(){if(obj.offsetLeft<obj.offsetWidth||obj.offsetLeft>bodywid||obj.offsetTop<-obj.offsetHeight){
clearInterval(obj.go);obj.go=null;obj.removeNode(true)}else{
obj.style.left=obj.offsetLeft+obj.jiax;obj.style.top=obj.offsetTop+obj.jiay;
}},30)
},
addrw:function(addname){  //追加完成任务 或 完成次数+1
var thei=-1,tempcishu=1;for(var i=0;i<rpg.rw.length;i++){if(rpg.rw[i]==null)continue;
if(rpg.rw[i].split("=")[0]==addname){thei=i;tempcishu=parseInt(rpg.rw[i].split("=")[1])+1;break;}
}
if(thei==-1){thei=rpg.rw.length;for(var i=0;i<thei;i++){if(rpg.rw[i]==null){thei=i;break}}}
rpg.rw[thei]=addname+"="+tempcishu;lt.help("恭喜你,顺利完成任务 ["+addname+"]!")
},
findrw:function(findname){  //查找内存已完成的任务
for(var i=0;i<rpg.rw.length;i++){if(rpg.rw[i]==null)continue;
if(rpg.rw[i].split("=")[0]==findname){
return parseInt(rpg.rw[i].split("=")[1])
}}
return 0;
},
jiangli:function(rwname){  //获取奖励
var getrw1=xml.getrw(rwname).getAttribute("jiangli").split(",");
for(var i=0;i<getrw1.length;i++){var sp1=getrw1[i].split("+")[0],zhi=new Number(getrw1[i].split("+")[1])
if(isNaN(zhi))zhi=getrw1[i].split("+")[1]
if(sp1.indexOf("wp=")==0)wpzb.rengbao(mex,mey,"wp",sp1.substr(3),zhi); //wp_add("wp",sp1.substr(3),zhi)
if(sp1.indexOf("zb=")==0)wpzb.rengbao(mex,mey,"zb",sp1.substr(3),zhi); //wp_add("zb",sp1.substr(3),zhi)
selwj=wj[0]
if(sp1.indexOf("武将_")==0){var sp2=sp1.split("_");selwj=rmwg.findwj(sp2[1]);sp1=sp2[2]}
switch(sp1){
case "经验":for(var r=0;r<wj.length;r++){if(wj[r].name!="")wj[r].exp1+=zhi;}break;
case "金币":if(zhi=="公会收益"){zhi=round(gh.zichan/10)}rpg.glod+=zhi;break;case "元灵":rpg.yuanling+=zhi;break;
case "名望":rpg.mingwang+=zhi;break;case "才能界限":selwj.lv2+=zhi;break;case "可用点":rpg.usedian+=zhi;break;
case "黄金":rpg.hj+=zhi;break;case "新称号":rpg.zy[rpg.zy.length]=zhi;break;case "生命上限":selwj.hp2+=zhi;break;
case "魔法上限":selwj.mp2+=zhi;break;case "幸运值":rpg.luck+=zhi;break;case "攻击力":selwj.act1+=zhi;selwj.act2+=zhi;break;
case "魔力":selwj.mct1+=zhi;selwj.mct2+=zhi;break;case "魔力下限":selwj.mct1+=zhi;break;case "怒火":selwj.nu2+=zhi;break;
case "防御":selwj.def+=zhi;break;case "魔防":selwj.mef+=zhi;break;case "暴击率":selwj.baoji+=zhi;break;
case "主角情商":if(rpg.qingshang<50)rpg.qingshang+=zhi;break;case "好感度":selwj.haogan+=zhi;selwj.lv2+=zhi;break;
case "存款上限":rpg.ckshangxian+=zhi;break;case "新武将":wjjs.add(zhi);break;
case "新公会":gh.name=zhi;lt.help("恭喜！你终于拥有了自己的大公会！右键菜单--公会事务功能已可用！");break;
case "募军":if(zhi=="公会知名度×20"){zhi=gh.zhimingdu*20;}gh.renshu+=zhi;break;case "公会等级":gh.zhimingdu+=zhi;break;
case "联盟":gh.mengjun==""?gh.mengjun+=zhi:gh.mengjun+=","+zhi;break;case "公会资产":gh.zichan+=zhi;break;
case "城堡":gh.chengbao==""?gh.chengbao+=zhi:gh.chengbao+=","+zhi;break;
}
if(sp1=="传送点"){rpg.sjdt[rpg.sjdt.length]=zhi.split("=")[0]+"+-=-+"+zhi.split("=")[1];lt.help("发现新传送点 "+zhi.split("=")[1])}
}
if(xml.getrw(rwname).getAttribute("lei")!="长期任务"){sd.selspimg.src="img/rw/clear.gif";wpzb.rengbao(mex,mey,"wp","用餐招待卡",1);}else{wpzb.rengbao(mex,mey,"wp","对决之石",1);}
sd.selspimg.wanchengcishu=parseInt(sd.selspimg.wanchengcishu)+1
gx_rpg();wjjs.shuaxin();wpzb.wupin();if(zt_kuang.style.display!="none")tbzt.zhuangtai();rwbutton.disabled=true;setTimeout("sdcloseimg.onmousedown();",500);shouce.yanhua();
if(rwname=="甜桃子")showshige("神说:第三章 初恋");
if(rwname=="仓库妹的线索")showshige("神说:第四章 泪水");
if(rwname=="诺亚残余")showshige("神说:第七章 遥远");
},
add_dropwp:function(add_gwname,add_wpzb,add_jilv){  //掉率添加shouce.jiangli("甜桃子");
var addtxt=add_gwname+"----"+add_wpzb;
if(shouce.find_dropwp(add_gwname,add_wpzb)==false)rpg.dropwp[rpg.dropwp.length]=addtxt;
},
find_dropwp:function(find_gwname,find_wpzb){  //掉率查找
var alltxt=rpg.dropwp.join("");
if(alltxt.indexOf(find_gwname+"----"+find_wpzb)==-1){return false}else{return true}
},
addmove:function(tablename){  //单元格移动效果
var movecolor="#0ADBFF"
tablename.onmouseover=function(){var obj=event.srcElement  //靠近
if(obj.tagName=="TD"){obj.bgColor=movecolor}else if(obj.tagName=="IMG"){obj.parentElement.bgColor=movecolor}}
tablename.onmouseout=function(){var obj=event.srcElement  //离开
if(obj.tagName=="TD"){obj.bgColor=""}else if(obj.tagName=="IMG"){obj.parentElement.bgColor=""}}
},
killload:function(){  //击杀记录归0,内存初始化
var len1=rpg.kill.length;rpg.kill.splice(0,len1)
var gws=gwdom.getElementsByTagName("document")[0].childNodes
for(var i=0;i<gws.length;i++)rpg.kill[i]=gws[i].tagName+"=0"
},
getkill:function(gwname,addgeshu){  //查询击杀数量,或添加击杀记录
for(var i=0;i<rpg.kill.length;i++){
if(rpg.kill[i].split("=")[0]==gwname){
if(addgeshu!=null){return rpg.kill[i]=gwname+"="+(parseInt(rpg.kill[i].split("=")[1])+addgeshu)}  //是添加
return rpg.kill[i].split("=")[1]  //是查询
}
}},
guainl:function(gwname,forwjadd){  //返回怪编译战斗力
var xmlgw=xml.getgw(gwname),slv=parseInt(xmlgw.getAttribute("lv"))
var oldlv=slv,newdiaoluo=null
var sboos=xmlgw.getAttribute("boos"),guaishe1=parseFloat(xml.getpz("怪设","生命")),actmct1=1.7
if(wj[0].lv-slv>=35&&forwjadd==null&&sboos!="神说级"&&sboos!="神葩级"){slv=wj[0].lv2;newdiaoluo="掉落"}
if(slv>30){var zengzhang=Math.ceil((slv-30)/10);guaishe1+=zengzhang;actmct1-=(zengzhang/10);if(actmct1<1.2)actmct1=1.2}
var shp=slv*guaishe1,smp=slv*3,sexp=slv*xml.getpz("怪设","经验基数"),scold=sexp/4;
var sact2=slv*xml.getpz("怪设","攻击"),sact1=sact2/actmct1,smct2=slv*xml.getpz("怪设","魔攻"),smct1=smct2/actmct1;
var sdef=slv*xml.getpz("怪设","防御")/2,smef=slv*xml.getpz("怪设","防御")/2
var syili=0;
switch(sboos){
case "经典级":
shp=shp*3;smp=smp*3;sexp=sexp*1.5;scold=sexp/4;sact2=sact2*1.1;sact1=sact1*1.1;
smct2=smct2*1.1;smct1=smct1*1.1;syili=3;
break;
case "帝王级":
shp=shp*6;smp=smp*5;sexp=sexp*2;scold=sexp/3.5;sact2=sact2*1.2;sact1=sact1*1.2;
smct2=smct2*1.2;smct1=smct1*1.2;syili=6;sdef=sdef*1.5;smef=smef*1.5;
break;
case "传说级":
shp=shp*13;smp=smp*10;sexp=sexp*3;scold=sexp/3;sact2=sact2*1.3;sact1=sact1*1.3;
smct2=smct2*1.3;smct1=smct1*1.3;syili=9;sdef=sdef*2;smef=smef*2;
break;
case "神魔级":
shp=shp*60;smp=smp*20;sexp=sexp*5;scold=sexp/2.5;sact2=sact2*1.5;sact1=sact1*1.5;
smct2=smct2*1.5;smct1=smct1*1.5;syili=12;sdef=sdef*3;smef=smef*3;
break;
case "神说级":
shp=shp*120;smp=smp*30;sexp=sexp*10;scold=sexp/2;sact2=sact2*2;sact1=sact1*2;
smct2=smct2*2;smct1=smct1*2;syili=15;sdef=sdef*4;smef=smef*4;
break;
case "神葩级":
shp=shp*170;smp=smp*40;sexp=sexp*20;scold=sexp/1.5;sact2=sact2*3;sact1=sact1*3;
smct2=smct2*3;smct1=smct1*3;syili=18;sdef=sdef*5;smef=smef*5;
break;
}
if(xmlgw.getAttribute("exp")!=null)sexp=xmlgw.getAttribute("exp");
if(xmlgw.getAttribute("cold")!=null)scold=xmlgw.getAttribute("cold");
if(oldlv==slv){
if(xmlgw.getAttribute("hp")!=null)shp=xmlgw.getAttribute("hp");
if(xmlgw.getAttribute("mp")!=null)smp=xmlgw.getAttribute("mp");
if(xmlgw.getAttribute("act")!=null){sact2=xmlgw.getAttribute("act").split("-")[1];sact1=xmlgw.getAttribute("act").split("-")[0];}
if(xmlgw.getAttribute("mct")!=null){smct2=xmlgw.getAttribute("mct").split("-")[1];smct1=xmlgw.getAttribute("mct").split("-")[0];}
if(xmlgw.getAttribute("def")!=null)sdef=xmlgw.getAttribute("def");
if(xmlgw.getAttribute("mef")!=null)smef=xmlgw.getAttribute("mef");
}else{   //sexp=sexp/2;scold=scold/2
}

var ssu=xmlgw.getAttribute("su")==null?slv*xml.getpz("怪设","速度"):xmlgw.getAttribute("su");
var sjq=xmlgw.getAttribute("jq")==null?75+(slv/3.5):parseInt(xmlgw.getAttribute("jq"));
var ssb=xmlgw.getAttribute("sb")==null?slv/4:parseInt(xmlgw.getAttribute("sb"));
var sbj=xmlgw.getAttribute("bj")==null?3+(slv/9):parseInt(xmlgw.getAttribute("bj"));

var gobj={};

if(newdiaoluo!=null){gobj.newdiaoluo=newdiaoluo
shp*=1.2;smp*=1.2;sact2*=1.2;smct2*=1.2;syili+=3;
sdef*=1.5;smef*=1.5;
}
var ciyuanjia=1;for(var i=1;i<rpg.ciyuan;i++){ciyuanjia+=0.5;syili+=2;}
if(rpg.ciyuan>1&&forwjadd==null){
shp*=ciyuanjia;smp*=ciyuanjia;sact2*=ciyuanjia;sact1*=ciyuanjia;smct2*=ciyuanjia;smct1*=ciyuanjia;
sdef*=ciyuanjia;smef*=ciyuanjia;ssu*=ciyuanjia;sjq*=ciyuanjia;
sexp*=ciyuanjia;scold*=ciyuanjia;
}

gobj.sjq=round(sjq);gobj.ssb=round(ssb);gobj.sbj=round(sbj);
gobj.slv=slv;gobj.sboos=sboos;gobj.shp=round(shp);gobj.sexp=round(sexp);gobj.sheng=xmlgw.getAttribute("sheng")
gobj.scold=round(scold);gobj.sact2=round(sact2);gobj.sact1=round(sact1);gobj.smct1=round(smct1);gobj.smct2=round(smct2);
gobj.smp=round(smp);gobj.ssu=round(ssu);gobj.sdef=round(sdef);gobj.smef=round(smef);
gobj.syili=xmlgw.getAttribute("yili")==null?syili:parseInt(xmlgw.getAttribute("yili"));
gobj.src=xmlgw.getAttribute("src");gobj.sjn=xmlgw.getAttribute("jn");gobj.swp=xmlgw.getAttribute("wp");
if(xmlgw.getAttribute("zt")!=null){gobj.szt=new Array(20);var tempzt=xmlgw.getAttribute("zt").split(",")
for(var i=0;i<tempzt.length;i++){if(tempzt[i]==""){gobj.szt[i]=""}else{gobj.szt[i]=tempzt[i]+"=0="+(10+round(random()*15))
if(tempzt[i]=="重生")gobj.szt[i]=tempzt[i]+"=0=999"
if(tempzt[i]=="不屈"&&newdiaoluo==null)gobj.szt[i]=tempzt[i]+"=0=999"
}}
}else{gobj.szt="无"}
return gobj
}
}