var olddhmubiao=null  //怪死亡处理对象,防止还没消失,又点换了其他BOOSNPC
var guaidh={
taopao:function(obj){
obj.style.position="absolute";obj.style.width=null;obj.style.height=null;gdtext(obj.offsetLeft,obj.offsetTop+50,obj.sname+":气死你,我妈叫我回家吃饭,拜哎捏哈~!");
setTimeout(function(){
obj.go=setInterval(function(){
if(obj.offsetTop>-obj.offsetHeight){obj.style.top=obj.offsetTop-8}else{
for(var i=0;i<zd.difang.length;i++){if(zd1td[zd.difang[i]].getElementsByTagName("IMG")[0]==obj)zd.difang.splice(i,1)}
for(var i=0;i<zd.tds.length;i++){if(zd.tds[i]==obj)zd.tds[i]=null}
zddh.cle(obj.go);obj.removeNode(true);return zd.zdjinxing()
}
},30)},800)
},
xiaomiezt:function(theshu){  //怪消灭玩家状态
var num=-1;for(var i=0;i<8;i++){if(me.szt[i]!=""){num=i;break;}}if(num==-1)return;
for(var i=0;i<8;i++){if(me.szt[i]!=""&&--theshu>-1){me.szt[i]="";clearInterval(ztimg[i].go);ztimg[i].style.display="none";}}
return temp1;
},
siwang:function(mubiao,jingong,whatjn){  //怪死亡处理
var thesheng=xml.getgw(mubiao.sname).getAttribute("sheng")
if(thesheng=="男性"){yinxiao("男惨叫")}else if(thesheng=="女性"){yinxiao("女惨叫")}else if(thesheng=="机器"){yinxiao("机惨叫")}else if(thesheng=="神裔"){yinxiao("神惨叫")}else{yinxiao("怪惨叫")}
if(dh.mubiao!=null&&mubiao.sname==dh.mubiao.boosis.replace(/\d+\=(.*?)/g,"$1")){
dh.mubiao.style.filter="progid:DXImageTransform.Microsoft.Pixelate(duration=8,enabled='false')";
yinxiao("风1");dh.mubiao.filters[0].Apply();dh.mubiao.filters[0].Play();dh.mubiao.suoding=true;
olddhmubiao=dh.mubiao
if(dh.mubiao.killxs==null){
if(dh.mubiao.newgo==null)dh.mubiao.newgo=setTimeout(function(){gdtext(olddhmubiao.offsetLeft+fmleft,olddhmubiao.offsetTop+fmtop,mubiao.sname+" 开始叫嚣:555有人欺负我~-~,一定要报仇!");olddhmubiao.style.filter=null;olddhmubiao.style.visibility="visible";olddhmubiao.suoding=null;olddhmubiao=null;dh.mubiao.newgo=null;dh.mubiao=null},8000);
}else{if(dh.mubiao.newgo==null)dh.mubiao.newgo=setTimeout(function(){gdtext(olddhmubiao.offsetLeft+fmleft,olddhmubiao.offsetTop+olddhmubiao.offsetHeight+fmtop,mubiao.sname+" 我居然败了！我不信！！……");olddhmubiao.style.filter=null;fm1.removeChild(olddhmubiao);olddhmubiao=null;dh.mubiao=null;xml.loadxdt();},4000);
}
lt.help("如此牛B,"+wj[0].lv+"级玩家[<font style='font-weight:bold'>"+wj[0].name+"</font>],刚刚击败了"+mubiao.slv+"级的BOOS[<font style='font-weight:bold'>"+mubiao.sname+"</font>]!它的气焰没那么嚣张啦!",true)
}

if(getzt(mubiao,"自爆",true)!=null){
var baoimg=document.createElement("IMG");baoimg.src=mubiao.src;
baoimg.style.left=jingong.parentElement.offsetLeft;baoimg.style.top=zd2.offsetTop+jingong.parentElement.offsetTop
zd_kuang.appendChild(baoimg);var oldselwj=selwj
setTimeout(function(){yinxiao("击中4");baoimg.src="img/zd/end5.gif";gdtext(baoimg.offsetLeft,baoimg.offsetTop,mubiao.sname+":跟你玩命,自爆了!");oldselwj.hp1-=round(oldselwj.hp1/3)},500)
setTimeout(function(){zd_kuang.removeChild(baoimg);},1300);
}

var x=mubiao.parentElement.offsetLeft+(mubiao.parentElement.offsetWidth/2)  //怪死亡动画开始
var y=mubiao.parentElement.offsetTop+(mubiao.parentElement.offsetHeight/2)
var endimg=document.createElement("IMG");endimg.src="img/zd/siwang"+Math.ceil(random()*5)+".gif";
endimg.style.left=mubiao.parentElement.offsetLeft;endimg.style.top=mubiao.parentElement.offsetTop;
endimg.style.width=zd1td[0].offsetWidth;endimg.style.height=zd1td[0].offsetHeight
zd_kuang.appendChild(endimg);
if(mubiao.go!=null)zddh.cle(mubiao.go)
mubiao.go2=setTimeout(function(){mubiao.style.visibility="hidden";},600)
mubiao.go=setTimeout(function(){zd_kuang.removeChild(endimg);
for(var i=0;i<zd.difang.length;i++){if(zd1td[zd.difang[i]].getElementsByTagName("IMG")[0]==mubiao){zd.difang.splice(i,1)}}
for(var i=0;i<zd.tds.length;i++){if(zd.tds[i]==mubiao)zd.tds[i]=null}
var tempexp=mubiao.sexp*xml.getpz("怪设","经验倍数"),tempyl=Math.ceil(tempexp/12),tempgold=mubiao.scold*xml.getpz("怪设","经验倍数")
var theqn=getqianneng("额外洗劫金币");if(theqn!=0)tempgold+=(tempgold*(theqn/100));
theqn=getqianneng("额外经验加成");if(theqn!=0)tempexp+=(tempexp*(theqn/100));
theqn=getqianneng("额外元灵加成");if(theqn!=0)tempyl+=(tempyl*(theqn/100));
var tempyun=0
if(mubiao.sjiaqiang!=null)tempyun+=2
if(zd.huihe>=150){tempexp*=4;tempyl*=4;tempgold*=4;tempyun+=3}else if(zd.huihe>=100&&zd.huihe<150){tempexp*=3;tempyl*=3;tempgold*=3;tempyun+=2}else if(zd.huihe>=50&&zd.huihe<100){tempexp*=2;tempyl*=2;tempgold*=2;tempyun+=1}
tempexp=round(tempexp);tempyl=round(tempyl);tempgold=round(tempgold);
gdtext(x,y+100,"经验 "+tempexp)
setTimeout("gdtext("+x+","+(y+100)+",'元灵 "+tempyl+"')",800)
setTimeout("gdtext("+x+","+(y+100)+",'金币 "+tempgold+"')",1500);
shouce.getkill(mubiao.sname,1);var baolvbei=xml.getpz("怪设","爆率倍数")
if(random()*100<1.5*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','礼物',1)",2500)
rpg.allkilllen++;
if(rpg.ciyuan>2&&random()*100<1*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','时空碎片',1)",2500)
if(mubiao.sboos!="null"){  //BOOS通掉
if(rpg.ciyuan>1)rpg.cykillboss++;
if(random()*100<1*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','黄金包',1)",2500)
if(random()*100<2*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','俘获绳',1)",2500)
if(random()*100<2*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','高级精炼石',1)",2500)
if(random()*100<3*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','纹章之蕊',1+Math.ceil(random()*2))",2500)
if(mubiao.newdiaoluo!=null){
if(random()*100<13*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','远古宝藏'+(1+Math.floor(random()*10)),1)",2500)
if(random()*100<4*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','真武残页',1)",2500)
}}else{  //普通怪通用掉落
if(rpg.ciyuan>1)rpg.cykillnoboss++;
if(random()*100<2*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','普通精炼石',1)",2500)
if(random()*100<3*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','纹章之蕊',1)",2500)
if(mubiao.newdiaoluo!=null){
if(random()*100<8*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','魔灵石',Math.ceil(random()*3))",2500)
if(random()*100<8*baolvbei)setTimeout("wpzb.rengbao(mex,mey,'wp','诗歌残页',Math.ceil(random()*3))",2500)
}}


if(mubiao.swp!="null"){  //物品掉落
var thewp1=mubiao.swp.split(",")
for(var i=0;i<thewp1.length;i++){
var thewp2=thewp1[i].split("=")
if(random()*100>round(parseInt(thewp2[1].replace("%",""))*baolvbei)+rpg.luck+tempyun)continue;
var liangge=1,node1=thewp2[0].substr(0,2),wpname1=thewp2[0].substr(2),houzhui="";if(node1=="wp"&&random()*100>95)liangge=2;
if(node1=="zb"&&random()*100>80){var templei=xml.getwp("zb",wpname1).getAttribute("lei");
if(templei!="座驾"&&templei!="飞行器"&&templei!="潜水衣"&&templei!="纹章")houzhui="$$$"+Math.ceil(random()*3)
}
setTimeout("wpzb.rengbao(mex,mey,'"+node1+"','"+(wpname1+houzhui)+"',"+liangge+")",2500)
shouce.add_dropwp(mubiao.sname,thewp2[0]);
}
}
for(var i=1;i<zdme.length;i++)if(wj[zdme[i].num].hp1>0)wj[zdme[i].num].exp1+=tempexp
rpg.glod+=tempgold;rpg.yuanling+=tempyl
gx_rpg();mubiao.removeNode(true)
if(whatjn=="常规攻击"||whatjn=="常规魔法攻击")return zd.zdjinxing();
if(--zddh.endcishu==0)return zd.zdjinxing();
},1200)
},
getact:function(obj){
var theact=parseInt(obj.sact1)+$(round((obj.sact2-obj.sact1)*random()))
return theact
},
getmct:function(obj){
var themct=parseInt(obj.smct1)+$(round((obj.smct2-obj.smct1)*random()))
return themct
},
getweili:function(objjn2){var thewl=parseInt(objjn2.getAttribute("wl"));
if(objjn2.getAttribute("wl").indexOf("%")!=-1)thewl+="%";return thewl;
},
getmiao:function(objjn2){return parseInt(objjn2.getAttribute("miao"))},

addjieshu:function(theobj,thejn){  //怪技能结束统一处理
for(var i=0;i<zd2td.length;i++){
if(zd2td[i].bgColor=="")continue;zd2td[i].onmouseout="";
if(zd2td[i].getElementsByTagName("IMG").length==0)continue;
if(zd2td[i].getElementsByTagName("IMG")[0].siwang==true)continue;
zddh.endcishu++;
}
for(var i=0;i<zd2td.length;i++){
if(zd2td[i].bgColor=="")continue;zd2td[i].onmouseout="";
if(zd2td[i].getElementsByTagName("IMG").length==0)continue;
if(zd2td[i].getElementsByTagName("IMG")[0].siwang==true)continue;
zddh.enddh(zd2td[i].getElementsByTagName("IMG")[0],theobj,thejn)
}
},
alljn:function(guaijn1,obj,guaijn2,jn2num,thenum){  //怪技能处理
zddh.endcishu=0
var jnname=guaijn1.getAttribute("n"),objtd=obj.parentElement
if(guaijn1.getAttribute("sound1")!=null)yinxiao(guaijn1.getAttribute("sound1"))

if(jnname=="邪恶召唤"&&(xml.gws[0]==null||xml.gwmax==0))return setTimeout(function(){
gdtext(objtd.offsetLeft+(objtd.offsetWidth/2),objtd.offsetTop+objtd.offsetHeight,obj.sname+":晕,这附近没有邪恶的朋友!")
zd.zdjinxing()
},1000)

if(jnname!="致命打击"&&jnname!="治疗"&&jnname!="全面强化"){
var tmimg=document.createElement("IMG")
tmimg.src=obj.src;tmimg.style.left=zdtuoyuan.offsetLeft;tmimg.style.top=zdtuoyuan.offsetTop;
tmimg.style.zIndex=1;tmimg.id="dijnuse1";zd_kuang.appendChild(tmimg);
var diimg=document.createElement("IMG"),tmwid=round(bodywid/5),tmhei=round(bodyhei/10)
obj.style.visibility="hidden";diimg.style.zIndex=0;diimg.id="dijnuse2";
diimg.src="img/zd/jn_shifang.gif";diimg.style.width=tmwid;diimg.style.height=tmhei;
diimg.style.left=tmimg.offsetLeft+(tmimg.offsetWidth/2)-(tmwid/2);
diimg.style.top=tmimg.offsetTop+(tmimg.offsetHeight/2);zd_kuang.appendChild(diimg);
}
if(jnname=="龙卷风"){zd2td[thenum].bgColor="purple";
var img1=document.createElement("IMG");img1.src="img/daolu/feng.gif";
img1.style.left=zd2td[thenum].offsetLeft-40;img1.style.top=zd2.offsetTop+zd2td[thenum].offsetTop-80
img1.style.width=zd2td[0].offsetWidth*2;img1.style.height=zd2td[0].offsetHeight*3;
zd_kuang.appendChild(img1);img1.go=setTimeout(function(){
guaidh.addjieshu(obj,jnname+"="+jn2num);
img1.removeNode(true);},2500)
}else if(jnname=="暗黑血咒"||jnname=="暗黑魔咒"){zd2td[thenum].bgColor="purple";
var img1=document.createElement("IMG");jnname=="暗黑血咒"?img1.src="img/zd/anheixuezhou.gif":img1.src="img/zd/anheimozhou.gif";
img1.style.left=bodywid/4;img1.style.top=bodyhei/3;img1.style.width=bodywid/2;img1.style.height=bodyhei/1.5
zd_kuang.appendChild(img1);img1.go=setTimeout(function(){
jnname=="暗黑血咒"?zddh.shanguang("red"):zddh.shanguang("blue");
zd_kuang.removeChild(img1);zddh.endcishu=1;return zddh.enddh(zd2td[thenum].getElementsByTagName("IMG")[0],obj,jnname+"="+jn2num);
},1800)
}else if(jnname=="死亡重创"||jnname=="死亡重负"){
var img1=document.createElement("IMG");
img1.src=jnname=="死亡重创"?"img/gw/gw_siwangzhongchuang.gif":"img/gw/gw_siwangzhongfu.gif";
img1.style.visibility="hidden";img1.style.left=bodywid/2-231;img1.style.top=bodyhei/2-180;
zd_kuang.appendChild(img1)
img1.style.filter="revealtrans(duration=1.6,transition=12";img1.filters[0].apply();
img1.style.visibility="visible";img1.filters[0].play();
setTimeout(function(){zddh.cle(img1.go);zd_kuang.removeChild(img1);zddh.endcishu=1;return zddh.enddh(zd2td[thenum].getElementsByTagName("IMG")[0],obj,jnname+"="+jn2num)
},1800);
}else if(jnname=="惊恐麻木"){
var img1=document.createElement("IMG");img1.src="img/zd/jingkongmamu.gif";
img1.style.left=bodywid/2-250;img1.style.top=bodyhei/2-125;
img1.style.width=500;img1.style.height=250;
zd_kuang.appendChild(img1)
setTimeout(function(){zddh.shanguang("black");zddh.cle(img1.go);zd_kuang.removeChild(img1);zddh.endcishu=1;return zddh.enddh(zd2td[thenum].getElementsByTagName("IMG")[0],obj,jnname+"="+jn2num)
},2000);
}else if(jnname=="巨石敲脑壳"){zd2td[thenum].bgColor="purple";
for(var i=0;i<12;i++){var img1=document.createElement("IMG");img1.src="img/zd/shitou.gif";
img1.style.left=zd2td[thenum].offsetLeft+(130-round(random()*200));img1.style.top=-100*i;img1.dex=1;zd_kuang.appendChild(img1)
if(i==11)img1.zuihou=true
guaidh.jn_巨石敲脑壳2(img1,obj,jnname,jn2num,thenum)
}
}else if(jnname=="魔界烈火"){zd2td[thenum].bgColor="purple";
var img1=document.createElement("IMG");img1.src="img/zd/mojieliehuo.gif";
img1.style.left=0;img1.style.top=zd2.offsetTop
img1.style.width=bodywid;img1.style.height=zd2.offsetHeight
zd_kuang.appendChild(img1);img1.go=setTimeout(function(){
guaidh.addjieshu(obj,jnname+"="+jn2num);
img1.removeNode(true);},1500)
}else if(jnname=="魑魅魍魉"||jnname=="法老的诅咒"){zd2td[thenum].bgColor="purple";
var img1=document.createElement("IMG");img1.src="img/zd/baiguang.gif";
img1.style.left=-(bodywid/4);img1.style.top=-(bodyhei/4);img1.style.width=bodywid*1.5;img1.style.height=bodyhei*1.5
zd_kuang.appendChild(img1);img1.go=setTimeout(function(){
guaidh.addjieshu(obj,jnname+"="+jn2num);
img1.removeNode(true);},3600)
}else if(jnname=="诺亚风暴"){zd2td[thenum].bgColor="purple";
var img1=document.createElement("IMG");img1.src="img/zd/luanzhan.gif";
img1.style.left=0;img1.style.top=0;img1.style.width=bodywid;img1.style.height=bodyhei
zd_kuang.appendChild(img1);img1.go=setTimeout(function(){
guaidh.addjieshu(obj,jnname+"="+jn2num);
img1.removeNode(true);},3000)
}else if(jnname=="炸弹之母"||jnname=="人间崩坏"){zd2td[thenum].bgColor="purple";
var img1=document.createElement("IMG");img1.src="img/zd/zhadan.gif";
img1.style.left=0;img1.style.top=0;img1.style.width=bodywid;img1.style.height=bodyhei
zd_kuang.appendChild(img1);img1.go=setTimeout(function(){
guaidh.addjieshu(obj,jnname+"="+jn2num);
img1.removeNode(true);},2400)
}else if(jnname=="玉殒香消"){zd2td[thenum].bgColor="purple";
var img1=document.createElement("IMG");img1.src="img/zd/yinghua1.gif";
img1.style.left=bodywid/3;img1.style.top=0;img1.style.width=bodywid/1.5;img1.style.height=bodyhei
var img2=document.createElement("IMG");img2.src="img/zd/yinghua2.gif";
img2.style.left=0;img2.style.top=0;img2.style.width=bodywid/1.5;img2.style.height=bodyhei
zd_kuang.appendChild(img1);zd_kuang.appendChild(img2);
img1.go=setTimeout(function(){guaidh.addjieshu(obj,jnname+"="+jn2num);img2.removeNode(true);img1.removeNode(true);},3600)
}else if(jnname=="黑色破坏光线"){zd2td[thenum].bgColor="purple";
var img1=document.createElement("IMG");img1.src="img/zd/hsphgx.gif";
img1.style.left=0;img1.style.top=0;img1.style.width=bodywid;img1.style.height=bodyhei
zd_kuang.appendChild(img1);
img1.go=setTimeout(function(){guaidh.addjieshu(obj,jnname+"="+jn2num);img1.removeNode(true);},3200)
}else if(jnname=="神罚"||jnname=="天马流星拳"){if(jnname!="神罚")yinxiao("流星拳");zd2td[thenum].bgColor="purple";
var img1=document.createElement("IMG");img1.src="img/zd/shenfa.gif";
img1.style.left=0;img1.style.top=0;img1.style.width=bodywid;img1.style.height=bodyhei
zd_kuang.appendChild(img1);
img1.go=setTimeout(function(){guaidh.addjieshu(obj,jnname+"="+jn2num);img1.removeNode(true);},3500)
}else if(jnname=="九阴祭尘烬"||jnname=="帅哥精杀"||jnname=="一闪冥王斩"||jnname=="真·地狱之舞"||jnname=="异次元之门"||jnname=="黑宇宙の末日序曲"||jnname=="光宇宙の绝对领域"){
zd2td[thenum].bgColor="purple";zddh.zdtexie(jnname,obj,jnname+"="+jn2num);
}else if(jnname=="技能封印"||jnname=="物品封印"){
var img1=document.createElement("IMG");
if(jnname=="技能封印"){img1.src="img/zd/jinengfengyin.gif";img1.style.left=bodywid/4;img1.style.top=bodyhei/4;img1.style.width=bodywid/2;img1.style.height=bodyhei/2}
else{img1.src="img/zd/wupinfengyin.gif";img1.style.left=bodywid/2.5;img1.style.top=bodyhei/2;img1.style.width=bodywid/5;img1.style.height=bodyhei/2}
zd_kuang.appendChild(img1);img1.go=setTimeout(function(){
zd_kuang.removeChild(img1);zddh.endcishu=1;return zddh.enddh(zd2td[thenum].getElementsByTagName("IMG")[0],obj,jnname+"="+jn2num);
},1800)
}else if(jnname=="治疗"){objtd.bgColor="orange";
for(var i=0;i<zd1td.length;i++){
if(zd1td[i].bgColor=="")continue;zd1td[i].onmouseout="";
if(zd1td[i].getElementsByTagName("IMG").length==0)continue;
zddh.endcishu++;
var obj=document.createElement("IMG");obj.src="img/zd/jn_zys.gif";obj.i=i
obj.style.left=zd1td[i].offsetLeft;obj.style.top=zd1td[i].offsetTop-zd1td[i].offsetHeight
obj.style.width=zd1td[0].offsetWidth;obj.style.height=150;zd_kuang.appendChild(obj);
guaidh.jn_治疗2(obj,guaijn2)
}}else if(jnname=="全面强化"){objtd.bgColor="orange";
for(var i=0;i<zd1td.length;i++){
if(zd1td[i].bgColor=="")continue;zd1td[i].onmouseout="";
if(zd1td[i].getElementsByTagName("IMG").length==0)continue;
zddh.endcishu++;var obj=zd1td[i].getElementsByTagName("IMG")[0];if(obj.go!=null)clearInterval(obj.go);
obj.style.filter="light(enabled=true)";obj.len1=0;guaidh.jn_全面强化2(obj,guaijn2);
}
}else if(jnname=="邪恶召唤"){
gdtext(objtd.offsetLeft+(objtd.offsetWidth/2),objtd.offsetTop+objtd.offsetHeight,obj.sname+":出来邪恶的伙计,捏哈哈!")
if(zd.difang.length>=zd1td.length){  //判断敌满员
gdtext(objtd.offsetLeft+(objtd.offsetWidth/2),objtd.offsetTop+objtd.offsetHeight,obj.sname+":晕,没位置容纳邪恶朋友了!")
return setTimeout(function(){zd.zdjinxing()},1000)
}
for(var tmi=0;tmi<xml.gws.length;tmi++){if(xml.gws[tmi]==null)break;}
var gwnum=-1  //单个为何种怪物
while(gwnum==-1){
var r=round(random()*(tmi-1))
var gwnum2=xml.gws[r].split("=")[0].replace("%","")
if(100*random()<gwnum2){gwnum=r;break}
}
for(var i=0;i<zd1td.length;i++){if(zd1td[i].bgColor!=""){zd1td[i].onmouseout="";break;}}
zd.difang[zd.difang.length]=i;var tempdi=zd1td[zd.difang[zd.difang.length-1]]
tempdi.innerHTML=zd.guaihtm(xml.gws[gwnum].split("=")[1]);
var img1=tempdi.getElementsByTagName("IMG")[0];img1.xingdong=true;img1.style.visibility="hidden"
if(img1.szt!="无"){img1.szt=img1.szt.split(",");}
var newimg=document.createElement("IMG");newimg.src=img1.src;
newimg.style.left=tempdi.offsetLeft;newimg.style.top=-100;
zd_kuang.appendChild(newimg);newimg.go=setInterval(function(){
if(newimg.offsetTop<tempdi.offsetTop-20){newimg.style.top=newimg.offsetTop+5}else{
gdtext(newimg.offsetLeft,newimg.offsetTop,img1.sname+":一起灭了对方!")
zd1td[i].bgColor="";zddh.cle(newimg.go);newimg.removeNode(true);img1.style.visibility="visible";
obj.style.visibility="visible";dijnuse1.removeNode(true);dijnuse2.removeNode(true)
setTimeout("zd.zdjinxing()",1000);
}},30);
}else if(jnname=="致命打击"){
obj.style.visibility="hidden";var thesheng=xml.getgw(obj.sname).getAttribute("sheng")
if(thesheng==null){yinxiao("怪攻声")}else if(thesheng=="男性"){yinxiao("男攻声")}else if(thesheng=="女性"){yinxiao("女攻声")}else{yinxiao("机攻声")}
var img1=document.createElement("IMG");img1.src=obj.src
img1.style.left=zd2td[thenum].offsetLeft;img1.style.visibility="hidden"
zd_kuang.appendChild(img1);zddh.endcishu=1
img1.style.top=zd2.offsetTop+zd2td[thenum].offsetTop-img1.offsetHeight;img1.style.visibility="visible"
img1.go=setTimeout(function(){img1.removeNode(true);obj.style.visibility="visible";zddh.enddh(zd2td[thenum].getElementsByTagName("IMG")[0],obj,"致命打击="+jn2num);},1500)
}},
jn_治疗2:function(obj,guaijn2){
obj.go=setTimeout(function(){var tempobj=zd1td[obj.i].getElementsByTagName("IMG")[0];tempobj.shp1=parseInt(tempobj.shp1)+guaidh.getweili(guaijn2)+round(tempobj.shp2/20);if(tempobj.shp1>tempobj.shp2)tempobj.shp1=tempobj.shp2;clearTimeout(obj.go);zd_kuang.removeChild(obj);zddh.enddh2(tempobj,"HP+"+(guaidh.getweili(guaijn2)+round(tempobj.shp2/20)));},1600)
},
jn_巨石敲脑壳2:function(obj,obj2,jnname,jn2num,mubiaonum){
obj.go=setInterval(function(){
if(obj.offsetTop>bodyhei+obj.offsetHeight){yinxiao("击中1");var img2=document.createElement("IMG")
img2.src="img/zd/jn_ddqc.gif";img2.style.left=zd2td[mubiaonum].offsetLeft+(130-round(random()*200));
img2.style.top=zd2.offsetTop+zd2td[mubiaonum].offsetTop+(100-round(random()*150));
zd_kuang.appendChild(img2);img2.go=setTimeout(function(){zd_kuang.removeChild(img2)},600);
zddh.cle(obj.go);zd_kuang.removeChild(obj);if(obj.zuihou!=null){
guaidh.addjieshu(obj2,jnname+"="+jn2num);
}}else{
obj.style.top=obj.offsetTop+obj.dex;obj.dex+=2
}
},40)
},
jn_全面强化2:function(obj,guaijn2){
obj.go=setInterval(function(){if(obj.yici!=null)obj.len1-=2;if(obj.yici==null)obj.len1+=2;if(obj.len1>60)obj.yici=true;
obj.filters[0].clear();
obj.filters[0].addCone(obj.offsetWidth/3,0,1,obj.offsetWidth,obj.offsetHeight,255,255,0,obj.len1,obj.offsetWidth);
if(obj.yici!=null&&obj.len1<5){obj.filters[0].clear();obj.style.filter=null;zddh.cle(obj.go);obj.removeAttribute("go");obj.removeAttribute("yici");var temwl=(100+parseInt(guaidh.getweili(guaijn2)))/100
if(obj.sjiaqiang==null){obj.shp2=round(obj.shp2*temwl);obj.smp2=round(obj.smp2*temwl);obj.sact1=round(obj.sact1*temwl);
obj.sact2=round(obj.sact2*temwl);obj.smct1=round(obj.smct1*temwl);obj.smct2=round(obj.smct2*temwl);
obj.sdef=round(obj.sdef*temwl);obj.smef=round(obj.smef*temwl);obj.ssu=round(obj.ssu*temwl);
obj.sjq=round(obj.sjq*temwl);obj.ssb=round(obj.ssb*temwl);obj.sbj=round(obj.sbj*temwl);obj.sexp=round(obj.sexp*temwl);obj.scold=round(obj.scold*temwl);
obj.sjiaqiang=true;}
zddh.enddh2(obj,"能力全面提升"+guaidh.getweili(guaijn2))
}
},30);
},

jitui:function(obj,jilv){  //战场被击退处理
if(jilv==null)jilv=100;if(random()*100>jilv||obj.go!=null)return obj;
var ran=round(random()*(zd1td.length-1));
if(obj.id!="zdme"){
while(zd1td[ran].getElementsByTagName("IMG").length!=0){
ran=round(random()*(zd1td.length-1))}
var tdsyes=false;for(var i=0;i<zd.difang.length;i++){
if(zd1td[zd.difang[i]].getElementsByTagName("IMG")[0]!=obj)continue;for(var j=0;j<zd.tds.length;j++){if(zd.tds[j]==obj){tdsyes=true;break;}}
var temphtm=obj.outerHTML,tempzt=obj.szt,tempxingdong=obj.xingdong;obj.removeNode(true)
zd.difang[i]=ran;zd1td[ran].innerHTML=temphtm+zd1td[ran].innerHTML
var tempobj=zd1td[ran].getElementsByTagName("IMG")[0];
tempobj.szt=tempzt;tempobj.removeAttribute("go");tempobj.xingdong=tempxingdong;
zd.tds[j]=tempobj;return tempobj
}}else{  //击退我方
while(zd2td[ran].getElementsByTagName("IMG").length!=0){
ran=round(random()*(zd2td.length-1))}
var tdsyes=false;for(var i=0;i<zd.wofang.length;i++){
if(zd2td[zd.wofang[i]].getElementsByTagName("IMG")[0]!=obj)continue;
for(var j=0;j<zd.tds.length;j++){if(zd.tds[j]==obj){tdsyes=true;break;}}
var temphtm=obj.outerHTML,tempxingdong=obj.xingdong;obj.removeNode(true)
zd.wofang[i]=ran;zd2td[ran].innerHTML=temphtm+zd2td[ran].innerHTML
zd2td[ran].getElementsByTagName("IMG")[0].xingdong=tempxingdong;
if(tdsyes)zd.tds[j]=zd2td[ran].getElementsByTagName("IMG")[0];return zd2td[ran].getElementsByTagName("IMG")[0]
}}
},

yd1:function(obj,diwo){  //战场移动特效
var oldx=obj.parentElement.offsetLeft+obj.offsetLeft,oldy=obj.parentElement.offsetTop+obj.offsetTop,newx=0,newy=0
yinxiao("走路");if(diwo=="敌"){
if(zd.difang.length>=zd1td.length){  //无处可移动
gdtext(oldx,oldy,obj.sname+":晕,无路可走了呢!");return setTimeout(function(){zd.zdjinxing()},1000)
}

var ran=round(random()*(zd1td.length-1));
for(var i=0;i<zd1td.length;i++){
if(zd1td[i].dixing=="速"||zd1td[i].dixing=="力"||zd1td[i].dixing=="固"||zd1td[i].dixing=="法"||zd1td[i].dixing=="毅"||zd1td[i].dixing=="保"){
if(zd1td[i].getElementsByTagName("IMG").length==0){ran=i;break;}
}
}
while(zd1td[ran].getElementsByTagName("IMG").length!=0){ran=round(random()*(zd1td.length-1))}
newx=zd1td[ran].offsetLeft;newy=zd1td[ran].offsetTop
}else{oldy+=zd2.offsetTop;newx=zd2td[zd.zdyidong].offsetLeft;newy=zd2td[zd.zdyidong].offsetTop+zd2.offsetTop;}
newx+=obj.offsetLeft;newy+=obj.offsetTop;obj.style.visibility="hidden";
var obj2=document.createElement("IMG");obj2.src=obj.src;obj2.style.width=obj.offsetWidth;obj2.style.height=obj.offsetHeight
obj2.style.left=oldx;obj2.style.top=oldy;
obj2.yibu1=0;obj2.yibu2=20;obj2.x1=(newx-oldx)/obj2.yibu2;obj2.y1=(newy-oldy)/obj2.yibu2;
zd_kuang.appendChild(obj2);
obj2.go=setInterval(function(){if(++obj2.yibu1<obj2.yibu2){  //移动中
obj2.style.left=obj2.x1+obj2.offsetLeft;obj2.style.top=obj2.y1+obj2.offsetTop;
}else{  //移动完成
if(diwo=="敌"){var tdsyes=false;
for(var i=0;i<zd.difang.length;i++){
if(zd1td[zd.difang[i]].getElementsByTagName("IMG")[0]!=obj)continue;
for(var j=0;j<zd.tds.length;j++){if(zd.tds[j]==obj){tdsyes=true;break;}}
var temphtm=obj.outerHTML,tempzt=obj.szt;obj.removeNode(true);
zd.difang[i]=ran;zd1td[ran].innerHTML=temphtm+zd1td[ran].innerHTML
zd1td[ran].getElementsByTagName("IMG")[0].szt=tempzt
if(tdsyes)zd.tds[j]=zd1td[ran].getElementsByTagName("IMG")[0];
zd.movetuoyuan(zd1td[ran]);zd.newobj=zd1td[ran].getElementsByTagName("IMG")[0];
}}else{
var tdsyes=false;
for(var i=0;i<zd.wofang.length;i++){
if(zd2td[zd.wofang[i]].getElementsByTagName("IMG")[0]!=obj)continue;
for(var j=0;j<zd.tds.length;j++){if(zd.tds[j]==obj){tdsyes=true;break;}}
var temphtm=obj.outerHTML,tempzt=obj.szt;obj.removeNode(true);
zd.wofang[i]=zd.zdyidong;zd.ydmubiaotd.innerHTML=temphtm+zd.ydmubiaotd.innerHTML
zd2td[zd.zdyidong].getElementsByTagName("IMG")[0].szt=tempzt
if(tdsyes)zd.tds[j]=zd2td[zd.zdyidong].getElementsByTagName("IMG")[0];
zd.movetuoyuan(zd2td[zd.zdyidong]);zd.newobj=zd.ydmubiaotd.getElementsByTagName("IMG")[0];
}
}
zddh.cle(obj2.go);zd_kuang.removeChild(obj2);zd.newobj.removeAttribute("go");zd.newobj.xingdong=true;
zd.newobj.style.visibility="visible";
if(diwo!="敌"){zd.movezt=0;if(100*random()<zd.newobj.syili&&zd.newobj.yilixingdong!="已毅力行动"){zd.newobj.xingdong=false;zd.newobj.yilixingdong="已毅力行动"}}return setTimeout("zd.zdjinxing()",300);
}},35)
}
}