您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > 黑兵-登陆前输入-爱微游-勇士之塔-代码
varmhp=1e+200;//±øµÄѪÁ¿£¬ÖµÔ½´óÔ½¶àѪ¡£1e+200¾ÍÊÇ10µÄ200´Î·½varxing_zou_su_du=10;//ÐÐ×ßËÙ¶Èsi=setInterval(function(){b=UserProxy.getInstance().getHeroInfo();b.speed=xing_zou_su_du;b.maxhp=mhp;},1000);varherorate=1;//1Ϊȫ²¿³öºÚ±ø£¬2Ôò1¸öºÚ±ø£¬1¸öÓÂÕß¡£varmyhero=0;UserProxy.getInstance().createHero=function(){myhero++;if(myhero==herorate){myhero=0;returntrue;}else{returnfalse;}};//Òþ²ØËùÓÐÓÂÊ¿»òÕß±øvarTowerView=function(d){functionf(b){d.call(this);this._chaList=[];this._monsterList=[null,null,null,null,null];this._monsterPosList=[];this._floor=b;this._monsterCount=UserProxy.getInstance().battleField[this._floor-1].length;switch(this._monsterCount){case1:this._monsterPosList.push(180);break;case2:this._monsterPosList.push(240,170);break;case3:this._monsterPosList.push(275,220,165);break;case4:this._monsterPosList.push(320,265,210,155);break;case5:this._monsterPosList.push(340,290,240,190,140)}for(b=0;bthis._monsterCount;b++)this.addMonster(b,!1)}__extends(f,d);varg=f.prototype;g.restore=function(){for(varbinthis._chaList)this._chaList[b].restore()};Object.defineProperty(g,floor,{get:function(){returnthis._floor},enumerable:!0,configurable:!0});Object.defineProperty(g,direction,{get:function(){return0this._floor%2},enumerable:!0,configurable:!0});g.createMonsterId=function(){return125this._floor?Math.floor(80*Math.random())+50:Math.floor(5*Math.random())+this._floor};g.addMonster=function(b,d){vara=UserProxy.getInstance().popTreasure(10*(this._floor-1)+b),c=newMonster(a?1E3:this.createMonsterId(),this._floor,b,d);this._monsterList[b]=c;this.direction?(c.scaleX=1,c.x=this._monsterPosList[b]):(c.scaleX=-1,c.x=480-this._monsterPosList[b]);this.addChild(c);varf=UserProxy.getInstance().battleField[this._floor-1][b];c.maxhp=f.maxhp;c.atk=f.attack;a?(c.coin=a,c.isTreasure=!0):(c.coin=f.coin,c.isTreasure=!1);returnc};g.initCha=function(b){b.floor=this._floor;b.enabled=!0;this._chaList.push(b);this.addChild(b)};g.addCha=function(b){vard=!1;if(1E3==b){vard=UserProxy.getInstance().createHero(),a=newegret.MovieClip(Global.getBombFactory().generateMovieClipData(bomb));a.touchEnabled=!1;this.addChild(a);a.x=this.direction?f.DEST_POS[1]:f.DEST_POS[0];a.y=55;a.play();a.addEventListener(egret.Event.COMPLETE,function(c){a.removeEventListener(egret.Event.COMPLETE,arguments.callee,a);DisplayUtils.removeFromParent(a)},a)}varc=null,c=3E3==b?newCharacter(3E3,this._floor):newCharacter(d?2E3:b,this._floor);if(1E3==b){b=UserProxy.getInstance().getHeroInfo();varh=UserProxy.getInstance().getWeaponParam(7);d?(UserProxy.getInstance().lhBorn++,c.maxhp=3*b.maxhp*(h?1+0.01*h:1),c.atk=5*b.attack*(h?1+0.01*h:1),c.speed=2*b.speed,Notice.show(\u53ec\u5524\u51fa\u4e86\u5df4\u8428\u5361,16776960)):(UserProxy.getInstance().shBorn++,c.maxhp=b.maxhp,c.atk=b.attack,c.speed=b.speed)}else3E3==b?(c.maxhp=1,c.atk=UserProxy.getInstance().demonAttack,c.speed=5):(h=UserProxy.getInstance().getWeaponParam(36),d=UserProxy.getInstance().getSoldierData(b),UserProxy.getInstance().skillProb&&this.floorUserProxy.getInstance().curFloor+1?(c.maxhp=Math.floor(8*d.maxhp*(1+0.01*h)),c.atk=Math.floor(1.5*d.attack*(1+0.01*h))):(c.maxhp=d.maxhp,c.atk=d.attack),c.speed=d.speed);this.initCha(c)};g.upCha=function(b){this.initCha(b);egret.Tween.get(b).to({alpha:1},250)};g.removeCha=function(b){b.parent==this?(this.removeChild(b),this._chaList.splice(this._chaList.indexOf(b),1)):console.log([ErrorremoveCha]chafloor:+b.floor+,towerfloor:+this.floor)};g.monsterDead=function(b){b.die();this.dropGold(b);this._monsterList[b.index]=null;b.index==this._monsterCount-1&&EventManager.getInstance().dispatch(ContextEvent.FLOOR_CLEAN,this._floor)};g.dropGold=function(b){for(vard=b.isTreasure,a=0;a(d?8:3);a++){varc=newDropGold(b.x,90,d);this.addChild(c)}vard=Math.floor(b.coin*(1+0.01*UserProxy.getInstance().skillGoldUp)),f=newegret.TextField;f.anchorX=0.5;f.anchorY=0.5;f.textAlign=egret.HorizontalAlign.CENTER;f.verticalAlign=egret.VerticalAlign.MIDDLE;f.textColor=16776960;f.fontFamily=Global.SYS_FONT;f.size=16;f.bold=!0;f.text=MathUtils.easyNumber(d);f.x=b.x;f.y=70;f.alpha=0.3;egret.Tween.get(f).to({y:58,alpha:1},200,egret.Ease.bounceOut).wait(500).call(function(){DisplayUtils.removeFromParent(f);EventManager.getInstance().dispatch(ContextEvent.REFRESH_BASE)},f);UserProxy.getInstance().gold+=d;UserProxy.getInstance().sendGold+=d;this.addChild(f)};g.update=function(b){vard=[],a;for(ainthis._chaList){varc=this._chaList[a];if(c.enabled)for(varh=0;hthis._monsterList.length;h++){varg=this._monsterList[h];if(g&&g.enabled&&!c.hitIndex){g.damage(c.atk);c.hitMonster(g);break}}}for(h=0;hthis._monsterList.length;h++)(g=this._monsterList[h])&&g.enabled&&g.update(b);c=UserProxy.getInstance().getWeaponParam(6);b=250-Math.floor(Math.min(2.5*c,150));h=500-Math.floor(Math.min(6*c,400));for(aind)c=d[a],c.enabled=!1,c.stop(),egret.Tween.get(c).to({alpha:0},b).wait(h).call(function(){EventManager.getInstance().dispatch(ContextEvent.UP_CHA,this)},c)};g.destory=function(){for(varbinthis._monsterList)this._
本文标题:黑兵-登陆前输入-爱微游-勇士之塔-代码
链接地址:https://www.777doc.com/doc-4367583 .html