function yi(yiji){  //主角移动
if(time1!=null){return false}
else if(shutusuoding==true||delsuoding==true)return false
var tempintd=td1[intd].value,tempstr,temptd
if(tempintd==9||tempintd==10){
tempintd==9?tempstr="td1[intd].innerHTML=xialou.outerHTML;":tempstr="td1[intd].innerHTML=shanglou.outerHTML;"
}else{tempstr="td1[intd].innerText='';"}

var temp6="time1youbiao+="+buchang+";";
var temp4="if(shutusuoding==true){clearInterval(time1);time1=null;return false};temp1=img1.outerHTML;"+tempstr
var temp5="time1youbiao=0;clearInterval(time1);time1=null;";
img1flash();
if(yiji==1){ //上
if(intd<tdlie)return false
temptd=td1[intd-tdlie]
temp6+="if(time1youbiao>=tdhei){"+temp4+"intd-=tdlie;td1[intd].innerHTML=temp1;img1top-=tdhei;"+temp5+"}else{img1.style.top=img1.offsetTop-"+buchang+";}"
}else if(yiji==4){ //下
if(intd+tdlie>=td1.length)return false
temptd=td1[intd+tdlie]
temp6+="if(time1youbiao>=tdhei){"+temp4+"intd+=tdlie;td1[intd].innerHTML=temp1;img1top+=tdhei;"+temp5+"}else{img1.style.top=img1.offsetTop+"+buchang+";}"
}else if(yiji==2){ //左
if((intd/tdlie).toString().length<3)return false
temptd=td1[intd-1]
temp6+="if(time1youbiao>=tdwid){"+temp4+"intd-=1;td1[intd].innerHTML=temp1;img1left-=tdwid;"+temp5+"}else{img1.style.left=img1.offsetLeft-"+buchang+";}"
}else if(yiji==3){ //右
if(((intd+1)/tdlie).toString().length<3)return false
temptd=td1[intd+1]
temp6+="if(time1youbiao>=tdwid){"+temp4+"intd+=1;td1[intd].innerHTML=temp1;img1left+=tdwid;"+temp5+"}else{img1.style.left=img1.offsetLeft+"+buchang+";}"
}

var tempv=temptd.value;
bsobj=null
if(tempv==null||tempv==11){}  //空路
else if(tempv==1||tempv==14){return false}  //禁止通行 通行事件
else if(tempv==2){    //黄门
if(key1==0){return false}else{key1--;gx1(temptd);yinxiao("key");}}
else if(tempv==3){    //蓝
if(key2==0){return false}else{key2--;gx1(temptd);yinxiao("key");}}
else if(tempv==4){    //红
if(key3==0){return false}else{key3--;gx1(temptd);yinxiao("key");}}
else if(tempv==5){    //绿
if(key4==0){return false}else{key4--;gx1(temptd);yinxiao("key");}}
else if(tempv==6){    //铁门
if(key5==0){return false}else{yinxiao("key");temptd.value=null}}
else if(tempv==12){    //陷阱1
if(wupin.indexOf("大自然之靴")==-1){yinxiao("xianjing");hp1-=lv*15;gx1(temptd);}}
else if(tempv==13){    //陷阱2
if(wupin.indexOf("大自然之靴")==-1){yinxiao("xianjing");hp1-=lv*15;gx1();}}
else if(tempv==7){    //火
rpgfangxiang=yiji;bsobj=temptd;return false}
else if(tempv==8){    //冰门
rpgfangxiang=yiji;bsobj=temptd;return false}
else if(tempv==9){
setTimeout("ceng--;ditugx('下楼')",200)
}
else if(tempv==10){
setTimeout("ceng++;if(ceng>ceng2)ceng2=ceng;ditugx('上楼')",200)
}else if(tempv==15){    //商店
yinxiao("shop");shopsuoding=true;shop1.style.display="";shop1.focus();return false
}else if(tempv==16||tempv==17||tempv==18||tempv==19){  //宝箱
rpgfangxiang=yiji;bsobj=temptd;return false
}else if(tempv.indexOf("shikong")!=-1){
yinxiao("shikong");
tempgo=tempv.replace(/shikong\=/,"");
tempsrc1=img1.src;img1.removeNode();td1[tempgo].innerHTML="&nbsp;<img width=140 height=160 src='"+tempsrc1+"' id=img1 style='position:absolute;clip:rect(0 25% 25% 0);'>";intd=parseInt(tempgo);img1left=img1.offsetLeft-21;img1top=img1.offsetTop;img1.style.left=img1left
return false
}
else if(tempv=="+key1"){key1++;gx1(temptd)}  //物品
else if(tempv=="+key2"){key2++;gx1(temptd)}
else if(tempv=="+key3"){key3++;gx1(temptd)}
else if(tempv=="+key4"){yinxiao("lv");key4++;gx1(temptd)}
else if(tempv=="+xue1"){yinxiao("chi");hp1+=100;gx1(temptd)}
else if(tempv=="+xue2"){yinxiao("chi");hp1+=200;gx1(temptd)}
else if(tempv=="+xue3"){yinxiao("chi");hp1+=500;gx1(temptd)}
else if(tempv=="+xue4"){yinxiao("chi");hp1+=1000;gx1(temptd)}
else if(tempv=="+xue5"){yinxiao("chi");hp1+=2000;gx1(temptd)}
else if(tempv=="+xue6"){yinxiao("chi");hp1+=5000;gx1(temptd)}
else if(tempv=="+xue7"){yinxiao("chi");hp1+=10000;gx1(temptd)}
else if(tempv=="+xue11"){yinxiao("lv");hp1+=100;hp2+=100;gx1(temptd)}
else if(tempv=="+shi1"){yinxiao("chi");act+=2;gx1(temptd)}
else if(tempv=="+shi2"){yinxiao("chi");def+=2;gx1(temptd)}
else if(tempv=="+shi3"){yinxiao("chi");mef+=5;gx1(temptd)}
else if(tempv=="+shi4"){yinxiao("chi");exp1+=50;gx1(temptd)}
else if(tempv=="+shi5"){yinxiao("chi");act+=3;def+=3;mef+=3;gx1(temptd)}
else if(tempv=="+cod100"){yinxiao("chi");cod+=100;gx1(temptd)}
else if(tempv=="+dun1"){yinxiao("lv");def+=15;gx1(temptd)}
else if(tempv=="+jian2"){yinxiao("lv");act+=15;gx1(temptd)}
else if(tempv=="+宝箱钥匙"){gxwupin("宝箱钥匙",1);temptd.value=null}
else if(tempv=="+速冻徽章"){gxwupin("速冻徽章",1);temptd.value=null}
else if(tempv=="+碎冰铲"){if(temptd.firstChild.dongzuo==null){gxwupin("碎冰铲",1);temptd.value=null}}
else if(tempv=="+药草"){gxwupin("药草",1);temptd.value=null}
else if(tempv=="+上楼器"){gxwupin("上楼器",1);temptd.value=null}
else if(tempv=="+dun3"){yinxiao("lv");def+=20;mef+=5;gx1(temptd)}
else if(tempv=="+jian3"){yinxiao("lv");act+=30;gx1(temptd)}
else if(tempv=="+dun4"){yinxiao("lv");def+=30;mef+=5;gx1(temptd)}
else if(tempv=="+jian4"){yinxiao("lv");act+=55;gx1(temptd)}
else if(tempv=="+dun5"){yinxiao("lv");def+=50;mef+=10;gx1(temptd)}

if(temptd.firstChild!=null){  //分析物件
var temptd2=temptd.firstChild;
rpgfangxiang=yiji;bsobj=temptd2;
if(temptd2.mitivalue!=null)return showmixml(temptd2.mitivalue)
if(temptd2.dongzuo!=null){  //有动作+谈话
return boxmsg(temptd2.tanhua,temptd2.src,temptd2.dongzuo,temptd);
}
if(temptd2.id=="img2"){  //是怪物战斗.
return zhandou();
}
}
guaiwu()
time1=setInterval(temp6,10)
}