home *** CD-ROM | disk | FTP | other *** search
- package game.panel
- {
- import flash.display.MovieClip;
- import flash.events.Event;
- import flash.text.TextField;
- import game.Player;
- import game.ThisGameManager;
-
- [Embed(source="/_assets/assets.swf", symbol="game.panel.Dock")]
- public class Dock extends MovieClip
- {
-
-
- public var machinee:TextField;
-
- internal var bazookaIcon:MovieClip;
-
- public var armorr:TextField;
-
- internal var rak:MovieClip;
-
- public var grenadess:TextField;
-
- internal var fence:TextField;
-
- public var dumbb:TextField;
-
- internal var armor:TextField;
-
- public var fencee:TextField;
-
- internal var machine:TextField;
-
- internal var hand:TextField;
-
- internal var handIcon:MovieClip;
-
- public var bazookaI:MovieClip;
-
- internal var machineIcon:MovieClip;
-
- public var rakieta:MovieClip;
-
- public var bazookaa:TextField;
-
- public var handI:MovieClip;
-
- public var flypaperr:TextField;
-
- internal var kbin:MovieClip;
-
- internal var bazooka:TextField;
-
- public var handd:TextField;
-
- internal var player:Player;
-
- internal var grenades:TextField;
-
- public var karabin:MovieClip;
-
- internal var dumb:TextField;
-
- public var machineI:MovieClip;
-
- internal var flypaper:TextField;
-
- public function Dock()
- {
- super();
- ThisGameManager.getInstance().dock = this;
- this.cacheAsBitmap = true;
- player = ThisGameManager.getInstance().player;
- hand = TextField(this.getChildByName("handd"));
- machine = TextField(this.getChildByName("machinee"));
- bazooka = TextField(this.getChildByName("bazookaa"));
- grenades = TextField(this.getChildByName("grenadess"));
- flypaper = TextField(this.getChildByName("flypaperr"));
- fence = TextField(this.getChildByName("fencee"));
- dumb = TextField(this.getChildByName("dumbb"));
- armor = TextField(this.getChildByName("armorr"));
- hand.embedFonts = true;
- hand.defaultTextFormat.font = ThisGameManager.getInstance().Ocra.fontName;
- hand.defaultTextFormat.letterSpacing = -3;
- machine.embedFonts = true;
- machine.defaultTextFormat.font = ThisGameManager.getInstance().Ocra.fontName;
- machine.defaultTextFormat.letterSpacing = -3;
- bazooka.embedFonts = true;
- bazooka.defaultTextFormat.font = ThisGameManager.getInstance().Ocra.fontName;
- bazooka.defaultTextFormat.letterSpacing = -3;
- grenades.embedFonts = true;
- grenades.defaultTextFormat.font = ThisGameManager.getInstance().Ocra.fontName;
- flypaper.embedFonts = true;
- flypaper.defaultTextFormat.font = ThisGameManager.getInstance().Ocra.fontName;
- fence.embedFonts = true;
- fence.defaultTextFormat.font = ThisGameManager.getInstance().Ocra.fontName;
- dumb.embedFonts = true;
- dumb.defaultTextFormat.font = ThisGameManager.getInstance().Ocra.fontName;
- armor.embedFonts = true;
- armor.defaultTextFormat.font = ThisGameManager.getInstance().Ocra.fontName;
- handIcon = MovieClip(this.getChildByName("handI"));
- bazookaIcon = MovieClip(this.getChildByName("bazookaI"));
- machineIcon = MovieClip(this.getChildByName("machineI"));
- handIcon.stop();
- bazookaIcon.stop();
- machineIcon.stop();
- kbin = MovieClip(this.getChildByName("karabin"));
- rak = MovieClip(this.getChildByName("rakieta"));
- setAll();
- }
-
- public function updateFlypaper() : void
- {
- flypaper.text = int(player.bullets[4][0]).toString();
- }
-
- public function updateHand(param1:Event) : void
- {
- hand.text = to4Digits(int(player.bullets[0][player.currentBulletsIDs[0]]));
- handIcon.gotoAndStop(player.currentBulletsIDs[0] + 1);
- }
-
- public function updateMachine(param1:Event) : void
- {
- machine.text = to4Digits(int(player.bullets[1][player.currentBulletsIDs[1]]));
- machineIcon.gotoAndStop(player.currentBulletsIDs[1] + 1);
- }
-
- private function to4Digits(param1:int) : String
- {
- var _loc2_:String = null;
- if(param1 < 10)
- {
- _loc2_ = "000" + param1.toString();
- }
- else if(param1 < 100)
- {
- _loc2_ = "00" + param1.toString();
- }
- else if(param1 < 1000)
- {
- _loc2_ = "0" + param1.toString();
- }
- else
- {
- _loc2_ = param1.toString();
- }
- return _loc2_;
- }
-
- public function updateGrenades() : void
- {
- grenades.text = int(player.bullets[3][player.currentBulletsIDs[3]]).toString();
- }
-
- public function updateBazooka(param1:Event) : void
- {
- bazooka.text = to4Digits(int(player.bullets[2][player.currentBulletsIDs[2]]));
- bazookaIcon.gotoAndStop(player.currentBulletsIDs[2] + 1);
- }
-
- public function updateFence() : void
- {
- fence.text = int(player.bullets[5][0]).toString();
- }
-
- public function setAll() : void
- {
- if(player.machineGunEnable)
- {
- kbin.alpha = 1;
- }
- else
- {
- kbin.alpha = 0.5;
- }
- if(player.rocketLauncherEnable)
- {
- rak.alpha = 1;
- }
- else
- {
- rak.alpha = 0.5;
- }
- hand.text = to4Digits(int(player.bullets[0][player.currentBulletsIDs[0]]));
- machine.text = to4Digits(int(player.bullets[1][player.currentBulletsIDs[1]]));
- bazooka.text = to4Digits(int(player.bullets[2][player.currentBulletsIDs[2]]));
- grenades.text = int(player.bullets[3][player.currentBulletsIDs[3]]).toString();
- flypaper.text = int(player.bullets[4][0]).toString();
- fence.text = int(player.bullets[5][0]).toString();
- dumb.text = player.dumbifierLevel.toString();
- armor.text = player.armorLevel.toString();
- handIcon.gotoAndStop(player.currentBulletsIDs[0] + 1);
- machineIcon.gotoAndStop(player.currentBulletsIDs[1] + 1);
- bazookaIcon.gotoAndStop(player.currentBulletsIDs[2] + 1);
- }
- }
- }
-