home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Acao / bubble_tanks_2.swf / scripts / __Packages / Enemy.as < prev    next >
Encoding:
Text File  |  2008-09-02  |  48.4 KB  |  1,143 lines

  1. class Enemy extends MovieClip
  2. {
  3.    var _type;
  4.    var blnBossHead;
  5.    var gunFlagOne;
  6.    var gunFlagTwo;
  7.    var guns;
  8.    var arrEvents;
  9.    var arrSeekers;
  10.    var haltMovie;
  11.    var safetyTurn;
  12.    var numSpeed;
  13.    var numFramesToTurn;
  14.    var numAmountToTurn;
  15.    var minFramesToHoldTurning;
  16.    var setToFrame2;
  17.    var enemyOff;
  18.    var countMachineGun;
  19.    var mGunCount;
  20.    var stunCounter;
  21.    var stickyCounter;
  22.    var strStickyRef;
  23.    var intInfectedCounter;
  24.    var strInfectedRef;
  25.    var blnInfected;
  26.    var intInfectMax;
  27.    var blnInfectImmune;
  28.    var maxLife;
  29.    var numLife;
  30.    var numLastAngle;
  31.    var okStop;
  32.    var isItTime;
  33.    var customFunction1;
  34.    function Enemy()
  35.    {
  36.       super();
  37.       this._type = 1;
  38.       this.blnBossHead = false;
  39.       this.gunFlagOne = true;
  40.       this.gunFlagTwo = true;
  41.       this.guns = new Array();
  42.       this.arrEvents = new Array();
  43.       this.arrSeekers = new Array();
  44.       this.haltMovie = false;
  45.       this.safetyTurn = false;
  46.       this.numSpeed = 0.25;
  47.       this.numFramesToTurn = 0;
  48.       this.numAmountToTurn = 0;
  49.       this.minFramesToHoldTurning = 0;
  50.       this.setToFrame2 = false;
  51.       this.enemyOff = false;
  52.       this.countMachineGun = 0;
  53.       this.mGunCount = 0;
  54.       this.stunCounter = 0;
  55.       this.stickyCounter = 0;
  56.       this.strStickyRef = "";
  57.       this.intInfectedCounter = 0;
  58.       this.strInfectedRef = "";
  59.       this.blnInfected = false;
  60.       this.intInfectMax = 13;
  61.       this.blnInfectImmune = false;
  62.       this.ConfigureEnemy();
  63.       this.maxLife = this.numLife;
  64.       this.gotoAndStop(this.numLife);
  65.    }
  66.    function ConfigureEnemy()
  67.    {
  68.       this.numLife = 1;
  69.       this.numSpeed = 2;
  70.       this.arrEvents.push({name:"Death Award",triggerValue:0,hit:false,custom:false,action:"EVENT_Bubbles",values:Array(5,10)});
  71.    }
  72.    function onEnterFrame()
  73.    {
  74.       if(!this.enemyOff)
  75.       {
  76.          if(this.stunCounter <= 0)
  77.          {
  78.             if(this.stickyCounter <= 0)
  79.             {
  80.                this.mGunDelay();
  81.                if(this.haltMovie == false)
  82.                {
  83.                   this.numLastAngle = this.GetAnglePos();
  84.                   if(this.blnBossHead == true)
  85.                   {
  86.                      this.TurnHead();
  87.                   }
  88.                   else
  89.                   {
  90.                      this.MoveMe();
  91.                   }
  92.                   var _loc5_ = this.AboutToExit();
  93.                   if(this.numFramesToTurn == 0 || _loc5_ == true && this.safetyTurn == false)
  94.                   {
  95.                      if(_loc5_ == true)
  96.                      {
  97.                         var _loc4_ = this.GetAnglePos();
  98.                         if(_loc4_ < 0)
  99.                         {
  100.                            if(_loc4_ < this.numLastAngle)
  101.                            {
  102.                               this.numAmountToTurn = Math.round(Math.random() * -90) - 90;
  103.                            }
  104.                            else
  105.                            {
  106.                               this.numAmountToTurn = Math.round(Math.random() * 90) + 90;
  107.                            }
  108.                         }
  109.                         else if(_loc4_ > this.numLastAngle)
  110.                         {
  111.                            this.numAmountToTurn = Math.round(Math.random() * 90) + 90;
  112.                         }
  113.                         else
  114.                         {
  115.                            this.numAmountToTurn = Math.round(Math.random() * -90) - 90;
  116.                         }
  117.                         this.numFramesToTurn = Math.round(Math.abs(this.numAmountToTurn) / this.numSpeed);
  118.                         this.numAmountToTurn = this.numSpeed * (this.numAmountToTurn / Math.abs(this.numAmountToTurn));
  119.                         this.minFramesToHoldTurning = 90;
  120.                         this.safetyTurn = true;
  121.                      }
  122.                   }
  123.                   else
  124.                   {
  125.                      this.numFramesToTurn = this.numFramesToTurn - 1;
  126.                      this._rotation += this.numAmountToTurn;
  127.                   }
  128.                }
  129.                if(this.minFramesToHoldTurning > 0)
  130.                {
  131.                   this.minFramesToHoldTurning = this.minFramesToHoldTurning - 1;
  132.                }
  133.                else if(this.numFramesToTurn == 0)
  134.                {
  135.                   var _loc3_ = Math.round(Math.random() * 1000);
  136.                   if(_loc3_ < 20)
  137.                   {
  138.                      _loc3_ = Math.round(Math.random() * 200) - 100;
  139.                      this.numFramesToTurn = Math.round(Math.abs(_loc3_) / this.numSpeed);
  140.                      this.numAmountToTurn = this.numSpeed * (_loc3_ / Math.abs(_loc3_));
  141.                      this.safetyTurn = false;
  142.                   }
  143.                }
  144.             }
  145.             else
  146.             {
  147.                this.stickyCounter = this.stickyCounter - 1;
  148.             }
  149.             if(_root.game.SafeToFire() == true)
  150.             {
  151.                this.OperateWeapons();
  152.             }
  153.          }
  154.          else if(this.stunCounter > 0)
  155.          {
  156.             this.stunCounter = this.stunCounter - 1;
  157.          }
  158.          if(this.blnInfected == true)
  159.          {
  160.             if(this.intInfectedCounter == 0)
  161.             {
  162.                this.ReceiveDamage(1,"");
  163.                this.intInfectedCounter = this.intInfectMax;
  164.             }
  165.             this.intInfectedCounter = this.intInfectedCounter - 1;
  166.          }
  167.       }
  168.    }
  169.    function TurnHead()
  170.    {
  171.       var _loc3_ = new Vector();
  172.       _loc3_._x = _root.avatar._x - this._x;
  173.       _loc3_._y = _root.avatar._y - this._y;
  174.       var _loc4_ = _loc3_.AngleToAlign(this._rotation,1,1);
  175.       this._rotation += _loc4_;
  176.       if(this._rotation < 60)
  177.       {
  178.          this._rotation = 60;
  179.       }
  180.       if(this._rotation > 120)
  181.       {
  182.          this._rotation = 120;
  183.       }
  184.    }
  185.    function Stun(amountTime)
  186.    {
  187.       this.stunCounter = amountTime;
  188.    }
  189.    function Sticky(amountTime)
  190.    {
  191.       this.stickyCounter = amountTime;
  192.    }
  193.    function OperateWeapons()
  194.    {
  195.       var i = 0;
  196.       while(i < this.guns.length)
  197.       {
  198.          if(this.guns[i].type == 1)
  199.          {
  200.             var ObjRef = eval("this." + this.guns[i].name);
  201.             var point = {x:ObjRef._x,y:ObjRef._y};
  202.             _root[this._name].localToGlobal(point);
  203.             var startPoint = {x:this._x,y:this._y};
  204.             startPoint.x += ObjRef._x;
  205.             startPoint.y += ObjRef._y;
  206.             var vecDirection = new Vector();
  207.             vecDirection._x = _root.avatar._x - point.x;
  208.             vecDirection._y = _root.avatar._y - point.y;
  209.             var myRadians = Math.atan2(vecDirection._y,vecDirection._x);
  210.             var myDegrees = 360 * myRadians / 6.283185307179586;
  211.             ObjRef._rotation = myDegrees - this._rotation;
  212.             if(this.guns[i].counter < 1)
  213.             {
  214.                var posVector = new Vector();
  215.                var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  216.                var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  217.                ObjRef.localToGlobal(pointTwo);
  218.                posVector._x = pointTwo.x;
  219.                posVector._y = pointTwo.y;
  220.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  221.                this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  222.             }
  223.             else
  224.             {
  225.                this.guns[i].counter--;
  226.             }
  227.          }
  228.          else if(this.guns[i].type == 2)
  229.          {
  230.             if(this.guns[i].counter < 1)
  231.             {
  232.                var posVector = new Vector();
  233.                var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  234.                var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  235.                ObjRefTwo.localToGlobal(pointTwo);
  236.                posVector._x = pointTwo.x;
  237.                posVector._y = pointTwo.y;
  238.                _root.SpawnUnit("Enemy_Seeker",posVector,this._name);
  239.                this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  240.             }
  241.             else
  242.             {
  243.                this.guns[i].counter--;
  244.             }
  245.          }
  246.          else if(this.guns[i].type == 3)
  247.          {
  248.             if(this.guns[i].counter < 1)
  249.             {
  250.                var posVector = new Vector();
  251.                var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  252.                var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  253.                ObjRefTwo.localToGlobal(pointTwo);
  254.                posVector._x = pointTwo.x;
  255.                posVector._y = pointTwo.y;
  256.                _root.SpawnUnit("Enemy_2",posVector,this._name);
  257.                this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  258.             }
  259.             else
  260.             {
  261.                this.guns[i].counter--;
  262.             }
  263.          }
  264.          else if(this.guns[i].type == 4)
  265.          {
  266.             if(this.guns[i].counter < 1)
  267.             {
  268.                if(this.GetDistance2Avatar() <= this.guns[i].size)
  269.                {
  270.                   _root.ReportAvatarDamage(this.guns[i].damage);
  271.                   this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  272.                }
  273.             }
  274.             else
  275.             {
  276.                this.guns[i].counter--;
  277.             }
  278.          }
  279.          else if(this.guns[i].type == 5)
  280.          {
  281.             var ObjRef = eval("this." + this.guns[i].name);
  282.             var point = {x:ObjRef._x,y:ObjRef._y};
  283.             _root[this._name].localToGlobal(point);
  284.             var startPoint = {x:this._x,y:this._y};
  285.             startPoint.x += ObjRef._x;
  286.             startPoint.y += ObjRef._y;
  287.             var vecDirection = new Vector();
  288.             vecDirection._x = _root.avatar._x - point.x;
  289.             vecDirection._y = _root.avatar._y - point.y;
  290.             var myRadians = Math.atan2(vecDirection._y,vecDirection._x);
  291.             var myDegrees = 360 * myRadians / 6.283185307179586;
  292.             ObjRef._rotation = myDegrees - this._rotation;
  293.             if(this.guns[i].counter < 1)
  294.             {
  295.                var posVector = new Vector();
  296.                var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter1");
  297.                var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  298.                ObjRef.localToGlobal(pointTwo);
  299.                posVector._x = pointTwo.x;
  300.                posVector._y = pointTwo.y;
  301.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  302.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter2");
  303.                var pointThree = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  304.                ObjRef.localToGlobal(pointThree);
  305.                posVector._x = pointThree.x;
  306.                posVector._y = pointThree.y;
  307.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  308.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter3");
  309.                var pointFour = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  310.                ObjRef.localToGlobal(pointFour);
  311.                posVector._x = pointFour.x;
  312.                posVector._y = pointFour.y;
  313.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  314.                this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  315.             }
  316.             else
  317.             {
  318.                this.guns[i].counter--;
  319.             }
  320.          }
  321.          else if(this.guns[i].type == 6)
  322.          {
  323.             var ObjRef = eval("this." + this.guns[i].name);
  324.             var point = {x:ObjRef._x,y:ObjRef._y};
  325.             _root[this._name].localToGlobal(point);
  326.             var startPoint = {x:this._x,y:this._y};
  327.             startPoint.x += ObjRef._x;
  328.             startPoint.y += ObjRef._y;
  329.             var vecDirection = new Vector();
  330.             vecDirection._x = _root.avatar._x - point.x;
  331.             vecDirection._y = _root.avatar._y - point.y;
  332.             var myRadians = Math.atan2(vecDirection._y,vecDirection._x);
  333.             var myDegrees = 360 * myRadians / 6.283185307179586;
  334.             ObjRef._rotation = myDegrees - this._rotation;
  335.             if(this.guns[i].counter < 1)
  336.             {
  337.                var posVector = new Vector();
  338.                var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter1");
  339.                var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  340.                ObjRef.localToGlobal(pointTwo);
  341.                posVector._x = pointTwo.x;
  342.                posVector._y = pointTwo.y;
  343.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation - 30,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  344.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter2");
  345.                var pointThree = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  346.                ObjRef.localToGlobal(pointThree);
  347.                posVector._x = pointThree.x;
  348.                posVector._y = pointThree.y;
  349.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  350.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter3");
  351.                var pointFour = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  352.                ObjRef.localToGlobal(pointFour);
  353.                posVector._x = pointFour.x;
  354.                posVector._y = pointFour.y;
  355.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation + 30,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  356.                this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  357.             }
  358.             else
  359.             {
  360.                this.guns[i].counter--;
  361.             }
  362.          }
  363.          else if(this.guns[i].type == 7)
  364.          {
  365.             var ObjRef = eval("this." + this.guns[i].name);
  366.             var point = {x:ObjRef._x,y:ObjRef._y};
  367.             _root[this._name].localToGlobal(point);
  368.             var startPoint = {x:this._x,y:this._y};
  369.             startPoint.x += ObjRef._x;
  370.             startPoint.y += ObjRef._y;
  371.             var vecDirection = new Vector();
  372.             vecDirection._x = _root.avatar._x - point.x;
  373.             vecDirection._y = _root.avatar._y - point.y;
  374.             var myRadians = Math.atan2(vecDirection._y,vecDirection._x);
  375.             var myDegrees = 360 * myRadians / 6.283185307179586;
  376.             ObjRef._rotation = myDegrees - this._rotation;
  377.             if(this.guns[i].counter < 1)
  378.             {
  379.                var posVector = new Vector();
  380.                var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter1");
  381.                var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  382.                ObjRef.localToGlobal(pointTwo);
  383.                posVector._x = pointTwo.x;
  384.                posVector._y = pointTwo.y;
  385.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  386.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter2");
  387.                var pointThree = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  388.                ObjRef.localToGlobal(pointThree);
  389.                posVector._x = pointThree.x;
  390.                posVector._y = pointThree.y;
  391.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  392.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter3");
  393.                var pointFour = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  394.                ObjRef.localToGlobal(pointFour);
  395.                posVector._x = pointFour.x;
  396.                posVector._y = pointFour.y;
  397.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  398.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter4");
  399.                var pointFive = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  400.                ObjRef.localToGlobal(pointFive);
  401.                posVector._x = pointFive.x;
  402.                posVector._y = pointFive.y;
  403.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  404.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter5");
  405.                var pointSix = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  406.                ObjRef.localToGlobal(pointSix);
  407.                posVector._x = pointSix.x;
  408.                posVector._y = pointSix.y;
  409.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  410.                this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  411.             }
  412.             else
  413.             {
  414.                this.guns[i].counter--;
  415.             }
  416.          }
  417.          else if(this.guns[i].type == 8)
  418.          {
  419.             var ObjRef = eval("this." + this.guns[i].name);
  420.             var point = {x:ObjRef._x,y:ObjRef._y};
  421.             _root[this._name].localToGlobal(point);
  422.             var startPoint = {x:this._x,y:this._y};
  423.             startPoint.x += ObjRef._x;
  424.             startPoint.y += ObjRef._y;
  425.             var vecDirection = new Vector();
  426.             vecDirection._x = _root.avatar._x - point.x;
  427.             vecDirection._y = _root.avatar._y - point.y;
  428.             var myRadians = Math.atan2(vecDirection._y,vecDirection._x);
  429.             var myDegrees = 360 * myRadians / 6.283185307179586;
  430.             ObjRef._rotation = myDegrees - this._rotation;
  431.             if(this.guns[i].counter < 1)
  432.             {
  433.                var posVector = new Vector();
  434.                var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter1");
  435.                var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  436.                ObjRef.localToGlobal(pointTwo);
  437.                posVector._x = pointTwo.x;
  438.                posVector._y = pointTwo.y;
  439.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation - 60,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  440.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter2");
  441.                var pointThree = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  442.                ObjRef.localToGlobal(pointThree);
  443.                posVector._x = pointThree.x;
  444.                posVector._y = pointThree.y;
  445.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation - 30,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  446.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter3");
  447.                var pointFour = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  448.                ObjRef.localToGlobal(pointFour);
  449.                posVector._x = pointFour.x;
  450.                posVector._y = pointFour.y;
  451.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  452.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter4");
  453.                var pointFive = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  454.                ObjRef.localToGlobal(pointFive);
  455.                posVector._x = pointFive.x;
  456.                posVector._y = pointFive.y;
  457.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation + 30,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  458.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter5");
  459.                var pointSix = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  460.                ObjRef.localToGlobal(pointSix);
  461.                posVector._x = pointSix.x;
  462.                posVector._y = pointSix.y;
  463.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation + 60,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  464.                this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  465.             }
  466.             else
  467.             {
  468.                this.guns[i].counter--;
  469.             }
  470.          }
  471.          else if(this.guns[i].type == 9)
  472.          {
  473.             var ObjRef = eval("this." + this.guns[i].name);
  474.             var point = {x:ObjRef._x,y:ObjRef._y};
  475.             _root[this._name].localToGlobal(point);
  476.             var startPoint = {x:this._x,y:this._y};
  477.             startPoint.x += ObjRef._x;
  478.             startPoint.y += ObjRef._y;
  479.             var vecDirection = new Vector();
  480.             vecDirection._x = _root.avatar._x - point.x;
  481.             vecDirection._y = _root.avatar._y - point.y;
  482.             var myRadians = Math.atan2(vecDirection._y,vecDirection._x);
  483.             var myDegrees = 360 * myRadians / 6.283185307179586;
  484.             ObjRef._rotation = myDegrees - this._rotation;
  485.             if(this.guns[i].counter < 1)
  486.             {
  487.                var posVector = new Vector();
  488.                var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter1");
  489.                var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  490.                ObjRef.localToGlobal(pointTwo);
  491.                posVector._x = pointTwo.x;
  492.                posVector._y = pointTwo.y;
  493.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation - 60,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  494.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter2");
  495.                var pointThree = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  496.                ObjRef.localToGlobal(pointThree);
  497.                posVector._x = pointThree.x;
  498.                posVector._y = pointThree.y;
  499.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation - 30,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  500.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter3");
  501.                var pointFour = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  502.                ObjRef.localToGlobal(pointFour);
  503.                posVector._x = pointFour.x;
  504.                posVector._y = pointFour.y;
  505.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  506.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter4");
  507.                var pointFive = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  508.                ObjRef.localToGlobal(pointFive);
  509.                posVector._x = pointFive.x;
  510.                posVector._y = pointFive.y;
  511.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation + 30,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  512.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter5");
  513.                var pointSix = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  514.                ObjRef.localToGlobal(pointSix);
  515.                posVector._x = pointSix.x;
  516.                posVector._y = pointSix.y;
  517.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation + 60,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  518.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter6");
  519.                var pointSeven = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  520.                ObjRef.localToGlobal(pointSeven);
  521.                posVector._x = pointSeven.x;
  522.                posVector._y = pointSeven.y;
  523.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation + 90,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  524.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter7");
  525.                var pointEight = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  526.                ObjRef.localToGlobal(pointEight);
  527.                posVector._x = pointEight.x;
  528.                posVector._y = pointEight.y;
  529.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation + 120,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  530.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter8");
  531.                var pointNine = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  532.                ObjRef.localToGlobal(pointNine);
  533.                posVector._x = pointNine.x;
  534.                posVector._y = pointNine.y;
  535.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation + 150,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  536.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter9");
  537.                var pointTen = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  538.                ObjRef.localToGlobal(pointTen);
  539.                posVector._x = pointTen.x;
  540.                posVector._y = pointTen.y;
  541.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation + 180,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  542.                ObjRefTwo = eval("this." + this.guns[i].name + ".emitter10");
  543.                var pointEleven = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  544.                ObjRef.localToGlobal(pointEleven);
  545.                posVector._x = pointEleven.x;
  546.                posVector._y = pointEleven.y;
  547.                _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation + 210,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  548.                this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  549.             }
  550.             else
  551.             {
  552.                this.guns[i].counter--;
  553.             }
  554.          }
  555.          else if(this.guns[i].type == 10)
  556.          {
  557.             var ObjRef = eval("this." + this.guns[i].name);
  558.             var point = {x:ObjRef._x,y:ObjRef._y};
  559.             _root[this._name].localToGlobal(point);
  560.             if(this.guns[i].counter < 1)
  561.             {
  562.                var posVector = new Vector();
  563.                var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  564.                var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  565.                ObjRef.localToGlobal(pointTwo);
  566.                posVector._x = pointTwo.x;
  567.                posVector._y = pointTwo.y;
  568.                _root.EnemyShootSpecial("mine",posVector,0,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  569.                this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  570.             }
  571.             else
  572.             {
  573.                this.guns[i].counter--;
  574.             }
  575.          }
  576.          else if(this.guns[i].type == 11)
  577.          {
  578.             if(this.DoesSeekerExist(this.guns[i].name) == false)
  579.             {
  580.                if(this.guns[i].counter < 1)
  581.                {
  582.                   var spawnedName = "";
  583.                   var posVector = new Vector();
  584.                   var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  585.                   var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  586.                   ObjRefTwo.localToGlobal(pointTwo);
  587.                   posVector._x = pointTwo.x;
  588.                   posVector._y = pointTwo.y;
  589.                   spawnedName = _root.SpawnUnit("Enemy_Orbital_Seeker",posVector,this._name);
  590.                   this.arrSeekers.push({name:spawnedName,from:this.guns[i].name});
  591.                   this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  592.                }
  593.                else
  594.                {
  595.                   this.guns[i].counter--;
  596.                }
  597.             }
  598.          }
  599.          else if(this.guns[i].type == 12)
  600.          {
  601.             var ObjRef = eval("this." + this.guns[i].name);
  602.             var point = {x:ObjRef._x,y:ObjRef._y};
  603.             _root[this._name].localToGlobal(point);
  604.             var startPoint = {x:this._x,y:this._y};
  605.             startPoint.x += ObjRef._x;
  606.             startPoint.y += ObjRef._y;
  607.             var vecDirection = new Vector();
  608.             vecDirection._x = _root.avatar._x - point.x;
  609.             vecDirection._y = _root.avatar._y - point.y;
  610.             var myRadians = Math.atan2(vecDirection._y,vecDirection._x);
  611.             var myDegrees = 360 * myRadians / 6.283185307179586;
  612.             ObjRef._rotation = myDegrees - this._rotation;
  613.             if(this.guns[i].counter < 1)
  614.             {
  615.                var posVector = new Vector();
  616.                var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  617.                var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  618.                ObjRef.localToGlobal(pointTwo);
  619.                posVector._x = pointTwo.x;
  620.                posVector._y = pointTwo.y;
  621.                _root.EnemyShootSpecial("sticky",posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  622.                this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  623.             }
  624.             else
  625.             {
  626.                this.guns[i].counter--;
  627.             }
  628.          }
  629.          else if(this.guns[i].type == 13)
  630.          {
  631.             var ObjRef = eval("this." + this.guns[i].name);
  632.             var point = {x:ObjRef._x,y:ObjRef._y};
  633.             _root[this._name].localToGlobal(point);
  634.             var startPoint = {x:this._x,y:this._y};
  635.             startPoint.x += ObjRef._x;
  636.             startPoint.y += ObjRef._y;
  637.             var vecDirection = new Vector();
  638.             vecDirection._x = _root.avatar._x - point.x;
  639.             vecDirection._y = _root.avatar._y - point.y;
  640.             var myRadians = Math.atan2(vecDirection._y,vecDirection._x);
  641.             var myDegrees = 360 * myRadians / 6.283185307179586;
  642.             ObjRef._rotation = myDegrees - this._rotation;
  643.             this.okStop = false;
  644.             if(this.isItTime)
  645.             {
  646.                if(this.guns[i].counter < 1)
  647.                {
  648.                   var posVector = new Vector();
  649.                   var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  650.                   var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  651.                   ObjRef.localToGlobal(pointTwo);
  652.                   posVector._x = pointTwo.x;
  653.                   posVector._y = pointTwo.y;
  654.                   _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  655.                   this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  656.                }
  657.                else
  658.                {
  659.                   this.guns[i].counter--;
  660.                }
  661.             }
  662.          }
  663.          else if(this.guns[i].type == 14)
  664.          {
  665.             if(this.DoesSeekerExist(this.guns[i].name) == false)
  666.             {
  667.                if(this.guns[i].counter < 1)
  668.                {
  669.                   var spawnedName = "";
  670.                   var posVector = new Vector();
  671.                   var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  672.                   var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  673.                   ObjRefTwo.localToGlobal(pointTwo);
  674.                   posVector._x = pointTwo.x;
  675.                   posVector._y = pointTwo.y;
  676.                   spawnedName = _root.SpawnUnit("Enemy_Sapper",posVector,this._name);
  677.                   this.arrSeekers.push({name:spawnedName,from:this.guns[i].name});
  678.                   this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  679.                }
  680.                else
  681.                {
  682.                   this.guns[i].counter--;
  683.                }
  684.             }
  685.          }
  686.          else if(this.guns[i].type != 15)
  687.          {
  688.             if(this.guns[i].type == 16)
  689.             {
  690.                if(this.DoesSeekerExist(this.guns[i].name) == false)
  691.                {
  692.                   if(this.guns[i].counter < 1)
  693.                   {
  694.                      var spawnedName = "";
  695.                      var posVector = new Vector();
  696.                      var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  697.                      var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  698.                      ObjRefTwo.localToGlobal(pointTwo);
  699.                      posVector._x = pointTwo.x;
  700.                      posVector._y = pointTwo.y;
  701.                      spawnedName = _root.SpawnUnit("Enemy_Leecher",posVector,this._name);
  702.                      this.arrSeekers.push({name:spawnedName,from:this.guns[i].name});
  703.                      this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  704.                   }
  705.                   else
  706.                   {
  707.                      this.guns[i].counter--;
  708.                   }
  709.                }
  710.             }
  711.             else if(this.guns[i].type == 17)
  712.             {
  713.                var ObjRef = eval("this." + this.guns[i].name);
  714.                var point = {x:ObjRef._x,y:ObjRef._y};
  715.                _root[this._name].localToGlobal(point);
  716.                var startPoint = {x:this._x,y:this._y};
  717.                startPoint.x += ObjRef._x;
  718.                startPoint.y += ObjRef._y;
  719.                var vecDirection = new Vector();
  720.                vecDirection._x = _root.avatar._x - point.x;
  721.                vecDirection._y = _root.avatar._y - point.y;
  722.                var myRadians = Math.atan2(vecDirection._y,vecDirection._x);
  723.                var myDegrees = 360 * myRadians / 6.283185307179586;
  724.                this.okStop = false;
  725.                if(!this.isItTime)
  726.                {
  727.                   ObjRef.gotoAndPlay(1);
  728.                }
  729.                if(this.isItTime)
  730.                {
  731.                   if(this.guns[i].counter < 1)
  732.                   {
  733.                      ObjRef._rotation += 5;
  734.                      if(this.isItTime)
  735.                      {
  736.                         if(!this.setToFrame2)
  737.                         {
  738.                            ObjRef.gotoAndPlay(2);
  739.                            this.setToFrame2 = true;
  740.                         }
  741.                      }
  742.                      else
  743.                      {
  744.                         ObjRef.gotoAndPlay(1);
  745.                      }
  746.                      var posVector = new Vector();
  747.                      var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  748.                      var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  749.                      ObjRef.localToGlobal(pointTwo);
  750.                      posVector._x = pointTwo.x;
  751.                      posVector._y = pointTwo.y;
  752.                      _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  753.                      this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  754.                   }
  755.                   else
  756.                   {
  757.                      this.guns[i].counter--;
  758.                   }
  759.                }
  760.             }
  761.             else if(this.guns[i].type == 18)
  762.             {
  763.                var ObjRef = eval("this." + this.guns[i].name);
  764.                var point = {x:ObjRef._x,y:ObjRef._y};
  765.                _root[this._name].localToGlobal(point);
  766.                var startPoint = {x:this._x,y:this._y};
  767.                startPoint.x += ObjRef._x;
  768.                startPoint.y += ObjRef._y;
  769.                var vecDirection = new Vector();
  770.                vecDirection._x = _root.avatar._x - point.x;
  771.                vecDirection._y = _root.avatar._y - point.y;
  772.                var myRadians = Math.atan2(vecDirection._y,vecDirection._x);
  773.                var myDegrees = 360 * myRadians / 6.283185307179586;
  774.                this.okStop = false;
  775.                if(!this.isItTime)
  776.                {
  777.                   ObjRef.gotoAndPlay(1);
  778.                }
  779.                if(this.isItTime)
  780.                {
  781.                   if(this.guns[i].counter < 1)
  782.                   {
  783.                      ObjRef._rotation += 20;
  784.                      if(this.isItTime)
  785.                      {
  786.                         if(!this.setToFrame2)
  787.                         {
  788.                            ObjRef.gotoAndPlay(2);
  789.                            this.setToFrame2 = true;
  790.                         }
  791.                      }
  792.                      else
  793.                      {
  794.                         ObjRef.gotoAndPlay(1);
  795.                      }
  796.                      var posVector = new Vector();
  797.                      var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  798.                      var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  799.                      ObjRef.localToGlobal(pointTwo);
  800.                      posVector._x = pointTwo.x;
  801.                      posVector._y = pointTwo.y;
  802.                      _root.EnemyShoot(posVector,ObjRef._rotation + this._rotation,this.guns[i].speed,this.guns[i].size,this.guns[i].damage);
  803.                      this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  804.                   }
  805.                   else
  806.                   {
  807.                      this.guns[i].counter--;
  808.                   }
  809.                }
  810.             }
  811.             else if(this.guns[i].type == 19)
  812.             {
  813.                if(this.DoesSeekerExist(this.guns[i].name) == false)
  814.                {
  815.                   if(this.guns[i].counter < 1)
  816.                   {
  817.                      var spawnedName = "";
  818.                      var posVector = new Vector();
  819.                      var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  820.                      var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  821.                      ObjRefTwo.localToGlobal(pointTwo);
  822.                      posVector._x = pointTwo.x;
  823.                      posVector._y = pointTwo.y;
  824.                      spawnedName = _root.SpawnUnit("Enemy_Health_Leecher",posVector,this._name);
  825.                      this.arrSeekers.push({name:spawnedName,from:this.guns[i].name});
  826.                      this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  827.                   }
  828.                   else
  829.                   {
  830.                      this.guns[i].counter--;
  831.                   }
  832.                }
  833.             }
  834.             else if(this.guns[i].type == 20)
  835.             {
  836.                if(this.guns[i].counter < 1)
  837.                {
  838.                   var posVector = new Vector();
  839.                   var ObjRefTwo = eval("this." + this.guns[i].name + ".emitter");
  840.                   var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  841.                   ObjRefTwo.localToGlobal(pointTwo);
  842.                   posVector._x = pointTwo.x;
  843.                   posVector._y = pointTwo.y;
  844.                   _root.SpawnUnit("Enemy_96",posVector,this._name);
  845.                   this.guns[i].counter = Math.round(Math.random() * (this.guns[i].fireTimerMax - this.guns[i].fireTimerMin)) + this.guns[i].fireTimerMin;
  846.                }
  847.                else
  848.                {
  849.                   this.guns[i].counter--;
  850.                }
  851.             }
  852.          }
  853.          i++;
  854.       }
  855.    }
  856.    function mGunDelay()
  857.    {
  858.       this.mGunCount = this.mGunCount + 1;
  859.       if(this.mGunCount > 150)
  860.       {
  861.          this.isItTime = true;
  862.          if(this.mGunCount > 250)
  863.          {
  864.             this.isItTime = false;
  865.             this.mGunCount = 0;
  866.          }
  867.       }
  868.       else
  869.       {
  870.          this.setToFrame2 = false;
  871.          this.isItTime = false;
  872.       }
  873.    }
  874.    function ReportLifeIncrease(amountLife)
  875.    {
  876.       this.numLife += amountLife;
  877.       if(this.numLife > this.maxLife)
  878.       {
  879.          this.numLife = this.maxLife;
  880.       }
  881.       this.gotoAndStop(this.numLife);
  882.    }
  883.    function ReceiveDamage(amountDamage, bulletName)
  884.    {
  885.       var returnValue = false;
  886.       this.numLife -= amountDamage;
  887.       var i = 0;
  888.       while(i < this.arrEvents.length)
  889.       {
  890.          if(this.numLife <= this.arrEvents[i].triggerValue && this.arrEvents[i].hit == false || this.arrEvents[i].triggerValue == -1)
  891.          {
  892.             this.arrEvents[i].hit = true;
  893.             if(this.arrEvents[i].custom == true)
  894.             {
  895.                this.customFunction1 = this.arrEvents[i].action;
  896.                this.customFunction1();
  897.             }
  898.             else
  899.             {
  900.                if(this.arrEvents[i].action == "EVENT_Bubbles")
  901.                {
  902.                   var bubbleVector = new Vector();
  903.                   bubbleVector._x = this._x;
  904.                   bubbleVector._y = this._y;
  905.                   _root.game.DropPickupBubbles(this.arrEvents[i].values[0],bubbleVector,this.arrEvents[i].values[1],1);
  906.                }
  907.                if(this.arrEvents[i].action == "EVENT_Bubbles_Large")
  908.                {
  909.                   var bubbleVector = new Vector();
  910.                   bubbleVector._x = this._x;
  911.                   bubbleVector._y = this._y;
  912.                   _root.game.DropPickupBubbles(this.arrEvents[i].values[0],bubbleVector,this.arrEvents[i].values[1],2);
  913.                }
  914.                if(this.arrEvents[i].action == "EVENT_Bubbles_Ultra")
  915.                {
  916.                   var bubbleVector = new Vector();
  917.                   bubbleVector._x = this._x;
  918.                   bubbleVector._y = this._y;
  919.                   _root.game.DropPickupBubbles(this.arrEvents[i].values[0],bubbleVector,this.arrEvents[i].values[1],3);
  920.                }
  921.                else if(this.arrEvents[i].action == "EVENT_DropGun")
  922.                {
  923.                   this.RemoveGun(this.arrEvents[i].values);
  924.                }
  925.                else if(this.arrEvents[i].action == "EVENT_SpeedChange")
  926.                {
  927.                   this.numSpeed = this.arrEvents[i].values;
  928.                }
  929.                else if(this.arrEvents[i].action == "EVENT_Spawn")
  930.                {
  931.                   var myPos = new Vector();
  932.                   myPos._x = this._x;
  933.                   myPos._y = this._y;
  934.                   var t = 0;
  935.                   while(t < this.arrEvents[i].values[1])
  936.                   {
  937.                      _root.SpawnUnit(this.arrEvents[i].values[0],myPos,this._name);
  938.                      t++;
  939.                   }
  940.                }
  941.                else if(this.arrEvents[i].action == "EVENT_SeekersDie")
  942.                {
  943.                   var t = 0;
  944.                   while(t < this.arrSeekers.length)
  945.                   {
  946.                      _root[this.arrSeekers[t].name].Terminate();
  947.                      t++;
  948.                   }
  949.                }
  950.             }
  951.          }
  952.          i++;
  953.       }
  954.       if(bulletName != "")
  955.       {
  956.          var i = 0;
  957.          while(i < this.guns.length)
  958.          {
  959.             if(this.guns[i].type == 15)
  960.             {
  961.                if(this.guns[i].damage == 0)
  962.                {
  963.                   var ObjRef = eval("this." + this.guns[i].name);
  964.                   if(ObjRef.hitTest(_root[bulletName]._x,_root[bulletName]._y,true))
  965.                   {
  966.                      ObjRef.inside.gotoAndPlay("hit");
  967.                      var posVector = new Vector();
  968.                      var ObjRefTwo = eval("this." + this.guns[i].name);
  969.                      var pointTwo = {x:ObjRefTwo._x,y:ObjRefTwo._y};
  970.                      ObjRefTwo._parent.localToGlobal(pointTwo);
  971.                      var s = 0;
  972.                      while(s < 8)
  973.                      {
  974.                         var theta = Math.round(Math.random() * 360);
  975.                         var R = Math.round(Math.random() * (ObjRefTwo._width - 15));
  976.                         posVector._x = R * Math.cos(theta) + pointTwo.x;
  977.                         posVector._y = R * Math.sin(theta) + pointTwo.y;
  978.                         _root.SpawnUnit("Enemy_Seeker",posVector,this._name);
  979.                         s++;
  980.                      }
  981.                      this.guns[i].damage = 1;
  982.                   }
  983.                }
  984.             }
  985.             i++;
  986.          }
  987.          if(_root[bulletName]._type == 3)
  988.          {
  989.             this.Sticky(120);
  990.             this.strStickyRef = _root.game.Effect_Sticky(this._x,this._y);
  991.          }
  992.       }
  993.       if(this.numLife < 1)
  994.       {
  995.          if(this.blnInfected == true)
  996.          {
  997.             _root.game.Gun_SpawnInfectors(this._x,this._y,this.RandNum(1,3));
  998.          }
  999.          if(this.strStickyRef != "")
  1000.          {
  1001.             _root.game.RemoveEffect(this.strStickyRef);
  1002.          }
  1003.          if(this.strInfectedRef != "")
  1004.          {
  1005.             _root.game.RemoveEffect(this.strInfectedRef);
  1006.          }
  1007.          returnValue = true;
  1008.          _root.ReportDeath(this._name);
  1009.          this.removeMovieClip();
  1010.       }
  1011.       else
  1012.       {
  1013.          this.gotoAndStop(this.numLife);
  1014.       }
  1015.       return returnValue;
  1016.    }
  1017.    function ReportSeekerDeath(strName)
  1018.    {
  1019.       var _loc2_ = 0;
  1020.       while(_loc2_ < this.arrSeekers.length)
  1021.       {
  1022.          if(strName == this.arrSeekers[_loc2_].name)
  1023.          {
  1024.             this.arrSeekers.splice(_loc2_,1);
  1025.             break;
  1026.          }
  1027.          _loc2_ = _loc2_ + 1;
  1028.       }
  1029.    }
  1030.    function DoesSeekerExist(gunName)
  1031.    {
  1032.       var _loc3_ = false;
  1033.       var _loc2_ = 0;
  1034.       while(_loc2_ < this.arrSeekers.length)
  1035.       {
  1036.          if(gunName == this.arrSeekers[_loc2_].from)
  1037.          {
  1038.             _loc3_ = true;
  1039.             break;
  1040.          }
  1041.          _loc2_ = _loc2_ + 1;
  1042.       }
  1043.       return _loc3_;
  1044.    }
  1045.    function RemoveGun(strName)
  1046.    {
  1047.       var _loc2_ = 0;
  1048.       while(_loc2_ < this.guns.length)
  1049.       {
  1050.          if(strName == this.guns[_loc2_].name)
  1051.          {
  1052.             this.guns.splice(_loc2_,1);
  1053.             break;
  1054.          }
  1055.          _loc2_ = _loc2_ + 1;
  1056.       }
  1057.    }
  1058.    function MoveMe()
  1059.    {
  1060.       var _loc2_ = new Vector();
  1061.       _loc2_._x = Math.cos(3.141592653589793 * this._rotation / 180) * this.numSpeed + this._x;
  1062.       _loc2_._y = Math.sin(3.141592653589793 * this._rotation / 180) * this.numSpeed + this._y;
  1063.       this._x = _loc2_._x;
  1064.       this._y = _loc2_._y;
  1065.    }
  1066.    function GetAnglePos()
  1067.    {
  1068.       var _loc3_ = new Vector();
  1069.       _loc3_._x = this._x - _root.bg._x;
  1070.       _loc3_._y = this._y - _root.bg._y;
  1071.       var _loc4_ = Math.atan2(_loc3_._y,_loc3_._x);
  1072.       var _loc5_ = 360 * _loc4_ / 6.283185307179586;
  1073.       return _loc5_;
  1074.    }
  1075.    function GetDistance()
  1076.    {
  1077.       var _loc4_ = this._x - _root.bg._x;
  1078.       var _loc3_ = this._y - _root.bg._y;
  1079.       return Math.sqrt(_loc4_ * _loc4_ + _loc3_ * _loc3_);
  1080.    }
  1081.    function GetDistance2Avatar()
  1082.    {
  1083.       var _loc4_ = this._x - _root.avatar._x;
  1084.       var _loc3_ = this._y - _root.avatar._y;
  1085.       return Math.sqrt(_loc4_ * _loc4_ + _loc3_ * _loc3_);
  1086.    }
  1087.    function AboutToExit()
  1088.    {
  1089.       var _loc5_ = false;
  1090.       var _loc6_ = Math.cos(3.141592653589793 * this._rotation / 180) * (this._width + 30 * this.numSpeed) + this._x;
  1091.       var _loc7_ = Math.sin(3.141592653589793 * this._rotation / 180) * (this._width + 30 * this.numSpeed) + this._y;
  1092.       var _loc4_ = _loc6_ - _root.bg._x;
  1093.       var _loc3_ = _loc7_ - _root.bg._y;
  1094.       if(Math.sqrt(_loc4_ * _loc4_ + _loc3_ * _loc3_) > _root.bg.inside._width / 2)
  1095.       {
  1096.          _loc5_ = true;
  1097.       }
  1098.       return _loc5_;
  1099.    }
  1100.    function TurnOff()
  1101.    {
  1102.       this.enemyOff = true;
  1103.    }
  1104.    function TurnOn()
  1105.    {
  1106.       this.enemyOff = false;
  1107.    }
  1108.    function PredictTargetLocation(intDistance, intSpeed)
  1109.    {
  1110.       var _loc2_ = {x:0,y:0};
  1111.       if(this.stunCounter <= 0 && this.stickyCounter <= 0)
  1112.       {
  1113.          var _loc3_ = intDistance / intSpeed;
  1114.          _loc2_.x = Math.cos(3.141592653589793 * this._rotation / 180) * this.numSpeed;
  1115.          _loc2_.y = Math.sin(3.141592653589793 * this._rotation / 180) * this.numSpeed;
  1116.          _loc2_.x *= _loc3_;
  1117.          _loc2_.y *= _loc3_;
  1118.       }
  1119.       _loc2_.x += this._x;
  1120.       _loc2_.y += this._y;
  1121.       return _loc2_;
  1122.    }
  1123.    function Infect()
  1124.    {
  1125.       if(this.blnInfectImmune == false)
  1126.       {
  1127.          if(this.blnInfected == false)
  1128.          {
  1129.             var _loc4_ = new flash.geom.Transform(this);
  1130.             var _loc3_ = new flash.geom.ColorTransform(1,1,1,1,150,-40,-60,0);
  1131.             _loc4_.colorTransform = _loc3_;
  1132.             this.strInfectedRef = _root.game.Effect_Infect(this._x,this._y,this._name);
  1133.             this.blnInfected = true;
  1134.             this.intInfectedCounter = this.intInfectMax;
  1135.          }
  1136.       }
  1137.    }
  1138.    function RandNum(minVal, maxVal)
  1139.    {
  1140.       return Math.round(Math.random() * (maxVal - minVal)) + minVal;
  1141.    }
  1142. }
  1143.