var wpzb={
getjinglian:function(thezbname){  //精炼度获取
if(thezbname.indexOf("$$$")!=-1){return parseInt(thezbname.substr(thezbname.indexOf("$$$")+3));}else{return 0};
},
jinglianjia:function(jiashuxing,jingliandu){  //精炼度加成
if(jingliandu==0)return jiashuxing;
var alltvalue=jiashuxing.match(/(\d+)/g),tempt=0;if(alltvalue==null)return jiashuxing;
for(var t=0;t<alltvalue.length;t++){tempt=parseFloat(alltvalue[t]);jiashuxing=jiashuxing.replace(tempt,round(tempt+(jingliandu/10*tempt)))}
return jiashuxing;
},
getjiage:function(getobj){  //无定价物品价格计算器
if(getobj.getAttribute("价值")!=null)return getobj.getAttribute("价值");
if(getobj.getAttribute("lei")==null)return 10;  //物品用返回
if(getobj.getAttribute("级别")==null)return 20;  //装备用返回
if(getobj.getAttribute("lei")=="武器"){return getobj.getAttribute("级别")*20}else{return getobj.getAttribute("级别")*10}
},
zbadd:function(addzb,xiexia,baoliu){  //装备更新用函数
var xmlzb=xml.getwp("zb",addzb);if(xmlzb==null)return lt.help("此装备数据库中不存在")
var tdlei=xmlzb.getAttribute("lei");if(addzb==null)return;
switch(tdlei){
case "座驾":zbnum=0;break;case "头盔":zbnum=3;break;case "纹章":zbnum=6;break;
case "潜水衣":zbnum=7;break;case "肩饰":zbnum=9;break;case "衣":zbnum=10;break;
case "披风":zbnum=11;break;case "项链":zbnum=13;break;case "飞行器":zbnum=14;break;
case "腰带":zbnum=17;break;case "武器":zbnum=20;break;case "副武器":zbnum=21;break;
case "内衣":zbnum=23;break;case "裤":zbnum=24;break;case "护腕":zbnum=25;break;
case "盾牌":zbnum=27;break;case "丝袜":zbnum=28;break;case "步履":zbnum=31;break;
case "戒指":zbnum=34;break;default:return lt.help("此物未知,或不适宜装备");
}
if(xiexia==null&&wj[0].lv<99999){  //99999是忽视需求,强制穿戴
if(wj[0].lv<parseInt(xmlzb.getAttribute("级别")))return lt.help("级别太低,无法装备")
if(rpg.dian[0]<parseInt(xmlzb.getAttribute("战心要求")))return lt.help("战心信仰力不足,无法装备")
if(rpg.dian[1]<parseInt(xmlzb.getAttribute("魔心要求")))return lt.help("魔心信仰力不足,无法装备")
if(rpg.dian[2]<parseInt(xmlzb.getAttribute("守心要求")))return lt.help("守心信仰力不足,无法装备")
if(rpg.dian[3]<parseInt(xmlzb.getAttribute("军心要求")))return lt.help("军心信仰力不足,无法装备")}

for(var i=3;i<xmlzb.attributes.length;i++){
var xbname=xmlzb.attributes[i].name,xbvalue=wpzb.jinglianjia(xmlzb.attributes[i].value,wpzb.getjinglian(addzb))
var tmvalue=xbvalue.replace("%","");
if(xbname=="攻击"||xbname=="魔力"){
var temp1=parseInt(xbvalue.split("-")[0]),temp2=parseInt(xbvalue.split("-")[1])
if(xiexia!=null){temp1=-temp1;temp2=-temp2}
if(xbname=="攻击"){wj[0].act1+=temp1;wj[0].act2+=temp2}else{wj[0].mct1+=temp1;wj[0].mct2+=temp2}
}else{
xiexia!=null?tmvalue=-parseInt(tmvalue):tmvalue=parseInt(tmvalue);
switch(xbname){
case "防御":wj[0].def+=tmvalue;break;case "魔防":wj[0].mef+=tmvalue;break;
case "生命上限":wj[0].hp2+=tmvalue;gx_rpg();break;case "魔法上限":wj[0].mp2+=tmvalue;gx_rpg();break;
case "怒火":wj[0].nu2+=tmvalue;gx_rpg();break;case "毅力":wj[0].yili+=tmvalue;break;
case "精确":wj[0].jingque+=tmvalue;break;case "暴击率":wj[0].baoji+=tmvalue;break;
case "闪避":wj[0].shanbi+=tmvalue;break;case "速度":wj[0].sudu+=tmvalue;break;
case "情商":if(rpg.qingshang<50)rpg.qingshang+=tmvalue;break;
case "幸运":rpg.luck+=tmvalue;break;case "移动力":rpg.yd+=tmvalue;break;
case "战心":tbzt.dianjisuan("减去");rpg.dian[0]+=tmvalue;tbzt.dianjisuan();break;
case "魔心":tbzt.dianjisuan("减去");rpg.dian[1]+=tmvalue;tbzt.dianjisuan();break;
case "守心":tbzt.dianjisuan("减去");rpg.dian[2]+=tmvalue;tbzt.dianjisuan();break;
case "军心":tbzt.dianjisuan("减去");rpg.dian[3]+=tmvalue;tbzt.dianjisuan();break;
case "四围":tbzt.dianjisuan("减去");rpg.dian[0]+=tmvalue;rpg.dian[1]+=tmvalue;rpg.dian[2]+=tmvalue;rpg.dian[3]+=tmvalue;tbzt.dianjisuan();break;
case "才能界限":wj[0].lv2+=tmvalue;gx_rpg();break;
}}
}  //end for
if(zt_kuang.style.display!="none"){selwj=wj[0];gx_rpg();tbzt.zhuangtai()}
if(xiexia!=null){  //是卸下计算,可选吧装备格清空,但不操作物品格
if(baoliu!=null)return true
rpg.zb[zbnum]=null;zbtd[zbnum].innerHTML=""
gx_qianneng();
return true
}
rpg.zb[zbnum]=addzb;  //是穿上
zbtd[zbnum].innerHTML="<img src='img/zb/"+xmlzb.getAttribute("src")+"' style='position:static;width:25;height:25;' xml_node='zb' xml_name='"+addzb+"' onmousemove=\"showtmk('wupin or zhuangbei%#&@!-$^=zb='+this.xml_name)\" lei='"+tdlei+"' onmouseup='if(event.button==2)wpzb.wupin_use(event.srcElement,rpg.wp)'>"
gx_qianneng();
return true
},
wupin:function(){  //物品栏更新
for(var i=0;i<rpg.wp.length;i++){
if(rpg.wp[i]==null){wps[i].innerHTML="&nbsp;";continue;}
var rpgwp=rpg.wp[i].split("=")
var getwp1=xml.getwp(rpgwp[0],rpgwp[1]),tempwp2=rpgwp[2]==1?"":rpgwp[2];
wps[i].innerHTML="<img src='img/"+rpgwp[0]+"/"+getwp1.getAttribute("src")+"' style='position:static;width:26;height:26;' onmouseup='if(event.button==2)wpzb.wupin_use(this,rpg.wp)' xml_node='"+rpgwp[0]+"' xml_name='"+rpgwp[1]+"' shuliang='"+rpgwp[2]+"' onmousemove=\"showtmk('wupin or zhuangbei%#&@!-$^="+rpgwp[0]+"="+rpgwp[1]+"')\" weizhi="+i+"><font style='position:absolute;color:purple;font-size:13px;margin-left:-30;margin-top:16'>"+tempwp2+"</font>"
}},
wupin_use:function(obj,wporck){  //右键使用
if(sl.suoding||sd_loading||wpzb.moveobj!=null)return false;
if(sd_sd&&(sd.sdname=="精炼"||sd.sdname=="分解"||sd.sdname=="锻制"||sd.sdname=="强化"))return false;
var xmlobj=xml.getwp(obj.xml_node,obj.xml_name)
if(obj.xml_node=="zb"){  //是装备从身体卸下 或 从包裹中切换新装备或穿上
if(zd.zdzhong&&selwj!=wj[0])return alert("战斗中仅限操纵主角时,可能调换装备！");
var thelei=xmlobj.getAttribute("lei")
if(obj.parentElement.id=="zbtd"){  //卸下
if(thelei=="飞行器"&&yd.zt=="飞行")return lt.help("飞行状态中,不能卸下飞行物")
if(wp_add(obj.xml_node,obj.xml_name,1)!=true)return;
wpzb.zbadd(obj.xml_name,"脱")
}else{  //穿上
var oldzb=null;for(var i=0;i<rpg.zb.length;i++){if(rpg.zb[i]==null)continue;
if(xml.getwp("zb",rpg.zb[i]).getAttribute("lei")!=thelei)continue;
oldzb=rpg.zb[i];break;
}
if(obj.shuliang>1)return gdtext(event.x,event.y,"无法一次穿戴一组装备,请先拆分");  //成组无法直接装备
if(wpzb.zbadd(obj.xml_name)!=true)return;  //装备失败

if(oldzb!=null){  //此类已有装备,更换
wporck[obj.weizhi]=obj.xml_node+"="+oldzb+"=1"
wpzb.zbadd(oldzb,"模拟脱下计算","但不要删除现有装备")
}else{  //直接穿上
wporck[obj.weizhi]=null
}
}
yinxiao("装备切换");
if(wporck==rpg.wp)wpzb.wupin();if(wporck==rpg.ck)sd.xuanxiang();return;
}
 //是使用包裹物品
if(xmlobj.getAttribute("ckuse")==null)return gdtext(event.x,event.y,'此物,无法右键使用');
if(xmlobj.getAttribute("ckuse")=="场景"&&zd.zdzhong)return gdtext(event.x,event.y,'此物,战时无法使用');
if(xmlobj.getAttribute("ckuse")=="战时"&&!zd.zdzhong)return gdtext(event.x,event.y,'此物,只能战时使用');
if(zd.zdzhong){
zd.usewp1=xmlobj;zd.usewp2=obj;wp_kuang.style.display="none";zd.closezdgn()
zd.jnwpfanwei=xmlobj.getAttribute("fe");return zd.movezt=3
}
yinxiao("使用");if(usewp(obj.xml_name)=="成功"){
if(obj.shuliang==1){wporck[obj.weizhi]=null}else{
wporck[obj.weizhi]=obj.xml_node+"="+obj.xml_name+"="+(obj.shuliang-1);
}}
if(wporck==rpg.wp)wpzb.wupin();if(wporck==rpg.ck)sd.xuanxiang();
},

moveobj:null,
wupin_move1:function(obj){ //物品-移动第一步
if(event.button!=1||obj.tagName!="IMG"||sl.suoding||sd_loading)return false;
wpzb.moveobj=obj;obj.style.visibility="hidden";obj.nextSibling.style.visibility="hidden";wpmoveimg.src=obj.src;
wpmoveimg.style.left=event.x;wpmoveimg.style.top=event.y;
wpmoveimg.style.width=obj.offsetWidth;wpmoveimg.style.height=obj.offsetHeight
wpmoveimg.style.zIndex+=tbfun.dropzindex;wpmoveimg.style.display=""
wpzb.moveobj.setCapture();yinxiao("物品移动")
},
wupin_move2:function(){  //2
if(event.button!=1||wpzb.moveobj==null||sl.suoding||sd_loading)return false;
wpmoveimg.style.left=event.x+2;wpmoveimg.style.top=event.y+2
},
wupin_move3:function(wporck){  //3
if(event.button!=1||wpzb.moveobj==null||sl.suoding||sd_loading)return false;
wpmoveimg.style.display="none";wpzb.moveobj.releaseCapture();
wpzb.moveobj.style.visibility="visible";wpzb.moveobj.nextSibling.style.visibility="visible";
if(sd_sd&&sd.sdname=="分解"){alert("分解作业中,休要乱动!");return false}

var obj=event.srcElement  //关键第3步更新

if(obj.id=="wps"||obj.parentElement.id=="wps"){  //to 物品格,或 to 已有物品,交换...
if(obj.id!="wps")obj=obj.parentElement
for(var i=0;i<wps.length;i++)if(wps[i]==obj)break;
if(wpzb.moveobj.weizhi==i&&wpzb.moveobj.parentElement.id=="wps"){
if(wpzb.moveobj.shuliang>1)return sl.open("分割",wpzb.moveobj,wporck);  //自身,分割
return wpzb.moveobj=null; //无法分割,不进行任何操作
}
if(rpg.wp[i]==null){  //空的
rpg.wp[i]=wporck[wpzb.moveobj.weizhi];wporck[wpzb.moveobj.weizhi]=null;
}else{  //有物品
var oldwp=wporck[wpzb.moveobj.weizhi],newwp=rpg.wp[i]
var oldwp2=oldwp.split("="),newwp2=newwp.split("=")
if(oldwp2[1]==newwp2[1]){  //同类物品交换
var themax=xml.getwp(oldwp2[0],oldwp2[1]).getAttribute("max")
if(themax!=null){  //交换可以叠加
if($(oldwp2[2])+$(newwp2[2])>themax){  //叠加,但超过最大值
rpg.wp[i]=oldwp2[0]+"="+oldwp2[1]+"="+themax;
wporck[wpzb.moveobj.weizhi]=newwp2[0]+"="+newwp2[1]+"="+($(oldwp2[2])+$(newwp2[2])-themax)
}else{  //叠加,未超最大值
rpg.wp[i]=oldwp2[0]+"="+oldwp2[1]+"="+($(oldwp2[2])+$(newwp2[2]))
wporck[wpzb.moveobj.weizhi]=null}
}else{  //不可叠加
wporck[wpzb.moveobj.weizhi]=newwp;rpg.wp[i]=oldwp;
}
}else{wporck[wpzb.moveobj.weizhi]=newwp;rpg.wp[i]=oldwp;}  //非同类物品交换
}  //end 有物品

}else if((obj.id=="maitd"||obj.parentElement.id=="maitd")&&sd.sdname=="仓库"){ //to仓库
if(obj.id!="maitd")obj=obj.parentElement
for(var i=0;i<maitd.length;i++)if(maitd[i]==obj)break;
if(wpzb.moveobj.weizhi==i&&wpzb.moveobj.parentElement.id=="maitd")return;  //自身无效
if(rpg.ck[i]==null){  //空的
rpg.ck[i]=wporck[wpzb.moveobj.weizhi];wporck[wpzb.moveobj.weizhi]=null;
}else{  //有物品
var oldwp=wporck[wpzb.moveobj.weizhi],newwp=rpg.ck[i]
var oldwp2=oldwp.split("="),newwp2=newwp.split("=")
if(oldwp2[1]==newwp2[1]){  //同类物品交换
var themax=xml.getwp(oldwp2[0],oldwp2[1]).getAttribute("max")
if(themax!=null){  //交换可以叠加
if($(oldwp2[2])+$(newwp2[2])>themax){  //叠加,但超过最大值
rpg.ck[i]=oldwp2[0]+"="+oldwp2[1]+"="+themax;
wporck[wpzb.moveobj.weizhi]=newwp2[0]+"="+newwp2[1]+"="+($(oldwp2[2])+$(newwp2[2])-themax)
}else{  //叠加,未超最大值
rpg.ck[i]=oldwp2[0]+"="+oldwp2[1]+"="+($(oldwp2[2])+$(newwp2[2]))
wporck[wpzb.moveobj.weizhi]=null}
}else{  //不可叠加
wporck[wpzb.moveobj.weizhi]=newwp;rpg.ck[i]=oldwp;
}
}else{wporck[wpzb.moveobj.weizhi]=newwp;rpg.ck[i]=oldwp;}  //非同类物品交换
}  //end 有物品

}else if(obj.id=="fm1"||obj.parentElement.id=="fm1"||obj.id=="lihua"){  //仍
if(sd_sd&&(sd.sdname=="锻制"||sd.sdname=="强化")){alert("锻制强化作业中,禁止乱仍东西");return false;}
wpzb.rengbao(mex,mey,wpzb.moveobj.xml_node,wpzb.moveobj.xml_name,wpzb.moveobj.shuliang)
wporck[wpzb.moveobj.weizhi]=null;
}else if(obj.id=="zbtd"||obj.parentElement.id=="zbtd"){  //物品 to 装备栏上
if(zd.zdzhong)return;
if(wpzb.moveobj.xml_node=="wp"){wpzb.moveobj=null;return lt.help("物品是用的,不是穿的")}
if(sd_sd&&(sd.sdname=="精炼"||sd.sdname=="锻制"||sd.sdname=="强化")){if(wpzb.moveobj!=null)wpzb.moveobj=null;return;}
for(var i=0;i<zbtd.length;i++){
if(obj.id=="zbtd"){if(zbtd[i]==obj)break;}else{if(zbtd[i]==obj.parentElement)break;}
}
if(zbtd[i].temtit==null){wpzb.moveobj=null;return lt.help("你未准确的拖入装备格")}
var oldwp=null
if(obj.id!="zbtd"){oldwp=obj.xml_name}
if(obj.id=="zbtd"&&obj.innerHTML.length>5){oldwp=obj.getElementsByTagName("IMG")[0].xml_name}  //有物,光标却碰边际
var thelei=xml.getwp("zb",wpzb.moveobj.xml_name).getAttribute("lei")
var tdlei=zbtd[i].temtit.replace('特别配备:','')
if(tdlei!=thelei){wpzb.moveobj=null;return lt.help("装备品类不符")}

if(wpzb.moveobj.shuliang>1)return gdtext(event.x,event.y,"无法一次穿戴一组装备,请先拆分");  //成组无法直接装备
if(wpzb.zbadd(wpzb.moveobj.xml_name)!=true)return wpzb.moveobj=null;  //装备失败
yinxiao("装备切换");
wporck[wpzb.moveobj.weizhi]=oldwp==null?null:"zb="+oldwp+"=1";
if(oldwp!=null)wpzb.zbadd(oldwp,"模拟脱下计算","但不要删除现有装备")
}else if(obj.id=="ddh"){  //卖掉
sl.open("典当",wpzb.moveobj,wporck);
}
wpzb.wupin();if(sd.sdname=="仓库")sd.xuanxiang();wpzb.moveobj=null;me.focus()
},
findwp:function(wplei,wpname){  //查询某个物品+数量,够与不够
var len1=rpg.wp.length,wpall=0;for(var i=0;i<len1;i++){
if(rpg.wp[i]==null)continue;
var wp0=rpg.wp[i].split("="),wp1=wp0[0],wp2=wp0[1]
if(wp1!=wplei||wp2!=wpname)continue;
wpall+=parseInt(wp0[2]);
}
return wpall;
},
rengbao:function(ranx,rany,thenode,thename,theshuliang){  //仍或爆出DD
var htm=document.createElement("IMG");htm.src="img/"+thenode+"/"+xml.getwp(thenode,thename).getAttribute("src")
htm.style.cursor="hand";htm.id="fmwp";htm.style.zIndex=10000;
htm.style.left=ranx+round(100-(200*random()));htm.style.top=rany+round(100-(200*random()));htm.xml_node=thenode;htm.xml_name=thename
htm.shuliang=theshuliang;htm.bushu1=15;htm.updown=15;htm.oldy=parseInt(htm.style.top)
htm.onmouseover=function(){showtmk('wupin or zhuangbei%#&@!-$^='+thenode+'='+thename)}
if(zd_kuang.tempbg==""||zd_kuang.tempbg==null){zd_kuang.tempbg=new String(zd_kuang.style.backgroundImage)}
if(zd.toushi==false)zd_kuang.style.backgroundImage="";
htm.onmousedown=function(){if(this.go!=null)return;
if(zd.zdzhong)return gdtext(this.offsetLeft,this.offsetTop,"战利品打赢架才让吃,死回去消失捏哈哈! - 淫笑~-~我日!!")
if($(ying.offsetLeft-this.offsetLeft)>200||$(ying.offsetTop-this.offsetTop)>200)return;
if(wp_add(this.xml_node,this.xml_name,this.shuliang)!=true)return;
lt.help("获得 "+this.shuliang+"个 "+this.xml_name);if(this.shuliang>1){fm1.removeChild(this.nextSibling);}fm1.removeChild(this);
if(wp_kuang.style.display!="none")wpzb.wupin();tmk1.style.visibility="hidden";return yinxiao("吃")
}
fm1.appendChild(htm);if(htm.shuliang>1){
var htm2=document.createElement("FONT")
htm2.style.position="absolute";htm2.style.color="purple";htm2.style.fontSize="13px";htm2.style.left=htm.style.left;htm2.style.top=htm.style.top
htm2.style.marginLeft=-5;htm2.style.marginTop=htm.offsetHeight-10;htm2.innerText=htm.shuliang;htm2.style.visibility="hidden";htm2.style.zIndex=10000;
fm1.appendChild(htm2)
}yinxiao("掉落")
htm.go=setInterval(function(){
if(htm.bushu1<1&&htm.offsetTop+15>=htm.oldy){clearInterval(htm.go);htm.go=null;if(htm.shuliang>1)htm.nextSibling.style.visibility="visible";if(zd.toushi==false)zd_kuang.style.backgroundImage=zd_kuang.tempbg;}
if(htm.bushu1--<1){htm.updown+=1;htm.style.top=htm.offsetTop+htm.updown;}
else{if(htm.updown--<1)htm.updown=1;htm.style.top=htm.offsetTop-htm.updown;}
},25)
}
}

function usewp(wpname,usemubiao){  //物品使用效果
if(usemubiao==null)usemubiao=selwj
var v1=$(xml.getwp("wp",wpname).getAttribute("v1"))
var v2=$(xml.getwp("wp",wpname).getAttribute("v2"))
if(wpname.indexOf("洗点券")!=-1){var temp1=wpname=="魔心洗点券"?1:
wpname=="守心洗点券"?2:
wpname=="军心洗点券"?3:0;tbzt.dianjisuan("减去")
if(rpg.dian[temp1]>=v1)rpg.dian[temp1]-=v1;else {v1=rpg.dian[temp1];rpg.dian[temp1]=0;};
rpg.usedian+=v1;lt.help("你的一项属性点洗去了 "+v1+" 点,现在可以重新分配");tbzt.dianjisuan();tbzt.zhuangtai();
}
if(wpname.indexOf("奥义:")==0){var jnname=wpname.substr(3);
if(jn.find(jnname)!=false)return lt.help(wpname+" 你已经习得,无需再次使用");
if(wpname.indexOf("奥义:真·")==0){var jnname2=wpname.substr(5),findjn1=jn.find(jnname2),manji=xml.getjn(jnname2).childNodes.length;
if(rpg.yuanling<v1)return lt.help("你没有"+v1+"元灵,无法进行修炼");
if(findjn1==false)return lt.help(jnname2+" 尚未习得,无法进化为终极技能");
if(findjn1[1]<manji)return lt.help(jnname2+" 未修炼到满级"+manji+",无法进化为终极技能");
jn.addjn(wpname.substr(3),10);rpg.yuanling-=v1;lt.help("恭喜你,技能 ["+jnname2+"] 进化为终极形态 ["+wpname.substr(3)+"]!");
}else{if(wpname.indexOf("暗黑时代合战")!=-1){if(jn.find("销声匿迹")==false)return lt.help("学习该技能前,你必须先学会神说系技能 - 销声匿迹!提示:这本技能书,在强化妹那里可以合成出来!");}
jn.addjn(jnname,1);lt.help("恭喜你,技能 ["+jnname+"]1级 修炼成功!");}
jn.show(jn.oldjnlei);gx_qianneng();
if(wpname.indexOf("神说俺样最强")!=-1)showshige("神说:第八章 觉醒");
}else if(wpname.indexOf("诗歌:")==0||wpname.indexOf("资料:")==0||wpname.indexOf("石板:")==0||wpname.indexOf("神说:")==0){
showshige(wpname);
}else if(wpname.indexOf("对决门:")==0){if(wj[0].lv<v2)return gdtext(event.x,event.y,"无效,挑战该BOOS你的级别最低也要="+v2+"级");
var tempdantiao=wpname.indexOf("暗灵王子")!=-1?true:confirm("请问你是否单挑、还是合战？单挑=选确定、不单挑=选取消");
var tempdantiao2=tempdantiao==true?"单挑":null;
var gwname=wpname.substr(4);dh.close();stoploading();sdcloseimg.onmousedown();
gdtext(event.x,event.y,gwname+":何人胆敢挑战本座,后悔吧....");
setTimeout(function(){zd.begin(xml.getwp("wp",wpname).getAttribute("v1"),tempdantiao2);zd.zdzhong=true;},1000)
}else if(wpname.indexOf("穿越门:")==0){var jnname=wpname.substr(4);
xml.loaddt(xml.getwp("wp",wpname).getAttribute("link"),jnname,v1,v2);saveuser();yinxiao("起飞");
}
switch(wpname){
case "A型红药":usemubiao.hp1+=v1;break;case "B型红药":usemubiao.hp1+=v1;break;
case "C型红药":usemubiao.hp1+=v1;break;case "D型红药":usemubiao.hp1+=v1;break;
case "E型红药":usemubiao.hp1+=v1;break;case "F型红药":usemubiao.hp1+=v1;break;
case "A型蓝药":usemubiao.mp1+=v1;break;case "B型蓝药":usemubiao.mp1+=v1;break;
case "C型蓝药":usemubiao.mp1+=v1;break;case "D型蓝药":usemubiao.mp1+=v1;break;
case "E型蓝药":usemubiao.mp1+=v1;break;case "F型蓝药":usemubiao.mp1+=v1;break;
case "A型绿药":usemubiao.hp1+=v1;usemubiao.mp1+=v2;break;case "B型绿药":usemubiao.hp1+=v1;usemubiao.mp1+=v2;break;
case "C型绿药":usemubiao.hp1+=v1;usemubiao.mp1+=v2;break;case "D型绿药":usemubiao.hp1+=v1;usemubiao.mp1+=v2;break;
case "A型黄药":usemubiao.nu1+=round(usemubiao.nu2*v1);break;case "B型黄药":usemubiao.nu1+=round(usemubiao.nu2*v1);break;
case "A型还魂草":siwang.yaoji(usemubiao,v1,v2);break;case "B型还魂草":siwang.yaoji(usemubiao,v1,v2);break;
case "C型还魂草":siwang.yaoji(usemubiao,v1,v2);break;
case "人参果":usemubiao.hp1+=round(usemubiao.hp2*v1);usemubiao.mp1+=round(usemubiao.mp2*v1);usemubiao.nu1+=round(usemubiao.nu2*v1);break;
case "小天使の祝福":usemubiao.hp1+=round(usemubiao.hp2*v1);addzt(me,"天赐甘霖",usemubiao.lv2*2,usemubiao.lv2*2);break;
case "精灵草":var tmptxt=jn.jieduwpjn(2);lt.help(tmptxt);if(tmptxt.indexOf("使用无效")!=-1)return;
break;
case "强效精灵草":var tmptxt=jn.jieduwpjn(3);lt.help(tmptxt);if(tmptxt.indexOf("使用无效")!=-1)return;
break;
case "兴奋剂":
var temobj=xml.getjn("天赐甘霖");jn.usexiaoguo(temobj,temobj.childNodes[0],selwj,"nompnu");
temobj=xml.getjn("伤痛减轻");jn.usexiaoguo(temobj,temobj.childNodes[0],selwj,"nompnu");
temobj=xml.getjn("进攻战术");jn.usexiaoguo(temobj,temobj.childNodes[0],selwj,"nompnu");
temobj=xml.getjn("血魔附体");jn.usexiaoguo(temobj,temobj.childNodes[0],selwj,"nompnu");
break;
case "回程券":xml.loaddt("chengshi",xml.guishu)
sd_kuang.style.display="none";sd_sd=false;
break;
case "黄金包":rpg.hj+=1;break;
case "神魔源泉":wj[0].lv2+=1;break;
case "烟花弹":if(rwbutton.go!=null)return;shouce.yanhua();break;
case "引诱晶球":if(rpg.glod<20)return lt.help("你已经没钱使用晶球刷怪了");rpg.glod-=20;gx_rpg();
if(random()>0.5)return;return zd.tance("刷怪")
break;
case "古文残页":var tempexp=round(usemubiao.exp2/20);if(tempexp>1000)tempexp=1000;usemubiao.exp1+=tempexp;lt.help("阅读古文残页,使你经验增加 ["+tempexp+"] 点");break;
case "德国汉堡":wj[0].hp2+=v1;break;case "魔法寿司":wj[0].mp2+=v1;break;
case "四川麻辣烫":wj[0].nu2+=v1;break;case "珍珠翡翠白玉汤":wj[0].yili+=v1;break;
case "水果奶酪披萨":wj[0].baoji+=v1;break;
case "菠菜绿豆羹":wj[0].act1+=v1;wj[0].act2+=v1;break;case "冰激凌圣代":wj[0].mct1+=v1;wj[0].mct2+=v1;break;
case "巨无霸鸡腿":wj[0].def+=v1;break;case "姐妹蛋夹卷":wj[0].mef+=v1;break;
case "天然矿物质绿茶":wj[0].sudu+=v1;break;case "八氯氰胺奶":wj[0].jingque+=v1;break;
case "么你黑咖啡":wj[0].shanbi+=v1;break;case "生日蛋糕":rpg.qingshang+=v1;break;
case "雄起泥棒":wj[0].baoji+=v1;break;case "撒尿泥窝":rpg.usedian+=v1;break;case "最甜蜜的蛋糕":rpg.qingshang+=v1;rpg.luck+=v2;break;
case "名望证明":rpg.mingwang+=v1;lt.help("名望增长 "+v1+" 点");break;
case "元灵神丹":rpg.yuanling+=v1;lt.help("元灵增长 "+v1+" 点");break;
case "纹章之心":if(wp_add("wp","纹章之蕊",Math.ceil(random()*30))!=true)return;break;
}
gx_rpg();if(zt_kuang.style.display!="none")tbzt.zhuangtai();return "成功";
}


function wp_add(wplei,wpname,wpshu){  //物品的(后台)基本操作
var templen=rpg.wp.length  //前期计算准备
var findwp=null,wpzongshu=0,wpmax=false
var xmlwp=xml.getwp(wplei,wpname).getAttribute("max")
for(var i=0;i<templen;i++){
if(rpg.wp[i]==null)continue;wpzongshu++;
if(rpg.wp[i].split("=")[1]==wpname&&findwp==null)findwp=i
}
wpmax=wpzongshu>=templen;wpshu=parseInt(wpshu);if(xmlwp!=null)xmlwp=parseInt(xmlwp)
if(findwp==null){  //没有此物
if(wpmax==true)return lt.help("行李已满!")
if(wpshu<1)return false;  //无法再删除,就退出
for(var i=0;i<templen;i++){
if(rpg.wp[i]==null){rpg.wp[i]=wplei+"="+wpname+"="+wpshu;return true}
}
}else{  //已有此物
if(xmlwp==null){ //但不可叠加
if(wpmax==true&&wpshu>0)return lt.help("行李已满")
if(wpshu<0){rpg.wp[findwp]=null;wpshu+=1;if(wpshu<0){return wp_add(wplei,wpname,wpshu)}return true}  //删
for(var i=0;i<templen;i++){  //添
if(rpg.wp[i]==null){rpg.wp[i]=wplei+"="+wpname+"="+wpshu;return true}
}
}else{  //可以叠加
var wpshu2=parseInt(rpg.wp[findwp].split("=")[2])
if(wpmax==true&&wpshu+wpshu2>xmlwp)return lt.help("行李已满")
if(wpshu2+wpshu<1){rpg.wp[findwp]=null;wpshu=(wpshu+wpshu2);if(wpshu<1){return wp_add(wplei,wpname,wpshu)}return true}  //删
if(wpshu+wpshu2>xmlwp){  //叠加,但超限
rpg.wp[findwp]=wplei+"="+wpname+"="+xmlwp;
for(var i=0;i<templen;i++){
if(rpg.wp[i]==null){rpg.wp[i]=wplei+"="+wpname+"="+(wpshu+wpshu2-xmlwp);return true}
}
}else{  //叠加,未超限
rpg.wp[findwp]=wplei+"="+wpname+"="+(wpshu+wpshu2);return true;
}
}  //可以叠加end
}  //已有此物end
}  //物品基本操作