⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pet.js

📁 某网页游戏的前台JS控制程序2
💻 JS
📖 第 1 页 / 共 5 页
字号:
		getObj("chatChannel").value="";		//:end	}}function getToTalkUser(input){	actionWin_my.location.href="action.jsp;jsessionid="+sessionId+"?action=getUser&name="+input;		//选到区域上:start		setTalkTo(-1);		listChatChannel="-1";		getObj("chatChannel").value="";		//:end}function huanZhongHong(){	var input=prompt('你准备使用多少个小补血剂来合成中型补血剂',"全部");	if(input!=null){		cmd("hezhonghong "+input);	}}function huanDaHong(){	var input=prompt('你准备使用多少个中型补血剂来合成大型补血剂',"全部");	if(input!=null){		cmd("hedahong "+input);	}}function huanZhongLan(){	var input=prompt('你准备使用多少个小魔法剂来合成中魔法剂',"全部");	if(input!=null){		cmd("hezhonglan "+input);	}}function huanDaLan(){	var input=prompt('你准备使用多少个中魔法剂来合成大魔法剂',"全部");	if(input!=null){		cmd("hedalan "+input);	}}//function askSellItem(){//	var input=prompt('你准备卖什么道具?',"请输入道具名");//	if(input!=null){//		cmd("sellvalue "+input);//	}//}function yaoyan(){	var input=prompt('你要发什么谣言?',"");	if(input!=null){		cmd("rumor "+input);	}}/*function setNick(){	var input=prompt('请输入你想设置的称号(清除输入cls):',"");	if(input!=null){		cmd("title "+input);	}}*/function dropItem(name,item){	var input=prompt('请输入要丢弃 ['+name+'] 的数量',"全部");	if(input!=null){		if(checkInt(input)||"全部"==input){			if(input<1){				alert("丢弃数量不能小于1个!");				dropItem(name,item);			}else{				if(confirm('确认要丢弃 ['+name+'] x '+input+' ?')){					cmd("drop "+item+" "+input);				}			}		}else{			alert("请输入正确的数字!");			dropItem(name,item);		}	}}function fuhuadan(){	var input=prompt('你有白色宠物蛋吗?先给你的宝宝起个名字吧!',"");	if(input!=null){		if(input.trim()==""){			alert("请输入你打算给你的宠物起的名字!");			fuhuadan();		}else{			cmd("fuhua "+input);		}	}}function fakeBr(height){	return "<table height="+height+" width=1 cellpadding=0 cellspacing=0><tr><td></td></tr></table>"}function _saveSet(){	var pos="";	for(var i=0;i<winList.length;i++){		var winLeft=delPx(_getWin(winList[i]).style.left);		var winTop=delPx(_getWin(winList[i]).style.top);		if(winLeft<0){			winLeft=0;		}		if(winTop<0){			winTop=0;		}		pos+=winLeft+"$"+winTop+"}";	}	var channelString="";	for(var i=0;i<channel.length;i++){		channelString+=(i!=0?"}":"")+channel[i];	}	actionWin_my.location.href="action.jsp;jsessionid="+sessionId+"?action=saveSet&args="+huaLi+","+_getCombatPic()+","+getAutoCenter()+","+pos+","+lianJiNeng+","+kuaiJieJian+","+showToolsButton+","+openPKButton+","+channelString+","+noautofightwin+","+noShowTipWin+","+bosskey+","+getObj("chatReaderOut").height+","+openDISPLAYButton+","+openDisSecondCode+",";}function setPetName(s){	getObj("_petName").innerHTML=s;	petName=s;}function getPetName(){	return getObj("_petName").innerHTML;}function changeMap(s){	document.all("mapWin").src="map/"+s+".html";}function _keyPress(){	try{		var _code=-1;		try{			_code=event.keyCode;		}catch(x){			try{				_code=mapWin.event.keyCode;			}catch(x){				_code=petWin.event.keyCode;			}		}		//bossKey		if(bosskey&&_code==192){			var obj=document.all("bossPic");			if(obj.style.display=="none"){				obj.style.display="";				try{parent.parent.document.getElementById("frameTop").rows="0,*";}catch(x){}				try{top.document.title="新建文档 - Mickeysoft word";}catch(x){}			}else{				obj.style.display="none";				changeTitle();			}			event.returnValue=false;			event.cancelBubble=true;			return;		}		if(_code==27){			event.returnValue=false;			event.cancelBubble=true;			return;		}		if(event.ctrlKey&&_code==192){			cmd("l");			event.returnValue=false;			event.cancelBubble=true;			return;		}		if(getPageState()=="zone"){			with(mapWin.document.body){				if(_code==39){//右					scrollLeft=scrollLeft+20;				}else if(_code==37){//左					scrollLeft=scrollLeft-20;				}else if(_code==38){//上					scrollTop=scrollTop-20;				}else if(_code==40){//下					scrollTop=scrollTop+20;				}			}		}		//映射ctrl 1~0:start		//alert(_code);		var useIndex=-1;		if(kuaiJieJian==2){			if(_code>=48&&_code<=57){				if(_code==48){					useIndex=9;				}else{					useIndex=_code-49;				}			}		}else if(kuaiJieJian==1){			if(event.altKey){				if(_code>=48&&_code<=57){					if(_code==48){						useIndex=9;					}else{						useIndex=_code-49;					}				}			}		}		if(event.altKey){			if(kuaiJieJian==1||kuaiJieJian==2){				if(_code==81){					useIndex=10;				}else if(_code==87){					useIndex=11;				}else if(_code==69){					useIndex=12;				}else if(_code==82){					useIndex=13;				}else if(_code==84){					useIndex=14;				}else if(_code==89){					useIndex=15;				}else if(_code==85){					useIndex=16;				}			}		}		if(useIndex!=-1){			useCut(useIndex);			event.returnValue=false;			event.cancelBubble=true;		}		//映射ctrl 1~0:end	}catch(x){		err(x);	}}//左=37//////销售jsvar sellTags=[];function listSellTools(listArr,seled,str){	var hasTags=listArr.length>0&&listArr[0].length==9;	var isLimit=listArr.length>0&&listArr[0].length==10;		if(hasTags){		tags=sellTags;		sellTags=[];		/*		var tags=[];		//生成select框		for(var i=0;i<listArr.length;i++){			var has=false;			for(var t=0;t<tags.length;t++){				if(tags[t]==listArr[i][8]){					has=true;				}			}			if(!has){				tags[tags.length]=listArr[i][8];			}		}		*/	}	var winObj=_getWin("listSellTools");	onOpenWin(winObj);	var o="";	o+=fakeBr(4)	if(str==undefined||str==null){		o+="<font color=red>你想买什么?</font>";	}else{		o+=str;	}	//for tags select	o+="<br>";	if(hasTags){		o+="<table width=100%><tr><td align=right>分类选择: <select onChange=\"cmd('list '+this.value);\">";		for(var i=0;i<tags.length;i++){			o+="<option "+(seled==tags[i]?"selected":"")+" value='"+tags[i]+"'>"+tags[i]+"</option>";		}		o+="</select></td></tr></table>";	}	o+="<table border=0 style='margin-top:3px;margin-bottom:6px;' width=100%>";	var add;	for(var i=0;i<listArr.length;i++){		if(!hasTags||(hasTags&&listArr[i][8]==seled)){			if (isLimit){				add="<td title=销售个数>"+listArr[i][9]+"</td>";				//o+="<tr><td><img src="+listArr[i][3]+"></td><td><a href=# onclick=\"p.cmd('foo toolsSellTools "+listArr[i][2]+"');return false;\">"+listArr[i][0]+"</a></td><td width=10></td><td>"+listArr[i][1]+"</td>"+add+"<td>&nbsp<a href=# onclick=\"p.buyItem('"+listArr[i][4]+"','"+listArr[i][2]+"',"+listArr[i][5]+");p.offOpenWin('listSellTools'); alert('aaaa');return false;\"><font color=blue>【买】</font></a></td></tr>";			}else{				if(listArr[i].length==9){					add="<td title=需要"+listArr[i][6]+"关系>"+listArr[i][7]+"</td>";				}else if(listArr[i].length==8){					add="<td title=需要"+listArr[i][6]+"关系>"+listArr[i][7]+"</td>";				}else {					add="";				}						}			o+="<tr><td><img src="+listArr[i][3]+"></td><td><a href=# onclick=\"p.cmd('foo toolsSellTools "+listArr[i][2]+"');return false;\">"+listArr[i][0]+"</a></td><td width=10></td><td>"+listArr[i][1]+"</td>"+add+"<td>&nbsp<a href=# onclick=\"p.buyItem('"+listArr[i][4]+"','"+listArr[i][2]+"',"+listArr[i][5]+");return false;\"><font color=blue>【买】</font></a></td></tr>";		}	}	o+="</table>";	_openWin("listSellTools",o);}////////////////////战斗背景function selCombatPic(v){	combatPicTouMing=v;}function _getCombatPic(){	return combatPicTouMing;}///////////////////////////////////////自动局中function setAutoCenter(v){	_autoToCenter=v;}function getAutoCenter(){	return _autoToCenter;}function setAutoAlert(obj){	obj.checked=!confirm(""	+"您目前取消了地图自动居中功能!  \n\n"	+"这会导致您在移动时地图不会自动 \n\n"	+"将您所在的场景居中,您可以在地 \n\n"	+"图区域按住鼠标左键拖动来实现区 \n\n"	+"域移动.\n\n"	+"我们建议新手不要取消这个功能!\n\n\n"	+"是否确认取消地图自动居中功能?"	);	setAutoCenter(obj.checked);}///////////////////function playGame(){	var winObj=_getWin("playGame");	onOpenWin(winObj);	var o="<table height=2 cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";	o+="<font color=blue>玩小游戏</font>";	o+="<hr size=1 width='98%' align=left>";		o+="<div style='background-color:#E1E1E1;height:28px;margin-right:5px;padding-top:4px;padding-left:5px;'>";//hr		o+="<a href=# onclick=\"window.open('/game/apple/index.jsp;jsessionid='+sessionId+'?'+new Date(),'','menubar=no,toolbar=no,location=no,directories=no,status=yes,width=567,height=563,left='+(p.event.screenX-360)+',top='+p.event.screenY+',scrollbars=yes,resizable=yes');return false;\">【幸运苹果机】</a> (<font color=green>1银币1注</font>,开心转转)"		o+="</div>";		//o+="<div style=';height:28px;margin-right:5px;padding-top:4px;padding-left:5px;'>";//hr		//o+="<a href=http://game.play.mop.com/apple/ target=_blank>【苹果机MP版】</a> (使用大杂烩MP玩)"		//o+="</div>";		//o+="<div style='background-color:#E1E1E1;height:28px;margin-right:5px;padding-top:4px;padding-left:5px;'>";//hr		//o+="<a href=http://game.play.mop.com/poke/  target=_blank>【扑克21点MP版】</a> (使用大杂烩MP玩)"		//o+="</div>";		o+="<div style=';height:28px;margin-right:5px;padding-top:4px;padding-left:5px;'>";//hr		o+="<a href=# onclick=\"cmd('chuo show');offOpenWin('playGame');return false;\">【幸运戳戳乐】</a> (戳出精彩,戳出未来)"		o+="</div>";	try{		_clickPos();		with(winObj.style){			top=p.eventY+15;			left=p.eventX;		}	}catch(x){err(x);}	_openWin("playGame",o);	}///////////////////function _optionButtonChange(b){	if("set"==b){		getObj("gameOptionButton").disabled=false;		getObj("gameSetButton").disabled=true;		getObj("gameHelpButton").disabled=false;		getObj('gameOption').style.display='none';		getObj('gameSet').style.display='';		getObj('gameHelp').style.display='none';	}	if("option"==b){		getObj("gameOptionButton").disabled=true;		getObj("gameSetButton").disabled=false;		getObj("gameHelpButton").disabled=false;		getObj('gameOption').style.display='';		getObj('gameSet').style.display='none';		getObj('gameHelp').style.display='none';	}	if("help"==b){		getObj("gameOptionButton").disabled=false;		getObj("gameSetButton").disabled=false;		getObj("gameHelpButton").disabled=true;		getObj('gameHelp').style.display='';		getObj('gameSet').style.display='none';		getObj('gameOption').style.display='none';	}}//channel:startfunction getChannel(index){	return channel.length>=(index+1)?channel[index]:-1;}function changeChannel(index){	channel[0]=document.getElementById("channel_0").checked?1:0;	channel[1]=document.getElementById("channel_1").checked?1:0;	channel[2]=document.getElementById("channel_2").checked?1:0;	channel[3]=document.getElementById("channel_3").checked?1:0;}//channel:endfunction changeLianJiNeng(a){	lianJiNeng=a;}/*显示每个配方的学习条件*/function showLearnRequire(sfName, sfKey, sfIndex, sfDesc){	var divObj=document.getElementById("divFormulaLearn");	if (divObj){		divObj.innerHTML="【"+sfName+"】 <a href=# onclick=\"p.cmd('buyFormula "+sfKey+" "+sfIndex+"');return false;\"><font color=blue>[学习]</font></a>"		+"<br><table height=7 cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"		+"<table border=0><tr><td valign=top>学习条件:</td><td><font color=red>"+sfDesc+"</font></td></tr></table>";	}}/*显示配方*/function _showComposeYuansu(sllArg){	var showComposeYuansu=_getWin("showComposeYuansu");	showComposeYuansu.style.height=150;	onOpenWin(showComposeYuansu);	var 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -