| 12 |
- var __reflect=this&&this.__reflect||function(t,e,i){t.__class__=e,i?i.push(e):i=[e],t.__types__=t.__types__?i.concat(t.__types__):i},__extends=this&&this.__extends||function(t,e){function i(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);i.prototype=e.prototype,t.prototype=new i},__awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(o,s){function a(t){try{h(n.next(t))}catch(e){s(e)}}function r(t){try{h(n["throw"](t))}catch(e){s(e)}}function h(t){t.done?o(t.value):new i(function(e){e(t.value)}).then(a,r)}h((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){function i(t){return function(e){return n([t,e])}}function n(i){if(o)throw new TypeError("Generator is already executing.");for(;h;)try{if(o=1,s&&(a=s[2&i[0]?"return":i[0]?"throw":"next"])&&!(a=a.call(s,i[1])).done)return a;switch(s=0,a&&(i=[0,a.value]),i[0]){case 0:case 1:a=i;break;case 4:return h.label++,{value:i[1],done:!1};case 5:h.label++,s=i[1],i=[0];continue;case 7:i=h.ops.pop(),h.trys.pop();continue;default:if(a=h.trys,!(a=a.length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){h=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){h.label=i[1];break}if(6===i[0]&&h.label<a[1]){h.label=a[1],a=i;break}if(a&&h.label<a[2]){h.label=a[2],h.ops.push(i);break}a[2]&&h.ops.pop(),h.trys.pop();continue}i=e.call(t,h)}catch(n){i=[6,n],s=0}finally{o=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var o,s,a,r,h={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return r={next:i(0),"throw":i(1),"return":i(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r},Main=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.loading=0,e.waiting=0,e}return __extends(e,t),e.prototype.createChildren=function(){t.prototype.createChildren.call(this),e.self=this,e.stageW=this.stage.stageWidth,e.stageH=this.stage.stageHeight,e.cenX=e.stageW/2,e.cenY=e.stageH/2;var i=e.stageH-1600;e.hh=i/2,RES.getVirtualUrl=function(t){return t+="?v="+window.version};var n=new AssetAdapter;egret.registerImplementation("eui.IAssetAdapter",n),egret.registerImplementation("eui.IThemeAdapter",new ThemeAdapter),this.runGame()["catch"](function(t){console.log(t)}),setTimeout(function(){this.waiting=1,console.log("waiting OK"),this.checkToStart()}.bind(this),300)},e.prototype.loadResource=function(){return __awaiter(this,void 0,void 0,function(){var t,e;return __generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),[4,RES.loadConfig("resource/default.res.json","resource/")];case 1:return i.sent(),[4,RES.loadGroup("loading",0,null)];case 2:return i.sent(),t=new LoadingUI,this.stage.addChild(t),this.loadingView=t,showGIF(),[4,this.loadTheme()];case 3:return i.sent(),[4,RES.loadGroup("preload",0,t)];case 4:return i.sent(),[3,6];case 5:return e=i.sent(),console.error(e),[3,6];case 6:return[2]}})})},e.prototype.runGame=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,this.loadResource()];case 1:return t.sent(),this.loading=1,console.log("loading OK"),this.checkToStart(),[2]}})})},e.prototype.checkToStart=function(){1==this.loading&&1==this.waiting&&(this.stage.removeChild(this.loadingView),hideGIF(),this.createGameScene())},e.prototype.loadTheme=function(){var t=this;return new Promise(function(e,i){var n=new eui.Theme("resource/default.thm.json",t.stage);n.addEventListener(eui.UIEvent.COMPLETE,function(){e()},t)})},e.prototype.createTest=function(){var t=new TestPage;this.addChild(t)},e.prototype.createGameScene=function(){var t=new MainGame;this.addChild(t),t.y=e.hh},e.prototype.onButtonClick=function(t){var e=new eui.Panel;e.title="Title",e.horizontalCenter=0,e.verticalCenter=0,this.addChild(e)},e}(eui.UILayer);__reflect(Main.prototype,"Main");var AssetAdapter=function(){function t(){}return t.prototype.getAsset=function(t,e,i){function n(n){e.call(i,n,t)}if(RES.hasRes(t)){var o=RES.getRes(t);o?n(o):RES.getResAsync(t,n,this)}else RES.getResByUrl(t,n,this,RES.ResourceItem.TYPE_IMAGE)},t}();__reflect(AssetAdapter.prototype,"AssetAdapter",["eui.IAssetAdapter"]);var ChouNoTimePage=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),this.init()},e.prototype.init=function(){},e.prototype.showShare=function(){},e.prototype.doReplay=function(){},e}(eui.Component);__reflect(ChouNoTimePage.prototype,"ChouNoTimePage",["eui.UIComponent","egret.DisplayObject"]);var ChouPage=function(t){function e(){var e=t.call(this)||this;return e.curIndex=0,e.delay=0,e.speed=0,e.canStopRunning=!1,e.isRunning=!1,e.canResetTimer=!1,e.curID=0,e.xArr=[100,297,479,479,297,100,100,297,479],e.yArr=[357,357,357,539,539,539,734,734,734],e.canRun=!1,e.curNum=0,e.maxIndex=8,e}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),this.init()},e.prototype.init=function(){e.self=this,this.chouBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.doChou,this),this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.showRule,this),this.closeRuleBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.hideRule,this),this.shareBtn.addEventListener(egret.TouchEvent.TOUCH_END,function(){doShare()}.bind(this),this),Xiaobin.makeScaleLoop(this.chouBtn,.8,600),this.curIndex=0,this.delay=window.delay,this.speed=window.speed,this.selBox.x=this.xArr[this.curIndex],this.selBox.y=this.yArr[this.curIndex],setInterval(function(){1==this.isRunning&&makeSlowDown()}.bind(this),window.changeAddSpeedTime);var t=new egret.Timer(this.delay);t.addEventListener(egret.TimerEvent.TIMER,this.loop,this),t.start(),this.timer=t,this.makeSound()},e.prototype.makeSound=function(){var t=new egret.URLLoader;t.addEventListener(egret.Event.COMPLETE,function(e){var i=t.data;this.sound=i},this),t.dataFormat=egret.URLLoaderDataFormat.SOUND,t.load(new egret.URLRequest("sound/di.mp3"))},e.prototype.loop=function(){1==this.canStopRunning?(this.timer.stop(),this.timer.removeEventListener(egret.TimerEvent.TIMER,this.loop,this),this.selBox.x=this.xArr[this.curIndex],this.selBox.y=this.yArr[this.curIndex],console.log("this.curIndex = "+this.curIndex),console.log("end......."),PrizePage.pIndex=this.curIndex):(1==this.canResetTimer&&(this.resetTimer(),this.canResetTimer=!1),this.speed=window.speed,1==this.canRun&&(this.curNum+=this.speed,this.curIndex=Math.floor(this.curNum),this.curNum>this.maxIndex&&(this.curIndex=0,this.curNum=0),this.sound.play(0,1),this.setPos(this.curIndex)))},e.prototype.setPos=function(t){t>0&&(this.selBox.x=this.xArr[t-1],this.selBox.y=this.yArr[t-1]),0==t&&(this.selBox.x=this.xArr[this.maxIndex],this.selBox.y=this.yArr[this.maxIndex]);var e=this.xArr[t],i=this.yArr[t];0==this.canStopRunning&&(this.selBox.x=e,this.selBox.y=i)},e.prototype.resetTimer=function(){this.timer.stop(),this.timer.removeEventListener(egret.TimerEvent.TIMER,this.loop,this),this.delay=window.delay,this.timer=new egret.Timer(this.delay),this.timer.addEventListener(egret.TimerEvent.TIMER,this.loop,this),this.timer.start()},e.prototype.doChou=function(){},e.prototype.hideRule=function(){Xiaobin.makeFadeOut(this.gRule,0,function(){this.gRule.visible=!1}.bind(this))},e.prototype.showRule=function(){this.gRule.visible=!0,Xiaobin.makeFadeIn(this.gRule)},e}(eui.Component);__reflect(ChouPage.prototype,"ChouPage",["eui.UIComponent","egret.DisplayObject"]);var ConstData=function(){function t(){}return t.CLICK_START="CLICK_START",t.CLICK_REPLAY="CLICK_REPLAY",t.CLICK_HOME="CLICK_HOME",t.SHOW_HOME="SHOW_HOME",t.SHOW_JISUAN="SHOW_JISUAN",t.SHOW_END="SHOW_END",t.BACK_INGAME="BACK_INGAME",t.BACK_OUT=egret.Ease.backOut,t.SINE_OUT=egret.Ease.sineOut,t.SINE_IN=egret.Ease.sineIn,t.LOOP={loop:!0},t}();__reflect(ConstData.prototype,"ConstData");var DanBar=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this)},e.prototype.setData=function(t,e){this.nick.text=t,this.jiang.text=e},e}(eui.Component);__reflect(DanBar.prototype,"DanBar",["eui.UIComponent","egret.DisplayObject"]);var Deng=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this);var e=this.dengLight;e.rotation=0;var i=egret.Tween.get(e,ConstData.LOOP);i.to({rotation:-15,alpha:1},500).to({rotation:0,alpha:1},500).to({rotation:15,alpha:1},500).to({rotation:0,alpha:1},500)},e}(eui.Component);__reflect(Deng.prototype,"Deng",["eui.UIComponent","egret.DisplayObject"]);var DiaBoy=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this)},e}(eui.Component);__reflect(DiaBoy.prototype,"DiaBoy",["eui.UIComponent","egret.DisplayObject"]);var DownCounter=function(t){function e(){var e=t.call(this)||this;return e.cIndex=3,e.addEventListener(egret.Event.ADDED_TO_STAGE,e.startGame,e),e}return __extends(e,t),e.prototype.startGame=function(t){this.cIndex=3,setTimeout(this.init.bind(this),100)},e.prototype.init=function(){},e}(egret.Sprite);__reflect(DownCounter.prototype,"DownCounter");var EndPage=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),e.self=this,this.endIcon.visible=!1,this.saveTip.visible=!1,this.scanTip.visible=!0,"localhost"==window.location.host?this.headBit.source="http://localhost/test.png":this.headBit.source=Main.userInfo.profile_image_url,this.endBgImg.source="img/hai/hai"+TestPage.endBitIndex+".png",this.endTxtImg.source="img/ht"+TestPage.endTxtIndex+".png",this.findTxt.text=TestPage.getDanNum+"枚彩蛋",setTimeout(function(){this.makeImg()}.bind(this),500)},e.prototype.showSaveTip=function(){this.saveTip.visible=!0,Xiaobin.makeFadeIn(this.saveTip)},e.prototype.makeImg=function(){var t=new egret.RenderTexture;t.drawToTexture(this);var e=t.toDataURL("image/jpeg",new egret.Rectangle(0,250,750,1250),1);makeDivImg(e)},e.prototype.makeImgComplete=function(){this.endIcon.visible=!0,this.scanTip.visible=!1,this.showSaveTip()},e}(eui.Component);__reflect(EndPage.prototype,"EndPage",["eui.UIComponent","egret.DisplayObject"]);var HomePage=function(t){function e(){var e=t.call(this)||this;return e.curSca=1,e.bigSca=1,e.yunSpeed0=2,e.yunSpeed1=1,e.infoArr0=[],e.infoArr1=[],e}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),e.self=this,this.tipImg.visible=!1,this.bar0.visible=!1,this.bar1.visible=!1,this.gPrize.visible=!1,this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.hidePirze,this),this.addEventListener(egret.Event.ENTER_FRAME,this.loop,this),this.startBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.doStart,this),this.anCar1.addEventListener("complete",this.replayAnCar1,this),this.anCar1.play(0),this.anCar2.addEventListener("complete",this.replayAnCar2,this),this.anCar2.play(0),this.tree.touchEnabled=!1,Xiaobin.makeScaleLoop(this.startBtn,1.1,900),Xiaobin.makeYLoop(this.ship,5,1500),Xiaobin.makeYLoop(this.qiqiu,10,1200),this.prizeBtn.y=80-Main.hh,this.jiangBtn.y=this.prizeBtn.y+110,this.prizeBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.showPrize,this),this.jiangBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.showJiang,this),this.lingquBtn0.addEventListener(egret.TouchEvent.TOUCH_END,this.showInfo0,this),this.lingquBtn1.addEventListener(egret.TouchEvent.TOUCH_END,this.showInfo1,this)},e.prototype.checkActiveOver=function(){0==window.isBeginActivity?(console.log("活动结束 状态"),getRankingWinAward(function(t){if(console.log("====== getRankingWinAward ======"),console.log(t),1==t.isWinAward){var e=t.giftId;console.log("获得排名奖 ID :"+e)}}.bind(this))):console.log("活动进行中 状态")},e.prototype.showTipImg=function(){this.tipImg.visible=!0},e.prototype.hideTipImg=function(){this.tipImg.visible=!1},e.prototype.showInfo0=function(){TestPage.giftId=this.infoArr0.giftId,MainGame.self.showInfoPage()},e.prototype.showInfo1=function(){TestPage.giftId=this.infoArr1.giftId,MainGame.self.showInfoPage()},e.prototype.hidePirze=function(){this.gPrize.visible=!1,1==this.tipImg.visible&&showTipDIV(),this.hideTipImg()},e.prototype.showPrize=function(){console.log("----- getAwardLog -----"),getAwardLog(function(t){console.log(t),t.length>0?(this.gPrize.visible=!0,this.showGiftList(t)):showMessage("暂时还没有获奖哦")}.bind(this))},e.prototype.showJiang=function(){MainGame.self.showRankEndPage()},e.prototype.showGiftList=function(t){1==t.length&&(this.infoArr0=t[0],this.setBar1()),2==t.length&&(this.infoArr0=t[0],this.setBar1(),this.infoArr1=t[1],this.setBar2())},e.prototype.setBar1=function(){this.bar0.visible=!0,this.la0.text=this.infoArr0.giftName,1==this.infoArr0.isReceive&&(Xiaobin.makeHui(this.lingquBtn0),this.lingquBtn0.touchEnabled=!1)},e.prototype.setBar2=function(){this.bar1.visible=!0,this.la1.text=this.infoArr1.giftName,1==this.infoArr1.isReceive&&(Xiaobin.makeHui(this.lingquBtn1),this.lingquBtn1.touchEnabled=!1)},e.prototype.replayAnCar1=function(){this.anCar1.play(0)},e.prototype.replayAnCar2=function(){this.anCar2.play(0)},e.prototype.doStart=function(){playBgMusic(),MainGame.playClickSound(),this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_END,this.doStart,this),MainGame.self.goBigMap(),startGame()},e.prototype.loop=function(){this.yun0.x+=this.yunSpeed0,this.yun1.x+=this.yunSpeed1,this.yun0.x>800&&(this.yun0.x-=800+this.yun0.width),this.yun1.x>800&&(this.yun1.x-=800+this.yun0.width)},e}(eui.Component);__reflect(HomePage.prototype,"HomePage",["eui.UIComponent","egret.DisplayObject"]);var IconMc=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),this.touchChildren=!1,this.dan.rotation=35,this.dan.y=66},e.prototype.setIcon=function(t){this.iconBit.source="ic"+t+"_png"},e.prototype.makeDanJump=function(){this.dan.scaleX=this.dan.scaleY=1.5;var t=egret.Tween.get(this.dan);t.to({rotation:0},900,egret.Ease.bounceOut).call(this.setDan,this)},e.prototype.setDan=function(){this.dan.scaleX=this.dan.scaleY=1,this.dan.source="dan1_png",this.dan.y=60,this.setNormal()},e.prototype.setHui=function(){Xiaobin.makeHui(this.iconBit)},e.prototype.setNormal=function(){Xiaobin.makeNormal(this.iconBit)},e}(eui.Component);__reflect(IconMc.prototype,"IconMc",["eui.UIComponent","egret.DisplayObject"]);var InfoPage=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),this.init()},e.prototype.init=function(){this.gInfo.visible=!0,Xiaobin.makeFadeIn(this.gInfo,0),this.tID.text=Main.userInfo.uid,this.tName.text="",this.tTel.text="",this.tAdd.text="",this.closeInfoBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.hideInfo,this),this.tijiaoBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.makeTijiao,this)},e.prototype.makeTijiao=function(){var t=this.tName.text,e=this.tTel.text,i=this.tAdd.text,n=0;n=1==TestPage.getCaidan?1:2;var o=TestPage.giftId;this.tijiaoBtn.alpha=.8,this.tijiaoBtn.touchEnabled=!1,submitReceive(t,e,i,o,n,function(t){console.log(t),this.tijiaoComplete(),1==TestPage.getCaidan&&(TestPage.self.hidePop(),TestPage.getCaidan=0)}.bind(this))},e.prototype.tijiaoComplete=function(){MainGame.self.hideInfoPage()},e.prototype.hideInfo=function(){MainGame.self.hideInfoPage()},e}(eui.Component);__reflect(InfoPage.prototype,"InfoPage",["eui.UIComponent","egret.DisplayObject"]);var InGame=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),console.log("create ingame"),this.init()},e.prototype.init=function(){},e}(eui.Component);__reflect(InGame.prototype,"InGame",["eui.UIComponent","egret.DisplayObject"]);var Item=function(t){function e(e){var i=t.call(this)||this;return i.r=1,i.speed=5,i.ro=2,i.name="",i.addEventListener(egret.Event.ADDED_TO_STAGE,i.startGame,i),i.r=e,i}return __extends(e,t),e.prototype.startGame=function(t){this.ro=Math.floor(3*Math.random()),Math.random()>.5&&(this.ro*=-1);var e=Xiaobin.createBitmapCenterPNG("item"+this.r);this.addChild(e),e.scaleX=e.scaleY=.99},e.addSpeed=1,e}(egret.Sprite);__reflect(Item.prototype,"Item");var LoadingUI=function(t){function e(){var e=t.call(this)||this;return e["long"]=550,e.barX=169.5,e.createView(),e}return __extends(e,t),e.prototype.createView=function(){var t=Xiaobin.createBitmapByNameJPG("aloadingBg");this.addChild(t),this.createText()},e.prototype.createText2=function(){var t=Xiaobin.createBitmapByNamePNG("aloadingTxt");this.addChild(t),t.anchorOffsetX=t.width/2,t.x=Main.cenX,t.y=860},e.prototype.createMan=function(){var t=Xiaobin.createBitmapByNamePNG("aloadingCoin");this.addChild(t),t.anchorOffsetX=t.width/2,t.anchorOffsetY=t.height,t.x=180,t.y=700,this.man=t},e.prototype.init=function(){var t=new egret.Sprite;this.addChild(t),this.con=t;var e=692,i=Xiaobin.createBitmapByNamePNG("aloadingBar0");t.addChild(i),i.x=this.barX,i.y=e;var i=Xiaobin.createBitmapByNamePNG("aloadingBar1");t.addChild(i),i.x=this.barX,i.y=e;var n=new egret.Shape;n.graphics.beginFill(16711680),n.graphics.drawRect(-this["long"],e,this["long"],100),n.graphics.endFill(),t.addChild(n),n.x=0,this.square=n,i.mask=n;var o=Xiaobin.createBitmapByNamePNG("aloadingSide");t.addChild(o),o.x=this.barX,o.y=718},e.prototype.createText=function(){null==this.textField&&(this.textField=new egret.TextField,this.addChild(this.textField),this.textField.size=30,this.textField.textColor=5915442,this.textField.y=770+Main.hh,this.textField.text="0%",this.textField.width=Main.stageW,this.textField.textAlign=egret.HorizontalAlign.CENTER,this.textField.bold=!0)},e.prototype.onProgress=function(t,e){if(null!=this.textField&&(this.textField.text=""+Math.floor(100*(t/e))+"%"),this.square){var i=this.barX+(750-2*this.barX)*(t/e);this.square.x=i}if(this.man){var i=180+390*(t/e);this.man.x=i}},e}(egret.Sprite);__reflect(LoadingUI.prototype,"LoadingUI",["RES.PromiseTaskReporter"]);var BigMap=function(t){function e(){var e=t.call(this)||this;return e.yuIndex=1,e.pengIndex=1,e.daguIndex=1,e.yanIndex=1,e}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),this.gBigMap.visible=!0,this.x51.visible=!1,this.a5.x=1502,this.a5.y=2408;var e=egret.Tween.get(this.a5,ConstData.LOOP);e.to({x:2580,y:1800},9e3),this.initEggItem(),this.makeBoatRotate()},e.prototype.updateAni=function(){this.yanIndex++,this.yanIndex>3&&(this.yanIndex=1),this.imgYan.source="yan"+this.yanIndex+"_png",this.yuIndex++,this.yuIndex>3&&(this.yuIndex=1),this.imgYu1.source="yu"+this.yuIndex+"_png",this.imgYu2.source="yu"+this.yuIndex+"_png",this.pengIndex++,this.pengIndex>3&&(this.pengIndex=1),this.imgPeng.source="peng"+this.pengIndex+"_png",this.daguIndex++,this.daguIndex>2&&(this.daguIndex=1),this.imgDagu.source="dagu"+this.daguIndex+"_png"},e.prototype.makeBoatRotate=function(){this.boatLine.rotation=-4;var t=egret.Tween.get(this.boatLine,ConstData.LOOP);t.to({rotation:4},800,ConstData.SINE_OUT).to({rotation:-4},800,ConstData.SINE_OUT)},e.prototype.initEggItem=function(){for(var t=1;15>=t;t++){var e=this["a"+t];e.name="a"+t,e.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickPic,this)}},e.prototype.clickPic=function(t){var e=t.target,i=e.name,n=i.slice(1);console.log(n),"5"==n&&egret.Tween.removeTweens(this.a5),e.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.clickPic,this);var o=egret.Tween.get(e);o.to({scaleX:1.1,scaleY:1.1},500,ConstData.BACK_OUT),setTimeout(function(){e.scaleX=e.scaleY=1}.bind(this),1500),TestPage.self.setEggFind(n),submitEasterEgg(n),MainGame.playClickSound()},e}(eui.Component);__reflect(BigMap.prototype,"BigMap",["eui.UIComponent","egret.DisplayObject"]);var MainGame=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),e.self=this,this.addEventListener(ConstData.CLICK_HOME,this.createHome,this),this.createHome(),this.createTestPage(),this.createSound(),checkLogin(function(){HomePage.self.checkActiveOver()})},e.prototype.showRankEndPage=function(){null==this.rankEndPage&&(this.rankEndPage=new RankEndPage,this.addChild(this.rankEndPage))},e.prototype.hideRankEndPage=function(){null!=this.rankEndPage&&(this.removeChild(this.rankEndPage),this.rankEndPage=null)},e.prototype.showRankPage=function(){null==this.rankPage&&(this.rankPage=new RankPage,this.addChild(this.rankPage))},e.prototype.hideRankPage=function(){null!=this.rankPage&&(this.removeChild(this.rankPage),this.rankPage=null)},e.prototype.showInfoPage=function(){null==this.infoPage&&(this.infoPage=new InfoPage,this.addChild(this.infoPage),this.infoPage.init())},e.prototype.hideInfoPage=function(){null!=this.infoPage&&(this.removeChild(this.infoPage),this.infoPage=null)},e.prototype.goEnd=function(){null!=this.testPage&&(this.testPage.makeDistroy(),this.removeChild(this.testPage),this.testPage=null),null==this.endPage&&(this.endPage=new EndPage,this.addChild(this.endPage))},e.prototype.showHome=function(){null!=this.ingame&&(this.removeChild(this.ingame),this.ingame=null),this.createHome()},e.prototype.createHome=function(){if(null==this.homepage){var t=new HomePage;this.addChild(t),this.homepage=t}},e.prototype.goIngame=function(){if(this.doRemoveHome(),null==this.ingame){var t=new InGame;this.addChild(t),this.ingame=t}},e.prototype.createTestPage=function(){null==this.testPage&&(this.testPage=new TestPage,this.addChild(this.testPage),this.testPage.visible=!1)},e.prototype.goBigMap=function(){this.testPage.createBigMap(),setTimeout(function(){this.testPage.init(),this.testPage.showTip(),this.testPage.visible=!0,this.doRemoveHome()}.bind(this),400)},e.prototype.doRemoveEndPage=function(){null!=this.endPage&&(this.removeChild(this.endPage),this.endPage=null)},e.prototype.doRemoveHome=function(){null!=this.homepage&&(this.removeChild(this.homepage),this.homepage=null)},e.playClickSound=function(){e.clickSound.play(0,1)},e.playDiSound=function(){e.diSound.play(0,1)},e.prototype.createSound=function(){e.clickSound=RES.getRes("soundClick_mp3"),e.diSound=RES.getRes("soundDi_mp3")},e}(eui.Component);__reflect(MainGame.prototype,"MainGame",["eui.UIComponent","egret.DisplayObject"]);var DebugPlatform=function(){function t(){}return t.prototype.getUserInfo=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,{nickName:"username"}]})})},t.prototype.login=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2]})})},t}();__reflect(DebugPlatform.prototype,"DebugPlatform",["Platform"]),window.platform||(window.platform=new DebugPlatform);var PrizePage=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),this.init()},e.prototype.init=function(){this.gWin.visible=!1,this.gLose.visible=!1,this.gTijiaoOk.visible=!1,this.shareBtn2.addEventListener(egret.TouchEvent.TOUCH_END,this.showShare,this),this.homeBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.showHome,this),1==e.pIndex||5==e.pIndex||6==e.pIndex?(this.prizeBit.source="prize"+e.pIndex+"_png",this.gWin.visible=!0,this.tijiaoBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.doTijiao,this)):(this.youhuiBit.source="prize"+window.toValue+"_png",this.gLose.visible=!0,this.shareBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.showShare,this),this.linkBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.doLink,this))},e.prototype.doLink=function(){jumpLink(1)},e.prototype.showShare=function(){doShare()},e.prototype.doReplay=function(){},e.prototype.doTijiao=function(){var t=this.tAdd.text,e=this.tTel.text,i=this.tName.text;doSubmit(i,e,t,function(){egret.log("提交成功 OK"),this.gWin.visible=!1,this.gTijiaoOk.visible=!0,Xiaobin.makeFadeIn(this.gTijiaoOk)}.bind(this))},e.prototype.showHome=function(){MainGame.self.createHome()},e.pIndex=0,e}(eui.Component);__reflect(PrizePage.prototype,"PrizePage",["eui.UIComponent","egret.DisplayObject"]);var QrPage=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this)},e}(eui.Component);__reflect(QrPage.prototype,"QrPage",["eui.UIComponent","egret.DisplayObject"]);var RankBar=function(t){function e(){var e=t.call(this)||this;return e.rankIndex=0,e}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),this.gold.visible=!1},e.prototype.init=function(t,e){this.ma.visible=!0,this.head.mask=this.ma,this.setHeadImg(t.portrait),this.rankIndex=e+1,this.rankTxt.text=this.rankIndex+"",this.setLabel(t.nickname,t.duration,t.number)},e.prototype.setHeadImg=function(t){"localhost"==window.location.host?this.head.source="http://localhost/test.png":this.head.source=t},e.prototype.setLabel=function(t,e,i){var n=t;n.length>5&&(n=n.slice(0,4)+"...");var o,s=16711680,a=255;1==this.rankIndex&&(this.gold.visible=!0),this.rankIndex<=21?(o=s,this.roundDi.fillColor=s):(o=a,this.roundDi.fillColor=a);var r=26;this.t.textFlow=new Array({text:n+"仅用",style:{size:r,textColor:0}},{text:e+"S",style:{size:r,textColor:o}},{text:" 集齐",style:{size:r,textColor:0}},{text:i+"枚",style:{size:r,textColor:o}},{text:"彩蛋",style:{size:r,textColor:0}})},e}(eui.Component);__reflect(RankBar.prototype,"RankBar",["eui.UIComponent","egret.DisplayObject"]);var RankBarNew=function(t){function e(){var e=t.call(this)||this;return e.rankIndex=0,e}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this)},e.prototype.init=function(t){this.ma.visible=!0,this.head.mask=this.ma,this.setHeadImg(t.portrait),this.setLabel(t.nickname,t.duration,t.number)},e.prototype.setHeadImg=function(t){"localhost"==window.location.host?this.head.source="http://localhost/test.png":this.head.source=t},e.prototype.setLabel=function(t,e,i){var n=t;n.length>5&&(n=n.slice(0,4)+"...");var o,s=16711680,a=255;o=this.rankIndex<=21?s:a;var r=26;this.t.textFlow=new Array({text:n+"用时",style:{size:r,textColor:0}},{text:e+"S",style:{size:r,textColor:o}},{text:" 找到彩蛋数:",style:{size:r,textColor:0}},{text:i+"",style:{size:r,textColor:o}},{text:"枚",style:{size:r,textColor:0}})},e}(eui.Component);__reflect(RankBarNew.prototype,"RankBarNew",["eui.UIComponent","egret.DisplayObject"]);var RankEndPage=function(t){function e(){var e=t.call(this)||this;return e.danObj=[],e.newTopObj=[],e}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),e.self=this,this.tipImg.visible=!1,this.btn0.touchChildren=!1,this.btn1.touchChildren=!1,this.btn0.addEventListener(egret.TouchEvent.TOUCH_END,this.doClick,this),this.btn1.addEventListener(egret.TouchEvent.TOUCH_END,this.doClick,this),this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.hideRank,this),easterEggDrawList(function(t){this.danObj=t,this.updateTopList()}.bind(this))},e.prototype.showTipImg=function(){this.tipImg.visible=!0},e.prototype.hideRank=function(){1==this.tipImg.visible?(showTipDIV(),MainGame.self.hideRankEndPage()):MainGame.self.hideRankEndPage()},e.prototype.doClick=function(t){var e=t.target;this.bar.x=e.x,e.x<Main.cenX?this.makeShowTop():0==this.newTopObj.length?rankingDrawList(function(t){1==t.isBeginActivity?this.makeShowNew():(this.newTopObj=t.list,this.updateNewList())}.bind(this)):this.makeShowNew(),MainGame.playClickSound()},e.prototype.updateTopList=function(){console.log("showDan======="),console.log(this.danObj),this.scDan.visible=!0,this.scTop.visible=!1;var t=this.danObj.length;t>50&&(t=50),this.gTop.removeChildren();for(var e=0;t>e;e++){var i=new DanBar;this.gTop.addChild(i);var n=this.danObj[e].nickname,o=this.danObj[e].giftName;i.setData(n,o)}},e.prototype.updateNewList=function(){console.log("showNewView======"),console.log(this.newTopObj),this.scDan.visible=!1,this.scTop.visible=!0;var t=this.newTopObj.length;t>50&&(t=50),this.gNew.removeChildren();for(var e=0;t>e;e++){var i=new DanBar;this.gNew.addChild(i);var n=this.newTopObj[e].nickname,o=this.newTopObj[e].giftName;i.setData(n,o)}},e.prototype.makeShowTop=function(){this.scDan.visible=!0,this.scTop.visible=!1},e.prototype.makeShowNew=function(){this.scDan.visible=!1,this.scTop.visible=!0},e}(eui.Component);__reflect(RankEndPage.prototype,"RankEndPage",["eui.UIComponent","egret.DisplayObject"]);var RankMe=function(t){function e(){var e=t.call(this)||this;return e.rankIndex=0,e}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this)},e.prototype.init=function(t){this.head.source=Main.userInfo.profile_image_url,this.ma.visible=!0,this.head.mask=this.ma,this.setLabel(Main.userInfo.name,t.duration,t.number)},e.prototype.setLabel=function(t,e,i){var n=Main.userInfo.name;n.length>5&&(n=n.slice(0,4)+"...");var o=16776960,s=26;this.t.textFlow=new Array({text:n+"用时",style:{size:s,textColor:0}},{text:e+"S",style:{size:s,textColor:o}},{text:" 找到彩蛋数:",style:{size:s,textColor:0}},{text:i,style:{size:s,textColor:o}},{text:"枚",style:{size:s,textColor:0}})},e}(eui.Component);__reflect(RankMe.prototype,"RankMe",["eui.UIComponent","egret.DisplayObject"]);var RankPage=function(t){function e(){var e=t.call(this)||this;return e.topObj=[],e.newObj=[],e}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),e.self=this,this.tipImg.visible=!1,this.btn0.touchChildren=!1,this.btn1.touchChildren=!1,this.btn0.addEventListener(egret.TouchEvent.TOUCH_END,this.doClick,this),this.btn1.addEventListener(egret.TouchEvent.TOUCH_END,this.doClick,this),this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.hideRank,this),getRankTop(function(t){this.topObj=t.ranking,this.updateTopList(),null==t.self||this.rankMe.init(t.self)}.bind(this))},e.prototype.showTipImg=function(){this.tipImg.visible=!0},e.prototype.hideRank=function(){1==this.tipImg.visible?(showTipDIV(),MainGame.self.hideRankPage()):(MainGame.self.hideRankPage(),showBtnAndImg())},e.prototype.doClick=function(t){var e=t.target;this.bar.x=e.x,e.x<Main.cenX?this.makeShowTop():0==this.newObj.length?getRankNew(function(t){this.newObj=t.ranking,this.updateNewList()}.bind(this)):this.makeShowNew(),MainGame.playClickSound()},e.prototype.updateTopList=function(){console.log("showTopView======="),console.log(this.topObj),this.scTop.visible=!0,this.scNew.visible=!1;
- var t=this.topObj.length;t>50&&(t=50),this.gTop.removeChildren();for(var e=0;t>e;e++){var i=new RankBar;this.gTop.addChild(i),console.log(e),console.log(this.topObj[e]),i.init(this.topObj[e],e)}},e.prototype.updateNewList=function(){console.log("showNewView======"),console.log(this.newObj),this.scTop.visible=!1,this.scNew.visible=!0;var t=this.newObj.length;t>50&&(t=50),this.gNew.removeChildren();for(var e=0;t>e;e++){var i=new RankBarNew;this.gNew.addChild(i),i.init(this.newObj[e])}},e.prototype.makeShowTop=function(){this.scTop.visible=!0,this.scNew.visible=!1},e.prototype.makeShowNew=function(){this.scTop.visible=!1,this.scNew.visible=!0},e}(eui.Component);__reflect(RankPage.prototype,"RankPage",["eui.UIComponent","egret.DisplayObject"]);var RedPoint=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this);for(var e=0;3>e;e++){var i=this["r"+e];i.alpha=0,i.scaleX=i.scaleY=.5;var n=egret.Tween.get(i,ConstData.LOOP).wait(500*e);n.to({scaleX:1,scaleY:1,alpha:.5},500).to({scaleX:1.5,scaleY:1.5,alpha:0},500)}},e}(eui.Component);__reflect(RedPoint.prototype,"RedPoint",["eui.UIComponent","egret.DisplayObject"]);var ResultPage=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),this.haibaoBtn.addEventListener(egret.TouchEvent.TOUCH_END,function(){showHaibao(1)},this)},e}(eui.Component);__reflect(ResultPage.prototype,"ResultPage",["eui.UIComponent","egret.DisplayObject"]);var TestPage=function(t){function e(){var e=t.call(this)||this;return e._touchStatus=!1,e._distance=new egret.Point,e.fyIndex=1,e.recIndex=1,e.toSca=.5,e.endSca=.5,e.MAX_SCALE=1.3,e.MIN_SCALE=.16,e.touchPoints={names:[]},e.distance=0,e.defAngle=0,e.touchCon=0,e._currentBirdRotation=0,e.c=.017453292,e}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),e.self=this,this.gGet.visible=!1,this.gPop.visible=!1,this.gRule.visible=!1,this.gShare.visible=!1},e.prototype.makeDistroy=function(){this.stage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.mouseDown,this),this.stage.removeEventListener(egret.TouchEvent.TOUCH_END,this.mouseUp,this),this.stage.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.mouseMove,this)},e.prototype.showShare=function(){this.gShare.visible=!0,Xiaobin.makeScaleIn(this.gShare,0),MainGame.playClickSound()},e.prototype.closeShare=function(){this.gShare.visible=!1,MainGame.playClickSound()},e.prototype.showRule=function(){this.gRule.visible=!0,Xiaobin.makeScaleIn(this.gRule,0),MainGame.playClickSound()},e.prototype.hideRule=function(){this.gRule.visible=!1,MainGame.playClickSound()},e.prototype.showTip=function(){this.gTip.visible=!0,Xiaobin.makeFadeIn(this.gTip,0),setTimeout(function(){Xiaobin.makeScaleLoop(this.tipImg,1.1,900)}.bind(this),500),setTimeout(function(){this.gTip.addEventListener(egret.TouchEvent.TOUCH_END,this.hideTip,this)}.bind(this),800)},e.prototype.hideTip=function(){this.gTip.visible=!1,this.gTip.removeEventListener(egret.TouchEvent.TOUCH_END,this.hideTip,this),MainGame.playClickSound()},e.prototype.setEggFind=function(t){e.getDanNum++,this.preloadEndBit(),this.gGet.visible=!0,this.getImg.source="img/pop/"+t+".png",Xiaobin.makeScaleIn(this.getImg,0),setTimeout(function(){this.gGet.visible=!1,this.getImg.source="",this.goNext(t)}.bind(this),window.stayTime)},e.prototype.goNext=function(t){var i=this["icon"+t];i.makeDanJump(),e.getDanNum>=15?this.readyGoEnd():getLuckDraw(function(i){1==i.isWinAward?(e.giftId=i.giftId,e.getCaidan=1,this.showPop(t)):console.log("未抽中彩蛋")}.bind(this)),this.popImg.source="p"+t+"_png",this.getEndBgIndex(),this.endTxtImg.source="img/ht"+e.endTxtIndex+".png"},e.prototype.preloadEndBit=function(){e.endBitIndex=this.getRandomEndBit(),this.endBgImg.source="img/hai/hai"+e.endBitIndex+".png"},e.prototype.getEndBgIndex=function(){var t=1;t=e.getDanNum<=5?1:e.getDanNum<=10?2:e.getDanNum<=14?3:4,e.endTxtIndex=t},e.prototype.getRandomEndBit=function(){return console.log("TestPage.getDanNum ==== "+e.getDanNum),e.getDanNum},e.prototype.showPop=function(t){setTimeout(function(){this.gPop.visible=!0,Xiaobin.makeScaleIn(this.gPop,0)}.bind(this),500)},e.prototype.hidePop=function(){this.gPop.visible=!1},e.prototype.createBigMap=function(){if(null==this.bigMap){var t=new BigMap;this._bird.addChild(t),this.bigMap=t}},e.prototype.init=function(){e.getDanNum=0,console.log("Main.hh = "+Main.hh),this.ingameTop.y=-Main.hh;var t=this.ingameCen.y-this.ingameTop.height+Main.hh,i=t/this.ingameCen.height;this.ingameCen.scaleY=i,this.ma.y=this.ingameTop.y+105,this.ma.height=1107-this.ma.y,e.costTime=0,this.secNum=window.secNum,this.secTotal=window.totalNum,this.secTxt.text=this.secNum+"",this.ingameCen.touchEnabled=!1,this.ma.touchEnabled=!1,this.ma.visible=!1,this._bird.touchEnabled=!0,this.popImg.source="",this.getImg.source="",this.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.mouseDown,this),this.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.mouseUp,this),this.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.mouseMove,this),this.initSca(),this.initIcon(),this.tianBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.showInfo,this),this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.showRule,this),this.closeRuleBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.hideRule,this),this.shareBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.showShare,this),this.closeShareBtn.addEventListener(egret.TouchEvent.TOUCH_END,this.closeShare,this);var n=egret.Tween.get(this,ConstData.LOOP);n.to({},300).call(this.updateAni,this);var o=egret.Tween.get(this.secTxt,ConstData.LOOP);o.to({},1e3).call(this.costTime,this),setTimeout(function(){this.preloadEndBit()}.bind(this),1e3),0==window.playCount&&(this.gRule.visible=!0,Xiaobin.makeScaleIn(this.gRule,0)),this.getEndBgIndex()},e.prototype.showInfo=function(){MainGame.self.showInfoPage(),MainGame.playClickSound()},e.prototype.costTime=function(){1!=this.gPop.visible&&1!=this.gTip.visible&&1!=this.gRule.visible&&1!=this.gShare.visible&&1!=this.gGet.visible&&(this.secNum--,this.secNum<=5&&(this.secTxt.scaleX=this.secTxt.scaleY=1.5,MainGame.playDiSound()),this.secNum<=0&&(this.secNum=0,console.log("时间到 !"),egret.Tween.removeAllTweens(),this.readyGoEnd()),this.secTxt.text=this.secNum+"")},e.prototype.readyGoEnd=function(){egret.Tween.removeTweens(this.secTxt);var t=this.secTotal-this.secNum;submitTask(t,e.getDanNum,function(){console.log("提交成功!")}.bind(this)),setTimeout(function(){MainGame.self.goEnd(),endGame()}.bind(this),1e3)},e.prototype.updateAni=function(){this.recIndex++,this.recIndex>4&&(this.recIndex=1),this.recIndex<3?this.recIcon.visible=!1:this.recIcon.visible=!0,this.fyIndex++,this.fyIndex>4&&(this.fyIndex=1),this.fangMc.source="f"+this.fyIndex+"_png",this.bigMap.updateAni()},e.prototype.initIcon=function(){for(var t=1;15>=t;t++){var e=this["icon"+t];e.setIcon(t),e.setHui()}},e.prototype.initSca=function(){this._bird.scaleX=this.toSca,this._bird.scaleY=this._bird.scaleX,this._bird.x=-1760,this._bird.y=-808,this.checkMcPos(this._bird)},e.prototype.doBig=function(){this.toSca+=.3,this.setAnchorCenter(this._bird),this.makeTween()},e.prototype.makeTween=function(){var t=egret.Tween.get(this._bird);t.to({scaleX:this.toSca,scaleY:this.toSca},300)},e.prototype.setAnchorCenter=function(t){var e=t.anchorOffsetX,i=t.anchorOffsetY,n=this._bird.globalToLocal(375,700);console.log("targetPoint 1 = ",n),t.anchorOffsetX=n.x,t.anchorOffsetY=n.y;var o=(n.x-e)*t.scaleX,s=(n.y-i)*t.scaleY;t.x+=o,t.y+=s},e.prototype.checkMcPos=function(t){t.x-t.anchorOffsetX*t.scaleX>this.ma.x&&(t.x=this.ma.x+t.anchorOffsetX*t.scaleX),t.y-t.anchorOffsetY*t.scaleY>this.ma.y&&(t.y=this.ma.y+t.anchorOffsetY*t.scaleY),t.x-t.anchorOffsetX*t.scaleX+t.width*t.scaleX<this.ma.x+this.ma.width&&(t.x=this.ma.x+this.ma.width+t.anchorOffsetX*t.scaleX-t.width*t.scaleX),t.y-t.anchorOffsetY*t.scaleY+t.height*t.scaleY<this.ma.y+this.ma.height&&(t.y=this.ma.y+this.ma.height+t.anchorOffsetY*t.scaleY-t.height*t.scaleY)},e.prototype.doSmall=function(){console.log("doSmall"),this.toSca-=.3,this.setAnchorCenter(this._bird),this.makeTween()},e.prototype.setAnchorNormal=function(t){var e=this.startX*this.toSca-375,i=this.startY*this.toSca-300;t.anchorOffsetX=0,t.anchorOffsetY=0,t.x=e,t.y=i},e.prototype.mouseDown=function(t){null==this.touchPoints[t.touchPointID]&&(this.touchPoints[t.touchPointID]=new egret.Point(t.stageX,t.stageY),this.touchPoints.names.push(t.touchPointID)),this.touchCon++,2==this.touchCon?(this.distance=this.getTouchDistance(),egret.log("distance:"+this.distance),0!=this.distance&&this.setAnchorCenter(this._bird)):1==this.touchCon&&(this._touchStatus=!0,this._distance.x=t.stageX-this._bird.x,this._distance.y=t.stageY-this._bird.y)},e.prototype.mouseMove=function(t){if(this.secNum<=0)return void console.log("noTime");if(1!=this.gPop.visible&&1!=this.gTip.visible&&1!=this.gRule.visible&&1!=this.gShare.visible&&1!=this.gGet.visible){if(0==this.visible)return void console.log("visible false");if(this.touchPoints[t.touchPointID].x=t.stageX,this.touchPoints[t.touchPointID].y=t.stageY,2==this.touchCon){if(0!=this.distance){var e=this.getTouchDistance(),i=e/this.distance;egret.log("scaNum:"+i);var n=this.endSca,o=i*n;o<this.MIN_SCALE&&(o=this.MIN_SCALE),o>this.MAX_SCALE&&(o=this.MAX_SCALE),this._bird.scaleX=o,this._bird.scaleY=this._bird.scaleX,this.checkMcPos(this._bird)}}else 1==this.touchCon&&this._touchStatus&&(this._bird.x=t.stageX-this._distance.x,this._bird.y=t.stageY-this._distance.y,this.checkMcPos(this._bird))}},e.prototype.mouseUp=function(t){delete this.touchPoints[t.touchPointID],2==this.touchCon&&(this.endSca=this._bird.scaleX),this.touchCon--,this._touchStatus=!1},e.prototype.getTouchDistance=function(){var t=0,e=this.touchPoints.names;return t=egret.Point.distance(this.touchPoints[e[e.length-1]],this.touchPoints[e[e.length-2]])},e.costTime=0,e.getDanNum=0,e.giftId=-1,e.getCaidan=0,e}(eui.Component);__reflect(TestPage.prototype,"TestPage",["eui.UIComponent","egret.DisplayObject"]);var ThemeAdapter=function(){function t(){}return t.prototype.getTheme=function(t,e,i,n){function o(t){e.call(n,t)}function s(e){e.resItem.url==t&&(RES.removeEventListener(RES.ResourceEvent.ITEM_LOAD_ERROR,s,null),i.call(n))}var a=this;if("undefined"!=typeof generateEUI)egret.callLater(function(){e.call(n,generateEUI)},this);else if("undefined"!=typeof generateEUI2)RES.getResByUrl("resource/gameEui.json",function(t,i){window.JSONParseClass.setData(t),egret.callLater(function(){e.call(n,generateEUI2)},a)},this,RES.ResourceItem.TYPE_JSON);else if("undefined"!=typeof generateJSON)if(t.indexOf(".exml")>-1){var r=t.split("/");r.pop();var h=r.join("/")+"_EUI.json";generateJSON.paths[t]?egret.callLater(function(){e.call(n,generateJSON.paths[t])},this):RES.getResByUrl(h,function(i){window.JSONParseClass.setData(i),egret.callLater(function(){e.call(n,generateJSON.paths[t])},a)},this,RES.ResourceItem.TYPE_JSON)}else egret.callLater(function(){e.call(n,generateJSON)},this);else RES.addEventListener(RES.ResourceEvent.ITEM_LOAD_ERROR,s,null),RES.getResByUrl(t,o,this,RES.ResourceItem.TYPE_TEXT)},t}();__reflect(ThemeAdapter.prototype,"ThemeAdapter",["eui.IThemeAdapter"]);var ToumingBg=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),this.bg.touchEnabled=!0},e}(eui.Component);__reflect(ToumingBg.prototype,"ToumingBg",["eui.UIComponent","egret.DisplayObject"]);var ToumingBtn=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.partAdded=function(e,i){t.prototype.partAdded.call(this,e,i)},e.prototype.childrenCreated=function(){t.prototype.childrenCreated.call(this),this.bg.alpha=0},e}(eui.Component);__reflect(ToumingBtn.prototype,"ToumingBtn",["eui.UIComponent","egret.DisplayObject"]);var Xiaobin=function(){function t(){}return t.createBitmapByName=function(t){var e=new egret.Bitmap,i=RES.getRes(t);return e.texture=i,e},t.warnInfo=function(t){console.warn(t)},t.makeFadeIn=function(t,e){void 0===e&&(e=0),t.alpha=0;var i=egret.Tween.get(t).wait(e);i.to({alpha:1},500)},t.makeFadeOut=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=null),t.alpha=1;var n=egret.Tween.get(t).wait(e);n.to({alpha:0},500).call(i)},t.makeLeftIn=function(t,e){void 0===e&&(e=0);var i=t.x;t.x-=100,t.alpha=0;var n=egret.Tween.get(t).wait(e);n.to({x:i,alpha:1},500,ConstData.SINE_OUT)},t.makeUp=function(t,e){void 0===e&&(e=0);var i=t.y;t.y+=50,t.alpha=0;var n=egret.Tween.get(t).wait(e);n.to({y:i,alpha:1},500,ConstData.SINE_OUT)},t.makeRotate=function(t,e){void 0===e&&(e=0);var i=t.rotation;t.rotation-=150,t.alpha=0;var n=egret.Tween.get(t).wait(e);n.to({rotation:i,alpha:1},500,ConstData.SINE_OUT)},t.makeRightIn=function(t,e){void 0===e&&(e=0);var i=t.x;t.x+=50,t.alpha=0;var n=egret.Tween.get(t).wait(e);n.to({x:i,alpha:1},500,ConstData.SINE_OUT)},t.makeScaleIn=function(t,e){void 0===e&&(e=0),t.scaleX=t.scaleY=.4,t.alpha=0;var i=egret.Tween.get(t).wait(e);i.to({scaleX:1,scaleY:1,alpha:1},500,ConstData.BACK_OUT)},t.makeScaleLoop=function(t,e,i){t.scaleX=t.scaleY=1;var n=egret.Tween.get(t,ConstData.LOOP);n.to({scaleX:e,scaleY:e},i).to({scaleX:1,scaleY:1},i)},t.makeYLoop=function(t,e,i){var n=t.y-e,o=egret.Tween.get(t,ConstData.LOOP);o.to({y:n},i).to({y:t.y},i)},t.createBitmapByNameJPG=function(t){var e=new egret.Bitmap,i=RES.getRes(t+"_jpg");return e.texture=i,e},t.createBitmapCenterJPG=function(t){var e=new egret.Bitmap,i=RES.getRes(t+"_jpg");return e.texture=i,e.anchorOffsetX=e.width/2,e.anchorOffsetY=e.height/2,e},t.createBitmapByNamePNG=function(t){var e=new egret.Bitmap,i=RES.getRes(t+"_png");return e.texture=i,e},t.createBitmapCenterPNG=function(t){var e=new egret.Bitmap,i=RES.getRes(t+"_png");return e.texture=i,e.anchorOffsetX=e.width/2,e.anchorOffsetY=e.height/2,e},t.createMovieClip=function(t,e){void 0===e&&(e=30);var i=RES.getRes(t+"_json"),n=RES.getRes(t+"_png"),o=new egret.MovieClipDataFactory(i,n),s=new egret.MovieClip(o.generateMovieClipData(t));return s.frameRate=e,s},t.makeHui=function(t){var e=[.2,.5,.5,0,0,.2,.5,.5,0,0,.2,.5,.5,0,0,0,0,0,1,0],i=new egret.ColorMatrixFilter(e);t.filters=[i]},t.makeRed=function(t){var e=[2,0,0,0,200,0,-1,0,0,0,0,0,-1,0,0,0,0,0,1,0],i=new egret.ColorMatrixFilter(e);t.filters=[i]},t.makeWhite=function(t){var e=[1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,0,0,0,1,0],i=new egret.ColorMatrixFilter(e);t.filters=[i]},t.makeLight=function(t){var e=[1,0,0,0,200,0,1,0,0,200,0,0,1,0,200,0,0,0,1,0],i=new egret.ColorMatrixFilter(e);t.filters=[i]},t.makeDark=function(t){var e=[.3,0,0,0,0,0,.3,0,0,0,0,0,.3,0,0,0,0,0,1,0],i=new egret.ColorMatrixFilter(e);t.filters=[i]},t.makeBlue=function(t){var e=[.2,0,0,0,0,0,.6,0,0,0,0,0,1,0,0,0,0,0,1,0],i=new egret.ColorMatrixFilter(e);t.filters=[i]},t.makeNormal=function(t){var e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],i=new egret.ColorMatrixFilter(e);t.filters=[i]},t.makeDarkYellow=function(t){var e=[.7,0,0,0,0,0,.7,0,0,0,0,0,.5,0,0,0,0,0,1,0],i=new egret.ColorMatrixFilter(e);t.filters=[i]},t.hitTest=function(t,e){var i=t.getBounds(),n=e.getBounds();return i.width=t.width,i.height=t.height,n.width=e.width,n.height=e.height,i.x=t.x-i.width/2,i.y=t.y,n.x=e.x-n.width/2,n.y=e.y,i.intersects(n)},t.checkArrRecover=function(t,e){if(0==t.length)for(var i=0;i<e.length;i++)t.push(e[i])},t.makeRandomFromArr=function(t,e){this.checkArrRecover(t,e);var i=Math.floor(Math.random()*t.length),n=t[i];return t.splice(i,1),this.checkArrRecover(t,e),n},t.getRandomFromArr=function(t){var e=Math.floor(Math.random()*t.length),i=t[e];return i},t.setLocalStorageData=function(t,e){"number"==typeof e&&(e=e.toString()),egret.localStorage.setItem(t,e)},t.getLocalStorageData=function(t){return egret.localStorage.getItem(t)},t.delLocalStorageData=function(t){return egret.localStorage.removeItem(t)},t.clearLocalStorageData=function(){egret.localStorage.clear()},t.checkPointDistance=function(t,e){var i=new egret.Point(t.x,t.y),n=new egret.Point(e.x,e.y),o=i.x-n.x,s=i.y-n.y,a=Math.sqrt(o*o+s*s);return a},t.checkIsNull=function(t){return null==t||""==t?!0:!1},t}();__reflect(Xiaobin.prototype,"Xiaobin");
|