bundle.js 161 KB

1
  1. var laya=function(exports){"use strict";class ResDic{constructor(){this._container={},this._length=0}get container(){return this._container}get size(){return this._length}set(key,value){this._container.hasOwnProperty(key)||this._length++,this._container[key]=value}has(key){return!!this._container.hasOwnProperty(key)}get(key){return this._container.hasOwnProperty(key)?this._container[key]:void 0}delete(key){this._container.hasOwnProperty(key)&&(delete this._container[key],this._length--)}clear(){this._container={},this._length=0}}var EventState,StageState;!function(EventState){EventState[EventState.LoadComplete=0]="LoadComplete",EventState[EventState.SceneInit=1]="SceneInit",EventState[EventState.StageInit=2]="StageInit",EventState[EventState.StageCreateComplete=3]="StageCreateComplete",EventState[EventState.AnimatorEnd=4]="AnimatorEnd",EventState[EventState.Select=5]="Select"}(EventState||(EventState={})),function(StageState){StageState[StageState.Win=0]="Win",StageState[StageState.Lose=1]="Lose",StageState[StageState.Start=2]="Start",StageState[StageState.StageCreateComPlete=3]="StageCreateComPlete",StageState[StageState.Over=4]="Over",StageState[StageState.Shoot=5]="Shoot",StageState[StageState.CreatArrow=6]="CreatArrow",StageState[StageState.Revive=7]="Revive",StageState[StageState.Restart=8]="Restart",StageState[StageState.Press=9]="Press",StageState[StageState.UnPress=10]="UnPress"}(StageState||(StageState={}));class EventManager{static EventOn(_mode,caller,fun,args=[]){EventManager.instance.on(EventState[_mode],caller,fun,args)}static EventOff(_mode,caller,fun,args=[]){EventManager.instance.off(EventState[_mode],caller,fun)}static EventTrigger(_mode,args=[]){EventManager.instance.event(EventState[_mode],args)}static StageOn(_mode,caller,fun,args=[]){EventManager.instance.on(StageState[_mode],caller,fun,args)}static StageOff(_mode,caller,fun,args=[]){EventManager.instance.off(StageState[_mode],caller,fun)}static StageTrigger(_mode,args=[]){EventManager.instance.event(StageState[_mode],args)}}EventManager.instance=new Laya.EventDispatcher;class AssetManager{constructor(){this.Boss=new ResDic,this.Player=new ResDic,this.Horse=new ResDic,this.Cap=new ResDic,this.Prop=new ResDic,this.Plane=new ResDic,this.Stone=new ResDic,this.Tree=new ResDic,this.Small_Fence=new ResDic,AssetManager.ins=this,EventManager.EventOn(EventState.LoadComplete,this,this.Init)}static get Instance(){return AssetManager.ins?AssetManager.ins:new AssetManager}Init(){this.maincamera=this.mainscene.getChildByName("Main Camera"),this.maincamera.transform.position=new Laya.Vector3(0,10,-12),this.maincamera.transform.rotationEuler=new Laya.Vector3(-35.7,180,0),this.maincamera.enableHDR=!1,this.Light=this.mainscene.getChildByName("Directional light"),this.Light.intensity=.7,EventManager.EventTrigger(EventState.SceneInit)}}class ResourcesPath{}ResourcesPath.MainScene="Game/res/MainScene/LayaScene_Mainscene/Conventional/Mainscene.ls",ResourcesPath.Boss=["Game/res/Role/LayaScene_Role/Conventional/boss.lh"],ResourcesPath.Player=["Game/res/Role/LayaScene_Role/Conventional/player.lh"],ResourcesPath.Horse=["Game/res/Horse/LayaScene_Horse/Conventional/horse1.lh","Game/res/Horse/LayaScene_Horse/Conventional/horse2.lh","Game/res/Horse/LayaScene_Horse/Conventional/horse3.lh","Game/res/Horse/LayaScene_Horse/Conventional/horse4.lh","Game/res/Horse/LayaScene_Horse/Conventional/horse5.lh"],ResourcesPath.Cap=["Game/res/Cap/LayaScene_Cap/Conventional/cap1.lh","Game/res/Cap/LayaScene_Cap/Conventional/cap2.lh","Game/res/Cap/LayaScene_Cap/Conventional/cap3.lh","Game/res/Cap/LayaScene_Cap/Conventional/cap4.lh","Game/res/Cap/LayaScene_Cap/Conventional/cap5.lh"],ResourcesPath.Prop="Game/res/Prop/LayaScene_Prop/Conventional/Prop.lh";var Sprite3D=Laya.Sprite3D,Vector3=Laya.Vector3;class modelConfig{constructor(model){this.modelcur=model,this.modelPos=model.transform.position.clone(),this.modelRot=model.transform.rotation.clone(),this.modelSca=model.transform.scale.clone()}}class GamePool{constructor(){this.modelpool={},this.maxAcount=30,GamePool.Ins=this}static get Instance(){return GamePool.Ins?GamePool.Ins:new GamePool}GetModel(_model,title){var poolname=title+_model.name;if(null!=this.modelpool[poolname]&&null!=this.modelpool[poolname]){if(this.modelpool[poolname].length>0){var model1=this.modelpool[poolname][0];return this.modelpool[poolname].splice(0,1),model1.modelcur.destroyed&&(model1.modelcur=Sprite3D.instantiate(_model),model1.modelcur.active||(model1.modelcur.active=!0)),model1.modelcur.active=!0,model1.modelcur.transform.position=_model.transform.position.clone(),model1.modelcur.transform.rotation=_model.transform.rotation.clone(),model1.modelcur.transform.scale=_model.transform.scale.clone(),model1.modelcur}var model;return(model=Sprite3D.instantiate(_model)).active=!0,model}return(model=Sprite3D.instantiate(_model)).active=!0,model}RecoveryModel(model,title="",modelstate=!1){if(!model.destroyed&&(modelstate||0!=model.active)){var poolname=title+model.name;if(null!=this.modelpool[poolname]&&null!=this.modelpool[poolname]){var modelnum=this.modelpool[poolname];if(modelnum.length>this.maxAcount)return void model.destroy();modelnum.push(new modelConfig(model))}else(modelnum=[]).push(new modelConfig(model)),this.modelpool[poolname]=modelnum;model.transform.position=new Vector3(0,0,-1e4),model.removeSelf(),model.active=!1}}ResetsModelPool(){for(var Key in this.modelpool)for(var model=this.modelpool[Key],i=0;i<model.length;i++)model[i].modelcur.destroy();this.modelpool={}}}var AccountUser,Vector3$1=Laya.Vector3;class Transform3DHelper{static getForward(transform){let forward=new Vector3$1;return transform.getForward(forward),Laya.Vector3.scale(forward,-1,forward),Laya.Vector3.normalize(forward,forward),forward}}class GameTools{constructor(){GameTools.ins=this}static get Instance(){return GameTools.ins?GameTools.ins:new GameTools}lerp(form,to,t){return t<=0?form:t>=1?to:t*to+(1-t)*form}SetCollider(setNode,CollisionGroup){setNode.numChildren;for(var i=0;i<setNode.numChildren;i++){setNode.getChildAt(i).numChildren>1&&this.SetCollider(setNode.getChildAt(i),CollisionGroup);var physicsCollider=setNode.getChildAt(i).getComponent(Laya.PhysicsCollider);physicsCollider&&(physicsCollider.collisionGroup=CollisionGroup)}}EnemySetCollider(setNode,collisionGroup){var collider=setNode.getChildByName("npcfrontcollider"),collider2=setNode.getChildByName("npcrearcollider"),physicsCollider=collider.getComponent(Laya.PhysicsCollider),physicsCollider2=collider2.getComponent(Laya.PhysicsCollider);physicsCollider&&(physicsCollider.collisionGroup=collisionGroup),physicsCollider2&&(physicsCollider2.collisionGroup=collisionGroup)}PlayerSetCollider(setNode,collisionGroup){var physicsCollider=setNode.getChildByName("playercollider").getComponent(Laya.PhysicsCollider);physicsCollider&&(physicsCollider.collisionGroup=collisionGroup)}HostageSetCollider(setNode,collisionGroup){var physicsCollider=setNode.getChildByName("hostagecollider").getComponent(Laya.PhysicsCollider);physicsCollider&&(physicsCollider.collisionGroup=collisionGroup)}static RandomNumber(from,to){if(from>=to)return 0;var size=to-from;return Math.random()*size+from}static RandomANumber(from,to){if(from>=to)return 0;var size=to-from,curNumber=Math.random()*size+from;return Math.floor(curNumber)}static GetMoney(_num,_pos=null,_completeHandle=null){if(0!=_num){var fafaafsfa=new Laya.Box;fafaafsfa.width=400,fafaafsfa.height=100,fafaafsfa.pivotX=fafaafsfa.width/2,fafaafsfa.pivotY=fafaafsfa.height/2,null==_pos&&(_pos=new Laya.Vector2(Laya.stage.width/2,Laya.stage.height/2)),fafaafsfa.pos(_pos.x,_pos.y);var aafafaffa=new Laya.Image;aafafaffa.skin="game/qiandao_1_7.png",aafafaffa.width=60,aafafaffa.height=60,aafafaffa.left=50,aafafaffa.y=10,fafaafsfa.addChild(aafafaffa);var faasfafsafs=new Laya.Text;faasfafsafs.width=300,faasfafsafs.height=50,faasfafsafs.align="center",faasfafsafs.valign="middle",faasfafsafs.font="Microsoft YaHei",faasfafsafs.fontSize=40,faasfafsafs.color="#FFFFFF",faasfafsafs.bold=!0,faasfafsafs.font="Microsoft YaHei",faasfafsafs.text="金币 +"+_num,faasfafsafs.x=60,faasfafsafs.y=10,fafaafsfa.addChild(faasfafsafs),Laya.stage.addChild(fafaafsfa);var faasfsaf=Laya.Tween.to(fafaafsfa,{y:fafaafsfa.y-200},1500,Laya.Ease.expoInOut,Laya.Handler.create(this,()=>{faasfsaf.clear(),fafaafsfa.destroy(),_completeHandle&&_completeHandle.run()}),100)}}static TweenText(faafssfafsa,_hight,_completeHandle=null,hide=!0,_duration=500){var afasafsafsfa=new Laya.Text;afasafsafsfa.width=faafssfafsa.size.x,afasafsafsfa.height=faafssfafsa.size.y,afasafsafsfa.align="center",afasafsafsfa.valign="middle",afasafsafsfa.font="Microsoft YaHei",afasafsafsfa.fontSize=faafssfafsa.fontSize,afasafsafsfa.pivotX=afasafsafsfa.width/2,afasafsafsfa.pivotY=afasafsafsfa.height/2,afasafsafsfa.color="#5ad122",afasafsafsfa.bold=!0,afasafsafsfa.stroke=5,afasafsafsfa.strokeColor="#ffffff",faafssfafsa.color&&(faafssfafsa.color=faafssfafsa.color),afasafsafsfa.text=faafssfafsa.message,afasafsafsfa.zOrder=1,Laya.stage.addChildAt(afasafsafsfa,Laya.stage.numChildren-1),afasafsafsfa.pos(faafssfafsa.pos.x,faafssfafsa.pos.y);var tween=Laya.Tween.to(afasafsafsfa,{y:afasafsafsfa.y-_hight,update:new Laya.Handler(this,function(){})},_duration,Laya.Ease.expoInOut,Laya.Handler.create(this,function(){tween.clear(),hide&&afasafsafsfa.destroy(),_completeHandle&&_completeHandle.run()}));return hide&&Laya.Tween.to(afasafsafsfa,{alpha:.4},500),afasafsafsfa}static StationTweenText(faafssfafsa,_hight,_completeHandle=null,hide=!0,_duration=500){var afasafsafsfa=new Laya.Text;afasafsafsfa.width=faafssfafsa.size.x,afasafsafsfa.height=faafssfafsa.size.y,afasafsafsfa.align="center",afasafsafsfa.valign="middle",afasafsafsfa.font="Microsoft YaHei",afasafsafsfa.fontSize=50,afasafsafsfa.pivotX=afasafsafsfa.width/2,afasafsafsfa.pivotY=afasafsafsfa.height/2,afasafsafsfa.color="#5ad122",afasafsafsfa.bold=!0,afasafsafsfa.stroke=5,afasafsafsfa.strokeColor="#ffffff",faafssfafsa.color&&(faafssfafsa.color=faafssfafsa.color),afasafsafsfa.text=faafssfafsa.message,afasafsafsfa.zOrder=1,Laya.stage.addChildAt(afasafsafsfa,Laya.stage.numChildren-1),afasafsafsfa.pos(faafssfafsa.pos.x,faafssfafsa.pos.y);var tween=Laya.Tween.to(afasafsafsfa,{y:afasafsafsfa.y-_hight,update:new Laya.Handler(this,function(){})},_duration,Laya.Ease.expoInOut,Laya.Handler.create(this,function(){tween.clear(),hide&&afasafsafsfa.destroy(),_completeHandle&&_completeHandle.run()}));return hide&&Laya.Tween.to(afasafsafsfa,{alpha:.4},1e4),afasafsafsfa}static tweenMove(transform,targPos,delay,ease,complete){let curPos=transform.position.clone();return Laya.Tween.to(curPos,{x:targPos.x,y:targPos.y,z:targPos.z,update:new Laya.Handler(this,()=>{transform.position=curPos.clone()})},delay,ease,complete)}static tweenRotate(transform,targEuler,delay,ease,complete){let curEuler=transform.rotationEuler.clone();return Laya.Tween.to(curEuler,{x:targEuler.x,y:targEuler.y,z:targEuler.z,update:new Laya.Handler(this,()=>{transform.rotationEuler=curEuler.clone()})},delay,ease,complete)}}!function(AccountUser){AccountUser[AccountUser.buyed_kun=0]="buyed_kun",AccountUser[AccountUser.diamond=1]="diamond",AccountUser[AccountUser.equip_themes=2]="equip_themes",AccountUser[AccountUser.favorite_times=3]="favorite_times",AccountUser[AccountUser.game_times=4]="game_times",AccountUser[AccountUser.get_themes=5]="get_themes",AccountUser[AccountUser.list_kun=6]="list_kun",AccountUser[AccountUser.moeny=7]="moeny",AccountUser[AccountUser.progress_themes=8]="progress_themes",AccountUser[AccountUser.revival=9]="revival",AccountUser[AccountUser.stage=10]="stage"}(AccountUser||(AccountUser={}));class PlayerData{constructor(_token,_config,_appSetting,_user,_userbase,_useInvite,_user_stage=null,_user_sign,_user_achievement,lottery){this.openid="",this.userId="",this.zhengshu=_token,this.netzheshe=_appSetting,this.account=_user,this.accountssss=_userbase,this.qiandao=_user_sign,this.renwu=_user_achievement,this.userId=this.account.user_id,this.openid=this.accountssss.openid,this.m_invite=_useInvite,this.lottery=lottery,console.log("user_id:"+this.userId)}GainCollocation(_type){return this.peizhis[_type]}GainAccount(_type){return this.account[_type]}get fenxiang(){return"1"==this.netzheshe.share}get Invincible(){return Number(this.netzheshe.Invincible)}get CheckScene(){return"1"==this.netzheshe.checkscene}get Cheat(){return"1"==this.netzheshe.cheat}get Banner(){return"1"==this.netzheshe.Banner}get wudaoshijian(){return Number(this.netzheshe.wudaoshijian)}GetUser(_type){var type=AccountUser[_type];return this.account[type]}get NpcRunDistance(){return Number(this.netzheshe.NpcRunDistance)}get NpcAtkDistance(){return Number(this.netzheshe.NpcAtkDistance)}get NpcChaseDistance(){return Number(this.netzheshe.NpcChaseDistance)}get NpcRushDistance(){return Number(this.netzheshe.NpcRushDistance)}get BossAtkInterval(){return Number(this.netzheshe.BossAtkInterval)}get NpcSpeed(){return Number(this.netzheshe.NpcSpeed)}get HostageSpeed(){return Number(this.netzheshe.HostageSpeed)}get ArrowSpeed(){return Number(this.netzheshe.ArrowSpeed)}get BossDistance(){return Number(this.netzheshe.ArrowSpeed)}get BossSpeed(){return Number(this.netzheshe.BossSpeed)}get PlayerDamage(){return Number(this.netzheshe.PlayerDamage)}get MaxBossDistance(){return Number(this.netzheshe.MaxBossDistance)}get MinBossDistance(){return Number(this.netzheshe.MinBossDistance)}get ShareContent(){return this.netzheshe.sharecontent}get DirRoatationLerp(){return Number(this.netzheshe.DirRoatationLerp)}get DirMoveLerp(){return Number(this.netzheshe.DirMoveLerp)}get CurTouchsmoothness(){return Number(this.netzheshe.curtouchsmoothness)}get CurTouchsize(){return Number(this.netzheshe.curtouchsize)}get NPCRushSpeed(){return Number(this.netzheshe.NPCRushSpeed)}get Range(){return Number(this.netzheshe.Range)}get CanStageShake(){return"1"==this.netzheshe.canstageshake}GlobalData(_key){var dataarray=[],_global=this.GainCollocation("global");for(var key in _global)dataarray.push(_global[key]);for(let i=0;i<dataarray.length;i++)if(_key==dataarray[i].key)return Number(dataarray[i].value)}HasEquip(_id){for(var data=this.GainAccount("get_themes"),i=0;i<data.length;i++){if(_id==data[i])return!0}return!1}GetProgress(_id){var config=this.account.progress_themes;return config[_id]?config[_id]:0}}class CheckMain{}CheckMain.Creat=!1,CheckMain.ZSSdkCreat=!1;class FengXiang{constructor(){FengXiang.instance=this}static get Instance(){return null==FengXiang.instance&&(FengXiang.instance=new FengXiang),FengXiang.instance}kaishifengxiang(callBack){FengXiang.kaishifengxiangshijian=(new Date).getTime(),FengXiang.fengxiangzhong=!0,FengXiang.callback=callBack}RegFenxiang(){null!=Laya.Browser.window.wx&&Laya.Browser.window.wx.onShow(function(option){if(FengXiang.fengxiangzhong){FengXiang.fengxiangzhong=!1;let wait=((new Date).getTime()-FengXiang.kaishifengxiangshijian)/1e3,shareSuccess=!1;0==(shareSuccess=wait>=4&&(!(wait<6)||!(Math.random()>.7)))?(Laya.Browser.window.wx.showToast({title:"请重试一次"}),FengXiang.callback(!1)):(Laya.Browser.window.wx.showToast({title:"分享成功"}),FengXiang.callback(!0))}})}}FengXiang.fengxiangchenggongshijian=0,FengXiang.fengxiangzhong=!1;class WXSDK{constructor(){WXSDK.ins=this}static get Instance(){return WXSDK.ins?WXSDK.ins:new WXSDK}static Init(){}static DengLu(_complete){var that=this;Laya.Browser.window.wx.login({success:function(res){res.code?(FengXiang.Instance.RegFenxiang(),console.log("微信登陆成功----"),that.codeValue=res.code,console.log("shareid:"+WXSDK.shareOpenId),new AccountManager(res.code,"","","",0,"","","","",WXSDK.shareOpenId,WXSDK.shareOpenId,Main.Ver),_complete(res)):(WXSDK.DengLu(WXSDK.DengLu),console.log("wx no code"+res.errMsg))},fail:function(res){console.log("wx.login: failed, res="+res)}})}static ShowTxt(text){Laya.Browser.onWeiXin?Laya.Browser.window.wx.showToast({title:text}):console.log(text)}static OnShow(cb){Laya.Browser.onWeiXin&&Laya.Browser.window.wx.onShow(cb)}static OffShow(cb){Laya.Browser.onWeiXin&&Laya.Browser.window.wx.offShow(cb)}static ShortShake(){Laya.Browser.window.wx.vibrateShort({})}static LongShake(){Laya.Browser.window.wx.vibrateLong({})}static Shake(_short=!0){Laya.Browser.onWeiXin&&WXSDK.shake&&(_short?this.ShortShake():this.LongShake())}static LoadSubPackage(name,_complete){if(Laya.Browser.onWeiXin){Laya.Browser.window.wx.loadSubpackage({name:"Game",success:function(res){_complete&&_complete(!0),console.log("分包加载成功")},fail:function(res){_complete&&_complete(!1),console.log("分包加载失败")}})}else console.log("未进行分包加载"),_complete&&_complete(!0)}static stageShake(callBack=null,speed=32){if(!this.isShake&&this.canshakestage){this.isShake=!0;var point=new Laya.Vector2(Laya.stage.x,Laya.stage.y);Laya.stage.timerLoop(speed,this,this.shakeObject,[point,callBack])}}static shakeObject(_point,_callBack){var count=this.num++%4;this.offsetArr[this.num%2]=count<2?0:this.offset,Laya.stage.x=this.offsetArr[0]+_point.x,Laya.stage.y=this.offsetArr[1]+_point.y,this.num>4*this.times+1&&(Laya.stage.clearTimer(this,this.shakeObject),Laya.stage.pos(0,0),this.num=0,this.isShake=!1,null!=_callBack&&_callBack())}static UpdateGuide(ShowGuide=0){var kvDataList=new Array;let date=(new Date).getTime();var myValue=JSON.stringify({guide:{ShowGuide:ShowGuide,update_time:date.toString()}});kvDataList.push({key:"ShowGuide",value:myValue}),Laya.Browser.window.wx&&Laya.Browser.window.wx.setUserCloudStorage({KVDataList:kvDataList,success:r=>{console.log("KVDATALIST---",kvDataList),console.log("上传新手指引成功:"+ShowGuide)}})}static UpdateScore(max_score){var kvDataList=new Array;let date=(new Date).getTime();var myValue=JSON.stringify({wxgame:{max_score:max_score,update_time:date.toString()}});kvDataList.push({key:"max_score",value:myValue}),Laya.Browser.window.wx&&Laya.Browser.window.wx.setUserCloudStorage({KVDataList:kvDataList,success:r=>{console.log("KVDATALIST---",kvDataList),console.log("上传分数成功:"+max_score)}})}static fengxiangtupian(callback){if(null!=Laya.Browser.window.wx){var t=AccountManager.Instance.ServerTime;Laya.Browser.window.wx.aldShareAppMessage({title:"有人@你,一起骑马仗箭走天涯",imageUrl:"Game/res/textrue/share.jpg",query:"userId="+AccountManager.Instance.curplayerData.userId+"_"+t+"_"+Math.floor(9999*Math.random()).toString()})}}static ShareContent(){return AccountManager.Instance.curplayerData.ShareContent}static AldEvent(eventName,key="用户id",value=""){Laya.Browser.onWeiXin&&Laya.Browser.window.wx.aldSendEvent(eventName,{key:value})}static AldStart(stageId){Laya.Browser.onWeiXin&&Laya.Browser.window.wx.aldStage.onStart({stageId:stageId,stageName:"第"+stageId+"关"})}static AldEnd(stageId,isComplete){if(!Laya.Browser.onWeiXin)return;let event=isComplete?"complete":"fail",desc=isComplete?"关卡完成":"关卡失败";Laya.Browser.window.wx.aldStage.onEnd({stageId:stageId,stageName:"第"+stageId+"关",event:event,params:{desc:desc}})}}WXSDK.codeValue="",WXSDK.shareOpenId="",WXSDK.openId=0,WXSDK.shareScene="",WXSDK.uid="123",WXSDK.querychannel="",WXSDK.referrerInfoappId="",WXSDK.shake=!0,WXSDK.times=1.3,WXSDK.num=0,WXSDK.offsetArr=[0,0],WXSDK.offset=14,WXSDK.canshakestage=!1;var ui,MusicType,BGMType,REG=Laya.ClassUtils.regClass;!function(ui){class CompleteViewUI extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(CompleteViewUI.uiView)}}CompleteViewUI.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Image",props:{top:0,skin:"Main/chunhei.png",sizeGrid:"12,14,15,10",right:0,name:"BG",left:0,bottom:0},compId:14},{type:"Image",props:{y:156,x:360,width:193,var:"winimage",skin:"Main/shenglijiemian-1-1.png",pivotY:114,pivotX:97,height:227},compId:4},{type:"Image",props:{y:156,x:360,width:191,var:"loseimage",skin:"Main/shibai-1-1.png",pivotY:114,pivotX:96,height:227},compId:5},{type:"Image",props:{y:220,x:360,width:152,var:"reviveimage",skin:"Main/fuhuo-1-1.png",pivotY:37,pivotX:76,height:74},compId:7},{type:"Box",props:{y:327,x:360,width:249,pivotY:43,pivotX:125,height:85},compId:12,child:[{type:"Image",props:{y:11.5,x:0,skin:"Main/zhujiemian-1-8.png"},compId:11},{type:"Text",props:{y:41,x:156,width:201,var:"goldnum",valign:"middle",text:"999",pivotY:31,pivotX:101,height:62,fontSize:50,color:"#ffffff",bold:!0,align:"center",runtime:"laya.display.Text"},compId:13}]},{type:"Box",props:{y:591,x:360,width:623,visible:!0,height:440,anchorY:.5,anchorX:.5},compId:16,child:[{type:"Image",props:{top:0,skin:"Main/chunhei.png",sizeGrid:"13,13,14,12",right:0,name:"BG",left:0,bottom:0},compId:17},{type:"List",props:{y:220,x:312,width:534,var:"PushList",spaceY:40,spaceX:40,pivotY:221,pivotX:267,height:441},compId:18,child:[{type:"Box",props:{y:14,x:0,width:150,renderType:"render",height:185},compId:19,child:[{type:"Image",props:{y:75,x:75,width:150,pivotY:75,pivotX:75,name:"icon",height:150},compId:20},{type:"Image",props:{y:149,x:0,width:151,name:"bottom",height:35},compId:23},{type:"Text",props:{y:166,x:76,width:151,valign:"middle",text:"冲冲冲冲冲冲",pivotY:18,pivotX:76,name:"name",height:36,fontSize:25,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:21},{type:"Button",props:{y:90,x:76,width:151,pivotY:90,pivotX:76,name:"btn",height:184},compId:22},{type:"Image",props:{y:-8,x:76,skin:"Push/icon-hot.png",name:"remen"},compId:24},{type:"Script",props:{runtime:"Tools/ListItem.ts"},compId:27}]}]}]},{type:"Box",props:{x:363,width:330,var:"BtnBox",pivotY:124,pivotX:165,height:222,bottom:350},compId:28,child:[{type:"Button",props:{y:84,x:162,width:313,var:"NextLevelBtn",stateNum:1,skin:"Main/shenglijiemian-1-2.png",pivotY:58,pivotX:157,height:116},compId:8},{type:"Button",props:{y:84,x:165,width:313,var:"ReviveBtn",stateNum:1,skin:"Main/fuhuo-1-2.png",pivotY:58,pivotX:157,height:116},compId:9},{type:"Button",props:{y:84,x:165,width:313,var:"TryAgainBtn",stateNum:1,skin:"Main/shibai-1-2.png",pivotY:58,pivotX:157,height:116},compId:10},{type:"Button",props:{y:181,x:162,var:"NoBtn",stateNum:1,skin:"Main/no.png",anchorY:.5,anchorX:.5},compId:15}]}],loadList:["Main/chunhei.png","Main/shenglijiemian-1-1.png","Main/shibai-1-1.png","Main/fuhuo-1-1.png","Main/zhujiemian-1-8.png","Push/icon-hot.png","Main/shenglijiemian-1-2.png","Main/fuhuo-1-2.png","Main/shibai-1-2.png","Main/no.png"],loadList3D:[]},ui.CompleteViewUI=CompleteViewUI,REG("ui.CompleteViewUI",CompleteViewUI);class ExportViewUI extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(ExportViewUI.uiView)}}ExportViewUI.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Image",props:{top:0,skin:"Main/chunhei2.png",sizeGrid:"25,16,29,14",right:0,name:"BG",left:0,bottom:0},compId:3},{type:"Box",props:{y:223,right:25,name:"HBox",left:25,height:150,anchorY:.5,anchorX:.5},compId:4,child:[{type:"Image",props:{y:0,skin:"Push/bg-box.png",sizeGrid:"33,35,44,42",right:0,left:0,height:149},compId:11},{type:"Image",props:{y:-32,x:335,width:230,skin:"Push/title-friend.png",pivotY:16,pivotX:115,height:32},compId:5},{type:"List",props:{var:"HList",spaceX:16,right:0,repeatY:1,left:0,height:150},compId:6,child:[{type:"Box",props:{width:120,renderType:"render",height:150},compId:7,child:[{type:"Image",props:{width:120,name:"icon",height:120},compId:8},{type:"Text",props:{y:135,x:60,width:121,valign:"middle",text:"冲冲冲冲冲冲",pivotY:15,pivotX:61,name:"name",height:30,fontSize:20,font:"Microsoft YaHei",align:"center",runtime:"laya.display.Text"},compId:9},{type:"Button",props:{y:0,x:0,width:120,name:"btn",height:141},compId:10},{type:"Script",props:{y:0,x:0,runtime:"Tools/ListItem.ts"},compId:26}]}]}]},{type:"Box",props:{top:400,right:25,name:"VBox",left:25,bottom:0,anchorY:.5,anchorX:.5},compId:12,child:[{type:"Image",props:{y:-32,x:335,width:230,skin:"Push/title-recommend.png",pivotY:16,pivotX:115,height:32},compId:13},{type:"List",props:{var:"VList",top:0,spaceY:40,spaceX:30,right:0,left:0,bottom:0},compId:14,child:[{type:"Box",props:{y:10,x:0,width:200,renderType:"render",height:240},compId:15,child:[{type:"Image",props:{top:0,skin:"Push/bg-box.png",sizeGrid:"24,27,42,16",right:0,left:0,bottom:0},compId:16},{type:"Image",props:{y:221,x:100,width:200,pivotY:21,pivotX:100,name:"bottom",height:41},compId:20},{type:"Image",props:{y:90,x:90,width:200,pivotY:90,pivotX:90,name:"icon",height:200},compId:17},{type:"Text",props:{y:220,x:101,width:199,valign:"middle",text:"冲冲冲冲冲冲",pivotY:20,pivotX:100,name:"name",height:40,fontSize:25,font:"Microsoft YaHei",align:"center",runtime:"laya.display.Text"},compId:18},{type:"Button",props:{y:121,x:100,width:200,pivotY:121,pivotX:100,name:"btn",height:241},compId:19},{type:"Image",props:{y:17,x:170.5,width:82,skin:"Push/icon-hot.png",pivotY:24,pivotX:41,name:"remen",height:47},compId:21},{type:"Script",props:{runtime:"Tools/ListItem.ts"},compId:25}]}]}]},{type:"Button",props:{x:371,width:349,var:"CloseExportBtn",stateNum:1,skin:"Push/btn-continue-new.png",pivotY:80,pivotX:175,height:160,bottom:200},compId:22}],loadList:["Main/chunhei2.png","Push/bg-box.png","Push/title-friend.png","Push/title-recommend.png","Push/icon-hot.png","Push/btn-continue-new.png"],loadList3D:[]},ui.ExportViewUI=ExportViewUI,REG("ui.ExportViewUI",ExportViewUI);class InGameViewUI extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(InGameViewUI.uiView)}}InGameViewUI.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"ProgressBar",props:{y:107,x:47,var:"GoalProgress",skin:"Main/zhujiemian-1-4.png"},compId:7,child:[{type:"Text",props:{y:0,x:0,width:120,valign:"middle",text:"0",strokeColor:"#050404",stroke:2,name:"goal",height:46,fontSize:36,color:"#ffffff",bold:!0,align:"center",runtime:"laya.display.Text"},compId:10},{type:"Image",props:{y:0,x:-18,skin:"Main/zhujiemian-1-10.png"},compId:11}]},{type:"Box",props:{y:137,x:620,width:201,pivotY:25,pivotX:101,height:50},compId:9,child:[{type:"Image",props:{y:23,x:121,width:160,skin:"Main/zhujiemian-1-9.png",pivotY:23,pivotX:80,height:46},compId:14},{type:"Image",props:{y:-4,x:12,skin:"Main/zhujiemian-1-8.png"},compId:15},{type:"Text",props:{y:0,x:65,width:137,var:"GoldNum",valign:"middle",text:"9999",height:46,fontSize:30,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:16}]},{type:"Box",props:{x:360,width:568,var:"Guide1",height:282,bottom:350,anchorY:.5,anchorX:.5},compId:17,child:[{type:"Image",props:{y:141,x:284,width:506,skin:"Main/-2.png",pivotY:9,pivotX:253,height:18},compId:19},{type:"Image",props:{y:208,x:55,width:348,skin:"Main/Hand.png",scaleY:.3,scaleX:.3,pivotY:258,pivotX:174,height:485},compId:18},{type:"Text",props:{y:65,x:284,width:416,valign:"middle",text:"左右滑动控制人物移动",strokeColor:"01361e",stroke:3,pivotY:51,pivotX:208,height:102,fontSize:40,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:20}]},{type:"Box",props:{x:360,width:510,var:"Guide2",pivotY:96,pivotX:255,height:192,bottom:341},compId:21,child:[{type:"Text",props:{y:118,x:255,wordWrap:!0,width:279,valign:"middle",text:"左右移动瞄准松开手指射箭",strokeColor:"01361e",stroke:3,pivotY:74,pivotX:140,overflow:"hidden",leading:15,height:148,fontSize:45,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:24}]},{type:"Box",props:{x:360,width:510,var:"Guide3",pivotY:96,pivotX:255,height:192,bottom:350},compId:27,child:[{type:"Text",props:{y:127,x:255,wordWrap:!0,width:297,valign:"middle",text:"射箭击倒栅栏可以继续前进",strokeColor:"01361e",stroke:3,pivotY:74,pivotX:149,overflow:"hidden",leading:15,height:148,fontSize:45,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:28}]},{type:"Box",props:{x:360,width:510,var:"Guide4",pivotY:96,pivotX:255,height:192,bottom:350},compId:30,child:[{type:"Text",props:{y:127,x:255,wordWrap:!0,width:297,valign:"middle",text:"保护蓝色友方射击黄色敌人",strokeColor:"01361e",stroke:3,pivotY:74,pivotX:149,overflow:"hidden",leading:15,height:148,fontSize:45,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:31}]},{type:"Box",props:{y:0,x:0,width:720,visible:!0,right:0,name:"BottomBox",left:0,height:177,bottom:0},compId:32,child:[{type:"Image",props:{width:720,top:0,skin:"Main/chunhei.png",sizeGrid:"12,11,13,10",right:0,name:"BG",left:0,height:183,bottom:0},compId:33},{type:"List",props:{width:720,var:"BottomList",spaceX:30,right:0,repeatY:1,left:0,height:176,bottom:0},compId:34,child:[{type:"Box",props:{y:8,x:18,width:130,renderType:"render",height:160},compId:35,child:[{type:"Image",props:{y:0,x:0,width:129,skin:"Push/bg-box.png",sizeGrid:"27,27,37,20",name:"BG",height:159},compId:36},{type:"Image",props:{y:0,x:0,width:130,name:"icon",height:130},compId:37},{type:"Text",props:{y:130,x:0,width:126,valign:"middle",text:"冲冲冲冲冲冲",name:"name",height:29,fontSize:20,bold:!0,align:"center",runtime:"laya.display.Text"},compId:38},{type:"Button",props:{y:0,x:0,width:130,name:"btn",height:160},compId:39},{type:"Script",props:{runtime:"Tools/ListItem.ts"},compId:40}]}]}]}],animations:[{nodes:[{target:18,keyframes:{y:[{value:208,tweenMethod:"linearNone",tween:!0,target:18,key:"y",index:0},{value:209,tweenMethod:"linearNone",tween:!0,target:18,key:"y",index:5},{value:210,tweenMethod:"linearNone",tween:!0,target:18,key:"y",index:10},{value:209,tweenMethod:"linearNone",tween:!0,target:18,key:"y",index:15},{value:210,tweenMethod:"linearNone",tween:!0,target:18,key:"y",index:25},{value:209,tweenMethod:"linearNone",tween:!0,target:18,key:"y",index:30},{value:210,tweenMethod:"linearNone",tween:!0,target:18,key:"y",index:35}],x:[{value:55,tweenMethod:"linearNone",tween:!0,target:18,key:"x",index:0},{value:144,tweenMethod:"linearNone",tween:!0,target:18,key:"x",index:5},{value:272,tweenMethod:"linearNone",tween:!0,target:18,key:"x",index:10},{value:394,tweenMethod:"linearNone",tween:!0,target:18,key:"x",index:15},{value:537,tweenMethod:"linearNone",tween:!0,target:18,key:"x",index:20},{value:453,tweenMethod:"linearNone",tween:!0,target:18,key:"x",index:25},{value:344,tweenMethod:"linearNone",tween:!0,target:18,key:"x",index:30},{value:212,tweenMethod:"linearNone",tween:!0,target:18,key:"x",index:35},{value:55,tweenMethod:"linearNone",tween:!0,target:18,key:"x",index:40}]}}],name:"ani1",id:1,frameRate:24,action:0}],loadList:["Main/zhujiemian-1-4.png","Main/zhujiemian-1-10.png","Main/zhujiemian-1-9.png","Main/zhujiemian-1-8.png","Main/-2.png","Main/Hand.png","Main/chunhei.png","Push/bg-box.png"],loadList3D:[]},ui.InGameViewUI=InGameViewUI,REG("ui.InGameViewUI",InGameViewUI);class LoadViewUI extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(LoadViewUI.uiView)}}LoadViewUI.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Image",props:{top:0,skin:"Load/jiazai-1-4.png",sizeGrid:"13,13,15,13",right:0,name:"BG",left:0,bottom:0},compId:3},{type:"Image",props:{y:357,x:360,width:445,skin:"Load/jiazai-1-1.png",pivotY:74,pivotX:223,name:"title",height:147},compId:5},{type:"ProgressBar",props:{y:842,x:360,width:506,var:"LoadProgress",value:0,skin:"Load/jiazai-1-3.png",pivotY:9,pivotX:253,height:18},compId:6}],loadList:["Load/jiazai-1-4.png","Load/jiazai-1-1.png","Load/jiazai-1-3.png"],loadList3D:[]},ui.LoadViewUI=LoadViewUI,REG("ui.LoadViewUI",LoadViewUI);class MainGameViewUI extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(MainGameViewUI.uiView)}}MainGameViewUI.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Button",props:{y:839,x:370,width:313,visible:!0,var:"StartBtn",stateNum:1,skin:"Main/zhujiemian-1-3.png",pivotY:58,pivotX:157,height:116},compId:7},{type:"Button",props:{y:821,width:156,var:"SkinBtn",stateNum:1,skin:"Main/zhujiemian-1-2.png",right:0,pivotY:77,pivotX:78,height:153},compId:9},{type:"Button",props:{y:828,width:140,var:"MoreFunBtn",stateNum:1,skin:"Main/zhujiemian-1-1.png",pivotY:70,pivotX:70,left:0,height:139},compId:10},{type:"ProgressBar",props:{y:107,x:47,var:"GoalProgress",value:0,skin:"Main/zhujiemian-1-4.png"},compId:11,child:[{type:"Text",props:{y:0,x:0,width:120,valign:"middle",text:"5",strokeColor:"#050404",stroke:2,name:"goal",height:46,fontSize:36,color:"#ffffff",bold:!0,align:"center",runtime:"laya.display.Text"},compId:12},{type:"Image",props:{y:0,x:-18,skin:"Main/zhujiemian-1-10.png"},compId:13}]},{type:"Box",props:{y:229.5,x:70,width:100,var:"SoundBox",pivotY:50,pivotX:50,height:100},compId:16,child:[{type:"Image",props:{y:50,x:50,width:83,visible:!1,skin:"Main/zhujiemian-1-6.png",pivotY:42,pivotX:42,name:"shake",height:83},compId:17},{type:"Image",props:{y:50,x:50,width:83,skin:"Main/zhujiemian-1-7.png",pivotY:42,pivotX:42,name:"sound",height:83},compId:18}]},{type:"Box",props:{y:137,x:620,width:201,pivotY:25,pivotX:101,height:50},compId:19,child:[{type:"Image",props:{y:23,x:121,width:160,skin:"Main/zhujiemian-1-9.png",pivotY:23,pivotX:80,height:46},compId:20},{type:"Image",props:{y:-4,x:12,skin:"Main/zhujiemian-1-8.png"},compId:21},{type:"Text",props:{y:0,x:65,width:137,var:"GoldNum",valign:"middle",text:"9999",height:46,fontSize:30,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:22}]},{type:"Box",props:{y:129.5,x:360,width:208,pivotY:50,pivotX:104,height:100},compId:23,child:[{type:"Text",props:{y:50,x:108,width:190,valign:"middle",text:"第 关",strokeColor:"033f22",stroke:4,pivotY:33,pivotX:95,height:66,fontSize:50,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:24},{type:"Text",props:{y:46,x:107,width:69,var:"LevelNum",valign:"middle",text:"99",strokeColor:"033f22",stroke:4,pivotY:21,pivotX:35,height:42,fontSize:50,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:25}]},{type:"Box",props:{width:720,visible:!0,right:0,name:"BottomBox",left:0,height:177,bottom:0},compId:27,child:[{type:"Image",props:{width:720,top:0,skin:"Main/chunhei.png",sizeGrid:"12,11,13,10",right:0,name:"BG",left:0,height:183,bottom:0},compId:28},{type:"List",props:{width:720,var:"BottomList",spaceX:30,right:0,repeatY:1,left:0,height:176,bottom:0},compId:26,child:[{type:"Box",props:{y:8,x:18,width:130,renderType:"render",height:160},compId:30,child:[{type:"Image",props:{y:0,x:0,width:129,skin:"Push/bg-box.png",sizeGrid:"27,27,37,20",name:"BG",height:159},compId:32},{type:"Image",props:{y:0,x:0,width:130,name:"icon",height:130},compId:31},{type:"Text",props:{y:130,x:0,width:126,valign:"middle",text:"冲冲冲冲冲冲",name:"name",height:29,fontSize:20,bold:!0,align:"center",runtime:"laya.display.Text"},compId:33},{type:"Button",props:{y:0,x:0,width:130,name:"btn",height:160},compId:34},{type:"Script",props:{runtime:"Tools/ListItem.ts"},compId:50}]}]}]},{type:"Button",props:{y:640,width:140,var:"LeftPushIcon",skin:"Main/white.png",sizeGrid:"5,16,5,11",pivotY:88,pivotX:70,left:20,height:175},compId:53,child:[{type:"Image",props:{width:140,name:"icon",height:140},compId:54},{type:"Text",props:{y:159,x:70,width:140,valign:"middle",text:"冲冲冲冲冲冲",pivotY:19,pivotX:70,name:"name",height:37,fontSize:22,font:"Microsoft YaHei",bold:!0,align:"center",runtime:"laya.display.Text"},compId:55}]},{type:"Button",props:{y:640,width:140,var:"RightPushIcon",skin:"Main/white.png",sizeGrid:"5,16,5,11",right:20,pivotY:88,pivotX:70,height:175},compId:56,child:[{type:"Image",props:{width:140,name:"icon",height:140},compId:57},{type:"Text",props:{y:159,x:70,width:140,valign:"middle",text:"冲冲冲冲冲冲",pivotY:19,pivotX:70,name:"name",height:37,fontSize:22,font:"Microsoft YaHei",bold:!0,align:"center",runtime:"laya.display.Text"},compId:58}]},{type:"Image",props:{y:640,x:360,visible:!1,var:"BaoKuan",top:0,skin:"Main/chunhei.png",sizeGrid:"10,12,16,9",right:0,left:0,bottom:0,anchorY:.5,anchorX:.5},compId:38,child:[{type:"Image",props:{y:560,x:-267.5,width:535,skin:"Push/index-box.png",sizeGrid:"28,33,48,26",height:573,anchorY:.5,anchorX:.5},compId:35,child:[{type:"Image",props:{y:40,x:267.5,width:228,skin:"Push/index-hot.png",pivotY:22,pivotX:114,height:44},compId:36},{type:"Button",props:{y:40,x:477.5,width:36,var:"CloseBaoKuan",stateNum:1,skin:"Push/index-close.png",pivotY:18,pivotX:18,height:36},compId:37},{type:"List",props:{y:313,x:267.5,width:493,var:"BaoKuanList",spaceY:8,spaceX:35,height:469,anchorY:.5,anchorX:.5},compId:39,child:[{type:"Box",props:{y:0,x:23,width:126,renderType:"render",height:150},compId:40,child:[{type:"Image",props:{width:125,name:"icon",height:125},compId:41},{type:"Text",props:{y:138,x:64,width:142,valign:"middle",text:"冲冲冲冲冲冲",pivotY:15,pivotX:71,name:"name",height:34,fontSize:20,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:42},{type:"Button",props:{y:84,x:71,width:141,pivotY:84,pivotX:71,name:"btn",height:167},compId:43},{type:"Script",props:{runtime:"Tools/ListItem.ts"},compId:49}]}]}]}]},{type:"Button",props:{y:338,x:0,visible:!0,var:"BaoKuanBtn",stateNum:1,skin:"Push/img_cover_slide_ad_btn.png",left:0},compId:44}],animations:[{nodes:[{target:35,keyframes:{y:[{value:560,tweenMethod:"linearNone",tween:!0,target:35,key:"y",index:0}],x:[{value:-267.5,tweenMethod:"linearNone",tween:!0,target:35,key:"x",index:0},{value:360,tweenMethod:"linearNone",tween:!0,target:35,key:"x",index:15}]}}],name:"chouti",id:1,frameRate:24,action:0},{nodes:[{target:53,keyframes:{rotation:[{value:0,tweenMethod:"linearNone",tween:!0,target:53,key:"rotation",index:0},{value:15,tweenMethod:"linearNone",tween:!0,target:53,key:"rotation",index:5},{value:-15,tweenMethod:"linearNone",tween:!0,target:53,key:"rotation",index:10},{value:15,tweenMethod:"linearNone",tween:!0,target:53,key:"rotation",index:15},{value:0,tweenMethod:"linearNone",tween:!0,target:53,key:"rotation",index:20}]}}],name:"lefticon",id:2,frameRate:24,action:0},{nodes:[{target:56,keyframes:{rotation:[{value:0,tweenMethod:"linearNone",tween:!0,target:56,key:"rotation",index:0},{value:15,tweenMethod:"linearNone",tween:!0,target:56,key:"rotation",index:5},{value:-15,tweenMethod:"linearNone",tween:!0,target:56,key:"rotation",index:10},{value:15,tweenMethod:"linearNone",tween:!0,target:56,key:"rotation",index:15},{value:0,tweenMethod:"linearNone",tween:!0,target:56,key:"rotation",index:20}]}}],name:"righticon",id:3,frameRate:24,action:0}],loadList:["Main/zhujiemian-1-3.png","Main/zhujiemian-1-2.png","Main/zhujiemian-1-1.png","Main/zhujiemian-1-4.png","Main/zhujiemian-1-10.png","Main/zhujiemian-1-6.png","Main/zhujiemian-1-7.png","Main/zhujiemian-1-9.png","Main/zhujiemian-1-8.png","Main/chunhei.png","Push/bg-box.png","Main/white.png","Push/index-box.png","Push/index-hot.png","Push/index-close.png","Push/img_cover_slide_ad_btn.png"],loadList3D:[]},ui.MainGameViewUI=MainGameViewUI,REG("ui.MainGameViewUI",MainGameViewUI);class SkinViewUI extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(SkinViewUI.uiView)}}SkinViewUI.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Image",props:{y:0,x:0,top:0,skin:"Main/chunhei.png",sizeGrid:"10,13,13,9",right:0,name:"BG",left:0,bottom:0},compId:22},{type:"Image",props:{y:875,x:362,width:658,skin:"Main/pifu-1-1.png",sizeGrid:"63,62,62,55",height:765,anchorY:.5,anchorX:.5},compId:4,child:[{type:"Image",props:{y:64,x:24,width:615,skin:"Main/pifu-1-2.png",sizeGrid:"42,33,67,30",height:675},compId:5},{type:"Button",props:{y:3,x:148.5,width:183,var:"CharacterBtn",height:61},compId:7,child:[{type:"Image",props:{y:1,x:0,skin:"Main/pifu-1-4.png",name:"grey"},compId:10},{type:"Image",props:{y:1,x:0,skin:"Main/pifu-1-3.png",name:"light"},compId:9},{type:"Text",props:{y:0,x:0,width:182,valign:"middle",text:"帽子",strokeColor:"#060606",stroke:2,height:63,fontSize:40,font:"Microsoft YaHei",color:"#ffffff",bold:!0,align:"center",runtime:"laya.display.Text"},compId:15}]},{type:"Button",props:{y:3,x:332,width:181,var:"HorseBtn",height:60},compId:8,child:[{type:"Image",props:{y:1,x:0,skin:"Main/pifu-1-4.png",name:"grey"},compId:14},{type:"Image",props:{y:1,x:0,visible:!1,skin:"Main/pifu-1-3.png",name:"light"},compId:13},{type:"Text",props:{y:0,x:0,width:182,valign:"middle",text:"马",strokeColor:"#060606",stroke:2,height:63,fontSize:40,font:"Microsoft YaHei",color:"#ffffff",bold:!0,align:"center",runtime:"laya.display.Text"},compId:16}]}]},{type:"List",props:{y:800,x:362,width:532,var:"ItemList",spaceY:10,spaceX:12,repeatY:2,repeatX:3,height:415,anchorY:.5,anchorX:.5},compId:17,child:[{type:"Box",props:{y:0,x:0,width:167,renderType:"render",height:199},compId:18,child:[{type:"Image",props:{y:0,x:2,width:165,skin:"Main/pifu-1-6.png",sizeGrid:"37,27,50,28",height:197},compId:19},{type:"Image",props:{y:0,x:0,width:170,skin:"Main/pifu-1-5.png",sizeGrid:"39,33,41,36",name:"choose",height:198},compId:20},{type:"Image",props:{y:78,x:83.5,width:127,pivotY:61,pivotX:64,name:"icon",height:121},compId:47},{type:"Button",props:{y:0,x:0,width:169,name:"btn",height:197},compId:43},{type:"Image",props:{y:154,x:51,skin:"Main/pifu-1-10.png",name:"used"},compId:45},{type:"Script",props:{runtime:"Tools/ShopItem.ts"},compId:46}]}]},{type:"Button",props:{y:114,x:46,var:"BackBtn",stateNum:1,skin:"Main/pifu-1-7.png"},compId:21},{type:"Button",props:{y:1144,x:498,width:243,var:"VideoGetCoinBtn",stateNum:1,skin:"Main/pifu-1-9.png",pivotY:46,pivotX:122,height:92},compId:23,child:[{type:"Text",props:{y:46,x:180,width:102,valign:"middle",text:"200",stroke:2,pivotY:33,pivotX:51,name:"CoinNum",height:65,fontSize:45,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:24}]},{type:"Button",props:{y:1144,x:218,var:"GetBtn",stateNum:1,skin:"Main/pifu-1-8.png",anchorY:.5,anchorX:.5},compId:25,child:[{type:"Image",props:{y:45,x:122,width:235,name:"GetByCoin",height:84,anchorY:.5,anchorX:.5},compId:26,child:[{type:"Image",props:{y:13,x:22,skin:"Main/zhujiemian-1-8.png"},compId:27},{type:"Text",props:{y:42,x:150,width:142,valign:"middle",text:"99999",strokeColor:"#030303",stroke:2,pivotY:26,pivotX:71,name:"CoinNum",height:51,fontSize:45,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:28}]},{type:"Image",props:{y:45,x:122,width:235,name:"GetByVideo",height:84,anchorY:.5,anchorX:.5},compId:30,child:[{type:"Image",props:{y:21.5,x:56,skin:"Main/pifu-1-11.png"},compId:31},{type:"Text",props:{y:42,x:150,width:142,valign:"middle",text:"1/3",strokeColor:"#030303",stroke:2,pivotY:26,pivotX:71,name:"VideoNum",height:51,fontSize:45,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:32}]},{type:"Image",props:{y:46,x:122,width:243,name:"GetByActive",height:91,anchorY:.5,anchorX:.5},compId:33,child:[{type:"Text",props:{y:42,x:117,width:232,valign:"middle",text:"活动领取",strokeColor:"#030303",stroke:2,pivotY:33,pivotX:116,name:"ByActive",height:76,fontSize:45,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:35}]},{type:"Image",props:{y:45,x:122,width:235,name:"Geted",height:84,anchorY:.5,anchorX:.5},compId:39,child:[{type:"Text",props:{y:42,x:117,width:232,valign:"middle",text:"使用",strokeColor:"#030303",stroke:2,pivotY:33,pivotX:116,name:"Get",height:76,fontSize:45,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:40}]},{type:"Text",props:{y:51,x:122,width:232,valign:"middle",text:"已装备",strokeColor:"#030303",stroke:2,pivotY:43,pivotX:116,name:"Using",height:80,fontSize:45,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:42}]}],loadList:["Main/chunhei.png","Main/pifu-1-1.png","Main/pifu-1-2.png","Main/pifu-1-4.png","Main/pifu-1-3.png","Main/pifu-1-6.png","Main/pifu-1-5.png","Main/pifu-1-10.png","Main/pifu-1-7.png","Main/pifu-1-9.png","Main/pifu-1-8.png","Main/zhujiemian-1-8.png","Main/pifu-1-11.png"],loadList3D:[]},ui.SkinViewUI=SkinViewUI,REG("ui.SkinViewUI",SkinViewUI);class TrialViewUI extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(TrialViewUI.uiView)}}TrialViewUI.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Image",props:{top:0,skin:"Main/chunhei.png",sizeGrid:"9,17,14,11",right:0,name:"BG",left:0,bottom:0},compId:4},{type:"Image",props:{y:213,x:108.5,skin:"Main/shiyong-1-3.png"},compId:5,child:[{type:"Image",props:{y:-58.5,x:40,skin:"Main/shiyong-1-1.png"},compId:6}]},{type:"Button",props:{y:672,x:219,var:"TrialBtn",stateNum:1,skin:"Main/shiyong-1-2.png"},compId:7},{type:"Button",props:{y:824,x:309,var:"NoTrialBtn",stateNum:1,skin:"Main/shiyong-1-4.png"},compId:8},{type:"Image",props:{y:276,x:161,width:398,var:"SceneViewPort",height:383},compId:9}],loadList:["Main/chunhei.png","Main/shiyong-1-3.png","Main/shiyong-1-1.png","Main/shiyong-1-2.png","Main/shiyong-1-4.png"],loadList3D:[]},ui.TrialViewUI=TrialViewUI,REG("ui.TrialViewUI",TrialViewUI)}(ui||(ui={})),function(MusicType){MusicType[MusicType.click=0]="click",MusicType[MusicType.hit=1]="hit",MusicType[MusicType.shoot=2]="shoot",MusicType[MusicType.OpenView=3]="OpenView",MusicType[MusicType.Lose=4]="Lose",MusicType[MusicType.Win=5]="Win",MusicType[MusicType.die=6]="die"}(MusicType||(MusicType={})),function(BGMType){BGMType[BGMType.BGM=0]="BGM"}(BGMType||(BGMType={}));class AudioManager{constructor(){}static musicres(_type){return"Game/res/music/"+MusicType[_type]+".mp3"}static bgmres(_type){return"Game/res/music/"+BGMType[_type]+".mp3"}static playMusic(_type){this.open&&Laya.SoundManager.playSound(this.musicres(_type))}static StopMusic(){Laya.SoundManager.stopMusic()}static PlayBGM(_type){this.open&&Laya.SoundManager.playMusic(this.bgmres(_type),0)}}AudioManager.open=!0;class MainGameView extends ui.MainGameViewUI{constructor(){super(),MainGameView.ins=this}static get Instance(){return MainGameView.ins?MainGameView.ins:new MainGameView}Show(){WXSDK.AldEvent("打开主界面"),AudioManager.PlayBGM(BGMType.BGM),this.BaoKuan.visible=!1,this.StartBtn.clickHandler=Laya.Handler.create(this,this.ClickStart),this.SkinBtn.clickHandler=Laya.Handler.create(this,this.ClickSkin),this.MoreFunBtn.clickHandler=new Laya.Handler(this,this.ClickMoreFun),this.BaoKuanBtn.clickHandler=new Laya.Handler(this,this.OpenChouTi),this.goaltext=this.GoalProgress.getChildByName("goal"),this.goaltext.text=GameManager.Instance.KillNum.toString(),this.GoldNum.text=AccountManager.Instance.curplayerData.GainAccount("money"),this.LevelNum.text=AccountManager.Instance.curplayerData.GainAccount("stage"),this.SoundBox.on(Laya.Event.CLICK,this,this.ClickSound),this.sound=this.SoundBox.getChildByName("sound"),this.shake=this.SoundBox.getChildByName("shake"),this.sound.visible=AudioManager.open,this.shake.visible=WXSDK.shake,this.SetData(),this.SetTopAd(),this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height})}Close(){Laya.stage.off(Laya.Event.MOUSE_DOWN,this,this.ClickStart)}ClickStart(){if(Number(AccountManager.Instance.curplayerData.GainAccount("stage"))>2)AudioManager.playMusic(MusicType.click),ViewManager.Instance.ShowView(ViewType.TrialView);else{var agrs=[{t:AccountManager.Instance.ServerTime.toString()}];ServerManager.Instance.SendHttp(ArcherWorrior.KaiShi,agrs,Laya.Handler.create(this,this.GameStart),null)}}ClickSkin(){AudioManager.playMusic(MusicType.click),ViewManager.Instance.ShowView(ViewType.ShopView)}ClickMoreFun(){ViewManager.Instance.OpenPopView(ViewType.ExportView)}ClickSound(){this.sound.visible?(this.sound.visible=!1,this.shake.visible=!0,AudioManager.open=!1,WXSDK.shake=!0,AudioManager.StopMusic(),console.log("关闭声音,打开震动---")):(this.sound.visible=!0,this.shake.visible=!1,AudioManager.open=!0,WXSDK.shake=!0,AudioManager.PlayBGM(BGMType.BGM),console.log("打开声音,关闭震动"))}GameStart(_data){let stage=AccountManager.Instance.curplayerData.GainAccount("stage");WXSDK.AldStart(stage),AudioManager.playMusic(MusicType.click),this.play_id=_data.play_id,EventManager.StageTrigger(StageState.Start),ViewManager.Instance.ShowView(ViewType.IngameView)}OpenChouTi(){this.BaoKuanBtn.visible=!1,this.BaoKuan.visible=!0,this.CloseBaoKuan.clickHandler=Laya.Handler.create(this,this.CloseChouTi),this.chouti.play(null,!1),this.InitAd()}CloseChouTi(){this.BaoKuan.visible=!1,this.BaoKuanBtn.visible=!0,this.CloseBaoKuan.clickHandler=null}InitAd(){SDKZS.SetHuTuiList(this.BaoKuanList,1,""),this.GunGun2()}GunGun2(){this.BaoKuanList.scrollBar.value=0;var maxTop=this.BaoKuanList.scrollBar.max,tempTop=1;Laya.timer.frameLoop(1,this,()=>{this.BaoKuanList.scrollBar.value+=tempTop,(this.BaoKuanList.scrollBar.value>=maxTop||this.BaoKuanList.scrollBar.value<=0)&&(tempTop=-tempTop)})}SetData(){SDKZS.SetHuTuiList(this.BottomList,2,""),this.GunGun()}GunGun(){var maxBtm;try{this.BottomList.scrollBar.value=0,maxBtm=this.BottomList.scrollBar.max}catch(error){return void console.error(error)}var tempBtm=1;Laya.timer.frameLoop(1,this,()=>{this.BottomList.scrollBar.value+=tempBtm,(this.BottomList.scrollBar.value>=maxBtm||this.BottomList.scrollBar.value<=0)&&(tempBtm=-tempBtm)})}SetTopAd(){this.topAdData=SDKZS.data.promotion||[],this.LeftPushIcon.visible=this.RightPushIcon.visible=this.topAdData.length>=2,this.topAdData.length<2||(this.topLeftAdIndex={index:0},this.topRightAdIndex={index:1},this._setTopAd(this.LeftPushIcon,this.topLeftAdIndex),this._setTopAd(this.RightPushIcon,this.topRightAdIndex))}_setTopAd(topAd,adIndex){let _icon=topAd.getChildByName("icon"),_name=topAd.getChildByName("name");topAd.clickHandler=new Laya.Handler(this,()=>{SDKZS.navigate2Mini(this.topAdData[adIndex.index])}),this._setIcon(_icon,_name,adIndex),Laya.timer.loop(5e3,this,()=>{this._setIcon(_icon,_name,adIndex),this.lefticon.play(null,!1),this.righticon.play(null,!1)})}_setIcon(_icon,_name,adIndex){adIndex.index=(adIndex.index+2)%this.topAdData.length,_icon.skin=this.topAdData[adIndex.index].app_icon,_name.text=this.topAdData[adIndex.index].app_title}}class DataManager{constructor(){DataManager.ins=this}static get Instance(){return DataManager.ins?DataManager.ins:new DataManager}}DataManager.DoorArray=[];var Sprite3D$1=Laya.Sprite3D,Vector3$2=Laya.Vector3;class Prop{constructor(_id){this.id=_id}}class Plane{constructor(_index,_id,pos,data,proppos,propoffest){this.things=[],this.thinghight=0,this.thingwight=0,this.index=_index,this.planeid=_id,this.position=pos,this.GetProp(data,proppos,propoffest)}GetProp(data,pos,offset){for(var config=AccountManager.Instance.curplayerData.GainCollocation("things"),datas=data.split(";"),poss=pos.split(";"),offestX=offset.split(";"),i=0;i<datas.length;i++)if("0"!=datas[i]){var prop=new Prop(Number(datas[i])),curconfig=config[(prop.id-1).toString()],ps=i<=poss.length-1?Number(poss[i]):this.long;i<=poss.length-1?Number(offestX[i]):this.long;prop.pos=new Vector3$2(this.position.x,this.position.y,this.position.z+ps),prop.type=Number(curconfig.type),this.things.push(prop)}}}class Grade{constructor(_index,_id){this.startpoint=new Vector3$2(0,0,0),this.planes=[],this.scencerys=[],this.MaxLength=0,this.MaxHight=0,this.fencearray=[],this.fencepos=0,this.fencepos2=0,this.fencenum=0,this.fenceleftpos=0,this.fencerightpos=0,this.creat=!1,this.floorarray=[],this.floornum=0,this.floorpos=0,this.treenum=0,this.treepos=0,this.treepos2=0,this.creatnum=0,this.index=_index,this.gradeid=_id}Init(){this.GetPlane(),this.endpointpoint=new Vector3$2(0,this.MaxHight,this.MaxLength)}GetPlane(){var config=AccountManager.Instance.curplayerData.GainCollocation("road");for(var key in config)if(Number(config[key].road_id)==this.gradeid){var planedata=config[key],long=Number(planedata.long),posz=this.startpoint.z,roadid=Number(planedata.street),planepos=new Vector3$2(9-1.65*roadid,0,posz),plane=new Plane(Number(planedata.street),Number(planedata.road_id),planepos,planedata.things,planedata.position,planedata.offset);plane.long=Number(planedata.long),this.MaxHight=plane.thinghight<this.MaxHight?plane.thinghight:this.MaxHight,0!=long&&(this.MaxLength=posz+long>this.MaxLength?posz+long:this.MaxLength),this.planes.push(plane)}}Clear(){for(var j=0;j<this.planes.length;j++){var model=this.planes[j].model;model&&model.active&&!model.destroyed&&GamePool.Instance.RecoveryModel(model),this.planes[j].model=null;for(var things=this.planes[j].things,k=0;k<things.length;k++)(model=things[k].model)&&model.active&&!model.destroyed&&GamePool.Instance.RecoveryModel(model),things[k].model=null}for(var i=0;i<this.scencerys.length;i++){var scencery=this.scencerys[i];scencery&&scencery.active&&!scencery.destroyed&&GamePool.Instance.RecoveryModel(scencery),this.scencerys[i]=null}this.scencerys.splice(0,this.scencerys.length);for(let k=0;k<this.fencearray.length;k++){var _fence=this.fencearray[k];_fence&&_fence.active&&!_fence.destroyed&&GamePool.Instance.RecoveryModel(_fence),this.fencearray[k]=null}this.fencearray.splice(0,this.fencearray.length),this.spr&&this.spr.destroy()}Creat(_stage=null,_id){null==_stage&&(_stage=StageControl.Instance.curstage),this.spr=new Sprite3D$1;for(var j=0;j<this.planes.length;j++){var plane=this.planes[j];if(plane.long>0){var res=AssetManager.Instance.Plane.get(1);plane.model=GamePool.Instance.GetModel(res,""),this.spr.addChild(plane.model),plane.model.transform.position=plane.position,plane.model.transform.scale=new Laya.Vector3(plane.model.transform.scale.x,plane.model.transform.scale.y,plane.long),GameTools.Instance.SetCollider(plane.model,100);for(var things=plane.things,k=0;k<things.length;k++){var thingdata=things[k],tre=AssetManager.Instance.Prop.get(thingdata.id);thingdata.model=GamePool.Instance.GetModel(tre,""),1==thingdata.id&&DataManager.DoorArray.push(thingdata.model),13==thingdata.id?GameManager.Instance.CreatEnemy(thingdata.model):14==thingdata.id?GameManager.Instance.CreatChaseCharacter(thingdata.model):GameTools.Instance.SetCollider(thingdata.model,100),this.spr.addChild(thingdata.model),thingdata.model.transform.position=thingdata.pos}}else if(plane.things.length>0)for(k=0;k<plane.things.length;k++){thingdata=plane.things[k],tre=AssetManager.Instance.Prop.get(thingdata.id);thingdata.model=GamePool.Instance.GetModel(tre,""),GameTools.Instance.SetCollider(thingdata.model,100),this.spr.addChild(thingdata.model),thingdata.model.transform.position=thingdata.pos}AssetManager.Instance.mainscene.addChild(this.spr)}}}class GK{constructor(_id){this.curgrades=[],this.ChooseGrade=[],this.Id=Number(_id),this.scenery=GameTools.RandomANumber(1,5),this.GetGrade()}GetGrade(){var config=AccountManager.Instance.curplayerData.GainCollocation("mission"),gradedatas=config[this.Id-1].roads.split(";"),roadnum=Number(config[this.Id-1].road_num);this.mainrolespeed=Number(config[this.Id-1].PlayerSpeed),this.npcspeed=Number(config[this.Id-1].NpcSpeed),this.hostspeed=Number(config[this.Id-1].HostageSpeed),this.BossHp=Number(config[this.Id-1].boss_HP),this.Goal=Number(config[this.Id-1].goal),this.Modulus=Number(config[this.Id-1].modulus),this.isboss=Number(config[this.Id-1].boss);let GradeArray=[],num=0;if(this.Id>2){for(;0==num;){var random=GameTools.RandomANumber(0,gradedatas.length),value=Number(gradedatas[random]);gradedatas.splice(random,1),GradeArray.push(value),GradeArray.length==roadnum&&(num=1)}for(var endpos=new Vector3$2,i=0;i<GradeArray.length;i++){var gradeid=Number(GradeArray[i]),grade=new Grade(i,gradeid);i>0&&(grade.startpoint=endpos),grade.Init(),endpos=grade.endpointpoint,this.curgrades.push(grade)}this.endposition=endpos,this.ChooseGrade=GradeArray}else{for(endpos=new Vector3$2,i=0;i<gradedatas.length;i++){gradeid=Number(gradedatas[i]),grade=new Grade(i,gradeid);i>0&&(grade.startpoint=endpos),grade.Init(),endpos=grade.endpointpoint,this.curgrades.push(grade)}this.endposition=endpos}console.log("GradeArray -- ",GradeArray.length)}}var SkinGetForType,ViewType,Vector3$3=Laya.Vector3;class StageControl{constructor(){this.floorarray=[],this.treearray=[],this.fencearray=[],this.num=1,this.curstagedic={},StageControl.ins=this,EventManager.EventOn(EventState.SceneInit,this,this.StageInit),EventManager.StageOn(StageState.Restart,this,this.RessetStage)}static get Instance(){return StageControl.ins?StageControl.ins:new StageControl}StageInit(){var config=AccountManager.Instance.curplayerData.GainCollocation("mission");for(var index in config){var data=config[index],gk=new GK(data.id);this.curstagedic[gk.Id]=gk}EventManager.EventTrigger(EventState.StageInit)}RessetStage(){GameManager.Instance.KillNum=0,GameManager.Instance.ReviveNum=1,GameManager.Instance.fenceleftpos=0,GameManager.Instance.fencerightpos=0,GameManager.Instance.treeleftpos=0,GameManager.Instance.treerightpos=0,GameManager.Instance.GuideKill=0,this.curstage&&this.ClearStageResources();var level=Number(AccountManager.Instance.curplayerData.GainAccount("stage"));this.curstage=this.CreatStage(level),console.log("本关卡为---",this.curstage.Id);for(let i=0;i<this.curstage.ChooseGrade.length;i++)console.log("选中路段为---",this.curstage.ChooseGrade[i]);EventManager.EventTrigger(EventState.StageCreateComplete)}ClearStageResources(){var stage=this.curstage;console.log("舞台id为:--------",this.curstage.Id);for(let j=0;j<this.floorarray.length;j++){let floor=this.floorarray[j];floor&&floor.active&&!floor.destroyed&&GamePool.Instance.RecoveryModel(floor),this.floorarray[j]=null}this.floorarray.slice(0,this.floorarray.length);for(let k=0;k<this.treearray.length;k++){let tree=this.treearray[k];tree&&tree.active&&!tree.destroyed&&GamePool.Instance.RecoveryModel(tree),this.treearray[k]=null}this.treearray.splice(0,this.treearray.length);for(let l=0;l<this.fencearray.length;l++){let fence=this.fencearray[l];fence&&fence.active&&!fence.destroyed&&GamePool.Instance.RecoveryModel(fence),this.fencearray[l]=null}this.fencearray.splice(0,this.fencearray.length);for(var i=0;i<stage.curgrades.length;i++)stage.curgrades[i].Clear();GameManager.Instance.RecoveryCharacter()}CreatStage(_id){var stage=this.curstagedic[_id];if(!stage){var config=AccountManager.Instance.curplayerData.GainCollocation("road"),from=Math.floor(.8*config.length);(stage=this.curstagedic[GameTools.RandomANumber(from,config.length-1)]).Id=_id}return this.CreatStageResources(stage,_id),stage}CreatStageResources(_stage,_id){for(var i=0;i<_stage.curgrades.length;i++)_stage.curgrades[i].Creat(_stage,_id);let stage=StageControl.Instance.curstagedic[_id],floornum=Math.floor(1.65*stage.endposition.z/8.23)+13,floorpos=-8.24;for(let i=0;i<floornum;i++){var _floor=GamePool.Instance.GetModel(AssetManager.Instance.Prop.get(19),"");i>0?(_floor.transform.position=new Vector3$3(0,-.5,floorpos),floorpos+=8.24):_floor.transform.position=new Vector3$3(0,-.5,-16.48),AssetManager.Instance.mainscene.addChild(_floor),this.floorarray.push(_floor),this.LastGround=_floor.transform.position.z}let planearray=[];for(let i=0;i<StageControl.Instance.curstagedic[_id].curgrades[0].planes.length;i++)StageControl.Instance.curstagedic[_id].curgrades[0].planes[i].long>0&&planearray.push(StageControl.Instance.curstagedic[_id].curgrades[0].planes[i]);let first_plane=planearray[0].index,last_plane=planearray[planearray.length-1].index,fenceLeft=9-1.65*first_plane+1;GameManager.Instance.fenceleftpos=fenceLeft;let fenceRight=9-1.65*last_plane-1;GameManager.Instance.fencerightpos=fenceRight;let treeLeft=9-1.65*first_plane+5;GameManager.Instance.treeleftpos=treeLeft;let treeRight=9-1.65*last_plane-4;GameManager.Instance.treerightpos=treeRight;let fencepos=-13.35,fencenum=_stage.endposition.z+60;for(let i=0;i<fencenum;i++){var _fence=GamePool.Instance.GetModel(AssetManager.Instance.Small_Fence.get(1),"");_fence.transform.position=new Vector3$3(fenceLeft,0,i>0?fencepos:-15),_fence.transform.rotationEuler=new Vector3$3(0,-90,0),AssetManager.Instance.mainscene.addChild(_fence),GameTools.Instance.SetCollider(_fence,100),this.fencearray.push(_fence);var _fence2=GamePool.Instance.GetModel(AssetManager.Instance.Small_Fence.get(1),"");_fence2.transform.position=new Vector3$3(fenceRight,0,i>0?fencepos:-15),_fence2.transform.rotationEuler=new Vector3$3(fenceRight,90,0),fencepos+=1.65,AssetManager.Instance.mainscene.addChild(_fence2),GameTools.Instance.SetCollider(_fence2,100),this.fencearray.push(_fence2)}let treepos=0,treenum=1.65*_stage.endposition.z/5+65;for(let i=0;i<treenum;i++){var _random=GameTools.RandomANumber(1,5),tree=GamePool.Instance.GetModel(AssetManager.Instance.Tree.get(_random),"");tree.transform.position=new Vector3$3(treeLeft,0,i>0?treepos:-20),AssetManager.Instance.mainscene.addChild(tree),this.treearray.push(tree);var _random2=GameTools.RandomANumber(1,5),tree2=GamePool.Instance.GetModel(AssetManager.Instance.Tree.get(_random2),"");tree2.transform.position=new Vector3$3(treeRight,0,i>0?treepos:-20),AssetManager.Instance.mainscene.addChild(tree2),this.treearray.push(tree2),treepos+=3}Number(AccountManager.Instance.curplayerData.GainAccount("stage"));if(1==_stage.isboss){let EndZ=1.2*_stage.curgrades[_stage.curgrades.length-1].endpointpoint.z,EndX=GameTools.RandomANumber(-2,2);GameManager.Instance.CreatBoss(new Vector3$3(EndX,0,EndZ))}}CreatGround(num){var startZ=this.LastGround,floorarr=[];for(let i=0;i<num;i++){var floor=GamePool.Instance.GetModel(AssetManager.Instance.Prop.get(19),"");floor.transform.position=new Vector3$3(0,-.5,startZ),AssetManager.Instance.mainscene.addChild(floor),this.floorarray.push(floor),floorarr.push(floor),startZ+=8.24}this.LastGround=startZ;var first=floorarr[0].transform.position.z,last=floorarr[floorarr.length-1].transform.position.z;this.CreatFence(first,last),this.CreatTree(first,last)}CreatFence(_start,_end){var Fir=_start,End_Fence=this.curstage.curgrades[this.curstage.curgrades.length-1].fencearray;let fencenum=Math.floor((_end-_start)/1.65)+8;for(let i=0;i<fencenum;i++){var _fence=GamePool.Instance.GetModel(AssetManager.Instance.Small_Fence.get(1),"");_fence.transform.position=new Vector3$3(GameManager.Instance.fenceleftpos,0,i>0?Fir:Fir-8.3),AssetManager.Instance.mainscene.addChild(_fence),End_Fence.push(_fence);var _fence2=GamePool.Instance.GetModel(AssetManager.Instance.Small_Fence.get(1),"");_fence2.transform.position=new Vector3$3(GameManager.Instance.fencerightpos,0,i>0?Fir:Fir-8.3),AssetManager.Instance.mainscene.addChild(_fence2),End_Fence.push(_fence2),Fir+=1.65}}CreatTree(_start,_end){var End_Fence=this.curstage.curgrades[this.curstage.curgrades.length-1].scencerys;let treenum=Math.floor((_end-_start)/3)+1;for(let i=0;i<treenum;i++){let _random=GameTools.RandomANumber(1,5);var _tree=GamePool.Instance.GetModel(AssetManager.Instance.Tree.get(_random),"");_tree.transform.position=new Vector3$3(GameManager.Instance.treeleftpos,0,_start),AssetManager.Instance.mainscene.addChild(_tree),End_Fence.push(_tree);var _tree2=GamePool.Instance.GetModel(AssetManager.Instance.Tree.get(_random),"");_tree2.transform.position=new Vector3$3(GameManager.Instance.treerightpos,0,_start),AssetManager.Instance.mainscene.addChild(_tree2),End_Fence.push(_tree2),_start+=3}}}class InGameView extends ui.InGameViewUI{constructor(){super(),InGameView.ins=this}static get Instance(){return InGameView.ins?InGameView.ins:new InGameView}Show(){WXSDK.AldEvent("进入游戏内界面");let stage=Number(AccountManager.Instance.curplayerData.GainAccount("stage"));1==stage?(this.Guide1.visible=!0,this.ani1.play(0,!0),this.Guide2.visible=!1,this.Guide3.visible=!1,this.Guide4.visible=!1):(this.Guide1.visible=!1,this.Guide2.visible=!1,this.Guide3.visible=!1,this.Guide4.visible=!1),this.GoldNum.text=AccountManager.Instance.curplayerData.GainAccount("money"),this.goaltext=this.GoalProgress.getChildByName("goal"),this.SetData(),this.InitUI(),this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height})}Close(){}InitUI(){this.goaltext.text=GameManager.Instance.KillNum.toString(),this.GoalProgress.value=GameManager.Instance.KillNum/StageControl.Instance.curstage.Goal}SetData(){SDKZS.SetHuTuiList(this.BottomList,2,""),this.GunGun()}GunGun(){var maxBtm;try{this.BottomList.scrollBar.value=0,maxBtm=this.BottomList.scrollBar.max}catch(error){return void console.error(error)}var tempBtm=1;Laya.timer.frameLoop(1,this,()=>{this.BottomList.scrollBar.value+=tempBtm,(this.BottomList.scrollBar.value>=maxBtm||this.BottomList.scrollBar.value<=0)&&(tempBtm=-tempBtm)})}}class GuangGao{constructor(){this.isVideoLoadCom=!1,GuangGao.ins=this}static get Instance(){return GuangGao.ins?GuangGao.ins:new GuangGao}static InitId(){}static JiaZaiShiPin(){this.afsfsaafsfsa||Laya.Browser.onWeiXin&&(this.fsaasfafssfa=Laya.Browser.window.wx.createRewardedVideoAd({adUnitId:this.videlAdUnitId}),this.fsaasfafssfa.onLoad(()=>{console.log("激励视频 广告加载成功"),this.asfasfsaffsa=!0}),this.fsaasfafssfa.onError(err=>{console.log("激励视屏加载失败:"+err),this.asfasfsaffsa=!1}),this.afsfasfasasf=0,this.afsfsaafsfsa=!0)}static fassfafasafs(callback){this.fsaasfafssfa.offClose(),this.fsaasfafssfa.onClose(res=>{console.log("激励视频关闭:"+res.isEnded),res&&res.isEnded||void 0===res?callback&&callback(!0):callback&&callback(!1),this.fsaasfafssfa.offClose()})}showBanner(success=null,fail=null){if(!Laya.Browser.onWeiXin)return;let ad=GuangGao.bannerAdUnitId,bannerAd=Laya.Browser.window.wx.createBannerAd({adUnitId:ad,style:{left:0,top:0,width:460}});bannerAd.onLoad(()=>{console.log("[LOG] Banner广告加载成功"),this.hideBanner(),this._bannerAd=bannerAd;let info=Laya.Browser.window.wx.getSystemInfoSync();this._bannerAd.style.width=info.windowWidth,this._bannerAd.style.top=info.windowHeight-this._bannerAd.style.realHeight-20,this._bannerAd.show(),success&&success(this._bannerAd)}),bannerAd.onError(err=>{console.log("[LOG] Banner广告加载失败"),console.log(err),fail&&fail()})}hideBanner(){Laya.Browser.onWeiXin&&this._bannerAd&&(this._bannerAd.hide(),this._bannerAd.destroy(),this._bannerAd=null)}static OpenBanner(gap=0,callVack=null,iswait=!1){if(Laya.Browser.onWeiXin)if(this.afsfasfasasf>=1e4){var hh=this.gasagsgasgsa(gap);iswait?(this.asgagassga.hide(),Laya.timer.once(1e3*AccountManager.Instance.curplayerData.wudaoshijian,this,()=>{null!=callVack&&callVack(hh),this.asgagassga.show()})):(null!=callVack&&callVack(hh),this.asgagassga.show())}else{var idd=this.bannerAdUnitId;console.log("adUnitId:"+idd);let newBanner=Laya.Browser.window.wx.createBannerAd({adUnitId:idd,style:{left:0,top:0,width:460}});newBanner.onError(err=>{console.log("没有拉到banner--"),console.log(err),newBanner=Laya.Browser.window.wx.createBannerAd({adUnitId:idd,style:{left:0,top:0,width:460}}),this.gasagsgasgsa(gap)}),newBanner.onLoad(()=>{this.afsfasfasasf++,this.asgagassga&&this.asgagassga.destroy(),this.asgagassga=newBanner;var hight=this.gasagsgasgsa(gap);iswait?(this.asgagassga.hide(),Laya.timer.once(1e3*AccountManager.Instance.curplayerData.wudaoshijian,this,()=>{null!=callVack&&callVack(hight),this.asgagassga.show()})):(null!=callVack&&callVack(hight),this.asgagassga.show())})}}static gasagsgasgsa(gap){if(this.asgagassga){let info=Laya.Browser.window.wx.getSystemInfoSync();return this.asgagassga.style.width=info.windowWidth,this.asgagassga.style.top=info.windowHeight-this.asgagassga.style.realHeight-gap-20,Laya.stage.height/info.windowHeight*this.asgagassga.style.realHeight}}static Clear(){Laya.timer.clearAll(this),Laya.Browser.onWeiXin&&this.asgagassga&&this.asgagassga.hide()}static agagsagags(){Laya.Browser.onWeiXin&&this.asgagassga&&this.asgagassga.hide()}static gasagsasg(){Laya.Browser.onWeiXin&&this.asgagassga&&this.asgagassga.show()}static get keyiwudao(){var wudao=AccountManager.Instance.curplayerData.Cheat;if(0==wudao)return console.log("cheat:"+wudao),!1;if("1037"==Main.SceneNum||"1058"==Main.SceneNum||"1067"==Main.SceneNum||"1095"==Main.SceneNum)return console.log("cheat:true-> "+Main.SceneNum),!0;var checkscence=AccountManager.Instance.curplayerData.CheckScene;return 0==checkscence?(console.log("cheat:true->checkscence: "+checkscence),!0):(console.log("cheat:false-> "+Main.SceneNum),!1)}static WudaoAnNiu(btn,ShowBanner=!0,complete=null,gap=0){AccountManager.Instance.curplayerData.Banner&&(GuangGao.agagsagags(),0==GuangGao.keyiwudao?(btn.bottom=350,GuangGao.OpenBanner()):ShowBanner?(btn.bottom=100,btn.mouseEnabled=!1,console.log("bottom:100"),GuangGao.OpenBanner(gap,height=>{if(null==height){console.log("展示互推位");var end=Laya.stage.height-height-btn.height;btn.y=end,btn.bottom=NaN}else{end=Laya.stage.height-height-btn.height;btn.y=end-100,btn.bottom=NaN,console.log("y:"+end)}},!0),Laya.timer.once(1e3*AccountManager.Instance.curplayerData.wudaoshijian,this,()=>{btn.mouseEnabled=!0,null!=complete&&complete()})):null!=complete&&complete())}loadVideo(cb){if(Laya.Browser.onWeiXin)if(this._onLoadVideo=cb,this._rewardedVideoAd)this.isVideoLoadCom?(this._onLoadVideo&&this._onLoadVideo(!0),this._onLoadVideo=null):(this._onLoadVideo&&this._onLoadVideo(!1),this._onLoadVideo=null);else{let index=GuangGao.videlAdUnitId;this._rewardedVideoAd=Laya.Browser.window.wx.createRewardedVideoAd({adUnitId:index});var isc=!1;this._rewardedVideoAd.onLoad(()=>{console.log("[LOG] 激励视频广告加载成功"),this.isVideoLoadCom=!0,isc||(isc=!0,this._onLoadVideo&&this._onLoadVideo(!0),this._onLoadVideo=null)}),this._rewardedVideoAd.onError(err=>{console.log("[LOG] 激励视频广告加载失败"),console.log(err),this.isVideoLoadCom=!1,this._onLoadVideo&&this._onLoadVideo(!1),this._onLoadVideo=null}),this._rewardedVideoAd.onClose(res=>{!res||res.isEnded?(this._onVideoClose&&this._onVideoClose(!0),this._onVideoClose=null):(this._onVideoClose&&this._onVideoClose(!1),this._onVideoClose=null)})}else cb&&cb(!0)}showVideo(cb){Laya.Browser.onWeiXin?(this._onVideoClose=cb,this._rewardedVideoAd.show().catch(err=>{this._rewardedVideoAd.load().then(()=>{this._rewardedVideoAd.show()})})):cb&&cb(!0)}}GuangGao.videlAdUnitId="adunit-40ac03a5538e8de0",GuangGao.bannerAdUnitId="adunit-dc3e1cfa3ac69be3",GuangGao.afsfsaafsfsa=!1,GuangGao.asfasfsaffsa=!1,GuangGao.afsfasfasasf=0;class ShopItem extends Laya.Script{constructor(){super(),this.use=!1,ShopItem.ins=this}static get Instance(){return ShopItem.ins?ShopItem.ins:new ShopItem}onAwake(){this.selfobj=this.owner,this._select=this.selfobj.getChildByName("choose"),this._skin=this.selfobj.getChildByName("icon"),this.using=this.selfobj.getChildByName("used"),this.click1_btn=this.selfobj.getChildByName("btn"),this.click1_btn.clickHandler=new Laya.Handler(this,this._ClickHander),EventManager.EventOn(EventState.Select,this,this.ShowSelect)}RefreshItem(any,comeType){this.comeType=comeType,this.instance=any||ShopView.Instance,this._data=this.selfobj.dataSource;var _id=this._data.id,usingId=AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)[1],usingId2=AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)[2],hasequip=AccountManager.Instance.curplayerData.HasEquip(_id),require_type=this._data.require_type;return this._skin.skin="Game/res/Skin/"+this._data.icon+".png",this._skin.rotation=0,usingId==_id||usingId2==_id?(this.skinGetForType=SkinGetForType.Using,void this.showui()):hasequip?(this.skinGetForType=SkinGetForType.Geted,void this.showui()):2==require_type?(this.skinGetForType=SkinGetForType.Bycoin,void this.showui()):4==require_type?(this.skinGetForType=SkinGetForType.GetByActivity,void this.showui()):3==require_type?(this.skinGetForType=SkinGetForType.GetByVideo,void this.showui()):void 0}showui(){this.skinGetForType;1==this._data.id||50==this._data.id?this._select.visible=!0:this._select.visible=!1,this.skinGetForType==SkinGetForType.Using?this.using.visible=!0:this.using.visible=!1}ShowUi(){var type=this.skinGetForType;this._select.visible=type==SkinGetForType.Using,this.skinGetForType==SkinGetForType.Using?this.using.visible=!0:this.using.visible=!1}_ClickHander(){this.instance._data=this._data,ShopView.Instance.RefreshButton(this.skinGetForType),this.instance.showroleId=this._data.id,this.ShowUi(),this.ShowModel()}ShowModel(){EventManager.EventTrigger(EventState.Select)}ShowSelect(){this._data&&(this._select.visible=this.instance.showroleId==this._data.id)}}!function(SkinGetForType){SkinGetForType[SkinGetForType.Geted=1]="Geted",SkinGetForType[SkinGetForType.Bycoin=2]="Bycoin",SkinGetForType[SkinGetForType.GetByVideo=3]="GetByVideo",SkinGetForType[SkinGetForType.GetByActivity=4]="GetByActivity",SkinGetForType[SkinGetForType.Using=-1]="Using"}(SkinGetForType||(SkinGetForType={}));class ShopView extends ui.SkinViewUI{constructor(){super(),this.firstopen=!0,this.showroleId=0,this.uiArr=[],this.CapArray=[],this.HorseArray=[],ShopView.ins=this}static get Instance(){return null==ShopView.ins?(console.log("new shopview"),new ShopView):ShopView.ins}Show(){WXSDK.AldEvent("打开皮肤商店界面");let data=AccountManager.Instance.curplayerData.GainCollocation("theme");for(let i=0;i<data.length;i++)i<5?this.CapArray.push(data[i]):this.HorseArray.push(data[i]);this.BackBtn.clickHandler=new Laya.Handler(this,this.ClickClose),this.CharacterBtn.clickHandler=new Laya.Handler(this,this.ClickCap),this.HorseBtn.clickHandler=new Laya.Handler(this,this.ClickHorse),this.GetBtn.clickHandler=new Laya.Handler(this,this.ClickGet),this.VideoGetCoinBtn.clickHandler=new Laya.Handler(this,this.VideoGet),this.CharacterLightImage=this.CharacterBtn.getChildByName("light"),this.HorseLightImage=this.HorseBtn.getChildByName("light"),this.GetByCoin=this.GetBtn.getChildByName("GetByCoin"),this.RequireCoinNum=this.GetByCoin.getChildByName("CoinNum"),this.GetByVideo=this.GetBtn.getChildByName("GetByVideo"),this.RequireVideoNum=this.GetByVideo.getChildByName("VideoNum"),this.GetByActive=this.GetBtn.getChildByName("GetByActive"),this.Geted=this.GetBtn.getChildByName("Geted"),this.Using=this.GetBtn.getChildByName("Using"),this.uiArr.push(this.Using),this.uiArr.push(this.Geted),this.uiArr.push(this.GetByCoin),this.uiArr.push(this.GetByVideo),this.uiArr.push(this.GetByActive),this.equip_Horse=AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)[2],this.equip_Cap=AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)[1],this.showroleId=1,this.ItemList.selectEnable=!1,this.ItemList.vScrollBarSkin="",this.ItemList.renderHandler=Laya.Handler.create(this,this.UpdateItem,null,!1),this.ItemList.array=this.CapArray,this.ItemList.refresh(),this.ShowButton(1),this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height})}Close(){WXSDK.AldEvent("关闭皮肤商城界面")}ClickClose(){var equiphorseid=Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)[2]),equipcap=Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)[1]);equipcap&&equipcap!=this.equip_Cap&&GameManager.Instance.SetCap(equipcap),equiphorseid!=this.equip_Horse&&GameManager.Instance.SetHorse(equiphorseid),ViewManager.Instance.ShowView(ViewType.MainView)}UpdateItem(cell,index){cell.getComponent(ShopItem).RefreshItem()}RefreshItem(){this.ItemList.refresh()}ClickCap(){this.firstopen=!0,this.equip_Cap?this.showroleId=this.equip_Cap:this.showroleId=1,this.ShowButton(1),this.CharacterLightImage.visible=!0,this.HorseLightImage.visible=!1,this.ItemList.vScrollBarSkin="",this.ItemList.array=this.CapArray,this.ItemList.renderHandler=Laya.Handler.create(this,this.UpdateItem,null,!1)}ClickHorse(){this.firstopen=!0,this.showroleId=this.equip_Horse,this.ShowButton(2),this.CharacterLightImage.visible=!1,this.HorseLightImage.visible=!0,this.ItemList.vScrollBarSkin="",this.ItemList.array=this.HorseArray,this.ItemList.renderHandler=Laya.Handler.create(this,this.UpdateItem,null,!1)}RefreshButton(_skinGetForType){this.skinGetForType=_skinGetForType,this.ShowUI(this.skinGetForType)}ShowButton(type){if(1==type){var usingId=Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)[1]);let item=this.CapArray[0].require_type;this._data=this.CapArray[0];var _id=this._data.id,hasequip=AccountManager.Instance.curplayerData.HasEquip(_id),require_type=item;if(usingId==_id)return this.skinGetForType=SkinGetForType.Using,void this.RefreshButton(this.skinGetForType);if(hasequip)return this.skinGetForType=SkinGetForType.Geted,void this.RefreshButton(this.skinGetForType);if(2==require_type)return this.skinGetForType=SkinGetForType.Bycoin,void this.RefreshButton(this.skinGetForType);if(4==require_type)return this.skinGetForType=SkinGetForType.GetByActivity,void this.RefreshButton(this.skinGetForType);if(3==require_type)return this.skinGetForType=SkinGetForType.GetByVideo,void this.RefreshButton(this.skinGetForType)}else{usingId=Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)[2]);let item=this.HorseArray[0].require_type;this._data=this.HorseArray[0];_id=this._data.id,hasequip=AccountManager.Instance.curplayerData.HasEquip(_id),require_type=item;if(usingId==_id)return this.skinGetForType=SkinGetForType.Using,void this.RefreshButton(this.skinGetForType);if(hasequip)return this.skinGetForType=SkinGetForType.Geted,void this.RefreshButton(this.skinGetForType);if(2==require_type)return this.skinGetForType=SkinGetForType.Bycoin,void this.RefreshButton(this.skinGetForType);if(4==require_type)return this.skinGetForType=SkinGetForType.GetByActivity,void this.RefreshButton(this.skinGetForType);if(3==require_type)return this.skinGetForType=SkinGetForType.GetByVideo,void this.RefreshButton(this.skinGetForType)}}ClickGet(){switch(this.skinGetForType){case SkinGetForType.Bycoin:Number(AccountManager.Instance.curplayerData.GainAccount("money"))<Number(this._data.require_num)?WXSDK.ShowTxt("金币不足--"):this.Buy(),console.log("金币--");break;case SkinGetForType.GetByActivity:WXSDK.ShowTxt("暂未开放!"),console.log("活动获取--");break;case SkinGetForType.GetByVideo:console.log("视频获取--"),this.VideoGet();break;case SkinGetForType.Geted:this.Use()}}ShowUI(_type){if(console.log("所需类型--",_type),_type!=SkinGetForType.Using){this.Using.visible=!1;for(let index=1;index<this.uiArr.length;index++)this.uiArr[index].visible=index==_type;switch(_type){case SkinGetForType.Bycoin:this.RequireCoinNum.text=this._data.require_num.toString();break;case SkinGetForType.GetByVideo:this.RequireVideoNum.text=AccountManager.Instance.curplayerData.GetProgress(this._data.id)+"/"+this._data.require_num.toString()}}else for(let index=0;index<this.uiArr.length;index++)this.uiArr[index].visible=0==index}VideoGet(){GuangGao.Instance.loadVideo(isLoaded=>{isLoaded?GuangGao.Instance.showVideo(isOk=>{if(isOk){WXSDK.AldEvent("皮肤界面看视频得金币成功");var getkey=ArcherWorrior.vd;let param=[{reward_item:"1000"},{reward_num:"200"},{t:AccountManager.Instance.ServerTime.toString()}];ServerManager.Instance.SendHttp(getkey,param,Laya.Handler.create(this,this.VideoGetSuccess),Laya.Handler.create(this,this.VideoGetFail))}}):WXSDK.fengxiangtupian(isOk=>{if(isOk){WXSDK.AldEvent("皮肤界面看视频得金币成功");var getkey=ArcherWorrior.vd;let param=[{reward_item:"1000"},{reward_num:"200"},{t:AccountManager.Instance.ServerTime.toString()}];ServerManager.Instance.SendHttp(getkey,param,Laya.Handler.create(this,this.VideoGetSuccess),Laya.Handler.create(this,this.VideoGetFail))}})})}VideoGetSuccess(_data){this.RefreshItem(),console.log("LookVideo->suc:"+JSON.stringify(_data))}VideoGetFail(_data){console.log("LookVideo->fail:"+JSON.stringify(_data))}Use(){var agrs=[{id:this._data.id}];ServerManager.Instance.SendHttp(ArcherWorrior.WearEquip,agrs,Laya.Handler.create(this,this.UseSuccess),Laya.Handler.create(this,this.UseFail))}UseSuccess(data){this.RefreshItem(),this.RefreshButton(SkinGetForType.Using),WXSDK.ShowTxt("装备成功!"),console.log("装备suc:"+JSON.stringify(data))}UseFail(data){console.log(data)}Buy(){var agrs=[{id:this._data.id.toString()}];ServerManager.Instance.SendHttp(ArcherWorrior.BuyEquip,agrs,Laya.Handler.create(this,this.BuySuccess),Laya.Handler.create(this,this.BuyFail))}BuySuccess(data){WXSDK.AldEvent("购买"+this._data.name+"成功"),this.RefreshItem(),this.RefreshButton(SkinGetForType.Using),console.log("购买suc:"+JSON.stringify(data))}BuyFail(data){console.log("购买fail:"+JSON.stringify(data))}}class ShopScene{constructor(){this.first=!0,this.motordic=new ResDic,ShopScene.ins=this}static get Instance(){return ShopScene.ins?ShopScene.ins:new ShopScene}CreateMoto(_motorindex,_image,trial=null){if(!this._shopscene||this._shopscene.destroyed||null==this._shopscene){this.first=!0,this._shopscene=new Laya.Scene3D,this._camera=new Laya.Camera,trial?(this._camera.transform.position=new Laya.Vector3(0,.7,3),this._camera.clearFlag=2,this._camera.fieldOfView=40):(this._camera.transform.position=new Laya.Vector3(0,.6,3.5),this._camera.clearFlag=2,this._camera.fieldOfView=30),this._shopscene.addChild(this._camera);let _light=new Laya.DirectionLight;_light.intensity=.5,this._shopscene.addChild(_light);var player=GamePool.Instance.GetModel(AssetManager.Instance.Horse.get(_motorindex),"");this._shopscene.addChild(player),_image.addChild(this._shopscene),player.transform.position=new Laya.Vector3(0,0,-2),this._position=new Laya.Vector3(0,.01,0)}_image&&(this._camera.viewport=new Laya.Viewport(_image.x,_image.y,_image.width,_image.height)),this._motor&&(this._motor.active=!1,this._motor.removeSelf(),this._motor=null),this.first&&(this.first=!1,Laya.timer.frameLoop(1,this,this.Rotation,[player]))}Rotation(model){model.transform.rotate(this._position)}CloseShop(){Laya.timer.clear(this,this.Rotation),this._motor&&(this._motor.active=!1,this._motor.removeSelf()),this._player&&(this._player.active=!1,this._player.removeSelf()),this._shopscene&&this._shopscene.destroy(!0),this._shopscene=null,this._motor=null,this._sprite=null,this._player=null,this.first=!0}}class TrialView extends ui.TrialViewUI{constructor(){super()}static get Instance(){return TrialView.ins?TrialView.ins:new TrialView}Show(){WXSDK.AldEvent("打开皮肤试用界面"),GuangGao.OpenBanner(),this.Init(),this.TrialBtn.clickHandler=Laya.Handler.create(this,this.Trial),this.NoTrialBtn.visible=!1,Laya.timer.once(2e3,this,()=>{this.NoTrialBtn.visible=!0,this.NoTrialBtn.clickHandler=Laya.Handler.create(this,this.ClickClose)}),this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height})}Close(){WXSDK.AldEvent("关闭皮肤试用界面")}ClickClose(){var agrs=[{t:AccountManager.Instance.ServerTime.toString()}];ServerManager.Instance.SendHttp(ArcherWorrior.KaiShi,agrs,Laya.Handler.create(this,this.Complete),null)}Trial(){GuangGao.Instance.loadVideo(isLoaded=>{isLoaded?GuangGao.Instance.showVideo(isOk=>{if(isOk){WXSDK.AldEvent("观看视频试用皮肤成功");var agrs=[{t:AccountManager.Instance.ServerTime.toString()}];ServerManager.Instance.SendHttp(ArcherWorrior.KaiShi,agrs,Laya.Handler.create(this,this.Complete),null),GameManager.Instance.SetHorse(this.arr.id)}else{WXSDK.AldEvent("观看视频试用皮肤失败");agrs=[{t:AccountManager.Instance.ServerTime.toString()}];ServerManager.Instance.SendHttp(ArcherWorrior.KaiShi,agrs,Laya.Handler.create(this,this.Complete),null)}}):WXSDK.fengxiangtupian(isOk=>{if(isOk){WXSDK.AldEvent("分享好友试用皮肤成功");var agrs=[{t:AccountManager.Instance.ServerTime.toString()}];ServerManager.Instance.SendHttp(ArcherWorrior.KaiShi,agrs,Laya.Handler.create(this,this.Complete),null),GameManager.Instance.SetHorse(this.arr.id)}else{WXSDK.AldEvent("分享好友试用皮肤失败");agrs=[{t:AccountManager.Instance.ServerTime.toString()}];ServerManager.Instance.SendHttp(ArcherWorrior.KaiShi,agrs,Laya.Handler.create(this,this.Complete),null)}})})}Complete(_data){ShopScene.Instance.CloseShop(),ViewManager.Instance.ShowView(ViewType.IngameView);let stage=AccountManager.Instance.curplayerData.GainAccount("stage");WXSDK.AldStart(stage),AudioManager.playMusic(MusicType.click),MainGameView.Instance.play_id=_data.play_id,EventManager.StageTrigger(StageState.Start),ViewManager.Instance.ShowView(ViewType.IngameView)}Init(){if(this.data=this.GetTryOutTheme(),this.count=this.data.length,1==this.count)this.arr=this.data[0];else{let index=GameTools.RandomANumber(0,this.count);this.arr=this.data[index]}ShopScene.Instance.CreateMoto(this.arr.id,this.SceneViewPort,1)}GetTryOutTheme(){let temp,arr=[],themeCfg=AccountManager.Instance.curplayerData.GainCollocation("theme");if(themeCfg)for(let index=5;index<themeCfg.length;index++){const element=themeCfg[index];let _id=element.id;AccountManager.Instance.curplayerData.HasEquip(_id)||arr.push(element),index==themeCfg.length-2&&(temp=element)}return 0==arr.length&&arr.push(temp),arr}}class CompleteView extends ui.CompleteViewUI{constructor(){super(),this.win=!0}static get Instance(){return CompleteView.ins?CompleteView.ins:new CompleteView}Show(_data){this.Init(_data),GuangGao.WudaoAnNiu(this.BtnBox);let gold=this.DealData(GameManager.Instance.KillNum);this.goldnum.text=Math.floor(gold).toString(),this.SetData(),this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height})}Close(){}Init(_data){switch(_data){case 1:WXSDK.AldEvent("打开胜利界面"),this.loseimage.visible=!1,this.reviveimage.visible=!1,this.NoBtn.visible=!1,this.TryAgainBtn.visible=!1,this.ReviveBtn.visible=!1,this.NextLevelBtn.clickHandler=Laya.Handler.create(this,this.NextLevel,[!0]);break;case 2:WXSDK.AldEvent("打开失败界面"),this.winimage.visible=!1,this.reviveimage.visible=!1,this.NoBtn.visible=!1,this.NextLevelBtn.visible=!1,this.ReviveBtn.visible=!1,this.TryAgainBtn.clickHandler=Laya.Handler.create(this,this.TryAgain,[!1]);break;case 3:WXSDK.AldEvent("打开结算界面"),this.winimage.visible=!1,this.loseimage.visible=!1,this.NextLevelBtn.visible=!1,this.TryAgainBtn.visible=!1,this.NoBtn.clickHandler=Laya.Handler.create(this,this.NoRevive),this.ReviveBtn.clickHandler=Laya.Handler.create(this,this.Revive)}}NextLevel(_win){let stage=AccountManager.Instance.curplayerData.GainAccount("stage");WXSDK.AldEnd(stage,!0),AudioManager.playMusic(MusicType.click),this.win=_win;var iswin=_win?"1":"0",coinnum=this.goldnum.text,args=[{t:AccountManager.Instance.ServerTime.toString()},{play_id:MainGameView.Instance.play_id},{win:iswin},{money:coinnum}];ServerManager.Instance.SendHttp(ArcherWorrior.JieShu,args,Laya.Handler.create(this,this.Success),null)}Revive(){AudioManager.playMusic(MusicType.click),GuangGao.Instance.loadVideo(isLoaded=>{isLoaded?GuangGao.Instance.showVideo(isOk=>{isOk&&(WXSDK.AldEvent("观看视频复活成功"),GameManager.Instance.ReviveNum-=1,GameManager.Instance.Revive())}):WXSDK.fengxiangtupian(isOk=>{isOk?(WXSDK.AldEvent("分享复活成功"),GameManager.Instance.ReviveNum-=1,GameManager.Instance.Revive()):EventManager.StageTrigger(StageState.Lose)})})}NoRevive(){GameManager.Instance.ReviveNum-=1,ViewManager.Instance.ShowView(ViewType.CompleteView,2)}TryAgain(_win){let stage=AccountManager.Instance.curplayerData.GainAccount("stage");WXSDK.AldEnd(stage,!1),AudioManager.playMusic(MusicType.click),this.win=_win;var iswin=_win?"1":"0",coinnum=this.goldnum.text,args=[{t:AccountManager.Instance.ServerTime.toString()},{play_id:MainGameView.Instance.play_id},{win:iswin},{money:coinnum}];ServerManager.Instance.SendHttp(ArcherWorrior.JieShu,args,Laya.Handler.create(this,this.Success),null)}Success(){EventManager.StageTrigger(StageState.Restart),ViewManager.Instance.OpenPopView(ViewType.ExportView)}DealData(_num){return _num>StageControl.Instance.curstage.Goal&&(_num=StageControl.Instance.curstage.Goal),AccountManager.Instance.curplayerData.GlobalData("mission_reward")*StageControl.Instance.curstage.Modulus*(_num/StageControl.Instance.curstage.Goal)}SetData(){SDKZS.SetHuTuiList(this.PushList,1,""),this.GunGun()}GunGun(){var maxBtm;try{this.PushList.scrollBar.value=0,maxBtm=this.PushList.scrollBar.max}catch(error){return void console.error(error)}let tempBtm=1;Laya.timer.frameLoop(1,this,()=>{this.PushList.scrollBar.value+=tempBtm,(this.PushList.scrollBar.value>=maxBtm||this.PushList.scrollBar.value<=0)&&(tempBtm=-tempBtm)})}}class ExportView extends ui.ExportViewUI{OnOpen(data){WXSDK.AldEvent("打开全屏幕导出界面"),this.CloseExportBtn.clickHandler=Laya.Handler.create(this,this.ClickClose,[data]),this.SetData(),this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height})}OnHide(){Laya.timer.clearAll(this),WXSDK.AldEvent("关闭全屏导出界面")}ClickClose(data){ViewManager.Instance.ClosePopView(ViewType.ExportView)}SetData(){SDKZS.SetHuTuiList(this.HList,2,""),SDKZS.SetHuTuiList(this.VList,1,""),this.GunGun()}GunGun(){var maxTop,maxBtm;try{this.VList.scrollBar.value=0,this.HList.scrollBar.value=0,maxTop=this.HList.scrollBar.max,maxBtm=this.VList.scrollBar.max}catch(error){return void console.error(error)}var tempTop=1,tempBtm=1;Laya.timer.frameLoop(1,this,()=>{this.HList.scrollBar.value+=tempTop,(this.HList.scrollBar.value>=maxTop||this.HList.scrollBar.value<=0)&&(tempTop=-tempTop),this.VList.scrollBar.value+=tempBtm,(this.VList.scrollBar.value>=maxBtm||this.VList.scrollBar.value<=0)&&(tempBtm=-tempBtm)})}}!function(ViewType){ViewType[ViewType.MainView=0]="MainView",ViewType[ViewType.IngameView=1]="IngameView",ViewType[ViewType.ShopView=2]="ShopView",ViewType[ViewType.TrialView=3]="TrialView",ViewType[ViewType.CompleteView=4]="CompleteView",ViewType[ViewType.ExportView=5]="ExportView"}(ViewType||(ViewType={}));class ViewManager{constructor(){this.showexportview=0,this.popViewDic=[],this.ViewSprite=new Laya.Sprite,this.OtherViewSprite=new Laya.Sprite,ViewManager.ins=this,Laya.stage.addChild(this.ViewSprite),Laya.stage.addChild(this.OtherViewSprite)}static get Instance(){return ViewManager.ins?ViewManager.ins:new ViewManager}ShowView(_viewtype,data=null){null!=this.curView&&(this.curView.Close(),this.curView.destroy(),this.curView.removeSelf()),GuangGao.Clear(),this.curView=this.CreateView(_viewtype),this.curView.name=ViewType[_viewtype],this.ViewSprite.addChild(this.curView),this.curView.Show(data)}CloseView(){null!=this.curView&&(this.curView.Close(),this.curView.destroy(),this.curView.removeSelf())}OpenPopView(viewType,data=null){var popView;GuangGao.Clear(),this.popViewDic[viewType]?(popView=this.popViewDic[viewType],this.OtherViewSprite.setChildIndex(popView,this.OtherViewSprite.numChildren-1),popView.visible=!0):(popView=this.CreateView(viewType),this.OtherViewSprite.addChild(popView),this.popViewDic[viewType]=popView),this.showexportview=1,popView.OnOpen(data)}ClosePopView(viewType){var popView=this.popViewDic[viewType];null!=popView&&(GuangGao.Clear(),popView.OnHide(),popView.visible=!1,this.showexportview=0)}ClearPopViews(){GuangGao.Clear()}CreateView(_viewtype){switch(_viewtype){case ViewType.MainView:return new MainGameView;case ViewType.IngameView:return new InGameView;case ViewType.TrialView:return new TrialView;case ViewType.CompleteView:return new CompleteView;case ViewType.ExportView:return new ExportView;case ViewType.ShopView:return new ShopView}return null}}class SDKZS{static SetHuTuiList(list,scrol=1,type=""){console.log("互推数据--",SDKZS.data),console.log("互推数据准备状态---",SDKZS.isReady);let arr=SDKZS.data.promotion;arr&&0!=arr.length&&(list.selectEnable=!1,1==scrol?list.vScrollBarSkin="":list.hScrollBarSkin="",list.renderHandler=Laya.Handler.create(this,SDKZS.updateItem,[type],!1),list.array=arr,list.refresh())}static updateItem(type,cell,index){cell.getComponent(ListItem).Refresh(type)}static loadData(){zs.sdk.loadAd(res=>{console.log("[LOG]互推数据"),console.log(res),SDKZS.data=res,console.log("拉取互推数据--",SDKZS.data),SDKZS.isReady=!0})}static navigate2Mini(data){zs.sdk.navigate2Mini(data,AccountManager.Instance.curplayerData.openid,()=>{WXSDK.AldEvent("成功跳转到"+data.app_title)},()=>{WXSDK.AldEvent("跳转"+data.app_title+"失败"),0==ViewManager.Instance.showexportview&&ViewManager.Instance.OpenPopView(ViewType.ExportView)},()=>{})}static get CanCheat(){return 0==AccountManager.Instance.curplayerData.CheckScene||("1037"==Main.SceneNum||"1058"==Main.SceneNum||"1067"==Main.SceneNum||"1095"==Main.SceneNum)}}SDKZS.isReady=!1;class ListItem extends Laya.Script{constructor(){super()}onAwake(){this.self=this.owner,this.icon=this.self.getChildByName("icon"),this.btn=this.self.getChildByName("btn"),this.name=this.self.getChildByName("name"),this._tip=this.self.getChildByName("tip"),this.bottom=this.self.getChildByName("bottom"),this.remen=this.self.getChildByName("remen"),this.diandian=this.icon.getChildAt(0),this.btn.clickHandler=new Laya.Handler(this,this.clickAd)}Refresh(type){if(this.data=this.self.dataSource,this.type=type,this.name&&(this.name.text=this.data.app_title),this._tip){this._tip.visible=!0;let rnd=GameTools.RandomANumber(1,2e5),text=rnd.toString()+"人玩过";rnd>9999&&(text=Math.floor(rnd/1e4)+"W人玩过"),this._tip.text=text}if(this.diandian&&(this.diandian.visible=!1),this.bottom){let num=GameTools.RandomANumber(1,10);this.bottom.skin="Game/res/bottom/"+num+".png"}this.remen&&(this.remen.visible=Math.random()<.2),this.icon.skin=this.data.app_icon}clickAd(){SDKZS.navigate2Mini(this.data)}onDestroy(){this.btn.clickHandler=null}}class GameConfig{constructor(){}static init(){var reg=Laya.ClassUtils.regClass;reg("Tools/ListItem.ts",ListItem),reg("Tools/ShopItem.ts",ShopItem)}}GameConfig.width=720,GameConfig.height=1280,GameConfig.scaleMode="fixedwidth",GameConfig.screenMode="none",GameConfig.alignV="top",GameConfig.alignH="left",GameConfig.startScene="LoadView.scene",GameConfig.sceneRoot="",GameConfig.debug=!1,GameConfig.stat=!1,GameConfig.physicsDebug=!1,GameConfig.exportSceneToJson=!0,GameConfig.init();class Main{constructor(){if(!CheckMain.Creat){if(CheckMain.Creat=!0,window.Laya3D?Laya3D.init(GameConfig.width,GameConfig.height):Laya.init(GameConfig.width,GameConfig.height,Laya.WebGL),Laya.Physics&&Laya.Physics.enable(),Laya.DebugPanel&&Laya.DebugPanel.enable(),Laya.stage.scaleMode=GameConfig.scaleMode,Laya.stage.screenMode=GameConfig.screenMode,Laya.stage.alignV=GameConfig.alignV,Laya.stage.alignH=GameConfig.alignH,Laya.URL.exportSceneToJson=GameConfig.exportSceneToJson,(GameConfig.debug||"true"==Laya.Utils.getQueryString("debug"))&&Laya.enableDebugPanel(),GameConfig.physicsDebug&&Laya.PhysicsDebugDraw&&Laya.PhysicsDebugDraw.enable(),GameConfig.stat&&Laya.Stat.show(),Laya.alertGlobalError=!0,Laya.Browser.onWeiXin){if(Laya.Browser.window.wx.showShareMenu({withShareTicket:!0}),Laya.Browser.window.wx.onShareAppMessage(function(){return{title:"有人@你,一起骑马仗箭走天涯",imageUrl:"Game/res/textrue/share.jpg"}}),Laya.Browser.window.wx.onShow(option=>{option.shareTicket,option.query.userId,option.query.shareTitle;var scenevalue=Laya.LocalStorage.getItem("SceneValue");scenevalue?Main.SceneNum=scenevalue:(Laya.LocalStorage.setItem("SceneValue",option.scene),Main.SceneNum=option.scene),WXSDK.querychannel=option.query.channel,WXSDK.shareOpenId=option.query.userId,console.log("scene:",option.scene),null!=WXSDK.querychannel&&console.log("onShow channel is:",WXSDK.querychannel),option.referrerInfo&&(WXSDK.referrerInfoappId=option.referrerInfo.appId,console.log("onShow appId is:",option.referrerInfo.appId))}),!Laya.Browser.onWeiXin)return;const updateManager=Laya.Browser.window.wx.getUpdateManager();updateManager.onCheckForUpdate(function(res){console.log("最新版本:"+res.hasUpdate)}),updateManager.onUpdateReady(function(){Laya.Browser.window.wx.showModal({showCancel:!1,title:"更新提示",content:"新版本已经准备好,是否重启应用?",success(res){updateManager.applyUpdate()},fail(res){updateManager.applyUpdate()}})})}Laya.ResourceVersion.enable("version.json",Laya.Handler.create(this,this.onVersionLoaded),Laya.ResourceVersion.FILENAME_VERSION)}}onVersionLoaded(){Laya.AtlasInfoManager.enable("fileconfig.json",Laya.Handler.create(this,this.onConfigLoaded))}onConfigLoaded(){new LoadView}}Main.Ver="1.0.0",Main.CFG="123",new Main;var HttpRequest=Laya.HttpRequest,Event=Laya.Event;const ArcherWorriorApiUrl="https://archerworriorapi.xwxgame.com/";class ArcherWorrior{}ArcherWorrior.DengLu="user/login",ArcherWorrior.KaiShi="game/start",ArcherWorrior.JieShu="game/play",ArcherWorrior.QianDao="sign/sign",ArcherWorrior.Chengjiu="achievement/getRewards",ArcherWorrior.Config="config/table",ArcherWorrior.FenXiang="fission/share",ArcherWorrior.LiXian="fission/offline",ArcherWorrior.vd="fission/vd",ArcherWorrior.FuHuo="game/revival",ArcherWorrior.gadagdag="treasure/click",ArcherWorrior.Invite="invite/getRewards",ArcherWorrior.Lottery="lottery/lottery",ArcherWorrior.ShareGetSkin="theme/fission",ArcherWorrior.WearEquip="theme/equip",ArcherWorrior.BuyEquip="theme/buy",ArcherWorrior.ShouQuan="user/auth",ArcherWorrior.JinBi="user/sync";class ServerManager{constructor(){}static get Instance(){return ServerManager.ins?ServerManager.ins:new ServerManager}Login(progresscb,completecb,errorcb){var Account=AccountManager.Instance,ver=Main.Ver;let Data=`code=${Account.code}&nickname=${Account.nickName}&avatar=${Account.avatarUrl}&gender=${Account.gender}&country=${Account.country}&province=${Account.province}&city=${Account.city}& device=${Account.device}$&share_id=${Account.share_id}&scene=${Account.scene}&v=${ver}`,httpRequest=new HttpRequest;httpRequest.once(Event.PROGRESS,this,this.Progress,[progresscb,httpRequest]),httpRequest.once(Event.COMPLETE,this,this.Complete,[completecb,httpRequest]),httpRequest.once(Event.ERROR,this,this.Errorcb,[errorcb,httpRequest]),httpRequest.send(ArcherWorriorApiUrl+ArcherWorrior.DengLu,Data,"post","text")}Progress(_progresscb,_httpreq){_progresscb&&_progresscb.run()}Complete(_completecb,_httpreq){let data=JSON.parse(_httpreq.data);console.log(data),"0"==data.code?(console.log("-----------sss",data.t),AccountManager.Instance.SFSFSF=data.t,this.RessetConfig(data,_completecb)):console.log("登录异常错误!错误信息sssssssss:",_httpreq.data.code)}RessetConfig(data,completecb){AccountManager.Instance.ReSetting(data,flag=>{flag?completecb.runWith(data):this.RessetConfig(data,completecb)})}Errorcb(_errorcb,_httpreq){null!=_errorcb&&_errorcb.runWith(_httpreq)}SendHttp(protocol,param,completecb,errorcb,hasToken=!0){let sfaasfsfa="",daadsads=ArcherWorriorApiUrl+protocol;if(1==hasToken&&(sfaasfsfa=`token=${AccountManager.Instance.curplayerData.zhengshu}&`),protocol==ArcherWorrior.KaiShi||protocol==ArcherWorrior.JieShu||protocol==ArcherWorrior.vd||protocol==ArcherWorrior.Lottery){let asddsa="abcdefghijkimnopqrstuvwxyz0123456789",adsassda="{",saafsafs="";for(let i=0;i<4;i++)saafsafs+=asddsa[Math.floor(100*Math.random())%asddsa.length];for(let i=0;i<param.length;i++){for(let key in param[i])adsassda+=`"${key}":"${param[i][key]}"`;i<param.length-1?adsassda+=",":adsassda+="}"}sfaasfsfa+="_r="+saafsafs+this.SFGSGSG(adsassda)}else if(null!=param)for(let i=0;i<param.length;i++)for(let key in param[i]){sfaasfsfa+=`${key}=${param[i][key]}`,i<param.length-1&&(sfaasfsfa+="&")}let httpRequest=new HttpRequest;httpRequest.once(Event.COMPLETE,this,this.onHttpRequestComplete,[completecb,errorcb,httpRequest]),httpRequest.once(Event.ERROR,this,this.Errorcb,[errorcb,httpRequest]),httpRequest.send(daadsads,sfaasfsfa,"post","text")}onHttpRequestComplete(succeedcb,failurecb,httpRequest){let data=JSON.parse(httpRequest.data);0==data.code?(AccountManager.Instance.ReSetting(data),null!=succeedcb&&succeedcb.runWith(data)):(null!=failurecb&&failurecb.runWith(data),console.log("Error! Http request complete error, code: "+data.code+" message: "+data.message))}SFGSGSG(str){for(var c1,c2,c3,SFSFFSFSFSFS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=str.length,SFFSSFFS="";i<len;){if(c1=255&str.charCodeAt(i++),i==len){SFFSSFFS+=SFSFFSFSFSFS.charAt(c1>>2),SFFSSFFS+=SFSFFSFSFSFS.charAt((3&c1)<<4),SFFSSFFS+="==";break}if(c2=str.charCodeAt(i++),i==len){SFFSSFFS+=SFSFFSFSFSFS.charAt(c1>>2),SFFSSFFS+=SFSFFSFSFSFS.charAt((3&c1)<<4|(240&c2)>>4),SFFSSFFS+=SFSFFSFSFSFS.charAt((15&c2)<<2),SFFSSFFS+="=";break}c3=str.charCodeAt(i++),SFFSSFFS+=SFSFFSFSFSFS.charAt(c1>>2),SFFSSFFS+=SFSFFSFSFSFS.charAt((3&c1)<<4|(240&c2)>>4),SFFSSFFS+=SFSFFSFSFSFS.charAt((15&c2)<<2|(192&c3)>>6),SFFSSFFS+=SFSFFSFSFSFS.charAt(63&c3)}return SFFSSFFS}}class AccountManager{constructor(_code,_userinfo,_nickname,_avatarurl,_gender,_province,_city,_country,_device,_shareid,_scene,_v){this.createTime=Laya.timer.currTimer,AccountManager.ins=this,this.code=_code,this.userInfo=_userinfo,this.nickName=_nickname,this.avatarUrl=_avatarurl,this.gender=_gender,this.province=_province,this.city=_city,this.country=_country,this.device=_device,this.share_id=_shareid,this.scene=_scene,this.v=_v}static get Instance(){return null==AccountManager.ins&&new AccountManager("222222","你找谁?","1233","123",1,"中国","上海","上海","iphone6s","123","123","123"),AccountManager.ins}ReSetting(data,cb=null){var zhengshu=data.token,netset=data.app_setting,user=data.user,jichu=data.user_base,qiandao=data.user_sign,chengjiu=data.user_achievement,invite=data.user_invite,lottery=data.user_lottery;null==this.curplayerData?(this.curplayerData=new PlayerData(zhengshu,null,netset,user,jichu,invite,null,qiandao,chengjiu,lottery),this.JundgCfg(data.table_version,cb)):(netset&&(this.curplayerData.netzheshe=netset),user&&(this.curplayerData.account=user),jichu&&(this.curplayerData.accountssss=jichu),qiandao&&(this.curplayerData.qiandao=qiandao),chengjiu&&(this.curplayerData.renwu=chengjiu))}JundgCfg(ver,callball){var cfg=Laya.LocalStorage.getJSON(Main.CFG);cfg?cfg.VER==ver?(console.log("已经拥有,不用更新"),this.SetCfg(cfg),callball&&callball(!0)):(console.log("cfg存在但是过期了"),Laya.LocalStorage.removeItem(Main.CFG),ServerManager.Instance.SendHttp(ArcherWorrior.Config,null,Laya.Handler.create(this,data=>{data.configs.VER=ver,Laya.LocalStorage.setJSON(Main.CFG,data.configs),this.SetCfg(data.configs),callball&&callball(!0)}),Laya.Handler.create(this,data=>{console.log("配置获取失败"+data),callball&&callball(!1)}))):(console.log("本地没有cfg"),ServerManager.Instance.SendHttp(ArcherWorrior.Config,null,Laya.Handler.create(this,data=>{data.configs.VER=ver,Laya.LocalStorage.setJSON(Main.CFG,data.configs),this.SetCfg(data.configs),callball&&callball(!0)}),Laya.Handler.create(this,data=>{console.log("配置获取失败"+data)})))}SetCfg(data){this.curplayerData.peizhis=data}RessetConfig(){ServerManager.Instance.SendHttp(ArcherWorrior.Config,null,Laya.Handler.create(this,data=>{this.curplayerData.peizhis=data.configs}),null)}get ServerTime(){let time=Laya.timer.currTimer;return this.SFSFSF+Math.ceil((time-this.createTime)/1e3)}}var NpcState,Vector3$4=Laya.Vector3;!function(NpcState){NpcState[NpcState.Attack=0]="Attack",NpcState[NpcState.Idle=1]="Idle",NpcState[NpcState.Win=2]="Win",NpcState[NpcState.Pursue=3]="Pursue",NpcState[NpcState.Run=4]="Run",NpcState[NpcState.Die=5]="Die"}(NpcState||(NpcState={}));class NpcRunner extends Laya.Script{constructor(){super(),this.m_distance=20,this.m_distanceatk=5,this.DIE=!1,this.m_npcspeed=0,this.atked=!1,this.wined=!1,this.begin=!1,this.frontdie=!1,this.reardie=!1,this.canmove=!1,this.dir=new Vector3$4,this.currotV=new Vector3$4,this.currot=new Laya.Quaternion,this.CurrectRotate=new Laya.Quaternion,this.curspeed=0,this.offest=new Vector3$4,this.curpos=new Vector3$4,this.die=!1,NpcRunner.ins=this,EventManager.StageOn(StageState.Start,this,this.Begin),EventManager.StageOn(StageState.Lose,this,this.GameOver),EventManager.StageOn(StageState.Win,this,this.GameOver),EventManager.StageOn(StageState.Press,this,this.AddSpeed),EventManager.StageOn(StageState.UnPress,this,this.SlowSpeed)}static get Instance(){return NpcRunner.ins?NpcRunner.ins:new NpcRunner}onAwake(){this.m_npcmodel=this.owner,this.m_npcanimator=this.owner.getComponent(Laya.Animator),this.player=PlayerControl.Instance.Player,this.m_distance=1.65*AccountManager.Instance.curplayerData.NpcRunDistance,this.m_distanceatk=1.65*AccountManager.Instance.curplayerData.NpcAtkDistance;let stage=Number(AccountManager.Instance.curplayerData.GainAccount("stage"));this.m_npcspeed=1==stage?.1:StageControl.Instance.curstage.npcspeed}Begin(){this.ChangeState(NpcState.Idle),this.begin=!0}onUpdate(){if(!this.begin)return;if(this.npc_state==NpcState.Die)return;if(this.frontdie||this.reardie)return void this.ChangeState(NpcState.Die);let stage=Number(AccountManager.Instance.curplayerData.GainAccount("stage"));var distance=Vector3$4.distance(this.player.transform.position,this.m_npcmodel.transform.position);distance<this.m_distance&&distance>this.m_distanceatk&&!this.atked&&stage>2?(Vector3$4.subtract(this.player.transform.position,this.m_npcmodel.transform.position,this.currotV),Vector3$4.normalize(this.currotV,this.currotV),this.m_npcmodel.transform.lookAt(new Vector3$4(this.m_npcmodel.transform.position.x-this.currotV.x,this.m_npcmodel.transform.position.y,this.m_npcmodel.transform.position.z-this.currotV.z),new Vector3$4(0,1,0)),this.NPCMoveDir=this.currotV,this.canmove=!0,this.ChangeState(NpcState.Run)):distance<=this.m_distanceatk&&!this.atked&&stage>2&&(Vector3$4.subtract(this.player.transform.position,this.m_npcmodel.transform.position,this.currotV),Vector3$4.normalize(this.currotV,this.currotV),this.m_npcmodel.transform.lookAt(new Vector3$4(this.m_npcmodel.transform.position.x-this.currotV.x,this.m_npcmodel.transform.position.y,this.m_npcmodel.transform.position.z-this.currotV.z),new Vector3$4(0,1,0)),this.NPCMoveDir=this.currotV,this.atked=!0,this.ChangeState(NpcState.Attack)),this.Move(this.NPCMoveDir,this.m_npcspeed),this.RayCheck()}Move(_dir,_speed){if(this.canmove){var sp=GameTools.Instance.lerp(this.curspeed,_speed,.1);this.curspeed=sp,Vector3$4.scale(_dir,this.curspeed,this.offest),Vector3$4.add(this.m_npcmodel.transform.position,this.offest,this.curpos),Vector3$4.lerp(this.m_npcmodel.transform.position,this.curpos,.15,this.curpos),this.curpos=new Vector3$4(this.curpos.x,this.curpos.y,this.curpos.z),this.m_npcmodel.transform.position=this.curpos}}AddSpeed(){this.m_npcspeed=StageControl.Instance.curstage.npcspeed}SlowSpeed(){this.m_npcspeed=StageControl.Instance.curstage.npcspeed/2}GameOver(){EventManager.StageOff(StageState.Press,this,this.AddSpeed),EventManager.StageOff(StageState.UnPress,this,this.SlowSpeed),EventManager.StageOff(StageState.Start,this,this.Begin)}ChangeState(_state){if(this.npc_state!=_state)switch(this.npc_state=_state,this.npc_state){case NpcState.Attack:this.Attack();break;case NpcState.Pursue:this.Pursue();break;case NpcState.Win:this.Win();break;case NpcState.Idle:this.Idle();break;case NpcState.Run:this.Run();break;case NpcState.Die:this.Die()}}Idle(){this.m_npcanimator.play("idle")}Attack(){this.m_npcanimator.play("atk"),Laya.timer.once(500,this,()=>{this.canmove=!1})}Win(){this.m_npcanimator.play("win")}Pursue(){}Run(){this.m_npcanimator.play("run")}Die(){this.die||(this.die=!0,AudioManager.playMusic(MusicType.die),this.PiaoZi(),EventManager.StageOff(StageState.Start,this,this.Begin),Laya.timer.once(500,this,()=>{GamePool.Instance.RecoveryModel(this.m_npcmodel)}),this.frontdie?this.m_npcanimator.play("diefront"):this.reardie&&this.m_npcanimator.play("dierear"),this.canmove=!1)}PiaoZi(){let headshoot=new Laya.Image;headshoot.skin="Game/res/textrue/headshoot.png",headshoot.scaleX=.5,headshoot.scaleY=.5,headshoot.anchorX=.5,headshoot.anchorY=.5,Laya.stage.addChild(headshoot),Laya.timer.once(1e3,this,()=>{headshoot.visible=!1}),GameManager.Instance.UIArray.push(headshoot);let UIPos=this.m_npcmodel.getChildByName("UIPos"),screenpos1=new Vector3$4;Laya.timer.frameLoop(1,this,this.UIFollow,[UIPos,headshoot,screenpos1])}UIFollow(UIPos,UI,POS){AssetManager.Instance.maincamera.worldToViewportPoint(UIPos.transform.position,POS),UI.pos(POS.x,POS.y)}RayCheck(){if(this.wined)return;let startpos=new Vector3$4(this.m_npcmodel.transform.position.x,this.m_npcmodel.transform.position.y+1.5,this.m_npcmodel.transform.position.z),dir=Transform3DHelper.getForward(this.m_npcmodel.transform),ray=new Laya.Ray(startpos,dir),hitres=new Laya.HitResult;if(AssetManager.Instance.mainscene.physicsSimulation.rayCast(ray,hitres,1,200)){let target=hitres.collider.owner.parent;if("player"==target.name){let runner=target.getComponent(Runner);target.getComponent(Laya.Animator);runner.Invincible||Laya.timer.once(150,this,()=>{runner.isdead=!0,this.wined=!0})}else"bonfire"==target.name?(this.ChangeState(NpcState.Die),this.wined=!0):"stone"==target.name||target.name}}}var HostageState,Vector3$5=Laya.Vector3;!function(HostageState){HostageState[HostageState.Run=0]="Run",HostageState[HostageState.Rescue=1]="Rescue",HostageState[HostageState.Arrest=2]="Arrest",HostageState[HostageState.Die=3]="Die"}(HostageState||(HostageState={}));class Hostage extends Laya.Script{constructor(){super(),this._hostagespeed=0,this.begin=!1,this.isbarrier=!1,this.canmove=!1,this.isdead=!1,this.DownHit=new Laya.HitResult,this.FowardHit=new Laya.HitResult,this.currotV=new Vector3$5,this.hostagedir=new Vector3$5,this.offest=new Vector3$5,this.curpos=new Vector3$5,this.curspeed=0,Hostage.ins=this,EventManager.StageOn(StageState.Start,this,this.Begin),EventManager.StageOn(StageState.Lose,this,this.GameOver),EventManager.StageOn(StageState.Win,this,this.GameOver),EventManager.StageOn(StageState.Press,this,this.AddSpeed),EventManager.StageOn(StageState.UnPress,this,this.SlowSpeed)}static get Instance(){return Hostage.ins?Hostage.ins:new Hostage}onAwake(){this.m_hostagemodel=this.owner,this.m_hostageanimator=this.m_hostagemodel.getComponent(Laya.Animator),this.enemy=this.owner.parent.parent.getChildByName("enemy").getChildAt(0),this._hostagespeed=StageControl.Instance.curstage.hostspeed}Begin(){this.ChangeState(HostageState.Run),this.begin=!0}onUpdate(){if(!this.begin)return;if(this.isdead)return void this.ChangeState(HostageState.Die);if(this.enemy.getComponent(ChaseNpc).isdead||null==this.enemy||this.enemy.destroyed)return this.canmove=!1,void this.ChangeState(HostageState.Rescue);this.RayCheck();let target=this.LookforRoad();this.canmove&&(target?(Vector3$5.subtract(target.transform.position,this.m_hostagemodel.transform.position,this.currotV),Vector3$5.normalize(this.currotV,this.currotV),this.m_hostagemodel.transform.lookAt(new Vector3$5(this.m_hostagemodel.transform.position.x-this.currotV.x,this.m_hostagemodel.transform.position.y,this.m_hostagemodel.transform.position.z-this.currotV.z),new Vector3$5(0,1,0)),this.hostagedir=this.currotV,this.isbarrier||this.Move(this.currotV,this._hostagespeed)):this.isbarrier||this.Move(new Vector3$5(0,0,1),this._hostagespeed))}LookforRoad(){var doorarr=[];for(let i=0;i<DataManager.DoorArray.length;i++){let _door=DataManager.DoorArray[i];this.m_hostagemodel.transform.position.z<_door.transform.position.z&&doorarr.push(_door)}for(let i=0;i<doorarr.length;i++)for(let j=0;j<doorarr.length-i-1;j++){if(Vector3$5.distance(doorarr[i].transform.position,this.m_hostagemodel.transform.position)>Vector3$5.distance(doorarr[i+1].transform.position,this.m_hostagemodel.transform.position)){let door1=doorarr[i];doorarr[i]=doorarr[i+1],doorarr[i+1]=door1}}return doorarr[0]}Move(_dir,_speed){if(1!=Number(AccountManager.Instance.curplayerData.GainAccount("stage"))&&this.canmove){var sp=GameTools.Instance.lerp(this.curspeed,_speed,.1);this.curspeed=sp,Vector3$5.scale(_dir,this.curspeed,this.offest),Vector3$5.add(this.m_hostagemodel.transform.position,this.offest,this.curpos),Vector3$5.lerp(this.m_hostagemodel.transform.position,this.curpos,.15,this.curpos),this.curpos=new Vector3$5(this.curpos.x,this.curpos.y,this.curpos.z),this.m_hostagemodel.transform.position=this.curpos}}AddSpeed(){this._hostagespeed=StageControl.Instance.curstage.hostspeed}SlowSpeed(){this._hostagespeed=StageControl.Instance.curstage.hostspeed/2}GameOver(){EventManager.StageOff(StageState.Press,this,this.AddSpeed),EventManager.StageOff(StageState.UnPress,this,this.SlowSpeed),EventManager.StageOff(StageState.Start,this,this.Begin),Laya.timer.clearAll(this),this.canmove=!1}ChangeState(_state){if(this.m_hostagestate!=_state)switch(this.m_hostagestate=_state,this.m_hostagestate){case HostageState.Run:this.Run();break;case HostageState.Arrest:this.Arrest();break;case HostageState.Rescue:this.Rescue();break;case HostageState.Die:this.Die()}}Run(){this.m_hostageanimator.play("run")}Rescue(){this.m_hostageanimator.play("thank"),this.PiaoZi()}Arrest(){this.m_hostageanimator.play("dierear"),this.canmove=!1}Die(){WXSDK.Shake(!0),this.m_hostageanimator.play("dierear"),this.canmove=!1,EventManager.StageOff(StageState.Start,this,this.Begin),Laya.timer.clearAll(this),EventManager.StageTrigger(StageState.Lose)}RayCheck(){this.FowardRayCheck?(this.CrashBarrier(),this.isbarrier=!0):this.isbarrier=!1}PiaoZi(){let smile=new Laya.Image;smile.skin="Game/res/textrue/happy.png",smile.scaleX=.05,smile.scaleY=.05,smile.anchorX=.5,smile.anchorY=.5,Laya.stage.addChild(smile),Laya.timer.once(1e3,this,()=>{smile.visible=!1,Laya.timer.clear(this,this.UIFollow)}),GameManager.Instance.UIArray.push(smile);let UIPos=this.m_hostagemodel.getChildByName("UIPos"),screenpos=new Vector3$5;Laya.timer.frameLoop(1,this,this.UIFollow,[UIPos,smile,screenpos])}UIFollow(UIPos,UI,POS){AssetManager.Instance.maincamera.worldToViewportPoint(UIPos.transform.position,POS),UI.pos(POS.x,POS.y)}CrashBarrier(){var target=this.FowardHit.collider.owner.parent;"stone"==target.name?this._hostagespeed=0:"bonfire"==target.name||("big_fence"==target.name?this._hostagespeed=0:"wood_Cylinder"==target.name&&(this._hostagespeed=0))}get FowardRayCheck(){var isFowardHit=!1,startPos=new Vector3$5(this.m_hostagemodel.transform.position.x,this.m_hostagemodel.transform.position.y+1,this.m_hostagemodel.transform.position.z+.5),direction=new Vector3$5(0,0,1),DownRay=new Laya.Ray(startPos,direction);return AssetManager.Instance.mainscene.physicsSimulation.rayCast(DownRay,this.FowardHit,1)&&100==this.FowardHit.collider.collisionGroup&&(isFowardHit=!0),isFowardHit}}var ChaseNpcState,Vector3$6=Laya.Vector3;!function(ChaseNpcState){ChaseNpcState[ChaseNpcState.Idle=0]="Idle",ChaseNpcState[ChaseNpcState.Run=1]="Run",ChaseNpcState[ChaseNpcState.Die=2]="Die",ChaseNpcState[ChaseNpcState.Atk=3]="Atk"}(ChaseNpcState||(ChaseNpcState={}));class ChaseNpc extends Laya.Script{constructor(){super(),this.frontdie=!1,this.reardie=!1,this.canmove=!1,this.isdead=!1,this.atked=!1,this.begin=!1,this.m_chasenpcspeed=0,this.pursuediatance=0,this.atkdistance=10,this.NPCRushSpeed=0,this.Distance=0,this.ChaseDistance=0,this.NpcStartPos=new Vector3$6,this.dir=new Vector3$6,this.currotV=new Vector3$6,this.currot=new Laya.Quaternion,this.CurrectRotate=new Laya.Quaternion,this.curspeed=0,this.offest=new Vector3$6,this.curpos=new Vector3$6,this.die=!1,ChaseNpc.ins=this,EventManager.StageOn(StageState.Start,this,this.Begin),EventManager.StageOn(StageState.Lose,this,this.GameOver),EventManager.StageOn(StageState.Win,this,this.GameOver),EventManager.StageOn(StageState.Press,this,this.AddSpeed),EventManager.StageOn(StageState.UnPress,this,this.SlowSpeed)}static get Instance(){return ChaseNpc.ins?ChaseNpc.ins:new ChaseNpc}onAwake(){this.m_chasenpcmodel=this.owner}onStart(){this.m_chasenpcanimator=this.m_chasenpcmodel.getComponent(Laya.Animator),this.m_hostage=this.owner.parent.parent.getChildByName("player").getChildAt(0),this.NpcStartPos=this.m_chasenpcmodel.transform.position.clone(),this.m_chasenpcspeed=StageControl.Instance.curstage.npcspeed,this.Distance=1.65*AccountManager.Instance.curplayerData.NpcChaseDistance,this.ChaseDistance=1.65*AccountManager.Instance.curplayerData.NpcRushDistance,this.NPCRushSpeed=AccountManager.Instance.curplayerData.NPCRushSpeed}Begin(){this.ChangeState(ChaseNpcState.Run),this.begin=!0}onUpdate(){if(!this.begin)return;if(this.isdead)return;let _host=this.m_hostage.getComponent(Hostage);if(_host.isdead)this.ChangeState(ChaseNpcState.Idle);else if(this.frontdie||this.reardie)this.ChangeState(ChaseNpcState.Die);else{if(Vector3$6.distance(PlayerControl.Instance.Player.transform.position,this.m_chasenpcmodel.transform.position)<this.Distance&&!this.atked){Vector3$6.subtract(this.m_hostage.transform.position,this.m_chasenpcmodel.transform.position,this.currotV),Vector3$6.normalize(this.currotV,this.currotV),this.m_chasenpcmodel.transform.lookAt(new Vector3$6(this.m_chasenpcmodel.transform.position.x-this.currotV.x,this.m_chasenpcmodel.transform.position.y,this.m_chasenpcmodel.transform.position.z-this.currotV.z),new Vector3$6(0,1,0)),this.NPCMoveDir=this.currotV,this.canmove=!0,_host.canmove=!0,this.m_chasenpcmodel.transform.position.z-this.NpcStartPos.z>=this.ChaseDistance&&(this.atked=!0,this.m_chasenpcspeed=this.NPCRushSpeed,this.ChangeState(ChaseNpcState.Atk))}this.Move(this.NPCMoveDir,this.m_chasenpcspeed),this.RayCheck()}}Move(_dir,_speed){if(!(Number(AccountManager.Instance.curplayerData.GainAccount("stage"))<=2)&&this.canmove){var sp=GameTools.Instance.lerp(this.curspeed,_speed,.1);this.curspeed=sp,Vector3$6.scale(_dir,this.curspeed,this.offest),Vector3$6.add(this.m_chasenpcmodel.transform.position,this.offest,this.curpos),Vector3$6.lerp(this.m_chasenpcmodel.transform.position,this.curpos,.15,this.curpos),this.curpos=new Vector3$6(this.curpos.x,this.curpos.y,this.curpos.z),this.m_chasenpcmodel.transform.position=this.curpos}}AddSpeed(){this.m_chasenpcspeed=StageControl.Instance.curstage.npcspeed}SlowSpeed(){this.m_chasenpcspeed=StageControl.Instance.curstage.npcspeed/2}GameOver(){EventManager.StageOff(StageState.Press,this,this.AddSpeed),EventManager.StageOff(StageState.UnPress,this,this.SlowSpeed),EventManager.StageOff(StageState.Start,this,this.Begin),EventManager.StageOff(StageState.Lose,this,this.GameOver),EventManager.StageOff(StageState.Win,this,this.GameOver)}ChangeState(_state){if(this.m_chasenpcstate!=_state)switch(this.m_chasenpcstate=_state,this.m_chasenpcstate){case ChaseNpcState.Atk:this.Attack();break;case ChaseNpcState.Idle:this.Idle();break;case ChaseNpcState.Run:this.Run();break;case ChaseNpcState.Die:this.Die()}}Idle(){this.m_chasenpcanimator.play("idle")}Attack(){this.m_chasenpcanimator.play("atk"),Laya.timer.once(500,this,()=>{this.canmove=!1})}Win(){this.m_chasenpcanimator.play("win")}Run(){this.m_chasenpcanimator.play("run")}Die(){this.die||(this.die=!0,AudioManager.playMusic(MusicType.die),this.PiaoZi(),this.isdead=!0,EventManager.StageOff(StageState.Start,this,this.Begin),this.frontdie&&this.m_chasenpcanimator.play("diefront"),this.reardie&&this.m_chasenpcanimator.play("dierear"),this.m_chasenpcanimator.play("diefront"),this.canmove=!1)}PiaoZi(){let headshoot=new Laya.Image;headshoot.skin="Game/res/textrue/headshoot.png",headshoot.scaleX=.5,headshoot.scaleY=.5,headshoot.anchorX=.5,headshoot.anchorY=.5,Laya.stage.addChild(headshoot),Laya.timer.once(1e3,this,()=>{headshoot.visible=!1,Laya.timer.clear(this,this.UIFollow)}),GameManager.Instance.UIArray.push(headshoot);let UIPos=this.m_chasenpcmodel.getChildByName("UIPos"),screenpos2=new Vector3$6;Laya.timer.frameLoop(1,this,this.UIFollow,[UIPos,headshoot,screenpos2])}UIFollow(UIPos,UI,POS){AssetManager.Instance.maincamera.worldToViewportPoint(UIPos.transform.position,POS),UI.pos(POS.x,POS.y)}RayCheck(){let startpos=new Vector3$6(this.m_chasenpcmodel.transform.position.x,this.m_chasenpcmodel.transform.position.y+.5,this.m_chasenpcmodel.transform.position.z),dir=Transform3DHelper.getForward(this.m_chasenpcmodel.transform),ray=new Laya.Ray(startpos,dir),hitres=new Laya.HitResult;if(AssetManager.Instance.mainscene.physicsSimulation.rayCast(ray,hitres,3,200)){let target=hitres.collider.owner.parent;if("hostage"==target.name){target.getComponent(Hostage).isdead=!0}else"bonfire"==target.name?this.ChangeState(ChaseNpcState.Die):"stone"==target.name?this.m_chasenpcspeed=0:target.name}}}class Dictionary{constructor(){this.keys=new Array,this.values=new Array}get count(){return this.keys.length}add(key,value){let index=this.keys.indexOf(key);-1==index?(this.keys.push(key),this.values.push(value)):this.values[index]=value}remove(key){let index=this.keys.indexOf(key);-1!=index&&(this.keys.splice(index,1),this.values.splice(index,1))}getValue(key){let index=this.keys.indexOf(key);return-1!=index?this.values[index]:null}containKey(key){return-1!=this.keys.indexOf(key)}containValue(value){return-1!=this.values.indexOf(value)}clear(){this.keys.length=0,this.values.length=0}}var BossState,Vector3$7=Laya.Vector3;!function(BossState){BossState[BossState.Idle=0]="Idle",BossState[BossState.Run=1]="Run",BossState[BossState.Die=2]="Die",BossState[BossState.Walk=3]="Walk"}(BossState||(BossState={}));class Boss extends Laya.Script{constructor(){super(),this.canmove=!1,this.FowardHit=new Laya.HitResult,this.isfence=!1,this.arrowarray=[],this.m_arrowspeed=0,this.AtkInterval=0,this.BossSpeed=1,this.CreatGround=!1,this.randomdir=!1,this.ArrowList=new Dictionary,this.currotV=new Vector3$7,this.currot=new Laya.Quaternion,this.NormalizeSpeed=new Vector3$7,this.curpos=new Vector3$7,this.offest=new Vector3$7,this.offestx=0,this.atk=!1,this.run=!1,this.curspeed=0,this.BossMoveDir=new Vector3$7(0,0,1),this.CurrectRotate=new Laya.Quaternion,this.recover=!1,this.speed=0,this.arrowoffset=new Vector3$7,this.arrowcurpos=new Vector3$7,EventManager.StageOn(StageState.Press,this,this.AddSpeed),EventManager.StageOn(StageState.UnPress,this,this.SlowSpeed),EventManager.StageOn(StageState.Win,this,this.GameOver),EventManager.StageOn(StageState.Lose,this,this.GameOver)}static get Instance(){return Boss.ins?Boss.ins:new Boss}onAwake(){this.m_bossmodel=this.owner,this.m_horsemodel=this.m_bossmodel.parent,this.m_bossanimator=this.m_bossmodel.getComponent(Laya.Animator),this.m_horseanimator=this.m_horsemodel.getComponent(Laya.Animator),this.arrowpos=this.m_bossmodel.getChildByName("arrowpos"),this.archerpos=this.m_bossmodel.getChildByName("archerpos"),this.raypos=this.m_bossmodel.getChildByName("raypos"),this.CreatRay(this.raypos.transform.position.clone(),this.raypos.transform.rotationEuler.clone(),this.raypos),this.CreatArcher(this.archerpos.transform.position.clone(),this.archerpos.transform.rotationEuler.clone(),this.archerpos),this.Player=PlayerControl.Instance.Player;let stage=Number(AccountManager.Instance.curplayerData.GainAccount("stage"));this.BossHp=Number(StageControl.Instance.curstagedic[stage].BossHp),this.NowBossHp=this.BossHp,this.AddHpUI(),this.BossDistance=1.65*AccountManager.Instance.curplayerData.BossDistance,this.level=AccountManager.Instance.curplayerData.GainAccount("stage"),this.AtkInterval=AccountManager.Instance.curplayerData.BossAtkInterval-.5*(this.level-1),this.m_arrowspeed=AccountManager.Instance.curplayerData.ArrowSpeed}onUpdate(){if(!this.isdead){var dis=Vector3$7.distance(this.Player.transform.position,this.m_bossmodel.transform.position);if(dis<=this.BossDistance&&!this.run&&(this.run=!0,WXSDK.Shake(),this.ChangeState(BossState.Run)),dis>=1.65*AccountManager.Instance.curplayerData.MaxBossDistance&&this.run?this.canmove=!1:dis>1.65*AccountManager.Instance.curplayerData.MinBossDistance&&dis<1.65*AccountManager.Instance.curplayerData.MaxBossDistance&&this.run&&(this.ChangeState(BossState.Run),this.canmove=!0,this.BossSpeed=StageControl.Instance.curstage.mainrolespeed),this.canmove&&(this.Move(this.BossMoveDir,this.BossSpeed),this.atk||(this.atk=!0,Laya.timer.once(1e3*this.AtkInterval,this,this.Atk)),!this.CreatGround&&this.m_bossmodel.transform.position.z>StageControl.Instance.LastGround-50&&StageControl.Instance.CreatGround(5),this.randomdir||(this.randomdir=!0,Laya.timer.once(2e3,this,this.RandomDir)),this.RayCheck(),null!=this.ArrowList))for(var keys=this.ArrowList.keys,i=0;i<keys.length;i++){var key=keys[i];if(null!=keys[i]){this.ArrowList.getValue(keys[i]);this.ArrowMove(key,this.ArrowList.getValue(key)[0],this.ArrowList.getValue(key)[1])}}}}TurnDir(_dir){0!=_dir.x&&(Vector3$7.lerp(this.currotV,_dir,.35,_dir),this.currotV=_dir,Laya.Quaternion.rotationLookAt(_dir,new Vector3$7(0,1,0),this.currot),Laya.Quaternion.slerp(this.m_horsemodel.transform.rotation,this.currot,.025,this.currot),this.currot=new Laya.Quaternion(0,this.currot.y,0),this.m_horsemodel.transform.rotation=this.currot)}MoveX(_speed){this.m_horsemodel.transform.position.x<0&&_speed<0&&this.isfence||this.m_horsemodel.transform.position.x>0&&_speed>0&&this.isfence||this.m_horsemodel.transform.position.x>=GameManager.Instance.fenceleftpos&&_speed>0||this.m_horsemodel.transform.position.x<=GameManager.Instance.fencerightpos&&_speed<0||(_speed*=.07,this.m_horsemodel.transform.translate(new Vector3$7(_speed,0,0)))}RandomDir(){let _dir=Math.random()>.5?-.5:.5;this.BossMoveDir=new Vector3$7(_dir,0,1),Laya.timer.once(200,this,()=>{this.BossMoveDir=new Vector3$7(0,0,1),this.randomdir=!1})}Move(_dir,_speed){var sp=GameTools.Instance.lerp(this.curspeed,_speed,.1);this.curspeed=sp,Vector3$7.scale(_dir,this.curspeed,this.offest),Vector3$7.add(this.m_horsemodel.transform.position,this.offest,this.curpos),Vector3$7.lerp(this.m_horsemodel.transform.position,this.curpos,.15,this.curpos),this.m_horsemodel.transform.position=this.curpos,this.m_horsemodel.transform.position=this.m_horsemodel.transform.position.x<GameManager.Instance.fencerightpos+.5?new Vector3$7(GameManager.Instance.fencerightpos+.5,this.m_horsemodel.transform.position.y,this.m_horsemodel.transform.position.z):this.m_horsemodel.transform.position,this.m_horsemodel.transform.position=this.m_horsemodel.transform.position.x>GameManager.Instance.fenceleftpos-.5?new Vector3$7(GameManager.Instance.fenceleftpos-.5,this.m_horsemodel.transform.position.y,this.m_horsemodel.transform.position.z):this.m_horsemodel.transform.position}Atk(){Laya.timer.frameLoop(1,this,this.RotationMove)}SlowSpeed(){this.run&&(this.ChangeState(BossState.Walk),this.BossSpeed=AccountManager.Instance.curplayerData.BossSpeed/2)}AddSpeed(){this.run&&(this.ChangeState(BossState.Run),this.BossSpeed=AccountManager.Instance.curplayerData.BossSpeed)}GameOver(){EventManager.StageOff(StageState.Press,this,this.AddSpeed),EventManager.StageOff(StageState.UnPress,this,this.SlowSpeed)}RotationMove(){Vector3$7.subtract(this.Player.transform.position,this.m_bossmodel.transform.position,this.currotV),Vector3$7.normalize(this.currotV,this.currotV);var curdir=new Vector3$7(-this.currotV.x,-this.currotV.y,-this.currotV.z);Laya.Quaternion.rotationLookAt(curdir,new Vector3$7(0,10,0),this.CurrectRotate),this.CurrectRotate.invert(this.CurrectRotate),Laya.Quaternion.slerp(this.m_bossmodel.transform.rotation,this.CurrectRotate,.05,this.CurrectRotate),this.m_bossmodel.transform.rotation=this.CurrectRotate;var bossfoward=Transform3DHelper.getForward(this.m_bossmodel.transform);if(this.JupdeAngle(bossfoward,this.currotV)>.995){Laya.timer.clear(this,this.RotationMove),this.Shoot();let rotation2=GameTools.tweenRotate(this.m_bossmodel.transform,new Vector3$7(0,0,0),700,Laya.Ease.linearInOut,Laya.Handler.create(this,()=>{rotation2.clear(),this.atk=!1}))}}JupdeAngle(dir1,dir2){let Dir1=new Vector3$7(dir1.x,0,dir1.z),Dir2=new Vector3$7(dir2.x,0,dir2.z);return Vector3$7.normalize(Dir1,Dir1),Vector3$7.normalize(Dir2,Dir2),Vector3$7.dot(Dir1,Dir2)}Shoot(){this.CreatArrow();var currect=this.m_arrow;this.m_arrow=null;let ray=this.owner.getChildByName("raypos").getChildAt(0),forw=Transform3DHelper.getForward(ray.transform),trans=this.owner.getChildByName("raypos").transform,testRay=new Laya.Ray(new Vector3$7(trans.position.x,trans.position.y-1,trans.position.z),forw),hitRes=new Laya.HitResult;if(this.m_bossanimator.play("shoot"),AssetManager.Instance.mainscene.physicsSimulation.rayCast(testRay,hitRes)){let target=hitRes.collider.owner.parent;this.ArrowList.add(currect,[forw,target])}else this.ArrowList.add(currect,[forw,null])}ArrowMove(arrow,_dir,target){if(target){if(arrow.destroyed)return;if(arrow.transform.position.z<=target.transform.position.z){if("player"==target.name){target.getComponent(Runner).isdead=!0,this.BossProgress.visible=!1}this.ArrowList.containKey(arrow)&&this.ArrowList.remove(arrow),GamePool.Instance.RecoveryModel(arrow)}else{var sp=GameTools.Instance.lerp(this.speed,this.m_arrowspeed,.1);this.speed=sp,Vector3$7.scale(_dir,this.speed,this.arrowoffset),Vector3$7.add(arrow.transform.position,this.arrowoffset,this.arrowcurpos),Vector3$7.lerp(arrow.transform.position,this.arrowcurpos,.15,this.arrowcurpos),arrow.transform.position=this.arrowcurpos}}else{sp=GameTools.Instance.lerp(this.speed,this.m_arrowspeed,.1);this.speed=sp,Vector3$7.scale(_dir,this.speed,this.arrowoffset),Vector3$7.add(arrow.transform.position,this.arrowoffset,this.arrowcurpos),Vector3$7.lerp(arrow.transform.position,this.arrowcurpos,.15,this.arrowcurpos),arrow.transform.position=this.arrowcurpos,this.recover||(this.recover=!0,Laya.timer.once(1e3,this,()=>{this.ArrowList.containKey(arrow)&&this.ArrowList.remove(arrow),GamePool.Instance.RecoveryModel(arrow),this.recover=!1}))}}ChangeState(_state){if(this._bossstate!=_state)switch(this._bossstate=_state,this._bossstate){case BossState.Idle:this.Idle();break;case BossState.Run:this.Run();break;case BossState.Die:this.Die();break;case BossState.Walk:this.Walk()}}Idle(){this.m_bossanimator.play("idle"),this.m_horseanimator.play("idle")}Walk(){this.m_horseanimator.play("walk"),this.m_bossanimator.play("down")}Run(){this.canmove=!0,this.m_bossanimator.play("down"),this.m_horseanimator.play("run")}Die(){this.BossProgress.visible=!1,this.isdead=!0,Laya.timer.clearAll(this),this.m_horseanimator.play("idle"),this.m_bossanimator.play("die"),EventManager.StageTrigger(StageState.Win)}RayCheck(){this.FowardRayCheck?this.CrashBarrier():this.isfence=!1}CrashBarrier(){"small_fence"==this.FowardHit.collider.owner.parent.name&&(this.isfence=!0)}get FowardRayCheck(){var isFowardHit=!1,startPos=new Vector3$7(this.m_bossmodel.transform.position.x,this.m_bossmodel.transform.position.y+.5,this.m_bossmodel.transform.position.z+2);let dir=Transform3DHelper.getForward(this.m_bossmodel.transform);var DownRay=new Laya.Ray(startPos,dir);return AssetManager.Instance.mainscene.physicsSimulation.rayCast(DownRay,this.FowardHit,1)&&100==this.FowardHit.collider.collisionGroup&&(isFowardHit=!0),isFowardHit}CreatRay(pos,euler,raypos){var ray=this.CreatRayPrefab();raypos.addChild(ray),ray.transform.position=pos,ray.transform.rotationEuler=euler}CreatRayPrefab(){return GamePool.Instance.GetModel(AssetManager.Instance.Prop.get(18),"")}CreatArcher(_pos,_euler,archerpos){var archer=GamePool.Instance.GetModel(AssetManager.Instance.Prop.get(16),"");archerpos.addChild(archer),archer.transform.position=_pos,archer.transform.rotationEuler=_euler;var scale=archer.transform.scale.clone();scale.x=.3,scale.y=.3,scale.z=.6,archer.transform.scale=scale}CreatArrow(){var arrow=GamePool.Instance.GetModel(AssetManager.Instance.Prop.get(17),"");AssetManager.Instance.mainscene.addChild(arrow),this.arrowarray.push(arrow),arrow.transform.position=this.arrowpos.transform.position.clone();var euler=this.arrowpos.transform.rotationEuler.clone();arrow.transform.rotationEuler=euler;let scale=arrow.transform.scale.clone();scale.z=.5,scale.x=.5,scale.y=.5,arrow.transform.scale=scale,this.m_arrow=arrow}AddHpUI(){this.BossProgress=new Laya.ProgressBar,this.BossProgress.skin="Game/res/textrue/healthbar1.png",this.BossProgress.scaleX=.4,this.BossProgress.scaleY=.4,this.BossProgress.anchorX=.5,this.BossProgress.anchorY=.5,Laya.stage.addChild(this.BossProgress),GameManager.Instance.UIArray.push(this.BossProgress);let UIPos=this.m_bossmodel.getChildByName("UIPos");this.InitHpUI(),Laya.timer.frameLoop(1,this,()=>{let ScreenPos=new Vector3$7;AssetManager.Instance.maincamera.worldToViewportPoint(UIPos.transform.position,ScreenPos),this.BossProgress.pos(ScreenPos.x,ScreenPos.y)})}InitHpUI(){this.BossProgress.value=this.NowBossHp/this.BossHp}LoseHp(_damage){GameManager.Instance.KillNum++,InGameView.Instance.InitUI(),this.NowBossHp>=_damage?this.NowBossHp=this.NowBossHp-=_damage:this.NowBossHp<_damage&&this.NowBossHp>0&&(this.NowBossHp=0),0==this.NowBossHp?(this.ChangeState(BossState.Die),this.BossProgress.destroy()):this.InitHpUI()}}var CharacterState,Vector3$8=Laya.Vector3;!function(CharacterState){CharacterState[CharacterState.Run=0]="Run",CharacterState[CharacterState.Idle=1]="Idle",CharacterState[CharacterState.Die=2]="Die",CharacterState[CharacterState.Win=3]="Win",CharacterState[CharacterState.Shoot=4]="Shoot",CharacterState[CharacterState.Walk=5]="Walk",CharacterState[CharacterState.Revive=6]="Revive"}(CharacterState||(CharacterState={}));class Runner extends Laya.Script3D{constructor(){super(),this.Invincible=!1,this.started=!1,this.shoot=!1,this.isbarrier=!1,this.isfence=!1,this.arrowarray=[],this.isdead=!1,this.canmove=!1,this._speed=0,this._press=!1,this.RayDir=new Vector3$8,this.DownHit=new Laya.HitResult,this.FowardHit=new Laya.HitResult,this.curspeed=0,this.currotV=new Vector3$8,this.currot=new Laya.Quaternion,this.NormalizeSpeed=new Vector3$8,this.curpos=new Vector3$8,this.offest=new Vector3$8,this.ArrowList=new Dictionary,this.arrowspeed=0,this.speed=0,this.arrowoffset=new Vector3$8,this.arrowcurpos=new Vector3$8,this.recover=!1,this.hitfence=!1,EventManager.StageOn(StageState.Start,this,this.Begin),EventManager.StageOn(StageState.Lose,this,this.GameOver),EventManager.StageOn(StageState.Win,this,this.GameOver)}static get Instance(){return Runner.ins?Runner.ins:new Runner}onAwake(){this.m_player=this.owner,this.m_animator=this.owner.getComponent(Laya.Animator),this.m_arrowpos=this.owner.getChildByName("arrowpos"),this.m_raypos=this.owner.getChildByName("raypos"),this.m_archerpos=this.owner.getChildByName("archerpos"),this.m_horseanimator=this.owner.getChildAt(this.owner.numChildren-1).getComponent(Laya.Animator),this._speed=StageControl.Instance.curstage.mainrolespeed,this.m_PlayerDamage=AccountManager.Instance.curplayerData.PlayerDamage,this.stage=Number(AccountManager.Instance.curplayerData.GainAccount("stage")),this.ChangeState(CharacterState.Idle),this.DirRoatationLerp=AccountManager.Instance.curplayerData.DirRoatationLerp,this.DirMoveLerp=AccountManager.Instance.curplayerData.DirMoveLerp,this.arrowspeed=AccountManager.Instance.curplayerData.ArrowSpeed,this.m_range=AccountManager.Instance.curplayerData.Range}Begin(){this.canmove=!0,this.CreatArrow(),this.ChangeState(CharacterState.Walk)}onUpdate(){if(this.isdead)this.ChangeState(CharacterState.Die);else{var speed;if(this.canmove&&this.started)if(!this.isbarrier){speed=this._press?StageControl.Instance.curstage.mainrolespeed:StageControl.Instance.curstage.mainrolespeed/2;let foward=Transform3DHelper.getForward(this.m_player.transform);this.Move(foward,speed)}if(this.RayCheck(),null!=this.ArrowList)for(var keys=this.ArrowList.keys,i=0;i<keys.length;i++){var key=keys[i];if(null!=keys[i]){this.ArrowList.getValue(keys[i]);this.ArrowMove(key,this.ArrowList.getValue(key)[0],this.ArrowList.getValue(key)[1])}}}}MoveX(_speed){this.m_player.transform.position.x<0&&_speed<0&&this.isfence||this.m_player.transform.position.x>0&&_speed>0&&this.isfence||this.m_player.transform.position.x>=GameManager.Instance.fenceleftpos&&_speed>0||this.m_player.transform.position.x<=GameManager.Instance.fencerightpos&&_speed<0||(_speed*=this.DirMoveLerp,this.canmove&&this.started&&this.m_player.transform.translate(new Vector3$8(_speed,0,0)))}TurnDir(_dir){0!=_dir.x&&(Vector3$8.lerp(this.currotV,_dir,.35,_dir),this.currotV=_dir,Laya.Quaternion.rotationLookAt(_dir,new Vector3$8(0,1,0),this.currot),Laya.Quaternion.slerp(this.m_player.transform.rotation,this.currot,this.DirRoatationLerp,this.currot),this.currot=new Laya.Quaternion(0,this.currot.y,0),this.m_player.transform.rotation=this.currot)}Move(_dir,_speed){var sp=GameTools.Instance.lerp(this.curspeed,_speed,.1);this.curspeed=sp,Vector3$8.scale(_dir,this.curspeed,this.offest),Vector3$8.add(this.m_player.transform.position,this.offest,this.curpos),Vector3$8.lerp(this.m_player.transform.position,this.curpos,.15,this.curpos),this.curpos=new Vector3$8(this.curpos.x,this.curpos.y,this.curpos.z),this.m_player.transform.position=this.curpos,this.m_player.transform.position=this.m_player.transform.position.x<GameManager.Instance.fencerightpos+.5?new Vector3$8(GameManager.Instance.fencerightpos+.5,this.m_player.transform.position.y,this.m_player.transform.position.z):this.m_player.transform.position,this.m_player.transform.position=this.m_player.transform.position.x>GameManager.Instance.fenceleftpos-.5?new Vector3$8(GameManager.Instance.fenceleftpos-.5,this.m_player.transform.position.y,this.m_player.transform.position.z):this.m_player.transform.position}ChangeState(_state){if(this.m_characterstate!=_state)switch(this.m_characterstate=_state,this.m_characterstate){case CharacterState.Idle:this.Idle();break;case CharacterState.Run:this.Run();break;case CharacterState.Die:this.Die();break;case CharacterState.Shoot:this.Shoot();break;case CharacterState.Walk:this.Walk()}}Idle(){this.m_animator.play("idle"),this.m_horseanimator.play("idle")}Run(){this.m_animator.play("down"),this.m_horseanimator.play("run")}ReviveState(){this.m_horseanimator.play("walk"),this.m_animator.play("down")}Die(){WXSDK.Shake(!0),this.canmove=!1,this.m_animator.play("die"),this.m_horseanimator.play("idle"),EventManager.StageTrigger(StageState.Lose)}GameOver(){Laya.timer.clear(this,this.AnimatorState),EventManager.StageOff(StageState.Start,this,this.Begin)}Walk(){this.m_horseanimator.play("walk")}Shoot(){this.m_animator.play("shoot")}RayCheck(){this.FowardRayCheck?this.CrashBarrier():(this.isbarrier=!1,this.isfence=!1)}CrashBarrier(){var target=this.FowardHit.collider.owner.parent;"stone"==target.name?this.isbarrier=!0:"bonfire"==target.name?this.ChangeState(CharacterState.Die):"big_fence"==target.name?this.isbarrier=!0:"wood_Cylinder"==target.name?this.isbarrier=!0:"small_fence"==target.name&&(this.isfence=!0)}get FowardRayCheck(){var isFowardHit=!1,startPos=new Vector3$8(this.m_player.transform.position.x,this.m_player.transform.position.y+.5,this.m_player.transform.position.z);let dir=Transform3DHelper.getForward(this.m_player.transform);var DownRay=new Laya.Ray(startPos,dir);return AssetManager.Instance.mainscene.physicsSimulation.rayCast(DownRay,this.FowardHit,1)&&100==this.FowardHit.collider.collisionGroup&&(isFowardHit=!0),isFowardHit}Archery(){var currect=this.m_arrow;this.m_arrow=null,AudioManager.playMusic(MusicType.shoot),Laya.timer.clear(this,this.ArrowFollow),Laya.timer.clear(this,this.AnimatorState);let ray=this.owner.getChildByName("raypos").getChildAt(0),forw=Transform3DHelper.getForward(ray.transform),trans=this.owner.getChildByName("raypos").transform,testRay=new Laya.Ray(new Vector3$8(trans.position.x,trans.position.y-.5,trans.position.z),forw),hitRes=new Laya.HitResult;if(this.m_animator.play("shoot"),Laya.timer.frameLoop(1,this,this.AnimatorState),this.stage<=2)if(AssetManager.Instance.mainscene.physicsSimulation.rayCast(testRay,hitRes,this.m_range)){let target=hitRes.collider.owner;this.ArrowList.add(currect,[forw,target])}else this.ArrowList.add(currect,[forw,null]);else if(AssetManager.Instance.mainscene.physicsSimulation.rayCast(testRay,hitRes)){let target=hitRes.collider.owner;this.ArrowList.add(currect,[forw,target])}else this.ArrowList.add(currect,[forw,null])}ArrowMove(arrow,_dir,target){if(target){if(arrow.destroyed)return;let parent=target.parent;if(arrow.transform.position.z>=parent.transform.position.z){if("npc"==parent.name){AudioManager.playMusic(MusicType.hit),1==this.stage?InGameView.Instance.Guide2.visible&&(GameManager.Instance.GuideKill<2&&(GameManager.Instance.GuideKill+=1),1==GameManager.Instance.GuideKill&&(this.started=!0,InGameView.Instance.Guide2.visible=!1,Laya.timer.once(2500,this,()=>{this.started=!1,InGameView.Instance.Guide3.visible=!0,this.m_range=100}))):2==this.stage&&InGameView.Instance.Guide2.visible&&(GameManager.Instance.GuideKill+=1,GameManager.Instance.GuideKill>=1&&(this.started=!0,InGameView.Instance.Guide2.visible=!1,Laya.timer.once(2e3,this,()=>{this.started=!1,InGameView.Instance.Guide4.visible=!0,this.m_range=100})));let _npcrunner=parent.getComponent(NpcRunner),_chaseNpc=parent.getComponent(ChaseNpc);if(_npcrunner){let stage=Number(AccountManager.Instance.curplayerData.GainAccount("stage"));1==stage?1==GameManager.Instance.GuideKill&&("npcfrontcollider"==target.name?_npcrunner.frontdie=!0:"npcrearcollider"==target.name&&(_npcrunner.reardie=!0),GameManager.Instance.KillNum++,InGameView.Instance.InitUI()):2==stage?((InGameView.Instance.Guide2.visible||1==GameManager.Instance.GuideKill)&&("npcfrontcollider"==target.name?_npcrunner.frontdie=!0:"npcrearcollider"==target.name&&(_npcrunner.reardie=!0)),GameManager.Instance.KillNum++,InGameView.Instance.InitUI()):stage>2&&("npcfrontcollider"==target.name?_npcrunner.frontdie=!0:"npcrearcollider"==target.name&&(_npcrunner.reardie=!0),GameManager.Instance.KillNum++,InGameView.Instance.InitUI()),WXSDK.Shake(!0),WXSDK.stageShake()}else _chaseNpc&&(2==this.stage?InGameView.Instance.Guide4.visible&&GameManager.Instance.GuideKill>=1&&(InGameView.Instance.Guide4.visible=!1,WXSDK.AldEvent("完成第四阶段引导"),this.started=!0,Laya.timer.once(3e3,this,()=>{EventManager.StageTrigger(StageState.Win)}),"npcfrontcollider"==target.name?_chaseNpc.frontdie=!0:"npcrearcollider"==target.name&&(_chaseNpc.reardie=!0),GameManager.Instance.KillNum++,InGameView.Instance.InitUI()):("npcfrontcollider"==target.name?_chaseNpc.frontdie=!0:"npcrearcollider"==target.name&&(_chaseNpc.reardie=!0),GameManager.Instance.KillNum++,InGameView.Instance.InitUI()),WXSDK.Shake(!0),WXSDK.stageShake())}else if("big_fence"==parent.name)if(AudioManager.playMusic(MusicType.hit),WXSDK.Shake(!0),1==this.stage){if(GameManager.Instance.GuideKill>=1){InGameView.Instance.Guide3.visible=!1,this.hitfence||(Laya.timer.once(5e3,this,()=>{EventManager.StageTrigger(StageState.Win)}),WXSDK.AldEvent("完成第三阶段引导"),this.started=!0,this.hitfence=!0);let tweenpos=GameTools.tweenMove(parent.transform,new Vector3$8(parent.transform.position.x,parent.transform.position.y,parent.transform.position.z+5),200,Laya.Ease.linearInOut,Laya.Handler.create(this,()=>{tweenpos.clear()})),tweenrot=GameTools.tweenRotate(parent.transform,new Vector3$8(90,0,0),500,Laya.Ease.linearInOut,Laya.Handler.create(this,()=>{tweenrot.clear()}));Laya.timer.once(500,this,()=>{GamePool.Instance.RecoveryModel(parent)})}}else{let tweenpos=GameTools.tweenMove(parent.transform,new Vector3$8(parent.transform.position.x,parent.transform.position.y,parent.transform.position.z+5),200,Laya.Ease.linearInOut,Laya.Handler.create(this,()=>{tweenpos.clear()})),tweenrot=GameTools.tweenRotate(parent.transform,new Vector3$8(90,0,0),500,Laya.Ease.linearInOut,Laya.Handler.create(this,()=>{tweenrot.clear()}));Laya.timer.once(1e3,this,()=>{GamePool.Instance.RecoveryModel(parent)})}else if("hostage"==parent.name){if(this.stage>1){AudioManager.playMusic(MusicType.hit),parent.getComponent(Hostage).isdead=!0}}else if("boss"==parent.name){AudioManager.playMusic(MusicType.hit),parent.getComponent(Boss).LoseHp(this.m_PlayerDamage)}this.ArrowList.containKey(arrow)&&this.ArrowList.remove(arrow),GamePool.Instance.RecoveryModel(arrow)}else{var sp=GameTools.Instance.lerp(this.speed,this.arrowspeed,.1);this.speed=sp,Vector3$8.scale(_dir,this.speed,this.arrowoffset),Vector3$8.add(arrow.transform.position,this.arrowoffset,this.arrowcurpos),Vector3$8.lerp(arrow.transform.position,this.arrowcurpos,.15,this.arrowcurpos),arrow.transform.position=this.arrowcurpos}}else{sp=GameTools.Instance.lerp(this.speed,this.arrowspeed,.1);this.speed=sp,Vector3$8.scale(_dir,this.speed,this.arrowoffset),Vector3$8.add(arrow.transform.position,this.arrowoffset,this.arrowcurpos),Vector3$8.lerp(arrow.transform.position,this.arrowcurpos,.15,this.arrowcurpos),arrow.transform.position=this.arrowcurpos,this.recover||(this.recover=!0,Laya.timer.once(500,this,()=>{this.ArrowList.containKey(arrow)&&this.ArrowList.remove(arrow),GamePool.Instance.RecoveryModel(arrow),this.recover=!1}))}}AnimatorState(){this.m_animator.getCurrentAnimatorPlayState(0).normalizedTime>=1&&(Laya.timer.clear(this,this.AnimatorState),this.m_arrowpos.destroyed||(this.CreatArrow(),this.shoot=!1))}CreatArrow(){var arrow=GamePool.Instance.GetModel(AssetManager.Instance.Prop.get(17),"");AssetManager.Instance.mainscene.addChild(arrow),this.arrowarray.push(arrow),arrow.transform.position=this.m_arrowpos.transform.position.clone();var euler=this.m_arrowpos.transform.rotationEuler.clone();arrow.transform.rotationEuler=euler;let scale=arrow.transform.scale.clone();scale.z=.5,scale.x=.8,scale.y=.5,arrow.transform.scale=scale,this.m_arrow=arrow,Laya.timer.frameLoop(1,this,this.ArrowFollow,[arrow,this.m_arrowpos])}ArrowFollow(arrow,arrowpos){arrowpos.destroyed?Laya.timer.clear(this,this.ArrowFollow):(arrow.transform.position=arrowpos.transform.position.clone(),arrow.transform.rotationEuler=arrowpos.transform.rotationEuler.clone())}Revive(){this.Invincible=!0,Laya.timer.once(AccountManager.Instance.curplayerData.Invincible,this,()=>{this.Invincible=!1}),this.ReviveState(),this.m_player.transform.position=new Vector3$8(this.m_player.transform.position.x,this.m_player.transform.position.y,this.m_player.transform.position.z-15),this.canmove=!0,this.ChangeState(CharacterState.Walk)}}var Vector3$9=Laya.Vector3;class PlayerControl{constructor(){this.DownHit=new Laya.HitResult,this.speed=1,this.press=!1,this.win=!1,this.offset=new Vector3$9(0,0,0),this.offestx=0,this.first=!1,this.poschazhi=new Vector3$9,this.gengsuipos=new Vector3$9,this.lllpos=new Vector3$9,this.hights=0,this.wights=0,PlayerControl.ins=this,EventManager.StageOn(StageState.Lose,this,this.GameOver),EventManager.StageOn(StageState.Win,this,this.GameOver)}static get Instance(){return PlayerControl.ins?PlayerControl.ins:new PlayerControl}Init(_player){this.win=!1,this.Player=_player,this.arrowpos=_player.getChildByName("arrowpos");let runner=this.Player.getComponent(Runner);runner&&runner.destroy(),this._runner=this.Player.addComponent(Runner),this.Camera=AssetManager.Instance.maincamera,this.Camera.transform.position=new Laya.Vector3(0,10,-19),this.Camera.transform.rotationEuler=new Laya.Vector3(-35.7,180,0),Laya.stage.on(Laya.Event.MOUSE_DOWN,this,this.onMouseDown),this.CameraFollow(),Laya.timer.frameLoop(1,this,this.CheckWin),this.stage=Number(AccountManager.Instance.curplayerData.GainAccount("stage")),this.curtouchsmoothness=AccountManager.Instance.curplayerData.CurTouchsmoothness,this.curtouchsize=AccountManager.Instance.curplayerData.CurTouchsize}CheckWin(){1==this.stage?this.Player.transform.position.z>=1.65*StageControl.Instance.curstage.endposition.z&&!this.win&&(this.win=!0,EventManager.StageTrigger(StageState.Win),Laya.timer.clear(this,this.CheckWin)):this.stage>2&&0==StageControl.Instance.curstage.isboss&&this.Player.transform.position.z>=1.2*StageControl.Instance.curstage.endposition.z&&!this.win&&(this.win=!0,EventManager.StageTrigger(StageState.Win),Laya.timer.clear(this,this.CheckWin))}onMouseDown(e){this._runner.canmove&&(this.stage>2?this._runner.started=!0:2!=this.stage||this.first||(this._runner.started=!0),2!=this.stage||this.first||(this.first=!0,Laya.timer.once(1500,this,()=>{this._runner.started=!1,InGameView.Instance.Guide2.visible=!0})),InGameView.Instance.Guide1.visible&&(InGameView.Instance.Guide1.visible=!1,WXSDK.AldEvent("完成第一阶段引导"),InGameView.Instance.ani1.stop(),this._runner.started=!0,Laya.timer.once(2e3,this,()=>{this._runner.started=!1,InGameView.Instance.Guide2.visible=!0})),this._runner._press=!0,this.curMousePos=new Laya.Vector2(Laya.MouseManager.instance.mouseX,Laya.MouseManager.instance.mouseY),Laya.timer.frameLoop(1,this,this.onMouseMove),Laya.stage.on(Laya.Event.MOUSE_UP,this,this.onMouseUp),Laya.stage.on(Laya.Event.MOUSE_OUT,this,this.onMouseUp),this._runner.ChangeState(CharacterState.Run),EventManager.StageTrigger(StageState.Press))}onMouseMove(){if(1==this.stage||this._runner.canmove){var MousePos=new Laya.Vector2(Laya.MouseManager.instance.mouseX,Laya.MouseManager.instance.mouseY),offestX=MousePos.x-this.curMousePos.x;offestX=(offestX=offestX>50?50:offestX)<-50?-50:offestX,this.offestx=GameTools.Instance.lerp(this.offestx,offestX,this.curtouchsmoothness);var dir=new Vector3$9(-offestX*this.curtouchsize,0,0);this._runner.TurnDir(dir),this.curMousePos=MousePos}else Laya.timer.clear(this,this.onMouseMove)}onMouseUp(){this._runner.canmove&&(this.offestx=0,Laya.timer.clear(this,this.onMouseMove),this._runner._press=!1,Laya.stage.off(Laya.Event.MOUSE_MOVE,this,this.onMouseMove),Laya.stage.off(Laya.Event.MOUSE_UP,this,this.onMouseUp),Laya.stage.off(Laya.Event.MOUSE_OUT,this,this.onMouseUp),this._runner.shoot||(this._runner.shoot=!0,this._runner.Archery()),this._runner.ChangeState(CharacterState.Walk),EventManager.StageTrigger(StageState.UnPress))}GameOver(){this._runner.canmove=!1,this._runner._press=!1,this.CameraCancelFollow(),Laya.timer.clear(this,this.CheckWin),Laya.stage.off(Laya.Event.MOUSE_MOVE,this,this.onMouseMove),Laya.stage.off(Laya.Event.MOUSE_UP,this,this.onMouseUp),Laya.stage.off(Laya.Event.MOUSE_OUT,this,this.onMouseUp),Laya.stage.off(Laya.Event.MOUSE_DOWN,this,this.onMouseDown)}Revive(){this.Camera.transform.position=new Vector3$9(this.Camera.transform.position.x,this.Camera.transform.position.y,this.Camera.transform.position.z-15),this._runner.Revive(),this.CameraFollow(),Laya.stage.on(Laya.Event.MOUSE_DOWN,this,this.onMouseDown)}CameraFollow(){this.hights=0,this.wights=0,Vector3$9.subtract(this.Player.transform.position,this.Camera.transform.position,this.poschazhi),Laya.timer.frameLoop(1,this,this.GenSui)}GenSui(){Vector3$9.subtract(this.Player.transform.position,this.poschazhi,this.gengsuipos),this.hights=GameTools.Instance.lerp(this.hights,1,.03),this.wights=GameTools.Instance.lerp(this.wights,.8,.02),this.gengsuipos=new Vector3$9(this.gengsuipos.x,this.gengsuipos.y,this.gengsuipos.z-this.wights),Vector3$9.lerp(this.Camera.transform.position,this.gengsuipos,.25,this.lllpos),this.lllpos=new Vector3$9(this.gengsuipos.x,this.lllpos.y,this.lllpos.z),this.Camera.transform.position=this.lllpos;var qqqwe=new Laya.Quaternion,eyePos=new Vector3$9(this.gengsuipos.x,this.gengsuipos.y-.8,this.gengsuipos.z);Laya.Quaternion.lookAt(eyePos,this.Player.transform.position,new Vector3$9(0,1,0),qqqwe),qqqwe.invert(qqqwe),Laya.Quaternion.slerp(this.Camera.transform.rotation,qqqwe,.1,qqqwe),this.Camera.transform.rotation=qqqwe}CameraCancelFollow(){Laya.timer.clear(this,this.GenSui)}}class NpcControl{constructor(){NpcControl.ins=this}static get Instance(){return NpcControl.ins?NpcControl.ins:new NpcControl}Init(_npc){this.m_npcmodel=_npc;let npcrunner=this.m_npcmodel.getComponent(NpcRunner);npcrunner&&npcrunner.destroy(),this.m_npcrunner=this.m_npcmodel.addComponent(NpcRunner)}}class GameManager{constructor(){this.started=!1,this.GuideKill=0,this.KillNum=0,this.ReviveNum=1,this.CharacterArray=[],this.UIArray=[],this.fenceleftpos=0,this.fencerightpos=0,this.treeleftpos=0,this.treerightpos=0,GameManager.ins=this,EventManager.EventOn(EventState.StageInit,this,this.CreatStage),EventManager.EventOn(EventState.StageCreateComplete,this,this.Init)}static get Instance(){return GameManager.ins?GameManager.ins:new GameManager}Init(){this.CreatCharacter(),this.mainscene=AssetManager.Instance.mainscene,Laya.stage.addChildAt(this.mainscene,0),ViewManager.Instance.ShowView(ViewType.MainView)}CreatStage(){StageControl.Instance.RessetStage()}CreatCharacter(){this.CreatPlayer()}CreatPlayer(){var equiphorseid=Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)[2]),equipcap=Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)[1]),playermodel=GamePool.Instance.GetModel(AssetManager.Instance.Player.get(1),""),horsemodel=GamePool.Instance.GetModel(AssetManager.Instance.Horse.get(equiphorseid),"");if(playermodel.addChild(horsemodel),playermodel.transform.position=new Laya.Vector3(0,0,-9),horsemodel.transform.localScale=new Laya.Vector3(1,1,1),horsemodel.transform.localPosition=new Laya.Vector3(0,0,0),this.raypos=playermodel.getChildByName("raypos"),this.archerpos=playermodel.getChildByName("archerpos"),this.arrowpos=playermodel.getChildByName("arrowpos"),this.cappos=playermodel.getChildByName("cappos"),equipcap){var capmodel=GamePool.Instance.GetModel(AssetManager.Instance.Cap.get(equipcap),"");this.cappos.addChild(capmodel),capmodel.transform.localScale=new Laya.Vector3(.5,.5,.5),capmodel.transform.localPosition=new Laya.Vector3(0,0,0),capmodel.transform.localRotationEuler=new Laya.Vector3(-90,0,0)}this.raypos.getChildAt(0)||this.CreatRay(this.raypos.transform.position.clone(),this.raypos.transform.rotationEuler.clone(),this.raypos),this.archerpos.getChildAt(0)||this.CreatArcher(this.archerpos.transform.position.clone(),this.archerpos.transform.rotationEuler.clone(),this.archerpos),PlayerControl.Instance.Init(playermodel),AssetManager.Instance.mainscene.addChild(playermodel),this.CharacterArray.push(playermodel),GameTools.Instance.PlayerSetCollider(playermodel,200)}CreatEnemy(enemy){enemy.transform.rotationEuler=new Laya.Vector3(0,180,0),NpcControl.Instance.Init(enemy),GameTools.Instance.EnemySetCollider(enemy,100),this.CharacterArray.push(enemy)}CreatChaseCharacter(_node){let enemy=_node.getChildByName("enemy").getChildAt(0),hostage=_node.getChildByName("player").getChildAt(0);hostage.transform.localPosition=new Laya.Vector3(0,0,0),hostage.transform.localRotationEuler=new Laya.Vector3(0,0,0),enemy.transform.localPosition=new Laya.Vector3(0,0,-2),enemy.transform.localRotationEuler=new Laya.Vector3(0,0,0),GameTools.Instance.EnemySetCollider(enemy,100),GameTools.Instance.HostageSetCollider(hostage,200);let chase=enemy.getComponent(ChaseNpc);if(chase)chase.destroy();else{enemy.addComponent(ChaseNpc)}let host=hostage.getComponent(Hostage);if(host)host.destroy();else{hostage.addComponent(Hostage)}this.CharacterArray.push(_node)}CreatBoss(_pos){var bossmodel=GamePool.Instance.GetModel(AssetManager.Instance.Boss.get(1),""),horsemodel=GamePool.Instance.GetModel(AssetManager.Instance.Horse.get(50),"");if(bossmodel.getComponent(Boss));else{bossmodel.addComponent(Boss)}horsemodel.addChild(bossmodel),bossmodel.transform.localPosition=new Laya.Vector3(0,0,0),bossmodel.transform.localScale=new Laya.Vector3(1,1,1),horsemodel.transform.position=_pos.clone(),AssetManager.Instance.mainscene.addChild(horsemodel),this.CharacterArray.push(horsemodel)}RecoveryCharacter(){for(let i=0;i<this.CharacterArray.length;i++){let model=this.CharacterArray[i];switch(model.name){case"npc":let npcrunner=model.getComponent(NpcRunner);npcrunner&&npcrunner.destroy();break;case"pursue":let hostage=model.getChildByName("player").getChildAt(0).getComponent(Hostage),chasenpc=model.getChildByName("enemy").getChildAt(0).getComponent(ChaseNpc);hostage&&hostage.destroy(),chasenpc&&chasenpc.destroy();break;case"horse1":let boss=model.getChildByName("boss");boss.active=!1,boss.removeSelf(),GamePool.Instance.RecoveryModel(boss);let _bs=boss.getComponent(Boss);if(_bs){for(let i=0;i<_bs.arrowarray.length;i++){let arrow=_bs.arrowarray[i];GamePool.Instance.RecoveryModel(arrow),_bs.arrowarray[i]=null}_bs.arrowarray.splice(0,_bs.arrowarray.length),_bs.destroy()}break;case"player":let runner=model.getComponent(Runner),horse=model.getChildAt(model.numChildren-1),cap=model.getChildByName("cappos").getChildAt(0);if(cap&&(cap.removeSelf(),GamePool.Instance.RecoveryModel(cap)),horse.active=!1,horse.removeSelf(),GamePool.Instance.RecoveryModel(horse),runner){for(let i=0;i<runner.arrowarray.length;i++){let arrow=runner.arrowarray[i];GamePool.Instance.RecoveryModel(arrow),runner.arrowarray[i]=null}runner.arrowarray.splice(0,runner.arrowarray.length),runner.destroy()}}GamePool.Instance.RecoveryModel(model),this.CharacterArray[i]=null}this.CharacterArray.splice(0,this.CharacterArray.length);for(let i=0;i<this.UIArray.length;i++){let UI=this.UIArray[i];UI.removeSelf(),UI.destroy()}this.UIArray.splice(0,this.UIArray.length)}CreatRay(pos,euler,raypos){var ray=this.CreatRayPrefab();raypos.addChild(ray),ray.transform.position=pos,ray.transform.rotationEuler=euler}CreatRayPrefab(){return GamePool.Instance.GetModel(AssetManager.Instance.Prop.get(18),"")}CreatArcher(_pos,_euler,archerpos){var archer=GamePool.Instance.GetModel(AssetManager.Instance.Prop.get(16),"");archerpos.addChild(archer),archer.transform.position=_pos,archer.transform.rotationEuler=_euler;var scale=archer.transform.scale.clone();scale.x=.3,scale.y=.3,scale.z=.6,archer.transform.scale=scale}Revive(){PlayerControl.Instance.Revive(),ViewManager.Instance.ShowView(ViewType.IngameView)}SetHorse(_id){let horsemodel=PlayerControl.Instance.Player.getChildAt(PlayerControl.Instance.Player.numChildren-1);horsemodel.removeSelf(),GamePool.Instance.RecoveryModel(horsemodel);var newhorsemodel=GamePool.Instance.GetModel(AssetManager.Instance.Horse.get(_id),"");PlayerControl.Instance.Player.addChild(newhorsemodel),newhorsemodel.transform.localScale=new Laya.Vector3(1,1,1),newhorsemodel.transform.localPosition=new Laya.Vector3(0,0,0),PlayerControl.Instance._runner.m_horseanimator=newhorsemodel.getComponent(Laya.Animator)}SetCap(_id){let cappos=PlayerControl.Instance._runner.m_player.getChildByName("cappos"),cap=cappos.getChildAt(0);cap&&(cap.removeSelf(),GamePool.Instance.RecoveryModel(cap));let newcap=GamePool.Instance.GetModel(AssetManager.Instance.Cap.get(_id),"");cappos.addChild(newcap),newcap.transform.localPosition=new Laya.Vector3(0,0,0),newcap.transform.localScale=new Laya.Vector3(.5,.5,.5),newcap.transform.localRotationEuler=new Laya.Vector3(-90,0,0)}}class MainGame{constructor(){MainGame.ins=this,EventManager.StageOn(StageState.Lose,this,this.GameFailure),EventManager.StageOn(StageState.Win,this,this.GameWin)}static get Instance(){return MainGame.ins?MainGame.ins:new MainGame}GameFailure(){GameManager.Instance.ReviveNum>0?ViewManager.Instance.ShowView(ViewType.CompleteView,3):(AudioManager.StopMusic(),AudioManager.playMusic(MusicType.Lose),ViewManager.Instance.ShowView(ViewType.CompleteView,2))}GameWin(){AudioManager.StopMusic(),AudioManager.playMusic(MusicType.Win),ViewManager.Instance.ShowView(ViewType.CompleteView,1)}Revive(){ViewManager.Instance.ShowView(ViewType.CompleteView,3)}}class LoadView extends ui.LoadViewUI{constructor(){super(),this.progressnum=0,this.fast=.07,this.slow=.001,this.End=!1,this.EndProgress=!1,Laya.stage.addChild(this),LoadView.ins=this,this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height}),this.Init()}static get Instance(){return LoadView.ins?LoadView.ins:new LoadView}Init(){console.log("load界面构造函数"),new GameManager,new StageControl,new MainGame,this.Login(),Laya.timer.frameLoop(1,this,this.UpdateProgress)}UpdateProgress(){this.progressnum<=.7?this.progressnum+=this.fast:this.progressnum>.7&&this.progressnum<.99?this.progressnum+=this.slow:this.End&&(this.progressnum+=this.slow),!this.EndProgress&&this.progressnum>=1&&(this.EndProgress=!0,this.progressnum=1,Laya.timer.clear(this,this.UpdateProgress),this.LoadComplete()),this.LoadProgress.value=this.progressnum}complete(){this.End=!0,this.slow=this.fast}Login(){WXSDK.AldEvent("开始加载"),Laya.Browser.onWeiXin?this.WXLogin():this.LocalLogin()}WXLogin(){Laya.Browser.onWeiXin?WXSDK.DengLu(res=>{"error"!=res?(WXSDK.AldEvent("微信登陆成功"),console.log("1微信登录成功:"+res),this.LocalLogin()):this.WXLogin()}):this.LocalLogin()}LocalLogin(){ServerManager.Instance.Login(null,Laya.Handler.create(this,this.LoginComplete),Laya.Handler.create(this,this.LoginFail))}LoginComplete(){WXSDK.canshakestage=AccountManager.Instance.curplayerData.CanStageShake,SDKZS.loadData(),WXSDK.AldEvent("本地服务器登陆成功"),console.log("本地服务器登陆成功"),this.LoadSubPackage()}LoginFail(){console.log("本地服务器登陆失败")}LoadComplete(){this.destroy(),EventManager.EventTrigger(EventState.LoadComplete),WXSDK.AldEvent("资源加载完毕,开始进入主界面"),console.log("加载完毕--")}LoadSubPackage(){WXSDK.LoadSubPackage("Game",callback=>{callback&&(WXSDK.AldEvent("分包加载成功"),this.LoadScene())})}LoadScene(){Laya.Scene3D.load(ResourcesPath.MainScene,Laya.Handler.create(this,scene=>{this.mainscene=scene,AssetManager.Instance.mainscene=this.mainscene,console.log("场景资源加载完毕---"),this.LoadPlayer()}))}LoadPlayer(){var path=[];for(let i=0;i<ResourcesPath.Player.length;i++)path.push(ResourcesPath.Player[i]);Laya.loader.create(path,Laya.Handler.create(this,()=>{for(let i=0;i<ResourcesPath.Player.length;i++){var model=Laya.loader.getRes(ResourcesPath.Player[i]);AssetManager.Instance.Player.set(i+1,model),Laya.loader.clearRes(ResourcesPath.Player[i])}console.log("玩家模型资源加载完毕---"),this.LoadHorse()}))}LoadHorse(){var path=[];for(let i=0;i<ResourcesPath.Horse.length;i++)path.push(ResourcesPath.Horse[i]);Laya.loader.create(path,Laya.Handler.create(this,()=>{for(let i=0;i<ResourcesPath.Horse.length;i++){var model=Laya.loader.getRes(ResourcesPath.Horse[i]);AssetManager.Instance.Horse.set(i+50,model),Laya.loader.clearRes(ResourcesPath.Horse[i])}console.log("马模型资源加载完毕---"),this.LoadBoss()}))}LoadBoss(){var path=[];for(let i=0;i<ResourcesPath.Boss.length;i++)path.push(ResourcesPath.Boss[i]);Laya.loader.create(path,Laya.Handler.create(this,()=>{for(let i=0;i<ResourcesPath.Boss.length;i++){var model=Laya.loader.getRes(ResourcesPath.Boss[i]);AssetManager.Instance.Boss.set(i+1,model),Laya.loader.clearRes(ResourcesPath.Boss[i])}console.log("boss模型资源加载完毕---"),this.LoadCap()}))}LoadCap(){var path=[];for(let i=0;i<ResourcesPath.Cap.length;i++)path.push(ResourcesPath.Cap[i]);Laya.loader.create(path,Laya.Handler.create(this,()=>{for(let i=0;i<ResourcesPath.Cap.length;i++){var model=Laya.loader.getRes(ResourcesPath.Cap[i]);AssetManager.Instance.Cap.set(i+1,model),Laya.loader.clearRes(ResourcesPath.Cap[i])}console.log("帽子模型资源加载完毕---"),this.LoadProp()}))}LoadProp(){Laya.loader.create(ResourcesPath.Prop,Laya.Handler.create(this,this.LoadResources))}LoadResources(_prop){var Prop=_prop.getChildByName("Prop");for(let i=0;i<Prop.numChildren;i++){var model=Prop.getChildAt(i);model.active=!1,AssetManager.Instance.Prop.set(i+1,model)}var Plane=_prop.getChildByName("plane");AssetManager.Instance.Plane.set(1,Plane);var smallfence=_prop.getChildByName("small_fence");AssetManager.Instance.Small_Fence.set(1,smallfence);var Tree=_prop.getChildByName("Tree");for(let i=0;i<Tree.numChildren;i++){var tree=Tree.getChildAt(i);tree.active=!1,AssetManager.Instance.Tree.set(i+1,tree)}Laya.loader.clearRes(ResourcesPath.Prop),console.log("道具资源加载完毕---"),this.complete()}}class Main$1{constructor(){if(!CheckMain.Creat){if(CheckMain.Creat=!0,window.Laya3D?Laya3D.init(GameConfig.width,GameConfig.height):Laya.init(GameConfig.width,GameConfig.height,Laya.WebGL),Laya.Physics&&Laya.Physics.enable(),Laya.DebugPanel&&Laya.DebugPanel.enable(),Laya.stage.scaleMode=GameConfig.scaleMode,Laya.stage.screenMode=GameConfig.screenMode,Laya.stage.alignV=GameConfig.alignV,Laya.stage.alignH=GameConfig.alignH,Laya.URL.exportSceneToJson=GameConfig.exportSceneToJson,(GameConfig.debug||"true"==Laya.Utils.getQueryString("debug"))&&Laya.enableDebugPanel(),GameConfig.physicsDebug&&Laya.PhysicsDebugDraw&&Laya.PhysicsDebugDraw.enable(),GameConfig.stat&&Laya.Stat.show(),Laya.alertGlobalError=!0,Laya.Browser.onWeiXin){if(Laya.Browser.window.wx.showShareMenu({withShareTicket:!0}),Laya.Browser.window.wx.onShareAppMessage(function(){return{title:"有人@你,一起骑马仗箭走天涯",imageUrl:"Game/res/textrue/share.jpg"}}),Laya.Browser.window.wx.onShow(option=>{option.shareTicket,option.query.userId,option.query.shareTitle;var scenevalue=Laya.LocalStorage.getItem("SceneValue");scenevalue?Main$1.SceneNum=scenevalue:(Laya.LocalStorage.setItem("SceneValue",option.scene),Main$1.SceneNum=option.scene),WXSDK.querychannel=option.query.channel,WXSDK.shareOpenId=option.query.userId,console.log("scene:",option.scene),null!=WXSDK.querychannel&&console.log("onShow channel is:",WXSDK.querychannel),option.referrerInfo&&(WXSDK.referrerInfoappId=option.referrerInfo.appId,console.log("onShow appId is:",option.referrerInfo.appId))}),!Laya.Browser.onWeiXin)return;const updateManager=Laya.Browser.window.wx.getUpdateManager();updateManager.onCheckForUpdate(function(res){console.log("最新版本:"+res.hasUpdate)}),updateManager.onUpdateReady(function(){Laya.Browser.window.wx.showModal({showCancel:!1,title:"更新提示",content:"新版本已经准备好,是否重启应用?",success(res){updateManager.applyUpdate()},fail(res){updateManager.applyUpdate()}})})}Laya.ResourceVersion.enable("version.json",Laya.Handler.create(this,this.onVersionLoaded),Laya.ResourceVersion.FILENAME_VERSION)}}onVersionLoaded(){Laya.AtlasInfoManager.enable("fileconfig.json",Laya.Handler.create(this,this.onConfigLoaded))}onConfigLoaded(){new LoadView}}return Main$1.Ver="1.0.0",Main$1.CFG="123",new Main$1,exports.Main=Main$1,exports}({});