home *** CD-ROM | disk | FTP | other *** search
- package game.Guns
- {
- import flash.display.MovieClip;
- import flash.events.Event;
- import game.ThisGameManager;
-
- [Embed(source="/_assets/assets.swf", symbol="game.Guns.MachineGun")]
- public class MachineGun extends Gun
- {
-
-
- public var ending:MovieClip;
-
- public function MachineGun()
- {
- addFrameScript(0,frame1,5,frame6,6,frame7,9,frame10);
- super();
- if(this.name.charAt(this.name.length - 1) == "1")
- {
- ThisGameManager.getInstance().guns[2] = this;
- this.addEventListener(FIRE_CPLT,luskiSound);
- ID = 1;
- }
- else
- {
- ThisGameManager.getInstance().guns[3] = this;
- ID = 2;
- }
- }
-
- internal function frame10() : *
- {
- this.gotoAndStop(1);
- }
-
- internal function frame7() : *
- {
- dispatchEvent(new Event("shot_complit"));
- }
-
- internal function frame1() : *
- {
- dispatchEvent(new Event("shot_complit"));
- }
-
- override public function fireTo(param1:int, param2:int, param3:int) : void
- {
- if(this.player.currentBulletsIDs[1] == 1 || this.player.currentBulletsIDs[1] == 3)
- {
- this.fast = "fast";
- }
- else
- {
- this.fast = "standard";
- }
- super.fireTo(param1,param2,param3);
- if(this.player.currentBulletsIDs[1] == 2 || this.player.currentBulletsIDs[1] == 3)
- {
- this.shots = 5;
- }
- else
- {
- this.shots = 10;
- }
- if(this.ID == 1)
- {
- this.addEventListener(FIRE_START,mySound);
- }
- }
-
- internal function frame6() : *
- {
- this.gotoAndStop(1);
- }
-
- private function mySound(param1:Event) : void
- {
- Gun(param1.target).removeEventListener(FIRE_START,mySound);
- this.sManager.giveMachineGunSound();
- }
- }
- }
-