home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / zombietypocalypse.swf / scripts / game / Guns / MachineGun.as < prev    next >
Encoding:
Text File  |  2008-09-15  |  2.1 KB  |  83 lines

  1. package game.Guns
  2. {
  3.    import flash.display.MovieClip;
  4.    import flash.events.Event;
  5.    import game.ThisGameManager;
  6.    
  7.    [Embed(source="/_assets/assets.swf", symbol="game.Guns.MachineGun")]
  8.    public class MachineGun extends Gun
  9.    {
  10.        
  11.       
  12.       public var ending:MovieClip;
  13.       
  14.       public function MachineGun()
  15.       {
  16.          addFrameScript(0,frame1,5,frame6,6,frame7,9,frame10);
  17.          super();
  18.          if(this.name.charAt(this.name.length - 1) == "1")
  19.          {
  20.             ThisGameManager.getInstance().guns[2] = this;
  21.             this.addEventListener(FIRE_CPLT,luskiSound);
  22.             ID = 1;
  23.          }
  24.          else
  25.          {
  26.             ThisGameManager.getInstance().guns[3] = this;
  27.             ID = 2;
  28.          }
  29.       }
  30.       
  31.       internal function frame10() : *
  32.       {
  33.          this.gotoAndStop(1);
  34.       }
  35.       
  36.       internal function frame7() : *
  37.       {
  38.          dispatchEvent(new Event("shot_complit"));
  39.       }
  40.       
  41.       internal function frame1() : *
  42.       {
  43.          dispatchEvent(new Event("shot_complit"));
  44.       }
  45.       
  46.       override public function fireTo(param1:int, param2:int, param3:int) : void
  47.       {
  48.          if(this.player.currentBulletsIDs[1] == 1 || this.player.currentBulletsIDs[1] == 3)
  49.          {
  50.             this.fast = "fast";
  51.          }
  52.          else
  53.          {
  54.             this.fast = "standard";
  55.          }
  56.          super.fireTo(param1,param2,param3);
  57.          if(this.player.currentBulletsIDs[1] == 2 || this.player.currentBulletsIDs[1] == 3)
  58.          {
  59.             this.shots = 5;
  60.          }
  61.          else
  62.          {
  63.             this.shots = 10;
  64.          }
  65.          if(this.ID == 1)
  66.          {
  67.             this.addEventListener(FIRE_START,mySound);
  68.          }
  69.       }
  70.       
  71.       internal function frame6() : *
  72.       {
  73.          this.gotoAndStop(1);
  74.       }
  75.       
  76.       private function mySound(param1:Event) : void
  77.       {
  78.          Gun(param1.target).removeEventListener(FIRE_START,mySound);
  79.          this.sManager.giveMachineGunSound();
  80.       }
  81.    }
  82. }
  83.