STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229595
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/97505491?noj=FRM97505491-22DC" width="1" height="1"></div>

Galactic Rebellion.swf

This is the info page for
Flash #48005

(Click the ID number above for more basic data on this flash file.)


Text
Loading:

Galactic Rebellion

<p align="center"><font face="Army" size="14" color="#000000" letterSpacing="0.000000" kerning="1"><b>presents</b></font></p>

Start Game

Wall Of Fame

Play All Levels

<p align="center"><font face="Witless" size="20" color="#ffffff" letterSpacing="0.000000" kerning="1"><b>Play More Games</b></font></p>

<p align="left"><font face="Witless" size="20" color="#ffffff" letterSpacing="0.000000" kerning="1"><b>This Game On Your Website</b></font></p>

Galactic Rebellion

Galactic Empire

Rebel Alliance

<p align="center"><font face="Tahoma" size="16" color="#ffffff" letterSpacing="0.000000" kerning="1"><b>Victory</b></font></p>

Killed:

Lost:

Crystals:

Built:

Bombs used:

<p align="left"><font face="Tahoma" size="14" color="#ff9900" letterSpacing="0.000000" kerning="1"><b>535</b></font></p>

<p align="left"><font face="Tahoma" size="14" color="#ff0000" letterSpacing="0.000000" kerning="1"><b>17</b></font></p>

<p align="left"><font face="Tahoma" size="14" color="#00ccff" letterSpacing="0.000000" kerning="1"><b>3413413</b></font></p>

<p align="left"><font face="Tahoma" size="14" color="#ffffff" letterSpacing="0.000000" kerning="1"><b>22</b></font></p>

<p align="left"><font face="Tahoma" size="14" color="#ffffff" letterSpacing="0.000000" kerning="1"><b>5</b></font></p>

Total score:

<p align="left"><font face="Tahoma" size="14" color="#ffffff" letterSpacing="0.000000" kerning="1"><b>232342</b></font></p>

Play Again

Main Menu

Continue

About six months after the death of the Emperor,
Dave Rickghama declared the Rebellion (which
became the Alliance of Free Galaxy) to be at an
end, and she declared the New Galaxy Republic to
be established as the successor state.
This government collapsed during the Shaddam
Sink invasion of the galaxy and its collapse
became clear because it traded order for freedom
and its control over the galaxy was minimal. By
allowing the galaxy to sustain on a simple ideal
rather than having it controlled by bureaucracy.
Later, it was re-organized into the Galactic
Alliance...

Victory!

Submit Score

Sell for 40533

Upgrade

ON

OFF

Laser Cannon

Best for all
round defense
+ chance to stan

25

Big

3

150

+25

+3

+150

1000/1000

building

Menu

S

Pause

Skip Tutorial

Starter's Guide

1. The goal of the game is to protect your Command Center from
being destroyed by invaders. You have to withstand all enemy waves
to advance a level.

Command Center

2. In order to protect your base
you have to build strong
security shield around your
Command Center and other
buildings. To build a turret your
need to click on the appropriate
button at the right side menu
and place the turret at the
battlefield.

Page 1/5

1. You can build turrets only if you have sufficient amount
of crystals and energy.

3. Build Refineries to mine resources - crystals.
Each Refinery has one harvester for minning and
it is created automatically once Refinery is built.

Refinery

Harvester

2. In order to increase energy rate you must build
Power Stations. Each Power Station will raise energy
rate by 5 points. Each turret, harvester, building
except Power Station uses one energy point. Your
Command Center delivers 10 initial energy points.
In-game adviser will help you to know when you need
more Power Stations.

Power Station

Page 2/5

Crystals

There are two types of enemies you will be faced: ground enemies and flying ones.
Each of your turrets has special abilities of its own and can damage only ground units, only
air of both.

Page 3/5

Laser Cannon
Most simple and cheap defender. Land + Air

Artillery
Heavier that Laser Cannon but for ground units only. Ground only

Missile Turret
Best antiaircraft defender. Air only

Plasma Mortar
Best defender ever. Good armor and damage rate. Land + Air

Stunner
Stuns a unit for some time. Bosses are stunned for less time than usual units. Land + Air

Damaged turrets can be repaired by pressing
Repair button at the Unit Info panel. You can
stop repair process by pressing repair button
again.

Page 4/5

You can upgrade units by pressing Upgrade
button at the Unit Info panel if you have
sufficient amount of crystals.

You can use group selection to select up to 8
units and use Repair, Sell or Upgrade abilities on
the all selected units at one time.

Select a unit by clicking on it at the battlefield.
You can see parameters of the selected unit at
the right side of the game screen.

Use this button
to sell a unit

Repair
button

Upgrade
button

Send Nitro Bomb, Cumulative Bomb or Nuclear Missile to damage enemies. But be
careful: bombs have wide range of damage. Remember: the closer to epicenter of
explosion - the bigger damage.

1. Start level by building extra Refinery if you have sufficient amount of
crystals. It will give you an advantage.

Nitro Bomb

Cumulative Bomb

Nuclear Missile

Page 5/5

2. Build turrets with higher armor at the front of the others. It'll make your shield less damageable.

Tips:

You can control targets upon which your turrets fire. To change an attack target of a turret,
click Attack button or use shortcut (A) on your keyboard and when a green cursor will appear,
select a target within turret's fire range. To stop attack, just click Stop button or press (Space).
If an enemy is exists in the turret's fire range, it will start to attack automatically.

Attack buton

Stop buton

Area Radar

Enemies:

0

Wave:

1/X

1. At the periphery

1. At the periphery

2. Tarentin

2. Tarentin

3. Tatuim

3. Tatuim

4. Moon of Omderoon

4. Moon of Omderoon

5. Kalarbik

5. Kalarbik

6. Mantuim

6. Mantuim

7. Battlestation

7. Battlestation

8. Antiock

8. Antiock

9. Antiock Counter Strike

9. Antiock Counter Strike

10. Forests of Priah

10. Forests of Priah

11. Moon of the Capitol

11. Moon of the Capitol

12. The Capitol

12. The Capitol

Level 1: At the periphery

With the Old Republic gone, an outcry of resistance begins to spread across the galaxy in protest to the new Empire's tyranny.  We must make first strike to capture distant Empire’s station and use it as the general camp for our forces.

Waves:

10

Play Next

Resume Game

Level 3 was not completed

Continue Next Level
Only at DragonGamez.com!

Sound:

Score:

25000

250

55/300

00:37

Send Next

Send Next

Pause...

Click: Select Unit
Shift+Click: Deselect Unit
Ctrl+Click: Select Unit Type

Advisor

<p align="left"><font face="Tahoma" size="12" color="#ffffff" letterSpacing="0.000000" kerning="1"><b>Too many enemies on the field.</b></font></p>

<p align="left"><font face="Tahoma" size="12" color="#ffffff" letterSpacing="0.000000" kerning="1">Nuclear Bomb (N)</font></p>

<p align="left"><font face="Tahoma" size="12" color="#ffffff" letterSpacing="0.000000" kerning="1">100</font></p>

Epicenter:

<p align="left"><font face="Tahoma" size="12" color="#ffcc00" letterSpacing="0.000000" kerning="1">5000</font></p>

<p align="center"><font face="Times New Roman" size="16" color="#00ff00" letterSpacing="0.000000" kerning="1"><b>Buildings</b></font></p>

ActionScript [AS3]

Section 1
//CumulativeBomb (fai.bomb.CumulativeBomb) package fai.bomb { import fai.*; import flash.events.*; import flash.display.*; import flash.utils.*; public class CumulativeBomb extends Sprite { private var droppoint:Position;// = null public var bombtimer:Timer;// = null private var curscale:Number;// = 0 private var groundLeft:Boolean;// = true private var engine:Engine;// = null private var esprite:AnimatedBitmap;// = null private var frame:int;// = 0 private var step:Number;// = 3 private var pause:int;// = 0 private static const startScale:Number = 3; private static const endScale:Number = 0.1; public function CumulativeBomb(_arg1:Position=null, _arg2:Engine=null):void{ var _local3:BitmapData; engine = null; bombtimer = null; curscale = 0; step = 3; frame = 0; pause = 0; droppoint = null; esprite = null; groundLeft = true; super(); if (!_arg2){ return; }; engine = _arg2; x = (_arg1.x * Consts.cell_size); y = (_arg1.y * Consts.cell_size); scaleY = (scaleX = startScale); _local3 = engine.sloader.specials[UnitTypes.cumulative_bomb]; esprite = new AnimatedBitmap(_local3, _local3.height, _local3.height); droppoint = _arg1; } private function makeDamage():void{ var _local1:int; var _local2:Unit; var _local3:Number; _local1 = 0; _local2 = null; while (_local1 < engine.game_board.my_camp.units.length) { _local2 = engine.game_board.my_camp.units[_local1]; _local3 = Camp.distanceFrom(droppoint, _local2); calculateDamage(_local2, _local3); if (_local2.isAlive()){ _local1++; }; }; _local1 = 0; while (_local1 < engine.game_board.enemy_camp.units.length) { _local2 = engine.game_board.enemy_camp.units[_local1]; _local3 = Camp.distanceFrom(droppoint, _local2); calculateDamage(_local2, _local3); if (_local2.isAlive()){ _local1++; }; }; } public function clean():void{ if (bombtimer){ bombtimer.stop(); bombtimer.removeEventListener(TimerEvent.TIMER, timerfunc); bombtimer = null; }; engine.game_board.positionLayers(); if (!frame){ engine.game_board.bulletlayer.removeChild(this); } else { if (((esprite) && ((frame >= esprite.nframes)))){ engine.game_board.bulletlayer.removeChild(esprite); esprite = null; }; }; } public function start():void{ curscale = startScale; bombtimer = new Timer(50); bombtimer.addEventListener(TimerEvent.TIMER, timerfunc); bombtimer.start(); } private function calculateDamage(_arg1:Unit, _arg2:Number):void{ if (_arg2 <= 2){ engine.game_process.hitUnit(1000, _arg1); } else { if (_arg2 <= 3){ engine.game_process.hitUnit(200, _arg1); } else { if (_arg2 <= 5){ engine.game_process.hitUnit(50, _arg1); }; }; }; } private function timerfunc(_arg1:TimerEvent):void{ if (engine.paused){ return; }; if (curscale > endScale){ curscale = (curscale - (3 / (step * step))); step = (step + 0.31); scaleY = (scaleX = curscale); } else { if (!frame){ esprite.x = x; esprite.y = y; esprite.x = (esprite.x - (esprite.width / 2)); esprite.y = (esprite.y - (esprite.height / 2)); engine.game_board.bulletlayer.addChild(esprite); engine.game_board.bulletlayer.removeChild(this); makeDamage(); engine.playSound(Sounds.explosion1); engine.playSound(Sounds.explosion1); } else { if (frame >= esprite.nframes){ bombtimer.stop(); bombtimer.removeEventListener(TimerEvent.TIMER, timerfunc); bombtimer = null; engine.game_board.bulletlayer.removeChild(esprite); esprite = null; engine.game_board.positionLayers(); return; }; }; if (groundLeft){ engine.game_board.backgr.x = ((-(Consts.cell_size) / 2) - 2); engine.game_board.unitlayer.x = ((Consts.cell_size / 2) - 2); } else { engine.game_board.backgr.x = (-(Consts.cell_size) / 2); engine.game_board.unitlayer.x = (Consts.cell_size / 2); }; groundLeft = !(groundLeft); if (pause > 0){ pause--; return; }; esprite.setFrame(frame); frame++; pause = 2; }; } } }//package fai.bomb
Section 2
//NitroBomb (fai.bomb.NitroBomb) package fai.bomb { import fai.*; import flash.events.*; import flash.display.*; import flash.utils.*; public class NitroBomb extends Sprite { private var droppoint:Position;// = null public var bombtimer:Timer;// = null private var curscale:Number;// = 0 private var engine:Engine;// = null private var esprite:AnimatedBitmap;// = null private var frame:int;// = 0 private var step:Number;// = 3 private var pause:int;// = 0 private static const startScale:Number = 3; private static const endScale:Number = 0.1; public function NitroBomb(_arg1:Position=null, _arg2:Engine=null):void{ var _local3:BitmapData; engine = null; bombtimer = null; curscale = 0; step = 3; frame = 0; pause = 0; droppoint = null; esprite = null; super(); if (!_arg2){ return; }; engine = _arg2; x = (_arg1.x * Consts.cell_size); y = (_arg1.y * Consts.cell_size); scaleY = (scaleX = startScale); _local3 = engine.sloader.specials[UnitTypes.nitro_bomb]; esprite = new AnimatedBitmap(_local3, _local3.height, _local3.height); droppoint = _arg1; } private function makeDamage():void{ var _local1:int; var _local2:Unit; var _local3:Number; _local1 = 0; _local2 = null; while (_local1 < engine.game_board.my_camp.units.length) { _local2 = engine.game_board.my_camp.units[_local1]; _local3 = Camp.distanceFrom(droppoint, _local2); calculateDamage(_local2, _local3); if (_local2.isAlive()){ _local1++; }; }; _local1 = 0; while (_local1 < engine.game_board.enemy_camp.units.length) { _local2 = engine.game_board.enemy_camp.units[_local1]; _local3 = Camp.distanceFrom(droppoint, _local2); calculateDamage(_local2, _local3); if (_local2.isAlive()){ _local1++; }; }; } public function clean():void{ if (bombtimer){ bombtimer.stop(); bombtimer.removeEventListener(TimerEvent.TIMER, timerfunc); bombtimer = null; }; if (!frame){ engine.game_board.bulletlayer.removeChild(this); } else { if (((esprite) && ((frame >= esprite.nframes)))){ engine.game_board.bulletlayer.removeChild(esprite); esprite = null; }; }; } public function start():void{ curscale = startScale; bombtimer = new Timer(50); bombtimer.addEventListener(TimerEvent.TIMER, timerfunc); bombtimer.start(); } private function calculateDamage(_arg1:Unit, _arg2:Number):void{ if (_arg2 <= 1){ engine.game_process.hitUnit(250, _arg1); } else { if (_arg2 <= 2){ engine.game_process.hitUnit(100, _arg1); } else { if (_arg2 <= 4){ engine.game_process.hitUnit(50, _arg1); }; }; }; } private function timerfunc(_arg1:TimerEvent):void{ if (engine.paused){ return; }; if (curscale > endScale){ curscale = (curscale - (3 / (step * step))); step = (step + 0.2); scaleY = (scaleX = curscale); } else { if (!frame){ esprite.x = x; esprite.y = y; esprite.x = (esprite.x - (esprite.width / 2)); esprite.y = (esprite.y - (esprite.height / 2)); engine.game_board.bulletlayer.addChild(esprite); engine.game_board.bulletlayer.removeChild(this); makeDamage(); engine.playSound(Sounds.explosion1); } else { if (frame >= esprite.nframes){ bombtimer.stop(); bombtimer.removeEventListener(TimerEvent.TIMER, timerfunc); bombtimer = null; engine.game_board.bulletlayer.removeChild(esprite); esprite = null; return; }; }; if (pause > 0){ pause--; return; }; esprite.setFrame(frame); frame++; pause = 1; }; } } }//package fai.bomb
Section 3
//NuclearMissile (fai.bomb.NuclearMissile) package fai.bomb { import fai.*; import flash.events.*; import flash.display.*; import flash.utils.*; public class NuclearMissile extends Sprite { private var droppoint:Position;// = null public var bombtimer:Timer;// = null private var curscale:Number;// = 0 private var groundLeft:Boolean;// = true private var engine:Engine;// = null private var esprite:AnimatedBitmap;// = null private var frame:int;// = 0 private var step:Number;// = 3 private var pause:int;// = 0 private static const startScale:Number = 3; private static const endScale:Number = 0.1; public function NuclearMissile(_arg1:Position=null, _arg2:Engine=null):void{ var _local3:BitmapData; engine = null; bombtimer = null; curscale = 0; step = 3; frame = 0; pause = 0; droppoint = null; esprite = null; groundLeft = true; super(); if (!_arg2){ return; }; engine = _arg2; x = (_arg1.x * Consts.cell_size); y = (_arg1.y * Consts.cell_size); scaleY = (scaleX = startScale); _local3 = engine.sloader.specials[UnitTypes.nuclear_missile]; esprite = new AnimatedBitmap(_local3, _local3.height, _local3.height); esprite.scaleX = (esprite.scaleY = 2); droppoint = _arg1; } private function makeDamage():void{ var _local1:int; var _local2:Unit; var _local3:Number; _local1 = 0; _local2 = null; while (_local1 < engine.game_board.my_camp.units.length) { _local2 = engine.game_board.my_camp.units[_local1]; _local3 = Camp.distanceFrom(droppoint, _local2); calculateDamage(_local2, _local3); if (_local2.isAlive()){ _local1++; }; }; _local1 = 0; while (_local1 < engine.game_board.enemy_camp.units.length) { _local2 = engine.game_board.enemy_camp.units[_local1]; _local3 = Camp.distanceFrom(droppoint, _local2); calculateDamage(_local2, _local3); if (_local2.isAlive()){ _local1++; }; }; } public function clean():void{ if (bombtimer){ bombtimer.stop(); bombtimer.removeEventListener(TimerEvent.TIMER, timerfunc); bombtimer = null; }; engine.game_board.positionLayers(); if (!frame){ engine.game_board.bulletlayer.removeChild(this); } else { if (((esprite) && ((frame >= esprite.nframes)))){ engine.game_board.bulletlayer.removeChild(esprite); esprite = null; }; }; } public function start():void{ curscale = startScale; bombtimer = new Timer(50); bombtimer.addEventListener(TimerEvent.TIMER, timerfunc); bombtimer.start(); } private function calculateDamage(_arg1:Unit, _arg2:Number):void{ if (_arg2 <= 2){ engine.game_process.hitUnit(5000, _arg1); } else { if (_arg2 <= 3){ engine.game_process.hitUnit(500, _arg1); } else { if (_arg2 <= 4){ engine.game_process.hitUnit(100, _arg1); } else { if (_arg2 <= 6){ engine.game_process.hitUnit(50, _arg1); } else { if (_arg2 <= 8){ engine.game_process.hitUnit(35, _arg1); }; }; }; }; }; } private function timerfunc(_arg1:TimerEvent):void{ if (engine.paused){ return; }; if (curscale > endScale){ curscale = (curscale - (3 / (step * step))); step = (step + 0.35); scaleY = (scaleX = curscale); } else { if (!frame){ esprite.x = x; esprite.y = y; esprite.x = (esprite.x - (esprite.width / 2)); esprite.y = (esprite.y - (esprite.height / 2)); engine.game_board.bulletlayer.addChild(esprite); engine.game_board.bulletlayer.removeChild(this); makeDamage(); engine.playSound(Sounds.explosion1); engine.playSound(Sounds.explosion1); engine.playSound(Sounds.explosion1); } else { if (frame >= esprite.nframes){ bombtimer.stop(); bombtimer.removeEventListener(TimerEvent.TIMER, timerfunc); bombtimer = null; esprite.visible = false; engine.game_board.bulletlayer.removeChild(esprite); esprite = null; engine.game_board.positionLayers(); return; }; }; if (groundLeft){ engine.game_board.backgr.x = ((-(Consts.cell_size) / 2) - 2); engine.game_board.unitlayer.x = ((Consts.cell_size / 2) - 2); } else { engine.game_board.backgr.x = (-(Consts.cell_size) / 2); engine.game_board.unitlayer.x = (Consts.cell_size / 2); }; groundLeft = !(groundLeft); if (pause > 0){ pause--; return; }; esprite.setFrame(frame); frame++; pause = 1; }; } } }//package fai.bomb
Section 4
//AnimatedBitmap (fai.AnimatedBitmap) package fai { import flash.display.*; import flash.geom.*; public class AnimatedBitmap extends Bitmap { private var point:Point;// = null private var rect:Rectangle;// = null public var curbuffer:BitmapData;// = null public var nframes:uint;// = 0 public var framen:uint;// = 0 public function AnimatedBitmap(_arg1:BitmapData, _arg2:int, _arg3:int):void{ nframes = 0; curbuffer = null; framen = 0; point = null; rect = null; super(new BitmapData(_arg2, _arg3, true, 0), "auto", true); point = new Point(0, 0); setBuffer(_arg1); } public function setBuffer(_arg1:BitmapData):void{ if (((_arg1) && (!((curbuffer == _arg1))))){ curbuffer = _arg1; nframes = (curbuffer.width / width); framen = 0; draw(); }; } public function setFrame(_arg1:uint):void{ if (_arg1 == framen){ return; }; framen = _arg1; draw(); } private function draw():void{ var _local1:BitmapData; _local1 = bitmapData; rect = new Rectangle((framen * width), 0, width, height); _local1.copyPixels(curbuffer, rect, point); bitmapData = _local1; smoothing = true; } } }//package fai
Section 5
//Astar (fai.Astar) package fai { public class Astar { private var maxf:uint;// = 0 public var ns:Array; public var checkxy:Function;// = null public var destination:Position; private var tempg:uint;// = 0 private var temph:uint;// = 0 public var tid:uint;// = 0 private var node:AstarNode;// = null public var map:MapMatrix;// = null private var nextbestpos:Position;// = null private var startnode:AstarNode;// = null private var cnode:AstarNode;// = null private var opened:AstarMap;// = null private var closed:AstarMap;// = null private var onode:AstarNode;// = null private var openedMap:AstarMap;// = null private var curf:int;// = 0 public static var npasses:int = 0; public function Astar(_arg1:MapMatrix, _arg2:int):void{ checkxy = null; map = null; ns = new Array(); opened = null; closed = null; openedMap = null; nextbestpos = null; tid = 0; tempg = 0; temph = 0; maxf = 0; curf = 0; onode = null; cnode = null; startnode = null; node = null; destination = new Position(); super(); checkxy = checkwallid; map = _arg1; tid = _arg2; } public function allgood(_arg1:uint, _arg2:uint):Boolean{ return (true); } public function findNearPlace(_arg1:Position, _arg2:int=0):void{ var _local3:int; var _local4:int; var _local5:int; _local3 = _arg2; while (true) { _local4 = (_arg1.x - _local3); while (_local4 <= (_arg1.x + _local3)) { _local5 = (_arg1.y - _local3); while (_local5 <= (_arg1.y + _local3)) { if ((((((((_local4 >= 0)) && ((_local5 >= 0)))) && ((_local4 < map.h)))) && ((_local5 < map.v)))){ if (checkxy(_local4, _local5)){ destination.set(_local4, _local5); return; }; }; _local5++; }; _local4++; }; _local3++; if (((((((((_arg1.x - _local3) < 0)) && (((_arg1.x + _local3) >= map.h)))) && (((_arg1.y - _local3) < 0)))) && (((_arg1.y + _local3) >= map.v)))){ destination = null; return; }; }; } public function hestimate(_arg1:Position, _arg2:Position):uint{ return ((Math.abs((_arg1.x - _arg2.x)) + Math.abs((_arg1.y - _arg2.y)))); } public function checknotempty(_arg1:uint, _arg2:uint):Boolean{ return (!(map.getxy(_arg1, _arg2))); } public function startDirectSearch(_arg1:Position, _arg2:Position):Boolean{ nextbestpos = null; ns.length = 0; opened = new AstarMap(); openedMap = new AstarMap(); closed = new AstarMap(); tempg = 0; temph = 0; maxf = 0; curf = 0; onode = null; cnode = null; destination = new Position(); destination.copy(_arg2); if (!destination){ return (false); }; startnode = new AstarNode(); node = null; startnode.pos = _arg1; startnode.f = (startnode.h = hestimate(_arg1, destination)); addToOpened(startnode); return (true); } public function checkwall(_arg1:uint, _arg2:uint):Boolean{ return (!((Consts.Wall == map.getxy(_arg1, _arg2)))); } private function addToOpened(_arg1:AstarNode):void{ opened.add(_arg1.key(), _arg1); openedMap.add(_arg1.h, _arg1); } public function startSearch(_arg1:Position, _arg2:Position):Boolean{ nextbestpos = null; ns.length = 0; opened = new AstarMap(); openedMap = new AstarMap(); closed = new AstarMap(); tempg = 0; temph = 0; maxf = 0; curf = 0; onode = null; cnode = null; findNearPlace(_arg2); if (!destination){ return (false); }; startnode = new AstarNode(); node = null; startnode.pos = _arg1; startnode.f = (startnode.h = hestimate(_arg1, destination)); addToOpened(startnode); return (true); } public function search(_arg1:Array):Boolean{ var _local2:Position; var _local3:AstarNode; var _local4:AstarNode; while (!(opened.empty())) { npasses--; if (npasses <= 0){ return (true); }; node = getBestNode(); if (node.pos.isequal(destination)){ _local3 = node; while (_local3 != startnode) { _arg1.unshift(_local3.pos); _local3 = _local3.parent; }; return (true); }; neighbours(node.pos); for each (_local2 in ns) { tempg = (node.g + hestimate(node.pos, _local2)); temph = hestimate(_local2, destination); curf = (tempg + temph); onode = opened.get(((_local2.x * 1000) + _local2.y)); if (((onode) && ((onode.f <= curf)))){ } else { cnode = closed.get(((_local2.x * 1000) + _local2.y)); if (((cnode) && ((cnode.f <= curf)))){ } else { if (onode){ opened.remove(onode.key()); openedMap.removeNode(onode.h, onode); }; if (cnode){ closed.remove(cnode.key()); }; _local4 = new AstarNode(); _local4.pos = _local2; _local4.g = tempg; _local4.h = temph; _local4.f = curf; _local4.parent = node; addToOpened(_local4); }; }; }; closed.add(node.key(), node); }; return (false); } public function checkwallid(_arg1:uint, _arg2:uint):Boolean{ var _local3:uint; _local3 = map.getxy(_arg1, _arg2); return (((((!((_local3 == Consts.Wall))) && (!((_local3 == Consts.crystalsId))))) && (!((_local3 == tid))))); } public function neighbours(_arg1:Position):void{ ns.length = 0; if (_arg1.x > 0){ if (checkxy((_arg1.x - 1), _arg1.y)){ ns.push(new Position((_arg1.x - 1), _arg1.y)); }; if ((((_arg1.y < (map.v - 1))) && (checkxy((_arg1.x - 1), (_arg1.y + 1))))){ ns.push(new Position((_arg1.x - 1), (_arg1.y + 1))); }; if ((((_arg1.y > 0)) && (checkxy((_arg1.x - 1), (_arg1.y - 1))))){ ns.push(new Position((_arg1.x - 1), (_arg1.y - 1))); }; }; if ((((_arg1.y > 0)) && (checkxy(_arg1.x, (_arg1.y - 1))))){ ns.push(new Position(_arg1.x, (_arg1.y - 1))); }; if (_arg1.x < (map.h - 1)){ if (checkxy((_arg1.x + 1), _arg1.y)){ ns.push(new Position((_arg1.x + 1), _arg1.y)); }; if ((((_arg1.y < (map.v - 1))) && (checkxy((_arg1.x + 1), (_arg1.y + 1))))){ ns.push(new Position((_arg1.x + 1), (_arg1.y + 1))); }; if ((((_arg1.y > 0)) && (checkxy((_arg1.x + 1), (_arg1.y - 1))))){ ns.push(new Position((_arg1.x + 1), (_arg1.y - 1))); }; }; if ((((_arg1.y < (map.v - 1))) && (checkxy(_arg1.x, (_arg1.y + 1))))){ ns.push(new Position(_arg1.x, (_arg1.y + 1))); }; } private function getBestNode():AstarNode{ var _local1:AstarNode; _local1 = openedMap.shift(); opened.remove(_local1.key()); return (_local1); } } }//package fai class AstarNode { public var f:uint;// = 0 public var g:uint;// = 0 public var h:uint;// = 0 public var parent:AstarNode;// = null public var pos:Position;// = null private function AstarNode(){ f = 0; g = 0; h = 0; parent = null; pos = null; super(); } public function key():uint{ return (((pos.x * 1000) + pos.y)); } } class AstarMap extends Map { private function AstarMap(){ } public function removeNode(_arg1:int, _arg2:AstarNode):void{ var _local3:int; if (find(_arg1)){ if (!values[index_].pos.isequal(_arg2.pos)){ _local3 = (index_ - 1); while ((((_local3 >= 0)) && ((keys[_local3] == _arg1)))) { if (values[_local3].pos.isequal(_arg2.pos)){ keys.splice(_local3, 1); values.splice(_local3, 1); return; }; _local3--; }; _local3 = (index_ + 1); while ((((_local3 < keys.length)) && ((keys[_local3] == _arg1)))) { if (values[_local3].pos.isequal(_arg2.pos)){ keys.splice(_local3, 1); values.splice(_local3, 1); return; }; _local3++; }; } else { keys.splice(index_, 1); values.splice(index_, 1); }; }; } }
Section 6
//AttackGoal (fai.AttackGoal) package fai { public class AttackGoal extends Goal { public var preciseTarget:Unit;// = null public var attacktarget:Unit;// = null private var onlyFlying:Boolean;// = false private var recharging:int;// = 0 public var paused:Boolean;// = false private var onlyLand:Boolean;// = false private var precisePos:Position;// = null public var hostilecamp:Camp;// = null public function AttackGoal(_arg1:Unit, _arg2:Camp):void{ hostilecamp = null; attacktarget = null; onlyFlying = false; onlyLand = false; recharging = 0; paused = false; preciseTarget = null; precisePos = null; super(); owner = _arg1; hostilecamp = _arg2; if (!owner.flag(UnitFlags.Antiaircraft)){ onlyLand = true; }; if (!owner.flag(UnitFlags.Antilandforces)){ onlyFlying = true; }; } public function advance():void{ var _local1:Unit; _local1 = null; if (Consts.ATTACK == owner.cstate){ if (recharging > 0){ recharging--; if (((((!(recharging)) && (!(paused)))) && (!(preciseAttack())))){ _local1 = hostilecamp.getNearestUnit(owner.pos, owner.eyerange, onlyFlying, onlyLand); if (_local1 != null){ owner.startattack(_local1); } else { owner.reset(); owner.sprite.setMoveSprite(); return; }; }; } else { owner.attack(); }; if ((((Consts.IDLE == owner.cstate)) && (!(paused)))){ if (preciseAttack()){ recharging = owner.rechargetime; } else { _local1 = hostilecamp.getNearestUnit(owner.pos, owner.eyerange, onlyFlying, onlyLand); if (_local1 != null){ recharging = owner.rechargetime; owner.startattack(_local1); } else { owner.sprite.setMoveSprite(); }; }; }; } else { if ((((((Consts.IDLE == owner.cstate)) && (!(paused)))) && (!(preciseAttack())))){ _local1 = hostilecamp.getNearestUnit(owner.pos, owner.eyerange, onlyFlying, onlyLand); if (_local1 != null){ owner.startattack(_local1); }; }; }; } public function preciseAttack():Boolean{ var _local1:int; var _local2:int; var _local3:Boolean; if (!preciseTarget){ return (false); }; if (!preciseTarget.isAlive()){ clearPreciseTarget(); return (false); }; if (((((preciseTarget.flag(UnitFlags.Flying)) && (!(owner.flag(UnitFlags.Antiaircraft))))) || (((!(preciseTarget.flag(UnitFlags.Flying))) && (!(owner.flag(UnitFlags.Antilandforces))))))){ clearPreciseTarget(); return (false); }; _local1 = (owner.pos.x - preciseTarget.pos.x); _local2 = (owner.pos.y - preciseTarget.pos.y); _local3 = (Math.sqrt(((_local1 * _local1) + (_local2 * _local2))) <= owner.eyerange); if (!_local3){ if (owner.flag(UnitFlags.Building)){ clearPreciseTarget(); return (false); }; if (((!(precisePos)) || (!(precisePos.isequal(preciseTarget.pos))))){ owner.life.move(preciseTarget.pos); precisePos = preciseTarget.pos; }; return (true); }; owner.startattack(preciseTarget); return (true); } public function clearPreciseTarget():void{ precisePos = null; preciseTarget = null; } } }//package fai
Section 7
//Background (fai.Background) package fai { import flash.display.*; import flash.geom.*; public class Background extends Bitmap { private var engine:Engine;// = null public function Background(_arg1:Engine):void{ engine = null; engine = _arg1; super(new BitmapData((engine.game_board.map_width * Consts.cell_size), (engine.game_board.map_height * Consts.cell_size), false, 0), "auto", false); } public function setTileType(_arg1:String):void{ var _local2:BitmapData; var _local3:int; var _local4:int; var _local5:Rectangle; var _local6:Point; var _local7:BitmapData; var _local8:int; var _local9:int; _local2 = engine.sloader.grounds[_arg1]; _local3 = ((engine.game_board.maplayer.width / _local2.width) + 1); _local4 = ((engine.game_board.maplayer.height / _local2.height) + 1); _local5 = new Rectangle(0, 0, _local2.width, _local2.height); _local6 = null; _local7 = bitmapData; _local8 = 0; _local9 = 0; _local8 = 0; while (_local8 < _local4) { _local9 = 0; while (_local9 < _local3) { _local6 = new Point((_local9 * _local2.width), (_local8 * _local2.height)); _local7.copyPixels(_local2, _local5, _local6); _local9++; }; _local8++; }; bitmapData = _local7; } public function addWall(_arg1:String, _arg2:int, _arg3:int):void{ var _local4:int; var _local5:int; var _local6:int; var _local7:int; var _local8:BitmapData; var _local9:Rectangle; var _local10:Point; var _local11:BitmapData; _local4 = 0; _local5 = 0; _local6 = 0; _local7 = 0; _local8 = engine.sloader.grounds[_arg1]; _local9 = new Rectangle(0, 0, _local8.width, _local8.height); _local10 = new Point((_arg2 * Consts.cell_size), (_arg3 * Consts.cell_size)); _local11 = bitmapData; _local11.copyPixels(_local8, _local9, _local10); _local4 = ((_local8.width / Consts.cell_size) + 1); _local5 = ((_local8.height / Consts.cell_size) + 1); _local6 = 0; while (_local6 < _local5) { _local7 = 0; while (_local7 < _local4) { if (((((_arg2 + _local7) < engine.game_board.world.h)) && (((_arg3 + _local6) < engine.game_board.world.v)))){ engine.game_board.world.setxy((_arg2 + _local7), (_arg3 + _local6), Consts.Wall); }; _local7++; }; _local6++; }; } } }//package fai
Section 8
//BombGoal (fai.BombGoal) package fai { public class BombGoal extends Goal { private var engine:Engine;// = null private var bomb;// = null public function BombGoal(_arg1:Engine, _arg2):void{ engine = null; bomb = null; super(); engine = _arg1; bomb = _arg2; } public function advance():void{ if (!bomb.bombtimer){ deactivate(); }; } override public function deactivate():void{ super.deactivate(); bomb.clean(); bomb = null; } } }//package fai
Section 9
//BuildCursor (fai.BuildCursor) package fai { import flash.display.*; import flash.text.*; public class BuildCursor extends Sprite { private var goodshape:Shape;// = null public var bitmap:AnimatedBitmap;// = null public var cost_crystals:uint;// = 0 public var type:String;// = null public var spritewidth:int;// = 0 private var msg:TextField;// = null private var badshape:Shape;// = null public function BuildCursor(_arg1:String, _arg2:AnimatedBitmap, _arg3:uint, _arg4:uint, _arg5:int):void{ bitmap = null; type = null; badshape = null; goodshape = null; cost_crystals = 0; msg = null; spritewidth = 0; super(); type = _arg1; cost_crystals = _arg4; bitmap = new AnimatedBitmap(_arg2.curbuffer, _arg2.width, _arg2.height); spritewidth = _arg5; addChild(bitmap); bitmap.x = (bitmap.x - (_arg2.width / 2)); bitmap.y = (bitmap.y - (_arg2.height / 2)); if (!_arg3){ _arg3 = 1; }; goodshape = new Shape(); drawEyeRange(0xEAEAEA, goodshape, _arg3); addChild(goodshape); badshape = new Shape(); badshape.visible = false; drawEyeRange(0xFF0000, badshape, _arg3); addChild(badshape); msg = Utils.createTextField(0xD8D8D8, 10); msg.text = "Select place for building"; msg.y = (msg.height * 2); msg.x = (msg.x - (msg.width / 2)); addChild(msg); } public function isGood():Boolean{ return (goodshape.visible); } public function setGood(_arg1:Boolean):void{ goodshape.visible = _arg1; badshape.visible = !(_arg1); } public function drawEyeRange(_arg1:uint, _arg2:Shape, _arg3:uint):void{ var _local4:uint; var _local5:uint; _local4 = 0x666666; _local5 = 0; _arg2.graphics.lineStyle(_local5, _local4); _arg2.graphics.beginFill(_arg1); _arg2.graphics.drawCircle(0, 0, (_arg3 * Consts.cell_size)); _arg2.graphics.endFill(); _arg2.alpha = 0.1; } public function destroy():void{ removeChild(bitmap); removeChild(goodshape); removeChild(badshape); } } }//package fai
Section 10
//BulletGoal (fai.BulletGoal) package fai { import flash.display.*; public class BulletGoal extends Goal { private var engine:Engine;// = null private var sprite:AnimatedBitmap;// = null private var gip:int;// = 0 public var bullet:Sprite; private var hitpos:Position;// = null private var framen:int;// = 0 private var assaulter:Unit;// = null private var subject:Unit;// = null private var expl:AnimatedBitmap;// = null public function BulletGoal(_arg1:Unit, _arg2:Unit, _arg3:Position, _arg4:Engine):void{ var _local5:int; var _local6:int; assaulter = null; subject = null; sprite = null; expl = null; engine = null; gip = 0; hitpos = null; bullet = new Sprite(); framen = 0; super(); engine = _arg4; assaulter = _arg1; subject = _arg2; sprite = new AnimatedBitmap(assaulter.sprite.bullet, assaulter.sprite.bullet.width, assaulter.sprite.bullet.height); expl = new AnimatedBitmap(assaulter.sprite.bulletexp, assaulter.sprite.bulletexp.height, assaulter.sprite.bulletexp.height); bullet.addChild(sprite); expl.visible = false; bullet.addChild(expl); sprite.x = (sprite.x - (sprite.width / 2)); sprite.y = (sprite.y - (sprite.height / 2)); expl.y = (expl.y + (sprite.height - (expl.height / 2))); hitpos = subject.pos; bullet.x = _arg1.sprite.x; bullet.y = _arg1.sprite.y; bullet.rotation = (((Math.atan2((_arg3.y - _arg1.sprite.y), (_arg3.x - _arg1.sprite.x)) / Math.PI) * 180) - 90); _local5 = (subject.pos.x - assaulter.pos.x); _local6 = (subject.pos.y - assaulter.pos.y); gip = (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))) * Consts.cell_size); } public function advance():void{ if (gip <= 0){ if (framen < expl.nframes){ expl.setFrame(framen); framen++; return; }; deactivate(); } else { gip = (gip - assaulter.bulletspeed); if (gip <= 0){ sprite.y = (sprite.y + (assaulter.bulletspeed + gip)); sprite.visible = false; expl.x = sprite.x; expl.y = sprite.y; expl.visible = true; engine.game_process.hitUnit(assaulter.damage, subject); if (UnitTypes.stunner == assaulter.type){ subject.life.froze(); }; if (!subject.isAlive()){ if (engine.game_process.isSelectedUnit(assaulter)){ engine.play_window.updateInfo(); }; }; } else { sprite.y = (sprite.y + assaulter.bulletspeed); }; }; } override public function deactivate():void{ super.deactivate(); if (bullet){ bullet.removeChild(sprite); bullet.removeChild(expl); engine.game_board.bulletlayer.removeChild(bullet); sprite = null; assaulter = (subject = null); bullet = null; }; } } }//package fai
Section 11
//ButtonSprite (fai.ButtonSprite) package fai { import fai.*; import flash.display.*; import flash.text.*; class ButtonSprite extends Sprite { private var shaped:Shape; public var type:String;// = null private var shapes:Shape; function ButtonSprite(_arg1:String, _arg2:AnimatedBitmap):void{ type = null; shaped = new Shape(); shapes = new Shape(); super(); Utils.drawRect(shaped, 2, 0, 4548515, _arg2.width, _arg2.height, true); shaped.alpha = 0.5; addChild(shaped); shapes.visible = false; Utils.drawRect(shapes, 2, 0, 0xD1D1D1, _arg2.width, _arg2.height, true); shapes.alpha = 0.5; addChild(shapes); type = _arg1; addChild(_arg2); } public function select(_arg1:Boolean):void{ shaped.visible = !(_arg1); shapes.visible = _arg1; } public function makeHotKey(_arg1:String):void{ var _local2:TextField; _local2 = Utils.createTextField(0xFFFFFF, 10); _local2.text = _arg1; addChild(_local2); } } }//package fai
Section 12
//Camp (fai.Camp) package fai { public class Camp { public var units:Array; public function Camp(){ units = new Array(); super(); } public function getUnder(_arg1:Position):Unit{ var _local2:Unit; var _local3:int; _local2 = null; _local3 = 0; while (_local3 < units.length) { _local2 = units[_local3]; if (((((((((_local2.sprite.x - (_local2.sprite_width / 2)) <= _arg1.x)) && ((_arg1.x < (_local2.sprite.x + (_local2.sprite_width / 2)))))) && (((_local2.sprite.y - (_local2.sprite.height / 2)) <= _arg1.y)))) && ((_arg1.y < (_local2.sprite.y + (_local2.sprite.height / 2)))))){ return (_local2); }; _local3++; }; return (null); } public function remove(_arg1:Unit):void{ var _local2:uint; _local2 = 0; while (_local2 < units.length) { if (units[_local2] == _arg1){ delete units[_local2]; units.splice(_local2, 1); break; }; _local2++; }; } public function add(_arg1:Unit):void{ units[units.length] = _arg1; } public function getUnderSelection(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Array):void{ var _local6:Unit; var _local7:int; _arg5.length = 0; _local6 = null; _local7 = 0; while (_local7 < units.length) { _local6 = units[_local7]; if ((((((((((_local6.pos.x >= _arg1)) && ((_local6.pos.x <= (_arg1 + _arg3))))) && ((_local6.pos.y >= _arg2)))) && ((_local6.pos.y <= (_arg2 + _arg4))))) && (!(((_local6.flag(UnitFlags.Building)) && (_local6.flag(UnitFlags.Peaceful))))))){ _arg5.push(_local6); }; _local7++; }; } public function getNearestUnit(_arg1:Position, _arg2:int, _arg3:Boolean, _arg4:Boolean):Unit{ var _local5:Unit; var _local6:int; var _local7:Unit; var _local8:int; var _local9:int; _local5 = null; _local6 = 9999999; _local7 = null; _local8 = 0; while (_local8 < units.length) { _local7 = units[_local8]; if (((((_arg3) && (!(_local7.flag(UnitFlags.Flying))))) || (((_arg4) && (_local7.flag(UnitFlags.Flying)))))){ } else { _local9 = distanceFrom(_arg1, _local7); if (_local9 <= _arg2){ if (_local9 < _local6){ _local6 = _local9; _local5 = _local7; }; }; }; _local8++; }; return (_local5); } public function size():uint{ return (units.length); } public function getNearUnitById(_arg1:Position, _arg2:int, _arg3:int):Unit{ var _local4:Unit; var _local5:int; var _local6:int; var _local7:int; var _local8:int; _local4 = null; _local5 = 0; while (_local5 < units.length) { _local4 = units[_local5]; if (_local4.mapid != _arg3){ } else { _local6 = (_local4.pos.x - _arg1.x); _local7 = (_local4.pos.y - _arg1.y); _local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7))); if (_local8 <= _arg2){ return (_local4); }; }; _local5++; }; return (null); } public function isUnitNear(_arg1:Position, _arg2:int):Boolean{ var _local3:Unit; var _local4:int; var _local5:int; _local3 = null; _local4 = 0; while (_local4 < units.length) { _local3 = units[_local4]; _local5 = distanceFrom(_arg1, _local3); if (_local5 <= _arg2){ return (true); }; _local4++; }; return (false); } public function getInMapUnder(_arg1:Position):Unit{ var _local2:Unit; var _local3:int; _local2 = null; _local3 = 0; while (_local3 < units.length) { _local2 = units[_local3]; if ((((_local2.pos.x == _arg1.x)) && ((_local2.pos.y == _arg1.y)))){ return (_local2); }; _local3++; }; return (null); } public function getNearestByType(_arg1:String, _arg2:Position):Unit{ var _local3:Unit; var _local4:Unit; var _local5:int; var _local6:int; var _local7:int; var _local8:int; var _local9:int; _local3 = null; _local4 = null; _local5 = 9999999; _local6 = 0; while (_local6 < units.length) { _local3 = units[_local6]; if (((_local3.isAlive()) && ((_local3.type == _arg1)))){ _local7 = (_local3.pos.x - _arg2.x); _local8 = (_local3.pos.y - _arg2.y); _local9 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8))); if (_local9 < _local5){ _local4 = _local3; _local5 = _local9; }; }; _local6++; }; return (_local4); } public static function distanceFrom(_arg1:Position, _arg2:Unit):Number{ var _local3:int; var _local4:int; _local3 = (_arg2.pos.x - _arg1.x); _local4 = (_arg2.pos.y - _arg1.y); return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4)))); } } }//package fai
Section 13
//Consts (fai.Consts) package fai { public class Consts { public static const PICKING:uint = 10; public static const PathfindingsPerTick:int = 1; public static const cumulative_bomb_cost:int = 250; public static const ATTACK:uint = 1; public static const CrystalsPortion:int = 8; public static const UNIT_LEAVE_COUNT:int = 100; public static const PowerStationAdd:int = 5; public static const ScreenHeight:int = 600; public static const MOVING:uint = 2; public static const DEATH:uint = 3; public static const nitro_bomb_cost:int = 50; public static const IDLE:uint = 0; public static const myId:uint = 3; public static const ScreenWidth:int = 800; public static const GOALSCLEANPAUSE:uint = 10; public static const Wall:uint = 1; public static const CrystalsLoad:int = 24; public static const MaxEnergy:int = 50; public static const hostileId:uint = 4; public static const crystalsId:int = 10; public static const FrozeDelay:int = 100; public static const cell_size:uint = 32; public static const nuclear_missile_cost:int = 500; } }//package fai
Section 14
//CustomCursor (fai.CustomCursor) package fai { import flash.display.*; import flash.ui.*; public class CustomCursor extends Sprite { private var size:uint;// = 20 public var enabled:Boolean;// = false private var engine:Engine;// = null private var effect:Shape;// = null public function CustomCursor(_arg1:Engine):void{ engine = null; size = 20; enabled = false; effect = null; super(); engine = _arg1; visible = false; draw(); } public function enableEffect(_arg1:String):void{ var radius:int; var action = _arg1; if (effect){ effect.graphics.clear(); removeChild(effect); effect = null; }; radius = 0; switch (action){ case UnitTypes.nitro_bomb: radius = 4; break; case UnitTypes.cumulative_bomb: radius = 5; break; case UnitTypes.nuclear_missile: radius = 8; break; }; effect = new Shape(); var _local3 = effect.graphics; with (_local3) { clear(); lineStyle(1, 0xFF3300); beginFill(0xFFCC00, 0.5); drawCircle(0, 0, (Consts.cell_size * radius)); endFill(); }; effect.alpha = 0.8; addChild(effect); } private function draw():void{ graphics.clear(); graphics.lineStyle(2, 0xFF00); graphics.drawCircle(0, 0, (size / 3)); } public function hide():void{ visible = false; Mouse.show(); } public function enable(_arg1:Boolean):void{ if (effect){ effect.graphics.clear(); removeChild(effect); effect = null; }; if (_arg1){ x = engine.global_stage.stage.mouseX; y = engine.global_stage.stage.mouseY; show(); } else { hide(); }; enabled = _arg1; } public function destroy():void{ if (effect){ effect.graphics.clear(); removeChild(effect); effect = null; }; } public function show():void{ Mouse.hide(); visible = true; } } }//package fai
Section 15
//DieGoal (fai.DieGoal) package fai { import flash.display.*; import flash.media.*; public class DieGoal extends Goal { public var engine:Engine;// = null private var spriteScale:Number;// = 1 public var unit:Unit;// = null private var lifegoal:LifeGoal;// = null private var framen:int;// = 0 private var esprite:Sprite;// = null private var expl:AnimatedBitmap;// = null private var pause:int;// = 0 private var leave:int;// = 100 private var debris:AnimatedBitmap;// = null public function DieGoal(_arg1:Unit, _arg2:Engine, _arg3:LifeGoal):void{ unit = null; engine = null; leave = Consts.UNIT_LEAVE_COUNT; lifegoal = null; expl = null; debris = null; pause = 0; spriteScale = 1; esprite = null; framen = 0; super(); unit = _arg1; engine = _arg2; lifegoal = _arg3; unit.destroy(); expl = new AnimatedBitmap(engine.sloader.specials[UnitTypes.sp_death1], 48, 48); if (!unit.flag(UnitFlags.Flying)){ debris = new AnimatedBitmap(engine.sloader.specials[UnitTypes.sp_debris], 48, 48); debris.visible = false; }; esprite = new Sprite(); expl.x = (expl.x - (unit.sprite_width / 2)); expl.y = (expl.y - (unit.sprite.sprite.height / 2)); expl.x = (expl.x + ((unit.sprite_width - expl.width) / 2)); expl.y = (expl.y + ((unit.sprite.sprite.height - expl.height) / 2)); esprite.scaleX = (esprite.scaleY = ((_arg1.sprite_width + 10) / 48)); esprite.addChild(expl); unit.sprite.body.addChild(esprite); if (_arg1.mapid == Consts.crystalsId){ expl.visible = false; }; _arg1.sprite.orders.visible = false; engine.playSoundPos(Sound(engine.sloader.getSound(Sounds.explosion1)), unit.pos); } public function advance():void{ if (pause > 0){ pause--; return; }; if (expl.framen < expl.nframes){ spriteScale = (spriteScale - 0.2); unit.sprite.sprite.alpha = spriteScale; framen++; expl.setFrame(framen); return; }; if (leave > 0){ if (leave == Consts.UNIT_LEAVE_COUNT){ expl.visible = false; if (!unit.flag(UnitFlags.Flying)){ engine.game_board.resourcelayer.addChild(debris); debris.x = unit.sprite.x; debris.y = unit.sprite.y; debris.scaleX = (debris.scaleY = (unit.sprite_width / 48)); debris.x = (debris.x - (debris.width / 2)); debris.y = (debris.y - (debris.height / 2)); debris.visible = true; }; unit.sprite.sprite.visible = false; }; leave--; return; }; deactivate(); } override public function deactivate():void{ if (((debris) && (debris.visible))){ engine.game_board.resourcelayer.removeChild(debris); debris = null; }; super.deactivate(); lifegoal.destroy(true); } } }//package fai
Section 16
//EffectGoal (fai.EffectGoal) package fai { public class EffectGoal extends Goal { public var engine:Engine;// = null public var sprite:AnimatedBitmap;// = null private var pause:int;// = 0 private var frame:int;// = 0 public function EffectGoal(_arg1:AnimatedBitmap, _arg2:Engine):void{ sprite = null; engine = null; pause = 0; frame = 0; super(); engine = _arg2; sprite = _arg1; } public function advance():void{ if (pause > 0){ pause--; return; }; if (frame >= sprite.nframes){ deactivate(); } else { sprite.setFrame(frame); frame++; pause = 1; return; }; } override public function deactivate():void{ super.deactivate(); if (sprite){ engine.game_board.bulletlayer.removeChild(sprite); sprite = null; }; } } }//package fai
Section 17
//Engine (fai.Engine) package fai { import flash.events.*; import flash.display.*; import flash.media.*; import flash.utils.*; import flash.geom.*; public class Engine extends MovieClip { public var last_loaded_level:LevelMap;// = null public var actions:PlayerActions;// = null public var volumeOff:Boolean;// = false public var volume:Number;// = 1 public var game_process:GameProcess;// = null public var harvs:Map;// = null public var paused:Boolean;// = false public var events:GameEvents;// = null public var utypes:UnitTypes;// = null public var mycolor:uint;// = 0xFF public var play_window:PlayWindow;// = null public var global_stage:GameStage;// = null public var game_board:GameBoard;// = null private var vd_timer:Timer;// = null public var sloader:SmartLoader;// = null public var scenario:Scenario;// = null public var energy:int;// = 0 public var score:int;// = 0 public var hostilecolor:uint;// = 0xFF0000 var showingAds;// = false public var command_center:Unit;// = null public var energy_fill:int;// = 0 public var goal_system:GoalSystem;// = null public var crystals:int;// = 0 public static var stageRadius = 0; public function Engine(_arg1):void{ global_stage = null; crystals = 0; score = 0; energy = 0; energy_fill = 0; mycolor = 0xFF; hostilecolor = 0xFF0000; paused = false; goal_system = null; sloader = null; utypes = null; events = null; play_window = null; game_process = null; actions = null; game_board = null; scenario = null; harvs = null; command_center = null; last_loaded_level = null; volume = 1; volumeOff = false; vd_timer = null; showingAds = false; super(); global_stage = _arg1; sloader = new SmartLoader(this); utypes = new UnitTypes(this); actions = new PlayerActions(this); KeyboardKeys.init(global_stage); } public function pause():void{ game_board.removeBuildCursor(); if (!paused){ play_window.pause_mc.visible = true; play_window.pause_mc.gotoAndPlay("pause"); events.unregister(); if (scenario){ scenario.stop(); }; } else { play_window.pause_mc.stop(); play_window.pause_mc.visible = false; events.register(); if (scenario){ scenario.run(); }; }; paused = !(paused); } public function victory():void{ if (showingAds){ return; }; showingAds = true; scenario.stop(); MochiAd.showInterLevelAd({id:"701c9f8f42284a14", res:"800x600", clip:global_stage, ad_finished:function (){ showingAds = false; victory2(); }}); } public function clearAll():void{ if (!game_board){ return; }; events.unregister(); events = null; scenario.destroy(); scenario = null; actions.clear(); play_window.destroy(); GameStage.main_holder.removeChild(play_window); play_window = null; game_board.destroy(); game_board = null; game_process.destroy(); game_process = null; goal_system = null; harvs = null; command_center = null; paused = false; } private function victoryHandler(_arg1:TimerEvent):void{ vd_timer.stop(); vd_timer.removeEventListener(TimerEvent.TIMER, victoryHandler); vd_timer = null; if (!paused){ pause(); }; if (global_stage.main_menu.planets.current_level >= 11){ finalVictory(); } else { if (global_stage.main_menu.planets.current_level == last_loaded_level.number){ global_stage.main_menu.planets.current_level++; }; global_stage.main_menu.planets.saveLocally(); }; play_window.custom_cursor.enable(false); play_window.stats.victory(); play_window.stats.start(); play_window.stats.visible = true; playSound(Sounds.menu_appear); playSound(Sounds.tada); } public function playSoundPos(_arg1:Sound, _arg2:Position):void{ var _local3:SoundTransform; var _local4:int; var _local5:int; var _local6:Number; if (((((!(volume)) || (volumeOff))) || (paused))){ return; }; _local3 = new SoundTransform(); _local4 = ((Consts.ScreenWidth / 2) - ((_arg2.x + 2) * Consts.cell_size)); _local5 = ((Consts.ScreenHeight / 2) - ((_arg2.y + 3) * Consts.cell_size)); _local6 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5))); _local3.volume = (volume / (1 + (_local6 / stageRadius))); _local3.pan = -((1 - (Math.abs(((Math.atan2(_local5, _local4) / Math.PI) * 180)) / 90))); _arg1.play(0, 0, _local3); } public function log(_arg1:String):void{ play_window.message_mc.msg.message_txt.text = _arg1; play_window.message_mc.visible = true; play_window.message_mc.play(); } public function addResources(_arg1:int):void{ crystals = (crystals + _arg1); play_window.stats.crystals = (play_window.stats.crystals + _arg1); } public function playSoundData(_arg1:Sound):void{ var _local2:SoundTransform; if (volumeOff){ return; }; _local2 = new SoundTransform(); _local2.volume = volume; _arg1.play(0, 0, _local2); } public function getColor(_arg1:int):uint{ if (_arg1 == Consts.myId){ return (mycolor); }; return (hostilecolor); } public function isCrystalsEnough(_arg1:String):Boolean{ return ((utypes.params(_arg1).cost_crystals <= crystals)); } public function playLevel(_arg1:LevelMap):void{ clearAll(); global_stage.main_menu.initGame(null); crystals = 0; score = 0; energy = 0; energy_fill = 0; goal_system = new GoalSystem(); events = new GameEvents(this); game_board = new GameBoard(this); play_window = new PlayWindow(this, game_board); play_window.initialize(); GameStage.main_holder.addChild(play_window); game_process = new GameProcess(this); harvs = new Map(); game_board.load(_arg1); play_window.createCustomCursor(); game_process.updatePower(); play_window.updateResources(); game_process.selected_units.push(command_center); play_window.updateInfo(); scenario = new Scenario(this, int(_arg1.data.scenario.nwaves.@value), int(_arg1.data.@number)); last_loaded_level = _arg1; stageRadius = Math.sqrt(((Consts.ScreenWidth * Consts.ScreenWidth) + (Consts.ScreenHeight * Consts.ScreenHeight))); if (_arg1.number == 0){ play_window.showTutorial(); } else { scenario.start(); events.register(); }; } public function victory2():void{ vd_timer = new Timer(2000, 1); vd_timer.addEventListener(TimerEvent.TIMER, victoryHandler); vd_timer.start(); } public function upgradeUnit(_arg1:Unit):void{ var _local2:Unit; var _local3:Number; var _local4:int; var _local5:AnimatedBitmap; if (_arg1.upgradeLevel >= 5){ return; }; _local2 = utypes.params(_arg1.type); _local3 = Utils.upgradeCost(_arg1.type, (_arg1.upgradeLevel + 1)); if (_arg1.mapid == Consts.hostileId){ _local3 = 0.85; }; _local4 = (_local3 * _arg1.cost_crystals); if (_arg1.mapid != Consts.hostileId){ if (crystals < _local4){ log("Not enough crystals"); return; }; crystals = (crystals - _local4); }; _arg1.upgradeLevel++; _arg1.full_health = (_arg1.full_health + (_arg1.full_health * _local3)); _arg1.health = (_arg1.health + (_arg1.health * _local3)); _arg1.damage = (_arg1.damage + (_arg1.damage * _local3)); _arg1.armor++; _arg1.cost_crystals = (_arg1.cost_crystals + (_arg1.cost_crystals * _local3)); _local5 = sloader.getSpecial(((_arg1.mapid == Consts.myId)) ? UnitTypes.sp_my_order : UnitTypes.sp_hostile_order); _arg1.sprite.addOrder(_local5, _arg1.upgradeLevel); if (((_arg1.life.repair_goal) && (_arg1.life.repair_goal.active))){ _arg1.life.repair(); _arg1.life.repair(); }; if (game_process.isUnitInSelection(_arg1)){ play_window.updateInfo(); }; play_window.updateResources(); } private function defeatHandler(_arg1:TimerEvent):void{ vd_timer.stop(); vd_timer.removeEventListener(TimerEvent.TIMER, defeatHandler); vd_timer = null; if (!paused){ pause(); }; play_window.custom_cursor.enable(false); play_window.stats.defeat(); play_window.stats.start(); play_window.stats.visible = true; playSound(Sounds.defeat); } public function playSound(_arg1:int):void{ switch (_arg1){ case Sounds.upgrade: playSoundData(new Sound_upgrade()); break; case Sounds.click: playSoundData(new Sound_click()); break; case Sounds.click1: playSoundData(new Sound_click1()); break; case Sounds.unpause: playSoundData(new Sound_unpause()); break; case Sounds.build: playSoundData(new Sound_build()); break; case Sounds.menu_appear: playSoundData(new Sound_stat_appear()); break; case Sounds.defeat: playSoundData(new Sound_defeat()); break; case Sounds.explosion1: playSoundData(new Sound_explosion1()); break; case Sounds.new_wave: playSoundData(new Sound_new_wave()); break; case Sounds.tada: playSoundData(new Sound_tada()); break; }; } public function finalVictory():void{ play_window.stats.final_victory.visible = true; play_window.stats.play_again_button.visible = false; play_window.stats.main_menu_button.visible = false; } public function gameOver():void{ scenario.stop(); vd_timer = new Timer(2000, 1); vd_timer.addEventListener(TimerEvent.TIMER, defeatHandler); vd_timer.start(); } public function upgradeUnitToLevel(_arg1:Unit, _arg2:int):void{ var _local3:int; _local3 = 0; while (_local3 < _arg2) { upgradeUnit(_arg1); _local3++; }; } } }//package fai
Section 18
//FastButtons (fai.FastButtons) package fai { import flash.events.*; import flash.display.*; import flash.text.*; import flash.utils.*; public class FastButtons extends Sprite { private var powersOpened:Boolean;// = true private var engine:Engine;// = null private var buttons:Array; private var switch_button:SwitchButton;// = null private var powersTimer:Timer;// = null private var fpb:Sprite;// = null public function FastButtons(_arg1:Engine):void{ var _local2:TextFormat; var _local3:int; var _local4:ButtonSprite; engine = null; fpb = null; powersOpened = true; powersTimer = null; buttons = []; switch_button = null; super(); engine = _arg1; switch_button = new SwitchButton(); _local2 = switch_button.buttonLabel.defaultTextFormat; _local2.bold = true; switch_button.buttonLabel.defaultTextFormat = _local2; switch_button.buttonLabel.text = "Powers"; addChild(switch_button); switch_button.addEventListener(MouseEvent.MOUSE_DOWN, onpowers); switch_button.gotoAndStop("opened"); switch_button.buttonMode = true; switch_button.mouseChildren = false; _local3 = 45; _local4 = null; fpb = new Sprite(); addChild(fpb); _local4 = createButton(UnitTypes.nitro_bomb, "B"); fpb.addChild(_local4); _local4 = createButton(UnitTypes.cumulative_bomb, "C"); fpb.addChild(_local4); _local4.y = (_local3 + 1); _local4 = createButton(UnitTypes.nuclear_missile, "N"); fpb.addChild(_local4); _local4.y = ((_local3 + 1) * 2); fpb.x = 0; fpb.y = ((switch_button.y + switch_button.height) - 10); powersTimer = new Timer(50, 0); powersTimer.addEventListener(TimerEvent.TIMER, powersTimeHandler); powersTimer.stop(); } public function destroy():void{ var _local1:int; switch_button.stop(); switch_button.removeEventListener(MouseEvent.MOUSE_DOWN, onpowers); removeChild(switch_button); switch_button = null; if (powersTimer){ powersTimer.stop(); powersTimer.removeEventListener(TimerEvent.TIMER, powersTimeHandler); powersTimer = null; }; _local1 = 0; _local1 = 0; while (_local1 < buttons.length) { buttons[_local1].removeEventListener(MouseEvent.CLICK, engine.play_window.buttons.onclick); buttons[_local1].removeEventListener(MouseEvent.MOUSE_OVER, engine.play_window.buttons.onoverbutton); buttons[_local1].removeEventListener(MouseEvent.MOUSE_OUT, engine.play_window.buttons.onoutbutton); _local1++; }; buttons.length = 0; } private function createButton(_arg1:String, _arg2:String=""):ButtonSprite{ var _local3:AnimatedBitmap; var _local4:ButtonSprite; _local3 = engine.sloader.getButton(_arg1); _local4 = new ButtonSprite(_arg1, _local3); if (_arg2 != ""){ _local4.makeHotKey(_arg2); }; _local4.buttonMode = true; _local4.mouseChildren = false; _local4.addEventListener(MouseEvent.CLICK, engine.play_window.buttons.onclick); _local4.addEventListener(MouseEvent.MOUSE_OVER, engine.play_window.buttons.onoverbutton); _local4.addEventListener(MouseEvent.MOUSE_OUT, engine.play_window.buttons.onoutbutton); buttons.push(_local4); return (_local4); } private function onpowers(_arg1:MouseEvent):void{ if (powersOpened){ _arg1.currentTarget.gotoAndPlay("opened"); powersOpened = false; powersTimer.start(); } else { _arg1.currentTarget.gotoAndPlay("start"); powersOpened = true; fpb.visible = true; powersTimer.start(); }; } private function powersTimeHandler(_arg1:TimerEvent):void{ var _local2:Number; _local2 = (powersOpened) ? 0.2 : -0.2; if (((((powersOpened) && ((fpb.scaleX < 1)))) || (((!(powersOpened)) && ((fpb.scaleY > 0.2)))))){ fpb.scaleX = (fpb.scaleX + _local2); fpb.scaleY = (fpb.scaleY + _local2); } else { fpb.visible = powersOpened; powersTimer.stop(); }; } } }//package fai
Section 19
//FrozeGoal (fai.FrozeGoal) package fai { public class FrozeGoal extends Goal { private var goals:Array; private var engine:Engine;// = null private var frozen_unit:Unit;// = null public var delay:int;// = 100 public function FrozeGoal(_arg1:Engine, _arg2:Unit):void{ var _local3:int; var _local4:*; engine = null; frozen_unit = null; goals = []; delay = Consts.FrozeDelay; super(); engine = _arg1; frozen_unit = _arg2; _local3 = 0; _local3 = 0; while (_local3 < engine.goal_system.goals.length) { _local4 = engine.goal_system.goals[_local3]; if (_local4.owner == frozen_unit){ goals.push(_local4); engine.goal_system.goals[_local3] = new Goal(); engine.goal_system.goals[_local3].deactivate(); }; _local3++; }; } public function advance():void{ if (delay > 0){ delay--; return; }; deactivate(); } override public function deactivate():void{ var _local1:int; super.deactivate(); _local1 = 0; _local1 = 0; while (_local1 < goals.length) { engine.goal_system.add(goals[_local1]); _local1++; }; goals = null; frozen_unit.life.froze_goal = null; } } }//package fai
Section 20
//GameBoard (fai.GameBoard) package fai { import flash.display.*; public class GameBoard extends Sprite { public var backgr:Background;// = null public var resourcelayer:Sprite;// = null public var map_width:int;// = 0 public var resources:Camp;// = null public var groundlayer:Sprite;// = null public var my_camp:Camp;// = null private var engine:Engine;// = null public var build_cursor:BuildCursor;// = null public var airlayer:Sprite;// = null public var map_height:int;// = 0 public var maplayer:Sprite;// = null public var selshape:Shape;// = null public var bulletlayer:Sprite;// = null public var airworld:MapMatrix;// = null public var world:MapMatrix;// = null public var unitlayer:Sprite;// = null public var enemy_camp:Camp;// = null public function GameBoard(_arg1:Engine):void{ engine = null; world = null; airworld = null; map_width = 0; map_height = 0; my_camp = null; enemy_camp = null; resources = null; build_cursor = null; maplayer = null; backgr = null; resourcelayer = null; unitlayer = null; groundlayer = null; airlayer = null; bulletlayer = null; selshape = null; super(); engine = _arg1; } public function destroy():void{ var _local1:Unit; var _local2:int; _local1 = null; _local2 = 0; if (my_camp){ _local2 = 0; while (_local2 < my_camp.units.length) { _local1 = my_camp.units[_local2]; _local1.life.destroy(true); _local2++; }; }; if (enemy_camp){ _local2 = 0; while (_local2 < enemy_camp.units.length) { _local1 = enemy_camp.units[_local2]; _local1.life.destroy(true); _local2++; }; }; if (resources){ _local2 = 0; while (_local2 < resources.units.length) { _local1 = resources.units[_local2]; _local1.life.destroy(true); _local2++; }; }; _local2 = 0; while (_local2 < engine.goal_system.goals.length) { if ((engine.goal_system.goals[_local2] is LifeGoal)){ engine.goal_system.goals[_local2].destroy(true); } else { if (engine.goal_system.goals[_local2].active){ engine.goal_system.goals[_local2].deactivate(); }; }; _local2++; }; engine.goal_system.goals.length = 0; world = null; airworld = null; removeBuildCursor(); if (my_camp){ my_camp.units.length = 0; }; if (enemy_camp){ enemy_camp.units.length = 0; }; if (resources){ resources.units.length = 0; }; map_width = 0; map_height = 0; removeChild(maplayer); backgr.bitmapData.dispose(); unitlayer.removeChild(backgr); backgr = null; unitlayer.removeChild(resourcelayer); resourcelayer = null; unitlayer.removeChild(groundlayer); groundlayer = null; unitlayer.removeChild(airlayer); airlayer = null; unitlayer.removeChild(bulletlayer); bulletlayer = null; unitlayer.removeChild(selshape); selshape = null; maplayer.removeChild(unitlayer); unitlayer = null; maplayer = null; } public function buildUnit(_arg1:String, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean):Unit{ var _local6:Unit; var _local7:Camp; _local6 = engine.utypes.createUnit(_arg1, _arg2); _local6.pos.set(_arg3, _arg4); addUnit(_local6); if (_arg5){ if (!_local6.flag(UnitFlags.Peaceful)){ _local7 = ((_local6.mapid == Consts.myId)) ? enemy_camp : my_camp; _local6.life.attack(_local7); } else { if (UnitTypes.refinery == _arg1){ engine.game_process.endBuilding(_local6, UnitTypes.harvester, true); }; }; }; return (_local6); } private function removeUnit(_arg1:Unit):void{ var _local2:Camp; _local2 = null; if (_arg1.mapid == Consts.myId){ _local2 = my_camp; } else { if (_arg1.mapid == Consts.hostileId){ _local2 = enemy_camp; } else { _local2 = resources; }; }; _local2.remove(_arg1); if (_arg1.flag(UnitFlags.Flying)){ airworld.setpos(_arg1.pos, 0); } else { if (_arg1.sprite_width > Consts.cell_size){ setUnitPos(_arg1, 0); } else { world.setpos(_arg1.pos, 0); }; }; } private function setUnitPos(_arg1:Unit, _arg2:int):void{ var _local3:MapMatrix; var _local4:int; var _local5:int; var _local6:int; var _local7:int; _local3 = (_arg1.flag(UnitFlags.Flying)) ? airworld : world; if (_arg1.type == UnitTypes.command_center){ _local4 = Math.floor(((_arg1.sprite_width / Consts.cell_size) + 0.5)); _local5 = Math.floor(((_arg1.sprite.height / Consts.cell_size) + 0.5)); _local6 = (_arg1.pos.x - (_local4 / 2)); while (_local6 < ((_arg1.pos.x + (_local4 / 2)) + 1)) { _local7 = (_arg1.pos.y - (_local5 / 2)); while (_local7 < ((_arg1.pos.y + (_local5 / 2)) + 1)) { if ((((((((_local6 < _local3.h)) && ((_local6 >= 0)))) && ((_local7 >= 0)))) && ((_local7 < _local3.v)))){ _local3.setxy(_local6, _local7, _arg2); }; _local7++; }; _local6++; }; } else { _local3.setpos(_arg1.pos, _arg2); }; } private function createLayers():void{ maplayer = new Sprite(); addChildAt(maplayer, 0); unitlayer = new Sprite(); maplayer.addChildAt(unitlayer, 0); backgr = new Background(engine); unitlayer.addChildAt(backgr, 0); resourcelayer = new Sprite(); unitlayer.addChildAt(resourcelayer, 1); groundlayer = new Sprite(); unitlayer.addChildAt(groundlayer, 2); airlayer = new Sprite(); unitlayer.addChildAt(airlayer, 3); bulletlayer = new Sprite(); unitlayer.addChildAt(bulletlayer, 4); selshape = new Shape(); unitlayer.addChildAt(selshape, 5); positionLayers(); } public function createBuildingCursor(_arg1:String):void{ var _local2:Unit; var _local3:BitmapData; var _local4:AnimatedBitmap; removeBuildCursor(); _local2 = engine.utypes.params(_arg1); _local3 = UnitSprite.setColor(engine.sloader.getBody(_arg1), engine.mycolor); _local4 = new AnimatedBitmap(_local3, _local2.sprite_width, _local3.height); build_cursor = new BuildCursor(_arg1, _local4, _local2.eyerange, _local2.cost_crystals, _local2.sprite_width); build_cursor.visible = engine.events.mouseWithinMap; unitlayer.addChild(build_cursor); } public function destroyUnit(_arg1:Unit):void{ var _local2:Unit; var _local3:Unit; _arg1.health = 0; if (UnitTypes.refinery == _arg1.type){ _local2 = engine.harvs.get(Utils.unitId(_arg1)); if (((_local2) && (_local2.isAlive()))){ engine.harvs.remove(Utils.unitId(_arg1)); destroyUnit(_local2); }; } else { if (UnitTypes.harvester == _arg1.type){ _local3 = findRefinery(_arg1); if (((_local3) && (_local3.isAlive()))){ engine.harvs.remove(Utils.unitId(_local3)); engine.game_process.builder.addTask(_local3, UnitTypes.refinery); }; }; }; removeUnit(_arg1); _arg1.sprite.stopBuilding(); if (_arg1.mapid == Consts.myId){ engine.play_window.stats.lost++; } else { engine.crystals = (engine.crystals + (_arg1.death_cost + (_arg1.death_cost * _arg1.upgradeLevel))); engine.play_window.stats.killed++; engine.score = (engine.score + (_arg1.cost_crystals / 3)); }; if (engine.game_process.isUnitInSelection(_arg1)){ engine.game_process.deselectUnit(_arg1); }; checkCursor(); engine.goal_system.removeOwner(_arg1); engine.game_process.updatePower(); engine.play_window.updateResources(); } public function removeBuildCursor():void{ if (build_cursor){ build_cursor.destroy(); unitlayer.removeChild(build_cursor); build_cursor = null; }; } public function checkCursor():void{ var _local1:uint; var _local2:uint; var _local3:Boolean; if (build_cursor != null){ build_cursor.visible = true; _local1 = Math.floor(((unitlayer.mouseX / Consts.cell_size) + 0.5)); _local2 = Math.floor(((unitlayer.mouseY / Consts.cell_size) + 0.5)); _local3 = true; build_cursor.x = (_local1 * Consts.cell_size); build_cursor.y = (_local2 * Consts.cell_size); if ((((((_local1 >= map_width)) || ((_local2 >= map_height)))) || ((_local2 < 7)))){ _local3 = false; } else { if (world.getxy(_local1, _local2) != 0){ _local3 = false; }; }; build_cursor.setGood(_local3); }; } private function addUnit(_arg1:Unit):void{ if (_arg1.flag(UnitFlags.Flying)){ airworld.setpos(_arg1.pos, _arg1.mapid); } else { if (_arg1.sprite_width > Consts.cell_size){ setUnitPos(_arg1, _arg1.mapid); } else { world.setpos(_arg1.pos, _arg1.mapid); }; }; _arg1.activate(engine); _arg1.sprite.x = (_arg1.pos.x * Consts.cell_size); _arg1.sprite.y = (_arg1.pos.y * Consts.cell_size); _arg1.sprite.visible = true; if (_arg1.mapid == Consts.myId){ my_camp.add(_arg1); } else { if (_arg1.mapid == Consts.hostileId){ enemy_camp.add(_arg1); } else { resources.add(_arg1); }; }; } private function findRefinery(_arg1:Unit):Unit{ return (_arg1.life.ore_goal.refinery); } public function positionLayers():void{ unitlayer.x = (Consts.cell_size / 2); unitlayer.y = (Consts.cell_size / 2); backgr.x = (-(Consts.cell_size) / 2); backgr.y = (-(Consts.cell_size) / 2); } public function moveMap(_arg1:int, _arg2:int):void{ var _local3:int; var _local4:int; _local3 = (maplayer.x + _arg1); _local4 = (maplayer.y + _arg2); if (_local3 > 0){ maplayer.x = 0; } else { if ((Math.abs(_local3) + Consts.ScreenWidth) > (map_width * Consts.cell_size)){ maplayer.x = ((-(map_width) * Consts.cell_size) + Consts.ScreenWidth); } else { maplayer.x = _local3; }; }; if (_local4 > 0){ maplayer.y = 0; } else { if ((Math.abs(_local4) + Consts.ScreenHeight) > (map_height * Consts.cell_size)){ maplayer.y = ((-(map_height) * Consts.cell_size) + Consts.ScreenHeight); } else { maplayer.y = _local4; }; }; } public function load(_arg1:LevelMap):void{ var _local2:XMLList; var _local3:XML; var _local4:Unit; var _local5:XMLList; var _local6:XML; var _local7:XMLList; var _local8:XML; var _local9:XMLList; var _local10:XML; var _local11:Unit; map_width = _arg1.data.size.@width; map_height = _arg1.data.size.@height; world = new MapMatrix(map_width, map_height); airworld = new MapMatrix(map_width, map_height); my_camp = new Camp(); enemy_camp = new Camp(); resources = new Camp(); createLayers(); backgr.setTileType(_arg1.data.background.@type); _local2 = _arg1.data.wall; for each (_local3 in _local2) { backgr.addWall(_local3.@type, _local3.@x, _local3.@y); }; _local4 = null; _local5 = _arg1.data.crystals; for each (_local6 in _local5) { buildUnit(UnitTypes.sp_crystals, 0, _local6.@x, _local6.@y, false); }; _local7 = _arg1.data.unit; for each (_local8 in _local7) { _local11 = buildUnit(_local8.@type, Consts.myId, _local8.@x, _local8.@y, true); if (UnitTypes.command_center == _local11.type){ engine.command_center = _local11; }; }; _local9 = _arg1.data.enemy; for each (_local10 in _local9) { buildUnit(_local10.@type, Consts.hostileId, _local10.@x, _local10.@y, true); }; engine.crystals = _arg1.data.scenario.crystals.@value; moveMap(0, (-(Consts.cell_size) * map_height)); } } }//package fai
Section 21
//GameButtons (fai.GameButtons) package fai { import flash.events.*; import flash.display.*; public class GameButtons extends Sprite { public var engine:Engine;// = null private var other_buttons:Array; private var bomb_tooltip:BombTooltipMC;// = null public var buttons:Map;// = null private var container:Sprite;// = null public var selected_unit:Unit;// = null public function GameButtons(_arg1:Engine):void{ engine = null; buttons = null; container = null; bomb_tooltip = null; other_buttons = []; selected_unit = null; super(); engine = _arg1; buttons = new Map(); create(); } public function onoutbutton(_arg1:MouseEvent):void{ bomb_tooltip.visible = false; if ((_arg1.currentTarget is ButtonSprite)){ _arg1.currentTarget.select(false); if (selected_unit){ selected_unit = null; engine.play_window.updateInfo(); }; }; } public function create():void{ var _local1:int; var _local2:ButtonSprite; var _local3:int; container = new Sprite(); addChild(container); container.y = 2; _local1 = 45; _local2 = null; _local2 = createButton(UnitTypes.laser_cannon, false, "1"); _local2 = createButton(UnitTypes.artillery, false, "2"); _local2.x = (_local1 + 4); _local2 = createButton(UnitTypes.missile_turret, false, "3"); _local2.x = ((_local1 + 4) * 2); _local2 = createButton(UnitTypes.plasma_mortar, false, "4"); _local2.x = ((_local1 + 4) * 3); _local2 = createButton(UnitTypes.stunner, false, "5"); _local2.y = (_local1 + 4); _local2 = createButton(UnitTypes.refinery, false, "6"); _local2.y = (_local1 + 4); _local2.x = (_local1 + 4); _local2 = createButton(UnitTypes.power_station, false, "7"); _local2.y = (_local1 + 4); _local2.x = ((_local1 + 4) * 2); _local3 = 447; _local2 = createButton(UnitTypes.b_attack, true, "A"); _local2.x = (_local1 + 4); _local2.y = ((_local1 + 4) * 2); _local2 = createButton(UnitTypes.b_stop, true, "Space"); _local2.x = ((_local1 + 4) * 2); _local2.y = ((_local1 + 4) * 2); _local2 = createButton(UnitTypes.b_cancel, true, "Esc"); _local2.x = ((_local1 + 4) * 3); _local2.y = ((_local1 + 4) * 2); bomb_tooltip = new BombTooltipMC(); bomb_tooltip.visible = false; engine.play_window.addChild(bomb_tooltip); } public function onclick(_arg1:MouseEvent):void{ if (engine.paused){ return; }; engine.playSound(Sounds.click1); if ((_arg1.currentTarget is ButtonSprite)){ engine.actions.buttonPressed(_arg1.currentTarget.type); }; } public function onoverbutton(_arg1:MouseEvent):void{ if ((_arg1.currentTarget is ButtonSprite)){ _arg1.currentTarget.select(true); showTooltip(_arg1.target.type, _arg1.currentTarget.y); selected_unit = engine.utypes.units[_arg1.currentTarget.type]; if (selected_unit){ engine.play_window.updateInfo(); }; }; } public function action():void{ hideButtons(); buttons.get(UnitTypes.b_cancel).visible = true; } private function createButton(_arg1:String, _arg2:Boolean=false, _arg3:String=""):ButtonSprite{ var _local4:AnimatedBitmap; var _local5:ButtonSprite; _local4 = engine.sloader.getButton(_arg1); _local5 = new ButtonSprite(_arg1, _local4); _local5.addEventListener(MouseEvent.MOUSE_DOWN, onclick); _local5.addEventListener(MouseEvent.MOUSE_OVER, onoverbutton); _local5.addEventListener(MouseEvent.MOUSE_OUT, onoutbutton); container.addChild(_local5); if (_arg3 != ""){ _local5.makeHotKey(_arg3); }; if (_arg2){ _local5.visible = false; buttons.add(_arg1, _local5); } else { other_buttons.push(_local5); }; _local5.buttonMode = true; _local5.mouseChildren = false; return (_local5); } public function showTooltip(_arg1:String, _arg2:int):void{ bomb_tooltip.x = 390; bomb_tooltip.y = (_arg2 + 60); switch (_arg1){ case UnitTypes.nitro_bomb: bomb_tooltip.title.text = "Nitro Bomb (B)"; bomb_tooltip.crystals.text = Consts.nitro_bomb_cost.toString(); bomb_tooltip.epicenter.text = "250"; bomb_tooltip.visible = true; break; case UnitTypes.cumulative_bomb: bomb_tooltip.title.text = "Cumulative Bomb (C)"; bomb_tooltip.crystals.text = Consts.cumulative_bomb_cost.toString(); bomb_tooltip.epicenter.text = "1000"; bomb_tooltip.visible = true; break; case UnitTypes.nuclear_missile: bomb_tooltip.title.text = "Nuclear Missile (N)"; bomb_tooltip.crystals.text = Consts.nuclear_missile_cost.toString(); bomb_tooltip.epicenter.text = "5000"; bomb_tooltip.visible = true; break; }; } public function showButtons(_arg1:String):void{ hideButtons(); if (!engine.utypes.params(_arg1).flag(UnitFlags.Peaceful)){ buttons.get(UnitTypes.b_attack).visible = true; buttons.get(UnitTypes.b_stop).visible = true; }; } public function hideButtons():void{ var _local1:ButtonSprite; for each (_local1 in buttons.values) { _local1.visible = false; }; } public function destroy():void{ var _local1:int; engine.play_window.removeChild(bomb_tooltip); bomb_tooltip = null; _local1 = 0; _local1 = 0; while (_local1 < other_buttons.length) { other_buttons[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, onclick); other_buttons[_local1].removeEventListener(MouseEvent.MOUSE_OVER, onoverbutton); other_buttons[_local1].removeEventListener(MouseEvent.MOUSE_OUT, onoutbutton); container.removeChild(other_buttons[_local1]); _local1++; }; _local1 = 0; while (_local1 < buttons.values.length) { buttons.values[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, onclick); buttons.values[_local1].removeEventListener(MouseEvent.MOUSE_OVER, onoverbutton); buttons.values[_local1].removeEventListener(MouseEvent.MOUSE_OUT, onoutbutton); container.removeChild(buttons.values[_local1]); _local1++; }; other_buttons.length = 0; buttons.values.length = 0; removeChild(container); container = null; } } }//package fai
Section 22
//GameEvents (fai.GameEvents) package fai { import flash.events.*; import flash.utils.*; import flash.ui.*; public class GameEvents { private var engine:Engine;// = null public var cursorpos:Position; public var downPoint:Position; public var mouseWithinMap:Boolean;// = false private var radarTimer:Timer;// = null public var selecting:Boolean;// = false public function GameEvents(_arg1:Engine):void{ engine = null; mouseWithinMap = false; selecting = false; downPoint = new Position(); cursorpos = new Position(); radarTimer = null; super(); engine = _arg1; } public function unregister():void{ GameStage.main_stage.removeEventListener(Event.ENTER_FRAME, tick); GameStage.main_stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); GameStage.main_stage.removeEventListener(MouseEvent.MOUSE_MOVE, onmoving); engine.game_board.unitlayer.removeEventListener(MouseEvent.MOUSE_DOWN, onmousedown); engine.game_board.unitlayer.removeEventListener(MouseEvent.MOUSE_UP, onmouseup); engine.game_board.unitlayer.removeEventListener(MouseEvent.MOUSE_OUT, onmapmouseout); engine.game_board.unitlayer.removeEventListener(MouseEvent.MOUSE_OVER, onmapmouseover); if (radarTimer){ radarTimer.stop(); radarTimer.removeEventListener(TimerEvent.TIMER, radarTimerHander); radarTimer = null; }; } public function onmousedown(_arg1:MouseEvent):void{ var _local2:uint; var _local3:uint; var _local4:BuildCursor; var _local5:Unit; var _local6:Unit; downPoint.x = engine.game_board.unitlayer.mouseX; downPoint.y = engine.game_board.unitlayer.mouseY; _local2 = Math.floor(((engine.game_board.unitlayer.mouseX / Consts.cell_size) + 0.5)); _local3 = Math.floor(((engine.game_board.unitlayer.mouseY / Consts.cell_size) + 0.5)); _local4 = engine.game_board.build_cursor; if (_local4 != null){ if (engine.paused){ return; }; if (_local4.isGood()){ if (!engine.isCrystalsEnough(_local4.type)){ engine.log("Not enough crystals"); return; }; if (((!((_local4.type == UnitTypes.power_station))) && ((engine.energy_fill >= engine.energy)))){ engine.log("Not enough energy. Build more power stations."); return; }; engine.crystals = (engine.crystals - _local4.cost_crystals); engine.playSound(Sounds.build); _local5 = engine.game_board.buildUnit(_local4.type, Consts.myId, _local2, _local3, false); _local5.sprite.startBuilding(); engine.game_process.builder.addTask(_local5, _local4.type); engine.actions.clear(); engine.game_board.removeBuildCursor(); engine.game_process.updatePower(); engine.play_window.updateResources(); engine.play_window.stats.built++; engine.game_process.deselectUnits(); engine.game_process.selected_units.push(_local5); engine.play_window.updateInfo(); }; return; }; if (engine.actions.hasDoAction()){ engine.actions.doAction(); } else { _local6 = engine.game_board.my_camp.getUnder(downPoint); if (!_local6){ _local6 = engine.game_board.enemy_camp.getUnder(downPoint); if (!_local6){ _local6 = engine.game_board.resources.getUnder(downPoint); }; }; if (_local6){ if (((((!(_arg1.shiftKey)) || (!((_local6.mapid == Consts.myId))))) || ((((engine.game_process.selected_units.length > 0)) && (!((engine.game_process.selected_units[0].mapid == Consts.myId))))))){ engine.game_process.deselectUnits(); } else { if (((_arg1.shiftKey) && (engine.game_process.isUnitInSelection(_local6)))){ engine.game_process.deselectUnit(_local6); return; }; }; if (engine.game_process.selected_units.length < 8){ engine.game_process.selected_units.push(_local6); }; engine.play_window.updateInfo(); } else { selecting = true; }; }; } private function onKeyDown(_arg1:KeyboardEvent):void{ if (Keyboard.ESCAPE == _arg1.keyCode){ engine.game_board.removeBuildCursor(); engine.actions.endAction(); } else { if (Keyboard.SPACE == _arg1.keyCode){ engine.game_process.stopUnits(); } else { if (Keyboard.F12 == _arg1.keyCode){ engine.play_window.menuPressed(null); } else { switch (_arg1.charCode){ case 49: engine.actions.buttonPressed(UnitTypes.laser_cannon); break; case 50: engine.actions.buttonPressed(UnitTypes.artillery); break; case 51: engine.actions.buttonPressed(UnitTypes.missile_turret); break; case 52: engine.actions.buttonPressed(UnitTypes.plasma_mortar); break; case 53: engine.actions.buttonPressed(UnitTypes.stunner); break; case 54: engine.actions.buttonPressed(UnitTypes.refinery); break; case 55: engine.actions.buttonPressed(UnitTypes.power_station); break; case 66: case 98: engine.actions.buttonPressed(UnitTypes.nitro_bomb); break; case 67: case 99: engine.actions.buttonPressed(UnitTypes.cumulative_bomb); break; case 78: case 110: engine.actions.buttonPressed(UnitTypes.nuclear_missile); break; case 65: case 97: engine.actions.buttonPressed(UnitTypes.b_attack); break; case 85: case 117: engine.play_window.upgradePressed(null); break; case 83: case 115: if (engine.volumeOff){ engine.volumeOff = false; engine.play_window.right_menu.sound_off_button.visible = true; engine.play_window.right_menu.sound_on_button.visible = false; } else { engine.volumeOff = true; engine.play_window.right_menu.sound_off_button.visible = false; engine.play_window.right_menu.sound_on_button.visible = true; }; break; }; }; }; }; } private function onmapmouseover(_arg1:MouseEvent):void{ mouseWithinMap = true; if (engine.game_board.build_cursor){ engine.game_board.build_cursor.visible = true; } else { if (engine.play_window.custom_cursor.enabled){ engine.play_window.custom_cursor.show(); }; }; } private function onmouseup(_arg1:MouseEvent):void{ if (selecting){ engine.game_process.endSelection(); }; } private function radarTimerHander(_arg1:TimerEvent):void{ engine.play_window.radar.update(); } public function tick(_arg1:Event):void{ engine.game_process.builder.buildTick(); Astar.npasses = 300; engine.goal_system.tick(); } public function register():void{ GameStage.main_stage.addEventListener(Event.ENTER_FRAME, tick); GameStage.main_stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); GameStage.main_stage.addEventListener(MouseEvent.MOUSE_MOVE, onmoving); engine.game_board.unitlayer.addEventListener(MouseEvent.MOUSE_DOWN, onmousedown); engine.game_board.unitlayer.addEventListener(MouseEvent.MOUSE_UP, onmouseup); engine.game_board.unitlayer.addEventListener(MouseEvent.MOUSE_OUT, onmapmouseout); engine.game_board.unitlayer.addEventListener(MouseEvent.MOUSE_OVER, onmapmouseover); radarTimer = new Timer(1200, 0); radarTimer.addEventListener(TimerEvent.TIMER, radarTimerHander); radarTimer.start(); engine.play_window.radar.update(); } private function onmoving(_arg1:MouseEvent):void{ var evt = _arg1; cursorpos.x = evt.stageX; cursorpos.y = evt.stageY; engine.game_board.checkCursor(); if (engine.play_window.custom_cursor.enabled){ engine.play_window.custom_cursor.x = engine.game_board.unitlayer.mouseX; engine.play_window.custom_cursor.y = engine.game_board.unitlayer.mouseY; }; if (selecting){ if (!evt.buttonDown){ engine.game_process.endSelection(); return; }; var _local3 = engine.game_board.selshape.graphics; with (_local3) { clear(); lineStyle(1, 1804218); beginFill(6077415, 0.3); drawRect(downPoint.x, downPoint.y, -((downPoint.x - engine.game_board.unitlayer.mouseX)), -((downPoint.y - engine.game_board.unitlayer.mouseY))); endFill(); }; }; } private function onmapmouseout(_arg1:MouseEvent):void{ mouseWithinMap = false; if (engine.game_board.build_cursor){ engine.game_board.build_cursor.visible = false; } else { if (engine.play_window.custom_cursor.enabled){ engine.play_window.custom_cursor.hide(); }; }; } } }//package fai
Section 23
//GameProcess (fai.GameProcess) package fai { import flash.display.*; public class GameProcess { private var engine:Engine;// = null public var selected_units:Array; private var game_board:GameBoard;// = null public var builder:UnitBuilder;// = null public function GameProcess(_arg1:Engine):void{ engine = null; builder = null; selected_units = []; game_board = null; super(); engine = _arg1; builder = new UnitBuilder(engine); game_board = engine.game_board; } public function attackTarget(_arg1:Position):void{ var _local2:Unit; var _local3:Unit; _local2 = getUnitUnder(_arg1); if (_local2){ for each (_local3 in selected_units) { if (!_local3.flag(UnitFlags.Peaceful)){ _local3.life.setAttackTarget(_local2); }; }; }; } public function isSelectedUnit(_arg1:Unit):Boolean{ if ((((selected_units.length == 1)) && ((selected_units[0] == _arg1)))){ return (true); }; return (false); } public function stopUnits():void{ var _local1:Unit; for each (_local1 in selected_units) { _local1.life.stop(); }; } public function effect(_arg1:int, _arg2:int, _arg3:String):void{ var _local4:BitmapData; var _local5:AnimatedBitmap; var _local6:EffectGoal; _local4 = engine.sloader.specials[_arg3][0].content.bitmapData; _local5 = new AnimatedBitmap(_local4, 32, _local4.height); _local5.x = _arg1; _local5.y = _arg2; game_board.bulletlayer.addChild(_local5); _local6 = new EffectGoal(_local5, engine); engine.goal_system.add(_local6); } public function deselectUnit(_arg1:Unit):void{ var _local2:int; if (selected_units.length > 0){ if (isSelectedUnit(_arg1)){ _arg1.sprite.select(false); selected_units.length = 0; engine.actions.clear(); } else { _local2 = 0; while (_local2 < selected_units.length) { if (selected_units[_local2] == _arg1){ _arg1.sprite.select(false); selected_units.splice(_local2, 1); break; } else { _local2++; }; }; }; engine.play_window.updateInfo(); }; } public function runBullet(_arg1:Unit, _arg2:Unit, _arg3:Position):void{ var _local4:BulletGoal; _local4 = new BulletGoal(_arg1, _arg2, _arg3, engine); game_board.bulletlayer.addChild(_local4.bullet); engine.goal_system.add(_local4); } public function endBuilding(_arg1:Unit, _arg2:String, _arg3:Boolean):void{ var _local4:Astar; var _local5:Position; var _local6:Boolean; var _local7:int; var _local8:int; var _local9:Unit; var _local10:Camp; if (((_arg3) && (isSelectedUnit(_arg1)))){ engine.actions.clear(); }; if (!engine.utypes.params(_arg2).flag(UnitFlags.Building)){ _local4 = null; if (engine.utypes.params(_arg2).flag(UnitFlags.Flying)){ _local4 = new Astar(game_board.airworld, 0); } else { _local4 = new Astar(game_board.world, 0); }; _local4.checkxy = _local4.checknotempty; _local5 = new Position(_arg1.pos.x, _arg1.pos.y); _local6 = false; _local7 = (_arg1.pos.x - 1); while (_local7 <= (_arg1.pos.x + 1)) { _local8 = (_arg1.pos.y - 1); while (_local8 <= (_arg1.pos.y + 1)) { _local5.set(_local7, _local8); if (!_local5.isequal(_arg1.pos)){ _local4.neighbours(_local5); if (_local4.ns.length > 0){ _local9 = game_board.buildUnit(_arg2, _arg1.mapid, _local4.ns[0].x, _local4.ns[0].y, true); if (UnitTypes.harvester == _local9.type){ engine.harvs.add(Utils.unitId(_arg1), _local9); _local9.life.pick(_arg1); }; _local6 = true; break; }; }; _local8++; }; if (_local6){ break; }; _local7++; }; } else { if (!_arg1.isAlive()){ return; }; _arg1.sprite.stopBuilding(); if (!_arg1.flag(UnitFlags.Peaceful)){ _local10 = ((_arg1.mapid == Consts.myId)) ? game_board.enemy_camp : game_board.my_camp; _arg1.life.attack(_local10); } else { if (_arg1.type == UnitTypes.refinery){ endBuilding(_arg1, UnitTypes.harvester, true); }; }; }; updatePower(); engine.play_window.updateInfo(); engine.play_window.updateResources(); } public function endSelection():void{ var _local1:int; var _local2:int; var _local3:int; var _local4:int; var _local5:Array; engine.events.selecting = false; engine.game_board.selshape.graphics.clear(); _local1 = (engine.events.downPoint.x - game_board.unitlayer.mouseX); _local2 = (engine.events.downPoint.y - game_board.unitlayer.mouseY); if ((((_local1 == 0)) || ((_local2 == 0)))){ return; }; _local3 = engine.events.downPoint.x; _local4 = engine.events.downPoint.y; if (_local2 > 0){ _local4 = game_board.unitlayer.mouseY; }; if (_local1 > 0){ _local3 = game_board.unitlayer.mouseX; }; _local5 = new Array(); game_board.my_camp.getUnderSelection(Math.floor(((_local3 / Consts.cell_size) + 0.5)), Math.floor(((_local4 / Consts.cell_size) + 0.5)), Math.floor(((Math.abs(_local1) / Consts.cell_size) + 0.5)), Math.floor(((Math.abs(_local2) / Consts.cell_size) + 0.5)), _local5); if (_local5.length > 0){ if (_local5.length > 8){ _local5.length = 8; }; deselectUnits(); selected_units = _local5; engine.play_window.updateInfo(); }; } public function deselectUnits():void{ var _local1:Unit; if (selected_units.length > 0){ for each (_local1 in selected_units) { _local1.sprite.select(false); }; selected_units.length = 0; engine.actions.clear(); }; } public function hitUnit(_arg1:int, _arg2:Unit):void{ var _local3:int; var _local4:int; var _local5:Number; if (!_arg2.isAlive()){ return; }; if (_arg2.mapid == Consts.myId){ if (_arg2.life.auto_repair){ if (((((!(_arg2.life.repair_goal)) || (!(_arg2.life.repair_goal.active)))) && ((engine.crystals > 0)))){ _arg2.life.repair(); }; }; }; _local3 = (_arg1 - _arg2.armor); if (_local3 <= 0){ _local3 = 1; }; _arg2.health = (_arg2.health - _local3); if (((_arg2.sprite.selection) && (_arg2.sprite.selection.visible))){ _arg2.updateHealth(); }; if (!_arg2.isAlive()){ if (_arg2.life.froze_goal != null){ _arg2.life.unfroze(); }; engine.game_board.destroyUnit(_arg2); if (UnitTypes.power_station == _arg2.type){ updatePower(); }; engine.play_window.updateResources(); } else { if (_arg2.mapid == Consts.crystalsId){ _local4 = engine.utypes.params(_arg2.type).health; _local5 = (_arg2.health / _local4); _arg2.sprite.sprite.setFrame(((4 - (5 * _local5)) + 1)); }; }; if (isUnitInSelection(_arg2)){ engine.play_window.updateInfo(); }; } public function isUnitInSelection(_arg1:Unit):Boolean{ var _local2:Unit; for each (_local2 in selected_units) { if (_local2 == _arg1){ return (true); }; }; return (false); } public function destroy():void{ builder.clear(); builder = null; } public function updatePower():void{ var _local1:int; var _local2:Unit; engine.energy = 10; engine.energy_fill = 0; _local1 = 0; _local1 = 0; while (_local1 < game_board.my_camp.units.length) { _local2 = game_board.my_camp.units[_local1]; if (UnitTypes.power_station == _local2.type){ if (((_local2.isAlive()) && ((engine.game_process.builder.inBuilding(_local2) == null)))){ engine.energy = (engine.energy + Consts.PowerStationAdd); }; } else { engine.energy_fill = (engine.energy_fill + 1); }; _local1++; }; } public function getUnitUnder(_arg1:Position):Unit{ var _local2:Unit; _local2 = game_board.enemy_camp.getInMapUnder(_arg1); if (!_local2){ _local2 = game_board.my_camp.getInMapUnder(_arg1); }; return (_local2); } private function isSelectedType(_arg1:String):Boolean{ var _local2:Unit; for each (_local2 in selected_units) { if (_arg1 == _local2.type){ return (true); }; }; return (false); } } }//package fai
Section 24
//Goal (fai.Goal) package fai { public class Goal { public var owner:Unit;// = null public var active:Boolean;// = true public function Goal(){ active = true; owner = null; super(); } public function deactivate():void{ active = false; } } }//package fai
Section 25
//GoalSystem (fai.GoalSystem) package fai { public class GoalSystem { public var goals:Array; private var active_count:int;// = 0 private var counter:int;// = 0 public function GoalSystem(){ goals = []; counter = 0; active_count = 0; super(); } public function add(_arg1):void{ goals.push(_arg1); } public function activeCount():int{ return (active_count); } private function cleanGoals():void{ var _local1:int; _local1 = 0; while (_local1 < goals.length) { if (!goals[_local1].active){ delete goals[_local1]; goals.splice(_local1, 1); } else { _local1++; }; }; } public function tick():void{ var _local1:uint; _local1 = 0; active_count = 0; while (_local1 < goals.length) { if (goals[_local1].active){ goals[_local1].advance(); active_count++; }; _local1++; }; if (!counter){ cleanGoals(); counter = Consts.GOALSCLEANPAUSE; } else { counter--; }; } public function removeOwner(_arg1:Unit):void{ var _local2:uint; _local2 = 0; while (_local2 < goals.length) { if (goals[_local2].owner == _arg1){ goals[_local2].deactivate(); }; _local2++; }; } } }//package fai
Section 26
//KeyboardKeys (fai.KeyboardKeys) package fai { import flash.events.*; public class KeyboardKeys { private static var initialized:Boolean = false; private static var keys:Object = new Object(); public static function init(_arg1):void{ GameStage.main_stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); GameStage.main_stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased); initialized = true; } private static function keyPressed(_arg1:KeyboardEvent):void{ keys[_arg1.keyCode] = true; } public static function isDown(_arg1:uint):Boolean{ if (!initialized){ return (false); }; if (Boolean((_arg1 in keys))){ return (keys[_arg1]); }; return (false); } private static function keyReleased(_arg1:KeyboardEvent):void{ keys[_arg1.keyCode] = false; } } }//package fai
Section 27
//LevelMap (fai.LevelMap) package fai { public class LevelMap { public var number:int;// = 0 public var data:XML;// = null public var desc:String;// = null public var title:String;// = null public function LevelMap(_arg1:XML):void{ data = null; title = null; desc = null; number = 0; super(); data = _arg1; title = data.title.toString(); desc = data.description.toString(); number = int(data.@number); } } }//package fai
Section 28
//LevelParams (fai.LevelParams) package fai { public final class LevelParams { public static var enemy_count:Array = [4, 3, 5, 4, 3, 3, 2, 2, 2, 8, 6, 8, 6, 5, 5, 4, 4, 4, 9, 8, 9, 8, 7, 6, 5, 5, 6, 11, 9, 11, 9, 8, 8, 7, 7, 8, 14, 10, 12, 6, 5, 5, 6, 7, 8, 12, 9, 10, 6, 5, 5, 6, 6, 6, 14, 10, 12, 7, 6, 6, 7, 7, 7, 15, 11, 15, 8, 6, 6, 6, 7, 7, 16, 11, 15, 9, 7, 7, 7, 8, 8, 17, 12, 16, 10, 8, 8, 8, 9, 9, 18, 14, 17, 11, 9, 9, 9, 10, 10]; public static var bosses:Array = [[[UnitTypes.interceptor, 0]], [[UnitTypes.executor, 0]], [[UnitTypes.interceptor, 0], [UnitTypes.interceptor, 1]], [[UnitTypes.star_conqueror, 1]], [[UnitTypes.executor, 1], [UnitTypes.executor, 1]], [[UnitTypes.star_conqueror, 2]], [[UnitTypes.interceptor, 4]], [[UnitTypes.executor, 4]], [[UnitTypes.star_conqueror, 3]], [[UnitTypes.executor, 4], [UnitTypes.interceptor, 4]], [[UnitTypes.executor, 5], [UnitTypes.interceptor, 5]], [[UnitTypes.star_conqueror, 5]]]; public static var special_cases:Array = [[((0 * 10000) + 0), 8], [((0 * 10000) + 7), 1], [((1 * 10000) + 0), 25]]; } }//package fai
Section 29
//LifeGoal (fai.LifeGoal) package fai { public class LifeGoal extends Goal { private var engine:Engine;// = null public var repair_goal:RepairGoal;// = null public var ore_goal:OreGoal;// = null public var goal_system:GoalSystem;// = null public var auto_repair:Boolean;// = false public var froze_goal:FrozeGoal;// = null private var attack_goal:AttackGoal;// = null public function LifeGoal(_arg1:Engine, _arg2:Unit):void{ attack_goal = null; repair_goal = null; ore_goal = null; engine = null; goal_system = null; froze_goal = null; auto_repair = false; super(); owner = _arg2; engine = _arg1; goal_system = new GoalSystem(); } public function advance():void{ if (repair_goal){ if (repair_goal.active){ repair_goal.advance(); } else { repair_goal = null; }; }; if (attack_goal){ attack_goal.advance(); }; goal_system.tick(); } public function repair():void{ if (repair_goal){ repair_goal.deactivate(); repair_goal = null; return; }; repair_goal = new RepairGoal(owner, engine); } public function froze():void{ if (!owner.isAlive()){ return; }; if (froze_goal != null){ froze_goal.delay = Consts.FrozeDelay; return; }; froze_goal = new FrozeGoal(engine, owner); if (UnitTypes.isBoss(owner.type)){ froze_goal.delay = 50; }; engine.goal_system.add(froze_goal); } public function move(_arg1:Position, _arg2:Boolean=false):void{ var _local3:*; var _local4:MoveGoal; for each (_local3 in goal_system.goals) { if ((_local3 is MoveGoal)){ _local3.deactivate(); }; }; _local4 = new MoveGoal(owner, engine); _local4.setMoveTarget(_arg1, _arg2); goal_system.add(_local4); if (_arg2){ if (attack_goal){ attack_goal.clearPreciseTarget(); attack_goal.paused = true; }; } else { if (attack_goal){ attack_goal.paused = false; }; }; } public function unfroze():void{ if (froze_goal){ froze_goal.deactivate(); froze_goal = null; }; } public function attack(_arg1:Camp):void{ if (attack_goal){ attack_goal.deactivate(); attack_goal = null; }; attack_goal = new AttackGoal(owner, _arg1); } public function stop():void{ var _local1:*; for each (_local1 in goal_system.goals) { if ((_local1 is MoveGoal)){ _local1.deactivate(); }; }; if (attack_goal){ attack_goal.clearPreciseTarget(); }; } public function destroy(_arg1:Boolean=false):void{ var _local2:int; unfroze(); _local2 = 0; while (_local2 < goal_system.goals.length) { if (goal_system.goals[_local2].active){ goal_system.goals[_local2].deactivate(); }; _local2++; }; goal_system.goals.length = 0; if (repair_goal){ repair_goal.deactivate(); repair_goal = null; }; if (attack_goal){ attack_goal.deactivate(); attack_goal = null; }; if (ore_goal){ ore_goal.deactivate(); ore_goal = null; }; if (((_arg1) && (owner))){ if (owner.mapid == Consts.crystalsId){ engine.game_board.resourcelayer.removeChild(owner.sprite); } else { if (owner.flag(UnitFlags.Flying)){ engine.game_board.airlayer.removeChild(owner.sprite); } else { engine.game_board.groundlayer.removeChild(owner.sprite); }; }; owner.destroy(); owner = null; active = false; }; } public function pick(_arg1:Unit):void{ if (ore_goal){ ore_goal.deactivate(); }; ore_goal = new OreGoal(owner, _arg1, engine); goal_system.add(ore_goal); } override public function deactivate():void{ if (owner){ destroy(); goal_system.add(new DieGoal(owner, engine, this)); }; } public function setAttackTarget(_arg1:Unit):void{ if (_arg1 == owner){ engine.log("I can't attack myself."); return; }; if (attack_goal){ attack_goal.clearPreciseTarget(); attack_goal.preciseTarget = _arg1; }; } } }//package fai
Section 30
//MainMenuMC (fai.MainMenuMC) package fai { import flash.events.*; import flash.display.*; import flash.utils.*; import mochi.*; import flash.net.*; public dynamic class MainMenuMC extends MovieClip { private var link1Timer:Timer;// = null private var linkTimer:Timer;// = null public var engine:Engine;// = null public var play_all_levels_button:SimpleButton; public var start_game_button:SimpleButton; public var onSiteBt:SimpleButton; public var planets:PlanetsMC;// = null public var hs_button:SimpleButton; public var playMoreBt:SimpleButton; public function MainMenuMC():void{ engine = null; planets = null; link1Timer = null; linkTimer = null; super(); start_game_button.addEventListener(MouseEvent.MOUSE_DOWN, startGame); hs_button.addEventListener(MouseEvent.MOUSE_DOWN, highscores); playMoreBt.addEventListener(MouseEvent.MOUSE_DOWN, moreGames); onSiteBt.addEventListener(MouseEvent.MOUSE_DOWN, onSite); play_all_levels_button.visible = false; } public function showPlanets():void{ planets.visible = true; planets.show(); } public function initGame(_arg1):void{ if (engine){ return; }; GameStage.main_holder = new Sprite(); addChild(GameStage.main_holder); engine = new Engine(_arg1); planets = new PlanetsMC(); planets.init(engine); planets.visible = false; GameStage.main_holder.addChild(planets); } private function highscores(_arg1:MouseEvent):void{ var evt = _arg1; engine.playSound(Sounds.click); MochiScores.showLeaderboard({boardID:"eb79342347b90226", onClose:function (){ }}); } private function linkTimerHandler(_arg1:TimerEvent):void{ var _local2:URLRequest; linkTimer.stop(); linkTimer.removeEventListener(TimerEvent.TIMER, linkTimerHandler); linkTimer = null; _local2 = new URLRequest("http://www.dragongamez.com/"); } private function link1TimerHandler(_arg1:TimerEvent):void{ var req:URLRequest; var evt = _arg1; link1Timer.stop(); link1Timer.addEventListener(TimerEvent.TIMER, link1TimerHandler); link1Timer = null; linkTimer = new Timer(3000, 1); linkTimer.addEventListener(TimerEvent.TIMER, linkTimerHandler); linkTimer.start(); try { req = new URLRequest("http://www.dragongamez.com/"); } finally { }; } public function allLevels(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); link1Timer = new Timer(2000, 1); link1Timer.addEventListener(TimerEvent.TIMER, link1TimerHandler); link1Timer.start(); planets.onlyatdg.visible = true; } private function startGame(_arg1:MouseEvent):void{ showPlanets(); } function onSite(_arg1:MouseEvent){ var _local2:URLRequest; _local2 = new URLRequest("http://www.yougame.com/putonyourwebsite/"); navigateToURL(_local2, "_top"); } function moreGames(_arg1:MouseEvent){ var _local2:URLRequest; _local2 = new URLRequest("http://www.yougame.com/"); navigateToURL(_local2, "_top"); } } }//package fai
Section 31
//Map (fai.Map) package fai { public class Map { public var values:Array; protected var index_:int;// = 0 public var keys:Array; public function Map(){ keys = new Array(); values = new Array(); index_ = 0; super(); } public function add(_arg1:Object, _arg2):void{ index_ = 0; find(_arg1); keys.splice(index_, 0, _arg1); values.splice(index_, 0, _arg2); } public function empty():Boolean{ return ((keys.length == 0)); } public function shift(){ var _local1:*; _local1 = values.shift(); keys.shift(); return (_local1); } public function remove(_arg1:Object):void{ if (find(_arg1)){ keys.splice(index_, 1); values.splice(index_, 1); }; } public function size():int{ return (keys.length); } public function pop(){ var _local1:*; _local1 = values.pop(); keys.pop(); return (_local1); } public function get(_arg1:Object){ if (!find(_arg1)){ return (null); }; return (values[index_]); } public function getout(_arg1:Object){ var _local2:*; if (!find(_arg1)){ return (null); }; _local2 = values[index_]; values.splice(index_, 1); keys.splice(index_, 1); return (_local2); } public function find(_arg1:Object):Boolean{ var _local2:int; var _local3:int; _local2 = 0; _local3 = (keys.length - 1); while (_local2 <= _local3) { index_ = ((_local2 + _local3) >> 1); if (_arg1 < keys[index_]){ _local3 = (index_ - 1); } else { if (_arg1 > keys[index_]){ _local2 = (index_ + 1); } else { return (true); }; }; }; index_ = _local2; return (false); } public function clear():void{ keys.length = 0; values.length = 0; index_ = 0; } } }//package fai
Section 32
//MapMatrix (fai.MapMatrix) package fai { public class MapMatrix { public var matrix:Array; public var v:uint;// = 0 public var h:uint;// = 0 public function MapMatrix(_arg1:uint, _arg2:uint):void{ var _local3:int; var _local4:int; matrix = new Array(); h = 0; v = 0; super(); h = _arg1; v = _arg2; _local3 = 0; while (_local3 < v) { matrix.push(new Array(h)); _local4 = 0; while (_local4 < h) { matrix[(matrix.length - 1)][_local4] = 0; _local4++; }; _local3++; }; } public function setxy(_arg1:uint, _arg2:uint, _arg3:uint):void{ matrix[_arg2][_arg1] = _arg3; } public function getxy(_arg1:uint, _arg2:uint):uint{ return (matrix[_arg2][_arg1]); } public function clear():void{ var _local1:int; var _local2:int; _local1 = 0; while (_local1 < v) { _local2 = 0; while (_local2 < h) { matrix[_local1][_local2] = 0; _local2++; }; _local1++; }; } public function setpos(_arg1:Position, _arg2:uint):void{ matrix[_arg1.y][_arg1.x] = _arg2; } public function getpos(_arg1:Position):uint{ return (matrix[_arg1.y][_arg1.x]); } } }//package fai
Section 33
//Maps (fai.Maps) package fai { public class Maps { public static const maps:XML = <maps> <level number='0'> <title>At the periphery</title> <description>With the Old Republic gone, an outcry of resistance begins to spread across the galaxy in protest to the new Empire&#39;s tyranny. We must make the first strike to capture distant Empire&#39;s station and use it as the general camp for our forces.</description> <size width='25' height='23'/> <background type='platform.jpg'/> <unit type='Laser Cannon' x='7' y='16'/> <unit type='Laser Cannon' x='9' y='16'/> <unit type='Missile Turret' x='8' y='10'/> <wall type='station_picket.png' x='3' y='9'/> <wall type='station_picket.png' x='7' y='8'/> <wall type='station_picket.png' x='11' y='9'/> <wall type='station_picket.png' x='2' y='12'/> <wall type='platformtube.png' x='16' y='14'/> <wall type='platformtube.png' x='16' y='15'/> <wall type='platformtube.png' x='0' y='21'/> <unit type='Command Center' x='8' y='20'/> <unit type='Refinery' x='15' y='18'/> <crystals x='0' y='20'/> <crystals x='2' y='20'/> <crystals x='1' y='18'/> <crystals x='1' y='16'/> <crystals x='0' y='16'/> <crystals x='1' y='19'/> <crystals x='0' y='19'/> <crystals x='0' y='17'/> <crystals x='0' y='15'/> <crystals x='3' y='19'/> <crystals x='2' y='18'/> <crystals x='14' y='22'/> <crystals x='16' y='22'/> <crystals x='15' y='22'/> <crystals x='17' y='22'/> <crystals x='18' y='22'/> <crystals x='17' y='21'/> <crystals x='15' y='21'/> <crystals x='18' y='21'/> <crystals x='18' y='20'/> <crystals x='18' y='19'/> <crystals x='17' y='20'/> <crystals x='16' y='21'/> <scenario> <crystals value='250'/> <nwaves value='10'/> </scenario> </level> <level number='1'> <title>Tarentin</title> <description>We must withstand against Empire&#39;s forces and release this green world from the tyranny. This world has rich deposit of crystals and is very important for forthcoming battles.</description> <size width='25' height='23'/> <background type='grass.jpg'/> <unit type='Command Center' x='2' y='21'/> <unit type='Laser Cannon' x='2' y='17'/> <unit type='Laser Cannon' x='5' y='18'/> <unit type='Missile Turret' x='3' y='12'/> <unit type='Missile Turret' x='6' y='12'/> <unit type='Laser Cannon' x='9' y='12'/> <unit type='Missile Turret' x='10' y='12'/> <unit type='Refinery' x='8' y='20'/> <crystals x='11' y='21'/> <crystals x='12' y='21'/> <crystals x='13' y='21'/> <crystals x='14' y='21'/> <crystals x='14' y='19'/> <crystals x='14' y='20'/> <crystals x='13' y='20'/> <crystals x='15' y='21'/> <crystals x='14' y='18'/> <crystals x='14' y='15'/> <crystals x='15' y='15'/> <crystals x='14' y='13'/> <crystals x='13' y='17'/> <crystals x='14' y='16'/> <wall type='driedtree.png' x='0' y='13'/> <wall type='driedtree.png' x='0' y='13'/> <wall type='driedtree.png' x='0' y='12'/> <wall type='driedtree.png' x='7' y='17'/> <wall type='driedtree.png' x='6' y='14'/> <wall type='driedtree.png' x='4' y='6'/> <wall type='driedtree.png' x='10' y='9'/> <wall type='tree.png' x='15' y='6'/> <wall type='tree.png' x='16' y='7'/> <wall type='tree.png' x='16' y='10'/> <wall type='tree.png' x='17' y='12'/> <wall type='tree.png' x='16' y='14'/> <wall type='tree.png' x='16' y='16'/> <wall type='tree.png' x='16' y='17'/> <wall type='tree.png' x='17' y='18'/> <wall type='tree.png' x='16' y='18'/> <wall type='tree.png' x='15' y='18'/> <wall type='tree.png' x='16' y='15'/> <wall type='tree.png' x='16' y='13'/> <wall type='tree.png' x='15' y='16'/> <wall type='tree.png' x='15' y='13'/> <wall type='tree.png' x='16' y='11'/> <wall type='tree.png' x='15' y='9'/> <wall type='tree.png' x='16' y='9'/> <wall type='tree.png' x='17' y='9'/> <wall type='tree.png' x='16' y='19'/> <wall type='tree.png' x='12' y='10'/> <wall type='tree.png' x='12' y='9'/> <wall type='tree.png' x='11' y='9'/> <wall type='tree.png' x='3' y='7'/> <wall type='tree.png' x='5' y='8'/> <wall type='tree.png' x='0' y='11'/> <wall type='tree.png' x='8' y='16'/> <wall type='tree2.png' x='16' y='12'/> <wall type='tree2.png' x='15' y='17'/> <wall type='wall2.png' x='4' y='8'/> <crystals x='12' y='22'/> <crystals x='14' y='22'/> <crystals x='15' y='22'/> <crystals x='17' y='22'/> <crystals x='16' y='22'/> <wall type='tree.png' x='17' y='20'/> <wall type='tree.png' x='16' y='20'/> <wall type='tree.png' x='15' y='19'/> <wall type='tree.png' x='16' y='18'/> <wall type='tree.png' x='17' y='19'/> <scenario> <crystals value='250'/> <nwaves value='20'/> </scenario> </level> <level number='2'> <title>Tatuim</title> <description>Many soldiers of the Old Republic were sent into exile to this desert world. Release of this planet will bring us big forces for the Rebel.</description> <size width='25' height='23'/> <background type='desert.jpg'/> <unit type='Refinery' x='5' y='19'/> <unit type='Command Center' x='13' y='21'/> <unit type='Artillery' x='12' y='15'/> <unit type='Artillery' x='9' y='16'/> <unit type='Missile Turret' x='11' y='17'/> <crystals x='0' y='22'/> <crystals x='0' y='20'/> <crystals x='0' y='21'/> <crystals x='1' y='22'/> <crystals x='3' y='22'/> <crystals x='4' y='22'/> <crystals x='2' y='22'/> <crystals x='1' y='21'/> <crystals x='0' y='19'/> <crystals x='1' y='19'/> <crystals x='0' y='18'/> <crystals x='1' y='18'/> <crystals x='0' y='17'/> <crystals x='1' y='17'/> <crystals x='0' y='16'/> <crystals x='1' y='16'/> <crystals x='0' y='15'/> <wall type='wall2.png' x='16' y='17'/> <wall type='wall2.png' x='16' y='16'/> <wall type='wall2.png' x='4' y='13'/> <wall type='wall2.png' x='5' y='12'/> <wall type='wall2.png' x='2' y='12'/> <wall type='wall2.png' x='1' y='14'/> <wall type='wall2.png' x='9' y='8'/> <wall type='wall2.png' x='12' y='9'/> <wall type='wall2.png' x='11' y='10'/> <wall type='wall2.png' x='9' y='9'/> <wall type='wall2.png' x='16' y='9'/> <wall type='wall2.png' x='17' y='11'/> <wall type='wall1.png' x='12' y='8'/> <wall type='wall1.png' x='10' y='8'/> <wall type='wall1.png' x='2' y='14'/> <wall type='wall1.png' x='15' y='10'/> <wall type='tree2.png' x='16' y='20'/> <wall type='tree.png' x='16' y='18'/> <wall type='tree.png' x='16' y='14'/> <wall type='tree.png' x='16' y='8'/> <wall type='tree.png' x='15' y='9'/> <wall type='tree2.png' x='16' y='19'/> <wall type='tree2.png' x='15' y='17'/> <wall type='tree2.png' x='15' y='14'/> <wall type='tree2.png' x='16' y='12'/> <wall type='tree2.png' x='15' y='8'/> <wall type='driedtree.png' x='5' y='12'/> <wall type='driedtree.png' x='10' y='8'/> <wall type='tree2.png' x='7' y='9'/> <wall type='tree2.png' x='2' y='13'/> <wall type='tree2.png' x='3' y='13'/> <wall type='tree2.png' x='3' y='12'/> <wall type='tree.png' x='17' y='19'/> <wall type='tree.png' x='17' y='17'/> <wall type='tree.png' x='17' y='15'/> <wall type='tree.png' x='17' y='13'/> <wall type='tree.png' x='17' y='11'/> <wall type='tree.png' x='17' y='14'/> <wall type='tree.png' x='17' y='9'/> <wall type='tree.png' x='17' y='8'/> <wall type='tree.png' x='17' y='6'/> <wall type='tree.png' x='17' y='21'/> <wall type='tree2.png' x='17' y='18'/> <wall type='tree2.png' x='17' y='12'/> <wall type='tree2.png' x='17' y='10'/> <wall type='driedtree.png' x='17' y='15'/> <scenario> <crystals value='300'/> <nwaves value='25'/> </scenario> </level> <level number='3'> <title>Moon of Omderoon</title> <description>General military base of the Empire at this galaxy sector is located on the moon of the Omderoon. We must withstand strong imperial forces to destroy this base.</description> <size width='25' height='23'/> <background type='moon.jpg'/> <unit type='Command Center' x='11' y='21'/> <unit type='Power Station' x='4' y='19'/> <unit type='Power Station' x='5' y='19'/> <unit type='Refinery' x='16' y='18'/> <unit type='Laser Cannon' x='10' y='16'/> <unit type='Laser Cannon' x='11' y='16'/> <crystals x='1' y='21'/> <crystals x='2' y='21'/> <crystals x='0' y='20'/> <crystals x='0' y='21'/> <crystals x='1' y='19'/> <crystals x='1' y='20'/> <crystals x='0' y='18'/> <crystals x='0' y='16'/> <crystals x='3' y='21'/> <crystals x='0' y='17'/> <crystals x='2' y='10'/> <crystals x='1' y='11'/> <crystals x='0' y='12'/> <crystals x='1' y='10'/> <crystals x='18' y='21'/> <crystals x='17' y='22'/> <crystals x='18' y='22'/> <crystals x='17' y='21'/> <crystals x='16' y='22'/> <crystals x='19' y='21'/> <crystals x='19' y='20'/> <crystals x='19' y='18'/> <crystals x='19' y='19'/> <crystals x='18' y='20'/> <crystals x='15' y='22'/> <crystals x='19' y='17'/> <wall type='moon_picket.png' x='3' y='11'/> <wall type='moon_picket.png' x='8' y='11'/> <wall type='moon_picket.png' x='13' y='11'/> <wall type='station_picket.png' x='3' y='16'/> <wall type='station_picket.png' x='5' y='16'/> <scenario> <crystals value='350'/> <nwaves value='30'/> </scenario> </level> <level number='4'> <title>Kalarbik</title> <description>First planet in center sector of the Galactic Empire. Emperor sent serious army to stop our advance.</description> <size width='25' height='23'/> <background type='desert.jpg'/> <unit type='Command Center' x='11' y='20'/> <unit type='Refinery' x='10' y='17'/> <unit type='Power Station' x='9' y='17'/> <unit type='Missile Turret' x='10' y='15'/> <crystals x='5' y='16'/> <crystals x='7' y='15'/> <crystals x='6' y='14'/> <crystals x='10' y='14'/> <crystals x='12' y='14'/> <crystals x='13' y='15'/> <crystals x='14' y='16'/> <crystals x='14' y='17'/> <crystals x='11' y='14'/> <crystals x='11' y='13'/> <crystals x='9' y='13'/> <crystals x='9' y='14'/> <crystals x='10' y='13'/> <crystals x='8' y='13'/> <crystals x='7' y='14'/> <crystals x='6' y='15'/> <crystals x='6' y='16'/> <crystals x='4' y='17'/> <crystals x='4' y='16'/> <crystals x='5' y='15'/> <crystals x='6' y='14'/> <crystals x='14' y='15'/> <crystals x='15' y='16'/> <crystals x='13' y='14'/> <crystals x='12' y='15'/> <crystals x='15' y='17'/> <wall type='tree2.png' x='6' y='12'/> <wall type='tree2.png' x='8' y='11'/> <wall type='tree2.png' x='11' y='11'/> <wall type='tree2.png' x='12' y='12'/> <wall type='tree2.png' x='15' y='14'/> <wall type='tree2.png' x='3' y='14'/> <wall type='wall1.png' x='4' y='13'/> <wall type='wall1.png' x='10' y='11'/> <wall type='wall1.png' x='14' y='14'/> <wall type='wall1.png' x='12' y='11'/> <wall type='wall1.png' x='7' y='11'/> <wall type='wall1.png' x='5' y='13'/> <wall type='wall1.png' x='7' y='12'/> <wall type='wall1.png' x='3' y='15'/> <wall type='wall2.png' x='3' y='6'/> <wall type='wall2.png' x='2' y='8'/> <wall type='wall2.png' x='0' y='9'/> <wall type='wall2.png' x='17' y='8'/> <wall type='wall2.png' x='12' y='8'/> <wall type='wall2.png' x='2' y='12'/> <wall type='wall2.png' x='0' y='20'/> <wall type='wall2.png' x='2' y='21'/> <wall type='wall2.png' x='17' y='21'/> <wall type='wall2.png' x='3' y='7'/> <wall type='wall2.png' x='5' y='7'/> <wall type='driedtree.png' x='0' y='20'/> <wall type='driedtree.png' x='2' y='21'/> <wall type='driedtree.png' x='1' y='21'/> <wall type='driedtree.png' x='0' y='21'/> <wall type='driedtree.png' x='16' y='21'/> <wall type='driedtree.png' x='17' y='20'/> <wall type='driedtree.png' x='16' y='7'/> <wall type='driedtree.png' x='17' y='5'/> <wall type='driedtree.png' x='17' y='8'/> <wall type='driedtree.png' x='17' y='6'/> <scenario> <crystals value='300'/> <nwaves value='35'/> </scenario> </level> <level number='5'> <title>Mantuim</title> <description>People of Mantuim revolted against the authoritarian regime of the Galactic Empire. We must help them to destroy imperial fortifications.</description> <size width='25' height='23'/> <background type='grass.jpg'/> <unit type='Command Center' x='9' y='19'/> <unit type='Laser Cannon' x='9' y='15'/> <unit type='Refinery' x='6' y='20'/> <crystals x='4' y='15'/> <crystals x='5' y='10'/> <crystals x='4' y='19'/> <crystals x='5' y='11'/> <crystals x='5' y='13'/> <crystals x='5' y='14'/> <crystals x='6' y='9'/> <crystals x='5' y='18'/> <crystals x='12' y='16'/> <crystals x='12' y='14'/> <crystals x='12' y='15'/> <crystals x='11' y='13'/> <crystals x='13' y='20'/> <crystals x='6' y='22'/> <crystals x='7' y='22'/> <crystals x='8' y='22'/> <crystals x='9' y='22'/> <crystals x='10' y='22'/> <crystals x='11' y='22'/> <wall type='tree.png' x='0' y='7'/> <wall type='tree.png' x='2' y='7'/> <wall type='tree.png' x='4' y='8'/> <wall type='tree.png' x='2' y='9'/> <wall type='tree.png' x='1' y='10'/> <wall type='tree.png' x='3' y='12'/> <wall type='tree.png' x='1' y='13'/> <wall type='tree.png' x='2' y='15'/> <wall type='tree.png' x='3' y='16'/> <wall type='tree.png' x='2' y='17'/> <wall type='tree.png' x='0' y='17'/> <wall type='tree.png' x='0' y='15'/> <wall type='tree.png' x='0' y='12'/> <wall type='tree.png' x='0' y='9'/> <wall type='tree.png' x='2' y='10'/> <wall type='tree.png' x='3' y='13'/> <wall type='tree.png' x='2' y='12'/> <wall type='tree.png' x='1' y='8'/> <wall type='tree.png' x='1' y='14'/> <wall type='tree.png' x='1' y='16'/> <wall type='tree.png' x='0' y='11'/> <wall type='tree.png' x='3' y='10'/> <wall type='tree.png' x='0' y='6'/> <wall type='tree.png' x='2' y='6'/> <wall type='tree.png' x='3' y='8'/> <wall type='tree.png' x='1' y='20'/> <wall type='tree.png' x='1' y='18'/> <wall type='tree.png' x='0' y='19'/> <wall type='tree.png' x='2' y='19'/> <wall type='tree.png' x='3' y='20'/> <wall type='tree.png' x='11' y='7'/> <wall type='tree.png' x='12' y='9'/> <wall type='tree.png' x='14' y='10'/> <wall type='tree.png' x='14' y='12'/> <wall type='tree.png' x='13' y='13'/> <wall type='tree.png' x='14' y='15'/> <wall type='tree.png' x='15' y='16'/> <wall type='tree.png' x='15' y='17'/> <wall type='tree.png' x='13' y='18'/> <wall type='tree.png' x='14' y='19'/> <wall type='tree.png' x='15' y='20'/> <wall type='tree.png' x='17' y='18'/> <wall type='tree.png' x='17' y='17'/> <wall type='tree.png' x='16' y='15'/> <wall type='tree.png' x='16' y='14'/> <wall type='tree.png' x='17' y='13'/> <wall type='tree.png' x='16' y='10'/> <wall type='tree.png' x='16' y='9'/> <wall type='tree.png' x='14' y='8'/> <wall type='tree.png' x='14' y='8'/> <wall type='tree.png' x='16' y='10'/> <wall type='tree.png' x='16' y='12'/> <wall type='tree.png' x='15' y='14'/> <wall type='tree.png' x='14' y='13'/> <wall type='tree.png' x='14' y='11'/> <wall type='tree.png' x='14' y='9'/> <wall type='tree.png' x='16' y='8'/> <wall type='tree.png' x='13' y='7'/> <wall type='tree.png' x='12' y='12'/> <wall type='tree.png' x='16' y='12'/> <wall type='tree.png' x='18' y='11'/> <wall type='tree.png' x='17' y='9'/> <wall type='tree.png' x='15' y='7'/> <wall type='tree.png' x='15' y='11'/> <wall type='tree.png' x='13' y='16'/> <wall type='tree.png' x='13' y='14'/> <wall type='tree.png' x='11' y='11'/> <wall type='tree.png' x='13' y='11'/> <wall type='tree.png' x='17' y='20'/> <wall type='tree2.png' x='16' y='19'/> <wall type='tree2.png' x='15' y='18'/> <wall type='tree2.png' x='14' y='17'/> <wall type='tree2.png' x='17' y='16'/> <wall type='tree2.png' x='15' y='13'/> <wall type='tree2.png' x='16' y='11'/> <wall type='tree2.png' x='15' y='9'/> <wall type='tree2.png' x='13' y='10'/> <wall type='tree2.png' x='2' y='14'/> <wall type='tree2.png' x='1' y='11'/> <wall type='tree2.png' x='0' y='10'/> <wall type='tree2.png' x='0' y='8'/> <wall type='tree2.png' x='0' y='18'/> <wall type='tree2.png' x='0' y='13'/> <wall type='tree2.png' x='0' y='14'/> <wall type='tree2.png' x='16' y='17'/> <wall type='station_picket.png' x='0' y='21'/> <wall type='station_picket.png' x='2' y='21'/> <wall type='station_picket.png' x='14' y='21'/> <wall type='station_picket.png' x='16' y='21'/> <scenario> <crystals value='350'/> <nwaves value='40'/> </scenario> </level> <level number='6'> <title>Battlestation</title> <description>We must withstand against forces of the biggest battle station of the Empire. The station is ready to attack!</description> <size width='25' height='23'/> <background type='platform.jpg'/> <unit type='Command Center' x='11' y='20'/> <unit type='Refinery' x='15' y='21'/> <unit type='Power Station' x='17' y='21'/> <crystals x='1' y='22'/> <crystals x='2' y='22'/> <crystals x='4' y='22'/> <crystals x='0' y='22'/> <crystals x='1' y='20'/> <crystals x='1' y='18'/> <crystals x='2' y='16'/> <crystals x='3' y='19'/> <crystals x='0' y='19'/> <crystals x='0' y='15'/> <crystals x='1' y='16'/> <crystals x='2' y='20'/> <crystals x='3' y='21'/> <crystals x='0' y='17'/> <crystals x='1' y='21'/> <wall type='platformtube.png' x='5' y='20'/> <wall type='platformtube.png' x='5' y='19'/> <wall type='platformtube.png' x='5' y='18'/> <wall type='platformtube.png' x='5' y='17'/> <wall type='platformtube.png' x='5' y='16'/> <wall type='station_picket.png' x='6' y='12'/> <wall type='station_picket.png' x='8' y='11'/> <wall type='station_picket.png' x='11' y='11'/> <wall type='station_picket.png' x='14' y='11'/> <wall type='station_picket.png' x='16' y='12'/> <wall type='moon_picket.png' x='16' y='16'/> <scenario> <crystals value='350'/> <nwaves value='45'/> </scenario> </level> <level number='7'> <title>Antiock</title> <description>Antiock is the first of the three great galaxy planets. We must withstand against huge military forces in this region.</description> <size width='25' height='23'/> <background type='stone.jpg'/> <unit type='Command Center' x='9' y='20'/> <unit type='Missile Turret' x='9' y='16'/> <unit type='Refinery' x='14' y='19'/> <crystals x='1' y='21'/> <crystals x='2' y='22'/> <crystals x='3' y='22'/> <crystals x='5' y='22'/> <crystals x='1' y='22'/> <crystals x='0' y='20'/> <crystals x='2' y='21'/> <crystals x='4' y='22'/> <crystals x='2' y='20'/> <crystals x='1' y='19'/> <crystals x='0' y='17'/> <crystals x='3' y='21'/> <crystals x='2' y='18'/> <crystals x='1' y='18'/> <crystals x='15' y='21'/> <crystals x='17' y='22'/> <crystals x='17' y='20'/> <crystals x='18' y='20'/> <crystals x='18' y='21'/> <crystals x='16' y='21'/> <crystals x='15' y='22'/> <crystals x='16' y='20'/> <crystals x='17' y='19'/> <crystals x='17' y='18'/> <crystals x='19' y='19'/> <crystals x='19' y='22'/> <wall type='hatch.png' x='5' y='9'/> <wall type='hatch.png' x='5' y='12'/> <wall type='hatch.png' x='5' y='15'/> <wall type='hatch.png' x='9' y='12'/> <wall type='hatch.png' x='13' y='12'/> <wall type='hatch.png' x='13' y='9'/> <wall type='hatch.png' x='13' y='15'/> <wall type='hatch.png' x='13' y='15'/> <wall type='tree.png' x='3' y='15'/> <wall type='tree.png' x='3' y='13'/> <wall type='tree.png' x='3' y='11'/> <wall type='tree.png' x='3' y='9'/> <wall type='tree.png' x='3' y='7'/> <wall type='tree.png' x='3' y='17'/> <wall type='tree.png' x='15' y='7'/> <wall type='tree.png' x='15' y='9'/> <wall type='tree.png' x='15' y='11'/> <wall type='tree.png' x='15' y='13'/> <wall type='tree.png' x='15' y='15'/> <wall type='tree.png' x='15' y='17'/> <wall type='station_picket.png' x='1' y='14'/> <wall type='station_picket.png' x='1' y='11'/> <wall type='station_picket.png' x='17' y='10'/> <wall type='station_picket.png' x='17' y='13'/> <wall type='station_picket.png' x='17' y='16'/> <scenario> <crystals value='300'/> <nwaves value='50'/> </scenario> </level> <level number='8'> <title>Antiock Counter Strike</title> <description>We destroyed first wave of the great imperial forces. Now we must withstand against second great wave on Antiock!</description> <size width='25' height='23'/> <background type='stone.jpg'/> <unit type='Command Center' x='9' y='20'/> <unit type='Laser Cannon' x='9' y='16'/> <crystals x='1' y='21'/> <crystals x='2' y='22'/> <crystals x='3' y='22'/> <crystals x='1' y='22'/> <crystals x='0' y='20'/> <crystals x='2' y='21'/> <crystals x='4' y='22'/> <crystals x='2' y='20'/> <crystals x='3' y='21'/> <crystals x='1' y='18'/> <crystals x='15' y='21'/> <crystals x='17' y='22'/> <crystals x='17' y='20'/> <crystals x='15' y='22'/> <crystals x='16' y='20'/> <crystals x='19' y='22'/> <crystals x='10' y='22'/> <crystals x='11' y='22'/> <crystals x='12' y='22'/> <wall type='hatch.png' x='5' y='9'/> <wall type='wall2.png' x='5' y='12'/> <wall type='hatch.png' x='5' y='15'/> <wall type='moon_picket.png' x='8' y='12'/> <wall type='moon_picket.png' x='10' y='12'/> <wall type='hatch.png' x='13' y='12'/> <wall type='wall2.png' x='13' y='9'/> <wall type='hatch.png' x='13' y='15'/> <wall type='hatch.png' x='13' y='15'/> <wall type='driedtree.png' x='3' y='15'/> <wall type='driedtree.png' x='3' y='13'/> <wall type='driedtree.png' x='3' y='11'/> <wall type='driedtree.png' x='3' y='9'/> <wall type='driedtree.png' x='3' y='7'/> <wall type='driedtree.png' x='3' y='17'/> <wall type='driedtree.png' x='15' y='7'/> <wall type='driedtree.png' x='15' y='9'/> <wall type='driedtree.png' x='15' y='11'/> <wall type='driedtree.png' x='15' y='13'/> <wall type='driedtree.png' x='15' y='15'/> <wall type='driedtree.png' x='15' y='17'/> <wall type='station_picket.png' x='1' y='14'/> <wall type='station_picket.png' x='1' y='11'/> <wall type='station_picket.png' x='17' y='10'/> <wall type='station_picket.png' x='17' y='13'/> <wall type='station_picket.png' x='17' y='16'/> <scenario> <crystals value='300'/> <nwaves value='60'/> </scenario> </level> <level number='9'> <title>Forests of Priah</title> <description>Forests of Priah contain many imperial soldiers. We must destroy them all to approach Galactic Capitol planet.</description> <size width='25' height='23'/> <background type='grass.jpg'/> <unit type='Command Center' x='12' y='16'/> <unit type='Missile Turret' x='12' y='14'/> <unit type='Laser Cannon' x='9' y='20'/> <unit type='Refinery' x='12' y='18'/> <crystals x='16' y='11'/> <crystals x='16' y='12'/> <crystals x='17' y='15'/> <crystals x='18' y='15'/> <crystals x='16' y='13'/> <crystals x='17' y='14'/> <crystals x='14' y='12'/> <crystals x='15' y='12'/> <crystals x='15' y='13'/> <crystals x='18' y='17'/> <crystals x='18' y='16'/> <crystals x='17' y='18'/> <crystals x='16' y='19'/> <crystals x='17' y='17'/> <crystals x='10' y='14'/> <crystals x='10' y='13'/> <crystals x='15' y='21'/> <crystals x='16' y='22'/> <crystals x='15' y='20'/> <wall type='tree.png' x='9' y='7'/> <wall type='tree.png' x='13' y='7'/> <wall type='tree.png' x='10' y='9'/> <wall type='tree.png' x='7' y='11'/> <wall type='tree.png' x='5' y='9'/> <wall type='tree.png' x='6' y='8'/> <wall type='tree.png' x='8' y='8'/> <wall type='tree.png' x='8' y='10'/> <wall type='tree.png' x='10' y='7'/> <wall type='tree.png' x='11' y='7'/> <wall type='tree.png' x='12' y='9'/> <wall type='tree.png' x='12' y='8'/> <wall type='tree.png' x='14' y='8'/> <wall type='tree.png' x='16' y='7'/> <wall type='tree.png' x='13' y='10'/> <wall type='tree.png' x='16' y='9'/> <wall type='tree.png' x='17' y='12'/> <wall type='tree.png' x='18' y='13'/> <wall type='tree.png' x='19' y='15'/> <wall type='tree.png' x='19' y='17'/> <wall type='tree.png' x='18' y='19'/> <wall type='tree.png' x='17' y='19'/> <wall type='tree.png' x='18' y='18'/> <wall type='tree.png' x='19' y='11'/> <wall type='tree.png' x='17' y='10'/> <wall type='tree.png' x='17' y='8'/> <wall type='tree.png' x='15' y='8'/> <wall type='tree.png' x='18' y='11'/> <wall type='tree.png' x='13' y='9'/> <wall type='tree.png' x='9' y='9'/> <wall type='tree.png' x='7' y='9'/> <wall type='tree.png' x='8' y='12'/> <wall type='tree.png' x='7' y='13'/> <wall type='tree.png' x='7' y='15'/> <wall type='tree.png' x='7' y='16'/> <wall type='tree.png' x='2' y='15'/> <wall type='tree.png' x='3' y='16'/> <wall type='tree.png' x='4' y='15'/> <wall type='tree.png' x='5' y='16'/> <wall type='tree.png' x='6' y='14'/> <wall type='tree.png' x='6' y='13'/> <wall type='tree.png' x='6' y='11'/> <wall type='tree.png' x='4' y='12'/> <wall type='tree.png' x='5' y='14'/> <wall type='tree.png' x='4' y='13'/> <wall type='tree.png' x='3' y='14'/> <wall type='tree.png' x='3' y='13'/> <wall type='tree.png' x='3' y='11'/> <wall type='tree.png' x='4' y='10'/> <wall type='tree.png' x='5' y='11'/> <wall type='tree.png' x='6' y='10'/> <wall type='tree.png' x='6' y='12'/> <wall type='tree.png' x='8' y='14'/> <wall type='tree.png' x='2' y='17'/> <wall type='tree.png' x='9' y='11'/> <wall type='tree.png' x='18' y='21'/> <wall type='tree.png' x='17' y='21'/> <wall type='tree.png' x='16' y='20'/> <wall type='tree.png' x='18' y='20'/> <wall type='tree2.png' x='10' y='8'/> <wall type='tree2.png' x='7' y='10'/> <wall type='tree2.png' x='5' y='13'/> <wall type='tree2.png' x='4' y='16'/> <wall type='tree2.png' x='19' y='13'/> <wall type='tree2.png' x='19' y='12'/> <wall type='tree2.png' x='15' y='9'/> <wall type='tree2.png' x='17' y='9'/> <wall type='tree.png' x='19' y='10'/> <wall type='tree.png' x='19' y='8'/> <wall type='tree.png' x='18' y='9'/> <wall type='tree.png' x='19' y='7'/> <wall type='tree.png' x='18' y='6'/> <wall type='tree.png' x='15' y='6'/> <wall type='tree.png' x='4' y='8'/> <wall type='tree.png' x='4' y='6'/> <wall type='tree.png' x='6' y='7'/> <wall type='tree.png' x='6' y='6'/> <wall type='tree.png' x='8' y='7'/> <wall type='tree.png' x='9' y='6'/> <wall type='tree.png' x='13' y='6'/> <wall type='tree.png' x='11' y='6'/> <wall type='tree.png' x='3' y='8'/> <wall type='tree2.png' x='19' y='19'/> <wall type='tree2.png' x='4' y='9'/> <wall type='tree2.png' x='3' y='7'/> <wall type='tree2.png' x='17' y='7'/> <scenario> <crystals value='300'/> <nwaves value='70'/> </scenario> </level> <level number='10'> <title>Moon of the Capitol</title> <description>After bloody operation we have established base on the general defensive outpost of the Capitol. Now we have to withstand all waves to destroy the base.</description> <size width='25' height='23'/> <background type='moon.jpg'/> <unit type='Command Center' x='10' y='19'/> <unit type='Refinery' x='14' y='18'/> <crystals x='5' y='22'/> <crystals x='1' y='22'/> <crystals x='2' y='22'/> <crystals x='3' y='21'/> <crystals x='4' y='22'/> <crystals x='1' y='19'/> <crystals x='0' y='17'/> <crystals x='1' y='16'/> <crystals x='2' y='19'/> <crystals x='1' y='21'/> <crystals x='5' y='21'/> <crystals x='3' y='19'/> <crystals x='2' y='18'/> <crystals x='1' y='18'/> <crystals x='1' y='15'/> <crystals x='0' y='13'/> <crystals x='0' y='16'/> <crystals x='0' y='18'/> <crystals x='0' y='19'/> <crystals x='0' y='21'/> <crystals x='2' y='20'/> <crystals x='3' y='22'/> <crystals x='6' y='22'/> <crystals x='14' y='22'/> <crystals x='16' y='22'/> <crystals x='17' y='22'/> <crystals x='18' y='21'/> <crystals x='18' y='20'/> <crystals x='18' y='22'/> <crystals x='19' y='20'/> <crystals x='18' y='18'/> <crystals x='19' y='16'/> <crystals x='18' y='14'/> <crystals x='18' y='17'/> <crystals x='17' y='19'/> <crystals x='16' y='20'/> <crystals x='16' y='21'/> <crystals x='17' y='21'/> <crystals x='18' y='19'/> <crystals x='18' y='16'/> <crystals x='18' y='15'/> <crystals x='12' y='22'/> <crystals x='15' y='21'/> <wall type='station_picket.png' x='5' y='9'/> <wall type='station_picket.png' x='10' y='9'/> <wall type='station_picket.png' x='15' y='9'/> <wall type='moon_picket.png' x='5' y='14'/> <wall type='moon_picket.png' x='15' y='14'/> <wall type='moon_picket.png' x='1' y='6'/> <scenario> <crystals value='350'/> <nwaves value='80'/> </scenario> </level> <level number='11'> <title>The Capitol</title> <description>General city and capital of the Galactic Empire. Capitol government assembled military forces from all the Empire to destroy us.</description> <size width='25' height='23'/> <background type='stone.jpg'/> <unit type='Command Center' x='10' y='19'/> <unit type='Refinery' x='7' y='19'/> <unit type='Laser Cannon' x='10' y='16'/> <crystals x='5' y='22'/> <crystals x='7' y='22'/> <crystals x='6' y='22'/> <crystals x='8' y='22'/> <crystals x='9' y='22'/> <crystals x='4' y='22'/> <crystals x='3' y='22'/> <crystals x='3' y='20'/> <crystals x='4' y='20'/> <crystals x='3' y='21'/> <crystals x='2' y='21'/> <crystals x='2' y='20'/> <crystals x='2' y='18'/> <crystals x='4' y='21'/> <crystals x='12' y='22'/> <crystals x='13' y='22'/> <crystals x='16' y='20'/> <crystals x='16' y='18'/> <crystals x='14' y='21'/> <crystals x='15' y='20'/> <crystals x='16' y='19'/> <crystals x='5' y='21'/> <crystals x='3' y='19'/> <crystals x='2' y='17'/> <crystals x='3' y='14'/> <crystals x='13' y='21'/> <crystals x='14' y='19'/> <wall type='station_picket.png' x='4' y='7'/> <wall type='station_picket.png' x='9' y='7'/> <wall type='station_picket.png' x='14' y='7'/> <wall type='tree.png' x='0' y='6'/> <wall type='tree.png' x='0' y='7'/> <wall type='tree.png' x='0' y='9'/> <wall type='tree.png' x='0' y='10'/> <wall type='tree.png' x='0' y='12'/> <wall type='tree.png' x='0' y='14'/> <wall type='tree.png' x='0' y='16'/> <wall type='tree.png' x='0' y='20'/> <wall type='tree.png' x='1' y='21'/> <wall type='tree.png' x='0' y='21'/> <wall type='tree.png' x='0' y='19'/> <wall type='tree.png' x='0' y='17'/> <wall type='tree.png' x='0' y='15'/> <wall type='tree.png' x='0' y='12'/> <wall type='tree.png' x='1' y='10'/> <wall type='tree.png' x='1' y='14'/> <wall type='tree.png' x='1' y='12'/> <wall type='tree.png' x='1' y='8'/> <wall type='tree.png' x='17' y='8'/> <wall type='tree.png' x='17' y='11'/> <wall type='tree.png' x='17' y='12'/> <wall type='tree.png' x='17' y='13'/> <wall type='tree.png' x='17' y='16'/> <wall type='tree.png' x='18' y='17'/> <wall type='tree.png' x='17' y='19'/> <wall type='tree.png' x='17' y='21'/> <wall type='tree.png' x='16' y='22'/> <wall type='tree.png' x='15' y='22'/> <wall type='tree.png' x='16' y='21'/> <wall type='tree.png' x='15' y='21'/> <wall type='tree.png' x='18' y='22'/> <wall type='tree.png' x='18' y='19'/> <wall type='tree.png' x='17' y='18'/> <wall type='tree.png' x='18' y='14'/> <wall type='tree.png' x='18' y='15'/> <wall type='tree.png' x='18' y='12'/> <wall type='tree.png' x='17' y='10'/> <wall type='tree.png' x='16' y='11'/> <wall type='tree.png' x='15' y='10'/> <wall type='tree.png' x='16' y='8'/> <wall type='tree.png' x='18' y='10'/> <wall type='tree.png' x='3' y='17'/> <wall type='tree.png' x='3' y='15'/> <wall type='tree.png' x='2' y='15'/> <wall type='tree.png' x='2' y='12'/> <wall type='tree.png' x='1' y='7'/> <wall type='tree.png' x='1' y='5'/> <wall type='tree.png' x='0' y='5'/> <wall type='hatch.png' x='7' y='15'/> <wall type='hatch.png' x='7' y='12'/> <wall type='hatch.png' x='12' y='12'/> <wall type='hatch.png' x='12' y='15'/> <scenario> <crystals value='350'/> <nwaves value='90'/> </scenario> </level> </maps> ; } }//package fai
Section 34
//MoveGoal (fai.MoveGoal) package fai { public class MoveGoal extends Goal { private var engine:Engine;// = null public var pathindex:uint;// = 0 public var target:Position; public var world:MapMatrix;// = null private var nchecks:int;// = 0 public var path:Array; private var ntries:int;// = 0 private var searchRange:uint;// = 0 private var pause:uint;// = 0 public var astar:Astar;// = null private var forcemove:Boolean;// = false public static const FindNearPlaceTries:uint = 10; public static const PAUSE:uint = 5; public static const MaxSearchTries:uint = 3000; public static const MaxChecks:uint = 3; public function MoveGoal(_arg1:Unit, _arg2:Engine):void{ target = new Position(); path = new Array(); pathindex = 0; world = null; pause = 0; ntries = 0; nchecks = 0; astar = null; forcemove = false; searchRange = 0; engine = null; super(); engine = _arg2; owner = _arg1; if (owner.flag(UnitFlags.Flying)){ world = engine.game_board.airworld; } else { world = engine.game_board.world; }; astar = new Astar(world, owner.mapid); } public function advance():void{ var _local1:uint; if (Consts.MOVING == owner.cstate){ owner.move(); } else { if (Consts.IDLE == owner.cstate){ if (target.isequal(owner.pos)){ deactivate(); } else { if (pause > 0){ pause--; if (!pause){ if (((path.length) && (world.getpos(path[pathindex])))){ nchecks++; if (nchecks >= MaxChecks){ setMoveTarget(target, false); nchecks = 0; }; } else { nchecks = 0; }; }; } else { if (path.length > 0){ _local1 = world.getpos(path[pathindex]); if (((!(owner.pos.isequal(path[pathindex]))) && (!((_local1 == 0))))){ if (Consts.Wall == _local1){ setMoveTarget(target, false); } else { pause = PAUSE; return; }; } else { owner.startmove(path[pathindex]); world.setpos(path[pathindex], owner.mapid); pathindex++; owner.move(); }; } else { keepSearching(); }; }; }; }; }; } public function setMoveTarget(_arg1:Position, _arg2:Boolean):void{ path.length = 0; pathindex = 0; target.copy(_arg1); if (((forcemove) || (_arg2))){ astar.checkxy = astar.checknotempty; forcemove = _arg2; }; if (!astar.startDirectSearch(owner.pos, target)){ pause = PAUSE; }; } private function keepSearching():void{ var _local1:int; var _local2:int; var _local3:Number; var _local4:Number; if (!astar.search(path)){ ntries++; setMoveTarget(target, false); pause = PAUSE; } else { if (path.length > 0){ nchecks = (ntries = 0); _local1 = Math.floor(((owner.sprite.x / Consts.cell_size) + 0.5)); _local2 = Math.floor(((owner.sprite.y / Consts.cell_size) + 0.5)); if (((!((_local1 == owner.pos.x))) || (!((_local2 == owner.pos.y))))){ _local3 = Math.sqrt((((target.x - _local1) * (target.x - _local1)) + ((target.y - _local2) * (target.y - _local2)))); _local4 = Math.sqrt((((target.x - owner.pos.x) * (target.x - owner.pos.x)) + ((target.y - owner.pos.y) * (target.y - owner.pos.y)))); if (_local4 < _local3){ path.unshift(new Position(owner.pos.x, owner.pos.y)); }; }; }; }; } private function cleanup():void{ if (owner){ astar = null; if ((((((pathindex > 0)) && (path.length))) && (!(owner.pos.isequal(path[(pathindex - 1)]))))){ world.setpos(path[(pathindex - 1)], 0); }; if (owner.cstate == Consts.MOVING){ owner.cstate = Consts.IDLE; }; owner = null; path.length = 0; }; } override public function deactivate():void{ super.deactivate(); cleanup(); } } }//package fai
Section 35
//OreGoal (fai.OreGoal) package fai { public class OreGoal extends Goal { private var engine:Engine;// = null public var harvested:int;// = 0 public var goto_ore:Position;// = null private var move_goal:OreMoveGoal;// = null public var goto_refinery:Position;// = null private var pick:int;// = 0 public var ore:Unit;// = null public var refinery:Unit;// = null public var pause:int;// = 0 private static const picktime:int = 50; public function OreGoal(_arg1:Unit, _arg2:Unit, _arg3:Engine):void{ engine = null; pick = 0; ore = null; move_goal = null; goto_ore = null; goto_refinery = null; pause = 0; harvested = 0; refinery = null; super(); engine = _arg3; owner = _arg1; refinery = _arg2; gotoOre(); } private function isNearRefinery():Boolean{ return ((((Math.abs((owner.pos.x - goto_refinery.x)) <= 1)) && ((Math.abs((owner.pos.y - goto_refinery.y)) <= 1)))); } public function advance():void{ var _local1:int; var _local2:int; var _local3:int; if (pause > 0){ pause--; if (!pause){ gotoRefinery(); }; return; }; if (Consts.PICKING == owner.cstate){ if (pick > 0){ if (owner.rotating){ owner.rotate(); return; }; pick--; } else { _local1 = ((ore.health > Consts.CrystalsPortion)) ? Consts.CrystalsPortion : ore.health; harvested = (harvested + _local1); engine.game_process.hitUnit(_local1, ore); if (((engine.game_process.isSelectedUnit(owner)) || (engine.game_process.isSelectedUnit(ore)))){ engine.play_window.updateInfo(); }; if (!ore.isAlive()){ owner.cstate = Consts.IDLE; gotoOre(); if (!ore){ owner.cstate = Consts.IDLE; gotoRefinery(); }; return; }; if (harvested >= Consts.CrystalsLoad){ owner.cstate = Consts.IDLE; gotoRefinery(); return; }; pick = picktime; }; } else { if (Consts.IDLE == owner.cstate){ if (goto_ore){ if (owner.pos.isequal(goto_ore)){ if (harvested >= Consts.CrystalsLoad){ gotoRefinery(); return; }; owner.cstate = Consts.PICKING; pick = picktime; _local2 = (ore.pos.x - owner.pos.x); _local3 = (ore.pos.y - owner.pos.y); owner.startrotate((((Math.atan2(_local3, _local2) / Math.PI) * 180) - 90)); return; } else { if (((move_goal) && (!(move_goal.active)))){ gotoOre(); }; }; } else { if (goto_refinery){ if (((owner.pos.isequal(goto_refinery)) || (isNearRefinery()))){ if (owner.mapid == Consts.myId){ engine.addResources(harvested); engine.play_window.updateResources(); }; harvested = 0; if (engine.game_process.isSelectedUnit(owner)){ engine.play_window.updateInfo(); }; gotoOre(); return; } else { if (((move_goal) && (!(move_goal.active)))){ gotoRefinery(); }; }; }; }; }; }; } public function gotoRefinery():void{ goto_ore = (goto_refinery = null); if (!refinery){ owner.life.stop(); return; }; if (((move_goal) && (move_goal.active))){ move_goal.deactivate(); move_goal = null; }; owner.life.stop(); move_goal = new OreMoveGoal(owner, engine); goto_refinery = refinery.pos; move_goal.setMoveTarget(goto_refinery, true); owner.life.goal_system.add(move_goal); } public function gotoOre():void{ if (((!(ore)) || (!(ore.isAlive())))){ ore = engine.game_board.resources.getNearestByType(UnitTypes.sp_crystals, refinery.pos); if (!ore){ deactivate(); return; }; }; goto_ore = (goto_refinery = null); owner.life.stop(); if (((move_goal) && (move_goal.active))){ move_goal.deactivate(); move_goal = null; }; move_goal = new OreMoveGoal(owner, engine); move_goal.astar.neighbours(ore.pos); if (move_goal.astar.ns.length > 0){ goto_ore = move_goal.astar.ns[0]; move_goal.setMoveTarget(goto_ore, true); owner.life.goal_system.add(move_goal); } else { pause = 10; }; } } }//package fai
Section 36
//OreMoveGoal (fai.OreMoveGoal) package fai { public class OreMoveGoal extends Goal { private var engine:Engine;// = null public var pathindex:uint;// = 0 public var target:Position; public var world:MapMatrix;// = null private var nchecks:int;// = 0 public var path:Array; private var ntries:int;// = 0 private var searchRange:uint;// = 0 private var pause:uint;// = 0 public var astar:Astar;// = null private var forcemove:Boolean;// = false public static const FindNearPlaceTries:uint = 8; public static const PAUSE:uint = 5; public static const MaxSearchTries:uint = 30; public static const MaxChecks:uint = 3; public function OreMoveGoal(_arg1:Unit, _arg2:Engine):void{ target = new Position(); path = new Array(); pathindex = 0; world = null; pause = 0; ntries = 0; nchecks = 0; astar = null; forcemove = false; searchRange = 0; engine = null; super(); engine = _arg2; owner = _arg1; if (owner.flag(UnitFlags.Flying)){ world = engine.game_board.airworld; } else { world = engine.game_board.world; }; astar = new Astar(world, owner.mapid); } public function advance():void{ var _local1:uint; if (Consts.MOVING == owner.cstate){ owner.move(); } else { if (Consts.IDLE == owner.cstate){ if (target.isequal(owner.pos)){ deactivate(); } else { if (path.length > 0){ _local1 = world.getpos(path[pathindex]); if (((!(owner.pos.isequal(path[pathindex]))) && (!((_local1 == 0))))){ if (owner.life.ore_goal.goto_refinery){ owner.life.ore_goal.gotoRefinery(); } else { owner.life.ore_goal.gotoOre(); }; deactivate(); return; } else { owner.startmove(path[pathindex]); world.setpos(path[pathindex], owner.mapid); pathindex++; owner.move(); }; } else { keepSearching(); }; }; }; }; } public function setMoveTarget(_arg1:Position, _arg2:Boolean):void{ path.length = 0; pathindex = 0; target.copy(_arg1); if (((forcemove) || (_arg2))){ astar.checkxy = astar.checknotempty; forcemove = _arg2; }; if (!astar.startSearch(owner.pos, target)){ deactivate(); } else { target.copy(astar.destination); }; } private function keepSearching():void{ var _local1:int; var _local2:int; var _local3:Number; var _local4:Number; if (!astar.search(path)){ ntries++; if (ntries >= MaxSearchTries){ deactivate(); } else { if (ntries >= FindNearPlaceTries){ searchRange++; astar.destination = new Position(); astar.findNearPlace(target, searchRange); if (astar.destination){ target.copy(astar.destination); }; }; setMoveTarget(target, false); pause = PAUSE; }; } else { if (path.length > 0){ nchecks = (ntries = 0); _local1 = Math.floor(((owner.sprite.x / Consts.cell_size) + 0.5)); _local2 = Math.floor(((owner.sprite.y / Consts.cell_size) + 0.5)); if (((!((_local1 == owner.pos.x))) || (!((_local2 == owner.pos.y))))){ _local3 = Math.sqrt((((target.x - _local1) * (target.x - _local1)) + ((target.y - _local2) * (target.y - _local2)))); _local4 = Math.sqrt((((target.x - owner.pos.x) * (target.x - owner.pos.x)) + ((target.y - owner.pos.y) * (target.y - owner.pos.y)))); if (_local4 < _local3){ path.unshift(new Position(owner.pos.x, owner.pos.y)); }; }; }; }; } private function cleanup():void{ if (owner){ astar = null; if ((((((pathindex > 0)) && (path.length))) && (!(owner.pos.isequal(path[(pathindex - 1)]))))){ world.setpos(path[(pathindex - 1)], 0); }; if (owner.cstate == Consts.MOVING){ owner.cstate = Consts.IDLE; }; owner = null; path.length = 0; }; } override public function deactivate():void{ super.deactivate(); cleanup(); } } }//package fai
Section 37
//PlanetsMC (fai.PlanetsMC) package fai { import flash.events.*; import flash.display.*; import flash.text.*; import flash.media.*; import flash.utils.*; import flash.net.*; public class PlanetsMC extends Sprite { public var space:MovieClip; private var final_pos:int;// = 0 private var level_msg_timer:Timer;// = null public var sound_control:MovieClip; public var current_level:int;// = 0 private var engine:Engine;// = null private var empires:Array;// = null private var music_sound:Sound;// = null public var level_msg:MovieClip; public var level_info:MovieClip; private var anim_timer:Timer;// = null public var onlyatdg:MovieClip; private var rebels:Array;// = null public var music_channel:SoundChannel;// = null public function PlanetsMC():void{ current_level = 0; anim_timer = null; final_pos = 0; engine = null; rebels = null; empires = null; level_msg_timer = null; music_sound = null; music_channel = null; super(); } private function updateArms():void{ hideRebels(); hideEmpires(); } private function level12Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(11); } public function stop():void{ if (anim_timer){ anim_timer.stop(); anim_timer.removeEventListener(TimerEvent.TIMER, timerFunc); anim_timer = null; }; } public function init(_arg1:Engine):void{ engine = _arg1; level_info.play_button.addEventListener(MouseEvent.MOUSE_DOWN, playNextClick); level_info.resume_game_button.addEventListener(MouseEvent.MOUSE_DOWN, resumeGameClick); rebels = new Array(space.rebel1, space.rebel2, space.rebel3, space.rebel4, space.rebel5, space.rebel6, space.rebel7, space.rebel8, space.rebel9, space.rebel10, space.rebel11, space.rebel12); empires = new Array(space.empire2, space.empire3, space.empire4, space.empire5, space.empire6, space.empire7, space.empire8, space.empire9, space.empire10, space.empire11, space.empire12); space.level1.addEventListener(MouseEvent.MOUSE_DOWN, level1Click); space.level2.addEventListener(MouseEvent.MOUSE_DOWN, level2Click); space.level3.addEventListener(MouseEvent.MOUSE_DOWN, level3Click); space.level4.addEventListener(MouseEvent.MOUSE_DOWN, level4Click); space.level5.addEventListener(MouseEvent.MOUSE_DOWN, level5Click); space.level6.addEventListener(MouseEvent.MOUSE_DOWN, level6Click); space.level7.addEventListener(MouseEvent.MOUSE_DOWN, level7Click); space.level8.addEventListener(MouseEvent.MOUSE_DOWN, level8Click); space.level9.addEventListener(MouseEvent.MOUSE_DOWN, level9Click); space.level10.addEventListener(MouseEvent.MOUSE_DOWN, level10Click); space.level11.addEventListener(MouseEvent.MOUSE_DOWN, level11Click); space.level12.addEventListener(MouseEvent.MOUSE_DOWN, level12Click); level_msg_timer = new Timer(1000, 0); level_msg_timer.addEventListener(TimerEvent.TIMER, levelMsgTimer); level_msg_timer.stop(); level_msg.visible = false; level_msg.stop(); onlyatdg.visible = false; sound_control.setEngine(engine); music_sound = new Sound_planets(); loadLocally(); } private function level7Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(6); } private function resumeGameClick(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); stop(); hidePlanets(); engine.play_window.visible = true; engine.pause(); } public function saveLocally():void{ var _local1:String; var _local2:*; _local1 = "F"; _local2 = SharedObject.getLocal(("Star_Rebellion_v124" + _local1), "/"); _local2.data.current_level = current_level; _local2.flush(); } private function level4Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(3); } private function hidePlanets():void{ visible = false; if (music_channel){ music_channel.stop(); music_channel = null; }; } private function level1Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(0); } private function level9Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(8); } private function level11Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(10); } private function level6Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(5); } private function showLevelMessage():void{ level_msg_timer.stop(); level_msg.msg.text = (("Level " + (current_level + 1).toString()) + " wasn't completed"); level_msg.visible = true; level_msg_timer.start(); } public function loadLocally():void{ var _local1:String; var _local2:*; _local1 = "F"; _local2 = SharedObject.getLocal(("Star_Rebellion_v124" + _local1), "/"); current_level = _local2.data.current_level; } private function playNextClick(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(current_level); } private function hideRebels():void{ var _local1:int; _local1 = 0; _local1 = 0; while (_local1 < rebels.length) { if (_local1 < current_level){ rebels[_local1].gotoAndStop("frozen"); rebels[_local1].visible = true; } else { if (_local1 == current_level){ rebels[current_level].visible = true; rebels[current_level].gotoAndPlay("glow"); } else { rebels[_local1].stop(); rebels[_local1].visible = false; }; }; _local1++; }; } private function level3Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(2); } private function level10Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(9); } private function timerFunc(_arg1:TimerEvent):void{ var _local2:Number; if (space.x < final_pos){ _local2 = ((final_pos - space.x) * 0.05); space.x = (space.x + _local2); } else { space.x = final_pos; stop(); }; } private function playLevel(_arg1:int):void{ if (current_level < _arg1){ showLevelMessage(); return; }; stop(); hidePlanets(); engine.playLevel(engine.sloader.maps.get(_arg1)); } private function level8Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(7); } private function hideEmpires():void{ var _local1:int; _local1 = 0; _local1 = 0; while (_local1 < empires.length) { if (_local1 < current_level){ empires[_local1].visible = false; } else { empires[_local1].visible = true; }; _local1++; }; } private function playMusic():void{ var _local1:SoundTransform; if (music_channel){ music_channel.stop(); music_channel = null; }; if (!engine.volumeOff){ _local1 = new SoundTransform(); _local1.volume = engine.volume; music_channel = music_sound.play(0, 3, _local1); }; } private function level5Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(4); } private function levelMsgTimer(_arg1:TimerEvent):void{ level_msg.visible = false; } private function level2Click(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); playLevel(1); } public function show():void{ var _local1:LevelMap; engine.playSound(Sounds.menu_appear); switch (current_level){ case 0: case 1: case 2: case 3: case 4: final_pos = 0; break; case 5: final_pos = -500; break; case 6: case 7: case 8: case 9: case 10: case 11: case 12: final_pos = -800; break; }; if (engine.game_board != null){ level_info.play_button.visible = false; level_info.resume_game_button.visible = true; } else { level_info.play_button.visible = true; level_info.resume_game_button.visible = false; }; updateArms(); _local1 = engine.sloader.maps.get(current_level); level_info.title.text = ((("Level " + (current_level + 1).toString()) + ": ") + _local1.title); level_info.desc.text = _local1.desc; level_info.waves.text = int(_local1.data.scenario.nwaves.@value); space.x = -800; space.cacheAsBitmap = true; cacheAsBitmap = true; anim_timer = new Timer(50, 0); anim_timer.addEventListener(TimerEvent.TIMER, timerFunc); anim_timer.start(); onlyatdg.visible = false; playMusic(); } } }//package fai
Section 38
//PlayerActions (fai.PlayerActions) package fai { import fai.bomb.*; public class PlayerActions { private var engine:Engine;// = null public var current_action:String;// = "" public function PlayerActions(_arg1:Engine):void{ engine = null; current_action = ""; super(); engine = _arg1; } private function cancelBuildingConstruction(_arg1:String):void{ if (engine.game_board.build_cursor){ engine.game_board.removeBuildCursor(); } else { if (engine.game_process.builder.cancelTask(engine.game_process.selected_units[0], _arg1)){ engine.game_board.destroyUnit(engine.game_process.selected_units[0]); engine.crystals = (engine.crystals + engine.utypes.params(_arg1).cost_crystals); engine.play_window.updateResources(); }; }; clear(); } public function doAction():void{ var _local1:Position; var _local2:Unit; var _local3:*; _local1 = new Position(Math.floor(((engine.game_board.unitlayer.mouseX / Consts.cell_size) + 0.5)), Math.floor(((engine.game_board.unitlayer.mouseY / Consts.cell_size) + 0.5))); _local2 = engine.game_process.getUnitUnder(_local1); _local3 = null; switch (current_action){ case UnitTypes.b_attack: engine.game_process.attackTarget(_local1); engine.play_window.buttons.showButtons(engine.game_process.selected_units[0].type); break; case UnitTypes.nitro_bomb: if (engine.crystals < Consts.nitro_bomb_cost){ engine.log("Not enough crystals"); return; }; engine.playSound(Sounds.menu_appear); engine.play_window.stats.bombs++; engine.crystals = (engine.crystals - Consts.nitro_bomb_cost); _local3 = new NitroBomb(_local1, engine); engine.game_board.bulletlayer.addChild(_local3); _local3.start(); engine.goal_system.add(new BombGoal(engine, _local3)); engine.score = (engine.score + Consts.nitro_bomb_cost); engine.play_window.updateResources(); break; case UnitTypes.cumulative_bomb: if (engine.crystals < Consts.cumulative_bomb_cost){ engine.log("Not enough crystals"); return; }; engine.playSound(Sounds.menu_appear); engine.play_window.stats.bombs++; engine.crystals = (engine.crystals - Consts.cumulative_bomb_cost); _local3 = new CumulativeBomb(_local1, engine); engine.game_board.bulletlayer.addChild(_local3); _local3.start(); engine.goal_system.add(new BombGoal(engine, _local3)); engine.score = (engine.score + Consts.cumulative_bomb_cost); engine.play_window.updateResources(); break; case UnitTypes.nuclear_missile: if (engine.crystals < Consts.nuclear_missile_cost){ engine.log("Not enough crystals"); return; }; engine.playSound(Sounds.menu_appear); engine.play_window.stats.bombs++; engine.crystals = (engine.crystals - Consts.nuclear_missile_cost); _local3 = new NuclearMissile(_local1, engine); engine.game_board.bulletlayer.addChild(_local3); _local3.start(); engine.goal_system.add(new BombGoal(engine, _local3)); engine.score = (engine.score + Consts.nuclear_missile_cost); engine.play_window.updateResources(); break; }; clear(); engine.play_window.updateInfo(); } public function clear():void{ current_action = ""; engine.play_window.custom_cursor.enable(false); } private function effectAction(_arg1:int, _arg2:String):void{ if (engine.crystals < _arg1){ engine.log("Not enough crystals"); return; }; clear(); engine.game_board.removeBuildCursor(); engine.game_process.deselectUnits(); engine.play_window.buttons.action(); current_action = _arg2; engine.play_window.custom_cursor.enable(true); engine.play_window.custom_cursor.enableEffect(_arg2); engine.play_window.updateInfo(); } public function buttonPressed(_arg1:String):void{ var _local2:Unit; engine.play_window.custom_cursor.enable(false); _local2 = engine.utypes.units[_arg1]; if (_local2 != null){ if (_local2.flag(UnitFlags.Building)){ buildConstruction(_arg1); return; }; }; switch (_arg1){ case UnitTypes.nitro_bomb: effectAction(Consts.nitro_bomb_cost, _arg1); break; case UnitTypes.cumulative_bomb: effectAction(Consts.cumulative_bomb_cost, _arg1); break; case UnitTypes.nuclear_missile: effectAction(Consts.nuclear_missile_cost, _arg1); break; case UnitTypes.b_attack: current_action = UnitTypes.b_attack; engine.play_window.custom_cursor.enable(true); engine.play_window.buttons.action(); break; case UnitTypes.b_stop: engine.game_process.stopUnits(); break; case UnitTypes.b_cancel: endAction(); break; }; } public function endAction():void{ var _local1:Unit; _local1 = engine.utypes.units[current_action]; if (_local1 != null){ if (_local1.flag(UnitFlags.Building)){ cancelBuildingConstruction(current_action); }; } else { clear(); }; engine.play_window.updateInfo(); } public function hasDoAction():Boolean{ return (((!((current_action == ""))) && ((((((((current_action == UnitTypes.nitro_bomb)) || ((current_action == UnitTypes.cumulative_bomb)))) || ((current_action == UnitTypes.nuclear_missile)))) || ((current_action == UnitTypes.b_attack)))))); } private function buildConstruction(_arg1:String):void{ if (!engine.isCrystalsEnough(_arg1)){ engine.log("Not enough crystals"); return; }; if (((!((_arg1 == UnitTypes.power_station))) && ((engine.energy_fill >= engine.energy)))){ engine.log("Not enough energy. Build more power stations."); return; }; engine.game_board.createBuildingCursor(_arg1); current_action = _arg1; engine.game_board.checkCursor(); } } }//package fai
Section 39
//PlayWindow (fai.PlayWindow) package fai { import flash.events.*; import flash.display.*; public class PlayWindow extends Sprite { public var radar:Radar;// = null private var powers:FastButtons;// = null public var resources:UpHeader;// = null private var engine:Engine;// = null private var game_board:GameBoard;// = null private var tutorial:TutorialMC;// = null public var pause_mc:PauseMC;// = null public var buttons:GameButtons;// = null public var stats:Statistics;// = null public var right_menu:RightSideMenu;// = null public var sstooltip:SelectedSpriteTooltip;// = null public var message_mc:GameMessageMotion;// = null public var custom_cursor:CustomCursor;// = null public function PlayWindow(_arg1:Engine, _arg2:GameBoard):void{ engine = null; custom_cursor = null; game_board = null; right_menu = null; buttons = null; radar = null; resources = null; powers = null; pause_mc = null; sstooltip = null; stats = null; message_mc = null; tutorial = null; super(); engine = _arg1; game_board = _arg2; } private function stopRepairPressed(_arg1:MouseEvent):void{ var _local2:int; var _local3:Unit; if (engine.paused){ return; }; _local2 = 0; _local2 = 0; while (_local2 < engine.game_process.selected_units.length) { _local3 = engine.game_process.selected_units[_local2]; _local3.life.auto_repair = true; if (((!(_local3.life.repair_goal)) || (!(_local3.life.repair_goal.active)))){ _local3.life.repair(); }; _local2++; }; updateInfo(); } public function updateInfo():void{ var _local1:Unit; var _local2:String; for each (_local1 in engine.game_process.selected_units) { if (_local1.isAlive()){ _local1.updateHealth(); }; }; if (!buttons.selected_unit){ if (engine.game_process.selected_units.length > 0){ right_menu.unit_info.visible = true; if (engine.game_process.selected_units.length == 1){ _local2 = engine.game_process.builder.inBuilding(engine.game_process.selected_units[0]); right_menu.unit_info.update(engine.game_process.selected_units[0]); if (_local2 != null){ buttons.action(); engine.actions.current_action = _local2; return; }; } else { right_menu.unit_info.updateGroup(engine.game_process.selected_units); }; if (((game_board.build_cursor) || (!((engine.actions.current_action == ""))))){ buttons.action(); } else { if (engine.game_process.selected_units[0].mapid != Consts.hostileId){ buttons.showButtons(engine.game_process.selected_units[0].type); } else { buttons.hideButtons(); }; }; } else { right_menu.unit_info.visible = false; if (((game_board.build_cursor) || (!((engine.actions.current_action == ""))))){ buttons.action(); } else { buttons.hideButtons(); }; }; } else { right_menu.unit_info.visible = true; right_menu.unit_info.update(buttons.selected_unit); buttons.hideButtons(); }; } private function soundOffPressed(_arg1:MouseEvent):void{ engine.volumeOff = true; right_menu.sound_off_button.visible = false; right_menu.sound_on_button.visible = true; } private function sendNextPressed(_arg1:MouseEvent):void{ if (engine.paused){ return; }; engine.scenario.sendNext(); } private function soundOnPressed(_arg1:MouseEvent):void{ engine.volumeOff = false; right_menu.sound_off_button.visible = true; right_menu.sound_on_button.visible = false; engine.playSound(Sounds.click); } public function createCustomCursor():void{ custom_cursor = new CustomCursor(engine); engine.game_board.unitlayer.addChild(custom_cursor); } private function pausePressed(_arg1:MouseEvent):void{ engine.playSound(Sounds.upgrade); engine.pause(); } public function updateResources():void{ resources.score.text = engine.score.toString(); resources.crystals.text = engine.crystals.toString(); resources.energy.text = ((engine.energy_fill.toString() + "/") + engine.energy.toString()); } public function upgradePressed(_arg1:MouseEvent):void{ var _local2:int; var _local3:Unit; if (engine.paused){ return; }; engine.playSound(Sounds.upgrade); _local2 = 0; _local2 = 0; while (_local2 < engine.game_process.selected_units.length) { _local3 = engine.game_process.selected_units[_local2]; if (_local3.mapid == Consts.myId){ engine.upgradeUnit(_local3); }; _local2++; }; updateResources(); } private function sellPressed(_arg1:MouseEvent):void{ var _local2:Unit; if (engine.paused){ return; }; while (engine.game_process.selected_units.length > 0) { _local2 = engine.game_process.selected_units[0]; if (_local2.type != UnitTypes.harvester){ engine.crystals = (engine.crystals + int(((_local2.cost_crystals * _local2.health) / _local2.full_health))); engine.game_board.destroyUnit(_local2); } else { engine.game_process.deselectUnit(engine.game_process.selected_units[0]); }; }; updateResources(); } private function unpausePressed(_arg1:MouseEvent):void{ engine.playSound(Sounds.unpause); if (!engine.paused){ return; }; engine.pause(); } public function showTutorial():void{ tutorial = new TutorialMC(); tutorial.init(engine); addChild(tutorial); } public function initialize():void{ addChild(game_board); right_menu = new RightSideMenu(); right_menu.init(engine); right_menu.x = 600; addChild(right_menu); buttons = new GameButtons(engine); buttons.y = 35; buttons.x = 5; right_menu.addChild(buttons); radar = new Radar(); radar.init(engine, 140, 90); radar.y = ((right_menu.unit_info.y + right_menu.unit_info.height) + 5); radar.x = 5; right_menu.addChild(radar); resources = new UpHeader(); addChild(resources); powers = new FastButtons(engine); addChild(powers); powers.x = 545; powers.y = 45; sstooltip = new SelectedSpriteTooltip(); sstooltip.visible = false; addChild(sstooltip); pause_mc = new PauseMC(); pause_mc.visible = false; pause_mc.stop(); addChild(pause_mc); message_mc = new GameMessageMotion(); message_mc.y = resources.height; message_mc.stop(); message_mc.visible = false; addChild(message_mc); stats = new Statistics(); stats.init(engine); stats.visible = false; stats.firework1.stop(); stats.firework2.stop(); stats.final_victory.visible = false; addChild(stats); right_menu.unit_info.repair_button.addEventListener(MouseEvent.MOUSE_DOWN, repairPressed); right_menu.unit_info.stop_repair_button.addEventListener(MouseEvent.MOUSE_DOWN, stopRepairPressed); right_menu.unit_info.sell_button.addEventListener(MouseEvent.MOUSE_DOWN, sellPressed); right_menu.unit_info.upgrade_button.addEventListener(MouseEvent.MOUSE_DOWN, upgradePressed); right_menu.sound_off_button.addEventListener(MouseEvent.MOUSE_DOWN, soundOffPressed); right_menu.sound_on_button.addEventListener(MouseEvent.MOUSE_DOWN, soundOnPressed); right_menu.pause_button.addEventListener(MouseEvent.MOUSE_DOWN, pausePressed); right_menu.menu_button.addEventListener(MouseEvent.MOUSE_DOWN, menuPressed); resources.send_next_button.addEventListener(MouseEvent.MOUSE_DOWN, sendNextPressed); pause_mc.addEventListener(MouseEvent.MOUSE_DOWN, unpausePressed); if (engine.volumeOff){ right_menu.sound_off_button.visible = false; right_menu.sound_on_button.visible = true; } else { right_menu.sound_off_button.visible = true; right_menu.sound_on_button.visible = false; }; GameStage.main_stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); } private function onKeyDown(_arg1:KeyboardEvent):void{ if ((((80 == _arg1.charCode)) || ((112 == _arg1.charCode)))){ if (visible){ engine.pause(); }; }; } public function hideTutorial():void{ removeChild(tutorial); tutorial = null; engine.scenario.start(); engine.events.register(); } public function menuPressed(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); engine.pause(); engine.play_window.visible = false; engine.global_stage.showMainMenu(); } private function repairPressed(_arg1:MouseEvent):void{ var _local2:int; var _local3:Unit; if (engine.paused){ return; }; _local2 = 0; _local2 = 0; while (_local2 < engine.game_process.selected_units.length) { _local3 = engine.game_process.selected_units[_local2]; _local3.life.auto_repair = false; if (((_local3.life.repair_goal) && (_local3.life.repair_goal.active))){ _local3.life.repair(); }; _local2++; }; updateInfo(); } public function destroy():void{ right_menu.unit_info.repair_button.removeEventListener(MouseEvent.MOUSE_DOWN, repairPressed); right_menu.unit_info.stop_repair_button.removeEventListener(MouseEvent.MOUSE_DOWN, stopRepairPressed); right_menu.unit_info.sell_button.removeEventListener(MouseEvent.MOUSE_DOWN, sellPressed); right_menu.unit_info.upgrade_button.removeEventListener(MouseEvent.MOUSE_DOWN, upgradePressed); right_menu.sound_off_button.removeEventListener(MouseEvent.MOUSE_DOWN, soundOffPressed); right_menu.sound_on_button.removeEventListener(MouseEvent.MOUSE_DOWN, soundOnPressed); right_menu.pause_button.removeEventListener(MouseEvent.MOUSE_DOWN, pausePressed); right_menu.menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, menuPressed); resources.send_next_button.removeEventListener(MouseEvent.MOUSE_DOWN, sendNextPressed); pause_mc.removeEventListener(MouseEvent.MOUSE_DOWN, unpausePressed); GameStage.main_stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); right_menu.removeChild(radar); radar = null; powers.destroy(); removeChild(powers); powers = null; buttons.destroy(); right_menu.removeChild(buttons); buttons = null; removeChild(right_menu); right_menu = null; stats.destroy(); removeChild(stats); stats = null; removeChild(game_board); game_board = null; custom_cursor.destroy(); engine.game_board.unitlayer.removeChild(custom_cursor); custom_cursor = null; removeChild(resources); resources = null; removeChild(sstooltip); sstooltip = null; removeChild(pause_mc); pause_mc = null; removeChild(message_mc); message_mc = null; } } }//package fai
Section 40
//Position (fai.Position) package fai { public class Position { public var x:int;// = 0 public var y:int;// = 0 public function Position(_arg1:int=0, _arg2:int=0):void{ x = 0; y = 0; super(); set(_arg1, _arg2); } public function copy(_arg1:Position):void{ x = _arg1.x; y = _arg1.y; } public function set(_arg1:int, _arg2:int):void{ x = _arg1; y = _arg2; } public function isequal(_arg1:Position):Boolean{ return ((((x == _arg1.x)) && ((y == _arg1.y)))); } } }//package fai
Section 41
//Radar (fai.Radar) package fai { import flash.display.*; import flash.text.*; public class Radar extends Sprite { private var radar:Shape; private var engine:Engine;// = null private var mwidth:int;// = 0 public var enemy_count:TextField; private var mheight:int;// = 0 public var current_wave:TextField; private static const HeaderHeight:int = 22; public function Radar():void{ radar = new Shape(); engine = null; mwidth = 0; mheight = 0; super(); } public function init(_arg1:Engine, _arg2:int, _arg3:int):void{ engine = _arg1; addChild(radar); mwidth = _arg2; mheight = _arg3; } public function update():void{ var unit:Unit; var rx:int; var ry:int; var rw:int; var rh:int; if (!engine.game_board){ return; }; radar.graphics.clear(); unit = null; rx = 0; ry = 0; rw = 0; rh = 0; for each (unit in engine.game_board.my_camp.units) { rx = ((unit.pos.x * mwidth) / engine.game_board.map_width); ry = (((unit.pos.y * mheight) / engine.game_board.map_height) + HeaderHeight); if (((unit.flag(UnitFlags.Building)) && (unit.flag(UnitFlags.Peaceful)))){ var _local4 = 5; rw = _local4; rh = _local4; } else { _local4 = 2; rw = _local4; rh = _local4; }; _local4 = radar.graphics; with (_local4) { beginFill(0xFF00); if (unit.type == UnitTypes.command_center){ drawCircle((rx + (rw / 2)), (ry + (rh / 2)), rw); } else { drawRect(rx, ry, rw, rh); }; endFill(); }; }; for each (unit in engine.game_board.enemy_camp.units) { rx = ((unit.pos.x * mwidth) / engine.game_board.map_width); ry = (((unit.pos.y * mheight) / engine.game_board.map_height) + HeaderHeight); if (UnitTypes.isBoss(unit.type)){ _local4 = 5; rw = _local4; rh = _local4; } else { _local4 = 2; rw = _local4; rh = _local4; }; _local4 = radar.graphics; with (_local4) { beginFill(0xFF0000); drawRect(rx, ry, rw, rh); endFill(); }; }; var _local2 = 3; rw = _local2; rh = _local2; for each (unit in engine.game_board.resources.units) { rx = ((unit.pos.x * mwidth) / engine.game_board.map_width); ry = (((unit.pos.y * mheight) / engine.game_board.map_height) + HeaderHeight); _local4 = radar.graphics; with (_local4) { beginFill(0xFCFF00); drawRect(rx, ry, rw, rh); endFill(); }; }; } } }//package fai
Section 42
//RepairGoal (fai.RepairGoal) package fai { public class RepairGoal extends Goal { private var engine:Engine;// = null private var orebeacon:Number;// = 0 private var orecost:Number;// = 0 private var life:int;// = 0 private var pause:int;// = 0 private static const PAUSE:int = 8; public function RepairGoal(_arg1:Unit, _arg2:Engine):void{ orecost = 0; orebeacon = 0; life = 0; engine = null; pause = 0; super(); owner = _arg1; engine = _arg2; life = _arg1.full_health; orecost = ((owner.cost_crystals / life) / 2); } public function advance():void{ var _local1:int; if (pause > 0){ pause--; return; }; if ((((engine.crystals <= 0)) && ((orecost > 0)))){ engine.log("Not enough resources for repair"); deactivate(); return; }; if (owner.health < life){ owner.health++; orebeacon = (orebeacon + orecost); if (orebeacon > 1){ _local1 = Math.floor(orebeacon); if (engine.crystals < _local1){ engine.log("Not enough resources for repair"); deactivate(); } else { engine.crystals = (engine.crystals - _local1); orebeacon = (orebeacon - _local1); engine.play_window.updateResources(); }; }; if (engine.game_process.isUnitInSelection(owner)){ engine.play_window.updateInfo(); }; pause = PAUSE; return; }; deactivate(); if (engine.game_process.isUnitInSelection(owner)){ engine.play_window.updateInfo(); }; } } }//package fai
Section 43
//RightSideMenu (fai.RightSideMenu) package fai { import flash.display.*; public class RightSideMenu extends Sprite { public var menu_button:SimpleButton; public var sound_off_button:SimpleButton; private var engine:Engine;// = null public var sound_on_button:SimpleButton; public var unit_info:UnitInfo;// = null public var pause_button:SimpleButton; public function RightSideMenu():void{ engine = null; unit_info = null; super(); } public function init(_arg1:Engine):void{ engine = _arg1; unit_info = new UnitInfo(); unit_info.init(engine); unit_info.y = 185; unit_info.x = 5; addChild(unit_info); } public function destroy():void{ if (unit_info){ unit_info.destroy(); removeChild(unit_info); unit_info = null; }; } } }//package fai
Section 44
//Scenario (fai.Scenario) package fai { import flash.events.*; import flash.utils.*; public class Scenario { private var engine:Engine;// = null private var thinktimer:Timer;// = null private var enemy_queue:Array; private var level_number:int;// = 0 private var nwaves:int;// = 0 public var pause:int;// = 0 private var special_cases:Map;// = null private var current_wave:int;// = 0 private static const MaxCountOnTheBattleField:int = 40; private static const PAUSE:int = 30; public function Scenario(_arg1:Engine, _arg2:int, _arg3:int):void{ var _local4:int; engine = null; thinktimer = null; pause = 0; current_wave = 0; nwaves = 0; level_number = 0; special_cases = null; enemy_queue = []; super(); engine = _arg1; nwaves = _arg2; level_number = _arg3; special_cases = new Map(); _local4 = 0; while (_local4 < LevelParams.special_cases.length) { special_cases.add(LevelParams.special_cases[_local4][0], LevelParams.special_cases[_local4][1]); _local4++; }; } private function liveCount():int{ var _local1:int; var _local2:int; var _local3:Unit; _local1 = 0; _local2 = 0; while (_local2 < engine.game_board.enemy_camp.units.length) { _local3 = engine.game_board.enemy_camp.units[_local2]; if ((((_local3.mapid == Consts.hostileId)) && (_local3.isAlive()))){ _local1++; }; _local2++; }; return (_local1); } public function stop():void{ thinktimer.stop(); } public function run():void{ thinktimer.start(); } private function setSeconds():void{ var _local1:String; _local1 = pause.toString(); if (pause < 10){ _local1 = ("0" + _local1); }; engine.play_window.resources.wave_time.text = ("00:" + _local1); } private function placeEnemy(_arg1:String, _arg2:int):Boolean{ var _local3:MapMatrix; var _local4:int; var _local5:int; var _local6:Unit; _local3 = (engine.utypes.params(_arg1).flag(UnitFlags.Flying)) ? engine.game_board.airworld : engine.game_board.world; _local4 = 0; while (_local4 < engine.game_board.map_height) { _local5 = 3; while (_local5 < engine.game_board.map_width) { if (!_local3.getxy(_local5, _local4)){ _local6 = engine.game_board.buildUnit(_arg1, Consts.hostileId, _local5, _local4, true); engine.upgradeUnitToLevel(_local6, _arg2); _local6.life.move(engine.command_center.pos, false); return (true); }; _local5++; }; _local4++; }; return (false); } public function destroy():void{ if (thinktimer){ thinktimer.stop(); thinktimer.removeEventListener(TimerEvent.TIMER, thinkHandler); thinktimer = null; }; } public function sendNext():void{ if (((!(thinktimer)) || (engine.paused))){ return; }; if (liveCount() > MaxCountOnTheBattleField){ engine.log("Too many invaders on the battle field"); return; }; if (current_wave < nwaves){ pause = 1; thinkHandler(null); } else { engine.log("All waves are on the battle field."); }; } private function makeEnemies():void{ var _local1:int; var _local2:int; var _local3:int; var _local4:int; var _local5:String; var _local6:int; engine.playSound(Sounds.new_wave); _local1 = (current_wave - 1); _local2 = (_local1 / UnitTypes.enemies.length); if (_local2 > 5){ _local2 = 5; }; _local3 = LevelParams.enemy_count[_local1]; _local4 = 0; _local5 = ""; if (special_cases.find(((level_number * 10000) + _local1))){ _local3 = special_cases.get(((level_number * 10000) + _local1)); }; if (current_wave == nwaves){ makeBosses(); return; }; _local5 = UnitTypes.enemies[(_local1 % UnitTypes.enemies.length)]; _local6 = liveCount(); while (_local4 < _local3) { if (_local6 > MaxCountOnTheBattleField){ enemy_queue.push([_local5, _local2]); } else { placeEnemy(_local5, _local2); _local6++; }; _local4++; }; } public function start():void{ pause = 1; thinktimer = new Timer(1000, 0); thinktimer.addEventListener(TimerEvent.TIMER, thinkHandler); thinktimer.start(); engine.play_window.radar.current_wave.text = (((current_wave + 1).toString() + "/") + nwaves.toString()); engine.log("Enemy is near. Prepare for battle!"); } private function makeBosses():void{ var _local1:Array; var _local2:int; _local1 = LevelParams.bosses[level_number]; _local2 = 0; _local2 = 0; while (_local2 < _local1.length) { placeEnemy(_local1[_local2][0], _local1[_local2][1]); _local2++; }; } public function isRunning():Boolean{ return (!((thinktimer == null))); } private function thinkHandler(_arg1:TimerEvent):void{ var _local2:int; if (!engine.command_center.isAlive()){ engine.gameOver(); return; }; _local2 = liveCount(); engine.play_window.radar.enemy_count.text = _local2.toString(); if (!_local2){ if (current_wave >= nwaves){ engine.victory(); return; }; } else { while ((((_local2 < MaxCountOnTheBattleField)) && ((enemy_queue.length > 0)))) { placeEnemy(enemy_queue[0][0], enemy_queue[0][1]); enemy_queue.shift(); _local2++; }; }; if (current_wave < nwaves){ if (pause > 0){ pause--; setSeconds(); if (pause <= 0){ if (enemy_queue.length > 0){ pause = 10; return; }; current_wave++; if (current_wave == nwaves){ engine.log("Boss attack started!"); }; engine.play_window.radar.current_wave.text = ((current_wave.toString() + "/") + nwaves.toString()); makeEnemies(); } else { return; }; }; pause = PAUSE; if (current_wave == (nwaves - 1)){ pause = (pause + 15); }; }; } } }//package fai
Section 45
//SelectedSprite (fai.SelectedSprite) package fai { import flash.events.*; import flash.display.*; public class SelectedSprite extends Sprite { private var sshape:Shape;// = null private var engine:Engine;// = null private var unit:Unit;// = null private var sstooltip;// = null public static const wsize:int = 45; public static const hsize:int = 45; public function SelectedSprite(_arg1:Engine, _arg2:Unit):void{ var _local3:AnimatedBitmap; var _local4:Number; var _local5:RepairSign; sshape = null; sstooltip = null; unit = null; engine = null; super(); engine = _arg1; sstooltip = engine.play_window.sstooltip; unit = _arg2; Utils.drawRect(this, 2, 1469357, 0, wsize, hsize, true, 10, 10); sshape = new Shape(); Utils.drawRect(sshape, 5, 4891623, 0, wsize, hsize, true, 10, 10); sshape.visible = false; addChild(sshape); _local3 = engine.sloader.getStatusSprite(_arg2.type); _local4 = (_arg2.health / _arg2.full_health); _local3.setFrame(((4 - (5 * _local4)) + 1)); _local3.scaleX = (wsize / _local3.width); _local3.scaleY = (hsize / _local3.height); _local3.x = (((wsize / 2) - (_local3.width / 2)) + 10); _local3.y = (((hsize / 2) - (_local3.height / 2)) + 10); addChild(_local3); addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); addEventListener(MouseEvent.MOUSE_DOWN, onMouseClick); if (((_arg2.life.repair_goal) && (_arg2.life.repair_goal.active))){ _local5 = new RepairSign(); _local5.x = 10; _local5.y = 10; addChild(_local5); }; } private function onMouseOver(_arg1:MouseEvent):void{ sshape.visible = true; sstooltip.visible = true; sstooltip.x = (((engine.play_window.right_menu.x + engine.play_window.right_menu.unit_info.x) + x) - sstooltip.width); sstooltip.y = ((engine.play_window.right_menu.y + engine.play_window.right_menu.unit_info.y) + y); } private function onMouseClick(_arg1:MouseEvent):void{ var _local2:int; var _local3:Unit; if (_arg1.ctrlKey){ _local2 = 0; while (_local2 < engine.game_process.selected_units.length) { _local3 = engine.game_process.selected_units[_local2]; if (_local3.type != unit.type){ engine.game_process.deselectUnit(_local3); } else { _local2++; }; }; } else { if (_arg1.shiftKey){ engine.game_process.deselectUnit(unit); } else { engine.game_process.deselectUnits(); engine.game_process.selected_units.push(unit); }; }; engine.play_window.updateInfo(); } private function onMouseOut(_arg1:MouseEvent):void{ sshape.visible = false; sstooltip.visible = false; } public function destroy():void{ removeChild(sshape); sshape = null; removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver); removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut); removeEventListener(MouseEvent.MOUSE_DOWN, onMouseClick); } } }//package fai
Section 46
//SmartLoader (fai.SmartLoader) package fai { import flash.display.*; import flash.media.*; import flash.utils.*; public class SmartLoader { public var buttons:Dictionary; public var sounds:Dictionary; public var engine:Engine;// = null public var grounds:Dictionary; public var specials:Dictionary; public var maps:Map; public var statuses:Dictionary; public var mimages:Dictionary; public var suites:Dictionary; public function SmartLoader(_arg1:Engine):void{ var _local2:XML; var _local3:XMLList; var _local4:XML; var _local5:LevelMap; suites = new Dictionary(); buttons = new Dictionary(); sounds = new Dictionary(); grounds = new Dictionary(); mimages = new Dictionary(); specials = new Dictionary(); statuses = new Dictionary(); maps = new Map(); engine = null; super(); engine = _arg1; _local2 = Maps.maps; _local3 = _local2.level; for each (_local4 in _local3) { _local5 = new LevelMap(new XML(_local4.toString())); maps.add(_local5.number, _local5); }; initArtwork(); } public function getSpecial(_arg1:String):AnimatedBitmap{ var _local2:BitmapData; _local2 = specials[_arg1]; return (new AnimatedBitmap(_local2, _local2.width, _local2.height)); } public function getStatusSprite(_arg1:String):AnimatedBitmap{ var _local2:BitmapData; _local2 = statuses[_arg1]; return (new AnimatedBitmap(_local2, 60, 60)); } public function dressPeacefulUnit(_arg1:Unit, _arg2:String, _arg3:Engine):void{ var _local4:Array; _local4 = suites[_arg2]; _arg1.sprite.setAppearence(_local4[0], null, null, null, _arg1.sprite_width, _arg3.getColor(_arg1.mapid)); if (_arg1.flag(UnitFlags.Flying)){ _arg3.game_board.airlayer.addChildAt(_arg1.sprite, 0); } else { _arg3.game_board.groundlayer.addChildAt(_arg1.sprite, 0); }; } public function initArtwork():void{ suites[UnitTypes.artillery] = new Array(4); suites[UnitTypes.artillery][0] = new Image_artillery_body(0, 0); suites[UnitTypes.artillery][1] = new Image_artillery_attack(0, 0); suites[UnitTypes.artillery][2] = new Image_artillery_bullet(0, 0); suites[UnitTypes.artillery][3] = new Image_artillery_be(0, 0); suites[UnitTypes.command_center] = new Array(4); suites[UnitTypes.command_center][0] = new Image_command_center_body(0, 0); suites[UnitTypes.harvester] = new Array(4); suites[UnitTypes.harvester][0] = new Image_harvester_body(0, 0); suites[UnitTypes.laser_cannon] = new Array(4); suites[UnitTypes.laser_cannon][0] = new Image_laser_cannon_body(0, 0); suites[UnitTypes.laser_cannon][1] = new Image_laser_cannon_attack(0, 0); suites[UnitTypes.laser_cannon][2] = new Image_laser_cannon_bullet(0, 0); suites[UnitTypes.laser_cannon][3] = new Image_laser_cannon_be(0, 0); suites[UnitTypes.missile_turret] = new Array(4); suites[UnitTypes.missile_turret][0] = new Image_missile_turret_body(0, 0); suites[UnitTypes.missile_turret][1] = new Image_missile_turret_attack(0, 0); suites[UnitTypes.missile_turret][2] = new Image_missile_turret_bullet(0, 0); suites[UnitTypes.missile_turret][3] = new Image_missile_turret_be(0, 0); suites[UnitTypes.plasma_mortar] = new Array(4); suites[UnitTypes.plasma_mortar][0] = new Image_plasma_mortar_body(0, 0); suites[UnitTypes.plasma_mortar][1] = new Image_plasma_mortar_attack(0, 0); suites[UnitTypes.plasma_mortar][2] = new Image_plasma_mortar_bullet(0, 0); suites[UnitTypes.plasma_mortar][3] = new Image_plasma_mortar_be(0, 0); suites[UnitTypes.power_station] = new Array(4); suites[UnitTypes.power_station][0] = new Image_power_station_body(0, 0); suites[UnitTypes.refinery] = new Array(4); suites[UnitTypes.refinery][0] = new Image_refinery_body(0, 0); suites[UnitTypes.stunner] = new Array(4); suites[UnitTypes.stunner][0] = new Image_stunner_body(0, 0); suites[UnitTypes.stunner][1] = new Image_stunner_attack(0, 0); suites[UnitTypes.stunner][2] = new Image_stunner_bullet(0, 0); suites[UnitTypes.stunner][3] = new Image_stunner_be(0, 0); suites[UnitTypes.battle_shuttle] = new Array(4); suites[UnitTypes.battle_shuttle][0] = new Image_battle_shuttle_body(0, 0); suites[UnitTypes.battle_shuttle][1] = new Image_battle_shuttle_attack(0, 0); suites[UnitTypes.battle_shuttle][2] = new Image_battle_shuttle_bullet(0, 0); suites[UnitTypes.battle_shuttle][3] = new Image_battle_shuttle_be(0, 0); suites[UnitTypes.destroyer] = new Array(4); suites[UnitTypes.destroyer][0] = new Image_destroyer_body(0, 0); suites[UnitTypes.destroyer][1] = new Image_destroyer_attack(0, 0); suites[UnitTypes.destroyer][2] = new Image_destroyer_bullet(0, 0); suites[UnitTypes.destroyer][3] = new Image_destroyer_be(0, 0); suites[UnitTypes.executor] = new Array(4); suites[UnitTypes.executor][0] = new Image_executor_body(0, 0); suites[UnitTypes.executor][1] = new Image_executor_attack(0, 0); suites[UnitTypes.executor][2] = new Image_executor_bullet(0, 0); suites[UnitTypes.executor][3] = new Image_executor_be(0, 0); suites[UnitTypes.fighter_t1] = new Array(4); suites[UnitTypes.fighter_t1][0] = new Image_fighter_t1_body(0, 0); suites[UnitTypes.fighter_t1][1] = new Image_fighter_t1_attack(0, 0); suites[UnitTypes.fighter_t1][2] = new Image_fighter_t1_bullet(0, 0); suites[UnitTypes.fighter_t1][3] = new Image_fighter_t1_be(0, 0); suites[UnitTypes.fighter_t2] = new Array(4); suites[UnitTypes.fighter_t2][0] = new Image_fighter_t2_body(0, 0); suites[UnitTypes.fighter_t2][1] = new Image_fighter_t2_attack(0, 0); suites[UnitTypes.fighter_t2][2] = new Image_fighter_t2_bullet(0, 0); suites[UnitTypes.fighter_t2][3] = new Image_fighter_t2_be(0, 0); suites[UnitTypes.fighter_t3] = new Array(4); suites[UnitTypes.fighter_t3][0] = new Image_fighter_t3_body(0, 0); suites[UnitTypes.fighter_t3][1] = new Image_fighter_t3_attack(0, 0); suites[UnitTypes.fighter_t3][2] = new Image_fighter_t3_bullet(0, 0); suites[UnitTypes.fighter_t3][3] = new Image_fighter_t3_be(0, 0); suites[UnitTypes.gunship] = new Array(4); suites[UnitTypes.gunship][0] = new Image_gunship_body(0, 0); suites[UnitTypes.gunship][1] = new Image_gunship_attack(0, 0); suites[UnitTypes.gunship][2] = new Image_gunship_bullet(0, 0); suites[UnitTypes.gunship][3] = new Image_gunship_be(0, 0); suites[UnitTypes.interceptor] = new Array(4); suites[UnitTypes.interceptor][0] = new Image_interceptor_body(0, 0); suites[UnitTypes.interceptor][1] = new Image_interceptor_attack(0, 0); suites[UnitTypes.interceptor][2] = new Image_interceptor_bullet(0, 0); suites[UnitTypes.interceptor][3] = new Image_interceptor_be(0, 0); suites[UnitTypes.jackal] = new Array(4); suites[UnitTypes.jackal][0] = new Image_jackal_body(0, 0); suites[UnitTypes.jackal][1] = new Image_jackal_attack(0, 0); suites[UnitTypes.jackal][2] = new Image_jackal_bullet(0, 0); suites[UnitTypes.jackal][3] = new Image_jackal_be(0, 0); suites[UnitTypes.rock] = new Array(4); suites[UnitTypes.rock][0] = new Image_rock_body(0, 0); suites[UnitTypes.rock][1] = new Image_rock_attack(0, 0); suites[UnitTypes.rock][2] = new Image_rock_bullet(0, 0); suites[UnitTypes.rock][3] = new Image_rock_be(0, 0); suites[UnitTypes.star_conqueror] = new Array(4); suites[UnitTypes.star_conqueror][0] = new Image_star_conqueror_body(0, 0); suites[UnitTypes.star_conqueror][1] = new Image_star_conqueror_attack(0, 0); suites[UnitTypes.star_conqueror][2] = new Image_star_conqueror_bullet(0, 0); suites[UnitTypes.star_conqueror][3] = new Image_star_conqueror_be(0, 0); suites[UnitTypes.war_bird] = new Array(4); suites[UnitTypes.war_bird][0] = new Image_war_bird_body(0, 0); suites[UnitTypes.war_bird][1] = new Image_war_bird_attack(0, 0); suites[UnitTypes.war_bird][2] = new Image_war_bird_bullet(0, 0); suites[UnitTypes.war_bird][3] = new Image_war_bird_be(0, 0); grounds["desert.jpg"] = new Image_ground_desert(0, 0); grounds["driedtree.png"] = new Image_ground_driedtree(0, 0); grounds["grass.jpg"] = new Image_ground_grass(0, 0); grounds["moon.jpg"] = new Image_ground_moon(0, 0); grounds["platform.jpg"] = new Image_ground_platform(0, 0); grounds["platformtube.png"] = new Image_ground_platformtube(0, 0); grounds["stone.jpg"] = new Image_ground_stone(0, 0); grounds["tree.png"] = new Image_ground_tree(0, 0); grounds["tree2.png"] = new Image_ground_tree2(0, 0); grounds["wall1.png"] = new Image_ground_wall1(0, 0); grounds["wall2.png"] = new Image_ground_wall2(0, 0); grounds["station_picket.png"] = new Image_station_picket(0, 0); grounds["moon_picket.png"] = new Image_moon_picket(0, 0); grounds["hatch.png"] = new Image_hatch(0, 0); sounds[Sounds.missile_turret_launch] = new Sound_missile_turret_launch(); sounds[Sounds.laser1] = new Sound_laser1(); sounds[Sounds.laser2] = new Sound_laser2(); sounds[Sounds.explosion1] = new Sound_explosion1(); buttons[UnitTypes.b_attack] = new Image_b_attack(0, 0); buttons[UnitTypes.b_stop] = new Image_b_stop(0, 0); buttons[UnitTypes.b_cancel] = new Image_b_cancel(0, 0); buttons[UnitTypes.artillery] = new Image_b_artillery(0, 0); buttons[UnitTypes.laser_cannon] = new Image_b_laser_cannon(0, 0); buttons[UnitTypes.missile_turret] = new Image_b_missile_turret(0, 0); buttons[UnitTypes.plasma_mortar] = new Image_b_plasma_mortar(0, 0); buttons[UnitTypes.power_station] = new Image_b_power_station(0, 0); buttons[UnitTypes.refinery] = new Image_b_refinery(0, 0); buttons[UnitTypes.stunner] = new Image_b_stunner(0, 0); buttons[UnitTypes.cumulative_bomb] = new Image_b_cumulative_bomb(0, 0); buttons[UnitTypes.nitro_bomb] = new Image_b_nitro_bomb(0, 0); buttons[UnitTypes.nuclear_missile] = new Image_b_nuclear_missile(0, 0); mimages[UnitTypes.m_crystals] = new Image_m_crystals(0, 0); mimages[UnitTypes.m_attack] = new Image_m_attack(0, 0); mimages[UnitTypes.m_range] = new Image_m_range(0, 0); mimages[UnitTypes.m_armor] = new Image_m_shield(0, 0); mimages[UnitTypes.m_energy] = new Image_m_energy(0, 0); statuses[UnitTypes.artillery] = new Image_artillery_status_sprite(0, 0); statuses[UnitTypes.laser_cannon] = new Image_laser_cannon_status_sprite(0, 0); statuses[UnitTypes.missile_turret] = new Image_missile_turret_status_sprite(0, 0); statuses[UnitTypes.plasma_mortar] = new Image_plasma_mortar_status_sprite(0, 0); statuses[UnitTypes.harvester] = new Image_harvester_status_sprite(0, 0); statuses[UnitTypes.stunner] = new Image_stunner_status_sprite(0, 0); statuses[UnitTypes.command_center] = new Image_command_center_status_sprite(0, 0); statuses[UnitTypes.refinery] = new Image_refinery_status_sprite(0, 0); statuses[UnitTypes.power_station] = new Image_power_station_status_sprite(0, 0); statuses[UnitTypes.battle_shuttle] = new Image_battle_shuttle_status_sprite(0, 0); statuses[UnitTypes.destroyer] = new Image_destroyer_status_sprite(0, 0); statuses[UnitTypes.executor] = new Image_executor_status_sprite(0, 0); statuses[UnitTypes.fighter_t1] = new Image_fighter_t1_status_sprite(0, 0); statuses[UnitTypes.fighter_t2] = new Image_fighter_t2_status_sprite(0, 0); statuses[UnitTypes.fighter_t3] = new Image_fighter_t3_status_sprite(0, 0); statuses[UnitTypes.gunship] = new Image_gunship_status_sprite(0, 0); statuses[UnitTypes.interceptor] = new Image_interceptor_status_sprite(0, 0); statuses[UnitTypes.jackal] = new Image_jackal_status_sprite(0, 0); statuses[UnitTypes.rock] = new Image_rock_status_sprite(0, 0); statuses[UnitTypes.star_conqueror] = new Image_star_conqueror_status_sprite(0, 0); statuses[UnitTypes.war_bird] = new Image_war_bird_status_sprite(0, 0); statuses[UnitTypes.sp_crystals] = new Image_crystals_status(0, 0); specials[UnitTypes.sp_crystals] = new Image_sp_crystals(0, 0); specials[UnitTypes.nitro_bomb] = new Image_sp_nitro_bomb(0, 0); specials[UnitTypes.cumulative_bomb] = new Image_sp_cumulative_bomb(0, 0); specials[UnitTypes.nuclear_missile] = new Image_sp_nuclear_bomb(0, 0); specials[UnitTypes.sp_death1] = new Image_sp_death1(0, 0); specials[UnitTypes.sp_debris] = new Image_sp_debris(0, 0); specials[UnitTypes.sp_my_order] = new Image_my_order(0, 0); specials[UnitTypes.sp_hostile_order] = new Image_hostile_order(0, 0); } public function getMenuItem(_arg1:String):AnimatedBitmap{ var _local2:BitmapData; _local2 = mimages[_arg1]; return (new AnimatedBitmap(_local2, _local2.width, _local2.height)); } public function getSound(_arg1:int):Sound{ return (sounds[_arg1]); } public function dressUnit(_arg1:Unit, _arg2:String, _arg3:Engine):void{ var _local4:Array; _local4 = suites[_arg2]; _arg1.sprite.setAppearence(_local4[0], _local4[1], _local4[2], _local4[3], _arg1.sprite_width, _arg3.getColor(_arg1.mapid)); if (!_arg1.attacksound){ _arg1.attacksound = Sound(getSound(Sounds.laser1)); }; if (_arg1.flag(UnitFlags.Flying)){ _arg3.game_board.airlayer.addChildAt(_arg1.sprite, 0); } else { _arg3.game_board.groundlayer.addChildAt(_arg1.sprite, 0); }; } public function getBody(_arg1:String):BitmapData{ var _local2:Array; _local2 = suites[_arg1]; return (_local2[0]); } public function getButton(_arg1:String):AnimatedBitmap{ var _local2:BitmapData; _local2 = buttons[_arg1]; return (new AnimatedBitmap(_local2, _local2.width, _local2.height)); } public function dressResource(_arg1:Unit, _arg2:String, _arg3:Engine):void{ var _local4:BitmapData; _local4 = specials[_arg2]; _arg1.sprite.setAppearence(_local4, null, null, null, _arg1.sprite_width, 0, false); _arg3.game_board.resourcelayer.addChildAt(_arg1.sprite, 0); } public function getGround(_arg1:String):AnimatedBitmap{ var _local2:BitmapData; _local2 = grounds[_arg1]; return (new AnimatedBitmap(_local2, _local2.width, _local2.height)); } } }//package fai
Section 47
//SoundControlMC (fai.SoundControlMC) package fai { import flash.events.*; import fl.controls.*; import flash.display.*; import flash.text.*; import flash.media.*; import fl.events.*; public class SoundControlMC extends MovieClip { private var sound_slider:Slider;// = null public var engine:Engine;// = null public function SoundControlMC():void{ engine = null; sound_slider = null; super(); sound_slider = new Slider(); sound_slider.liveDragging = true; sound_slider.setSize(100, 0); sound_slider.maximum = 100; sound_slider.minimum = 0; sound_slider.tickInterval = 5; sound_slider.addEventListener(SliderEvent.CHANGE, musicChange); sound_slider.x = 60; sound_slider.y = -10; addChild(sound_slider); sound_slider.value = 100; } public function destroy():void{ sound_slider.removeEventListener(SliderEvent.CHANGE, musicChange); removeChild(sound_slider); sound_slider = null; } private function musicChange(_arg1:Event):void{ var _local2:SoundTransform; engine.volume = (sound_slider.value / 100); if (engine.global_stage.main_menu.planets.music_channel){ _local2 = engine.global_stage.main_menu.planets.music_channel.soundTransform; _local2.volume = engine.volume; engine.global_stage.main_menu.planets.music_channel.soundTransform = _local2; }; } public function setEngine(_arg1:Engine):void{ engine = _arg1; sound_slider.value = (engine.volume * 100); } } }//package fai
Section 48
//Sounds (fai.Sounds) package fai { public final class Sounds { public static var laser1:int = 9; public static var new_wave:int = 11; public static var click:int = 2; public static var missile_turret_launch:int = 8; public static var laser2:int = 10; public static var upgrade:int = 1; public static var click1:int = 3; public static var tada:int = 0; public static var build:int = 5; public static var defeat:int = 7; public static var menu_appear:int = 6; public static var explosion1:int = 12; public static var unpause:int = 4; } }//package fai
Section 49
//Statistics (fai.Statistics) package fai { import flash.events.*; import flash.display.*; import flash.text.*; import flash.utils.*; import mochi.*; public class Statistics extends Sprite { public var play_again_button:SimpleButton; public var bombs:int;// = 0 public var lost:int;// = 0 public var crystals_txt:TextField; public var built_txt:TextField; public var score_txt:TextField; private var engine:Engine;// = null public var final_victory:MovieClip; public var bombs_txt:TextField; public var submit_score_button:SimpleButton; public var killed:int;// = 0 public var built:int;// = 0 private var score:int;// = 0 public var main_menu_button:SimpleButton; private var counterTimer:Timer;// = null public var stat_title:TextField; public var killed_txt:TextField; public var continue_button:SimpleButton; public var firework1:MovieClip; public var firework2:MovieClip; public var lost_txt:TextField; public var crystals:int;// = 0 public function Statistics():void{ killed = 0; lost = 0; built = 0; crystals = 0; bombs = 0; score = 0; engine = null; counterTimer = null; super(); } public function destroy():void{ if (counterTimer){ counterTimer.stop(); counterTimer.removeEventListener(TimerEvent.TIMER, counterTick); counterTimer = null; }; play_again_button.removeEventListener(MouseEvent.MOUSE_DOWN, playAgain); main_menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, mainMenu); continue_button.removeEventListener(MouseEvent.MOUSE_DOWN, mainMenu); } public function init(_arg1:Engine):void{ engine = _arg1; play_again_button.addEventListener(MouseEvent.MOUSE_DOWN, playAgain); main_menu_button.addEventListener(MouseEvent.MOUSE_DOWN, mainMenu); continue_button.addEventListener(MouseEvent.MOUSE_DOWN, planets); submit_score_button.addEventListener(MouseEvent.MOUSE_DOWN, submitScore); } public function victory():void{ firework1.play(); firework2.play(); stat_title.text = "Well Done!"; continue_button.visible = true; } private function counter(_arg1, _arg2:int):int{ var _local3:int; if (_arg2 > 0){ _local3 = ((_arg2 > 10)) ? 10 : _arg2; _arg1.text = (int(_arg1.text) + _local3).toString(); return (_local3); }; return (0); } public function start():void{ killed_txt.text = "0"; lost_txt.text = "0"; built_txt.text = "0"; crystals_txt.text = "0"; bombs_txt.text = "0"; score_txt.text = "0"; score = engine.score; counterTimer = new Timer(30, 0); counterTimer.addEventListener(TimerEvent.TIMER, counterTick); counterTimer.start(); } private function submitScore(_arg1:MouseEvent):void{ var evt = _arg1; MochiScores.showLeaderboard({boardID:"eb79342347b90226", score:engine.score, onClose:function (){ visible = false; engine.playSound(Sounds.click); engine.clearAll(); if (engine.global_stage.main_menu.planets.current_level >= 11){ engine.global_stage.main_menu.planets.current_level = 0; }; engine.global_stage.main_menu.visible = true; }}); engine.score = 0; } public function defeat():void{ stat_title.text = "DEFEAT"; continue_button.visible = false; } private function playAgain(_arg1:MouseEvent):void{ visible = false; engine.playSound(Sounds.click); engine.playLevel(engine.last_loaded_level); } private function mainMenu(_arg1:MouseEvent):void{ visible = false; engine.playSound(Sounds.click); engine.clearAll(); if (engine.global_stage.main_menu.planets.current_level >= 11){ engine.global_stage.main_menu.planets.current_level = 0; }; engine.global_stage.main_menu.visible = true; } private function counterTick(_arg1:TimerEvent):void{ killed = (killed - counter(killed_txt, killed)); lost = (lost - counter(lost_txt, lost)); built = (built - counter(built_txt, built)); crystals = (crystals - counter(crystals_txt, crystals)); bombs = (bombs - counter(bombs_txt, bombs)); score = (score - counter(score_txt, score)); if ((((((killed + lost) + built) + crystals) + bombs) + score) == 0){ counterTimer.stop(); counterTimer.removeEventListener(TimerEvent.TIMER, counterTick); counterTimer = null; }; } private function planets(_arg1:MouseEvent):void{ visible = false; engine.playSound(Sounds.click); engine.clearAll(); if (engine.global_stage.main_menu.planets.current_level >= 11){ engine.global_stage.main_menu.planets.current_level = 0; engine.global_stage.main_menu.visible = true; } else { engine.global_stage.main_menu.showPlanets(); }; } } }//package fai
Section 50
//TutorialMC (fai.TutorialMC) package fai { import flash.events.*; import flash.display.*; public class TutorialMC extends MovieClip { private var engine:Engine;// = null public var current_page:String;// = "page1" public var continue_button:SimpleButton; public var skip_button:SimpleButton; public function TutorialMC():void{ engine = null; current_page = "page1"; super(); addFrameScript(0, frame1); } public function init(_arg1:Engine):void{ engine = _arg1; continue_button.addEventListener(MouseEvent.MOUSE_DOWN, continueClick); skip_button.addEventListener(MouseEvent.MOUSE_DOWN, skipClick); } private function continueClick(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); switch (current_page){ case "page1": gotoPage("page2"); break; case "page2": gotoPage("page3"); break; case "page3": gotoPage("page4"); break; case "page4": gotoPage("page5"); break; case "page5": engine.play_window.hideTutorial(); break; }; } private function skipClick(_arg1:MouseEvent):void{ engine.playSound(Sounds.click); engine.play_window.hideTutorial(); } function frame1(){ stop(); } public function gotoPage(_arg1:String):void{ current_page = _arg1; gotoAndStop(_arg1); } } }//package fai
Section 51
//Unit (fai.Unit) package fai { import flash.events.*; import flash.media.*; public final class Unit { public var bulletspeed:uint;// = 40 public var full_health:int;// = 0 public var cstate:uint;// = 0 private var attackpos:Position;// = null public var flags:uint;// = 0 public var desc:String;// = "Assaulter. Defend Command Center against this unit." public var rotstep:int;// = 10 private var destangel:int;// = 0 private var movetarget:Position;// = null public var eyerange:uint;// = 5 public var cost_crystals:uint;// = 20 public var deathsteps:uint;// = 12 public var type:String;// = null public var death_cost:int;// = 1 public var engine:Engine;// = null public var sprite:UnitSprite;// = null public var attacksound:Sound;// = null public var upgradeLevel:int;// = 0 private var xstep:Number;// = 0 public var sprite_width:int;// = 32 public var armor:uint;// = 1 private var step:uint;// = 0 public var pos:Position; private var attacktarget:Unit;// = null public var health:int;// = 50 private var ystep:Number;// = 0 public var rotating:Boolean;// = false public var attackssteps:uint;// = 3 public var damage:uint;// = 0 public var movesteps:uint;// = 10 public var mapid:uint;// = 0 public var rechargetime:uint;// = 25 public var life:LifeGoal;// = null public function Unit(_arg1:Engine, _arg2:uint, _arg3:String):void{ rotstep = 10; movesteps = 10; attackssteps = 3; deathsteps = 12; type = null; sprite_width = 32; pos = new Position(); sprite = null; cstate = 0; eyerange = 5; damage = 0; armor = 1; health = 50; bulletspeed = 40; rechargetime = 25; upgradeLevel = 0; full_health = 0; death_cost = 1; cost_crystals = 20; flags = 0; attacksound = null; desc = "Assaulter. Defend Command Center\nagainst this unit."; movetarget = null; attacktarget = null; attackpos = null; engine = null; mapid = 0; xstep = 0; ystep = 0; step = 0; rotating = false; destangel = 0; life = null; super(); engine = _arg1; mapid = _arg2; type = _arg3; sprite = new UnitSprite(this); if (engine){ sprite.addEventListener(MouseEvent.MOUSE_OVER, onmouseover); sprite.addEventListener(MouseEvent.MOUSE_OUT, onmouseout); }; } public function die():void{ } private function onmouseover(_arg1:MouseEvent):void{ updateHealth(); } public function updateHealth():void{ sprite.select(true); } public function copyProperties(_arg1:Unit):void{ eyerange = _arg1.eyerange; damage = _arg1.damage; armor = _arg1.armor; health = _arg1.health; bulletspeed = _arg1.bulletspeed; rechargetime = _arg1.rechargetime; } private function onmouseout(_arg1:MouseEvent):void{ if (((!(isAlive())) || (!(engine.game_process.isUnitInSelection(this))))){ sprite.select(false); }; } public function flag(_arg1:uint):Boolean{ return ((flags & _arg1)); } public function startattack(_arg1:Unit):void{ reset(); attacktarget = _arg1; cstate = Consts.ATTACK; attackpos = new Position(); attackpos.set(attacktarget.sprite.x, attacktarget.sprite.y); startrotate((((Math.atan2((attacktarget.sprite.y - sprite.y), (attacktarget.sprite.x - sprite.x)) / Math.PI) * 180) - 90)); } public function startrotate(_arg1:int):void{ destangel = (_arg1 - sprite.body.rotation); if (destangel > 180){ destangel = (destangel - 360); } else { if (destangel < -180){ destangel = (destangel + 360); }; }; if (!destangel){ return; }; rotating = true; } public function isAlive():Boolean{ return ((health > 0)); } public function attack():void{ if (rotating){ rotate(); return; }; if (!step){ sprite.setAttackSprite(); engine.playSoundPos(attacksound, pos); }; if (step >= attackssteps){ engine.game_process.runBullet(this, attacktarget, attackpos); reset(); sprite.setMoveSprite(); } else { step++; sprite.setFrame(((step * sprite.nframes()) / attackssteps)); }; } public function move():void{ if (rotating){ rotate(); return; }; if (!step){ sprite.setMoveSprite(); }; sprite.x = (sprite.x + xstep); sprite.y = (sprite.y + ystep); step++; sprite.setFrame(((step * sprite.nframes()) / movesteps)); if (step >= movesteps){ if ((flags & UnitFlags.Flying)){ engine.game_board.airworld.setpos(pos, 0); } else { engine.game_board.world.setpos(pos, 0); }; pos = movetarget; reset(); }; } public function reset():void{ cstate = Consts.IDLE; step = (ystep = (xstep = 0)); attacktarget = null; rotating = false; } public function rotate():void{ var _local1:int; if (Math.abs(destangel) < rotstep){ sprite.body.rotation = (sprite.body.rotation + destangel); destangel = 0; rotating = false; } else { _local1 = ((Math.abs(destangel) > rotstep)) ? ((destangel > 0)) ? rotstep : -(rotstep) : destangel; sprite.body.rotation = (sprite.body.rotation + _local1); destangel = (destangel - _local1); }; } public function startmove(_arg1:Position):void{ reset(); movetarget = _arg1; cstate = Consts.MOVING; xstep = (((movetarget.x * Consts.cell_size) - sprite.x) / movesteps); ystep = (((movetarget.y * Consts.cell_size) - sprite.y) / movesteps); startrotate((((Math.atan2(ystep, xstep) / Math.PI) * 180) - 90)); } public function activate(_arg1:Engine):void{ life = new LifeGoal(_arg1, this); _arg1.goal_system.add(life); } public function destroy():void{ reset(); if (cstate != Consts.DEATH){ cstate = Consts.DEATH; }; sprite.removeEventListener(MouseEvent.MOUSE_OVER, onmouseover); sprite.removeEventListener(MouseEvent.MOUSE_OUT, onmouseout); sprite.select(false); } } }//package fai
Section 52
//UnitBuilder (fai.UnitBuilder) package fai { public class UnitBuilder { private var engine:Engine;// = null private var tasks:Array; public function UnitBuilder(_arg1:Engine):void{ engine = null; tasks = new Array(); super(); engine = _arg1; } public function addTask(_arg1:Unit, _arg2:String):void{ var _local3:Boolean; var _local4:BuildingTask; _local3 = false; _local4 = null; for each (_local4 in tasks) { if ((((_local4.building == _arg1)) && ((_local4.task == _arg2)))){ _local4.addTask(); _local3 = true; break; }; }; if (!_local3){ _local4 = new BuildingTask(_arg1, _arg2, engine.utypes.buildSteps(_arg2), engine.utypes.params(_arg2).health, engine.utypes.params(_arg2).flag(UnitFlags.Building)); tasks.push(_local4); }; if (_local4){ engine.play_window.right_menu.unit_info.building(_local4.task, _local4.completed()); }; } public function buildTick():void{ var _local1:uint; var _local2:BuildingTask; var _local3:Boolean; _local1 = 0; while (_local1 < tasks.length) { _local2 = tasks[_local1]; _local3 = _local2.build(); if (_local2.finished()){ delete tasks[_local1]; tasks.splice(_local1, 1); } else { _local1++; }; if (_local3){ engine.game_process.endBuilding(_local2.building, _local2.task, _local2.finished()); }; if (engine.game_process.isSelectedUnit(_local2.building)){ if (((!(_local2.finished())) && (((_local2.tick % 5) == 0)))){ engine.play_window.right_menu.unit_info.building(_local2.task, _local2.completed()); }; }; }; } public function clear():void{ var _local1:BuildingTask; for each (_local1 in tasks) { (_local1.building == null); }; tasks.length = 0; } public function inBuilding(_arg1:Unit):String{ var _local2:BuildingTask; for each (_local2 in tasks) { if (_local2.building == _arg1){ return (_local2.task); }; }; return (null); } public function cancelTask(_arg1:Unit, _arg2:String):Boolean{ var _local3:uint; var _local4:BuildingTask; _local3 = 0; while (_local3 < tasks.length) { _local4 = tasks[_local3]; if ((((_local4.building == _arg1)) && ((_local4.task == _arg2)))){ _local4.count--; if (!_local4.count){ tasks.splice(_local3, 1); engine.play_window.updateInfo(); }; return (true); }; _local3++; }; return (false); } } }//package fai class BuildingTask { public var task:String;// = "" public var fullHealth:int;// = 0 private var chunk:Number;// = 0 public var count:int;// = 0 public var building:Unit;// = null public var isconstr:Boolean;// = false private var health:Number;// = 0 public var tick:int;// = 0 private function BuildingTask(_arg1:Unit, _arg2:String, _arg3:int, _arg4:int, _arg5:Boolean):void{ building = null; count = 0; task = ""; fullHealth = 0; chunk = 0; health = 0; isconstr = false; tick = 0; super(); building = _arg1; fullHealth = _arg4; task = _arg2; chunk = (fullHealth / _arg3); health = 1; isconstr = _arg5; if (isconstr){ building.health = (fullHealth / 2); }; addTask(); } public function completed():int{ return (int(health)); } public function addTask():void{ count++; } public function build():Boolean{ health = (health + chunk); tick++; if (isconstr){ if (!building.isAlive()){ count--; tick = 0; health = 0; return (true); }; }; if (health >= fullHealth){ if (isconstr){ building.health = fullHealth; }; count--; health = 0; tick = 0; return (true); }; return (false); } public function finished():Boolean{ return ((count <= 0)); } }
Section 53
//UnitFlags (fai.UnitFlags) package fai { public final class UnitFlags { public static const Building:uint = 2; public static const Peaceful:uint = 1; public static const Antiaircraft:uint = 8; public static const Antilandforces:uint = 16; public static const Flying:uint = 4; } }//package fai
Section 54
//UnitInfo (fai.UnitInfo) package fai { import flash.display.*; import flash.text.*; import flash.filters.*; public class UnitInfo extends Sprite { public var description:TextField; private var status_bitmap:AnimatedBitmap;// = null public var repair_button:SimpleButton; public var armor:TextField; private var last_type:String;// = "" public var range:TextField; private var engine:Engine;// = null public var info_icons:MovieClip; public var attack:TextField; public var title:TextField; public var health:TextField; public var up_crystals:TextField; public var building_txt:TextField; public var up_attack:TextField; private var last_frontier:int;// = -1 public var stop_repair_button:SimpleButton; public var selected_sprites:Array;// = null public var up_armor:TextField; public var upgrade_button:SimpleButton; public var sell_button:MovieClip; private var build_progress:Shape;// = null public var crystals:TextField; public function UnitInfo():void{ engine = null; status_bitmap = null; last_type = ""; build_progress = null; last_frontier = -1; selected_sprites = null; super(); } public function destroy():void{ clearGroupSprites(); if (build_progress){ removeChild(build_progress); build_progress = null; }; } private function getBitmapFilter():BitmapFilter{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Boolean; var _local7:Boolean; var _local8:Number; _local1 = 2387199; _local2 = 0.8; _local3 = 15; _local4 = 15; _local5 = 2; _local6 = false; _local7 = false; _local8 = BitmapFilterQuality.HIGH; return (new GlowFilter(_local1, _local2, _local3, _local4, _local5, _local8, _local6, _local7)); } public function init(_arg1:Engine):void{ engine = _arg1; sell_button.buttonMode = true; sell_button.mouseChildren = false; build_progress = new Shape(); build_progress.x = 90; build_progress.y = 80; build_progress.visible = false; addChild(build_progress); } private function setStatus(_arg1:String, _arg2:Number):void{ var _local3:BitmapFilter; var _local4:Array; if (((status_bitmap) && (!((last_type == _arg1))))){ status_bitmap.bitmapData.dispose(); removeChild(status_bitmap); status_bitmap = null; }; if (_arg1 == ""){ return; }; if (!status_bitmap){ status_bitmap = engine.sloader.getStatusSprite(_arg1); status_bitmap.x = 15; status_bitmap.y = 45; addChild(status_bitmap); _local3 = getBitmapFilter(); _local4 = new Array(); _local4.push(_local3); status_bitmap.filters = _local4; }; status_bitmap.setFrame(((4 - (5 * _arg2)) + 1)); last_type = _arg1; } public function updateGroup(_arg1:Array):void{ var _local2:int; var _local3:Array; var _local4:SelectedSprite; var _local5:Boolean; var _local6:Boolean; var _local7:Boolean; var _local8:int; title.text = (("Selected " + _arg1.length.toString()) + " units"); building_txt.visible = false; build_progress.visible = false; crystals.visible = false; armor.visible = false; attack.visible = false; range.visible = false; health.visible = false; description.visible = false; info_icons.visible = false; sell_button.visible = true; upgrade_button.visible = true; setStatus("", 0); _local2 = 0; clearGroupSprites(); _local3 = engine.game_process.selected_units; _local4 = null; _local5 = false; _local6 = false; _local7 = false; _local8 = 0; _local2 = 0; while (_local2 < _local3.length) { _local4 = new SelectedSprite(engine, _local3[_local2]); selected_sprites.push(_local4); _local4.x = ((_local2 % 2) * (SelectedSprite.wsize + 5)); _local4.y = (40 + (int((_local2 / 2)) * (SelectedSprite.hsize + 5))); addChild(_local4); if (_local3[_local2].life.auto_repair){ _local6 = true; }; if (_local3[_local2].upgradeLevel < 5){ _local7 = true; }; _local8 = (_local8 + int(((_local3[_local2].cost_crystals * _local3[_local2].health) / _local3[_local2].full_health))); _local2++; }; sell_button.caption.text = ("Sell for " + _local8.toString()); if (_local6){ repair_button.visible = true; stop_repair_button.visible = false; } else { repair_button.visible = false; stop_repair_button.visible = true; }; if (_local7){ showUpgrade(); up_crystals.text = "*"; up_attack.text = "*"; up_armor.text = "*"; } else { hideUpgrade(); }; } private function showUpgrade():void{ up_crystals.visible = true; up_attack.visible = true; up_armor.visible = true; upgrade_button.visible = true; info_icons.x = 30; crystals.x = 50; range.x = 50; armor.x = 50; attack.x = 50; } public function building(_arg1:String, _arg2:int):void{ var full_health:int; var rects:int; var frontier:int; var rsize:*; var startx:*; var i:*; var type = _arg1; var compl = _arg2; full_health = engine.utypes.params(type).health; rects = 16; frontier = ((compl * rects) / full_health); if (frontier != last_frontier){ last_frontier = frontier; var _local4 = build_progress; with (_local4) { rsize = 6; startx = 0; graphics.clear(); graphics.lineStyle(1, 2244111); i = 0; while (i < rects) { if (i < frontier){ graphics.beginFill(0xFF00); } else { graphics.beginFill(0x808080); }; graphics.drawRect(startx, 0, rsize, rsize); if (i < frontier){ graphics.endFill(); }; startx = (startx + rsize); i++; }; }; }; } public function update(_arg1:Unit):void{ var _local2:int; var _local3:Number; var _local4:TextFormat; var _local5:Number; clearGroupSprites(); if ((((Consts.myId == _arg1.mapid)) || (!(_arg1.mapid)))){ upgrade_button.visible = true; sell_button.visible = !((_arg1.type == UnitTypes.harvester)); if (!_arg1.mapid){ hideUpgrade(); sell_button.visible = false; } else { showUpgrade(); }; } else { upgrade_button.visible = false; sell_button.visible = false; hideUpgrade(); }; crystals.visible = true; armor.visible = true; attack.visible = true; range.visible = true; info_icons.visible = true; _local2 = _arg1.full_health; _local3 = (_arg1.health / _local2); if (((_arg1.life) && ((_arg1.mapid == Consts.myId)))){ if (_arg1.life.auto_repair){ repair_button.visible = true; stop_repair_button.visible = false; } else { repair_button.visible = false; stop_repair_button.visible = true; }; } else { repair_button.visible = false; stop_repair_button.visible = false; }; title.text = _arg1.type; description.text = _arg1.desc; _local4 = health.defaultTextFormat; _local4.color = Utils.healthcolor((_local3 * 100)); health.defaultTextFormat = _local4; health.text = ((_arg1.health.toString() + "/") + _local2.toString()); health.visible = true; if (Consts.crystalsId == _arg1.mapid){ building_txt.visible = false; build_progress.visible = false; description.visible = true; crystals.visible = false; armor.visible = false; attack.visible = false; range.visible = false; info_icons.visible = false; setStatus(_arg1.type, _local3); return; }; if ((((((Consts.myId == _arg1.mapid)) && ((UnitTypes.harvester == _arg1.type)))) && (_arg1.life.ore_goal))){ title.text = (title.text + ((" (Loaded: " + _arg1.life.ore_goal.harvested.toString()) + "/24)")); }; if (engine.game_process.builder.inBuilding(_arg1) != null){ building_txt.visible = true; build_progress.visible = true; description.visible = false; attack.text = "-"; sell_button.visible = false; hideUpgrade(); } else { building_txt.visible = false; build_progress.visible = false; description.visible = true; attack.text = _arg1.damage.toString(); if (_arg1.upgradeLevel >= 5){ hideUpgrade(); } else { if (upgrade_button.visible){ showUpgrade(); _local5 = Utils.upgradeCost(_arg1.type, (_arg1.upgradeLevel + 1)); up_crystals.text = ("+" + int((_local5 * _arg1.cost_crystals)).toString()); up_attack.text = ("+" + int((_local5 * _arg1.damage)).toString()); up_armor.text = "+1"; }; }; if (sell_button.visible){ sell_button.caption.text = ("Sell for " + int(((_arg1.cost_crystals * _arg1.health) / _arg1.full_health)).toString()); }; }; crystals.text = _arg1.cost_crystals.toString(); armor.text = _arg1.armor.toString(); range.text = Utils.textrange(_arg1.eyerange); setStatus(_arg1.type, _local3); } private function clearGroupSprites():void{ var _local1:SelectedSprite; engine.play_window.sstooltip.visible = false; if (selected_sprites){ while (selected_sprites.length > 0) { _local1 = selected_sprites.shift(); _local1.destroy(); removeChild(_local1); }; }; selected_sprites = new Array(); } private function hideUpgrade():void{ up_crystals.visible = false; up_attack.visible = false; up_armor.visible = false; upgrade_button.visible = false; info_icons.x = 65; crystals.x = 95; range.x = 95; armor.x = 95; attack.x = 95; } } }//package fai
Section 55
//UnitSprite (fai.UnitSprite) package fai { import flash.display.*; import flash.filters.*; public class UnitSprite extends Sprite { public var bullet:BitmapData;// = null public var selection:Shape;// = null public var body:Sprite; private var owner:Unit;// = null private var building:BuildingMC;// = null public var sprite:AnimatedBitmap;// = null private var lastfrontier:int;// = -1 public var bulletexp:BitmapData;// = null public var abuffer:BitmapData;// = null public var orders:Sprite;// = null public var mbuffer:BitmapData;// = null public function UnitSprite(_arg1:Unit){ body = new Sprite(); selection = null; sprite = null; owner = null; orders = null; building = null; mbuffer = null; abuffer = null; bullet = null; bulletexp = null; lastfrontier = -1; super(); owner = _arg1; visible = false; } public function select(_arg1:Boolean):void{ var sqcount:*; var hpercent:*; var frontier:*; var diameter:*; var isenemy:*; var rsize:*; var startx:*; var i:*; var enable = _arg1; if (!selection){ selection = new Shape(); addChildAt(selection, 1); selection.x = (selection.x - (sprite.width / 2)); selection.y = (selection.y - (sprite.height / 2)); selection.alpha = 0.5; }; if (enable){ var _local3 = selection; with (_local3) { visible = true; sqcount = 7; hpercent = ((owner.health * 100) / owner.full_health); frontier = ((hpercent * sqcount) / 100); if (frontier != lastfrontier){ lastfrontier = frontier; diameter = (Math.max(sprite.width, sprite.height) + 8); graphics.clear(); isenemy = (owner.mapid == Consts.hostileId); if (isenemy){ graphics.lineStyle(2, 0xFF0000); } else { graphics.lineStyle(2, 253443); }; graphics.drawCircle((sprite.width / 2), (sprite.height / 2), (diameter / 2)); rsize = 5; startx = (((-(rsize) * sqcount) / 2) + (sprite.width / 2)); graphics.lineStyle(1, 0); i = 0; i = 0; while (i < sqcount) { if (i < frontier){ if (isenemy){ graphics.beginFill(0xFF0000); } else { graphics.beginFill(0xFF00); }; }; graphics.drawRect(startx, (diameter - rsize), rsize, rsize); if (i < frontier){ graphics.endFill(); }; startx = (startx + rsize); i++; }; }; }; } else { selection.visible = false; }; } public function setFrame(_arg1:uint):void{ sprite.setFrame(_arg1); } public function addOrder(_arg1:AnimatedBitmap, _arg2:int):void{ _arg1.x = ((_arg2 - 1) * _arg1.width); orders.addChild(_arg1); } public function startBuilding():void{ building = new BuildingMC(); building.scaleX = (building.scaleY = (Consts.cell_size / building.height)); body.alpha = 0.7; addChild(building); } public function rotate(_arg1:uint):void{ body.rotation = _arg1; } public function nframes():uint{ return (sprite.nframes); } public function setAttackSprite():void{ sprite.setBuffer(abuffer); } public function stopBuilding():void{ if (building){ removeChild(building); body.alpha = 1; building = null; }; } public function setAppearence(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:int, _arg6:uint, _arg7:Boolean=true):void{ var _local8:BitmapFilter; var _local9:Array; if (_arg7){ mbuffer = setColor(_arg1, _arg6); abuffer = setColor(_arg2, _arg6); } else { mbuffer = _arg1; abuffer = _arg2; }; bullet = _arg3; bulletexp = _arg4; sprite = new AnimatedBitmap(mbuffer, _arg5, mbuffer.height); orders = new Sprite(); body.addChild(sprite); sprite.x = (sprite.x - (sprite.width / 2)); sprite.y = (sprite.y - (sprite.height / 2)); addChild(body); orders.x = sprite.x; orders.y = (sprite.y + (sprite.height / 8)); addChild(orders); if (owner.flag(UnitFlags.Flying)){ _local8 = getBitmapFilter(); _local9 = new Array(); _local9.push(_local8); filters = _local9; }; cacheAsBitmap = true; } private function getBitmapFilter():BitmapFilter{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Boolean; var _local9:Boolean; var _local10:Number; _local1 = 0; _local2 = 45; _local3 = 0.8; _local4 = 5; _local5 = 5; _local6 = 10; _local7 = 0.8; _local8 = false; _local9 = false; _local10 = BitmapFilterQuality.LOW; return (new DropShadowFilter(_local6, _local2, _local1, _local3, _local4, _local5, _local7, _local10, _local8, _local9)); } public function setMoveSprite():void{ sprite.setBuffer(mbuffer); } public static function setColor(_arg1:BitmapData, _arg2:uint):BitmapData{ var _local3:BitmapData; var _local4:int; var _local5:int; var _local6:int; var _local7:int; var _local8:uint; var _local9:uint; var _local10:uint; var _local11:uint; var _local12:uint; if (!_arg1){ return (null); }; _local3 = _arg1.clone(); _local4 = _local3.width; _local5 = _local3.height; _local6 = 0; while (_local6 < _local4) { _local7 = 0; while (_local7 < _local5) { _local8 = _local3.getPixel32(_local6, _local7); _local9 = ((_local8 >> 24) & 0xFF); _local10 = ((_local8 >> 16) & 0xFF); _local11 = ((_local8 >> 8) & 0xFF); _local12 = (_local8 & 0xFF); if ((((((_local11 == 0)) && ((_local12 == 0)))) && ((_local10 > 250)))){ _local3.setPixel(_local6, _local7, _arg2); }; _local7++; }; _local6++; }; return (_local3); } } }//package fai
Section 56
//UnitTypes (fai.UnitTypes) package fai { import flash.utils.*; public class UnitTypes { private var bsteps:Dictionary; private var sloader:SmartLoader;// = null private var engine:Engine;// = null private var initiated:Boolean;// = false private var unitToButton:Dictionary; public var units:Dictionary; public static const fighter_t2:String = "Fighter T2"; public static const fighter_t3:String = "Fighter T3"; public static const m_crystals:String = "crystals.png"; public static const m_energy:String = "energy.png"; public static const sp_debris:String = "debris.png"; public static const sp_crystals:String = "Crystals"; public static const stunner:String = "Stunner"; public static const sp_my_order:String = "My Order"; public static const interceptor:String = "Interceptor"; public static const destroyer:String = "Destroyer"; public static const missile_turret:String = "Missile Turret"; public static const nitro_bomb:String = "Nitro Bomb"; public static const enemies:Array = [battle_shuttle, destroyer, fighter_t1, fighter_t2, fighter_t3, gunship, jackal, rock, war_bird]; public static const war_bird:String = "War Bird"; public static const plasma_mortar:String = "Plasma Mortar"; public static const battle_shuttle:String = "Battle Shuttle"; public static const b_stop:String = "Stop"; public static const b_attack:String = "Attack"; public static const artillery:String = "Artillery"; public static const command_center:String = "Command Center"; public static const nuclear_missile:String = "Nuclear Missile"; public static const star_conqueror:String = "Star Conqueror"; public static const jackal:String = "Jackal"; public static const executor:String = "Executor"; public static const harvester:String = "Harvester"; public static const m_attack:String = "attack.png"; public static const bosses:Array = [executor, interceptor, star_conqueror]; public static const sp_death1:String = "death1.png"; public static const rock:String = "Rock"; public static const sp_hostile_order:String = "Hostile Order"; public static const m_armor:String = "shield.png"; public static const laser_cannon:String = "Laser Cannon"; public static const m_range:String = "range.png"; public static const refinery:String = "Refinery"; public static const cumulative_bomb:String = "Cumulative Bomb"; public static const b_cancel:String = "Cancel"; public static const types:Array = [artillery, laser_cannon, missile_turret, plasma_mortar, harvester, stunner, command_center, refinery, power_station, battle_shuttle, destroyer, executor, fighter_t1, fighter_t2, fighter_t3, gunship, interceptor, jackal, rock, star_conqueror, war_bird]; public static const power_station:String = "Power Station"; public static const gunship:String = "Gunship"; public static const fighter_t1:String = "Fighter T1"; public function UnitTypes(_arg1:Engine):void{ var _local2:String; var _local3:Unit; units = new Dictionary(); bsteps = new Dictionary(); unitToButton = new Dictionary(); sloader = null; engine = null; initiated = false; super(); engine = _arg1; sloader = engine.sloader; for each (_local2 in types) { units[_local2] = createUnit(_local2, 0); }; _local3 = createUnit(sp_crystals, 0); if (_local3){ units[sp_crystals] = _local3; }; initBuildSteps(); initiated = true; } public function createUnit(_arg1:String, _arg2:int):Unit{ var _local3:Unit; _local3 = null; switch (_arg1){ case laser_cannon: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 100; _local3.damage = 5; _local3.cost_crystals = 50; _local3.eyerange = 7; _local3.sprite_width = 32; _local3.rechargetime = 40; _local3.desc = "(Air, Ground)\nSmall health, fire and cost rate."; _local3.armor = 1; _local3.flags = (_local3.flags | ((UnitFlags.Building | UnitFlags.Antilandforces) | UnitFlags.Antiaircraft)); break; case artillery: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 150; _local3.damage = 10; _local3.cost_crystals = 75; _local3.sprite_width = 30; _local3.eyerange = 9; _local3.desc = "(Ground)\nGood surface defender."; _local3.armor = 2; _local3.flags = (_local3.flags | (UnitFlags.Building | UnitFlags.Antilandforces)); break; case missile_turret: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 80; _local3.damage = 5; _local3.cost_crystals = 125; _local3.sprite_width = 32; _local3.eyerange = 10; _local3.rechargetime = 5; _local3.desc = "(Air)\nBest Anti-Aircraft unit. Good fire power, small health rate."; _local3.armor = 0; _local3.flags = (_local3.flags | (UnitFlags.Building | UnitFlags.Antiaircraft)); if (initiated){ _local3.attacksound = sloader.getSound(Sounds.missile_turret_launch); }; break; case plasma_mortar: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 400; _local3.damage = 16; _local3.cost_crystals = 250; _local3.sprite_width = 32; _local3.eyerange = 7; _local3.desc = "(Air, Ground)\nHeaviest unit. Best health and fire rate."; _local3.armor = 4; _local3.flags = (_local3.flags | ((UnitFlags.Building | UnitFlags.Antiaircraft) | UnitFlags.Antilandforces)); break; case stunner: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 100; _local3.damage = 3; _local3.cost_crystals = 200; _local3.sprite_width = 32; _local3.eyerange = 8; _local3.rechargetime = 100; _local3.desc = "(Air, Ground)\nStuns enemies for several seconds. Longer recharge."; _local3.armor = 1; _local3.flags = (_local3.flags | ((UnitFlags.Building | UnitFlags.Antilandforces) | UnitFlags.Antiaircraft)); break; case command_center: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 1500; _local3.desc = "Rebel Headquarters. This building must not be destroyed."; _local3.armor = 1; _local3.cost_crystals = 500; _local3.sprite_width = 64; _local3.flags = (_local3.flags | (UnitFlags.Building | UnitFlags.Peaceful)); break; case refinery: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 500; _local3.cost_crystals = 150; _local3.desc = "Crystals Refinery. Refines crystals mined by the harvester."; _local3.armor = 0; _local3.flags = (_local3.flags | (UnitFlags.Building | UnitFlags.Peaceful)); _local3.sprite_width = 34; break; case power_station: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 800; _local3.cost_crystals = 60; _local3.desc = "This building increases energy treshold by 5 points."; _local3.armor = 0; _local3.flags = (_local3.flags | (UnitFlags.Building | UnitFlags.Peaceful)); _local3.sprite_width = 42; break; case harvester: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 400; _local3.cost_crystals = 125; _local3.movesteps = 12; _local3.desc = "This unit harvests crystals and departs them to its Refinery."; _local3.armor = 5; _local3.flags = (_local3.flags | (UnitFlags.Peaceful | UnitFlags.Flying)); _local3.eyerange = 10; _local3.sprite_width = 22; break; case battle_shuttle: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 30; _local3.damage = 3; _local3.cost_crystals = 30; _local3.eyerange = 3; _local3.rechargetime = 40; _local3.sprite_width = 30; _local3.armor = 0; _local3.death_cost = 2; _local3.flags = (_local3.flags | (UnitFlags.Flying | UnitFlags.Antilandforces)); if (initiated){ _local3.attacksound = sloader.getSound(Sounds.laser2); }; break; case destroyer: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 50; _local3.damage = 4; _local3.cost_crystals = 50; _local3.eyerange = 4; _local3.rechargetime = 40; _local3.sprite_width = 32; _local3.armor = 1; _local3.death_cost = 3; _local3.flags = (_local3.flags | UnitFlags.Antilandforces); if (initiated){ _local3.attacksound = sloader.getSound(Sounds.laser2); }; break; case fighter_t1: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 50; _local3.damage = 3; _local3.cost_crystals = 60; _local3.eyerange = 4; _local3.sprite_width = 30; _local3.rechargetime = 40; _local3.movesteps = 8; _local3.armor = 0; _local3.death_cost = 3; _local3.flags = (_local3.flags | (UnitFlags.Flying | UnitFlags.Antilandforces)); if (initiated){ _local3.attacksound = sloader.getSound(Sounds.laser2); }; break; case fighter_t2: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 75; _local3.damage = 3; _local3.cost_crystals = 80; _local3.eyerange = 4; _local3.sprite_width = 32; _local3.rechargetime = 40; _local3.movesteps = 8; _local3.armor = 0; _local3.death_cost = 3; _local3.flags = (_local3.flags | (UnitFlags.Flying | UnitFlags.Antilandforces)); if (initiated){ _local3.attacksound = sloader.getSound(Sounds.laser2); }; break; case fighter_t3: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 90; _local3.damage = 4; _local3.cost_crystals = 100; _local3.eyerange = 4; _local3.movesteps = 5; _local3.sprite_width = 32; _local3.rechargetime = 40; _local3.armor = 0; _local3.death_cost = 4; _local3.flags = (_local3.flags | (UnitFlags.Flying | UnitFlags.Antilandforces)); break; case gunship: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 120; _local3.damage = 5; _local3.cost_crystals = 120; _local3.eyerange = 4; _local3.sprite_width = 32; _local3.rechargetime = 40; _local3.armor = 0; _local3.death_cost = 5; _local3.flags = (_local3.flags | UnitFlags.Antilandforces); if (initiated){ _local3.attacksound = sloader.getSound(Sounds.laser2); }; break; case jackal: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 180; _local3.damage = 5; _local3.cost_crystals = 180; _local3.eyerange = 4; _local3.sprite_width = 32; _local3.rechargetime = 40; _local3.armor = 0; _local3.death_cost = 5; _local3.flags = (_local3.flags | UnitFlags.Antilandforces); if (initiated){ _local3.attacksound = sloader.getSound(Sounds.laser2); }; break; case rock: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 400; _local3.damage = 6; _local3.cost_crystals = 500; _local3.eyerange = 2; _local3.sprite_width = 24; _local3.rechargetime = 40; _local3.movesteps = 30; _local3.armor = 0; _local3.rotstep = 3; _local3.death_cost = 10; _local3.flags = (_local3.flags | UnitFlags.Antilandforces); break; case war_bird: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 200; _local3.damage = 7; _local3.cost_crystals = 250; _local3.eyerange = 4; _local3.sprite_width = 32; _local3.rechargetime = 40; _local3.movesteps = 20; _local3.armor = 0; _local3.death_cost = 8; _local3.flags = (_local3.flags | UnitFlags.Antilandforces); if (initiated){ _local3.attacksound = sloader.getSound(Sounds.laser2); }; break; case interceptor: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 1100; _local3.damage = 20; _local3.cost_crystals = 1500; _local3.eyerange = 4; _local3.sprite_width = 90; _local3.rechargetime = 40; _local3.movesteps = 25; _local3.rotstep = 3; _local3.armor = 1; _local3.death_cost = 100; _local3.flags = (_local3.flags | (UnitFlags.Flying | UnitFlags.Antilandforces)); break; case executor: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 2500; _local3.damage = 25; _local3.cost_crystals = 3000; _local3.eyerange = 4; _local3.sprite_width = 80; _local3.rechargetime = 40; _local3.rotstep = 3; _local3.movesteps = 28; _local3.armor = 2; _local3.death_cost = 300; _local3.flags = (_local3.flags | (UnitFlags.Flying | UnitFlags.Antilandforces)); break; case star_conqueror: _local3 = new Unit(engine, _arg2, _arg1); _local3.health = 5000; _local3.damage = 35; _local3.cost_crystals = 5000; _local3.eyerange = 4; _local3.sprite_width = 85; _local3.rechargetime = 45; _local3.rotstep = 2; _local3.movesteps = 32; _local3.armor = 3; _local3.death_cost = 1000; _local3.flags = (_local3.flags | (UnitFlags.Flying | UnitFlags.Antilandforces)); break; case sp_crystals: _local3 = new Unit(engine, Consts.crystalsId, _arg1); _local3.health = 3000; _local3.cost_crystals = 0; _local3.sprite_width = 32; _local3.desc = "Ore crystals. The general trade resource."; _local3.armor = 0; _local3.flags = (_local3.flags | (UnitFlags.Building | UnitFlags.Peaceful)); break; }; _local3.full_health = _local3.health; if (initiated){ _local3.copyProperties(units[_arg1]); if (_local3.flag(UnitFlags.Peaceful)){ switch (_local3.mapid){ case Consts.crystalsId: sloader.dressResource(_local3, _arg1, engine); break; default: sloader.dressPeacefulUnit(_local3, _arg1, engine); break; }; } else { sloader.dressUnit(_local3, _arg1, engine); }; }; return (_local3); } public function params(_arg1:String):Unit{ return (units[_arg1]); } private function initBuildSteps():void{ bsteps[artillery] = 210; bsteps[harvester] = 100; bsteps[laser_cannon] = 150; bsteps[missile_turret] = 280; bsteps[plasma_mortar] = 500; bsteps[refinery] = 400; bsteps[power_station] = 250; bsteps[stunner] = 400; } public function buildSteps(_arg1:String):int{ return (bsteps[_arg1]); } public static function isBoss(_arg1:String):Boolean{ return ((((((_arg1 == star_conqueror)) || ((_arg1 == interceptor)))) || ((_arg1 == executor)))); } } }//package fai
Section 57
//Utils (fai.Utils) package fai { import flash.text.*; public class Utils { public static function textrange(_arg1:int):String{ if (_arg1 < 6){ return ("Small"); }; if (_arg1 < 7){ return ("Average"); }; return ("Big"); } public static function createTextField(_arg1:uint, _arg2:uint=10):TextField{ var _local3:TextField; var _local4:TextFormat; _local3 = new TextField(); _local3.autoSize = TextFieldAutoSize.LEFT; _local3.background = false; _local3.border = false; _local3.selectable = false; _local4 = new TextFormat(); _local4.font = "Verdana"; _local4.color = _arg1; _local4.size = _arg2; _local4.bold = true; _local3.defaultTextFormat = _local4; return (_local3); } public static function healthcolor(_arg1:int):int{ if (_arg1 >= 70){ return (0xFF00); }; if (_arg1 > 30){ return (16576567); }; return (0xFF0000); } public static function drawRect(_arg1, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:Boolean=false, _arg8:int=0, _arg9:int=0):void{ var s = _arg1; var border = _arg2; var bcolor = _arg3; var fcolor = _arg4; var w = _arg5; var h = _arg6; var rr = _arg7; var xs = _arg8; var ys = _arg9; var _local11 = s.graphics; with (_local11) { lineStyle(border, bcolor); beginFill(fcolor); if (rr){ drawRoundRect(xs, ys, w, h, (w / 5), (h / 5)); } else { drawRect(xs, ys, w, h); }; endFill(); }; } public static function upgradeCost(_arg1:String, _arg2:int):int{ switch (_arg1){ case UnitTypes.artillery: switch (_arg2){ case 5: return (1.25); }; break; case UnitTypes.missile_turret: switch (_arg2){ case 5: return (1.5); }; break; case UnitTypes.plasma_mortar: switch (_arg2){ case 5: return (1.5); }; break; case UnitTypes.war_bird: switch (_arg2){ case 5: return (1.5); }; break; }; return (1); } public static function unitId(_arg1:Unit):int{ return (((_arg1.pos.x * 1987600) + _arg1.pos.y)); } } }//package fai
Section 58
//BaseButton (fl.controls.BaseButton) package fl.controls { import flash.events.*; import flash.display.*; import fl.core.*; import flash.utils.*; import fl.events.*; public class BaseButton extends UIComponent { protected var _selected:Boolean;// = false private var unlockedMouseState:String; protected var pressTimer:Timer; protected var mouseState:String; protected var background:DisplayObject; private var _mouseStateLocked:Boolean;// = false protected var _autoRepeat:Boolean;// = false private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35}; public function BaseButton(){ _selected = false; _autoRepeat = false; _mouseStateLocked = false; super(); buttonMode = true; mouseChildren = false; useHandCursor = false; setupMouseEvents(); setMouseState("up"); pressTimer = new Timer(1, 0); pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true); } protected function endPress():void{ pressTimer.reset(); } public function set mouseStateLocked(_arg1:Boolean):void{ _mouseStateLocked = _arg1; if (_arg1 == false){ setMouseState(unlockedMouseState); } else { unlockedMouseState = mouseState; }; } public function get autoRepeat():Boolean{ return (_autoRepeat); } public function set autoRepeat(_arg1:Boolean):void{ _autoRepeat = _arg1; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; mouseEnabled = _arg1; } public function get selected():Boolean{ return (_selected); } protected function mouseEventHandler(_arg1:MouseEvent):void{ if (_arg1.type == MouseEvent.MOUSE_DOWN){ setMouseState("down"); startPress(); } else { if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){ setMouseState("over"); endPress(); } else { if (_arg1.type == MouseEvent.ROLL_OUT){ setMouseState("up"); endPress(); }; }; }; } public function setMouseState(_arg1:String):void{ if (_mouseStateLocked){ unlockedMouseState = _arg1; return; }; if (mouseState == _arg1){ return; }; mouseState = _arg1; invalidate(InvalidationType.STATE); } protected function startPress():void{ if (_autoRepeat){ pressTimer.delay = Number(getStyleValue("repeatDelay")); pressTimer.start(); }; dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true)); } protected function buttonDown(_arg1:TimerEvent):void{ if (!_autoRepeat){ endPress(); return; }; if (pressTimer.currentCount == 1){ pressTimer.delay = Number(getStyleValue("repeatInterval")); }; dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true)); } public function set selected(_arg1:Boolean):void{ if (_selected == _arg1){ return; }; _selected = _arg1; invalidate(InvalidationType.STATE); } override public function get enabled():Boolean{ return (super.enabled); } override protected function draw():void{ if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ drawBackground(); invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE)){ drawLayout(); }; super.draw(); } protected function setupMouseEvents():void{ addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true); addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true); addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true); addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true); } protected function drawLayout():void{ background.width = width; background.height = height; } protected function drawBackground():void{ var _local1:String; var _local2:DisplayObject; _local1 = (enabled) ? mouseState : "disabled"; if (selected){ _local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1)); }; _local1 = (_local1 + "Skin"); _local2 = background; background = getDisplayObjectInstance(getStyleValue(_local1)); addChildAt(background, 0); if (((!((_local2 == null))) && (!((_local2 == background))))){ removeChild(_local2); }; } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 59
//Button (fl.controls.Button) package fl.controls { import flash.display.*; import fl.core.*; import fl.managers.*; public class Button extends LabelButton implements IFocusManagerComponent { protected var emphasizedBorder:DisplayObject; protected var _emphasized:Boolean;// = false private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2}; public static var createAccessibilityImplementation:Function; public function Button(){ _emphasized = false; super(); } override public function drawFocus(_arg1:Boolean):void{ var _local2:Number; var _local3:*; super.drawFocus(_arg1); if (_arg1){ _local2 = Number(getStyleValue("emphasizedPadding")); if ((((_local2 < 0)) || (!(_emphasized)))){ _local2 = 0; }; _local3 = getStyleValue("focusRectPadding"); _local3 = ((_local3)==null) ? 2 : _local3; _local3 = (_local3 + _local2); uiFocusRect.x = -(_local3); uiFocusRect.y = -(_local3); uiFocusRect.width = (width + (_local3 * 2)); uiFocusRect.height = (height + (_local3 * 2)); }; } public function set emphasized(_arg1:Boolean):void{ _emphasized = _arg1; invalidate(InvalidationType.STYLES); } override protected function draw():void{ if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){ drawEmphasized(); }; super.draw(); if (emphasizedBorder != null){ setChildIndex(emphasizedBorder, (numChildren - 1)); }; } public function get emphasized():Boolean{ return (_emphasized); } override protected function initializeAccessibility():void{ if (Button.createAccessibilityImplementation != null){ Button.createAccessibilityImplementation(this); }; } protected function drawEmphasized():void{ var _local1:Object; var _local2:Number; if (emphasizedBorder != null){ removeChild(emphasizedBorder); }; emphasizedBorder = null; if (!_emphasized){ return; }; _local1 = getStyleValue("emphasizedSkin"); if (_local1 != null){ emphasizedBorder = getDisplayObjectInstance(_local1); }; if (emphasizedBorder != null){ addChildAt(emphasizedBorder, 0); _local2 = Number(getStyleValue("emphasizedPadding")); emphasizedBorder.x = (emphasizedBorder.y = -(_local2)); emphasizedBorder.width = (width + (_local2 * 2)); emphasizedBorder.height = (height + (_local2 * 2)); }; } public static function getStyleDefinition():Object{ return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles)); } } }//package fl.controls
Section 60
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement) package fl.controls { public class ButtonLabelPlacement { public static const TOP:String = "top"; public static const LEFT:String = "left"; public static const BOTTOM:String = "bottom"; public static const RIGHT:String = "right"; } }//package fl.controls
Section 61
//LabelButton (fl.controls.LabelButton) package fl.controls { import flash.events.*; import flash.display.*; import flash.text.*; import fl.core.*; import fl.managers.*; import fl.events.*; import flash.ui.*; public class LabelButton extends BaseButton implements IFocusManagerComponent { protected var _labelPlacement:String;// = "right" protected var _toggle:Boolean;// = false protected var icon:DisplayObject; protected var oldMouseState:String; protected var mode:String;// = "center" public var textField:TextField; protected var _label:String;// = "Label" private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false}; public static var createAccessibilityImplementation:Function; public function LabelButton(){ _labelPlacement = ButtonLabelPlacement.RIGHT; _toggle = false; _label = "Label"; mode = "center"; super(); } protected function toggleSelected(_arg1:MouseEvent):void{ selected = !(selected); dispatchEvent(new Event(Event.CHANGE, true)); } public function get labelPlacement():String{ return (_labelPlacement); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ if (!enabled){ return; }; if (_arg1.keyCode == Keyboard.SPACE){ if (oldMouseState == null){ oldMouseState = mouseState; }; setMouseState("down"); startPress(); }; } protected function setEmbedFont(){ var _local1:Object; _local1 = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; } override protected function keyUpHandler(_arg1:KeyboardEvent):void{ if (!enabled){ return; }; if (_arg1.keyCode == Keyboard.SPACE){ setMouseState(oldMouseState); oldMouseState = null; endPress(); dispatchEvent(new MouseEvent(MouseEvent.CLICK)); }; } override public function get selected():Boolean{ return ((_toggle) ? _selected : false); } public function set labelPlacement(_arg1:String):void{ _labelPlacement = _arg1; invalidate(InvalidationType.SIZE); } public function set toggle(_arg1:Boolean):void{ if (((!(_arg1)) && (super.selected))){ selected = false; }; _toggle = _arg1; if (_toggle){ addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true); } else { removeEventListener(MouseEvent.CLICK, toggleSelected); }; invalidate(InvalidationType.STATE); } public function get label():String{ return (_label); } override public function set selected(_arg1:Boolean):void{ _selected = _arg1; if (_toggle){ invalidate(InvalidationType.STATE); }; } override protected function draw():void{ if (textField.text != _label){ label = _label; }; if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ drawBackground(); drawIcon(); drawTextFormat(); invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE)){ drawLayout(); }; if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){ if (((isFocused) && (focusManager.showFocusIndicator))){ drawFocus(true); }; }; validate(); } public function get toggle():Boolean{ return (_toggle); } override protected function configUI():void{ super.configUI(); textField = new TextField(); textField.type = TextFieldType.DYNAMIC; textField.selectable = false; addChild(textField); } override protected function drawLayout():void{ var _local1:Number; var _local2:String; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; _local1 = Number(getStyleValue("textPadding")); _local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement; textField.height = (textField.textHeight + 4); _local3 = (textField.textWidth + 4); _local4 = (textField.textHeight + 4); _local5 = ((icon)==null) ? 0 : (icon.width + _local1); _local6 = ((icon)==null) ? 0 : (icon.height + _local1); textField.visible = (label.length > 0); if (icon != null){ icon.x = Math.round(((width - icon.width) / 2)); icon.y = Math.round(((height - icon.height) / 2)); }; if (textField.visible == false){ textField.width = 0; textField.height = 0; } else { if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){ _local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1)))); if ((height - 2) > _local4){ _local8 = _local4; } else { _local8 = (height - 2); }; _local3 = _local7; textField.width = _local3; _local4 = _local8; textField.height = _local4; textField.x = Math.round(((width - _local3) / 2)); textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0)); if (icon != null){ icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1)); }; } else { _local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1)))); _local3 = _local7; textField.width = _local3; textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0)); textField.y = Math.round(((height - textField.height) / 2)); if (icon != null){ icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1)); }; }; }; super.drawLayout(); } override protected function initializeAccessibility():void{ if (LabelButton.createAccessibilityImplementation != null){ LabelButton.createAccessibilityImplementation(this); }; } protected function drawIcon():void{ var _local1:DisplayObject; var _local2:String; var _local3:Object; _local1 = icon; _local2 = (enabled) ? mouseState : "disabled"; if (selected){ _local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1)); }; _local2 = (_local2 + "Icon"); _local3 = getStyleValue(_local2); if (_local3 == null){ _local3 = getStyleValue("icon"); }; if (_local3 != null){ icon = getDisplayObjectInstance(_local3); }; if (icon != null){ addChildAt(icon, 1); }; if (((!((_local1 == null))) && (!((_local1 == icon))))){ removeChild(_local1); }; } public function set label(_arg1:String):void{ _label = _arg1; if (textField.text != _label){ textField.text = _label; dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE)); }; invalidate(InvalidationType.SIZE); invalidate(InvalidationType.STYLES); } protected function drawTextFormat():void{ var _local1:Object; var _local2:TextFormat; var _local3:TextFormat; _local1 = UIComponent.getStyleDefinition(); _local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat); textField.setTextFormat(_local2); _local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); if (_local3 != null){ textField.setTextFormat(_local3); } else { _local3 = _local2; }; textField.defaultTextFormat = _local3; setEmbedFont(); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition())); } } }//package fl.controls
Section 62
//Slider (fl.controls.Slider) package fl.controls { import flash.events.*; import flash.display.*; import fl.core.*; import fl.managers.*; import fl.events.*; import flash.ui.*; public class Slider extends UIComponent implements IFocusManagerComponent { protected var _direction:String; protected var _liveDragging:Boolean;// = false protected var _value:Number;// = 0 protected var _snapInterval:Number;// = 0 protected var _minimum:Number;// = 0 protected var _maximum:Number;// = 10 protected var track:BaseButton; protected var _tickInterval:Number;// = 0 protected var tickContainer:Sprite; protected var thumb:BaseButton; protected static const TICK_STYLES:Object = {upSkin:"tickSkin"}; protected static const TRACK_STYLES:Object = {upSkin:"sliderTrackSkin", overSkin:"sliderTrackSkin", downSkin:"sliderTrackSkin", disabledSkin:"sliderTrackDisabledSkin"}; protected static const THUMB_STYLES:Object = {upSkin:"thumbUpSkin", overSkin:"thumbOverSkin", downSkin:"thumbDownSkin", disabledSkin:"thumbDisabledSkin"}; protected static var defaultStyles:Object = {thumbUpSkin:"SliderThumb_upSkin", thumbOverSkin:"SliderThumb_overSkin", thumbDownSkin:"SliderThumb_downSkin", thumbDisabledSkin:"SliderThumb_disabledSkin", sliderTrackSkin:"SliderTrack_skin", sliderTrackDisabledSkin:"SliderTrack_disabledSkin", tickSkin:"SliderTick_skin", focusRectSkin:null, focusRectPadding:null}; public function Slider(){ _direction = SliderDirection.HORIZONTAL; _minimum = 0; _maximum = 10; _value = 0; _tickInterval = 0; _snapInterval = 0; _liveDragging = false; super(); setStyles(); } public function get minimum():Number{ return (_minimum); } public function set minimum(_arg1:Number):void{ _minimum = _arg1; this.value = Math.max(_arg1, this.value); invalidate(InvalidationType.DATA); } public function get maximum():Number{ return (_maximum); } protected function positionThumb():void{ thumb.x = ((((_direction)==SliderDirection.VERTICAL) ? ((maximum - minimum) - value) : (value - minimum) / (maximum - minimum)) * _width); } protected function clearTicks():void{ if (((!(tickContainer)) || (!(tickContainer.parent)))){ return; }; removeChild(tickContainer); } protected function onTrackClick(_arg1:MouseEvent):void{ calculateValue(track.mouseX, InteractionInputType.MOUSE, SliderEventClickTarget.TRACK); if (!liveDragging){ dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.TRACK, InteractionInputType.MOUSE)); }; } public function set maximum(_arg1:Number):void{ _maximum = _arg1; this.value = Math.min(_arg1, this.value); invalidate(InvalidationType.DATA); } public function get liveDragging():Boolean{ return (_liveDragging); } protected function doDrag(_arg1:MouseEvent):void{ var _local2:Number; var _local3:Number; _local2 = (_width / snapInterval); _local3 = track.mouseX; calculateValue(_local3, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB); dispatchEvent(new SliderEvent(SliderEvent.THUMB_DRAG, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE)); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ var _local2:uint; var _local3:Number; var _local4:Boolean; if (!enabled){ return; }; _local2 = ((snapInterval)>0) ? snapInterval : 1; _local4 = (direction == SliderDirection.HORIZONTAL); if ((((((_arg1.keyCode == Keyboard.DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.LEFT)) && (_local4))))){ _local3 = (value - _local2); } else { if ((((((_arg1.keyCode == Keyboard.UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.RIGHT)) && (_local4))))){ _local3 = (value + _local2); } else { if ((((((_arg1.keyCode == Keyboard.PAGE_DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.HOME)) && (_local4))))){ _local3 = minimum; } else { if ((((((_arg1.keyCode == Keyboard.PAGE_UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.END)) && (_local4))))){ _local3 = maximum; }; }; }; }; if (!isNaN(_local3)){ _arg1.stopPropagation(); doSetValue(_local3, InteractionInputType.KEYBOARD, null, _arg1.keyCode); }; } override public function set enabled(_arg1:Boolean):void{ if (enabled == _arg1){ return; }; super.enabled = _arg1; track.enabled = (thumb.enabled = _arg1); } protected function thumbPressHandler(_arg1:MouseEvent):void{ stage.addEventListener(MouseEvent.MOUSE_MOVE, doDrag, false, 0, true); stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true); dispatchEvent(new SliderEvent(SliderEvent.THUMB_PRESS, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB)); } public function get snapInterval():Number{ return (_snapInterval); } protected function thumbReleaseHandler(_arg1:MouseEvent):void{ stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag); stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler); dispatchEvent(new SliderEvent(SliderEvent.THUMB_RELEASE, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB)); dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE)); } public function set liveDragging(_arg1:Boolean):void{ _liveDragging = _arg1; } public function set value(_arg1:Number):void{ doSetValue(_arg1); } public function set direction(_arg1:String):void{ var _local2:Boolean; _direction = _arg1; _local2 = (_direction == SliderDirection.VERTICAL); if (isLivePreview){ if (_local2){ setScaleY(-1); y = track.height; } else { setScaleY(1); y = 0; }; positionThumb(); return; }; if (((_local2) && (componentInspectorSetting))){ if ((rotation % 90) == 0){ setScaleY(-1); }; }; if (!componentInspectorSetting){ rotation = (_local2) ? 90 : 0; }; } public function set tickInterval(_arg1:Number):void{ _tickInterval = _arg1; invalidate(InvalidationType.SIZE); } override public function get enabled():Boolean{ return (super.enabled); } override protected function draw():void{ if (isInvalid(InvalidationType.STYLES)){ setStyles(); invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE)){ track.setSize(_width, track.height); track.drawNow(); thumb.drawNow(); }; if (tickInterval > 0){ drawTicks(); } else { clearTicks(); }; positionThumb(); super.draw(); } override protected function configUI():void{ super.configUI(); thumb = new BaseButton(); thumb.setSize(13, 13); thumb.autoRepeat = false; addChild(thumb); thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true); track = new BaseButton(); track.move(0, 0); track.setSize(80, 4); track.autoRepeat = false; track.useHandCursor = false; track.addEventListener(MouseEvent.CLICK, onTrackClick, false, 0, true); addChildAt(track, 0); } public function set snapInterval(_arg1:Number):void{ _snapInterval = _arg1; } public function get value():Number{ return (_value); } public function get direction():String{ return (_direction); } public function get tickInterval():Number{ return (_tickInterval); } override public function setSize(_arg1:Number, _arg2:Number):void{ if ((((_direction == SliderDirection.VERTICAL)) && (!(isLivePreview)))){ super.setSize(_arg2, _arg1); } else { super.setSize(_arg1, _arg2); }; invalidate(InvalidationType.SIZE); } protected function drawTicks():void{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:uint; var _local5:DisplayObject; clearTicks(); tickContainer = new Sprite(); _local1 = ((maximum)<1) ? (tickInterval / 100) : tickInterval; _local2 = ((maximum - minimum) / _local1); _local3 = (_width / _local2); _local4 = 0; while (_local4 <= _local2) { _local5 = getDisplayObjectInstance(getStyleValue("tickSkin")); _local5.x = (_local3 * _local4); _local5.y = ((track.y - _local5.height) - 2); tickContainer.addChild(_local5); _local4++; }; addChild(tickContainer); } protected function calculateValue(_arg1:Number, _arg2:String, _arg3:String, _arg4:int=undefined):void{ var _local5:Number; _local5 = ((_arg1 / _width) * (maximum - minimum)); if (_direction == SliderDirection.VERTICAL){ _local5 = (maximum - _local5); } else { _local5 = (minimum + _local5); }; doSetValue(_local5, _arg2, _arg3, _arg4); } protected function getPrecision(_arg1:Number):Number{ var _local2:String; _local2 = _arg1.toString(); if (_local2.indexOf(".") == -1){ return (0); }; return (_local2.split(".").pop().length); } protected function doSetValue(_arg1:Number, _arg2:String=null, _arg3:String=null, _arg4:int=undefined):void{ var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; _local5 = _value; if (((!((_snapInterval == 0))) && (!((_snapInterval == 1))))){ _local6 = Math.pow(10, getPrecision(snapInterval)); _local7 = (_snapInterval * _local6); _local8 = Math.round((_arg1 * _local6)); _local9 = (Math.round((_local8 / _local7)) * _local7); _arg1 = (_local9 / _local6); _value = Math.max(minimum, Math.min(maximum, _arg1)); } else { _value = Math.max(minimum, Math.min(maximum, Math.round(_arg1))); }; if (((!((_local5 == _value))) && (((((liveDragging) && (!((_arg3 == null))))) || ((_arg2 == InteractionInputType.KEYBOARD)))))){ dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, _arg3, _arg2, _arg4)); }; positionThumb(); } protected function setStyles():void{ copyStylesToChild(thumb, THUMB_STYLES); copyStylesToChild(track, TRACK_STYLES); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 63
//SliderDirection (fl.controls.SliderDirection) package fl.controls { public class SliderDirection { public static var HORIZONTAL:String = "horizontal"; public static var VERTICAL:String = "vertical"; } }//package fl.controls
Section 64
//ComponentShim (fl.core.ComponentShim) package fl.core { import flash.display.*; public dynamic class ComponentShim extends MovieClip { } }//package fl.core
Section 65
//InvalidationType (fl.core.InvalidationType) package fl.core { public class InvalidationType { public static const SIZE:String = "size"; public static const ALL:String = "all"; public static const DATA:String = "data"; public static const SCROLL:String = "scroll"; public static const STATE:String = "state"; public static const STYLES:String = "styles"; public static const SELECTED:String = "selected"; public static const RENDERER_STYLES:String = "rendererStyles"; } }//package fl.core
Section 66
//UIComponent (fl.core.UIComponent) package fl.core { import flash.events.*; import flash.display.*; import flash.text.*; import fl.managers.*; import flash.utils.*; import fl.events.*; import flash.system.*; public class UIComponent extends Sprite { protected var _enabled:Boolean;// = true private var _mouseFocusEnabled:Boolean;// = true protected var startHeight:Number; protected var _height:Number; protected var _oldIMEMode:String;// = null protected var startWidth:Number; public var focusTarget:IFocusManagerComponent; protected var errorCaught:Boolean;// = false protected var uiFocusRect:DisplayObject; protected var _width:Number; public var version:String;// = "3.0.0.15" protected var isFocused:Boolean;// = false protected var callLaterMethods:Dictionary; private var _focusEnabled:Boolean;// = true private var tempText:TextField; protected var invalidateFlag:Boolean;// = false protected var _inspector:Boolean;// = false protected var sharedStyles:Object; protected var invalidHash:Object; protected var isLivePreview:Boolean;// = false protected var _imeMode:String;// = null protected var instanceStyles:Object; protected var _x:Number; protected var _y:Number; public static var inCallLaterPhase:Boolean = false; private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)}; public static var createAccessibilityImplementation:Function; private static var focusManagers:Dictionary = new Dictionary(false); public function UIComponent(){ version = "3.0.0.15"; isLivePreview = false; invalidateFlag = false; _enabled = true; isFocused = false; _focusEnabled = true; _mouseFocusEnabled = true; _imeMode = null; _oldIMEMode = null; errorCaught = false; _inspector = false; super(); instanceStyles = {}; sharedStyles = {}; invalidHash = {}; callLaterMethods = new Dictionary(); StyleManager.registerInstance(this); configUI(); invalidate(InvalidationType.ALL); tabEnabled = (this is IFocusManagerComponent); focusRect = false; if (tabEnabled){ addEventListener(FocusEvent.FOCUS_IN, focusInHandler); addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler); addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); addEventListener(KeyboardEvent.KEY_UP, keyUpHandler); }; initializeFocusManager(); addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true); } public function drawFocus(_arg1:Boolean):void{ var _local2:Number; isFocused = _arg1; if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){ removeChild(uiFocusRect); uiFocusRect = null; }; if (_arg1){ uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite); if (uiFocusRect == null){ return; }; _local2 = Number(getStyleValue("focusRectPadding")); uiFocusRect.x = -(_local2); uiFocusRect.y = -(_local2); uiFocusRect.width = (width + (_local2 * 2)); uiFocusRect.height = (height + (_local2 * 2)); addChildAt(uiFocusRect, 0); }; } private function callLaterDispatcher(_arg1:Event):void{ var _local2:Dictionary; var _local3:Object; if (_arg1.type == Event.ADDED_TO_STAGE){ removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher); stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); stage.invalidate(); return; }; _arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher); if (stage == null){ addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); return; }; inCallLaterPhase = true; _local2 = callLaterMethods; for (_local3 in _local2) { _local3(); delete _local2[_local3]; }; inCallLaterPhase = false; } private function addedHandler(_arg1:Event):void{ removeEventListener("addedToStage", addedHandler); initializeFocusManager(); } protected function getStyleValue(_arg1:String):Object{ return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]); } protected function isOurFocus(_arg1:DisplayObject):Boolean{ return ((_arg1 == this)); } override public function get scaleX():Number{ return ((width / startWidth)); } override public function get scaleY():Number{ return ((height / startHeight)); } override public function set height(_arg1:Number):void{ if (_height == _arg1){ return; }; setSize(width, _arg1); } protected function keyDownHandler(_arg1:KeyboardEvent):void{ } protected function focusInHandler(_arg1:FocusEvent):void{ var _local2:IFocusManager; if (isOurFocus((_arg1.target as DisplayObject))){ _local2 = focusManager; if (((_local2) && (_local2.showFocusIndicator))){ drawFocus(true); isFocused = true; }; }; } public function setStyle(_arg1:String, _arg2:Object):void{ if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; instanceStyles[_arg1] = _arg2; invalidate(InvalidationType.STYLES); } override public function get visible():Boolean{ return (super.visible); } public function get componentInspectorSetting():Boolean{ return (_inspector); } override public function get x():Number{ return ((isNaN(_x)) ? super.x : _x); } override public function get y():Number{ return ((isNaN(_y)) ? super.y : _y); } protected function setIMEMode(_arg1:Boolean){ var enabled = _arg1; if (_imeMode != null){ if (enabled){ IME.enabled = true; _oldIMEMode = IME.conversionMode; try { if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){ IME.conversionMode = _imeMode; }; errorCaught = false; } catch(e:Error) { errorCaught = true; throw (new Error(("IME mode not supported: " + _imeMode))); }; } else { if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){ IME.conversionMode = _oldIMEMode; }; IME.enabled = false; }; }; } public function set enabled(_arg1:Boolean):void{ if (_arg1 == _enabled){ return; }; _enabled = _arg1; invalidate(InvalidationType.STATE); } public function setSharedStyle(_arg1:String, _arg2:Object):void{ if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; sharedStyles[_arg1] = _arg2; if (instanceStyles[_arg1] == null){ invalidate(InvalidationType.STYLES); }; } protected function keyUpHandler(_arg1:KeyboardEvent):void{ } public function set focusEnabled(_arg1:Boolean):void{ _focusEnabled = _arg1; } override public function set scaleX(_arg1:Number):void{ setSize((startWidth * _arg1), height); } public function get mouseFocusEnabled():Boolean{ return (_mouseFocusEnabled); } override public function set scaleY(_arg1:Number):void{ setSize(width, (startHeight * _arg1)); } protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{ var classDef:Object; var skin = _arg1; classDef = null; if ((skin is Class)){ return ((new (skin) as DisplayObject)); }; if ((skin is DisplayObject)){ (skin as DisplayObject).x = 0; (skin as DisplayObject).y = 0; return ((skin as DisplayObject)); }; try { classDef = getDefinitionByName(skin.toString()); } catch(e:Error) { try { classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object); } catch(e:Error) { }; }; if (classDef == null){ return (null); }; return ((new (classDef) as DisplayObject)); } protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{ var _local3:String; for (_local3 in _arg2) { _arg1.setStyle(_local3, getStyleValue(_arg2[_local3])); }; } protected function beforeComponentParameters():void{ } protected function callLater(_arg1:Function):void{ if (inCallLaterPhase){ return; }; callLaterMethods[_arg1] = true; if (stage != null){ stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); stage.invalidate(); } else { addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); }; } protected function createFocusManager():void{ if (focusManagers[stage] == null){ focusManagers[stage] = new FocusManager(stage); }; } override public function set visible(_arg1:Boolean):void{ var _local2:String; if (super.visible == _arg1){ return; }; super.visible = _arg1; _local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE; dispatchEvent(new ComponentEvent(_local2, true)); } protected function hookAccessibility(_arg1:Event):void{ removeEventListener(Event.ENTER_FRAME, hookAccessibility); initializeAccessibility(); } public function set componentInspectorSetting(_arg1:Boolean):void{ _inspector = _arg1; if (_inspector){ beforeComponentParameters(); } else { afterComponentParameters(); }; } override public function set x(_arg1:Number):void{ move(_arg1, _y); } public function drawNow():void{ draw(); } override public function set y(_arg1:Number):void{ move(_x, _arg1); } protected function checkLivePreview():Boolean{ var className:String; if (parent == null){ return (false); }; try { className = getQualifiedClassName(parent); } catch(e:Error) { }; return ((className == "fl.livepreview::LivePreviewParent")); } protected function focusOutHandler(_arg1:FocusEvent):void{ if (isOurFocus((_arg1.target as DisplayObject))){ drawFocus(false); isFocused = false; }; } public function set mouseFocusEnabled(_arg1:Boolean):void{ _mouseFocusEnabled = _arg1; } public function getFocus():InteractiveObject{ if (stage){ return (stage.focus); }; return (null); } protected function validate():void{ invalidHash = {}; } override public function get height():Number{ return (_height); } public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{ invalidHash[_arg1] = true; if (_arg2){ this.callLater(draw); }; } public function get enabled():Boolean{ return (_enabled); } protected function getScaleX():Number{ return (super.scaleX); } protected function getScaleY():Number{ return (super.scaleY); } public function get focusEnabled():Boolean{ return (_focusEnabled); } protected function afterComponentParameters():void{ } protected function draw():void{ if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){ if (((isFocused) && (focusManager.showFocusIndicator))){ drawFocus(true); }; }; validate(); } protected function configUI():void{ var _local1:Number; var _local2:Number; var _local3:Number; isLivePreview = checkLivePreview(); _local1 = rotation; rotation = 0; _local2 = super.width; _local3 = super.height; var _local4 = 1; super.scaleY = _local4; super.scaleX = _local4; setSize(_local2, _local3); move(super.x, super.y); rotation = _local1; startWidth = _local2; startHeight = _local3; if (numChildren > 0){ removeChildAt(0); }; } protected function setScaleX(_arg1:Number):void{ super.scaleX = _arg1; } protected function setScaleY(_arg1:Number):void{ super.scaleY = _arg1; } private function initializeFocusManager():void{ if (stage == null){ addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true); } else { createFocusManager(); }; } public function set focusManager(_arg1:IFocusManager):void{ UIComponent.focusManagers[this] = _arg1; } public function clearStyle(_arg1:String):void{ setStyle(_arg1, null); } protected function isInvalid(_arg1:String, ... _args):Boolean{ if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){ return (true); }; while (_args.length > 0) { if (invalidHash[_args.pop()]){ return (true); }; }; return (false); } public function setSize(_arg1:Number, _arg2:Number):void{ _width = _arg1; _height = _arg2; invalidate(InvalidationType.SIZE); dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false)); } override public function set width(_arg1:Number):void{ if (_width == _arg1){ return; }; setSize(_arg1, height); } public function setFocus():void{ if (stage){ stage.focus = this; }; } protected function initializeAccessibility():void{ if (UIComponent.createAccessibilityImplementation != null){ UIComponent.createAccessibilityImplementation(this); }; } public function get focusManager():IFocusManager{ var _local1:DisplayObject; _local1 = this; while (_local1) { if (UIComponent.focusManagers[_local1] != null){ return (IFocusManager(UIComponent.focusManagers[_local1])); }; _local1 = _local1.parent; }; return (null); } override public function get width():Number{ return (_width); } public function move(_arg1:Number, _arg2:Number):void{ _x = _arg1; _y = _arg2; super.x = Math.round(_arg1); super.y = Math.round(_arg2); dispatchEvent(new ComponentEvent(ComponentEvent.MOVE)); } public function validateNow():void{ invalidate(InvalidationType.ALL, false); draw(); } public function getStyle(_arg1:String):Object{ return (instanceStyles[_arg1]); } public static function getStyleDefinition():Object{ return (defaultStyles); } public static function mergeStyles(... _args):Object{ var _local2:Object; var _local3:uint; var _local4:uint; var _local5:Object; var _local6:String; _local2 = {}; _local3 = _args.length; _local4 = 0; while (_local4 < _local3) { _local5 = _args[_local4]; for (_local6 in _local5) { if (_local2[_local6] != null){ } else { _local2[_local6] = _args[_local4][_local6]; }; }; _local4++; }; return (_local2); } } }//package fl.core
Section 67
//ComponentEvent (fl.events.ComponentEvent) package fl.events { import flash.events.*; public class ComponentEvent extends Event { public static const HIDE:String = "hide"; public static const BUTTON_DOWN:String = "buttonDown"; public static const MOVE:String = "move"; public static const RESIZE:String = "resize"; public static const ENTER:String = "enter"; public static const LABEL_CHANGE:String = "labelChange"; public static const SHOW:String = "show"; public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } override public function toString():String{ return (formatToString("ComponentEvent", "type", "bubbles", "cancelable")); } override public function clone():Event{ return (new ComponentEvent(type, bubbles, cancelable)); } } }//package fl.events
Section 68
//InteractionInputType (fl.events.InteractionInputType) package fl.events { public class InteractionInputType { public static const MOUSE:String = "mouse"; public static const KEYBOARD:String = "keyboard"; } }//package fl.events
Section 69
//SliderEvent (fl.events.SliderEvent) package fl.events { import flash.events.*; public class SliderEvent extends Event { protected var _triggerEvent:String; protected var _keyCode:Number; protected var _value:Number; protected var _clickTarget:String; public static const CHANGE:String = "change"; public static const THUMB_PRESS:String = "thumbPress"; public static const THUMB_DRAG:String = "thumbDrag"; public static const THUMB_RELEASE:String = "thumbRelease"; public function SliderEvent(_arg1:String, _arg2:Number, _arg3:String, _arg4:String, _arg5:int=0){ _value = _arg2; _keyCode = _arg5; _triggerEvent = _arg4; _clickTarget = _arg3; super(_arg1); } public function get clickTarget():String{ return (_clickTarget); } override public function clone():Event{ return (new SliderEvent(type, _value, _clickTarget, _triggerEvent, _keyCode)); } override public function toString():String{ return (formatToString("SliderEvent", "type", "value", "bubbles", "cancelable", "keyCode", "triggerEvent", "clickTarget")); } public function get triggerEvent():String{ return (_triggerEvent); } public function get value():Number{ return (_value); } public function get keyCode():Number{ return (_keyCode); } } }//package fl.events
Section 70
//SliderEventClickTarget (fl.events.SliderEventClickTarget) package fl.events { public class SliderEventClickTarget { public static const TRACK:String = "track"; public static const THUMB:String = "thumb"; } }//package fl.events
Section 71
//FocusManager (fl.managers.FocusManager) package fl.managers { import flash.events.*; import fl.controls.*; import flash.display.*; import flash.text.*; import fl.core.*; import flash.utils.*; import flash.ui.*; public class FocusManager implements IFocusManager { private var focusableObjects:Dictionary; private var _showFocusIndicator:Boolean;// = true private var defButton:Button; private var focusableCandidates:Array; private var _form:DisplayObjectContainer; private var _defaultButtonEnabled:Boolean;// = true private var activated:Boolean;// = false private var _defaultButton:Button; private var calculateCandidates:Boolean;// = true private var lastFocus:InteractiveObject; private var lastAction:String; public function FocusManager(_arg1:DisplayObjectContainer){ activated = false; calculateCandidates = true; _showFocusIndicator = true; _defaultButtonEnabled = true; super(); focusableObjects = new Dictionary(true); if (_arg1 != null){ _form = _arg1; addFocusables(DisplayObject(_arg1)); _arg1.addEventListener(Event.ADDED, addedHandler); _arg1.addEventListener(Event.REMOVED, removedHandler); activate(); }; } public function get showFocusIndicator():Boolean{ return (_showFocusIndicator); } private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{ var _local5:int; var _local6:int; var _local7:DisplayObject; var _local8:IFocusManagerGroup; var _local9:int; var _local10:DisplayObject; var _local11:IFocusManagerGroup; _local5 = focusableCandidates.length; _local6 = _arg1; while (true) { if (_arg2){ _arg1--; } else { _arg1++; }; if (_arg3){ if (((_arg2) && ((_arg1 < 0)))){ break; }; if (((!(_arg2)) && ((_arg1 == _local5)))){ break; }; } else { _arg1 = ((_arg1 + _local5) % _local5); if (_local6 == _arg1){ break; }; }; if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){ _local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1])); if ((_local7 is IFocusManagerGroup)){ _local8 = IFocusManagerGroup(_local7); _local9 = 0; while (_local9 < focusableCandidates.length) { _local10 = focusableCandidates[_local9]; if ((_local10 is IFocusManagerGroup)){ _local11 = IFocusManagerGroup(_local10); if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){ _arg1 = _local9; break; }; }; _local9++; }; }; return (_arg1); }; }; return (_arg1); } public function set form(_arg1:DisplayObjectContainer):void{ _form = _arg1; } private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{ var focusable:IFocusManagerComponent; var io:InteractiveObject; var doc:DisplayObjectContainer; var i:int; var child:DisplayObject; var o = _arg1; var skipTopLevel = _arg2; if (!skipTopLevel){ if ((o is IFocusManagerComponent)){ focusable = IFocusManagerComponent(o); if (focusable.focusEnabled){ if (((focusable.tabEnabled) && (isTabVisible(o)))){ focusableObjects[o] = true; calculateCandidates = true; }; o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); }; } else { if ((o is InteractiveObject)){ io = (o as InteractiveObject); if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){ focusableObjects[io] = true; calculateCandidates = true; }; io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); }; }; }; if ((o is DisplayObjectContainer)){ doc = DisplayObjectContainer(o); o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler); if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){ i = 0; while (i < doc.numChildren) { try { child = doc.getChildAt(i); if (child != null){ addFocusables(doc.getChildAt(i)); }; } catch(error:SecurityError) { }; i = (i + 1); }; }; }; } private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{ return (_arg1.getChildIndex(_arg2)); } private function mouseFocusChangeHandler(_arg1:FocusEvent):void{ if ((_arg1.relatedObject is TextField)){ return; }; _arg1.preventDefault(); } private function focusOutHandler(_arg1:FocusEvent):void{ var _local2:InteractiveObject; _local2 = (_arg1.target as InteractiveObject); } private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{ var _local3:IFocusManagerGroup; if (!isEnabledAndVisible(_arg1)){ return (false); }; if ((_arg1 is IFocusManagerGroup)){ _local3 = IFocusManagerGroup(_arg1); if (_arg2 == _local3.groupName){ return (false); }; }; return (true); } public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{ var _local2:InteractiveObject; _local2 = _arg1; while (_arg1) { if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){ return (_arg1); }; _arg1 = _arg1.parent; }; return (_local2); } private function sortFocusableObjectsTabIndex():void{ var _local1:Object; var _local2:InteractiveObject; focusableCandidates = []; for (_local1 in focusableObjects) { _local2 = InteractiveObject(_local1); if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){ focusableCandidates.push(_local2); }; }; focusableCandidates.sort(sortByTabIndex); } private function removeFocusables(_arg1:DisplayObject):void{ var _local2:Object; var _local3:DisplayObject; if ((_arg1 is DisplayObjectContainer)){ _arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler); _arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); for (_local2 in focusableObjects) { _local3 = DisplayObject(_local2); if (DisplayObjectContainer(_arg1).contains(_local3)){ if (_local3 == lastFocus){ lastFocus = null; }; _local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); delete focusableObjects[_local2]; calculateCandidates = true; }; }; }; } private function addedHandler(_arg1:Event):void{ var _local2:DisplayObject; _local2 = DisplayObject(_arg1.target); if (_local2.stage){ addFocusables(DisplayObject(_arg1.target)); }; } private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{ while (_arg1 != InteractiveObject(form)) { if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){ return (_arg1); }; _arg1 = _arg1.parent; if (_arg1 == null){ break; }; }; return (null); } private function tabChildrenChangeHandler(_arg1:Event):void{ var _local2:DisplayObjectContainer; if (_arg1.target != _arg1.currentTarget){ return; }; calculateCandidates = true; _local2 = DisplayObjectContainer(_arg1.target); if (_local2.tabChildren){ addFocusables(_local2, true); } else { removeFocusables(_local2); }; } public function sendDefaultButtonEvent():void{ defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); } public function getFocus():InteractiveObject{ var _local1:InteractiveObject; _local1 = form.stage.focus; return (findFocusManagerComponent(_local1)); } private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{ var _local2:DisplayObjectContainer; var _local3:TextField; var _local4:SimpleButton; _local2 = DisplayObject(form).parent; while (_arg1 != _local2) { if ((_arg1 is UIComponent)){ if (!UIComponent(_arg1).enabled){ return (false); }; } else { if ((_arg1 is TextField)){ _local3 = TextField(_arg1); if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){ return (false); }; } else { if ((_arg1 is SimpleButton)){ _local4 = SimpleButton(_arg1); if (!_local4.enabled){ return (false); }; }; }; }; if (!_arg1.visible){ return (false); }; _arg1 = _arg1.parent; }; return (true); } public function set defaultButton(_arg1:Button):void{ var _local2:Button; _local2 = (_arg1) ? Button(_arg1) : null; if (_local2 != _defaultButton){ if (_defaultButton){ _defaultButton.emphasized = false; }; if (defButton){ defButton.emphasized = false; }; _defaultButton = _local2; defButton = _local2; if (_local2){ _local2.emphasized = true; }; }; } private function deactivateHandler(_arg1:Event):void{ var _local2:InteractiveObject; _local2 = InteractiveObject(_arg1.target); } public function setFocus(_arg1:InteractiveObject):void{ if ((_arg1 is IFocusManagerComponent)){ IFocusManagerComponent(_arg1).setFocus(); } else { form.stage.focus = _arg1; }; } private function setFocusToNextObject(_arg1:FocusEvent):void{ var _local2:InteractiveObject; if (!hasFocusableObjects()){ return; }; _local2 = getNextFocusManagerComponent(_arg1.shiftKey); if (_local2){ setFocus(_local2); }; } private function hasFocusableObjects():Boolean{ var _local1:Object; for (_local1 in focusableObjects) { return (true); }; return (false); } private function tabIndexChangeHandler(_arg1:Event):void{ calculateCandidates = true; } private function sortFocusableObjects():void{ var _local1:Object; var _local2:InteractiveObject; focusableCandidates = []; for (_local1 in focusableObjects) { _local2 = InteractiveObject(_local1); if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){ sortFocusableObjectsTabIndex(); return; }; focusableCandidates.push(_local2); }; focusableCandidates.sort(sortByDepth); } private function keyFocusChangeHandler(_arg1:FocusEvent):void{ showFocusIndicator = true; if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){ setFocusToNextObject(_arg1); _arg1.preventDefault(); }; } private function getIndexOfFocusedObject(_arg1:DisplayObject):int{ var _local2:int; var _local3:int; _local2 = focusableCandidates.length; _local3 = 0; _local3 = 0; while (_local3 < _local2) { if (focusableCandidates[_local3] == _arg1){ return (_local3); }; _local3++; }; return (-1); } public function hideFocus():void{ } private function removedHandler(_arg1:Event):void{ var _local2:int; var _local3:DisplayObject; var _local4:InteractiveObject; _local3 = DisplayObject(_arg1.target); if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){ if (_local3 == lastFocus){ IFocusManagerComponent(lastFocus).drawFocus(false); lastFocus = null; }; _local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); delete focusableObjects[_local3]; calculateCandidates = true; } else { if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){ _local4 = (_local3 as InteractiveObject); if (_local4){ if (_local4 == lastFocus){ lastFocus = null; }; delete focusableObjects[_local4]; calculateCandidates = true; }; _local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); }; }; removeFocusables(_local3); } private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{ var _local3:String; var _local4:String; var _local5:int; var _local6:String; var _local7:String; var _local8:String; var _local9:DisplayObject; var _local10:DisplayObject; _local3 = ""; _local4 = ""; _local8 = "0000"; _local9 = DisplayObject(_arg1); _local10 = DisplayObject(_arg2); while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) { _local5 = getChildIndex(_local9.parent, _local9); _local6 = _local5.toString(16); if (_local6.length < 4){ _local7 = (_local8.substring(0, (4 - _local6.length)) + _local6); }; _local3 = (_local7 + _local3); _local9 = _local9.parent; }; while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) { _local5 = getChildIndex(_local10.parent, _local10); _local6 = _local5.toString(16); if (_local6.length < 4){ _local7 = (_local8.substring(0, (4 - _local6.length)) + _local6); }; _local4 = (_local7 + _local4); _local10 = _local10.parent; }; return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0); } public function get defaultButton():Button{ return (_defaultButton); } private function activateHandler(_arg1:Event):void{ var _local2:InteractiveObject; _local2 = InteractiveObject(_arg1.target); if (lastFocus){ if ((lastFocus is IFocusManagerComponent)){ IFocusManagerComponent(lastFocus).setFocus(); } else { form.stage.focus = lastFocus; }; }; lastAction = "ACTIVATE"; } public function showFocus():void{ } public function set defaultButtonEnabled(_arg1:Boolean):void{ _defaultButtonEnabled = _arg1; } public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{ var _local2:DisplayObject; var _local3:String; var _local4:int; var _local5:Boolean; var _local6:int; var _local7:int; var _local8:IFocusManagerGroup; if (!hasFocusableObjects()){ return (null); }; if (calculateCandidates){ sortFocusableObjects(); calculateCandidates = false; }; _local2 = form.stage.focus; _local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2))); _local3 = ""; if ((_local2 is IFocusManagerGroup)){ _local8 = IFocusManagerGroup(_local2); _local3 = _local8.groupName; }; _local4 = getIndexOfFocusedObject(_local2); _local5 = false; _local6 = _local4; if (_local4 == -1){ if (_arg1){ _local4 = focusableCandidates.length; }; _local5 = true; }; _local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3); return (findFocusManagerComponent(focusableCandidates[_local7])); } private function mouseDownHandler(_arg1:MouseEvent):void{ var _local2:InteractiveObject; if (_arg1.isDefaultPrevented()){ return; }; _local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target)); if (!_local2){ return; }; showFocusIndicator = false; if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){ setFocus(_local2); }; lastAction = "MOUSEDOWN"; } private function isTabVisible(_arg1:DisplayObject):Boolean{ var _local2:DisplayObjectContainer; _local2 = _arg1.parent; while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) { if (!_local2.tabChildren){ return (false); }; _local2 = _local2.parent; }; return (true); } public function get nextTabIndex():int{ return (0); } private function keyDownHandler(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.TAB){ lastAction = "KEY"; if (calculateCandidates){ sortFocusableObjects(); calculateCandidates = false; }; }; if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){ sendDefaultButtonEvent(); }; } private function focusInHandler(_arg1:FocusEvent):void{ var _local2:InteractiveObject; var _local3:Button; _local2 = InteractiveObject(_arg1.target); if (form.contains(_local2)){ lastFocus = findFocusManagerComponent(InteractiveObject(_local2)); if ((lastFocus is Button)){ _local3 = Button(lastFocus); if (defButton){ defButton.emphasized = false; defButton = _local3; _local3.emphasized = true; }; } else { if (((defButton) && (!((defButton == _defaultButton))))){ defButton.emphasized = false; defButton = _defaultButton; _defaultButton.emphasized = true; }; }; }; } private function tabEnabledChangeHandler(_arg1:Event):void{ var _local2:InteractiveObject; var _local3:Boolean; calculateCandidates = true; _local2 = InteractiveObject(_arg1.target); _local3 = (focusableObjects[_local2] == true); if (_local2.tabEnabled){ if (((!(_local3)) && (isTabVisible(_local2)))){ if (!(_local2 is IFocusManagerComponent)){ _local2.focusRect = false; }; focusableObjects[_local2] = true; }; } else { if (_local3){ delete focusableObjects[_local2]; }; }; } public function set showFocusIndicator(_arg1:Boolean):void{ _showFocusIndicator = _arg1; } public function get form():DisplayObjectContainer{ return (_form); } private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{ return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2)); } public function activate():void{ if (activated){ return; }; form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true); form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true); form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true); form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true); form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true); form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true); form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true); activated = true; if (lastFocus){ setFocus(lastFocus); }; } public function deactivate():void{ form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler); form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler); form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true); form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true); form.stage.removeEventListener(Event.ACTIVATE, activateHandler); form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler); form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true); activated = false; } public function get defaultButtonEnabled():Boolean{ return (_defaultButtonEnabled); } } }//package fl.managers
Section 72
//IFocusManager (fl.managers.IFocusManager) package fl.managers { import fl.controls.*; import flash.display.*; public interface IFocusManager { function getFocus():InteractiveObject; function deactivate():void; function set defaultButton(_arg1:Button):void; function set showFocusIndicator(_arg1:Boolean):void; function get defaultButtonEnabled():Boolean; function get nextTabIndex():int; function get defaultButton():Button; function get showFocusIndicator():Boolean; function setFocus(_arg1:InteractiveObject):void; function activate():void; function showFocus():void; function set defaultButtonEnabled(_arg1:Boolean):void; function hideFocus():void; function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject; function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject; } }//package fl.managers
Section 73
//IFocusManagerComponent (fl.managers.IFocusManagerComponent) package fl.managers { public interface IFocusManagerComponent { function set focusEnabled(_arg1:Boolean):void; function drawFocus(_arg1:Boolean):void; function setFocus():void; function get focusEnabled():Boolean; function get tabEnabled():Boolean; function get tabIndex():int; function get mouseFocusEnabled():Boolean; } }//package fl.managers
Section 74
//IFocusManagerGroup (fl.managers.IFocusManagerGroup) package fl.managers { public interface IFocusManagerGroup { function set groupName(_arg1:String):void; function set selected(_arg1:Boolean):void; function get groupName():String; function get selected():Boolean; } }//package fl.managers
Section 75
//StyleManager (fl.managers.StyleManager) package fl.managers { import flash.text.*; import fl.core.*; import flash.utils.*; public class StyleManager { private var globalStyles:Object; private var classToDefaultStylesDict:Dictionary; private var styleToClassesHash:Object; private var classToStylesDict:Dictionary; private var classToInstancesDict:Dictionary; private static var _instance:StyleManager; public function StyleManager(){ styleToClassesHash = {}; classToInstancesDict = new Dictionary(true); classToStylesDict = new Dictionary(true); classToDefaultStylesDict = new Dictionary(true); globalStyles = UIComponent.getStyleDefinition(); } public static function clearComponentStyle(_arg1:Object, _arg2:String):void{ var _local3:Class; var _local4:Object; _local3 = getClassDef(_arg1); _local4 = getInstance().classToStylesDict[_local3]; if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){ delete _local4[_arg2]; invalidateComponentStyle(_local3, _arg2); }; } private static function getClassDef(_arg1:Object):Class{ var component = _arg1; if ((component is Class)){ return ((component as Class)); }; try { return ((getDefinitionByName(getQualifiedClassName(component)) as Class)); } catch(e:Error) { if ((component is UIComponent)){ try { return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class)); } catch(e:Error) { }; }; }; return (null); } public static function clearStyle(_arg1:String):void{ setStyle(_arg1, null); } public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{ var _local4:Class; var _local5:Object; _local4 = getClassDef(_arg1); _local5 = getInstance().classToStylesDict[_local4]; if (_local5 == null){ _local5 = (getInstance().classToStylesDict[_local4] = {}); }; if (_local5 == _arg3){ return; }; _local5[_arg2] = _arg3; invalidateComponentStyle(_local4, _arg2); } private static function setSharedStyles(_arg1:UIComponent):void{ var _local2:StyleManager; var _local3:Class; var _local4:Object; var _local5:String; _local2 = getInstance(); _local3 = getClassDef(_arg1); _local4 = _local2.classToDefaultStylesDict[_local3]; for (_local5 in _local4) { _arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5)); }; } public static function getComponentStyle(_arg1:Object, _arg2:String):Object{ var _local3:Class; var _local4:Object; _local3 = getClassDef(_arg1); _local4 = getInstance().classToStylesDict[_local3]; return (((_local4)==null) ? null : _local4[_arg2]); } private static function getInstance(){ if (_instance == null){ _instance = new (StyleManager); }; return (_instance); } private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{ var _local3:Dictionary; var _local4:Object; var _local5:UIComponent; _local3 = getInstance().classToInstancesDict[_arg1]; if (_local3 == null){ return; }; for (_local4 in _local3) { _local5 = (_local4 as UIComponent); if (_local5 == null){ } else { _local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2)); }; }; } private static function invalidateStyle(_arg1:String):void{ var _local2:Dictionary; var _local3:Object; _local2 = getInstance().styleToClassesHash[_arg1]; if (_local2 == null){ return; }; for (_local3 in _local2) { invalidateComponentStyle(Class(_local3), _arg1); }; } public static function registerInstance(_arg1:UIComponent):void{ var inst:StyleManager; var classDef:Class; var target:Class; var defaultStyles:Object; var styleToClasses:Object; var n:String; var instance = _arg1; inst = getInstance(); classDef = getClassDef(instance); if (classDef == null){ return; }; if (inst.classToInstancesDict[classDef] == null){ inst.classToInstancesDict[classDef] = new Dictionary(true); target = classDef; while (defaultStyles == null) { if (target["getStyleDefinition"] != null){ defaultStyles = target["getStyleDefinition"](); break; }; try { target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class); } catch(err:Error) { try { target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class); } catch(e:Error) { defaultStyles = UIComponent.getStyleDefinition(); break; }; }; }; styleToClasses = inst.styleToClassesHash; for (n in defaultStyles) { if (styleToClasses[n] == null){ styleToClasses[n] = new Dictionary(true); }; styleToClasses[n][classDef] = true; }; inst.classToDefaultStylesDict[classDef] = defaultStyles; inst.classToStylesDict[classDef] = {}; }; inst.classToInstancesDict[classDef][instance] = true; setSharedStyles(instance); } public static function getStyle(_arg1:String):Object{ return (getInstance().globalStyles[_arg1]); } private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{ var _local3:Class; var _local4:StyleManager; var _local5:Object; _local3 = getClassDef(_arg1); _local4 = getInstance(); _local5 = _local4.classToStylesDict[_local3][_arg2]; if (_local5 != null){ return (_local5); }; _local5 = _local4.globalStyles[_arg2]; if (_local5 != null){ return (_local5); }; return (_local4.classToDefaultStylesDict[_local3][_arg2]); } public static function setStyle(_arg1:String, _arg2:Object):void{ var _local3:Object; _local3 = getInstance().globalStyles; if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; _local3[_arg1] = _arg2; invalidateStyle(_arg1); } } }//package fl.managers
Section 76
//MochiScores (mochi.MochiScores) package mochi { import flash.display.*; import flash.text.*; public class MochiScores { private static var boardID:String; public static var onErrorHandler:Object; public static var onCloseHandler:Object; public static function showLeaderboard(_arg1:Object=null):void{ var options = _arg1; if (options != null){ if (options.clip != null){ if ((options.clip is Sprite)){ MochiServices.setContainer(options.clip); }; delete options.clip; } else { MochiServices.setContainer(); }; MochiServices.stayOnTop(); if (options.name != null){ if ((options.name is TextField)){ if (options.name.text.length > 0){ options.name = options.name.text; }; }; }; if (options.score != null){ if ((options.score is TextField)){ if (options.score.text.length > 0){ options.score = options.score.text; }; }; }; if (options.onDisplay != null){ options.onDisplay(); } else { if (MochiServices.clip != null){ if ((MochiServices.clip is MovieClip)){ MochiServices.clip.stop(); //unresolved jump }; }; }; } else { options = {}; if ((MochiServices.clip is MovieClip)){ MochiServices.clip.stop(); //unresolved jump }; }; if (options.onClose != null){ onCloseHandler = options.onClose; } else { onCloseHandler = function ():void{ if ((MochiServices.clip is MovieClip)){ MochiServices.clip.play(); //unresolved jump }; }; }; if (options.onError != null){ onErrorHandler = options.onError; } else { onErrorHandler = null; }; if (options.boardID == null){ if (MochiScores.boardID != null){ options.boardID = MochiScores.boardID; }; }; MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose); } public static function closeLeaderboard():void{ MochiServices.send("scores_closeLeaderboard"); } public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{ MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2); } public static function requestList(_arg1:Object, _arg2:Object=null):void{ MochiServices.send("scores_requestList", null, _arg1, _arg2); } public static function scoresArrayToObjects(_arg1:Object):Object{ var _local2:Object; var _local3:Number; var _local4:Number; var _local5:Object; var _local6:Object; var _local7:String; var _local8:String; _local2 = {}; for (_local7 in _arg1) { if (typeof(_arg1[_local7]) == "object"){ if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){ _local2[_local7] = []; _local5 = _arg1[_local7]; _local4 = 0; while (_local4 < _local5.rows.length) { _local6 = {}; _local3 = 0; while (_local3 < _local5.cols.length) { _local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3]; _local3++; }; _local2[_local7].push(_local6); _local4++; }; } else { _local2[_local7] = {}; for (_local8 in _arg1[_local7]) { _local2[_local7][_local8] = _arg1[_local7][_local8]; }; }; } else { _local2[_local7] = _arg1[_local7]; }; }; return (_local2); } public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{ MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4); } public static function onClose(_arg1:Object=null):void{ if (_arg1 != null){ if (_arg1.error != null){ if (_arg1.error == true){ if (onErrorHandler != null){ if (_arg1.errorCode == null){ _arg1.errorCode = "IOError"; }; onErrorHandler(_arg1.errorCode); MochiServices.doClose(); return; }; }; }; }; onCloseHandler(); MochiServices.doClose(); } public static function setBoardID(_arg1:String):void{ MochiScores.boardID = _arg1; MochiServices.send("scores_setBoardID", {boardID:_arg1}); } } }//package mochi
Section 77
//MochiServices (mochi.MochiServices) package mochi { import flash.display.*; import flash.events.*; import flash.net.*; import flash.utils.*; import flash.system.*; public class MochiServices { private static var _container:Object; private static var _connected:Boolean = false; private static var _swfVersion:String; private static var _sendChannel:LocalConnection; private static var _rcvChannelName:String; private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf"; private static var _clip:MovieClip; private static var _loader:Loader; private static var _id:String; private static var _listenChannel:LocalConnection; private static var _timer:Timer; private static var _sendChannelName:String; private static var _startTime:Number; private static var _connecting:Boolean = false; public static var onError:Object; private static var _listenChannelName:String = "__mochiservices"; private static var _rcvChannel:LocalConnection; public static function isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{ if (_connected){ _sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID}); } else { if ((((_clip == null)) || (!(_connecting)))){ onError("NotConnected"); handleError(_arg2, _arg3, _arg4); flush(true); return; }; _clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID}); }; if (_clip != null){ if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){ _clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4}; _clip._nextcallbackID++; }; }; } public static function get connected():Boolean{ return (_connected); } private static function flush(_arg1:Boolean):void{ var _local2:Object; var _local3:Object; if (_clip != null){ if (_clip._queue != null){ while (_clip._queue.length > 0) { _local2 = _clip._queue.shift(); _local3 = null; if (_local2 != null){ if (_local2.callbackID != null){ _local3 = _clip._callbacks[_local2.callbackID]; }; delete _clip._callbacks[_local2.callbackID]; if (((_arg1) && (!((_local3 == null))))){ handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod); }; }; }; }; }; } private static function init(_arg1:String, _arg2:Object):void{ _id = _arg1; if (_arg2 != null){ _container = _arg2; loadCommunicator(_arg1, _container); }; } public static function get childClip():Object{ return (_clip); } public static function get id():String{ return (_id); } public static function stayOnTop():void{ _container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true); if (_clip != null){ _clip.visible = true; }; } public static function getVersion():String{ return ("1.31"); } public static function disconnect():void{ if (((_connected) || (_connecting))){ if (_clip != null){ if (_clip.parent != null){ if ((_clip.parent is Sprite)){ Sprite(_clip.parent).removeChild(_clip); _clip = null; }; }; }; _connecting = (_connected = false); flush(true); try { _listenChannel.close(); _rcvChannel.close(); } catch(error:Error) { }; }; if (_timer != null){ try { _timer.stop(); } catch(error:Error) { }; }; } public static function allowDomains(_arg1:String):String{ var _local2:String; Security.allowDomain("*"); Security.allowInsecureDomain("*"); if (_arg1.indexOf("http://") != -1){ _local2 = _arg1.split("/")[2].split(":")[0]; Security.allowDomain(_local2); Security.allowInsecureDomain(_local2); }; return (_local2); } public static function doClose():void{ _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); if (_clip.parent != null){ Sprite(_clip.parent).removeChild(_clip); }; } public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{ if (_arg1 != null){ if ((_arg1 is Sprite)){ _container = _arg1; }; }; if (_arg2){ if ((_container is Sprite)){ Sprite(_container).addChild(_clip); }; }; } private static function onStatus(_arg1:StatusEvent):void{ switch (_arg1.level){ case "error": _connected = false; _listenChannel.connect(_listenChannelName); break; }; } private static function initComChannels():void{ if (!_connected){ _sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus); _sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"}); _sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()}); _rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus); _clip.onReceive = function (_arg1:Object):void{ var cb:String; var cblst:Object; var method:*; var methodName:String; var obj:Object; var pkg = _arg1; cb = pkg.callbackID; cblst = this.client._callbacks[cb]; if (!cblst){ return; }; method = cblst.callbackMethod; methodName = ""; obj = cblst.callbackObject; if (((obj) && ((typeof(method) == "string")))){ methodName = method; if (obj[method] != null){ method = obj[method]; //unresolved jump }; }; if (method != undefined){ try { method.apply(obj, pkg.args); } catch(error:Error) { }; } else { if (obj != null){ try { obj(pkg.args); } catch(error:Error) { }; }; }; delete this.client._callbacks[cb]; }; _clip.onError = function ():void{ MochiServices.onError("IOError"); }; _rcvChannel.connect(_rcvChannelName); _connecting = false; _connected = true; _listenChannel.close(); while (_clip._queue.length > 0) { _sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift()); }; }; } private static function listen():void{ _listenChannel = new LocalConnection(); _listenChannel.client = _clip; _clip.handshake = function (_arg1:Object):void{ MochiServices.comChannelName = _arg1.newChannel; }; _listenChannel.allowDomain("*", "localhost"); _listenChannel.allowInsecureDomain("*", "localhost"); _listenChannel.connect(_listenChannelName); } private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{ var args = _arg1; var callbackObject = _arg2; var callbackMethod = _arg3; if (args != null){ if (args.onError != null){ args.onError.apply(null, ["NotConnected"]); }; }; if (callbackMethod != null){ args = {}; args.error = true; args.errorCode = "NotConnected"; if (((!((callbackObject == null))) && ((callbackMethod is String)))){ try { var _local5 = callbackObject; _local5[callbackMethod](args); } catch(error:Error) { }; } else { if (callbackMethod != null){ try { callbackMethod.apply(args); } catch(error:Error) { }; }; }; }; } public static function get clip():Object{ return (_container); } public static function set comChannelName(_arg1:String):void{ if (_arg1 != null){ if (_arg1.length > 3){ _sendChannelName = (_arg1 + "_fromgame"); _rcvChannelName = _arg1; initComChannels(); }; }; } private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{ var clipname:String; var f:Function; var req:URLRequest; var id = _arg1; var clip = _arg2; clipname = ("_mochiservices_com_" + id); if (_clip != null){ return (_clip); }; if (!MochiServices.isNetworkAvailable()){ return (null); }; MochiServices.allowDomains(_gatewayURL); _clip = createEmptyMovieClip(clip, clipname, 10336, false); _loader = new Loader(); _timer = new Timer(1000, 0); _startTime = getTimer(); _timer.addEventListener(TimerEvent.TIMER, connectWait); _timer.start(); f = function (_arg1:Object):void{ _clip._mochiad_ctr_failed = true; MochiServices.disconnect(); MochiServices.onError("IOError"); }; _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f); req = new URLRequest(_gatewayURL); _loader.load(req); _clip.addChild(_loader); _clip._mochiservices_com = _loader; _sendChannel = new LocalConnection(); _clip._queue = []; _rcvChannel = new LocalConnection(); _rcvChannel.allowDomain("*", "localhost"); _rcvChannel.allowInsecureDomain("*", "localhost"); _rcvChannel.client = _clip; _clip._nextcallbackID = 0; _clip._callbacks = {}; listen(); return (_clip); } public static function bringToTop(_arg1:Event):void{ var e = _arg1; if (MochiServices.clip != null){ if (MochiServices.childClip != null){ try { if (MochiServices.clip.numChildren > 1){ MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1)); }; } catch(errorObject:Error) { _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); }; }; }; } public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{ var id = _arg1; var clip = _arg2; var onError = _arg3; if ((clip is DisplayObject)){ if (((!(_connected)) && ((_clip == null)))){ _connecting = true; init(id, clip); }; //unresolved jump }; if (onError != null){ MochiServices.onError = onError; } else { if (MochiServices.onError == null){ MochiServices.onError = function (_arg1:String):void{ }; }; }; } public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{ var mc:MovieClip; var parent = _arg1; var name = _arg2; var depth = _arg3; var doAdd = _arg4; mc = new MovieClip(); if (doAdd){ if (((false) && (depth))){ parent.addChildAt(mc, depth); } else { parent.addChild(mc); }; }; try { parent[name] = mc; } catch(e:Error) { throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic.")); }; mc["_name"] = name; return (mc); } public static function connectWait(_arg1:TimerEvent):void{ if ((getTimer() - _startTime) > 10000){ if (!_connected){ _clip._mochiad_ctr_failed = true; MochiServices.disconnect(); MochiServices.onError("IOError"); }; _timer.stop(); }; } } }//package mochi
Section 78
//BibbAssetsMC_20 (sr_fla.BibbAssetsMC_20) package sr_fla { import flash.display.*; public dynamic class BibbAssetsMC_20 extends MovieClip { public function BibbAssetsMC_20(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package sr_fla
Section 79
//GameMessageMC_108 (sr_fla.GameMessageMC_108) package sr_fla { import flash.display.*; import flash.text.*; public dynamic class GameMessageMC_108 extends MovieClip { public var message_txt:TextField; } }//package sr_fla
Section 80
//LOGO_YOUGAME_5 (sr_fla.LOGO_YOUGAME_5) package sr_fla { import flash.display.*; public dynamic class LOGO_YOUGAME_5 extends MovieClip { public function LOGO_YOUGAME_5(){ addFrameScript(0, frame1, 197, frame198); } function frame1(){ } function frame198(){ MovieClip(parent).play(); } } }//package sr_fla
Section 81
//PlanetsBackMC_65 (sr_fla.PlanetsBackMC_65) package sr_fla { import flash.display.*; public dynamic class PlanetsBackMC_65 extends MovieClip { public var rebel12:MovieClip; public var rebel10:MovieClip; public var empire2:MovieClip; public var empire6:MovieClip; public var empire7:MovieClip; public var empire9:MovieClip; public var empire8:MovieClip; public var level1:SimpleButton; public var level2:SimpleButton; public var level4:SimpleButton; public var level6:SimpleButton; public var level7:SimpleButton; public var level3:SimpleButton; public var level5:SimpleButton; public var level8:SimpleButton; public var level9:SimpleButton; public var rebel11:MovieClip; public var empire3:MovieClip; public var rebel1:MovieClip; public var rebel2:MovieClip; public var rebel3:MovieClip; public var rebel6:MovieClip; public var rebel8:MovieClip; public var rebel5:MovieClip; public var level12:SimpleButton; public var empire10:MovieClip; public var empire12:MovieClip; public var rebel4:MovieClip; public var rebel7:MovieClip; public var empire11:MovieClip; public var level10:SimpleButton; public var empire4:MovieClip; public var empire5:MovieClip; public var level11:SimpleButton; public var rebel9:MovieClip; } }//package sr_fla
Section 82
//PlanetsLevelMessageMC_97 (sr_fla.PlanetsLevelMessageMC_97) package sr_fla { import flash.display.*; import flash.text.*; public dynamic class PlanetsLevelMessageMC_97 extends MovieClip { public var msg:TextField; } }//package sr_fla
Section 83
//RebelArmsMC_90 (sr_fla.RebelArmsMC_90) package sr_fla { import flash.display.*; public dynamic class RebelArmsMC_90 extends MovieClip { public function RebelArmsMC_90(){ addFrameScript(0, frame1, 14, frame15); } function frame15(){ gotoAndPlay("glow"); } function frame1(){ stop(); } } }//package sr_fla
Section 84
//SellButton_36 (sr_fla.SellButton_36) package sr_fla { import flash.display.*; import flash.text.*; public dynamic class SellButton_36 extends MovieClip { public var caption:TextField; public function SellButton_36(){ addFrameScript(0, frame1, 1, frame2); } function frame1(){ stop(); } function frame2(){ stop(); } } }//package sr_fla
Section 85
//BombTooltipMC (BombTooltipMC) package { import flash.display.*; import flash.text.*; public dynamic class BombTooltipMC extends MovieClip { public var epicenter:TextField; public var title:TextField; public var crystals:TextField; } }//package
Section 86
//BuildingMC (BuildingMC) package { import flash.display.*; public dynamic class BuildingMC extends MovieClip { } }//package
Section 87
//focusRectSkin (focusRectSkin) package { import flash.display.*; public dynamic class focusRectSkin extends MovieClip { } }//package
Section 88
//GameMessageMotion (GameMessageMotion) package { import flash.display.*; public dynamic class GameMessageMotion extends MovieClip { public var msg:MovieClip; public function GameMessageMotion(){ addFrameScript(54, frame55); } function frame55(){ stop(); visible = false; } } }//package
Section 89
//GameStage (GameStage) package { import flash.display.*; import flash.events.*; import mochi.*; import flash.system.*; import flash.ui.*; public dynamic class GameStage extends MovieClip { public var assets_bibb:MovieClip; public var main_menu:MovieClip; public var loadingMC:MovieClip; public var initialized:Boolean;// = false public static var main_stage = null; public static var main_holder:Sprite = null; public function GameStage():void{ initialized = false; super(); addFrameScript(0, frame1, 11, frame12, 19, frame20); Security.allowDomain("*"); } function frame12(){ MochiAd.showPreGameAd({clip:root, id:"701c9f8f42284a14", res:"800x600"}); } function frame1(){ MochiServices.connect("701c9f8f42284a14", root); stop(); if (initialized){ gotoAndStop(10); } else { root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, update); }; } function frame20(){ try { MochiBot.track(this, "cf36b48a"); } finally { }; this.initTheGame(); stop(); } public function update(_arg1:ProgressEvent):void{ var _local2:Number; _local2 = Math.floor(((_arg1.bytesLoaded * 100) / _arg1.bytesTotal)); if ((loadingMC is MovieClip)){ loadingMC.progress_mc.gotoAndStop(_local2); loadingMC.loaded_txt.text = (("Loaded: " + _local2.toString()) + "%"); }; if (_local2 >= 100){ loadingMC.progress_mc.stop(); loadingMC.progress_mc.visible = false; removeChild(loadingMC); loadingMC = null; play(); }; } public function initTheGame():void{ if (initialized){ return; }; removeChild(assets_bibb); assets_bibb = null; main_stage = this.stage; main_menu.initGame(this); initialized = true; } public function showMainMenu():void{ main_menu.visible = true; } } }//package
Section 90
//Image_artillery_attack (Image_artillery_attack) package { import flash.display.*; public dynamic class Image_artillery_attack extends BitmapData { public function Image_artillery_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 91
//Image_artillery_be (Image_artillery_be) package { import flash.display.*; public dynamic class Image_artillery_be extends BitmapData { public function Image_artillery_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 92
//Image_artillery_body (Image_artillery_body) package { import flash.display.*; public dynamic class Image_artillery_body extends BitmapData { public function Image_artillery_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 93
//Image_artillery_bullet (Image_artillery_bullet) package { import flash.display.*; public dynamic class Image_artillery_bullet extends BitmapData { public function Image_artillery_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 94
//Image_artillery_status_sprite (Image_artillery_status_sprite) package { import flash.display.*; public dynamic class Image_artillery_status_sprite extends BitmapData { public function Image_artillery_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 95
//Image_b_artillery (Image_b_artillery) package { import flash.display.*; public dynamic class Image_b_artillery extends BitmapData { public function Image_b_artillery(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 96
//Image_b_attack (Image_b_attack) package { import flash.display.*; public dynamic class Image_b_attack extends BitmapData { public function Image_b_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 97
//Image_b_cancel (Image_b_cancel) package { import flash.display.*; public dynamic class Image_b_cancel extends BitmapData { public function Image_b_cancel(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 98
//Image_b_cumulative_bomb (Image_b_cumulative_bomb) package { import flash.display.*; public dynamic class Image_b_cumulative_bomb extends BitmapData { public function Image_b_cumulative_bomb(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 99
//Image_b_laser_cannon (Image_b_laser_cannon) package { import flash.display.*; public dynamic class Image_b_laser_cannon extends BitmapData { public function Image_b_laser_cannon(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 100
//Image_b_missile_turret (Image_b_missile_turret) package { import flash.display.*; public dynamic class Image_b_missile_turret extends BitmapData { public function Image_b_missile_turret(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 101
//Image_b_nitro_bomb (Image_b_nitro_bomb) package { import flash.display.*; public dynamic class Image_b_nitro_bomb extends BitmapData { public function Image_b_nitro_bomb(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 102
//Image_b_nuclear_missile (Image_b_nuclear_missile) package { import flash.display.*; public dynamic class Image_b_nuclear_missile extends BitmapData { public function Image_b_nuclear_missile(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 103
//Image_b_plasma_mortar (Image_b_plasma_mortar) package { import flash.display.*; public dynamic class Image_b_plasma_mortar extends BitmapData { public function Image_b_plasma_mortar(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 104
//Image_b_power_station (Image_b_power_station) package { import flash.display.*; public dynamic class Image_b_power_station extends BitmapData { public function Image_b_power_station(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 105
//Image_b_refinery (Image_b_refinery) package { import flash.display.*; public dynamic class Image_b_refinery extends BitmapData { public function Image_b_refinery(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 106
//Image_b_stop (Image_b_stop) package { import flash.display.*; public dynamic class Image_b_stop extends BitmapData { public function Image_b_stop(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 107
//Image_b_stunner (Image_b_stunner) package { import flash.display.*; public dynamic class Image_b_stunner extends BitmapData { public function Image_b_stunner(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 108
//Image_battle_shuttle_attack (Image_battle_shuttle_attack) package { import flash.display.*; public dynamic class Image_battle_shuttle_attack extends BitmapData { public function Image_battle_shuttle_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 109
//Image_battle_shuttle_be (Image_battle_shuttle_be) package { import flash.display.*; public dynamic class Image_battle_shuttle_be extends BitmapData { public function Image_battle_shuttle_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 110
//Image_battle_shuttle_body (Image_battle_shuttle_body) package { import flash.display.*; public dynamic class Image_battle_shuttle_body extends BitmapData { public function Image_battle_shuttle_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 111
//Image_battle_shuttle_bullet (Image_battle_shuttle_bullet) package { import flash.display.*; public dynamic class Image_battle_shuttle_bullet extends BitmapData { public function Image_battle_shuttle_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 112
//Image_battle_shuttle_status_sprite (Image_battle_shuttle_status_sprite) package { import flash.display.*; public dynamic class Image_battle_shuttle_status_sprite extends BitmapData { public function Image_battle_shuttle_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 113
//Image_command_center_body (Image_command_center_body) package { import flash.display.*; public dynamic class Image_command_center_body extends BitmapData { public function Image_command_center_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 114
//Image_command_center_status_sprite (Image_command_center_status_sprite) package { import flash.display.*; public dynamic class Image_command_center_status_sprite extends BitmapData { public function Image_command_center_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 115
//Image_crystals_status (Image_crystals_status) package { import flash.display.*; public dynamic class Image_crystals_status extends BitmapData { public function Image_crystals_status(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 116
//Image_destroyer_attack (Image_destroyer_attack) package { import flash.display.*; public dynamic class Image_destroyer_attack extends BitmapData { public function Image_destroyer_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 117
//Image_destroyer_be (Image_destroyer_be) package { import flash.display.*; public dynamic class Image_destroyer_be extends BitmapData { public function Image_destroyer_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 118
//Image_destroyer_body (Image_destroyer_body) package { import flash.display.*; public dynamic class Image_destroyer_body extends BitmapData { public function Image_destroyer_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 119
//Image_destroyer_bullet (Image_destroyer_bullet) package { import flash.display.*; public dynamic class Image_destroyer_bullet extends BitmapData { public function Image_destroyer_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 120
//Image_destroyer_status_sprite (Image_destroyer_status_sprite) package { import flash.display.*; public dynamic class Image_destroyer_status_sprite extends BitmapData { public function Image_destroyer_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 121
//Image_executor_attack (Image_executor_attack) package { import flash.display.*; public dynamic class Image_executor_attack extends BitmapData { public function Image_executor_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 122
//Image_executor_be (Image_executor_be) package { import flash.display.*; public dynamic class Image_executor_be extends BitmapData { public function Image_executor_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 123
//Image_executor_body (Image_executor_body) package { import flash.display.*; public dynamic class Image_executor_body extends BitmapData { public function Image_executor_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 124
//Image_executor_bullet (Image_executor_bullet) package { import flash.display.*; public dynamic class Image_executor_bullet extends BitmapData { public function Image_executor_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 125
//Image_executor_status_sprite (Image_executor_status_sprite) package { import flash.display.*; public dynamic class Image_executor_status_sprite extends BitmapData { public function Image_executor_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 126
//Image_fighter_t1_attack (Image_fighter_t1_attack) package { import flash.display.*; public dynamic class Image_fighter_t1_attack extends BitmapData { public function Image_fighter_t1_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 127
//Image_fighter_t1_be (Image_fighter_t1_be) package { import flash.display.*; public dynamic class Image_fighter_t1_be extends BitmapData { public function Image_fighter_t1_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 128
//Image_fighter_t1_body (Image_fighter_t1_body) package { import flash.display.*; public dynamic class Image_fighter_t1_body extends BitmapData { public function Image_fighter_t1_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 129
//Image_fighter_t1_bullet (Image_fighter_t1_bullet) package { import flash.display.*; public dynamic class Image_fighter_t1_bullet extends BitmapData { public function Image_fighter_t1_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 130
//Image_fighter_t1_status_sprite (Image_fighter_t1_status_sprite) package { import flash.display.*; public dynamic class Image_fighter_t1_status_sprite extends BitmapData { public function Image_fighter_t1_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 131
//Image_fighter_t2_attack (Image_fighter_t2_attack) package { import flash.display.*; public dynamic class Image_fighter_t2_attack extends BitmapData { public function Image_fighter_t2_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 132
//Image_fighter_t2_be (Image_fighter_t2_be) package { import flash.display.*; public dynamic class Image_fighter_t2_be extends BitmapData { public function Image_fighter_t2_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 133
//Image_fighter_t2_body (Image_fighter_t2_body) package { import flash.display.*; public dynamic class Image_fighter_t2_body extends BitmapData { public function Image_fighter_t2_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 134
//Image_fighter_t2_bullet (Image_fighter_t2_bullet) package { import flash.display.*; public dynamic class Image_fighter_t2_bullet extends BitmapData { public function Image_fighter_t2_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 135
//Image_fighter_t2_status_sprite (Image_fighter_t2_status_sprite) package { import flash.display.*; public dynamic class Image_fighter_t2_status_sprite extends BitmapData { public function Image_fighter_t2_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 136
//Image_fighter_t3_attack (Image_fighter_t3_attack) package { import flash.display.*; public dynamic class Image_fighter_t3_attack extends BitmapData { public function Image_fighter_t3_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 137
//Image_fighter_t3_be (Image_fighter_t3_be) package { import flash.display.*; public dynamic class Image_fighter_t3_be extends BitmapData { public function Image_fighter_t3_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 138
//Image_fighter_t3_body (Image_fighter_t3_body) package { import flash.display.*; public dynamic class Image_fighter_t3_body extends BitmapData { public function Image_fighter_t3_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 139
//Image_fighter_t3_bullet (Image_fighter_t3_bullet) package { import flash.display.*; public dynamic class Image_fighter_t3_bullet extends BitmapData { public function Image_fighter_t3_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 140
//Image_fighter_t3_status_sprite (Image_fighter_t3_status_sprite) package { import flash.display.*; public dynamic class Image_fighter_t3_status_sprite extends BitmapData { public function Image_fighter_t3_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 141
//Image_ground_desert (Image_ground_desert) package { import flash.display.*; public dynamic class Image_ground_desert extends BitmapData { public function Image_ground_desert(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 142
//Image_ground_driedtree (Image_ground_driedtree) package { import flash.display.*; public dynamic class Image_ground_driedtree extends BitmapData { public function Image_ground_driedtree(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 143
//Image_ground_grass (Image_ground_grass) package { import flash.display.*; public dynamic class Image_ground_grass extends BitmapData { public function Image_ground_grass(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 144
//Image_ground_moon (Image_ground_moon) package { import flash.display.*; public dynamic class Image_ground_moon extends BitmapData { public function Image_ground_moon(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 145
//Image_ground_platform (Image_ground_platform) package { import flash.display.*; public dynamic class Image_ground_platform extends BitmapData { public function Image_ground_platform(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 146
//Image_ground_platformtube (Image_ground_platformtube) package { import flash.display.*; public dynamic class Image_ground_platformtube extends BitmapData { public function Image_ground_platformtube(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 147
//Image_ground_stone (Image_ground_stone) package { import flash.display.*; public dynamic class Image_ground_stone extends BitmapData { public function Image_ground_stone(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 148
//Image_ground_tree (Image_ground_tree) package { import flash.display.*; public dynamic class Image_ground_tree extends BitmapData { public function Image_ground_tree(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 149
//Image_ground_tree2 (Image_ground_tree2) package { import flash.display.*; public dynamic class Image_ground_tree2 extends BitmapData { public function Image_ground_tree2(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 150
//Image_ground_wall1 (Image_ground_wall1) package { import flash.display.*; public dynamic class Image_ground_wall1 extends BitmapData { public function Image_ground_wall1(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 151
//Image_ground_wall2 (Image_ground_wall2) package { import flash.display.*; public dynamic class Image_ground_wall2 extends BitmapData { public function Image_ground_wall2(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 152
//Image_gunship_attack (Image_gunship_attack) package { import flash.display.*; public dynamic class Image_gunship_attack extends BitmapData { public function Image_gunship_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 153
//Image_gunship_be (Image_gunship_be) package { import flash.display.*; public dynamic class Image_gunship_be extends BitmapData { public function Image_gunship_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 154
//Image_gunship_body (Image_gunship_body) package { import flash.display.*; public dynamic class Image_gunship_body extends BitmapData { public function Image_gunship_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 155
//Image_gunship_bullet (Image_gunship_bullet) package { import flash.display.*; public dynamic class Image_gunship_bullet extends BitmapData { public function Image_gunship_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 156
//Image_gunship_status_sprite (Image_gunship_status_sprite) package { import flash.display.*; public dynamic class Image_gunship_status_sprite extends BitmapData { public function Image_gunship_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 157
//Image_harvester_body (Image_harvester_body) package { import flash.display.*; public dynamic class Image_harvester_body extends BitmapData { public function Image_harvester_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 158
//Image_harvester_status_sprite (Image_harvester_status_sprite) package { import flash.display.*; public dynamic class Image_harvester_status_sprite extends BitmapData { public function Image_harvester_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 159
//Image_hatch (Image_hatch) package { import flash.display.*; public dynamic class Image_hatch extends BitmapData { public function Image_hatch(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 160
//Image_hostile_order (Image_hostile_order) package { import flash.display.*; public dynamic class Image_hostile_order extends BitmapData { public function Image_hostile_order(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 161
//Image_interceptor_attack (Image_interceptor_attack) package { import flash.display.*; public dynamic class Image_interceptor_attack extends BitmapData { public function Image_interceptor_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 162
//Image_interceptor_be (Image_interceptor_be) package { import flash.display.*; public dynamic class Image_interceptor_be extends BitmapData { public function Image_interceptor_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 163
//Image_interceptor_body (Image_interceptor_body) package { import flash.display.*; public dynamic class Image_interceptor_body extends BitmapData { public function Image_interceptor_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 164
//Image_interceptor_bullet (Image_interceptor_bullet) package { import flash.display.*; public dynamic class Image_interceptor_bullet extends BitmapData { public function Image_interceptor_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 165
//Image_interceptor_status_sprite (Image_interceptor_status_sprite) package { import flash.display.*; public dynamic class Image_interceptor_status_sprite extends BitmapData { public function Image_interceptor_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 166
//Image_jackal_attack (Image_jackal_attack) package { import flash.display.*; public dynamic class Image_jackal_attack extends BitmapData { public function Image_jackal_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 167
//Image_jackal_be (Image_jackal_be) package { import flash.display.*; public dynamic class Image_jackal_be extends BitmapData { public function Image_jackal_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 168
//Image_jackal_body (Image_jackal_body) package { import flash.display.*; public dynamic class Image_jackal_body extends BitmapData { public function Image_jackal_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 169
//Image_jackal_bullet (Image_jackal_bullet) package { import flash.display.*; public dynamic class Image_jackal_bullet extends BitmapData { public function Image_jackal_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 170
//Image_jackal_status_sprite (Image_jackal_status_sprite) package { import flash.display.*; public dynamic class Image_jackal_status_sprite extends BitmapData { public function Image_jackal_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 171
//Image_laser_cannon_attack (Image_laser_cannon_attack) package { import flash.display.*; public dynamic class Image_laser_cannon_attack extends BitmapData { public function Image_laser_cannon_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 172
//Image_laser_cannon_be (Image_laser_cannon_be) package { import flash.display.*; public dynamic class Image_laser_cannon_be extends BitmapData { public function Image_laser_cannon_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 173
//Image_laser_cannon_body (Image_laser_cannon_body) package { import flash.display.*; public dynamic class Image_laser_cannon_body extends BitmapData { public function Image_laser_cannon_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 174
//Image_laser_cannon_bullet (Image_laser_cannon_bullet) package { import flash.display.*; public dynamic class Image_laser_cannon_bullet extends BitmapData { public function Image_laser_cannon_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 175
//Image_laser_cannon_status_sprite (Image_laser_cannon_status_sprite) package { import flash.display.*; public dynamic class Image_laser_cannon_status_sprite extends BitmapData { public function Image_laser_cannon_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 176
//Image_m_attack (Image_m_attack) package { import flash.display.*; public dynamic class Image_m_attack extends BitmapData { public function Image_m_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 177
//Image_m_crystals (Image_m_crystals) package { import flash.display.*; public dynamic class Image_m_crystals extends BitmapData { public function Image_m_crystals(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 178
//Image_m_energy (Image_m_energy) package { import flash.display.*; public dynamic class Image_m_energy extends BitmapData { public function Image_m_energy(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 179
//Image_m_range (Image_m_range) package { import flash.display.*; public dynamic class Image_m_range extends BitmapData { public function Image_m_range(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 180
//Image_m_shield (Image_m_shield) package { import flash.display.*; public dynamic class Image_m_shield extends BitmapData { public function Image_m_shield(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 181
//Image_missile_turret_attack (Image_missile_turret_attack) package { import flash.display.*; public dynamic class Image_missile_turret_attack extends BitmapData { public function Image_missile_turret_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 182
//Image_missile_turret_be (Image_missile_turret_be) package { import flash.display.*; public dynamic class Image_missile_turret_be extends BitmapData { public function Image_missile_turret_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 183
//Image_missile_turret_body (Image_missile_turret_body) package { import flash.display.*; public dynamic class Image_missile_turret_body extends BitmapData { public function Image_missile_turret_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 184
//Image_missile_turret_bullet (Image_missile_turret_bullet) package { import flash.display.*; public dynamic class Image_missile_turret_bullet extends BitmapData { public function Image_missile_turret_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 185
//Image_missile_turret_status_sprite (Image_missile_turret_status_sprite) package { import flash.display.*; public dynamic class Image_missile_turret_status_sprite extends BitmapData { public function Image_missile_turret_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 186
//Image_moon_picket (Image_moon_picket) package { import flash.display.*; public dynamic class Image_moon_picket extends BitmapData { public function Image_moon_picket(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 187
//Image_my_order (Image_my_order) package { import flash.display.*; public dynamic class Image_my_order extends BitmapData { public function Image_my_order(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 188
//Image_plasma_mortar_attack (Image_plasma_mortar_attack) package { import flash.display.*; public dynamic class Image_plasma_mortar_attack extends BitmapData { public function Image_plasma_mortar_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 189
//Image_plasma_mortar_be (Image_plasma_mortar_be) package { import flash.display.*; public dynamic class Image_plasma_mortar_be extends BitmapData { public function Image_plasma_mortar_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 190
//Image_plasma_mortar_body (Image_plasma_mortar_body) package { import flash.display.*; public dynamic class Image_plasma_mortar_body extends BitmapData { public function Image_plasma_mortar_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 191
//Image_plasma_mortar_bullet (Image_plasma_mortar_bullet) package { import flash.display.*; public dynamic class Image_plasma_mortar_bullet extends BitmapData { public function Image_plasma_mortar_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 192
//Image_plasma_mortar_status_sprite (Image_plasma_mortar_status_sprite) package { import flash.display.*; public dynamic class Image_plasma_mortar_status_sprite extends BitmapData { public function Image_plasma_mortar_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 193
//Image_power_station_body (Image_power_station_body) package { import flash.display.*; public dynamic class Image_power_station_body extends BitmapData { public function Image_power_station_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 194
//Image_power_station_status_sprite (Image_power_station_status_sprite) package { import flash.display.*; public dynamic class Image_power_station_status_sprite extends BitmapData { public function Image_power_station_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 195
//Image_refinery_body (Image_refinery_body) package { import flash.display.*; public dynamic class Image_refinery_body extends BitmapData { public function Image_refinery_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 196
//Image_refinery_status_sprite (Image_refinery_status_sprite) package { import flash.display.*; public dynamic class Image_refinery_status_sprite extends BitmapData { public function Image_refinery_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 197
//Image_rock_attack (Image_rock_attack) package { import flash.display.*; public dynamic class Image_rock_attack extends BitmapData { public function Image_rock_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 198
//Image_rock_be (Image_rock_be) package { import flash.display.*; public dynamic class Image_rock_be extends BitmapData { public function Image_rock_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 199
//Image_rock_body (Image_rock_body) package { import flash.display.*; public dynamic class Image_rock_body extends BitmapData { public function Image_rock_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 200
//Image_rock_bullet (Image_rock_bullet) package { import flash.display.*; public dynamic class Image_rock_bullet extends BitmapData { public function Image_rock_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 201
//Image_rock_status_sprite (Image_rock_status_sprite) package { import flash.display.*; public dynamic class Image_rock_status_sprite extends BitmapData { public function Image_rock_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 202
//Image_sp_crystals (Image_sp_crystals) package { import flash.display.*; public dynamic class Image_sp_crystals extends BitmapData { public function Image_sp_crystals(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 203
//Image_sp_cumulative_bomb (Image_sp_cumulative_bomb) package { import flash.display.*; public dynamic class Image_sp_cumulative_bomb extends BitmapData { public function Image_sp_cumulative_bomb(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 204
//Image_sp_death1 (Image_sp_death1) package { import flash.display.*; public dynamic class Image_sp_death1 extends BitmapData { public function Image_sp_death1(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 205
//Image_sp_debris (Image_sp_debris) package { import flash.display.*; public dynamic class Image_sp_debris extends BitmapData { public function Image_sp_debris(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 206
//Image_sp_nitro_bomb (Image_sp_nitro_bomb) package { import flash.display.*; public dynamic class Image_sp_nitro_bomb extends BitmapData { public function Image_sp_nitro_bomb(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 207
//Image_sp_nuclear_bomb (Image_sp_nuclear_bomb) package { import flash.display.*; public dynamic class Image_sp_nuclear_bomb extends BitmapData { public function Image_sp_nuclear_bomb(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 208
//Image_star_conqueror_attack (Image_star_conqueror_attack) package { import flash.display.*; public dynamic class Image_star_conqueror_attack extends BitmapData { public function Image_star_conqueror_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 209
//Image_star_conqueror_be (Image_star_conqueror_be) package { import flash.display.*; public dynamic class Image_star_conqueror_be extends BitmapData { public function Image_star_conqueror_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 210
//Image_star_conqueror_body (Image_star_conqueror_body) package { import flash.display.*; public dynamic class Image_star_conqueror_body extends BitmapData { public function Image_star_conqueror_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 211
//Image_star_conqueror_bullet (Image_star_conqueror_bullet) package { import flash.display.*; public dynamic class Image_star_conqueror_bullet extends BitmapData { public function Image_star_conqueror_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 212
//Image_star_conqueror_status_sprite (Image_star_conqueror_status_sprite) package { import flash.display.*; public dynamic class Image_star_conqueror_status_sprite extends BitmapData { public function Image_star_conqueror_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 213
//Image_station_picket (Image_station_picket) package { import flash.display.*; public dynamic class Image_station_picket extends BitmapData { public function Image_station_picket(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 214
//Image_stunner_attack (Image_stunner_attack) package { import flash.display.*; public dynamic class Image_stunner_attack extends BitmapData { public function Image_stunner_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 215
//Image_stunner_be (Image_stunner_be) package { import flash.display.*; public dynamic class Image_stunner_be extends BitmapData { public function Image_stunner_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 216
//Image_stunner_body (Image_stunner_body) package { import flash.display.*; public dynamic class Image_stunner_body extends BitmapData { public function Image_stunner_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 217
//Image_stunner_bullet (Image_stunner_bullet) package { import flash.display.*; public dynamic class Image_stunner_bullet extends BitmapData { public function Image_stunner_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 218
//Image_stunner_status_sprite (Image_stunner_status_sprite) package { import flash.display.*; public dynamic class Image_stunner_status_sprite extends BitmapData { public function Image_stunner_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 219
//Image_war_bird_attack (Image_war_bird_attack) package { import flash.display.*; public dynamic class Image_war_bird_attack extends BitmapData { public function Image_war_bird_attack(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 220
//Image_war_bird_be (Image_war_bird_be) package { import flash.display.*; public dynamic class Image_war_bird_be extends BitmapData { public function Image_war_bird_be(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 221
//Image_war_bird_body (Image_war_bird_body) package { import flash.display.*; public dynamic class Image_war_bird_body extends BitmapData { public function Image_war_bird_body(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 222
//Image_war_bird_bullet (Image_war_bird_bullet) package { import flash.display.*; public dynamic class Image_war_bird_bullet extends BitmapData { public function Image_war_bird_bullet(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 223
//Image_war_bird_status_sprite (Image_war_bird_status_sprite) package { import flash.display.*; public dynamic class Image_war_bird_status_sprite extends BitmapData { public function Image_war_bird_status_sprite(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 224
//LoadingMC (LoadingMC) package { import flash.display.*; import flash.text.*; public dynamic class LoadingMC extends MovieClip { public var loaded_txt:TextField; public var error_txt:TextField; public var progress_mc:MovieClip; } }//package
Section 225
//MochiAd (MochiAd) package { import flash.display.*; import flash.events.*; import flash.net.*; import flash.utils.*; import flash.system.*; public class MochiAd { public static function getVersion():String{ return ("2.5"); } public static function showClickAwayAd(_arg1:Object):void{ var DEFAULTS:Object; var clip:Object; var ad_timeout:Number; var mc:MovieClip; var wh:Array; var w:Number; var h:Number; var chk:MovieClip; var sendHostProgress:Boolean; var options = _arg1; DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{ }, ad_finished:function ():void{ }, ad_loaded:function (_arg1:Number, _arg2:Number):void{ }, ad_failed:function ():void{ }, ad_skipped:function ():void{ }}; options = MochiAd._parseOptions(options, DEFAULTS); clip = options.clip; ad_timeout = options.ad_timeout; delete options.ad_timeout; if (!MochiAd.load(options)){ options.ad_failed(); options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ MochiAd._cleanup(mc); options.ad_finished(); }; wh = MochiAd._getRes(options, clip); w = wh[0]; h = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; mc.unloadAd = function ():void{ MochiAd.unload(clip); }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; sendHostProgress = false; mc.regContLC = function (_arg1:String):void{ mc._containerLCName = _arg1; }; chk["onEnterFrame"] = function ():void{ var _local1:Object; var _local2:Number; var _local3:Boolean; var _local4:Number; if (!this.parent){ delete this.onEnterFrame; return; }; _local1 = this.parent._mochiad_ctr; _local2 = (getTimer() - this.started); _local3 = false; if (!chk.showing){ _local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local4 > 0){ chk.showing = true; _local3 = true; chk.started = getTimer(); } else { if (_local2 > chk.ad_timeout){ options.ad_failed(); _local3 = true; }; }; }; if (this.root == null){ _local3 = true; }; if (_local3){ delete this.onEnterFrame; }; }; doOnEnterFrame(chk); } public static function _isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function _allowDomains(_arg1:String):String{ var _local2:String; _local2 = _arg1.split("/")[2].split(":")[0]; Security.allowDomain("*"); Security.allowDomain(_local2); Security.allowInsecureDomain("*"); Security.allowInsecureDomain(_local2); return (_local2); } public static function unload(_arg1:Object):Boolean{ if (((_arg1.clip) && (_arg1.clip._mochiad))){ _arg1 = _arg1.clip; }; if (_arg1.origFrameRate != undefined){ _arg1.stage.frameRate = _arg1.origFrameRate; }; if (!_arg1._mochiad){ return (false); }; if (_arg1._mochiad._containerLCName != undefined){ _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"}); }; if (_arg1._mochiad.onUnload){ _arg1._mochiad.onUnload(); }; delete _arg1._mochiad_loaded; delete _arg1._mochiad; return (true); } public static function showInterLevelAd(_arg1:Object):void{ var DEFAULTS:Object; var clip:Object; var ad_msec:Number; var ad_timeout:Number; var fadeout_time:Number; var mc:MovieClip; var wh:Array; var w:Number; var h:Number; var chk:MovieClip; var options = _arg1; DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{ if ((this.clip is MovieClip)){ this.clip.stop(); } else { throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_finished:function ():void{ if ((this.clip is MovieClip)){ this.clip.play(); } else { throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_loaded:function (_arg1:Number, _arg2:Number):void{ }, ad_failed:function ():void{ }, ad_skipped:function ():void{ }}; options = MochiAd._parseOptions(options, DEFAULTS); clip = options.clip; ad_msec = 11000; ad_timeout = options.ad_timeout; delete options.ad_timeout; fadeout_time = options.fadeout_time; delete options.fadeout_time; if (!MochiAd.load(options)){ options.ad_failed(); options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ MochiAd._cleanup(mc); options.ad_finished(); }; wh = MochiAd._getRes(options, clip); w = wh[0]; h = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.ad_msec = ad_msec; chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; chk.fadeout_time = fadeout_time; chk.fadeFunction = function ():void{ var _local1:Number; if (!this.parent){ delete this.onEnterFrame; delete this.fadeFunction; return; }; _local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 0.01); } else { MochiAd.unload(clip); delete this["onEnterFrame"]; }; }; mc.unloadAd = function ():void{ MochiAd.unload(clip); }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object; _local2 = mc._mochiad_wait; _local2.server_control = true; _local2.showing = true; _local2.started = getTimer(); _local2.ad_msec = (_arg1 - 250); }; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; chk["onEnterFrame"] = function ():void{ var _local1:Object; var _local2:Number; var _local3:Boolean; var _local4:Number; if (!this.parent){ delete this.onEnterFrame; delete this.fadeFunction; return; }; _local1 = this.parent._mochiad_ctr; _local2 = (getTimer() - this.started); _local3 = false; if (!chk.showing){ _local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local4 > 0){ chk.showing = true; chk.started = getTimer(); MochiAd.adShowing(clip); } else { if (_local2 > chk.ad_timeout){ options.ad_failed(); _local3 = true; }; }; }; if (_local2 > chk.ad_msec){ _local3 = true; }; if (_local3){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = this.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function _parseOptions(_arg1:Object, _arg2:Object):Object{ var _local3:Object; var _local4:String; var _local5:Array; var _local6:Number; var _local7:Array; _local3 = {}; for (_local4 in _arg2) { _local3[_local4] = _arg2[_local4]; }; if (_arg1){ for (_local4 in _arg1) { _local3[_local4] = _arg1[_local4]; }; }; if (_local3.clip == undefined){ throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite.")); }; _arg1 = _local3.clip.loaderInfo.parameters.mochiad_options; if (_arg1){ _local5 = _arg1.split("&"); _local6 = 0; while (_local6 < _local5.length) { _local7 = _local5[_local6].split("="); _local3[unescape(_local7[0])] = unescape(_local7[1]); _local6++; }; }; if (_local3.id == "test"){ }; return (_local3); } public static function _cleanup(_arg1:Object):void{ var idx:Number; var k:String; var lc:LocalConnection; var f:Function; var mc = _arg1; if (("lc" in mc)){ lc = mc.lc; f = function ():void{ try { lc.client = null; lc.close(); } catch(e:Error) { }; }; setTimeout(f, 0); }; idx = DisplayObjectContainer(mc).numChildren; while (idx > 0) { idx = (idx - 1); DisplayObjectContainer(mc).removeChildAt(idx); }; for (k in mc) { delete mc[k]; }; } public static function load(_arg1:Object):MovieClip{ var DEFAULTS:Object; var clip:Object; var depth:Number; var mc:MovieClip; var wh:Array; var lv:URLVariables; var k:String; var server:String; var hostname:String; var lc:LocalConnection; var name:String; var loader:Loader; var g:Function; var req:URLRequest; var v:Object; var options = _arg1; DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"}; options = MochiAd._parseOptions(options, DEFAULTS); options.swfv = 9; options.mav = MochiAd.getVersion(); clip = options.clip; if (!MochiAd._isNetworkAvailable()){ return (null); }; try { if (clip._mochiad_loaded){ return (null); }; } catch(e:Error) { throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic.")); }; depth = options.depth; delete options.depth; mc = createEmptyMovieClip(clip, "_mochiad", depth); wh = MochiAd._getRes(options, clip); options.res = ((wh[0] + "x") + wh[1]); options.server = (options.server + options.id); delete options.id; clip._mochiad_loaded = true; if (clip.loaderInfo.loaderURL.indexOf("http") == 0){ options.as3_swf = clip.loaderInfo.loaderURL; }; lv = new URLVariables(); for (k in options) { v = options[k]; if (!(v is Function)){ lv[k] = v; }; }; server = lv.server; delete lv.server; hostname = _allowDomains(server); lc = new LocalConnection(); lc.client = mc; name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_"); lc.allowDomain("*", "localhost"); lc.allowInsecureDomain("*", "localhost"); lc.connect(name); mc.lc = lc; mc.lcName = name; lv.lc = name; lv.st = getTimer(); loader = new Loader(); g = function (_arg1:Object):void{ _arg1.target.removeEventListener(_arg1.type, arguments.callee); MochiAd.unload(clip); }; loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g); req = new URLRequest((server + ".swf")); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; loader.load(req); mc.addChild(loader); mc._mochiad_ctr = loader; return (mc); } public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{ var _local4:Array; var _local5:Number; _local4 = _arg2.split("."); _local5 = 0; while (_local5 < (_local4.length - 1)) { if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){ return (undefined); }; _arg1 = _arg1[_local4[_local5]]; _local5++; }; if (typeof(_arg1[_local4[_local5]]) == "function"){ return (_arg1[_local4[_local5]].apply(_arg1, _arg3)); }; return (undefined); } public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{ var _local4:MovieClip; _local4 = new MovieClip(); if (((false) && (_arg3))){ _arg1.addChildAt(_local4, _arg3); } else { _arg1.addChild(_local4); }; _arg1[_arg2] = _local4; _local4["_name"] = _arg2; return (_local4); } public static function _getRes(_arg1:Object, _arg2:Object):Array{ var _local3:Object; var _local4:Number; var _local5:Number; var _local6:Array; _local3 = _arg2.getBounds(_arg2.root); _local4 = 0; _local5 = 0; if (typeof(_arg1.res) != "undefined"){ _local6 = _arg1.res.split("x"); _local4 = parseFloat(_local6[0]); _local5 = parseFloat(_local6[1]); } else { _local4 = (_local3.xMax - _local3.xMin); _local5 = (_local3.yMax - _local3.yMin); }; if ((((_local4 == 0)) || ((_local5 == 0)))){ _local4 = _arg2.stage.stageWidth; _local5 = _arg2.stage.stageHeight; }; return ([_local4, _local5]); } public static function adShowing(_arg1:Object):void{ _arg1.origFrameRate = _arg1.stage.frameRate; _arg1.stage.frameRate = 30; } public static function getValue(_arg1:Object, _arg2:String):Object{ var _local3:Array; var _local4:Number; _local3 = _arg2.split("."); _local4 = 0; while (_local4 < (_local3.length - 1)) { if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){ return (undefined); }; _arg1 = _arg1[_local3[_local4]]; _local4++; }; return (_arg1[_local3[_local4]]); } public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{ var _local4:Object; var _local5:Object; switch (_arg3.id){ case "setValue": MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value); break; case "getValue": _local4 = MochiAd.getValue(_arg1, _arg3.objectName); _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4); break; case "runMethod": _local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args); _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5); break; }; } public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{ var _local4:Array; var _local5:Number; _local4 = _arg2.split("."); _local5 = 0; while (_local5 < (_local4.length - 1)) { if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){ return; }; _arg1 = _arg1[_local4[_local5]]; _local5++; }; _arg1[_local4[_local5]] = _arg3; } public static function showPreGameAd(_arg1:Object):void{ var DEFAULTS:Object; var clip:Object; var ad_msec:Number; var ad_timeout:Number; var fadeout_time:Number; var mc:MovieClip; var wh:Array; var w:Number; var h:Number; var chk:MovieClip; var bar:MovieClip; var bar_color:Number; var bar_background:Number; var bar_outline:Number; var backing_mc:MovieClip; var backing:Object; var inside_mc:MovieClip; var inside:Object; var outline_mc:MovieClip; var outline:Object; var complete:Boolean; var unloaded:Boolean; var f:Function; var sendHostProgress:Boolean; var r:MovieClip; var options = _arg1; DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{ if ((this.clip is MovieClip)){ this.clip.stop(); } else { throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_finished:function ():void{ if ((this.clip is MovieClip)){ this.clip.play(); } else { throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_loaded:function (_arg1:Number, _arg2:Number):void{ }, ad_failed:function ():void{ }, ad_skipped:function ():void{ }, ad_progress:function (_arg1:Number):void{ }}; options = MochiAd._parseOptions(options, DEFAULTS); if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){ options.ad_started(); setTimeout(options.ad_finished, 100); return; }; clip = options.clip; ad_msec = 11000; ad_timeout = options.ad_timeout; delete options.ad_timeout; fadeout_time = options.fadeout_time; delete options.fadeout_time; if (!MochiAd.load(options)){ options.ad_failed(); options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ var fn:Function; MochiAd._cleanup(mc); fn = function ():void{ options.ad_finished(); }; setTimeout(fn, 100); }; wh = MochiAd._getRes(options, clip); w = wh[0]; h = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.x = (w * -0.5); chk.y = (h * -0.5); bar = createEmptyMovieClip(chk, "_mochiad_bar", 4); if (options.no_progress_bar){ bar.visible = false; delete options.no_progress_bar; } else { bar.x = 10; bar.y = (h - 20); }; bar_color = options.color; delete options.color; bar_background = options.background; delete options.background; bar_outline = options.outline; delete options.outline; backing_mc = createEmptyMovieClip(bar, "_outline", 1); backing = backing_mc.graphics; backing.beginFill(bar_background); backing.moveTo(0, 0); backing.lineTo((w - 20), 0); backing.lineTo((w - 20), 10); backing.lineTo(0, 10); backing.lineTo(0, 0); backing.endFill(); inside_mc = createEmptyMovieClip(bar, "_inside", 2); inside = inside_mc.graphics; inside.beginFill(bar_color); inside.moveTo(0, 0); inside.lineTo((w - 20), 0); inside.lineTo((w - 20), 10); inside.lineTo(0, 10); inside.lineTo(0, 0); inside.endFill(); inside_mc.scaleX = 0; outline_mc = createEmptyMovieClip(bar, "_outline", 3); outline = outline_mc.graphics; outline.lineStyle(0, bar_outline, 100); outline.moveTo(0, 0); outline.lineTo((w - 20), 0); outline.lineTo((w - 20), 10); outline.lineTo(0, 10); outline.lineTo(0, 0); chk.ad_msec = ad_msec; chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; chk.last_pcnt = 0; chk.fadeout_time = fadeout_time; chk.fadeFunction = function ():void{ var _local1:Number; _local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 0.01); } else { MochiAd.unload(clip); delete this["onEnterFrame"]; }; }; complete = false; unloaded = false; f = function (_arg1:Event):void{ _arg1.target.removeEventListener(_arg1.type, arguments.callee); complete = true; if (unloaded){ MochiAd.unload(clip); }; }; clip.loaderInfo.addEventListener(Event.COMPLETE, f); if ((clip.root is MovieClip)){ r = (clip.root as MovieClip); if (r.framesLoaded >= r.totalFrames){ complete = true; }; }; mc.unloadAd = function ():void{ unloaded = true; if (complete){ MochiAd.unload(clip); }; }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object; _local2 = mc._mochiad_wait; _local2.server_control = true; _local2.showing = true; _local2.started = getTimer(); _local2.ad_msec = _arg1; }; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; mc.rpcTestFn = function (_arg1:String):Object{ return (_arg1); }; mc.regContLC = function (_arg1:String):void{ mc._containerLCName = _arg1; }; sendHostProgress = false; mc.sendHostLoadProgress = function (_arg1:String):void{ sendHostProgress = true; }; chk["onEnterFrame"] = function ():void{ var _local1:Object; var _local2:Object; var _local3:Number; var _local4:Boolean; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Object; var _local10:Number; var _local11:Number; if (((!(this.parent)) || (!(this.parent.parent)))){ delete this["onEnterFrame"]; return; }; _local1 = this.parent.parent.root; _local2 = this.parent._mochiad_ctr; _local3 = (getTimer() - this.started); _local4 = false; _local5 = _local1.loaderInfo.bytesTotal; _local6 = _local1.loaderInfo.bytesLoaded; if (complete){ _local6 = Math.max(1, _local6); _local5 = _local6; }; _local7 = ((100 * _local6) / _local5); _local8 = ((100 * _local3) / chk.ad_msec); _local9 = this._mochiad_bar._inside; _local10 = Math.min(100, Math.min(((_local7) || (0)), _local8)); _local10 = Math.max(this.last_pcnt, _local10); this.last_pcnt = _local10; _local9.scaleX = (_local10 * 0.01); options.ad_progress(_local10); if (sendHostProgress){ clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7}); if (_local7 == 100){ sendHostProgress = false; }; }; if (!chk.showing){ _local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local11 > 0){ chk.showing = true; chk.started = getTimer(); MochiAd.adShowing(clip); } else { if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){ options.ad_failed(); _local4 = true; }; }; }; if (_local3 > chk.ad_msec){ _local4 = true; }; if (((complete) && (_local4))){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = chk.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function showPreloaderAd(_arg1:Object):void{ MochiAd.showPreGameAd(_arg1); } public static function showTimedAd(_arg1:Object):void{ MochiAd.showInterLevelAd(_arg1); } public static function doOnEnterFrame(_arg1:MovieClip):void{ var f:Function; var mc = _arg1; f = function (_arg1:Object):void{ if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){ mc.onEnterFrame(); } else { _arg1.target.removeEventListener(_arg1.type, arguments.callee); }; }; mc.addEventListener(Event.ENTER_FRAME, f); } } }//package
Section 226
//MochiBot (MochiBot) package { import flash.display.*; import flash.net.*; import flash.system.*; public dynamic class MochiBot extends Sprite { public static function track(_arg1:Sprite, _arg2:String):MochiBot{ var _local3:MochiBot; var _local4:String; var _local5:URLVariables; var _local6:String; var _local7:URLRequest; var _local8:Loader; if (Security.sandboxType == "localWithFile"){ return (null); }; _local3 = new (MochiBot); _arg1.addChild(_local3); Security.allowDomain("*"); Security.allowInsecureDomain("*"); _local4 = "http://core.mochibot.com/my/core.swf"; _local5 = new URLVariables(); _local5["sb"] = Security.sandboxType; _local5["v"] = Capabilities.version; _local5["swfid"] = _arg2; _local5["mv"] = "8"; _local5["fv"] = "9"; _local6 = _arg1.loaderInfo.url; if (_local6.indexOf("http") == 0){ _local5["url"] = _local6; } else { _local5["url"] = "local"; }; _local7 = new URLRequest(_local4); _local7.contentType = "application/x-www-form-urlencoded"; _local7.method = URLRequestMethod.POST; _local7.data = _local5; _local8 = new Loader(); _local3.addChild(_local8); _local8.load(_local7); return (_local3); } } }//package
Section 227
//PauseMC (PauseMC) package { import flash.display.*; public dynamic class PauseMC extends MovieClip { public function PauseMC(){ addFrameScript(9, frame10); } function frame10(){ stop(); } } }//package
Section 228
//PlanetsInfoMC (PlanetsInfoMC) package { import flash.display.*; import flash.text.*; public dynamic class PlanetsInfoMC extends MovieClip { public var resume_game_button:SimpleButton; public var title:TextField; public var desc:TextField; public var waves:TextField; public var play_button:SimpleButton; } }//package
Section 229
//RepairSign (RepairSign) package { import flash.display.*; public dynamic class RepairSign extends MovieClip { } }//package
Section 230
//SelectedSpriteTooltip (SelectedSpriteTooltip) package { import flash.display.*; public dynamic class SelectedSpriteTooltip extends Sprite { } }//package
Section 231
//SliderThumb_disabledSkin (SliderThumb_disabledSkin) package { import flash.display.*; public dynamic class SliderThumb_disabledSkin extends MovieClip { } }//package
Section 232
//SliderThumb_downSkin (SliderThumb_downSkin) package { import flash.display.*; public dynamic class SliderThumb_downSkin extends MovieClip { } }//package
Section 233
//SliderThumb_overSkin (SliderThumb_overSkin) package { import flash.display.*; public dynamic class SliderThumb_overSkin extends MovieClip { } }//package
Section 234
//SliderThumb_upSkin (SliderThumb_upSkin) package { import flash.display.*; public dynamic class SliderThumb_upSkin extends MovieClip { } }//package
Section 235
//SliderTick_skin (SliderTick_skin) package { import flash.display.*; public dynamic class SliderTick_skin extends MovieClip { } }//package
Section 236
//SliderTrack_disabledSkin (SliderTrack_disabledSkin) package { import flash.display.*; public dynamic class SliderTrack_disabledSkin extends MovieClip { } }//package
Section 237
//SliderTrack_skin (SliderTrack_skin) package { import flash.display.*; public dynamic class SliderTrack_skin extends MovieClip { } }//package
Section 238
//Sound_build (Sound_build) package { import flash.media.*; public dynamic class Sound_build extends Sound { } }//package
Section 239
//Sound_click (Sound_click) package { import flash.media.*; public dynamic class Sound_click extends Sound { } }//package
Section 240
//Sound_click1 (Sound_click1) package { import flash.media.*; public dynamic class Sound_click1 extends Sound { } }//package
Section 241
//Sound_defeat (Sound_defeat) package { import flash.media.*; public dynamic class Sound_defeat extends Sound { } }//package
Section 242
//Sound_explosion1 (Sound_explosion1) package { import flash.media.*; public dynamic class Sound_explosion1 extends Sound { } }//package
Section 243
//Sound_laser1 (Sound_laser1) package { import flash.media.*; public dynamic class Sound_laser1 extends Sound { } }//package
Section 244
//Sound_laser2 (Sound_laser2) package { import flash.media.*; public dynamic class Sound_laser2 extends Sound { } }//package
Section 245
//Sound_missile_turret_launch (Sound_missile_turret_launch) package { import flash.media.*; public dynamic class Sound_missile_turret_launch extends Sound { } }//package
Section 246
//Sound_new_wave (Sound_new_wave) package { import flash.media.*; public dynamic class Sound_new_wave extends Sound { } }//package
Section 247
//Sound_planets (Sound_planets) package { import flash.media.*; public dynamic class Sound_planets extends Sound { } }//package
Section 248
//Sound_stat_appear (Sound_stat_appear) package { import flash.media.*; public dynamic class Sound_stat_appear extends Sound { } }//package
Section 249
//Sound_tada (Sound_tada) package { import flash.media.*; public dynamic class Sound_tada extends Sound { } }//package
Section 250
//Sound_unpause (Sound_unpause) package { import flash.media.*; public dynamic class Sound_unpause extends Sound { } }//package
Section 251
//Sound_upgrade (Sound_upgrade) package { import flash.media.*; public dynamic class Sound_upgrade extends Sound { } }//package
Section 252
//SwitchButton (SwitchButton) package { import flash.display.*; import flash.text.*; public dynamic class SwitchButton extends MovieClip { public var buttonLabel:TextField; public function SwitchButton(){ addFrameScript(4, frame5, 9, frame10); } function frame10(){ stop(); } function frame5(){ stop(); } } }//package
Section 253
//UpHeader (UpHeader) package { import flash.display.*; import flash.text.*; public dynamic class UpHeader extends MovieClip { public var wave_time:TextField; public var energy:TextField; public var score:TextField; public var send_next_button:SimpleButton; public var crystals:TextField; } }//package

Library Items

Symbol 1 ShapeTweeningUsed by:4
Symbol 2 GraphicUsed by:4
Symbol 3 GraphicUsed by:4
Symbol 4 MovieClipUses:1 2 3Used by:10
Symbol 5 FontUsed by:6 7 237 271 299 300 301 306 307 308 309 310 311 316 318 320 321 322 323 324 325 329 332 333 334 335 337 339 340 341 345 346 347 350 351 353 453 470 496 504 505 506 507
Symbol 6 EditableTextUses:5Used by:10
Symbol 7 EditableTextUses:5Used by:10
Symbol 8 FontUsed by:9 61
Symbol 9 EditableTextUses:8Used by:10
Symbol 10 MovieClip {LoadingMC}Uses:4 6 7 9Used by:Timeline
Symbol 11 GraphicUsed by:12 35
Symbol 12 MovieClipUses:11Used by:Timeline
Symbol 13 GraphicUsed by:14
Symbol 14 MovieClipUses:13Used by:35  Timeline
Symbol 15 FontUsed by:16
Symbol 16 EditableTextUses:15Used by:Timeline
Symbol 17 GraphicUsed by:Timeline
Symbol 18 GraphicUsed by:35
Symbol 19 GraphicUsed by:20
Symbol 20 MovieClipUses:19Used by:35
Symbol 21 SoundUsed by:35
Symbol 22 ShapeTweeningUsed by:35
Symbol 23 GraphicUsed by:24
Symbol 24 MovieClipUses:23Used by:35
Symbol 25 GraphicUsed by:26
Symbol 26 MovieClipUses:25Used by:35
Symbol 27 ShapeTweeningUsed by:35
Symbol 28 ShapeTweeningUsed by:35
Symbol 29 GraphicUsed by:30
Symbol 30 MovieClipUses:29Used by:35
Symbol 31 GraphicUsed by:35
Symbol 32 GraphicUsed by:33
Symbol 33 MovieClipUses:32Used by:35
Symbol 34 GraphicUsed by:35
Symbol 35 MovieClip {sr_fla.LOGO_YOUGAME_5}Uses:18 20 21 22 24 11 26 14 27 28 30 31 33 34Used by:Timeline
Symbol 36 BitmapUsed by:37
Symbol 37 GraphicUses:36Used by:64 250 348 450
Symbol 38 GraphicUsed by:39 42 44 51 256 261 262 266 269 283 285 286 289 291 293 295 297
Symbol 39 MovieClipUses:38Used by:42 44 51
Symbol 40 FontUsed by:41 43 49 62 63 212 213 214 215 216 217 218 219 220 221 222 223 224 228 232 235 238 248 254 257 270 272 273 274 275 276 277 278 279 280 284 288 290 296 298 302 306 312 319 320 321 322 323 324 326 342 344 352 354 378 379 384 385 390 391 396 397 402 403 408 409 414 415 420 421 426 427 432 433 438 439 444 445 452 454 455 457 459 463 467 474 476 477 478 479 482 483 497
Symbol 41 TextUses:40Used by:42
Symbol 42 ButtonUses:39 41 38Used by:64
Symbol 43 TextUses:40Used by:44
Symbol 44 ButtonUses:39 43 38Used by:64
Symbol 45 BitmapUsed by:48 376
Symbol 46 BitmapUsed by:48 50 105
Symbol 47 BitmapUsed by:48 93
Symbol 48 GraphicUses:45 46 47Used by:64
Symbol 49 TextUses:40Used by:51
Symbol 50 GraphicUses:46Used by:51 447 448
Symbol 51 ButtonUses:39 49 50 38Used by:64
Symbol 52 FontUsed by:53 57
Symbol 53 EditableTextUses:52Used by:54 56
Symbol 54 MovieClipUses:53Used by:56
Symbol 55 GraphicUsed by:56
Symbol 56 ButtonUses:54 55 53Used by:64
Symbol 57 EditableTextUses:52Used by:58 60
Symbol 58 MovieClipUses:57Used by:60
Symbol 59 GraphicUsed by:60
Symbol 60 ButtonUses:58 59 57Used by:64
Symbol 61 EditableTextUses:8Used by:64
Symbol 62 TextUses:40Used by:64
Symbol 63 TextUses:40Used by:64
Symbol 64 MovieClip {fai.MainMenuMC}Uses:37 42 44 48 51 56 60 61 62 63Used by:Timeline
Symbol 65 Bitmap {Image_b_artillery}Used by:348 540
Symbol 66 Bitmap {Image_b_attack}Used by:348 540
Symbol 67 Bitmap {Image_b_cancel}Used by:540
Symbol 68 Bitmap {Image_b_cumulative_bomb}Used by:348 540
Symbol 69 Bitmap {Image_b_laser_cannon}Used by:348 540
Symbol 70 Bitmap {Image_b_missile_turret}Used by:348 540
Symbol 71 Bitmap {Image_b_nitro_bomb}Used by:348 540
Symbol 72 Bitmap {Image_b_nuclear_missile}Used by:348 540
Symbol 73 Bitmap {Image_b_plasma_mortar}Used by:348 540
Symbol 74 Bitmap {Image_b_power_station}Used by:540
Symbol 75 Bitmap {Image_b_refinery}Used by:540
Symbol 76 Bitmap {Image_b_stop}Used by:348 540
Symbol 77 Bitmap {Image_b_stunner}Used by:348 540
Symbol 78 Bitmap {Image_ground_desert}Used by:540
Symbol 79 Bitmap {Image_ground_driedtree}Used by:540
Symbol 80 Bitmap {Image_ground_grass}Used by:540
Symbol 81 Bitmap {Image_hatch}Used by:540
Symbol 82 Bitmap {Image_ground_moon}Used by:540
Symbol 83 Bitmap {Image_moon_picket}Used by:540
Symbol 84 Bitmap {Image_ground_platform}Used by:540
Symbol 85 Bitmap {Image_ground_platformtube}Used by:540
Symbol 86 Bitmap {Image_station_picket}Used by:540
Symbol 87 Bitmap {Image_ground_stone}Used by:540
Symbol 88 Bitmap {Image_ground_tree}Used by:540
Symbol 89 Bitmap {Image_ground_tree2}Used by:540
Symbol 90 Bitmap {Image_ground_wall1}Used by:540
Symbol 91 Bitmap {Image_ground_wall2}Used by:540
Symbol 92 Bitmap {Image_crystals_status}Used by:540
Symbol 93 GraphicUses:47Used by:449 540
Symbol 94 Bitmap {Image_hostile_order}Used by:540
Symbol 95 BitmapUsed by:97 495
Symbol 96 BitmapUsed by:97 475
Symbol 97 GraphicUses:95 96Used by:540
Symbol 98 Bitmap {Image_my_order}Used by:540
Symbol 99 BitmapUsed by:105 210
Symbol 100 BitmapUsed by:105 263 267 500 524
Symbol 101 BitmapUsed by:105 292
Symbol 102 BitmapUsed by:105 282
Symbol 103 BitmapUsed by:105 349
Symbol 104 BitmapUsed by:105 287
Symbol 105 GraphicUses:99 100 101 102 46 103 104Used by:540
Symbol 106 Bitmap {Image_m_attack}Used by:253 540
Symbol 107 Bitmap {Image_m_crystals}Used by:485 508 540
Symbol 108 Bitmap {Image_m_energy}Used by:485 540
Symbol 109 Bitmap {Image_m_range}Used by:253 540
Symbol 110 Bitmap {Image_m_shield}Used by:253 540
Symbol 111 Bitmap {Image_sp_crystals}Used by:540
Symbol 112 Bitmap {Image_sp_cumulative_bomb}Used by:540
Symbol 113 Bitmap {Image_sp_death1}Used by:540
Symbol 114 Bitmap {Image_sp_debris}Used by:540
Symbol 115 Bitmap {Image_sp_nitro_bomb}Used by:540
Symbol 116 Bitmap {Image_sp_nuclear_bomb}Used by:540
Symbol 117 Bitmap {Image_artillery_attack}Used by:540
Symbol 118 Bitmap {Image_artillery_be}Used by:540
Symbol 119 Bitmap {Image_artillery_body}Used by:540
Symbol 120 Bitmap {Image_artillery_bullet}Used by:540
Symbol 121 Bitmap {Image_artillery_status_sprite}Used by:540
Symbol 122 Bitmap {Image_command_center_body}Used by:348 540
Symbol 123 Bitmap {Image_command_center_status_sprite}Used by:540
Symbol 124 Bitmap {Image_harvester_body}Used by:540
Symbol 125 Bitmap {Image_harvester_status_sprite}Used by:540
Symbol 126 Bitmap {Image_laser_cannon_attack}Used by:540
Symbol 127 Bitmap {Image_laser_cannon_be}Used by:540
Symbol 128 Bitmap {Image_laser_cannon_body}Used by:540
Symbol 129 Bitmap {Image_laser_cannon_bullet}Used by:540
Symbol 130 Bitmap {Image_laser_cannon_status_sprite}Used by:540
Symbol 131 Bitmap {Image_missile_turret_attack}Used by:540
Symbol 132 Bitmap {Image_missile_turret_be}Used by:540
Symbol 133 Bitmap {Image_missile_turret_body}Used by:540
Symbol 134 Bitmap {Image_missile_turret_bullet}Used by:540
Symbol 135 Bitmap {Image_missile_turret_status_sprite}Used by:540
Symbol 136 Bitmap {Image_plasma_mortar_attack}Used by:540
Symbol 137 Bitmap {Image_plasma_mortar_be}Used by:540
Symbol 138 Bitmap {Image_plasma_mortar_body}Used by:540
Symbol 139 Bitmap {Image_plasma_mortar_bullet}Used by:540
Symbol 140 Bitmap {Image_plasma_mortar_status_sprite}Used by:540
Symbol 141 Bitmap {Image_power_station_body}Used by:348 513 540
Symbol 142 Bitmap {Image_power_station_status_sprite}Used by:540
Symbol 143 Bitmap {Image_refinery_body}Used by:510 540
Symbol 144 Bitmap {Image_refinery_status_sprite}Used by:540
Symbol 145 Bitmap {Image_stunner_attack}Used by:540
Symbol 146 Bitmap {Image_stunner_be}Used by:540
Symbol 147 Bitmap {Image_stunner_body}Used by:540
Symbol 148 Bitmap {Image_stunner_bullet}Used by:540
Symbol 149 Bitmap {Image_stunner_status_sprite}Used by:540
Symbol 150 Bitmap {Image_battle_shuttle_attack}Used by:540
Symbol 151 Bitmap {Image_battle_shuttle_be}Used by:540
Symbol 152 Bitmap {Image_battle_shuttle_body}Used by:540
Symbol 153 Bitmap {Image_battle_shuttle_bullet}Used by:540
Symbol 154 Bitmap {Image_battle_shuttle_status_sprite}Used by:540
Symbol 155 Bitmap {Image_destroyer_attack}Used by:540
Symbol 156 Bitmap {Image_destroyer_be}Used by:540
Symbol 157 Bitmap {Image_destroyer_body}Used by:540
Symbol 158 Bitmap {Image_destroyer_bullet}Used by:540
Symbol 159 Bitmap {Image_destroyer_status_sprite}Used by:540
Symbol 160 Bitmap {Image_executor_attack}Used by:540
Symbol 161 Bitmap {Image_executor_be}Used by:540
Symbol 162 Bitmap {Image_executor_body}Used by:540
Symbol 163 Bitmap {Image_executor_bullet}Used by:540
Symbol 164 Bitmap {Image_executor_status_sprite}Used by:540
Symbol 165 Bitmap {Image_fighter_t1_attack}Used by:540
Symbol 166 Bitmap {Image_fighter_t1_be}Used by:540
Symbol 167 Bitmap {Image_fighter_t1_body}Used by:540
Symbol 168 Bitmap {Image_fighter_t1_bullet}Used by:540
Symbol 169 Bitmap {Image_fighter_t1_status_sprite}Used by:540
Symbol 170 Bitmap {Image_fighter_t2_attack}Used by:540
Symbol 171 Bitmap {Image_fighter_t2_be}Used by:540
Symbol 172 Bitmap {Image_fighter_t2_body}Used by:540
Symbol 173 Bitmap {Image_fighter_t2_bullet}Used by:540
Symbol 174 Bitmap {Image_fighter_t2_status_sprite}Used by:540
Symbol 175 Bitmap {Image_fighter_t3_attack}Used by:540
Symbol 176 Bitmap {Image_fighter_t3_be}Used by:540
Symbol 177 Bitmap {Image_fighter_t3_body}Used by:540
Symbol 178 Bitmap {Image_fighter_t3_bullet}Used by:540
Symbol 179 Bitmap {Image_fighter_t3_status_sprite}Used by:540
Symbol 180 Bitmap {Image_gunship_attack}Used by:540
Symbol 181 Bitmap {Image_gunship_be}Used by:540
Symbol 182 Bitmap {Image_gunship_body}Used by:540
Symbol 183 Bitmap {Image_gunship_bullet}Used by:540
Symbol 184 Bitmap {Image_gunship_status_sprite}Used by:540
Symbol 185 Bitmap {Image_interceptor_attack}Used by:540
Symbol 186 Bitmap {Image_interceptor_be}Used by:540
Symbol 187 Bitmap {Image_interceptor_body}Used by:540
Symbol 188 Bitmap {Image_interceptor_bullet}Used by:540
Symbol 189 Bitmap {Image_interceptor_status_sprite}Used by:540
Symbol 190 Bitmap {Image_jackal_attack}Used by:540
Symbol 191 Bitmap {Image_jackal_be}Used by:540
Symbol 192 Bitmap {Image_jackal_body}Used by:540
Symbol 193 Bitmap {Image_jackal_bullet}Used by:540
Symbol 194 Bitmap {Image_jackal_status_sprite}Used by:540
Symbol 195 Bitmap {Image_rock_attack}Used by:540
Symbol 196 Bitmap {Image_rock_be}Used by:540
Symbol 197 Bitmap {Image_rock_body}Used by:540
Symbol 198 Bitmap {Image_rock_bullet}Used by:540
Symbol 199 Bitmap {Image_rock_status_sprite}Used by:540
Symbol 200 Bitmap {Image_star_conqueror_attack}Used by:540
Symbol 201 Bitmap {Image_star_conqueror_be}Used by:540
Symbol 202 Bitmap {Image_star_conqueror_body}Used by:540
Symbol 203 Bitmap {Image_star_conqueror_bullet}Used by:540
Symbol 204 Bitmap {Image_star_conqueror_status_sprite}Used by:540
Symbol 205 Bitmap {Image_war_bird_attack}Used by:540
Symbol 206 Bitmap {Image_war_bird_be}Used by:540
Symbol 207 Bitmap {Image_war_bird_body}Used by:540
Symbol 208 Bitmap {Image_war_bird_bullet}Used by:540
Symbol 209 Bitmap {Image_war_bird_status_sprite}Used by:540
Symbol 210 GraphicUses:99Used by:211 281
Symbol 211 MovieClipUses:210Used by:250
Symbol 212 EditableTextUses:40Used by:250
Symbol 213 TextUses:40Used by:250
Symbol 214 TextUses:40Used by:250
Symbol 215 TextUses:40Used by:250
Symbol 216 TextUses:40Used by:250
Symbol 217 TextUses:40Used by:250
Symbol 218 EditableTextUses:40Used by:250
Symbol 219 EditableTextUses:40Used by:250
Symbol 220 EditableTextUses:40Used by:250
Symbol 221 EditableTextUses:40Used by:250
Symbol 222 EditableTextUses:40Used by:250
Symbol 223 TextUses:40Used by:250
Symbol 224 EditableTextUses:40Used by:250
Symbol 225 GraphicUsed by:250
Symbol 226 GraphicUsed by:227 229
Symbol 227 MovieClipUses:226Used by:229 255
Symbol 228 TextUses:40Used by:229
Symbol 229 ButtonUses:227 228 226Used by:250
Symbol 230 GraphicUsed by:231 233 234 236 456 458 460
Symbol 231 MovieClipUses:230Used by:233
Symbol 232 TextUses:40Used by:233
Symbol 233 ButtonUses:231 232 230Used by:250
Symbol 234 MovieClipUses:230Used by:236
Symbol 235 TextUses:40Used by:236
Symbol 236 ButtonUses:234 235 230Used by:250 348
Symbol 237 TextUses:5Used by:239
Symbol 238 TextUses:40Used by:239
Symbol 239 MovieClipUses:237 238Used by:250
Symbol 240 GraphicUsed by:242
Symbol 241 GraphicUsed by:242
Symbol 242 MovieClipUses:240 241Used by:250
Symbol 243 GraphicUsed by:245
Symbol 244 GraphicUsed by:245
Symbol 245 MovieClipUses:243 244Used by:250
Symbol 246 GraphicUsed by:247 249
Symbol 247 MovieClipUses:246Used by:249
Symbol 248 TextUses:40Used by:249
Symbol 249 ButtonUses:247 248 246Used by:250
Symbol 250 MovieClip {fai.Statistics}Uses:37 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 229 233 236 239 242 245 249Used by:540
Symbol 251 BitmapUsed by:252
Symbol 252 GraphicUses:251Used by:253
Symbol 253 MovieClipUses:106 109 110 252Used by:281
Symbol 254 EditableTextUses:40Used by:255
Symbol 255 MovieClip {sr_fla.SellButton_36}Uses:227 254Used by:281
Symbol 256 MovieClipUses:38Used by:261
Symbol 257 TextUses:40Used by:261
Symbol 258 GraphicUsed by:259 261
Symbol 259 MovieClipUses:258Used by:261
Symbol 260 GraphicUsed by:261
Symbol 261 ButtonUses:256 257 259 260 38 258Used by:281
Symbol 262 MovieClipUses:38Used by:266 269
Symbol 263 GraphicUses:100Used by:266
Symbol 264 FontUsed by:265 268
Symbol 265 TextUses:264Used by:266
Symbol 266 ButtonUses:262 263 265 38Used by:281
Symbol 267 GraphicUses:100Used by:269
Symbol 268 TextUses:264Used by:269
Symbol 269 ButtonUses:262 267 268 38Used by:281
Symbol 270 EditableTextUses:40Used by:281
Symbol 271 EditableTextUses:5Used by:281
Symbol 272 EditableTextUses:40Used by:281
Symbol 273 EditableTextUses:40Used by:281
Symbol 274 EditableTextUses:40Used by:281
Symbol 275 EditableTextUses:40Used by:281
Symbol 276 EditableTextUses:40Used by:281
Symbol 277 EditableTextUses:40Used by:281
Symbol 278 EditableTextUses:40Used by:281
Symbol 279 EditableTextUses:40Used by:281
Symbol 280 EditableTextUses:40Used by:281
Symbol 281 MovieClip {fai.UnitInfo}Uses:210 253 255 261 266 269 270 271 272 273 274 275 276 277 278 279 280Used by:540
Symbol 282 GraphicUses:102Used by:294
Symbol 283 MovieClipUses:38Used by:285
Symbol 284 TextUses:40Used by:285
Symbol 285 ButtonUses:283 284 38Used by:294
Symbol 286 MovieClipUses:38Used by:289 291 293
Symbol 287 GraphicUses:104Used by:289
Symbol 288 TextUses:40Used by:289 293
Symbol 289 ButtonUses:286 287 288 38Used by:294
Symbol 290 TextUses:40Used by:291
Symbol 291 ButtonUses:286 290 38Used by:294
Symbol 292 GraphicUses:101Used by:293
Symbol 293 ButtonUses:286 288 292 38Used by:294
Symbol 294 MovieClip {fai.RightSideMenu}Uses:282 285 289 291 293Used by:540
Symbol 295 MovieClipUses:38Used by:297
Symbol 296 TextUses:40Used by:297
Symbol 297 ButtonUses:295 296 38Used by:348
Symbol 298 TextUses:40Used by:348
Symbol 299 TextUses:5Used by:348
Symbol 300 TextUses:5Used by:348
Symbol 301 TextUses:5Used by:348
Symbol 302 TextUses:40Used by:348
Symbol 303 BitmapUsed by:305
Symbol 304 BitmapUsed by:305
Symbol 305 GraphicUses:303 304Used by:348
Symbol 306 TextUses:5 40Used by:348
Symbol 307 TextUses:5Used by:348
Symbol 308 TextUses:5Used by:348
Symbol 309 TextUses:5Used by:348
Symbol 310 TextUses:5Used by:348
Symbol 311 TextUses:5Used by:348
Symbol 312 TextUses:40Used by:348
Symbol 313 BitmapUsed by:315
Symbol 314 BitmapUsed by:315
Symbol 315 GraphicUses:313 314Used by:348
Symbol 316 TextUses:5Used by:348
Symbol 317 GraphicUsed by:348
Symbol 318 TextUses:5Used by:348
Symbol 319 TextUses:40Used by:348
Symbol 320 TextUses:40 5Used by:348
Symbol 321 TextUses:40 5Used by:348
Symbol 322 TextUses:40 5Used by:348
Symbol 323 TextUses:40 5Used by:348
Symbol 324 TextUses:40 5Used by:348
Symbol 325 TextUses:5Used by:348
Symbol 326 TextUses:40Used by:348
Symbol 327 BitmapUsed by:328
Symbol 328 GraphicUses:327Used by:348
Symbol 329 TextUses:5Used by:348
Symbol 330 FontUsed by:331 338 343
Symbol 331 TextUses:330Used by:348
Symbol 332 TextUses:5Used by:348
Symbol 333 TextUses:5Used by:348
Symbol 334 TextUses:5Used by:348
Symbol 335 TextUses:5Used by:348
Symbol 336 GraphicUsed by:348
Symbol 337 TextUses:5Used by:348
Symbol 338 TextUses:330Used by:348
Symbol 339 TextUses:5Used by:348
Symbol 340 TextUses:5Used by:348
Symbol 341 TextUses:5Used by:348
Symbol 342 TextUses:40Used by:348
Symbol 343 TextUses:330Used by:348
Symbol 344 TextUses:40Used by:348
Symbol 345 TextUses:5Used by:348
Symbol 346 TextUses:5Used by:348
Symbol 347 TextUses:5Used by:348
Symbol 348 MovieClip {fai.TutorialMC}Uses:37 236 297 298 299 122 300 301 302 305 306 307 308 309 310 141 311 312 315 316 317 318 319 69 65 70 73 77 320 321 322 323 324 325 326 328 329 331 332 333 334 335 336 337 338 71 68 72 339 340 341 342 343 344 345 66 76 346 347Used by:540
Symbol 349 GraphicUses:103Used by:355
Symbol 350 TextUses:5Used by:355
Symbol 351 TextUses:5Used by:355
Symbol 352 EditableTextUses:40Used by:355
Symbol 353 TextUses:5Used by:355
Symbol 354 EditableTextUses:40Used by:355
Symbol 355 MovieClip {fai.Radar}Uses:349 350 351 352 353 354Used by:540
Symbol 356 GraphicUsed by:357
Symbol 357 MovieClipUses:356Used by:375
Symbol 358 MovieClip {fl.core.ComponentShim}Used by:375
Symbol 359 GraphicUsed by:360
Symbol 360 MovieClip {SliderThumb_upSkin}Uses:359Used by:375
Symbol 361 GraphicUsed by:362
Symbol 362 MovieClip {SliderThumb_overSkin}Uses:361Used by:375
Symbol 363 GraphicUsed by:364
Symbol 364 MovieClip {SliderThumb_downSkin}Uses:363Used by:375
Symbol 365 GraphicUsed by:366
Symbol 366 MovieClip {SliderThumb_disabledSkin}Uses:365Used by:375
Symbol 367 GraphicUsed by:368
Symbol 368 MovieClip {SliderTrack_skin}Uses:367Used by:375
Symbol 369 GraphicUsed by:370
Symbol 370 MovieClip {SliderTick_skin}Uses:369Used by:375
Symbol 371 GraphicUsed by:372
Symbol 372 MovieClip {SliderTrack_disabledSkin}Uses:371Used by:375
Symbol 373 GraphicUsed by:374
Symbol 374 MovieClip {focusRectSkin}Uses:373Used by:375
Symbol 375 MovieClip {fl.controls.Slider}Uses:357 358 360 362 364 366 368 370 372 374Used by:540
Symbol 376 GraphicUses:45Used by:377 380
Symbol 377 MovieClipUses:376Used by:380
Symbol 378 EditableTextUses:40Used by:380
Symbol 379 EditableTextUses:40Used by:380
Symbol 380 ButtonUses:377 378 379 376Used by:450
Symbol 381 BitmapUsed by:382
Symbol 382 GraphicUses:381Used by:383 386
Symbol 383 MovieClipUses:382Used by:386
Symbol 384 EditableTextUses:40Used by:386
Symbol 385 EditableTextUses:40Used by:386
Symbol 386 ButtonUses:383 384 385 382Used by:450
Symbol 387 BitmapUsed by:388
Symbol 388 GraphicUses:387Used by:389 392
Symbol 389 MovieClipUses:388Used by:392
Symbol 390 EditableTextUses:40Used by:392
Symbol 391 EditableTextUses:40Used by:392
Symbol 392 ButtonUses:389 390 391 388Used by:450
Symbol 393 BitmapUsed by:394
Symbol 394 GraphicUses:393Used by:395 398
Symbol 395 MovieClipUses:394Used by:398
Symbol 396 EditableTextUses:40Used by:398
Symbol 397 EditableTextUses:40Used by:398
Symbol 398 ButtonUses:395 396 397 394Used by:450
Symbol 399 BitmapUsed by:400
Symbol 400 GraphicUses:399Used by:401 404
Symbol 401 MovieClipUses:400Used by:404
Symbol 402 EditableTextUses:40Used by:404
Symbol 403 EditableTextUses:40Used by:404
Symbol 404 ButtonUses:401 402 403 400Used by:450
Symbol 405 BitmapUsed by:406
Symbol 406 GraphicUses:405Used by:407 410
Symbol 407 MovieClipUses:406Used by:410
Symbol 408 EditableTextUses:40Used by:410
Symbol 409 EditableTextUses:40Used by:410
Symbol 410 ButtonUses:407 408 409 406Used by:450
Symbol 411 BitmapUsed by:412
Symbol 412 GraphicUses:411Used by:413 416
Symbol 413 MovieClipUses:412Used by:416
Symbol 414 EditableTextUses:40Used by:416
Symbol 415 EditableTextUses:40Used by:416
Symbol 416 ButtonUses:413 414 415 412Used by:450
Symbol 417 BitmapUsed by:418
Symbol 418 GraphicUses:417Used by:419 422
Symbol 419 MovieClipUses:418Used by:422
Symbol 420 EditableTextUses:40Used by:422
Symbol 421 EditableTextUses:40Used by:422
Symbol 422 ButtonUses:419 420 421 418Used by:450
Symbol 423 BitmapUsed by:424
Symbol 424 GraphicUses:423Used by:425 428
Symbol 425 MovieClipUses:424Used by:428
Symbol 426 EditableTextUses:40Used by:428
Symbol 427 EditableTextUses:40Used by:428
Symbol 428 ButtonUses:425 426 427 424Used by:450
Symbol 429 BitmapUsed by:430
Symbol 430 GraphicUses:429Used by:431 434
Symbol 431 MovieClipUses:430Used by:434
Symbol 432 EditableTextUses:40Used by:434
Symbol 433 EditableTextUses:40Used by:434
Symbol 434 ButtonUses:431 432 433 430Used by:450
Symbol 435 BitmapUsed by:436
Symbol 436 GraphicUses:435Used by:437 440
Symbol 437 MovieClipUses:436Used by:440
Symbol 438 EditableTextUses:40Used by:440
Symbol 439 EditableTextUses:40Used by:440
Symbol 440 ButtonUses:437 438 439 436Used by:450
Symbol 441 BitmapUsed by:442
Symbol 442 GraphicUses:441Used by:443 446
Symbol 443 MovieClipUses:442Used by:446
Symbol 444 EditableTextUses:40Used by:446
Symbol 445 EditableTextUses:40Used by:446
Symbol 446 ButtonUses:443 444 445 442Used by:450
Symbol 447 MovieClipUses:50Used by:448
Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}Uses:50 447Used by:450
Symbol 449 MovieClipUses:93Used by:450
Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65}Uses:37 380 386 392 398 404 410 416 422 428 434 440 446 448 449Used by:472
Symbol 451 GraphicUsed by:461
Symbol 452 EditableTextUses:40Used by:461
Symbol 453 EditableTextUses:5Used by:461
Symbol 454 TextUses:40Used by:461
Symbol 455 EditableTextUses:40Used by:461
Symbol 456 MovieClipUses:230Used by:458 460
Symbol 457 TextUses:40Used by:458
Symbol 458 ButtonUses:456 457 230Used by:461
Symbol 459 TextUses:40Used by:460
Symbol 460 ButtonUses:456 459 230Used by:461
Symbol 461 MovieClip {PlanetsInfoMC}Uses:451 452 453 454 455 458 460Used by:472
Symbol 462 GraphicUsed by:464
Symbol 463 EditableTextUses:40Used by:464
Symbol 464 MovieClip {sr_fla.PlanetsLevelMessageMC_97}Uses:462 463Used by:472
Symbol 465 GraphicUsed by:466
Symbol 466 MovieClipUses:465Used by:468
Symbol 467 TextUses:40Used by:468
Symbol 468 MovieClipUses:466 467Used by:472
Symbol 469 GraphicUsed by:471
Symbol 470 TextUses:5Used by:471
Symbol 471 MovieClip {fai.SoundControlMC}Uses:469 470Used by:472
Symbol 472 MovieClip {fai.PlanetsMC}Uses:450 461 464 468 471Used by:540
Symbol 473 GraphicUsed by:485
Symbol 474 TextUses:40Used by:485
Symbol 475 GraphicUses:96Used by:485
Symbol 476 EditableTextUses:40Used by:485
Symbol 477 EditableTextUses:40Used by:485
Symbol 478 EditableTextUses:40Used by:485
Symbol 479 EditableTextUses:40Used by:485
Symbol 480 GraphicUsed by:481 484
Symbol 481 MovieClipUses:480Used by:484 523
Symbol 482 TextUses:40Used by:484
Symbol 483 TextUses:40Used by:484
Symbol 484 ButtonUses:481 482 483 480Used by:485
Symbol 485 MovieClip {UpHeader}Uses:473 107 108 474 475 476 477 478 479 484Used by:540
Symbol 486 GraphicUsed by:489
Symbol 487 FontUsed by:488 520
Symbol 488 TextUses:487Used by:489
Symbol 489 MovieClipUses:486 488Used by:490
Symbol 490 MovieClip {PauseMC}Uses:489Used by:540
Symbol 491 GraphicUsed by:494
Symbol 492 FontUsed by:493
Symbol 493 TextUses:492Used by:494
Symbol 494 MovieClip {SelectedSpriteTooltip}Uses:491 493Used by:540
Symbol 495 GraphicUses:95Used by:498
Symbol 496 TextUses:5Used by:498
Symbol 497 EditableTextUses:40Used by:498
Symbol 498 MovieClip {sr_fla.GameMessageMC_108}Uses:495 496 497Used by:499
Symbol 499 MovieClip {GameMessageMotion}Uses:498Used by:540
Symbol 500 GraphicUses:100Used by:501
Symbol 501 MovieClipUses:500Used by:502
Symbol 502 MovieClip {BuildingMC}Uses:501Used by:540
Symbol 503 GraphicUsed by:508
Symbol 504 EditableTextUses:5Used by:508
Symbol 505 EditableTextUses:5Used by:508
Symbol 506 TextUses:5Used by:508
Symbol 507 EditableTextUses:5Used by:508
Symbol 508 MovieClip {BombTooltipMC}Uses:503 504 107 505 506 507Used by:540
Symbol 509 GraphicUsed by:510
Symbol 510 MovieClipUses:143 509Used by:511
Symbol 511 MovieClip {fai.bomb.CumulativeBomb}Uses:510Used by:540
Symbol 512 GraphicUsed by:513
Symbol 513 MovieClipUses:141 512Used by:514
Symbol 514 MovieClip {fai.bomb.NitroBomb}Uses:513Used by:540
Symbol 515 GraphicUsed by:519
Symbol 516 GraphicUsed by:517
Symbol 517 MovieClipUses:516Used by:519
Symbol 518 GraphicUsed by:519
Symbol 519 MovieClip {fai.bomb.NuclearMissile}Uses:515 517 518Used by:540
Symbol 520 EditableTextUses:487Used by:523
Symbol 521 GraphicUsed by:522
Symbol 522 MovieClipUses:521Used by:523
Symbol 523 MovieClip {SwitchButton}Uses:481 520 522Used by:540
Symbol 524 GraphicUses:100Used by:525
Symbol 525 MovieClip {RepairSign}Uses:524Used by:540
Symbol 526 Sound {Sound_upgrade}Used by:540
Symbol 527 Sound {Sound_unpause}Used by:540
Symbol 528 Sound {Sound_stat_appear}Used by:540
Symbol 529 Sound {Sound_tada}Used by:540
Symbol 530 Sound {Sound_planets}Used by:540
Symbol 531 Sound {Sound_new_wave}Used by:540
Symbol 532 Sound {Sound_missile_turret_launch}Used by:540
Symbol 533 Sound {Sound_laser2}Used by:540
Symbol 534 Sound {Sound_laser1}Used by:540
Symbol 535 Sound {Sound_explosion1}Used by:540
Symbol 536 Sound {Sound_defeat}Used by:540
Symbol 537 Sound {Sound_click1}Used by:540
Symbol 538 Sound {Sound_click}Used by:540
Symbol 539 Sound {Sound_build}Used by:540
Symbol 540 MovieClip {sr_fla.BibbAssetsMC_20}Uses:65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 97 98 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 250 281 294 348 355 375 472 485 490 494 499 502 508 511 514 519 523 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539Used by:Timeline

Instance Names

"loadingMC"Frame 1Symbol 10 MovieClip {LoadingMC}
"main_menu"Frame 20Symbol 64 MovieClip {fai.MainMenuMC}
"assets_bibb"Frame 20Symbol 540 MovieClip {sr_fla.BibbAssetsMC_20}
"progress_mc"Symbol 10 MovieClip {LoadingMC} Frame 1Symbol 4 MovieClip
"loaded_txt"Symbol 10 MovieClip {LoadingMC} Frame 1Symbol 6 EditableText
"error_txt"Symbol 10 MovieClip {LoadingMC} Frame 1Symbol 7 EditableText
"start_game_button"Symbol 64 MovieClip {fai.MainMenuMC} Frame 1Symbol 42 Button
"hs_button"Symbol 64 MovieClip {fai.MainMenuMC} Frame 1Symbol 44 Button
"play_all_levels_button"Symbol 64 MovieClip {fai.MainMenuMC} Frame 1Symbol 51 Button
"playMoreBt"Symbol 64 MovieClip {fai.MainMenuMC} Frame 1Symbol 56 Button
"onSiteBt"Symbol 64 MovieClip {fai.MainMenuMC} Frame 1Symbol 60 Button
"stat_title"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 212 EditableText
"killed_txt"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 218 EditableText
"lost_txt"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 219 EditableText
"crystals_txt"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 220 EditableText
"built_txt"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 221 EditableText
"bombs_txt"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 222 EditableText
"score_txt"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 224 EditableText
"play_again_button"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 229 Button
"main_menu_button"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 233 Button
"continue_button"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 236 Button
"final_victory"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 239 MovieClip
"firework2"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 242 MovieClip
"firework1"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 245 MovieClip
"submit_score_button"Symbol 250 MovieClip {fai.Statistics} Frame 1Symbol 249 Button
"caption"Symbol 255 MovieClip {sr_fla.SellButton_36} Frame 1Symbol 254 EditableText
"info_icons"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 253 MovieClip
"sell_button"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 255 MovieClip {sr_fla.SellButton_36}
"upgrade_button"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 261 Button
"repair_button"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 266 Button
"stop_repair_button"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 269 Button
"title"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 270 EditableText
"description"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 271 EditableText
"attack"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 272 EditableText
"range"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 273 EditableText
"armor"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 274 EditableText
"crystals"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 275 EditableText
"up_attack"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 276 EditableText
"up_armor"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 277 EditableText
"up_crystals"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 278 EditableText
"health"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 279 EditableText
"building_txt"Symbol 281 MovieClip {fai.UnitInfo} Frame 1Symbol 280 EditableText
"menu_button"Symbol 294 MovieClip {fai.RightSideMenu} Frame 1Symbol 285 Button
"sound_off_button"Symbol 294 MovieClip {fai.RightSideMenu} Frame 1Symbol 289 Button
"pause_button"Symbol 294 MovieClip {fai.RightSideMenu} Frame 1Symbol 291 Button
"sound_on_button"Symbol 294 MovieClip {fai.RightSideMenu} Frame 1Symbol 293 Button
"continue_button"Symbol 348 MovieClip {fai.TutorialMC} Frame 1Symbol 236 Button
"skip_button"Symbol 348 MovieClip {fai.TutorialMC} Frame 1Symbol 297 Button
"enemy_count"Symbol 355 MovieClip {fai.Radar} Frame 1Symbol 352 EditableText
"current_wave"Symbol 355 MovieClip {fai.Radar} Frame 1Symbol 354 EditableText
"level1"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 380 Button
"level2"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 386 Button
"level3"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 392 Button
"level4"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 398 Button
"level5"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 404 Button
"level6"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 410 Button
"level7"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 416 Button
"level8"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 422 Button
"level9"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 428 Button
"level10"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 434 Button
"level11"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 440 Button
"level12"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 446 Button
"rebel1"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel2"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel3"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel4"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel5"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel6"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel8"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel7"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel9"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel10"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel12"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"rebel11"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 448 MovieClip {sr_fla.RebelArmsMC_90}
"empire3"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"empire2"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"empire4"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"empire5"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"empire6"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"empire8"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"empire7"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"empire9"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"empire11"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"empire12"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"empire10"Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65} Frame 1Symbol 449 MovieClip
"title"Symbol 461 MovieClip {PlanetsInfoMC} Frame 1Symbol 452 EditableText
"desc"Symbol 461 MovieClip {PlanetsInfoMC} Frame 1Symbol 453 EditableText
"waves"Symbol 461 MovieClip {PlanetsInfoMC} Frame 1Symbol 455 EditableText
"play_button"Symbol 461 MovieClip {PlanetsInfoMC} Frame 1Symbol 458 Button
"resume_game_button"Symbol 461 MovieClip {PlanetsInfoMC} Frame 1Symbol 460 Button
"msg"Symbol 464 MovieClip {sr_fla.PlanetsLevelMessageMC_97} Frame 1Symbol 463 EditableText
"space"Symbol 472 MovieClip {fai.PlanetsMC} Frame 1Symbol 450 MovieClip {sr_fla.PlanetsBackMC_65}
"level_info"Symbol 472 MovieClip {fai.PlanetsMC} Frame 1Symbol 461 MovieClip {PlanetsInfoMC}
"level_msg"Symbol 472 MovieClip {fai.PlanetsMC} Frame 1Symbol 464 MovieClip {sr_fla.PlanetsLevelMessageMC_97}
"onlyatdg"Symbol 472 MovieClip {fai.PlanetsMC} Frame 1Symbol 468 MovieClip
"sound_control"Symbol 472 MovieClip {fai.PlanetsMC} Frame 1Symbol 471 MovieClip {fai.SoundControlMC}
"score"Symbol 485 MovieClip {UpHeader} Frame 1Symbol 476 EditableText
"crystals"Symbol 485 MovieClip {UpHeader} Frame 1Symbol 477 EditableText
"energy"Symbol 485 MovieClip {UpHeader} Frame 1Symbol 478 EditableText
"wave_time"Symbol 485 MovieClip {UpHeader} Frame 1Symbol 479 EditableText
"send_next_button"Symbol 485 MovieClip {UpHeader} Frame 1Symbol 484 Button
"message_txt"Symbol 498 MovieClip {sr_fla.GameMessageMC_108} Frame 1Symbol 497 EditableText
"msg"Symbol 499 MovieClip {GameMessageMotion} Frame 1Symbol 498 MovieClip {sr_fla.GameMessageMC_108}
"title"Symbol 508 MovieClip {BombTooltipMC} Frame 1Symbol 504 EditableText
"crystals"Symbol 508 MovieClip {BombTooltipMC} Frame 1Symbol 505 EditableText
"epicenter"Symbol 508 MovieClip {BombTooltipMC} Frame 1Symbol 507 EditableText
"buttonLabel"Symbol 523 MovieClip {SwitchButton} Frame 1Symbol 520 EditableText

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata not present, AS3.
Protect (24)Timeline Frame 131 bytes "..$1$Y0$tSnc2iLqYqcWNP25JpmdA.."

Labels

"export"Frame 3
"logo"Frame 10
"_up"Symbol 255 MovieClip {sr_fla.SellButton_36} Frame 1
"_over"Symbol 255 MovieClip {sr_fla.SellButton_36} Frame 2
"_down"Symbol 255 MovieClip {sr_fla.SellButton_36} Frame 3
"page1"Symbol 348 MovieClip {fai.TutorialMC} Frame 1
"page2"Symbol 348 MovieClip {fai.TutorialMC} Frame 2
"page3"Symbol 348 MovieClip {fai.TutorialMC} Frame 3
"page4"Symbol 348 MovieClip {fai.TutorialMC} Frame 4
"page5"Symbol 348 MovieClip {fai.TutorialMC} Frame 5
"frozen"Symbol 448 MovieClip {sr_fla.RebelArmsMC_90} Frame 1
"glow"Symbol 448 MovieClip {sr_fla.RebelArmsMC_90} Frame 2
"pause"Symbol 490 MovieClip {PauseMC} Frame 1
"start"Symbol 523 MovieClip {SwitchButton} Frame 1
"opened"Symbol 523 MovieClip {SwitchButton} Frame 5
"end"Symbol 523 MovieClip {SwitchButton} Frame 10




http://swfchan.com/10/48005/info.shtml
Created: 30/4 -2019 18:50:00 Last modified: 30/4 -2019 18:50:00 Server time: 22/12 -2024 23:31:48