Section 1
//Wave (com.elf7.algo.Wave)
package com.elf7.algo {
import flash.display.*;
public class Wave {
private const BORDER:Boolean = true;
private const MAX_ITER:int = 100;
private var done:Boolean;// = false
private var open:Array;
private var close:Object;
private var end:Object;
private var map:Array;
private var start:Object;
private var path:Array;
private var points:Object;
public var testParent:MovieClip;
private var current:Object;
private var counter:int;// = 0
public function Wave(){
done = false;
counter = 0;
super();
}
private function getH(_arg1:Object):Number{
return (((Math.abs((end.x - _arg1.x)) + Math.abs((end.y - _arg1.y))) * 10));
}
private function refreshPoint(_arg1:Object):void{
_arg1.g = (getG(_arg1.parent, _arg1) + _arg1.parent.g);
_arg1.h = getH(_arg1);
_arg1.f = (_arg1.g + _arg1.h);
points[((String(_arg1.x) + "_") + String(_arg1.y))] = _arg1;
}
private function isNear(_arg1:Object, _arg2:Object):Boolean{
if ((((_arg1 == null)) || ((_arg2 == null)))){
return (false);
};
if ((((Math.abs((_arg1.x - _arg2.x)) < 2)) && ((Math.abs((_arg1.y - _arg2.y)) < 2)))){
return (true);
};
return (false);
}
private function doWithPoint(_arg1:Object, _arg2:Object):void{
var _local3:*;
var _local4:Object;
_local3 = close[((String(_arg1.x) + "_") + String(_arg1.y))];
if (_local3 != 1){
if (_local3 == 0){
_local4 = points[((String(_arg1.x) + "_") + String(_arg1.y))];
if (_local4.g > (_arg2.g + getG(_arg2, _local4))){
_local4.parent = _arg2;
refreshPoint(_local4);
};
} else {
if ((((end.x == _arg1.x)) && ((end.y == _arg1.y)))){
end.parent = _arg2;
done = true;
} else {
close[((String(_arg1.x) + "_") + String(_arg1.y))] = 0;
_arg1.parent = _arg2;
refreshPoint(_arg1);
open.push(_arg1);
};
};
};
}
private function isNormal(_arg1:Object):Boolean{
if ((((((((_arg1.x < 0)) || ((_arg1.x >= map.length)))) || ((_arg1.y < 0)))) || ((_arg1.y >= map[0].length)))){
return (false);
};
if (map[_arg1.x][_arg1.y] == 1){
return (false);
};
return (true);
}
private function checkAround(_arg1:Object):void{
var _local2:int;
var _local3:int;
var _local4:Object;
var _local5:Boolean;
if (testParent != null){
};
_local2 = 0;
_local3 = 0;
_local5 = true;
_local2 = -1;
_local3 = -1;
_local4 = {x:(_arg1.x + _local2), y:(_arg1.y + _local3), g:0, h:0, f:0, parent:null, pos:0};
if (isNormal(_local4)){
if (((!(BORDER)) || (!((((map[(_arg1.x - 1)][_arg1.y] == 1)) || ((map[_arg1.x][(_arg1.y - 1)] == 1))))))){
doWithPoint(_local4, _arg1);
};
};
if (done){
return;
};
_local2 = 0;
_local3 = -1;
_local4 = {x:(_arg1.x + _local2), y:(_arg1.y + _local3), g:0, h:0, f:0, parent:null, pos:0};
if (isNormal(_local4)){
doWithPoint(_local4, _arg1);
};
if (done){
return;
};
_local2 = 1;
_local3 = -1;
_local4 = {x:(_arg1.x + _local2), y:(_arg1.y + _local3), g:0, h:0, f:0, parent:null, pos:0};
if (isNormal(_local4)){
if (((!(BORDER)) || (!((((map[(_arg1.x + 1)][_arg1.y] == 1)) || ((map[_arg1.x][(_arg1.y - 1)] == 1))))))){
doWithPoint(_local4, _arg1);
};
};
if (done){
return;
};
_local2 = -1;
_local3 = 1;
_local4 = {x:(_arg1.x + _local2), y:(_arg1.y + _local3), g:0, h:0, f:0, parent:null, pos:0};
if (isNormal(_local4)){
if (((!(BORDER)) || (!((((map[(_arg1.x - 1)][_arg1.y] == 1)) || ((map[_arg1.x][(_arg1.y + 1)] == 1))))))){
doWithPoint(_local4, _arg1);
};
};
if (done){
return;
};
_local2 = 0;
_local3 = 1;
_local4 = {x:(_arg1.x + _local2), y:(_arg1.y + _local3), g:0, h:0, f:0, parent:null, pos:0};
if (isNormal(_local4)){
doWithPoint(_local4, _arg1);
};
if (done){
return;
};
_local2 = 1;
_local3 = 1;
_local4 = {x:(_arg1.x + _local2), y:(_arg1.y + _local3), g:0, h:0, f:0, parent:null, pos:0};
if (isNormal(_local4)){
if (((!(BORDER)) || (!((((map[(_arg1.x + 1)][_arg1.y] == 1)) || ((map[_arg1.x][(_arg1.y + 1)] == 1))))))){
doWithPoint(_local4, _arg1);
};
};
if (done){
return;
};
_local2 = -1;
_local3 = 0;
_local4 = {x:(_arg1.x + _local2), y:(_arg1.y + _local3), g:0, h:0, f:0, parent:null, pos:0};
if (isNormal(_local4)){
doWithPoint(_local4, _arg1);
};
if (done){
return;
};
_local2 = 1;
_local3 = 0;
_local4 = {x:(_arg1.x + _local2), y:(_arg1.y + _local3), g:0, h:0, f:0, parent:null, pos:0};
if (isNormal(_local4)){
doWithPoint(_local4, _arg1);
};
}
private function removeFromOpenList(_arg1:Object):void{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < open.length) {
if (open[_local2] == _arg1){
open.splice(_local2, 1);
break;
};
_local2++;
};
}
private function getG(_arg1:Object, _arg2:Object):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
if ((((Math.abs(_local3) == 1)) && ((Math.abs(_local4) == 1)))){
return (14);
};
return (10);
}
public function findPath(_arg1:Array, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Array{
end = {x:_arg4, y:_arg5, g:0, h:0, f:0, parent:null, pos:0};
start = {x:_arg2, y:_arg3, g:0, h:0, f:0, parent:null, pos:0};
map = _arg1;
close = {};
points = {};
open = new Array();
open.push(start);
while (!(done)) {
counter++;
if (counter >= MAX_ITER){
break;
};
if (open.length == 0){
break;
};
open.sortOn("f", Array.NUMERIC);
current = open[0];
close[((String(current.x) + "_") + String(current.y))] = 1;
removeFromOpenList(current);
checkAround(current);
if (done){
break;
};
};
if (done){
path = new Array();
current = end;
path.push({x:end.x, y:end.y});
current = end.parent;
while (((!((current.x == start.x))) || (!((current.y == start.y))))) {
path.splice(0, 0, {x:current.x, y:current.y});
current = current.parent;
};
path.splice(0, 0, {x:start.x, y:start.y});
return (path);
};
return (null);
}
}
}//package com.elf7.algo
Section 2
//GameField (com.elf7.level.GameField)
package com.elf7.level {
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
import com.elf7.units.*;
import flash.text.*;
import com.elf7.algo.*;
import fl.transitions.easing.*;
import flash.utils.*;
import com.elf7.*;
import com.elf7.menu.*;
import flash.geom.*;
public dynamic class GameField extends MovieClip {
public const FIELD_WIDTH:Number = 1590;
public const MAX_ENEMIES:int = 25;
public const FIELD_HEIGHT:Number = 1590;
public const MAX_UNITS:int = 17;
public var unitsDump:Array;
public var left:Boolean;// = false
public var spawnCounter:int;// = 0
public var right:Boolean;// = false
public var currentWave:int;// = 0
public var enemies:Array;
public var specialLayer:MovieClip;
public var gameStarted:Boolean;// = false
public var bg:MovieClip;
public var flies:Array;
public var g:MovieClip;
public var d:Boolean;// = false
public var solderRank:Array;
public var a:Boolean;// = false
public var currentType:String;// = "0"
public var w:Boolean;// = false
public var lastY:Number;// = 0
public var bugWaves:Object;
public var aniCounter:int;// = 0
public var spawnTimer:Timer;
public var CELL_WIDTH:Number;// = 30
public var lastX:Number;// = 0
public var selected:Array;
public var sol1:Array;
public var down:Boolean;// = false
public var up:Boolean;// = false
public var currentUnit:DisplayObject;
public var buyGunInfo:Object;
public var MIN_TIME;// = 800
public var newX:Number;// = 0
public var clickLayer:MovieClip;
public var sol2:Array;
public var s:Boolean;// = false
public var enemiesLayer:MovieClip;
public var TOWER_MAX_HEALTH:Number;// = 2000
public var CASTLE_X:Number;// = 21
public var CASTLE_Y:Number;// = 19
public var TILE_WIDTH:Number;// = 60
public var sol0:Array;
public var newY:Number;// = 0
public var repairMenu:RepairMenu;
public var MAX_TIME:Number;// = 2000
public var gun1:Array;
public var melody:String;// = "l"
public var gun2:Array;
public var castle:MovieClip;
public var shopAni:Tween;
public var currentGun:BigGun;
public var mguns:Array;
public var unitsLayer:MovieClip;
public var k4:Boolean;// = false
public var k6:Boolean;// = false
public var tower_l_u:Object;
public var k1:Boolean;// = false
public var castleDump:Object;
public var tower_l_d:Object;
public var gun_cursor:MovieClip;
public var endTimer:Timer;
public var k7:Boolean;// = false
public var wall_r:Object;
public var wall_l:Object;
public var repairCursor:MovieClip;
public var k2:Boolean;// = false
public var WALL_MAX_HEALTH:Number;// = 5000
public var grid:MovieClip;
public var k3:Boolean;// = false
public var cursor:MovieClip;
public var k5:Boolean;// = false
public var CELLS_NUM:Number;// = 53
public var wall_u:Object;
public var map:Array;
public var k8:Boolean;// = false
public var help:Help;
public var units:Array;
public var cleanCounter:int;// = 0
public var wall_d:Object;
public var bloodLayer:MovieClip;
public var spawnLastEnemy:Boolean;// = false
public var buyCursor:MovieClip;
public var fliesLayer:MovieClip;
public var castleCrash:Boolean;// = false
public var gun0:Array;
public var gunRank:Array;
public var tower_r_d:Object;
public var real:Array;
public var rocks:MovieClip;
public var tower_r_u:Object;
public var ani0:Tween;
public var ani1:Tween;
public var ani2:Tween;
public var zoom:Boolean;// = false
public var quick:Object;
public var game:Game;
public var dump:Array;
public var ani:Tween;
public function GameField(){
WALL_MAX_HEALTH = 5000;
TOWER_MAX_HEALTH = 2000;
CELLS_NUM = 53;
CELL_WIDTH = 30;
TILE_WIDTH = 60;
CASTLE_X = 21;
CASTLE_Y = 19;
MIN_TIME = 800;
MAX_TIME = 2000;
map = new Array();
real = new Array();
units = new Array();
enemies = new Array();
flies = new Array();
mguns = new Array();
selected = new Array();
bugWaves = {};
spawnCounter = 0;
spawnTimer = new Timer(2000, 1);
endTimer = new Timer(4000, 1);
currentWave = 0;
cleanCounter = 0;
lastX = 0;
lastY = 0;
newX = 0;
newY = 0;
zoom = false;
castleDump = {};
wall_l = {};
wall_r = {};
wall_d = {};
wall_u = {};
tower_l_u = {};
tower_l_d = {};
tower_r_u = {};
tower_r_d = {};
quick = {};
up = false;
down = false;
right = false;
left = false;
w = false;
s = false;
a = false;
d = false;
k1 = false;
k2 = false;
k3 = false;
k4 = false;
k5 = false;
k6 = false;
k7 = false;
k8 = false;
melody = "l";
castleCrash = false;
currentType = "0";
aniCounter = 0;
spawnLastEnemy = false;
gameStarted = false;
super();
}
public function onMDown(_arg1:MouseEvent):void{
if (game.pause){
return;
};
if (clickLayer != null){
removeChild(clickLayer);
};
clickLayer = (addChild(new MovieClip()) as MovieClip);
lastX = ((stage.mouseX - x) / scaleX);
lastY = ((stage.mouseY - y) / scaleY);
addEventListener(Event.ENTER_FRAME, drawRect, false, 0, true);
}
public function createRocks():void{
var _local1:Number;
var _local2:MovieClip;
_local1 = 0.85;
_local2 = (rocks.addChild(new RockWall()) as MovieClip);
_local2.scaleX = _local1;
_local2.scaleY = _local1;
_local2.x = 50;
_local2.y = 50;
_local2.cacheAsBitmap = true;
map[22][9] = 1;
map[18][10] = 1;
map[19][10] = 1;
map[18][11] = 1;
map[19][11] = 1;
map[18][12] = 1;
map[19][12] = 1;
map[20][11] = 1;
map[20][12] = 1;
map[20][13] = 1;
map[19][13] = 1;
map[22][12] = 1;
map[23][12] = 1;
map[23][13] = 1;
map[22][13] = 1;
map[32][12] = 1;
map[32][13] = 1;
map[48][18] = 1;
map[47][18] = 1;
map[46][18] = 1;
map[45][17] = 1;
map[46][17] = 1;
map[47][17] = 1;
map[48][16] = 1;
map[47][16] = 1;
map[46][16] = 1;
map[45][16] = 1;
map[45][15] = 1;
map[46][15] = 1;
map[47][15] = 1;
map[48][15] = 1;
map[49][15] = 1;
map[50][15] = 1;
map[50][14] = 1;
map[49][14] = 1;
map[48][14] = 1;
map[47][14] = 1;
map[44][20] = 1;
map[41][22] = 1;
map[42][22] = 1;
map[41][23] = 1;
map[42][23] = 1;
map[47][27] = 1;
map[47][28] = 1;
map[42][29] = 1;
map[41][29] = 1;
map[41][28] = 1;
map[42][28] = 1;
map[43][33] = 1;
map[44][33] = 1;
map[44][34] = 1;
map[43][34] = 1;
map[42][34] = 1;
map[43][35] = 1;
map[44][35] = 1;
map[45][35] = 1;
map[32][45] = 1;
map[31][45] = 1;
map[31][44] = 1;
map[32][44] = 1;
map[31][43] = 1;
map[32][43] = 1;
map[33][43] = 1;
map[33][42] = 1;
map[32][42] = 1;
map[31][42] = 1;
map[25][41] = 1;
map[25][40] = 1;
map[26][40] = 1;
map[27][40] = 1;
map[27][39] = 1;
map[26][39] = 1;
map[19][50] = 1;
map[19][49] = 1;
map[18][51] = 1;
map[18][50] = 1;
map[18][49] = 1;
map[17][49] = 1;
map[17][50] = 1;
map[17][51] = 1;
map[19][46] = 1;
map[19][45] = 1;
map[19][44] = 1;
map[19][43] = 1;
map[18][43] = 1;
map[18][44] = 1;
map[18][45] = 1;
map[18][46] = 1;
map[17][46] = 1;
map[17][45] = 1;
map[17][44] = 1;
map[17][43] = 1;
map[17][42] = 1;
map[16][42] = 1;
map[16][43] = 1;
map[16][44] = 1;
map[16][45] = 1;
map[16][46] = 1;
map[15][46] = 1;
map[15][45] = 1;
map[15][44] = 1;
map[15][43] = 1;
map[15][42] = 1;
map[14][45] = 1;
map[14][46] = 1;
map[13][18] = 1;
map[6][23] = 1;
map[7][23] = 1;
map[8][23] = 1;
map[10][28] = 1;
map[11][28] = 1;
map[11][29] = 1;
map[10][29] = 1;
map[14][31] = 1;
map[15][31] = 1;
map[10][33] = 1;
map[11][33] = 1;
map[10][34] = 1;
map[11][34] = 1;
map[11][35] = 1;
map[12][35] = 1;
map[12][34] = 1;
}
public function testClick(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
}
public function destroyShop(_arg1:TweenEvent):void{
var _local2:int;
var _local3:MovieClip;
var _local4:SimpleButton;
_local2 = 0;
_local3 = (game.getChildByName("shop") as MovieClip);
_local4 = (_local3.getChildByName("close") as SimpleButton);
_local4.addEventListener(MouseEvent.CLICK, onShopClose);
shopAni.removeEventListener("motionFinish", destroyShop);
shopAni = null;
_local2 = 0;
while (_local2 < 5) {
if (_local2 > 2){
(_local3.getChildByName(("buy" + String(_local2))) as SimpleButton).removeEventListener(MouseEvent.MOUSE_DOWN, shopMouseDown);
} else {
(_local3.getChildByName(("buy" + String(_local2))) as SimpleButton).removeEventListener(MouseEvent.CLICK, shopClick);
};
(_local3.getChildByName(("sell" + String(_local2))) as SimpleButton).removeEventListener(MouseEvent.CLICK, shopClick);
_local2++;
};
while (_local3.numChildren) {
_local3.removeChildAt(0);
};
parent.removeChild(_local3);
}
public function onHelpClose():void{
if (!gameStarted){
gameStarted = true;
addEventListener(Event.ENTER_FRAME, globalAI, false, 0, true);
} else {
enableMenus();
game.pause = false;
};
}
public function placeSolderRandomly(_arg1:Object):void{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
_local2 = new Array();
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = -1;
_local8 = -1;
if (wall_l.solders[((String(wall_l.cells[9].x) + "_") + String(wall_l.cells[9].y))].length != 1){
_local2.push("wall_l");
};
if (wall_r.solders[((String(wall_r.cells[9].x) + "_") + String(wall_r.cells[9].y))].length != 1){
_local2.push("wall_r");
};
if (wall_d.solders[((String(wall_d.cells[9].x) + "_") + String(wall_d.cells[9].y))].length != 1){
_local2.push("wall_d");
};
if (wall_u.solders[((String(wall_u.cells[9].x) + "_") + String(wall_u.cells[9].y))].length != 1){
_local2.push("wall_u");
};
_local4 = Math.round((Math.random() * (_local2.length - 1)));
_local3 = 0;
while (_local3 < this[_local2[_local4]].cells.length) {
if (this[_local2[_local4]].solders[((String(this[_local2[_local4]].cells[_local3].x) + "_") + String(this[_local2[_local4]].cells[_local3].y))].length == 0){
_local7 = this[_local2[_local4]].cells[_local3].x;
_local8 = this[_local2[_local4]].cells[_local3].y;
break;
};
_local3++;
};
createSolder(_local7, _local8, _arg1);
}
public function sendSolder(_arg1:Solder, _arg2:int, _arg3:int):void{
var _local4:Array;
var _local5:Mark;
var _local6:Number;
_local4 = new Wave().findPath(map, _arg1.pos.x, _arg1.pos.y, _arg2, _arg3);
if (_arg1.path.length > 1){
_arg1.path.splice(1);
};
_local6 = 1;
while (_local6 < _local4.length) {
_arg1.path.push(_local4[_local6]);
_local6++;
};
_arg1.rotateByPath();
_arg1.target = null;
_arg1.action = _arg1.ACTION_MOVE;
}
public function shopClick(_arg1:MouseEvent):void{
var _local2:MovieClip;
var _local3:Array;
var _local4:Object;
if (!_arg1.target.enabled){
return;
};
_local2 = (game.getChildByName("shop") as MovieClip);
if (_arg1.target.name == "repair"){
repairMenu = (game.addChild(new RepairMenu()) as RepairMenu);
repairMenu.x = 45;
repairMenu.y = 15;
repairMenu.init();
return;
};
_local3 = [160, 400, 250];
_local4 = {};
if (_arg1.target.name.indexOf("buy") > -1){
if (Number(_arg1.target.name.substr(3, 1)) > 2){
} else {
(_local2.getChildByName((("t" + _arg1.target.name.substr(3, 1)) + "0")) as TextField).text = String((int((_local2.getChildByName((("t" + _arg1.target.name.substr(3, 1)) + "0")) as TextField).text) - 1));
_local4.type = int(_arg1.target.name.substr(3, 1));
_local4.level = 0;
_local4.killed = 0;
_local4.exp = 0;
_local4.name = game.names[Math.floor((Math.random() * (game.names.length - 0.01)))];
placeSolderRandomly(_local4);
game.valourPoints = (game.valourPoints - _local3[_local4.type]);
shopInit();
};
} else {
if (Number(_arg1.target.name.substr(4, 1)) > 2){
sellGun((int(_arg1.target.name.substr(4, 1)) - 2));
} else {
sellUnit(int(_arg1.target.name.substr(4, 1)));
};
};
}
public function convertToBitMap(_arg1:DisplayObjectContainer, _arg2:Number, _arg3:Number, _arg4:Boolean=false):DisplayObject{
var _local5:DisplayObjectContainer;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:BitmapData;
var _local10:Bitmap;
var _local11:Rectangle;
_local5 = (_arg1.parent as DisplayObjectContainer);
_local6 = _local5.getChildIndex((_arg1 as DisplayObject));
_local7 = _arg1.x;
_local8 = _arg1.y;
_local9 = new BitmapData(_arg2, _arg3, _arg4, 0);
_local11 = new Rectangle(0, 0, _arg2, _arg3);
_local9.draw(_local5, null, null, null, _local11);
_local10 = new Bitmap(_local9);
_local5.removeChild(_arg1);
_local10.x = _local7;
_local10.y = _local8;
return (_local5.addChildAt((_local10 as DisplayObject), _local6));
}
public function onSOut(_arg1:MouseEvent):void{
if (game.pause){
return;
};
(game.getChildByName("ss") as MovieClip).visible = false;
}
public function setTargets():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = 0;
dump = new Array();
unitsDump = new Array();
_local1 = 0;
while (_local1 < map.length) {
dump[_local1] = new Array();
unitsDump[_local1] = new Array();
_local2 = 0;
while (_local2 < map[0].length) {
dump[_local1][_local2] = new Array();
unitsDump[_local1][_local2] = new Array();
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < units.length) {
_local3 = Math.floor((units[_local1].x / CELL_WIDTH));
_local4 = Math.floor((units[_local1].y / CELL_WIDTH));
unitsDump[_local3][_local4].push(units[_local1]);
_local1++;
};
_local1 = 0;
while (_local1 < enemies.length) {
_local3 = Math.floor((enemies[_local1].x / CELL_WIDTH));
_local4 = Math.floor((enemies[_local1].y / CELL_WIDTH));
dump[_local3][_local4].push(enemies[_local1]);
_local1++;
};
}
public function createBg():void{
var _local1:MovieClip;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
_local3 = 0;
_local4 = Math.round((FIELD_WIDTH / TILE_WIDTH));
_local5 = Math.round((FIELD_HEIGHT / TILE_WIDTH));
if (bg != null){
removeChild(bg);
bg = null;
};
bg = (addChildAt(new MovieClip(), 0) as MovieClip);
_local2 = 0;
while (_local2 < _local4) {
_local3 = 0;
while (_local3 < _local5) {
_local1 = (bg.addChild(new Tile0()) as MovieClip);
_local1.x = (_local2 * TILE_WIDTH);
_local1.y = (_local3 * TILE_WIDTH);
_local3++;
};
_local2++;
};
rocks = (bg.addChild(new MovieClip()) as MovieClip);
rocks.cacheAsBitmap = true;
createRocks();
convertToBitMap((bg as DisplayObjectContainer), bg.width, bg.height);
bg = null;
}
public function onCursorClick(_arg1:MouseEvent):void{
if ((_arg1.target as MovieClip).currentFrame == 1){
return;
};
cursor.stopDrag();
cursor.visible = false;
currentGun.target.x = _arg1.target.x;
currentGun.target.y = _arg1.target.y;
currentGun = null;
}
public function setRanks():void{
solderRank = new Array();
solderRank[0] = 0;
solderRank[1] = 20;
solderRank[2] = 60;
solderRank[3] = 110;
solderRank[4] = 180;
solderRank[5] = 280;
solderRank[6] = 400;
gunRank = new Array();
gunRank[0] = 0;
gunRank[1] = 40;
gunRank[2] = 200;
gunRank[3] = 400;
sol0 = new Array();
sol1 = new Array();
sol2 = new Array();
gun0 = new Array();
gun1 = new Array();
gun2 = new Array();
sol0[0] = {health:30, damage:6};
sol0[1] = {health:40, damage:9};
sol0[2] = {health:50, damage:12};
sol0[3] = {health:70, damage:16};
sol0[4] = {health:90, damage:20};
sol0[5] = {health:110, damage:25};
sol0[6] = {health:160, damage:35};
sol1[0] = {health:100, damage:60};
sol1[1] = {health:120, damage:80};
sol1[2] = {health:140, damage:100};
sol1[3] = {health:160, damage:120};
sol1[4] = {health:180, damage:140};
sol1[5] = {health:200, damage:160};
sol1[6] = {health:250, damage:200};
sol2[0] = {health:30, damage:10};
sol2[1] = {health:40, damage:15};
sol2[2] = {health:50, damage:20};
sol2[3] = {health:60, damage:25};
sol2[4] = {health:70, damage:30};
sol2[5] = {health:80, damage:35};
sol2[6] = {health:100, damage:40};
gun1[0] = {damage:150};
gun1[1] = {damage:200};
gun1[2] = {damage:250};
gun1[3] = {damage:400};
gun2[0] = {damage:6};
gun2[1] = {damage:10};
gun2[2] = {damage:15};
gun2[3] = {damage:20};
}
public function shopMouseDown(_arg1:MouseEvent):void{
var _local2:Object;
var _local3:Array;
var _local4:int;
var _local5:MovieClip;
if (!_arg1.target.enabled){
return;
};
_local2 = {};
_local3 = ["tower_l_u", "tower_r_u", "tower_l_d", "tower_r_d"];
_local4 = 0;
_local5 = (game.getChildByName("shop") as MovieClip);
if (_arg1.target.name.indexOf("buy") > -1){
_local2.type = (int(_arg1.target.name.substr(3, 1)) - 2);
_local2.tower = "";
_local2.level = 0;
_local2.killed = 0;
_local2.exp = 0;
buyGunInfo = _local2;
_local5.visible = false;
buyCursor.visible = true;
(game.getChildByName("ship") as MovieClip).visible = false;
addEventListener(Event.ENTER_FRAME, shopAI);
stage.addEventListener(MouseEvent.MOUSE_UP, shopMUp);
_local4 = 0;
while (_local4 < _local3.length) {
if (this[_local3[_local4]].weapon == null){
this[_local3[_local4]].plant.visible = true;
};
_local4++;
};
setChildIndex(buyCursor, (numChildren - 1));
};
}
public function sellGun(_arg1:int):void{
var _local2:int;
var _local3:Array;
var _local4:Array;
var _local5:Array;
_local2 = 0;
_local3 = [1500, 1500, 800];
_local4 = new Array();
_local5 = ["tower_l_u", "tower_r_u", "tower_l_d", "tower_r_d"];
_local2 = 0;
while (_local2 < _local5.length) {
if (this[_local5[_local2]].weapon != null){
if (this[_local5[_local2]].weapon.type == _arg1){
_local4.push({link:this[_local5[_local2]].weapon, p:((this[_local5[_local2]].weapon.rank * 10000) + this[_local5[_local2]].weapon.experience)});
};
};
_local2++;
};
_local4.sortOn("p");
game.valourPoints = (game.valourPoints + _local3[_arg1]);
_local4[0].link.destroy();
shopInit();
}
public function createSolder(_arg1:int, _arg2:int, _arg3:Object):void{
var _local4:Solder;
_local4 = (unitsLayer.addChild(new Solder()) as Solder);
_local4.type = _arg3.type;
_local4.rank = _arg3.level;
_local4.name = _arg3.name;
_local4.experience = _arg3.exp;
_local4.killed = _arg3.killed;
_local4.init(_arg1, _arg2);
_local4.currentWall = getWallByPoint(_arg1, _arg2);
_local4.wallPos = {x:_arg1, y:_arg2};
this[_local4.currentWall].solders[((String(_local4.wallPos.x) + "_") + String(_local4.wallPos.y))].push(_local4);
units.push(_local4);
}
public function createGun(_arg1:Object):void{
var _local2:BigGun;
_local2 = (fliesLayer.addChildAt(new BigGun(), 0) as BigGun);
if (_arg1.tower == "tower_l_u"){
_local2.x = ((CASTLE_X + 0.8) * CELL_WIDTH);
_local2.y = ((CASTLE_Y + 1) * CELL_WIDTH);
};
if (_arg1.tower == "tower_l_d"){
_local2.x = ((CASTLE_X + 0.8) * CELL_WIDTH);
_local2.y = (((CASTLE_Y + 9) + 1) * CELL_WIDTH);
};
if (_arg1.tower == "tower_r_u"){
_local2.x = (((CASTLE_X + 9) + 1.2) * CELL_WIDTH);
_local2.y = ((CASTLE_Y + 1) * CELL_WIDTH);
};
if (_arg1.tower == "tower_r_d"){
_local2.x = (((CASTLE_X + 9) + 1.2) * CELL_WIDTH);
_local2.y = (((CASTLE_Y + 9) + 1) * CELL_WIDTH);
};
_local2.type = _arg1.type;
_local2.tower = _arg1.tower;
_local2.rank = _arg1.level;
_local2.killed = _arg1.killed;
_local2.experience = _arg1.exp;
this[_arg1.tower].weapon = _local2;
_local2.init();
}
public function changeUnitType(_arg1:MouseEvent):void{
var _local2:int;
if (!_arg1.target.enabled){
return;
};
if (game.pause){
return;
};
_local2 = 0;
_local2 = 0;
while (_local2 < 3) {
(game.getChildByName(("t" + String(_local2))) as MovieClip).gotoAndStop(1);
_local2++;
};
(_arg1.target as MovieClip).gotoAndStop(2);
currentType = _arg1.target.name.substr(1);
}
public function createArmy():void{
var _local1:int;
var _local2:Object;
_local1 = 0;
_local2 = {};
_local1 = 0;
while (_local1 < game.units.length) {
_local2 = game.units[_local1];
placeSolderRandomly(_local2);
_local1++;
};
_local1 = 0;
while (_local1 < game.guns.length) {
_local2 = game.guns[_local1];
if (this[_local2.tower].weapon != null){
} else {
createGun(_local2);
};
_local1++;
};
}
public function startNewDay():void{
if (stage.loaderInfo.url.indexOf("www.7thelf.com") == -1){
};
game.levelStatistic = {};
game.levelStatistic.ekilled = 0;
game.levelStatistic.slost = 0;
game.levelStatistic.srised = 0;
game.levelStatistic.tlost = 0;
game.levelStatistic.wlost = 0;
disableMenus();
if (game.currentLevel == 0){
if (game.tutorialOn){
help = (game.addChildAt(new Help(), game.getChildIndex(game.doors)) as Help);
help.x = 40;
help.y = 50;
help.init();
} else {
gameStarted = true;
addEventListener(Event.ENTER_FRAME, globalAI, false, 0, true);
};
} else {
gameStarted = true;
ani0 = new Tween((game.getChildByName("ship") as MovieClip), "scaleX", Strong.easeOut, 2, 1, 6, true);
ani1 = new Tween((game.getChildByName("ship") as MovieClip), "scaleY", Strong.easeOut, 2, 1, 6, true);
ani2 = new Tween((game.getChildByName("ship") as MovieClip), "x", Strong.easeOut, 1400, 280, 6, true);
ani2.addEventListener("motionFinish", onShipAnimationEnd, false, 0, true);
};
}
public function disableMenus():void{
var _local1:MapMenu;
var _local2:CastleMenu;
var _local3:BtnMenu;
var _local4:int;
_local1 = (game.getChildByName("mm") as MapMenu);
_local2 = (game.getChildByName("cm") as CastleMenu);
_local3 = (game.getChildByName("bm") as BtnMenu);
_local1.showBtn.enabled = false;
_local2.hideBtn.enabled = false;
_local3.hideBtn.enabled = false;
_local4 = 0;
_local4 = 0;
while (_local4 < 3) {
(game.getChildByName(("t" + String(_local4))) as MovieClip).enabled = false;
_local4++;
};
if (game.gameResult == "none"){
game.pause = true;
};
}
public function setBugWaves():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
_local2 = 0;
_local3 = CASTLE_X;
_local4 = CASTLE_Y;
bugWaves = {};
bugWaves.l = new Array();
_local1 = 0;
while (_local1 < (game.MAX_LEVEL + 1)) {
bugWaves.l[_local1] = new Array();
_local1++;
};
_local2 = 0;
while (_local2 < (game.MAX_LEVEL + 1)) {
_local1 = 0;
while (_local1 < 13) {
bugWaves.l[_local2][_local1] = new Array();
_local1++;
};
_local2++;
};
bugWaves.u = new Array();
_local1 = 0;
while (_local1 < (game.MAX_LEVEL + 1)) {
bugWaves.u[_local1] = new Array();
_local1++;
};
_local2 = 0;
while (_local2 < (game.MAX_LEVEL + 1)) {
_local1 = 0;
while (_local1 < 13) {
bugWaves.u[_local2][_local1] = new Array();
_local1++;
};
_local2++;
};
bugWaves.r = new Array();
_local1 = 0;
while (_local1 < (game.MAX_LEVEL + 1)) {
bugWaves.r[_local1] = new Array();
_local1++;
};
_local2 = 0;
while (_local2 < (game.MAX_LEVEL + 1)) {
_local1 = 0;
while (_local1 < 13) {
bugWaves.r[_local2][_local1] = new Array();
_local1++;
};
_local2++;
};
bugWaves.d = new Array();
_local1 = 0;
while (_local1 < (game.MAX_LEVEL + 1)) {
bugWaves.d[_local1] = new Array();
_local1++;
};
_local2 = 0;
while (_local2 < (game.MAX_LEVEL + 1)) {
_local1 = 0;
while (_local1 < 13) {
bugWaves.d[_local2][_local1] = new Array();
_local1++;
};
_local2++;
};
bugWaves.l[0][0] = [0, 0, 0, 0, 0, 9, 0, 0, 0, 9, 0, 0, 0, 9, 0, 0, 9, 0, 0, 0, 9, 0, 0, 0, 0];
bugWaves.l[0][1] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.l[0][2] = [0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.l[0][3] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.l[0][4] = [0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.l[0][5] = [0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.l[0][6] = [0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0];
bugWaves.l[0][7] = [0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.l[0][8] = [0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.l[0][9] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0];
bugWaves.u[39][3] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.u[39][4] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.u[39][5] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.u[39][6] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 5];
bugWaves.u[39][7] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.u[39][8] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.u[39][9] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0];
bugWaves.u[39][10] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
bugWaves.u[39][11] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5];
bugWaves.u[39][12] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
}
public function globalAI(_arg1:Event):void{
var _local2:int;
var _local3:Number;
var _local4:Array;
if (game.pause){
};
_local2 = 0;
if (game.currentLevel == 0){
_local4 = ["wall_l", "wall_r", "wall_d", "wall_u"];
if (selected.length > 0){
if (!wall_l.hint.visible){
_local2 = 0;
while (_local2 < _local4.length) {
_local2++;
};
};
} else {
if (wall_l.hint.visible){
_local2 = 0;
while (_local2 < _local4.length) {
_local2++;
};
};
};
};
if (game.currentLevel != 0){
if (aniCounter < 80){
aniCounter++;
if (aniCounter == 1){
ani = new Tween((game.getChildByName("level_preview") as MovieClip), "alpha", Strong.easeInOut, 0, 1, 1.5, true);
};
if (aniCounter == 50){
ani = new Tween((game.getChildByName("level_preview") as MovieClip), "alpha", Strong.easeInOut, 1, 0, 1.5, true);
};
if (aniCounter == 79){
game.removeChild(game.getChildByName("level_preview"));
enableMenus();
spawnTimer.start();
};
return;
};
} else {
if (aniCounter < 100){
aniCounter++;
if (aniCounter == 21){
ani = new Tween((game.getChildByName("level_preview") as MovieClip), "alpha", Strong.easeInOut, 0, 1, 1.5, true);
};
if (aniCounter == 70){
ani = new Tween((game.getChildByName("level_preview") as MovieClip), "alpha", Strong.easeInOut, 1, 0, 1.5, true);
};
if (aniCounter == 99){
enableMenus();
spawnTimer.start();
};
return;
};
};
_local3 = getTimer();
setTargets();
_local2 = 0;
while (_local2 < units.length) {
if ((((((units[_local2].target == null)) && (!((units[_local2].action == units[_local2].ACTION_MOVE))))) && (!((units[_local2].type == 2))))){
searchTargetForSolder(units[_local2]);
};
_local2++;
};
if (bloodLayer.numChildren > 100){
bloodLayer.removeChildAt(0);
cleanCounter = 0;
};
}
public function init():void{
var _local1:int;
var _local2:int;
var _local3:Number;
var _local4:Number;
setRanks();
_local1 = 21;
_local2 = 19;
game = (parent as Game);
grid = (getChildByName("g") as MovieClip);
buyCursor = (getChildByName("gun_cursor") as MovieClip);
buyCursor.visible = false;
grid.visible = false;
x = (-((FIELD_WIDTH - 600)) / 2);
y = (-((FIELD_HEIGHT - 600)) / 2);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUp, false, 0, true);
addEventListener(Event.ENTER_FRAME, checkUpdate, false, 0, true);
addEventListener(Event.ENTER_FRAME, drawMap, false, 0, true);
_local3 = 0;
while (_local3 < CELLS_NUM) {
map[_local3] = new Array();
real[_local3] = new Array();
_local4 = 0;
while (_local4 < CELLS_NUM) {
map[_local3][_local4] = 0;
real[_local3][_local4] = {x:((CELL_WIDTH / 2) + (CELL_WIDTH * _local3)), y:((CELL_WIDTH / 2) + (CELL_WIDTH * _local4))};
_local4++;
};
_local3++;
};
createBg();
createCastle(_local1, _local2);
bloodLayer = (addChild(new MovieClip()) as MovieClip);
unitsLayer = (addChild(new MovieClip()) as MovieClip);
enemiesLayer = (addChild(new MovieClip()) as MovieClip);
specialLayer = (addChild(new MovieClip()) as MovieClip);
fliesLayer = (addChild(new MovieClip()) as MovieClip);
bloodLayer.cacheAsBitmap = true;
bloodLayer.mouseEnabled = false;
fliesLayer.mouseEnabled = false;
enemiesLayer.mouseEnabled = false;
unitsLayer.mouseEnabled = false;
cursor = (addChild(new AtackCursor()) as MovieClip);
cursor.visible = false;
cursor.buttonMode = true;
cursor.mouseChildren = false;
createArmy();
setBugWaves();
spawnTimer = new Timer((MIN_TIME + Math.round((Math.random() * MAX_TIME))), 1);
spawnTimer.addEventListener(TimerEvent.TIMER, spawnWave, false, 0, true);
_local3 = 0;
while (_local3 < 3) {
(game.getChildByName(("t" + String(_local3))) as MovieClip).visible = false;
_local3++;
};
(game.getChildByName("t0") as MovieClip).gotoAndStop(2);
cursor.addEventListener(MouseEvent.CLICK, onCursorClick, false, 0, true);
(game.getChildByName("level_preview") as MovieClip).alpha = 0;
(game.getChildByName("level_preview") as MovieClip).mouseChildren = false;
(game.getChildByName("level_preview") as MovieClip).mouseEnabled = false;
if (game.currentLevel == (bugWaves.r.length - 1)){
((game.getChildByName("level_preview") as MovieClip).getChildByName("day") as TextField).text = "LAST DAY";
} else {
((game.getChildByName("level_preview") as MovieClip).getChildByName("day") as TextField).text = ((("DAY " + String((game.currentLevel + 1))) + "/") + String(bugWaves.l.length));
};
setTargets();
game.gameResult = "none";
startNewDay();
(game.getChildByName("zi") as SimpleButton).addEventListener(MouseEvent.CLICK, zoomed, false, 0, true);
(game.getChildByName("zo") as SimpleButton).addEventListener(MouseEvent.CLICK, zoomed, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMDown, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, onMUp, false, 0, true);
clickLayer = (addChild(new MovieClip()) as MovieClip);
clickLayer.graphics.lineStyle(2, 1038134);
(game.getChildByName("ssb") as MovieClip).mouseChildren = false;
(game.getChildByName("ssb") as MovieClip).buttonMode = true;
(game.getChildByName("ssb") as MovieClip).addEventListener(MouseEvent.MOUSE_OVER, onSOver, false, 0, true);
(game.getChildByName("ssb") as MovieClip).addEventListener(MouseEvent.MOUSE_OUT, onSOut, false, 0, true);
(game.getChildByName("ss") as MovieClip).visible = false;
}
public function onShipAnimationEnd(_arg1:TweenEvent):void{
var _local2:Array;
var _local3:int;
if ((game.getChildByName("ship") as MovieClip).x == 280){
ani2.removeEventListener("motionFinish", onShipAnimationEnd);
shopInit();
} else {
_local2 = ["tower_l_u", "tower_r_u", "tower_l_d", "tower_r_d"];
_local3 = 0;
_local3 = 0;
while (_local3 < _local2.length) {
this[_local2[_local3]].plant.parent.removeChild(this[_local2[_local3]].plant);
this[_local2[_local3]].plant = null;
_local3++;
};
ani2.removeEventListener("motionFinish", onShipAnimationEnd);
game.removeChild(game.getChildByName("ship"));
ani0 = null;
ani1 = null;
ani2 = null;
};
}
public function createCastle(_arg1:int, _arg2:int):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:MovieClip;
var _local8:MovieClip;
var _local9:MovieClip;
var _local10:MovieClip;
var _local11:Mark;
var _local12:Number;
var _local13:Class;
var _local14:MovieClip;
var _local15:String;
var _local16:String;
var _local17:int;
var _local18:*;
var _local19:BitmapData;
var _local20:Bitmap;
_local3 = ["tower_l_u", "tower_r_u", "tower_l_d", "tower_r_d"];
_local4 = ["wall_l", "wall_r", "wall_d", "wall_u"];
castleDump.tower_l_u = {x:-47, y:-49, rotation:0, scaleX:1, scaleY:1, link:null, h:1};
castleDump.tower_r_u = {x:375, y:-49, rotation:0, scaleX:-1, scaleY:1, link:null, h:1};
castleDump.tower_l_d = {x:-46, y:378, rotation:0, scaleX:1, scaleY:-1, link:null, h:1};
castleDump.tower_r_d = {x:377, y:379, rotation:0, scaleX:-1, scaleY:-1, link:null, h:1};
castleDump.wall_l = {x:-47, y:0xFF, rotation:-90, scaleX:1, scaleY:1, link:null, h:1};
castleDump.wall_r = {x:375, y:75, rotation:90, scaleX:1, scaleY:1, link:null, h:1};
castleDump.wall_d = {x:0x0100, y:378, rotation:0, scaleX:-1, scaleY:-1, link:null, h:1};
castleDump.wall_u = {x:74, y:-47, rotation:0, scaleX:1, scaleY:1, link:null, h:1};
_local5 = 0;
_local6 = 0;
castle = (addChild(new Castle()) as MovieClip);
castle.cacheAsBitmap = true;
castle.x = (CELL_WIDTH * _arg1);
castle.y = (CELL_WIDTH * _arg2);
_local7 = (castle.getChildByName("wall_l_mask") as MovieClip);
_local8 = (castle.getChildByName("wall_r_mask") as MovieClip);
_local9 = (castle.getChildByName("wall_u_mask") as MovieClip);
_local10 = (castle.getChildByName("wall_d_mask") as MovieClip);
_local7.buttonMode = true;
_local8.buttonMode = true;
_local9.buttonMode = true;
_local10.buttonMode = true;
_local7.addEventListener(MouseEvent.CLICK, activateWall, false, 0, true);
_local8.addEventListener(MouseEvent.CLICK, activateWall, false, 0, true);
_local9.addEventListener(MouseEvent.CLICK, activateWall, false, 0, true);
_local10.addEventListener(MouseEvent.CLICK, activateWall, false, 0, true);
if (game.currentLevel == 0){
wall_u.health = WALL_MAX_HEALTH;
wall_d.health = WALL_MAX_HEALTH;
wall_r.health = WALL_MAX_HEALTH;
wall_l.health = WALL_MAX_HEALTH;
tower_l_u.health = TOWER_MAX_HEALTH;
tower_l_d.health = TOWER_MAX_HEALTH;
tower_r_u.health = TOWER_MAX_HEALTH;
tower_r_d.health = TOWER_MAX_HEALTH;
} else {
_local5 = 0;
while (_local5 < _local3.length) {
this[_local3[_local5]].health = game.saveData[_local3[_local5]];
_local5++;
};
_local5 = 0;
while (_local5 < _local4.length) {
this[_local4[_local5]].health = game.saveData[_local4[_local5]];
_local5++;
};
};
_local12 = 0;
_local17 = 0;
for (_local18 in castleDump) {
_local15 = ((_local18.indexOf("tower") > -1)) ? "TOWER_MAX_HEALTH" : "WALL_MAX_HEALTH";
_local16 = ((_local18.indexOf("tower") > -1)) ? "Tower" : "Wall";
_local12 = (5 - Math.round(((this[_local18].health / this[_local15]) * 4)));
_local13 = (getDefinitionByName((_local16 + String(_local12))) as Class);
_local14 = (new (_local13) as MovieClip);
_local19 = new BitmapData(_local14.width, _local14.height, true, 0);
_local19.draw(_local14);
_local20 = new Bitmap(_local19);
if (_local16 == "Tower"){
castle.addChildAt(_local20, 0);
} else {
castle.addChildAt(_local20, _local17);
};
_local17++;
_local20.x = castleDump[_local18].x;
_local20.y = castleDump[_local18].y;
_local20.rotation = castleDump[_local18].rotation;
_local20.scaleX = castleDump[_local18].scaleX;
_local20.scaleY = castleDump[_local18].scaleY;
castleDump[_local18].link = _local20;
castleDump[_local18].h = _local12;
};
wall_u.solders = {};
wall_d.solders = {};
wall_r.solders = {};
wall_l.solders = {};
wall_u.hint = (castle.getChildByName("wall_u_hint") as MovieClip);
wall_r.hint = (castle.getChildByName("wall_r_hint") as MovieClip);
wall_d.hint = (castle.getChildByName("wall_d_hint") as MovieClip);
wall_l.hint = (castle.getChildByName("wall_l_hint") as MovieClip);
wall_u.hint.visible = false;
wall_d.hint.visible = false;
wall_r.hint.visible = false;
wall_l.hint.visible = false;
wall_u.cells = new Array();
_local5 = 0;
while (_local5 < 5) {
_local6 = 0;
while (_local6 < 2) {
wall_u.cells.push({x:((_arg1 + 3) + _local5), y:(_arg2 + _local6)});
wall_u.solders[((String(wall_u.cells[(wall_u.cells.length - 1)].x) + "_") + String(wall_u.cells[(wall_u.cells.length - 1)].y))] = new Array();
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < 5) {
_local6 = 0;
while (_local6 < 5) {
quick[((String(((_arg1 + 3) + _local5)) + "_") + String(((_arg2 + _local6) - 2)))] = "wall_u";
_local6++;
};
_local5++;
};
wall_d.cells = new Array();
_local5 = 0;
while (_local5 < 5) {
_local6 = 0;
while (_local6 < 2) {
wall_d.cells.push({x:((_arg1 + 3) + _local5), y:((9 + _arg2) + _local6)});
wall_d.solders[((String(wall_d.cells[(wall_d.cells.length - 1)].x) + "_") + String(wall_d.cells[(wall_d.cells.length - 1)].y))] = new Array();
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < 5) {
_local6 = 0;
while (_local6 < 5) {
quick[((String(((_arg1 + 3) + _local5)) + "_") + String(((_arg2 + _local6) + 8)))] = "wall_d";
_local6++;
};
_local5++;
};
wall_r.cells = new Array();
_local5 = 0;
while (_local5 < 2) {
_local6 = 0;
while (_local6 < 5) {
wall_r.cells.push({x:((_arg1 + 9) + _local5), y:((3 + _arg2) + _local6)});
wall_r.solders[((String(wall_r.cells[(wall_r.cells.length - 1)].x) + "_") + String(wall_r.cells[(wall_r.cells.length - 1)].y))] = new Array();
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < 5) {
_local6 = 0;
while (_local6 < 5) {
quick[((String(((_arg1 + 8) + _local5)) + "_") + String(((_arg2 + _local6) + 3)))] = "wall_r";
_local6++;
};
_local5++;
};
wall_l.cells = new Array();
_local5 = 0;
while (_local5 < 2) {
_local6 = 0;
while (_local6 < 5) {
wall_l.cells.push({x:(_arg1 + _local5), y:((3 + _arg2) + _local6)});
wall_l.solders[((String(wall_l.cells[(wall_l.cells.length - 1)].x) + "_") + String(wall_l.cells[(wall_l.cells.length - 1)].y))] = new Array();
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < 5) {
_local6 = 0;
while (_local6 < 5) {
quick[((String(((_arg1 - 2) + _local5)) + "_") + String(((_arg2 + _local6) + 3)))] = "wall_l";
_local6++;
};
_local5++;
};
tower_l_u.plant = castle.getChildByName("tower_l_u_plant");
tower_l_u.plant.visible = false;
tower_l_u.weapon = null;
tower_l_u.cells = new Array();
_local5 = 0;
while (_local5 < 5) {
_local6 = 0;
while (_local6 < 5) {
tower_l_u.cells.push({x:((_arg1 - 2) + _local5), y:((_arg2 - 2) + _local6)});
quick[((String(((_arg1 - 2) + _local5)) + "_") + String(((_arg2 - 2) + _local6)))] = "tower_l_u";
_local6++;
};
_local5++;
};
tower_r_u.plant = castle.getChildByName("tower_r_u_plant");
tower_r_u.plant.visible = false;
tower_r_u.weapon = null;
tower_r_u.cells = new Array();
_local5 = 0;
while (_local5 < 5) {
_local6 = 0;
while (_local6 < 5) {
tower_r_u.cells.push({x:((_arg1 + 8) + _local5), y:((_arg2 - 2) + _local6)});
quick[((String(((_arg1 + 8) + _local5)) + "_") + String(((_arg2 - 2) + _local6)))] = "tower_r_u";
_local6++;
};
_local5++;
};
tower_l_d.plant = castle.getChildByName("tower_l_d_plant");
tower_l_d.plant.visible = false;
tower_l_d.weapon = null;
tower_l_d.cells = new Array();
_local5 = 0;
while (_local5 < 5) {
_local6 = 0;
while (_local6 < 5) {
tower_l_d.cells.push({x:((_arg1 - 2) + _local5), y:((_arg2 + 8) + _local6)});
quick[((String(((_arg1 - 2) + _local5)) + "_") + String(((_arg2 + 8) + _local6)))] = "tower_l_d";
_local6++;
};
_local5++;
};
tower_r_d.plant = castle.getChildByName("tower_r_d_plant");
tower_r_d.plant.visible = false;
tower_r_d.weapon = null;
tower_r_d.cells = new Array();
_local5 = 0;
while (_local5 < 5) {
_local6 = 0;
while (_local6 < 5) {
tower_r_d.cells.push({x:((_arg1 + 8) + _local5), y:((_arg2 + 8) + _local6)});
quick[((String(((_arg1 + 8) + _local5)) + "_") + String(((_arg2 + 8) + _local6)))] = "tower_r_d";
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < 15) {
_local6 = 0;
while (_local6 < 2) {
map[((_arg1 - 2) + _local5)][((_arg2 - 2) + _local6)] = 1;
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < 15) {
_local6 = 0;
while (_local6 < 2) {
map[((_arg1 - 2) + _local5)][((_arg2 + 11) + _local6)] = 1;
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local6 = 0;
while (_local6 < 11) {
map[((_arg1 - 2) + _local5)][(_arg2 + _local6)] = 1;
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local6 = 0;
while (_local6 < 11) {
map[((_arg1 + 11) + _local5)][(_arg2 + _local6)] = 1;
_local6++;
};
_local5++;
};
tower_l_u.plant.visible = false;
tower_r_d.plant.visible = false;
tower_l_d.plant.visible = false;
tower_r_u.plant.visible = false;
map[(_arg1 + 2)][(_arg2 + 0)] = 1;
map[(_arg1 + 2)][(_arg2 + 1)] = 1;
map[(_arg1 + 2)][(_arg2 + 2)] = 1;
map[(_arg1 + 2)][(_arg2 + 3)] = 1;
map[(_arg1 + 0)][(_arg2 + 2)] = 1;
map[(_arg1 + 1)][(_arg2 + 2)] = 1;
map[(_arg1 + 2)][(_arg2 + 2)] = 1;
map[(_arg1 + 3)][(_arg2 + 2)] = 1;
map[(_arg1 + 8)][(_arg2 + 0)] = 1;
map[(_arg1 + 8)][(_arg2 + 1)] = 1;
map[(_arg1 + 8)][(_arg2 + 2)] = 1;
map[(_arg1 + 8)][(_arg2 + 3)] = 1;
map[(_arg1 + 7)][(_arg2 + 2)] = 1;
map[(_arg1 + 8)][(_arg2 + 2)] = 1;
map[(_arg1 + 9)][(_arg2 + 2)] = 1;
map[(_arg1 + 10)][(_arg2 + 2)] = 1;
map[(_arg1 + 2)][(_arg2 + 7)] = 1;
map[(_arg1 + 2)][(_arg2 + 8)] = 1;
map[(_arg1 + 2)][(_arg2 + 9)] = 1;
map[(_arg1 + 2)][(_arg2 + 10)] = 1;
map[(_arg1 + 0)][(_arg2 + 8)] = 1;
map[(_arg1 + 1)][(_arg2 + 8)] = 1;
map[(_arg1 + 2)][(_arg2 + 8)] = 1;
map[(_arg1 + 3)][(_arg2 + 8)] = 1;
map[(_arg1 + 7)][(_arg2 + 8)] = 1;
map[(_arg1 + 8)][(_arg2 + 8)] = 1;
map[(_arg1 + 9)][(_arg2 + 8)] = 1;
map[(_arg1 + 10)][(_arg2 + 8)] = 1;
map[(_arg1 + 8)][(_arg2 + 7)] = 1;
map[(_arg1 + 8)][(_arg2 + 8)] = 1;
map[(_arg1 + 8)][(_arg2 + 9)] = 1;
map[(_arg1 + 8)][(_arg2 + 10)] = 1;
(game.getChildByName("cm") as CastleMenu).init();
_local5 = 0;
while (_local5 < _local3.length) {
damageCastle(_local3[_local5], 0);
_local5++;
};
_local5 = 0;
while (_local5 < _local4.length) {
damageCastle(_local4[_local5], 0);
_local5++;
};
}
public function getWallByPoint(_arg1:int, _arg2:int):String{
var _local3:int;
var _local4:int;
var _local5:Array;
_local3 = 0;
_local4 = 0;
_local5 = ["wall_l", "wall_r", "wall_d", "wall_u"];
_local4 = 0;
while (_local4 < _local5.length) {
_local3 = 0;
while (_local3 < this[_local5[_local4]].cells.length) {
if ((((_arg1 == this[_local5[_local4]].cells[_local3].x)) && ((_arg2 == this[_local5[_local4]].cells[_local3].y)))){
return (_local5[_local4]);
};
_local3++;
};
_local4++;
};
return ("ERROR");
}
public function spawnWave(_arg1:TimerEvent):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 0;
_local3 = 0;
_local4 = CASTLE_X;
_local5 = CASTLE_Y;
if (bugWaves.l[game.currentLevel][0][spawnCounter] == 9){
spawnTimer.stop();
spawnTimer.removeEventListener(TimerEvent.TIMER, spawnWave);
spawnTimer = new Timer(20000, 1);
spawnTimer.addEventListener(TimerEvent.TIMER, spawnWave, false, 0, true);
spawnTimer.start();
spawnCounter++;
return;
};
if (((((enemies.length + 5) > MAX_ENEMIES)) || (((flies.length + 5) > MAX_ENEMIES)))){
spawnTimer.removeEventListener(TimerEvent.TIMER, spawnWave);
spawnTimer = new Timer((MIN_TIME + Math.round((Math.random() * MAX_TIME))), 1);
spawnTimer.addEventListener(TimerEvent.TIMER, spawnWave, false, 0, true);
spawnTimer.start();
return;
};
_local2 = 0;
while (_local2 < 13) {
if (bugWaves.l[game.currentLevel][_local2][spawnCounter] != 0){
createEnemy(0, ((_local5 - 1) + _local2), String((bugWaves.l[game.currentLevel][_local2][spawnCounter] - 1)));
};
_local2++;
};
_local2 = 0;
while (_local2 < 13) {
if (bugWaves.r[game.currentLevel][_local2][spawnCounter] != 0){
createEnemy((CELLS_NUM - 1), ((_local5 - 1) + _local2), String((bugWaves.r[game.currentLevel][_local2][spawnCounter] - 1)));
};
_local2++;
};
_local2 = 0;
while (_local2 < 13) {
if (bugWaves.u[game.currentLevel][_local2][spawnCounter] != 0){
createEnemy(((_local4 - 1) + _local2), 0, String((bugWaves.u[game.currentLevel][_local2][spawnCounter] - 1)));
};
_local2++;
};
_local2 = 0;
while (_local2 < 13) {
if (bugWaves.d[game.currentLevel][_local2][spawnCounter] != 0){
createEnemy(((_local4 - 1) + _local2), (CELLS_NUM - 1), String((bugWaves.d[game.currentLevel][_local2][spawnCounter] - 1)));
};
_local2++;
};
spawnTimer.removeEventListener(TimerEvent.TIMER, spawnWave);
if (spawnCounter == (bugWaves.l[game.currentLevel][0].length - 1)){
spawnLastEnemy = true;
return;
};
spawnTimer.stop();
spawnTimer = new Timer((MIN_TIME + Math.round((Math.random() * MAX_TIME))), 1);
spawnTimer.addEventListener(TimerEvent.TIMER, spawnWave, false, 0, true);
spawnTimer.start();
spawnCounter++;
if ((((enemies.length > 2)) && ((melody == "l")))){
melody = "h";
game.soundController.playMusic("hard");
};
}
public function shopInit():void{
var _local1:Array;
var _local2:Array;
var _local3:MovieClip;
var _local4:SimpleButton;
var _local5:int;
var _local6:Array;
var _local7:Array;
_local1 = [160, 400, 250];
_local2 = [1500, 800, 0.1];
_local3 = (game.getChildByName("shop") as MovieClip);
_local4 = (_local3.getChildByName("close") as SimpleButton);
_local5 = 0;
_local5 = 0;
while (_local5 < 5) {
(_local3.getChildByName(("buy" + String(_local5))) as SimpleButton).enabled = true;
(_local3.getChildByName(("buy" + String(_local5))) as SimpleButton).alpha = 1;
(_local3.getChildByName(("sell" + String(_local5))) as SimpleButton).enabled = true;
(_local3.getChildByName(("sell" + String(_local5))) as SimpleButton).alpha = 1;
_local5++;
};
if (!_local4.hasEventListener(MouseEvent.CLICK)){
shopAni = new Tween(_local3, "y", Strong.easeInOut, 580, 50, 1.5, true);
_local4.addEventListener(MouseEvent.CLICK, onShopClose, false, 0, true);
_local5 = 0;
while (_local5 < 5) {
if (_local5 > 2){
(_local3.getChildByName(("buy" + String(_local5))) as SimpleButton).addEventListener(MouseEvent.MOUSE_DOWN, shopMouseDown, false, 0, true);
} else {
(_local3.getChildByName(("buy" + String(_local5))) as SimpleButton).addEventListener(MouseEvent.CLICK, shopClick, false, 0, true);
};
(_local3.getChildByName(("sell" + String(_local5))) as SimpleButton).addEventListener(MouseEvent.CLICK, shopClick, false, 0, true);
_local5++;
};
(_local3.getChildByName("repair") as SimpleButton).addEventListener(MouseEvent.CLICK, shopClick, false, 0, true);
if (game.currentLevel < 10){
(_local3.getChildByName("t00") as TextField).text = "2";
(_local3.getChildByName("t10") as TextField).text = "1";
(_local3.getChildByName("t20") as TextField).text = "1";
(_local3.getChildByName("t30") as TextField).text = "1";
(_local3.getChildByName("t40") as TextField).text = "1";
} else {
if ((((game.currentLevel >= 10)) && ((game.currentLevel < 20)))){
(_local3.getChildByName("t00") as TextField).text = "3";
(_local3.getChildByName("t10") as TextField).text = "1";
(_local3.getChildByName("t20") as TextField).text = "1";
(_local3.getChildByName("t30") as TextField).text = "1";
(_local3.getChildByName("t40") as TextField).text = "1";
} else {
(_local3.getChildByName("t00") as TextField).text = "4";
(_local3.getChildByName("t10") as TextField).text = "1";
(_local3.getChildByName("t20") as TextField).text = "2";
(_local3.getChildByName("t30") as TextField).text = "1";
(_local3.getChildByName("t40") as TextField).text = "1";
};
};
};
_local5 = 0;
while (_local5 < 5) {
if ((_local3.getChildByName((("t" + String(_local5)) + "0")) as TextField).text == "0"){
(_local3.getChildByName(("buy" + String(_local5))) as SimpleButton).enabled = false;
(_local3.getChildByName(("buy" + String(_local5))) as SimpleButton).alpha = 0.5;
};
_local5++;
};
(_local3.getChildByName("sq") as TextField).text = ((String(units.length) + "/") + String((MAX_UNITS + 1)));
(_local3.getChildByName("vpoints") as TextField).text = String(game.valourPoints);
(_local3.getChildByName("t01") as TextField).text = String(_local1[0]);
(_local3.getChildByName("t11") as TextField).text = String(_local1[1]);
(_local3.getChildByName("t21") as TextField).text = String(_local1[2]);
(_local3.getChildByName("t31") as TextField).text = String(_local2[0]);
(_local3.getChildByName("t41") as TextField).text = String(_local2[1]);
_local6 = new Array();
_local6[0] = 0;
_local6[1] = 0;
_local6[2] = 0;
_local5 = 0;
while (_local5 < units.length) {
var _local8 = _local6;
var _local9 = units[_local5].type;
var _local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
_local5++;
};
(_local3.getChildByName("t02") as TextField).text = String(_local6[0]);
(_local3.getChildByName("t12") as TextField).text = String(_local6[1]);
(_local3.getChildByName("t22") as TextField).text = String(_local6[2]);
_local7 = new Array();
_local7[0] = 0;
_local7[1] = 0;
if (tower_l_d.weapon != null){
_local8 = _local7;
_local9 = (tower_l_d.weapon.type - 1);
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
};
if (tower_l_u.weapon != null){
_local8 = _local7;
_local9 = (tower_l_u.weapon.type - 1);
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
};
if (tower_r_d.weapon != null){
_local8 = _local7;
_local9 = (tower_r_d.weapon.type - 1);
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
};
if (tower_r_u.weapon != null){
_local8 = _local7;
_local9 = (tower_r_u.weapon.type - 1);
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
};
(_local3.getChildByName("t32") as TextField).text = String(_local7[0]);
(_local3.getChildByName("t42") as TextField).text = String(_local7[1]);
if (units.length > MAX_UNITS){
(_local3.getChildByName("buy0") as SimpleButton).enabled = false;
(_local3.getChildByName("buy0") as SimpleButton).alpha = 0.5;
(_local3.getChildByName("buy1") as SimpleButton).enabled = false;
(_local3.getChildByName("buy1") as SimpleButton).alpha = 0.5;
(_local3.getChildByName("buy2") as SimpleButton).enabled = false;
(_local3.getChildByName("buy2") as SimpleButton).alpha = 0.5;
};
if (((((((!((tower_l_d.weapon == null))) && (!((tower_l_u.weapon == null))))) && (!((tower_r_d.weapon == null))))) && (!((tower_r_u.weapon == null))))){
(_local3.getChildByName("buy3") as SimpleButton).enabled = false;
(_local3.getChildByName("buy3") as SimpleButton).alpha = 0.5;
(_local3.getChildByName("buy4") as SimpleButton).enabled = false;
(_local3.getChildByName("buy4") as SimpleButton).alpha = 0.5;
};
if (game.valourPoints < _local1[0]){
(_local3.getChildByName("buy0") as SimpleButton).enabled = false;
(_local3.getChildByName("buy0") as SimpleButton).alpha = 0.5;
};
if (game.valourPoints < _local1[1]){
(_local3.getChildByName("buy1") as SimpleButton).enabled = false;
(_local3.getChildByName("buy1") as SimpleButton).alpha = 0.5;
};
if (game.valourPoints < _local1[2]){
(_local3.getChildByName("buy2") as SimpleButton).enabled = false;
(_local3.getChildByName("buy2") as SimpleButton).alpha = 0.5;
};
if (game.valourPoints < _local2[0]){
(_local3.getChildByName("buy3") as SimpleButton).enabled = false;
(_local3.getChildByName("buy3") as SimpleButton).alpha = 0.5;
};
if (game.valourPoints < _local2[1]){
(_local3.getChildByName("buy4") as SimpleButton).enabled = false;
(_local3.getChildByName("buy4") as SimpleButton).alpha = 0.5;
};
if (_local6[0] == 0){
(_local3.getChildByName("sell0") as SimpleButton).enabled = false;
(_local3.getChildByName("sell0") as SimpleButton).alpha = 0.5;
};
if (_local6[1] == 0){
(_local3.getChildByName("sell1") as SimpleButton).enabled = false;
(_local3.getChildByName("sell1") as SimpleButton).alpha = 0.5;
};
if (_local6[2] == 0){
(_local3.getChildByName("sell2") as SimpleButton).enabled = false;
(_local3.getChildByName("sell2") as SimpleButton).alpha = 0.5;
};
if (_local7[0] == 0){
(_local3.getChildByName("sell3") as SimpleButton).enabled = false;
(_local3.getChildByName("sell3") as SimpleButton).alpha = 0.5;
};
if (_local7[1] == 0){
(_local3.getChildByName("sell4") as SimpleButton).enabled = false;
(_local3.getChildByName("sell4") as SimpleButton).alpha = 0.5;
};
}
public function shopMUp(_arg1:MouseEvent):void{
var _local2:MovieClip;
var _local3:Array;
var _local4:Array;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local2 = (game.getChildByName("shop") as MovieClip);
_local3 = ["tower_l_u", "tower_r_u", "tower_l_d", "tower_r_d"];
_local4 = [1500, 800, 0.1];
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = (-(x) + stage.mouseX);
_local9 = (-(y) + stage.mouseY);
buyCursor.visible = false;
_local2.visible = true;
buyCursor.x = 2000;
(game.getChildByName("ship") as MovieClip).visible = true;
removeEventListener(Event.ENTER_FRAME, shopAI);
stage.removeEventListener(MouseEvent.MOUSE_UP, shopMUp);
_local5 = 0;
while (_local5 < _local3.length) {
_local6 = (this[_local3[_local5]].plant.parent.x + this[_local3[_local5]].plant.x);
_local7 = (this[_local3[_local5]].plant.parent.y + this[_local3[_local5]].plant.y);
this[_local3[_local5]].plant.visible = false;
if ((((Math.abs((_local6 - _local8)) < 40)) && ((Math.abs((_local7 - _local9)) < 40)))){
(_local2.getChildByName((("t" + String((2 + buyGunInfo.type))) + "0")) as TextField).text = String((int((_local2.getChildByName((("t" + String((2 + buyGunInfo.type))) + "0")) as TextField).text) - 1));
buyGunInfo.tower = _local3[_local5];
createGun(buyGunInfo);
game.valourPoints = (game.valourPoints - _local4[(buyGunInfo.type - 1)]);
shopInit();
};
_local5++;
};
}
public function enableMenus():void{
var _local1:MapMenu;
var _local2:CastleMenu;
var _local3:BtnMenu;
var _local4:int;
_local1 = (game.getChildByName("mm") as MapMenu);
_local2 = (game.getChildByName("cm") as CastleMenu);
_local3 = (game.getChildByName("bm") as BtnMenu);
_local1.showBtn.enabled = true;
_local2.hideBtn.enabled = true;
_local3.hideBtn.enabled = true;
_local4 = 0;
_local4 = 0;
while (_local4 < 3) {
(game.getChildByName(("t" + String(_local4))) as MovieClip).enabled = true;
_local4++;
};
game.pause = false;
}
public function damageCastle(_arg1:String, _arg2:Number):Boolean{
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:Class;
var _local7:MovieClip;
var _local8:String;
var _local9:String;
var _local10:int;
var _local11:*;
var _local12:Array;
var _local13:int;
var _local14:MovieClip;
var _local15:Number;
var _local16:BitmapData;
var _local17:Bitmap;
_local3 = ((_arg1.indexOf("tower") > -1)) ? "TOWER_MAX_HEALTH" : "WALL_MAX_HEALTH";
_local4 = 0;
_local5 = 0;
_local10 = 0;
if ((((this[_arg1].health == 0)) && (!((aniCounter == 0))))){
return (false);
};
if ((this[_arg1].health - _arg2) <= 0){
this[_arg1].health = 0;
if (_local3 == "WALL_MAX_HEALTH"){
game.levelStatistic.wlost++;
castleCrash = true;
for (_local11 in quick) {
if (quick[_local11] == _arg1){
_local12 = String(_local11).split("_");
map[int(_local12[0])][int(_local12[1])] = 0;
};
};
} else {
if (this[_arg1].weapon != null){
this[_arg1].weapon.destroy();
};
if (aniCounter != 0){
_local13 = 0;
while (_local13 < 4) {
_local14 = (specialLayer.addChild(new Explosion()) as MovieClip);
_local15 = Math.floor((Math.random() * (this[_arg1].cells.length - 0.01)));
_local14.x = ((this[_arg1].cells[_local15].x + 0.5) * CELL_WIDTH);
_local14.y = ((this[_arg1].cells[_local15].y + 0.5) * CELL_WIDTH);
_local14.mouseEnabled = false;
_local13++;
};
};
game.levelStatistic.tlost++;
};
_local4 = Math.round(((this[_arg1].health / this[_local3]) * 100));
_local5 = (5 - Math.floor(((this[_arg1].health / this[_local3]) * 4)));
if (_local5 != castleDump[_arg1].h){
_local8 = ((_arg1.indexOf("tower") > -1)) ? "TOWER_MAX_HEALTH" : "WALL_MAX_HEALTH";
_local9 = ((_arg1.indexOf("tower") > -1)) ? "Tower" : "Wall";
_local10 = castle.getChildIndex(castleDump[_arg1].link);
_local6 = (getDefinitionByName((_local9 + String(_local5))) as Class);
castle.removeChild(castleDump[_arg1].link);
_local7 = (new (_local6) as MovieClip);
_local16 = new BitmapData(_local7.width, _local7.height, true, 0);
_local16.draw(_local7);
_local17 = new Bitmap(_local16);
if (_local9 == "Tower"){
castle.addChildAt(_local17, 0);
} else {
castle.addChildAt(_local17, 4);
};
_local17.x = castleDump[_arg1].x;
_local17.y = castleDump[_arg1].y;
_local17.rotation = castleDump[_arg1].rotation;
_local17.scaleX = castleDump[_arg1].scaleX;
_local17.scaleY = castleDump[_arg1].scaleY;
castleDump[_arg1].link = (_local17 as DisplayObject);
castleDump[_arg1].h = _local5;
};
(game.getChildByName("cm") as CastleMenu).changeState(_arg1, _local4);
return (false);
} else {
this[_arg1].health = (this[_arg1].health - _arg2);
};
_local5 = (5 - Math.round(((this[_arg1].health / this[_local3]) * 4)));
if (_local5 != castleDump[_arg1].h){
_local8 = ((_arg1.indexOf("tower") > -1)) ? "TOWER_MAX_HEALTH" : "WALL_MAX_HEALTH";
_local9 = ((_arg1.indexOf("tower") > -1)) ? "Tower" : "Wall";
_local10 = castle.getChildIndex(castleDump[_arg1].link);
_local6 = (getDefinitionByName((_local9 + String(_local5))) as Class);
castle.removeChild(castleDump[_arg1].link);
_local7 = (new (_local6) as MovieClip);
_local16 = new BitmapData(_local7.width, _local7.height, true, 0);
_local16.draw(_local7);
_local17 = new Bitmap(_local16);
if (_local9 == "Tower"){
castle.addChildAt(_local17, 0);
} else {
castle.addChildAt(_local17, 4);
};
_local17.x = castleDump[_arg1].x;
_local17.y = castleDump[_arg1].y;
_local17.rotation = castleDump[_arg1].rotation;
_local17.scaleX = castleDump[_arg1].scaleX;
_local17.scaleY = castleDump[_arg1].scaleY;
castleDump[_arg1].link = _local17;
castleDump[_arg1].h = _local5;
};
_local4 = Math.floor(((this[_arg1].health / this[_local3]) * 100));
(game.getChildByName("cm") as CastleMenu).changeState(_arg1, _local4);
return (true);
}
public function onSOver(_arg1:MouseEvent):void{
if (game.pause){
return;
};
(game.getChildByName("ss") as MovieClip).visible = true;
}
public function drawRect(_arg1:Event):void{
var _local2:Number;
clickLayer.graphics.clear();
newX = ((stage.mouseX - x) / scaleX);
newY = ((stage.mouseY - y) / scaleY);
if ((((Math.abs((newX - lastX)) > 5)) || ((Math.abs((newY - lastY)) > 5)))){
clickLayer.graphics.lineStyle(1, 1038134);
clickLayer.graphics.drawRect(lastX, lastY, (newX - lastX), (newY - lastY));
};
}
public function searchTargetForSolder(_arg1:Solder):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:Array;
var _local13:Array;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:Array;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = Math.floor((_arg1.maxRadius / CELL_WIDTH));
_local7 = _local6;
_local8 = 0;
_local9 = 0;
_local10 = 0;
_local11 = new Array();
_local12 = new Array();
_local13 = new Array();
_local14 = new Array();
_local16 = new Array();
_local17 = new Array();
_local2 = (_arg1.pos.x - _local6);
_local3 = ((_arg1.pos.x + _local6) + 1);
_local4 = (_arg1.pos.y - _local7);
_local5 = ((_arg1.pos.y + _local7) + 1);
_local8 = _local2;
while (_local8 < _local3) {
_local9 = _local4;
while (_local9 < _local5) {
_local10 = 0;
while (_local10 < dump[_local8][_local9].length) {
_local18 = _arg1.getL(_arg1.x, dump[_local8][_local9][_local10].x, _arg1.y, dump[_local8][_local9][_local10].y);
_local19 = (_arg1.maxRadius * _arg1.maxRadius);
_local20 = (_arg1.minRadius * _arg1.minRadius);
if (((((dump[_local8][_local9][_local10].inCastle) && ((_local18 < _local19)))) && ((_local18 > _local20)))){
_local17.push({link:dump[_local8][_local9][_local10], p:_arg1.getL(dump[_local8][_local9][_local10].rPos.x, _arg1.rPos.x, dump[_local8][_local9][_local10].rPos.y, _arg1.rPos.y)});
} else {
if (((((dump[_local8][_local9][_local10].fly) && ((_local18 < _local19)))) && ((_local18 > _local20)))){
_local16.push({link:dump[_local8][_local9][_local10], p:_arg1.getL(dump[_local8][_local9][_local10].rPos.x, _arg1.rPos.x, dump[_local8][_local9][_local10].rPos.y, _arg1.rPos.y)});
} else {
if ((((((dump[_local8][_local9][_local10].currentWall == "wall_l")) && ((_local18 < _local19)))) && ((_local18 > _local20)))){
_local11.push({link:dump[_local8][_local9][_local10], p:_arg1.getL(dump[_local8][_local9][_local10].rPos.x, _arg1.rPos.x, dump[_local8][_local9][_local10].rPos.y, _arg1.rPos.y)});
} else {
if ((((((dump[_local8][_local9][_local10].currentWall == "wall_r")) && ((_local18 < _local19)))) && ((_local18 > _local20)))){
_local12.push({link:dump[_local8][_local9][_local10], p:_arg1.getL(dump[_local8][_local9][_local10].rPos.x, _arg1.rPos.x, dump[_local8][_local9][_local10].rPos.y, _arg1.rPos.y)});
} else {
if ((((((dump[_local8][_local9][_local10].currentWall == "wall_u")) && ((_local18 < _local19)))) && ((_local18 > _local20)))){
_local13.push({link:dump[_local8][_local9][_local10], p:_arg1.getL(dump[_local8][_local9][_local10].rPos.x, _arg1.rPos.x, dump[_local8][_local9][_local10].rPos.y, _arg1.rPos.y)});
} else {
if ((((((dump[_local8][_local9][_local10].currentWall == "wall_d")) && ((_local18 < _local19)))) && ((_local18 > _local20)))){
_local14.push({link:dump[_local8][_local9][_local10], p:_arg1.getL(dump[_local8][_local9][_local10].rPos.x, _arg1.rPos.x, dump[_local8][_local9][_local10].rPos.y, _arg1.rPos.y)});
};
};
};
};
};
};
_local10++;
};
_local9++;
};
_local8++;
};
if (_arg1.type == 0){
if (_local17.length != 0){
_local15 = _local17;
} else {
if (_local16.length != 0){
_local15 = _local16;
} else {
if ((((_arg1.currentWall == "wall_l")) && (!((_local11.length == 0))))){
_local15 = _local11;
};
if ((((_arg1.currentWall == "wall_r")) && (!((_local12.length == 0))))){
_local15 = _local12;
};
if ((((_arg1.currentWall == "wall_u")) && (!((_local13.length == 0))))){
_local15 = _local13;
};
if ((((_arg1.currentWall == "wall_d")) && (!((_local14.length == 0))))){
_local15 = _local14;
};
};
};
if (_local15 != null){
_arg1.target = _local15[Math.floor((Math.random() * (_local15.length - 0.01)))].link;
} else {
_arg1.target = null;
};
};
if (_arg1.type == 1){
if ((((_arg1.currentWall == "wall_l")) && (!((_local11.length == 0))))){
_local15 = _local11;
};
if ((((_arg1.currentWall == "wall_r")) && (!((_local12.length == 0))))){
_local15 = _local12;
};
if ((((_arg1.currentWall == "wall_u")) && (!((_local13.length == 0))))){
_local15 = _local13;
};
if ((((_arg1.currentWall == "wall_d")) && (!((_local14.length == 0))))){
_local15 = _local14;
};
if (_local15 != null){
_local15.sortOn("p", Array.NUMERIC);
_arg1.target = _local15[0].link;
} else {
_arg1.target = null;
};
};
}
public function keyUp(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 38){
up = false;
};
if (_arg1.keyCode == 40){
down = false;
};
if (_arg1.keyCode == 39){
right = false;
};
if (_arg1.keyCode == 37){
left = false;
};
if (_arg1.keyCode == 87){
w = false;
};
if (_arg1.keyCode == 83){
s = false;
};
if (_arg1.keyCode == 68){
d = false;
};
if (_arg1.keyCode == 65){
a = false;
};
}
public function activateWall(_arg1:MouseEvent):void{
var _local2:MovieClip;
var _local3:String;
var _local4:Solder;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Boolean;
var _local10:Array;
var _local11:*;
var _local12:Number;
var _local13:Number;
if (((!(_arg1.target.enabled)) || (game.pause))){
return;
};
_local2 = (_arg1.target as MovieClip);
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = true;
_local10 = new Array();
_local2.gotoAndPlay(2);
_local3 = _arg1.target.name.substr(0, 6);
if (selected.length == 0){
return;
};
_local7 = 0;
while (_local7 < selected.length) {
if (selected[_local7].currentWall != _local3){
_local10.push(selected[_local7]);
};
_local7++;
};
for (_local11 in this[_local3].solders) {
if (this[_local3].solders[_local11].length == 0){
_local9 = false;
break;
};
};
if (_local9){
return;
};
_local8 = 0;
while (_local8 < _local10.length) {
_local12 = _local10[_local8].wallPos.x;
_local13 = _local10[_local8].wallPos.y;
_local7 = 0;
while (_local7 < this[_local10[_local8].currentWall].solders[((String(_local12) + "_") + String(_local13))].length) {
if (this[_local10[_local8].currentWall].solders[((String(_local12) + "_") + String(_local13))][_local7] == _local10[_local8]){
this[_local10[_local8].currentWall].solders[((String(_local12) + "_") + String(_local13))].splice(_local7, 1);
break;
};
_local7++;
};
_local10[_local8].currentWall = _local3;
_local7 = 0;
while (_local7 < this[_local3].cells.length) {
if (this[_local3].solders[((String(this[_local3].cells[_local7].x) + "_") + String(this[_local3].cells[_local7].y))].length == 0){
_local10[_local8].wallPos.x = this[_local3].cells[_local7].x;
_local10[_local8].wallPos.y = this[_local3].cells[_local7].y;
break;
};
_local7++;
};
this[_local3].solders[((String(_local10[_local8].wallPos.x) + "_") + String(_local10[_local8].wallPos.y))].push(_local10[_local8]);
sendSolder(_local10[_local8], _local10[_local8].wallPos.x, _local10[_local8].wallPos.y);
_local9 = true;
for (_local11 in this[_local3].solders) {
if (this[_local3].solders[_local11].length == 0){
_local9 = false;
break;
};
};
if (_local9){
return;
};
_local8++;
};
}
public function endGame(_arg1:TimerEvent):void{
game.doors.play();
if ((((game.gameResult == "win")) && (!((game.currentLevel == game.MAX_LEVEL))))){
game.frameInc = 1;
} else {
if ((((game.gameResult == "win")) && ((game.currentLevel == game.MAX_LEVEL)))){
game.frameInc = 2;
} else {
game.frameInc = 3;
};
};
}
public function chooseSolder(_arg1:String):Solder{
var _local2:int;
var _local3:Object;
var _local4:Array;
var _local5:*;
var _local6:int;
_local2 = 0;
_local3 = {wall_l:new Array(), wall_r:new Array(), wall_d:new Array(), wall_u:new Array()};
_local4 = new Array();
_local2 = 0;
while (_local2 < units.length) {
if (((!((units[_local2].currentWall == _arg1))) && ((String(units[_local2].type) == currentType)))){
_local3[units[_local2].currentWall].push(units[_local2]);
};
_local2++;
};
for (_local5 in _local3) {
_local4.push({id:_local5, num:_local3[_local5].length});
};
_local4.sortOn("num", Array.NUMERIC);
if (_local4[(_local4.length - 1)].num < 1){
return (null);
};
_local6 = Math.round((Math.random() * (_local4[(_local4.length - 1)].num - 1)));
return (_local3[_local4[(_local4.length - 1)].id][_local6]);
}
public function drawMap(_arg1:Event):void{
var _local2:Number;
var _local3:MapMenu;
var _local4:MovieClip;
_local2 = 0;
_local3 = (game.getChildByName("mm") as MapMenu);
_local4 = (_local3.getChildByName("bg0") as MovieClip);
if (!_local4.visible){
return;
};
_local3.clear();
_local2 = 0;
while (_local2 < enemies.length) {
_local3.drawSmall(enemies[_local2].x, enemies[_local2].y);
_local2++;
};
}
public function onShopClose(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (game.getChildByName("shop") as MovieClip);
ani0 = new Tween((game.getChildByName("ship") as MovieClip), "scaleX", Strong.easeOut, 1, 2, 4, true);
ani1 = new Tween((game.getChildByName("ship") as MovieClip), "scaleY", Strong.easeOut, 1, 2, 4, true);
ani2 = new Tween((game.getChildByName("ship") as MovieClip), "x", Strong.easeOut, 280, -700, 6, true);
shopAni = new Tween(_local2, "y", Strong.easeInOut, 50, 580, 1.5, true);
shopAni.addEventListener("motionFinish", destroyShop, false, 0, true);
ani2.addEventListener("motionFinish", onShipAnimationEnd, false, 0, true);
addEventListener(Event.ENTER_FRAME, globalAI, false, 0, true);
}
public function onMUp(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:Number;
var _local13:Number;
var _local14:MovieClip;
if (game.pause){
return;
};
clickLayer.graphics.clear();
removeEventListener(Event.ENTER_FRAME, drawRect);
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = ["wall_l", "wall_r", "wall_d", "wall_u"];
if ((((Math.abs((newX - lastX)) <= 5)) && ((Math.abs((newY - lastY)) <= 5)))){
_local12 = (newX - castle.x);
_local13 = (newY - castle.y);
_local2 = 0;
while (_local2 < _local5.length) {
_local14 = (castle.getChildByName((_local5[_local2] + "_mask")) as MovieClip);
if ((((((((_local12 > (_local14.x - (_local14.width / 2)))) && ((_local12 < (_local14.x + (_local14.width / 2)))))) && ((_local13 > (_local14.y - (_local14.height / 2)))))) && ((_local13 < (_local14.y + (_local14.height / 2)))))){
return;
};
_local2++;
};
};
if (selected.length > 0){
while (selected.length) {
selected[0].selectedMask.visible = false;
selected.splice(0, 1);
};
};
(game.getChildByName("im") as InfoMenu).changeVisible(null);
_local6 = 0;
_local7 = 0;
if (lastX > newX){
_local6 = lastX;
lastX = newX;
newX = _local6;
};
if (lastY > newY){
_local7 = lastY;
lastY = newY;
newY = _local7;
};
_local8 = Math.floor((lastX / CELL_WIDTH));
_local9 = Math.floor((newX / CELL_WIDTH));
_local10 = Math.floor((lastY / CELL_WIDTH));
_local11 = Math.floor((newY / CELL_WIDTH));
_local2 = _local8;
while (_local2 < (_local9 + 1)) {
_local3 = _local10;
while (_local3 < (_local11 + 1)) {
if (unitsDump[_local2][_local3].length > 0){
_local4 = 0;
while (_local4 < unitsDump[_local2][_local3].length) {
selected.push(unitsDump[_local2][_local3][_local4]);
unitsDump[_local2][_local3][_local4].selectedMask.visible = true;
_local4++;
};
};
_local3++;
};
_local2++;
};
}
public function shopAI(_arg1:Event):void{
var _local2:Array;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = ["tower_l_u", "tower_r_u", "tower_l_d", "tower_r_d"];
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = (-(x) + stage.mouseX);
_local7 = (-(y) + stage.mouseY);
_local3 = 0;
while (_local3 < _local2.length) {
_local4 = (this[_local2[_local3]].plant.parent.x + this[_local2[_local3]].plant.x);
_local5 = (this[_local2[_local3]].plant.parent.y + this[_local2[_local3]].plant.y);
if ((((Math.abs((_local4 - _local6)) < 40)) && ((Math.abs((_local5 - _local7)) < 40)))){
buyCursor.x = _local4;
buyCursor.y = _local5;
return;
};
_local3++;
};
buyCursor.x = _local6;
buyCursor.y = _local7;
}
public function keyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 38){
up = true;
};
if (_arg1.keyCode == 40){
down = true;
};
if (_arg1.keyCode == 39){
right = true;
};
if (_arg1.keyCode == 37){
left = true;
};
if (_arg1.keyCode == 87){
w = true;
};
if (_arg1.keyCode == 83){
s = true;
};
if (_arg1.keyCode == 68){
d = true;
};
if (_arg1.keyCode == 65){
a = true;
};
if (_arg1.keyCode == 49){
selectUnits(0);
k1 = true;
};
if (_arg1.keyCode == 50){
selectUnits(1);
k2 = true;
};
if (_arg1.keyCode == 51){
selectUnits(2);
k3 = true;
};
if (_arg1.keyCode == 52){
selectUnitsOnWall("wall_u");
k4 = true;
};
if (_arg1.keyCode == 53){
selectUnitsOnWall("wall_d");
k5 = true;
};
if (_arg1.keyCode == 54){
selectUnitsOnWall("wall_l");
k6 = true;
};
if (_arg1.keyCode == 55){
selectUnitsOnWall("wall_r");
k7 = true;
};
}
public function searchTargetForBug(_arg1:Bug):void{
_arg1.target = quick[((String((_arg1.pos.x + _arg1.dx)) + "_") + String((_arg1.pos.y + _arg1.dy)))];
}
public function zoomed(_arg1:MouseEvent):void{
var _local2:MapMenu;
if (game.pause){
return;
};
_local2 = (game.getChildByName("mm") as MapMenu);
if (_arg1.target.name == "zi"){
if (zoom){
x = (-((FIELD_WIDTH - 600)) / 2);
y = (-((FIELD_HEIGHT - 600)) / 2);
scaleX = 1;
scaleY = 1;
_local2.onUnZoom();
zoom = false;
};
} else {
if (!zoom){
x = 0;
y = ((-((600 - 480)) / 2) + 10);
scaleX = (600 / 1590);
scaleY = (600 / 1590);
_local2.onZoom();
zoom = true;
};
};
}
public function checkScrolling():void{
var _local1:Number;
var _local2:Number;
if (zoom){
return;
};
_local1 = 0;
_local2 = 0;
if (((up) || (w))){
_local2 = (_local2 + 30);
};
if (((down) || (s))){
_local2 = (_local2 - 30);
};
if (((right) || (d))){
_local1 = (_local1 - 30);
};
if (((left) || (a))){
_local1 = (_local1 + 30);
};
if ((x + _local1) > 0){
x = 0;
} else {
if ((x + _local1) < (-(grid.width) + 600)){
x = (-(grid.width) + 600);
} else {
x = (x + _local1);
};
};
if ((y + _local2) > 0){
y = 0;
} else {
if ((y + _local2) < (-(grid.height) + 480)){
y = (-(grid.height) + 480);
} else {
y = (y + _local2);
};
};
if (((!((_local1 == 0))) || (!((_local2 == 0))))){
(game.getChildByName("mm") as MapMenu).moveCamByGameField();
};
}
public function selectUnits(_arg1:int):void{
var _local2:int;
_local2 = 0;
if (selected.length > 0){
while (selected.length) {
selected[0].selectedMask.visible = false;
selected.splice(0, 1);
};
};
_local2 = 0;
while (_local2 < units.length) {
if (units[_local2].type == _arg1){
selected.push(units[_local2]);
units[_local2].selectedMask.visible = true;
};
_local2++;
};
}
public function checkGameResult():void{
if (spawnCounter == 0){
return;
};
if (units.length == 0){
game.gameResult = "lose";
} else {
if ((((enemies.length == 0)) && (spawnLastEnemy))){
game.gameResult = "win";
game.soundController.playSound("win");
};
};
if (game.gameResult != "none"){
endTimer.addEventListener(TimerEvent.TIMER, endGame, false, 0, true);
endTimer.start();
disableMenus();
closeMenus();
};
}
public function closeMenus():void{
var _local1:MapMenu;
var _local2:CastleMenu;
var _local3:BtnMenu;
var _local4:InfoMenu;
_local1 = (game.getChildByName("mm") as MapMenu);
_local2 = (game.getChildByName("cm") as CastleMenu);
_local3 = (game.getChildByName("bm") as BtnMenu);
_local4 = (game.getChildByName("im") as InfoMenu);
if ((_local1.getChildByName("bg0") as MovieClip).visible){
_local1.changeVisible(null);
};
if ((_local2.getChildByName("bg0") as MovieClip).visible){
_local2.changeVisible(null);
};
if ((_local3.getChildByName("bg0") as MovieClip).visible){
_local3.changeVisible(null);
};
if ((_local4.getChildByName("bg0") as MovieClip).visible){
_local4.changeVisible(null);
};
}
public function isWallPoint(_arg1:int, _arg2:int):Boolean{
if ((((((((_arg1 >= (CASTLE_X - 2))) && ((_arg1 <= (CASTLE_X + 12))))) && ((_arg2 >= (CASTLE_Y - 2))))) && ((_arg2 <= (CASTLE_Y + 12))))){
return (true);
};
return (false);
}
public function createEnemy(_arg1:int, _arg2:int, _arg3:String="0"):Bug{
var _local4:Bug;
if ((((_arg3 == "1")) || ((_arg3 == "5")))){
_local4 = (fliesLayer.addChild(new Bug()) as Bug);
flies.push(_local4);
} else {
_local4 = (enemiesLayer.addChild(new Bug()) as Bug);
};
_local4.init(_arg1, _arg2, _arg3);
enemies.push(_local4);
return (_local4);
}
public function checkUpdate(_arg1:Event):void{
if (game.pause){
return;
};
checkScrolling();
}
public function destroy():void{
var _local1:MapMenu;
var _local2:CastleMenu;
var _local3:BtnMenu;
var _local4:InfoMenu;
var _local5:int;
var _local6:Array;
var _local7:Array;
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, onMUp);
_local1 = (game.getChildByName("mm") as MapMenu);
_local2 = (game.getChildByName("cm") as CastleMenu);
_local3 = (game.getChildByName("bm") as BtnMenu);
_local4 = (game.getChildByName("im") as InfoMenu);
_local5 = 0;
_local1.destroy();
_local2.destroy();
_local3.destroy();
_local4.destroy();
spawnTimer.stop();
spawnTimer = null;
endTimer.stop();
endTimer.removeEventListener(TimerEvent.TIMER, endGame);
endTimer = null;
removeEventListener(Event.ENTER_FRAME, checkUpdate);
removeEventListener(Event.ENTER_FRAME, drawMap);
removeEventListener(Event.ENTER_FRAME, globalAI);
game.units = new Array();
game.guns = new Array();
_local6 = ["tower_l_u", "tower_r_u", "tower_l_d", "tower_r_d"];
_local7 = ["wall_l", "wall_r", "wall_d", "wall_u"];
if (game.gameResult == "win"){
if (game.currentLevel == 0){
game.saveData = {};
};
_local5 = 0;
while (_local5 < _local6.length) {
game.saveData[_local6[_local5]] = this[_local6[_local5]].health;
_local5++;
};
_local5 = 0;
while (_local5 < _local7.length) {
game.saveData[_local7[_local5]] = this[_local7[_local5]].health;
_local5++;
};
};
while (units.length) {
if (game.gameResult == "win"){
game.units.push({name:units[0].name, killed:units[0].killed, level:units[0].rank, type:units[0].type, exp:units[0].experience});
};
units[0].destroy(true);
};
while (enemies.length) {
enemies[0].destroy(true);
};
if (tower_l_d.weapon != null){
if (game.gameResult == "win"){
game.guns.push({killed:tower_l_d.weapon.killed, level:tower_l_d.weapon.rank, type:tower_l_d.weapon.type, tower:"tower_l_d", exp:tower_l_d.weapon.experience});
};
tower_l_d.weapon.destroy();
};
if (tower_l_u.weapon != null){
if (game.gameResult == "win"){
game.guns.push({killed:tower_l_u.weapon.killed, level:tower_l_u.weapon.rank, type:tower_l_u.weapon.type, tower:"tower_l_u", exp:tower_l_u.weapon.experience});
};
tower_l_u.weapon.destroy();
};
if (tower_r_d.weapon != null){
if (game.gameResult == "win"){
game.guns.push({killed:tower_r_d.weapon.killed, level:tower_r_d.weapon.rank, type:tower_r_d.weapon.type, tower:"tower_r_d", exp:tower_r_d.weapon.experience});
};
tower_r_d.weapon.destroy();
};
if (tower_r_u.weapon != null){
if (game.gameResult == "win"){
game.guns.push({killed:tower_r_u.weapon.killed, level:tower_r_u.weapon.rank, type:tower_r_u.weapon.type, tower:"tower_r_u", exp:tower_r_u.weapon.experience});
};
tower_r_u.weapon.destroy();
};
while (bloodLayer.numChildren) {
bloodLayer.removeChildAt(0);
};
while (enemiesLayer.numChildren) {
enemiesLayer.removeChildAt(0);
};
while (fliesLayer.numChildren) {
fliesLayer.removeChildAt(0);
};
while (specialLayer.numChildren) {
specialLayer.removeChildAt(0);
};
while (unitsLayer.numChildren) {
unitsLayer.removeChildAt(0);
};
bloodLayer = null;
enemiesLayer = null;
fliesLayer = null;
specialLayer = null;
unitsLayer = null;
flies = null;
enemies = null;
units = null;
ani = null;
ani0 = null;
ani1 = null;
ani2 = null;
unitsDump = null;
dump = null;
currentGun = null;
currentUnit = null;
quick = null;
tower_l_d = null;
tower_r_d = null;
tower_l_u = null;
tower_r_u = null;
wall_d = null;
wall_l = null;
wall_r = null;
wall_u = null;
removeChild(cursor);
removeChild(grid);
removeChild(castle);
spawnTimer = null;
bugWaves = null;
mguns = null;
real = null;
map = null;
castle = null;
grid = null;
bg = null;
rocks = null;
cursor = null;
}
public function selectUnitsOnWall(_arg1:String):void{
var _local2:*;
if (selected.length > 0){
while (selected.length) {
selected[0].selectedMask.visible = false;
selected.splice(0, 1);
};
};
for (_local2 in this[_arg1].solders) {
if (this[_arg1].solders[_local2].length > 0){
selected.push(this[_arg1].solders[_local2][0]);
this[_arg1].solders[_local2][0].selectedMask.visible = true;
};
};
}
public function sellUnit(_arg1:int):void{
var _local2:int;
var _local3:Array;
var _local4:Array;
_local2 = 0;
_local3 = new Array();
_local4 = [160, 400, 250];
_local2 = 0;
while (_local2 < units.length) {
if (units[_local2].type == _arg1){
_local3.push({link:units[_local2], p:((units[_local2].rank * 10000) + units[_local2].experience)});
};
_local2++;
};
_local3.sortOn("p");
game.valourPoints = (game.valourPoints + _local4[_local3[0].link.type]);
_local3[0].link.destroy(true);
shopInit();
}
}
}//package com.elf7.level
Section 3
//BtnMenu (com.elf7.menu.BtnMenu)
package com.elf7.menu {
import flash.events.*;
import flash.display.*;
import com.elf7.*;
import com.elf7.level.*;
import com.elf7.utils.*;
import flash.net.*;
public class BtnMenu extends MovieClip {
public var bg:MovieClip;
public var btn:SimpleButton;
public var b:MovieClip;
public var bg0:MovieClip;
public var bg2:MovieClip;
public var bg1:MovieClip;
public var hideBtn:SimpleButton;
public var hints:Array;
public var gf:GameField;
public var game:Game;
public function BtnMenu():void{
var _local1:SimpleButton;
var _local2:SimpleButton;
var _local3:SimpleButton;
var _local4:SimpleButton;
var _local5:SimpleButton;
var _local6:XML;
hints = new Array();
super();
game = (parent as Game);
gf = (game.getChildByName("gf") as GameField);
hideBtn = (getChildByName("btn") as SimpleButton);
bg = (getChildByName("b") as MovieClip);
changeVisible(null);
hideBtn.addEventListener(MouseEvent.CLICK, changeVisible, false, 0, true);
_local1 = (bg.getChildByName("pause_b") as SimpleButton);
_local2 = (bg.getChildByName("help_b") as SimpleButton);
_local3 = (bg.getChildByName("sound_b") as SimpleButton);
_local4 = (bg.getChildByName("quit_b") as SimpleButton);
_local5 = (bg.getChildByName("more_b") as SimpleButton);
_local1.addEventListener(MouseEvent.CLICK, btnClick, false, 0, true);
_local2.addEventListener(MouseEvent.CLICK, btnClick, false, 0, true);
_local3.addEventListener(MouseEvent.CLICK, btnClick, false, 0, true);
_local4.addEventListener(MouseEvent.CLICK, btnClick, false, 0, true);
_local5.addEventListener(MouseEvent.CLICK, btnClick, false, 0, true);
hideBtn.addEventListener(MouseEvent.CLICK, game.onOver, false, 0, true);
_local1.addEventListener(MouseEvent.CLICK, game.onClick, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_OVER, game.onOver, false, 0, true);
_local2.addEventListener(MouseEvent.CLICK, game.onClick, false, 0, true);
_local2.addEventListener(MouseEvent.MOUSE_OVER, game.onOver, false, 0, true);
_local3.addEventListener(MouseEvent.CLICK, game.onClick, false, 0, true);
_local3.addEventListener(MouseEvent.MOUSE_OVER, game.onOver, false, 0, true);
_local4.addEventListener(MouseEvent.CLICK, game.onClick, false, 0, true);
_local4.addEventListener(MouseEvent.MOUSE_OVER, game.onOver, false, 0, true);
_local5.addEventListener(MouseEvent.CLICK, game.onClick, false, 0, true);
_local5.addEventListener(MouseEvent.MOUSE_OVER, game.onOver, false, 0, true);
_local6 = <hint name="hint0">
<bg x="0" y="0" w="150" h="40" t="0"/>
<text x="10" y="10" w="140" h="30">
<Font color="#FFFFFF" size="11">Click to hide or show menu!</Font>
</text>
</hint>
;
hints.push(addChild(new Hint()));
hints[(hints.length - 1)].target = (hideBtn as DisplayObject);
hints[(hints.length - 1)].create(_local6);
}
public function destroy():void{
var _local1:int;
var _local2:SimpleButton;
var _local3:SimpleButton;
var _local4:SimpleButton;
var _local5:SimpleButton;
var _local6:SimpleButton;
_local1 = 0;
_local1 = 0;
while (_local1 < hints.length) {
hints[_local1].destroy();
_local1++;
};
hints = null;
hideBtn.removeEventListener(MouseEvent.CLICK, changeVisible);
_local2 = (bg.getChildByName("pause_b") as SimpleButton);
_local3 = (bg.getChildByName("help_b") as SimpleButton);
_local4 = (bg.getChildByName("sound_b") as SimpleButton);
_local5 = (bg.getChildByName("quit_b") as SimpleButton);
_local6 = (bg.getChildByName("more_b") as SimpleButton);
_local2.removeEventListener(MouseEvent.CLICK, btnClick);
_local3.removeEventListener(MouseEvent.CLICK, btnClick);
_local4.removeEventListener(MouseEvent.CLICK, btnClick);
_local5.removeEventListener(MouseEvent.CLICK, btnClick);
_local6.removeEventListener(MouseEvent.CLICK, btnClick);
while (numChildren) {
removeChildAt(0);
};
bg = null;
hideBtn = null;
game = null;
gf = null;
parent.removeChild(this);
}
public function changeVisible(_arg1:MouseEvent):void{
var _local2:MovieClip;
if (_arg1 != null){
if (!_arg1.target.enabled){
return;
};
if (game.pause){
return;
};
};
bg.visible = !(bg.visible);
(getChildByName("bg0") as MovieClip).visible = !((getChildByName("bg0") as MovieClip).visible);
(getChildByName("bg1") as MovieClip).visible = !((getChildByName("bg1") as MovieClip).visible);
_local2 = (getChildByName("bg1") as MovieClip);
(getChildByName("bg2") as MovieClip).visible = !((getChildByName("bg2") as MovieClip).visible);
if (_local2.visible){
_local2.play();
} else {
_local2.stop();
};
}
public function btnClick(_arg1:MouseEvent):void{
var _local2:SimpleButton;
var _local3:SimpleButton;
var _local4:SimpleButton;
var _local5:SimpleButton;
var _local6:SimpleButton;
var _local7:SimpleButton;
_local2 = (_arg1.target as SimpleButton);
_local3 = (bg.getChildByName("pause_b") as SimpleButton);
_local4 = (bg.getChildByName("help_b") as SimpleButton);
_local5 = (bg.getChildByName("sound_b") as SimpleButton);
_local6 = (bg.getChildByName("quit_b") as SimpleButton);
_local7 = (bg.getChildByName("more_b") as SimpleButton);
if (_local2 == _local3){
if (game.pause){
gf.spawnTimer.start();
} else {
gf.spawnTimer.stop();
};
game.pause = !(game.pause);
};
if (_local2 == _local4){
gf.help = (game.addChildAt(new Help(), game.getChildIndex(game.doors)) as Help);
gf.help.x = 40;
gf.help.y = 50;
gf.help.init();
gf.disableMenus();
gf.closeMenus();
game.pause = true;
};
if (_local2 == _local5){
if (game.soundController.soundEnabled){
game.soundController.soundEnabled = false;
game.soundController.setVolume("all", 0);
} else {
game.soundController.setVolume("all", 1);
game.soundController.soundEnabled = true;
};
};
if (_local2 == _local6){
game.frameInc = -2;
game.doors.play();
onQuit();
};
if (_local2 == _local7){
navigateToURL(new URLRequest("http://www.flashgamesnexus.com/"), "_blank");
};
}
public function onQuit():void{
}
}
}//package com.elf7.menu
Section 4
//CastleMenu (com.elf7.menu.CastleMenu)
package com.elf7.menu {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import com.elf7.*;
import com.elf7.level.*;
import com.elf7.utils.*;
import flash.geom.*;
public dynamic class CastleMenu extends MovieClip {
public const colors:Array;
public var bg:MovieClip;
public var btn:SimpleButton;
public var b:MovieClip;
public var state:Object;
public var bg0:MovieClip;
public var bg2:MovieClip;
public var hideBtn:SimpleButton;
public var hints:Array;
public var gf:GameField;
public var game:Game;
public function CastleMenu(){
colors = [0xCC00, 6879494, 11598086, 15006978, 0xFFFF00, 16500996, 16494596, 16482308, 0xFF0000, 0];
state = {};
hints = new Array();
super();
}
public function destroy():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < hints.length) {
hints[_local1].destroy();
_local1++;
};
hints = null;
hideBtn.removeEventListener(MouseEvent.CLICK, changeVisible);
while (numChildren) {
removeChildAt(0);
};
bg = null;
hideBtn = null;
game = null;
gf = null;
state = null;
parent.removeChild(this);
}
public function init():void{
var _local1:Array;
var _local2:XML;
var _local3:String;
var _local4:String;
var _local5:*;
var _local6:int;
game = (parent as Game);
gf = (game.getChildByName("gf") as GameField);
hideBtn = (getChildByName("btn") as SimpleButton);
bg = (getChildByName("b") as MovieClip);
changeVisible(null);
hideBtn.addEventListener(MouseEvent.CLICK, changeVisible, false, 0, true);
hideBtn.addEventListener(MouseEvent.CLICK, game.onOver, false, 0, true);
(bg.getChildByName("tower_l_u") as MovieClip).buttonMode = true;
(bg.getChildByName("tower_r_u") as MovieClip).buttonMode = true;
(bg.getChildByName("tower_l_d") as MovieClip).buttonMode = true;
(bg.getChildByName("tower_r_d") as MovieClip).buttonMode = true;
(bg.getChildByName("wall_u") as MovieClip).buttonMode = true;
(bg.getChildByName("wall_d") as MovieClip).buttonMode = true;
(bg.getChildByName("wall_r") as MovieClip).buttonMode = true;
(bg.getChildByName("wall_l") as MovieClip).buttonMode = true;
state.tower_l_u = {link:(bg.getChildByName("tower_l_u") as MovieClip), state:100};
state.tower_r_u = {link:(bg.getChildByName("tower_r_u") as MovieClip), state:100};
state.tower_l_d = {link:(bg.getChildByName("tower_l_d") as MovieClip), state:100};
state.tower_r_d = {link:(bg.getChildByName("tower_r_d") as MovieClip), state:100};
state.wall_u = {link:(bg.getChildByName("wall_u") as MovieClip), state:100};
state.wall_d = {link:(bg.getChildByName("wall_d") as MovieClip), state:100};
state.wall_r = {link:(bg.getChildByName("wall_r") as MovieClip), state:100};
state.wall_l = {link:(bg.getChildByName("wall_l") as MovieClip), state:100};
_local1 = ["tower_l_u", "tower_r_u", "tower_l_d", "tower_r_d", "wall_u", "wall_d", "wall_r", "wall_l"];
for (_local5 in state) {
_local4 = ((_local5.indexOf("tower") > -1)) ? "TOWER_MAX_HEALTH" : "WALL_MAX_HEALTH";
_local3 = (((("<hint name=\"hint0\"> <bg x=\"0\" y=\"0\" w=\"70\" h=\"30\" t=\"0\"/><text x=\"10\" y=\"7\" w=\"70\" h=\"20\"><Font color=\"#FFFFFF\" size=\"11\">" + String(Math.floor(gf[_local5].health))) + "/") + gf[_local4]) + "</Font></text></hint>");
_local2 = new XML(_local3);
hints.push(addChild(new Hint()));
hints[(hints.length - 1)].target = (state[_local5].link as DisplayObject);
state[_local5].text = hints[(hints.length - 1)].create(_local2);
(bg.getChildByName((_local5 + "_t")) as TextField).text = (String(Math.floor(((gf[_local5].health / gf[_local4]) * 100))) + "%");
changeState(_local5, Math.floor(((gf[_local5].health / gf[_local4]) * 100)));
};
_local6 = 0;
while (_local6 < _local1.length) {
(bg.getChildByName((_local1[_local6] + "_t")) as TextField).mouseEnabled = false;
_local6++;
};
_local2 = <hint name="hint0">
<bg x="0" y="0" w="150" h="40" t="0"/>
<text x="10" y="10" w="140" h="30">
<Font color="#FFFFFF" size="11">Click to hide or show menu!</Font>
</text>
</hint>
;
hints.push(addChild(new Hint()));
hints[(hints.length - 1)].target = (hideBtn as DisplayObject);
hints[(hints.length - 1)].create(_local2);
}
public function changeVisible(_arg1:MouseEvent):void{
if (_arg1 != null){
if (!_arg1.target.enabled){
return;
};
if (game.pause){
return;
};
};
bg.visible = !(bg.visible);
(getChildByName("bg0") as MovieClip).visible = !((getChildByName("bg0") as MovieClip).visible);
(getChildByName("bg2") as MovieClip).visible = !((getChildByName("bg2") as MovieClip).visible);
}
public function getColor(_arg1:Number):uint{
var _local2:int;
_local2 = 0;
if (_arg1 > 95){
_local2 = 0;
} else {
if (_arg1 > 85){
_local2 = 1;
} else {
if (_arg1 > 75){
_local2 = 2;
} else {
if (_arg1 > 60){
_local2 = 3;
} else {
if (_arg1 > 50){
_local2 = 4;
} else {
if (_arg1 > 40){
_local2 = 5;
} else {
if (_arg1 > 30){
_local2 = 6;
} else {
if (_arg1 > 15){
_local2 = 7;
} else {
if (_arg1 > 0){
_local2 = 8;
} else {
_local2 = 9;
};
};
};
};
};
};
};
};
};
return (colors[_local2]);
}
public function changeState(_arg1:String, _arg2:Number):void{
var _local3:MovieClip;
var _local4:ColorTransform;
var _local5:String;
_local3 = (bg.getChildByName(_arg1) as MovieClip);
_local4 = new ColorTransform();
_local5 = ((_arg1.indexOf("tower") > -1)) ? "TOWER_MAX_HEALTH" : "WALL_MAX_HEALTH";
_local4.color = getColor(_arg2);
_local3.transform.colorTransform = _local4;
state[_arg1].state = _arg2;
(bg.getChildByName((_arg1 + "_t")) as TextField).text = (_arg2 + "%");
state[_arg1].text.htmlText = (((("<Font color=\"#FFFFFF\" size=\"11\">" + String(Math.floor(gf[_arg1].health))) + "/") + gf[_local5]) + "</Font>");
}
}
}//package com.elf7.menu
Section 5
//InfoMenu (com.elf7.menu.InfoMenu)
package com.elf7.menu {
import flash.events.*;
import flash.display.*;
import com.elf7.*;
import com.elf7.level.*;
import com.elf7.utils.*;
public class InfoMenu extends MovieClip {
public var closeBtn:SimpleButton;
public var bg:MovieClip;
public var btn:SimpleButton;
public var unit_screen:MovieClip;
public var bug_screen:MovieClip;
public var bg0:MovieClip;
public var bg2:MovieClip;
public var hints:Array;
public var gf:GameField;
public var game:Game;
public function InfoMenu():void{
var _local1:XML;
hints = new Array();
super();
game = (parent as Game);
gf = (game.getChildByName("gf") as GameField);
closeBtn = (getChildByName("btn") as SimpleButton);
changeVisible(null);
closeBtn.addEventListener(MouseEvent.CLICK, changeVisible, false, 0, true);
closeBtn.addEventListener(MouseEvent.CLICK, game.onOver, false, 0, true);
_local1 = <hint name="hint0">
<bg x="0" y="0" w="110" h="40" t="0"/>
<text x="10" y="10" w="100" h="30">
<Font color="#FFFFFF" size="11">Click to hide menu!</Font>
</text>
</hint>
;
hints.push(addChild(new Hint()));
hints[(hints.length - 1)].target = (closeBtn as DisplayObject);
hints[(hints.length - 1)].create(_local1);
}
public function destroy():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < hints.length) {
hints[_local1].destroy();
_local1++;
};
hints = null;
closeBtn.removeEventListener(MouseEvent.CLICK, changeVisible);
while (numChildren) {
removeChildAt(0);
};
bg = null;
closeBtn = null;
game = null;
gf = null;
parent.removeChild(this);
}
public function changeVisible(_arg1:MouseEvent):void{
if (_arg1 != null){
if (!_arg1.target.enabled){
return;
};
if (game.pause){
return;
};
};
if (gf.selected.length > 0){
while (gf.selected.length) {
gf.selected[0].selectedMask.visible = false;
gf.selected.splice(0, 1);
};
};
visible = false;
gf.currentUnit = null;
}
public function btnClick(_arg1:MouseEvent):void{
var _local2:SimpleButton;
var _local3:SimpleButton;
var _local4:SimpleButton;
var _local5:SimpleButton;
var _local6:SimpleButton;
var _local7:SimpleButton;
_local2 = (_arg1.target as SimpleButton);
_local3 = (bg.getChildByName("pause_b") as SimpleButton);
_local4 = (bg.getChildByName("help_b") as SimpleButton);
_local5 = (bg.getChildByName("options_b") as SimpleButton);
_local6 = (bg.getChildByName("quit_b") as SimpleButton);
_local7 = (bg.getChildByName("more_b") as SimpleButton);
if (_local2 == _local3){
game.pause = !(game.pause);
};
if (_local2 == _local4){
};
if (_local2 == _local5){
};
if (_local2 == _local6){
onQuit();
game.frameInc = -2;
game.doors.play();
};
if (_local2 == _local7){
game.naviget7thelf(null);
};
}
public function onQuit():void{
(game.getChildByName("gf") as GameField).destroy();
}
}
}//package com.elf7.menu
Section 6
//MapMenu (com.elf7.menu.MapMenu)
package com.elf7.menu {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import com.elf7.*;
import com.elf7.level.*;
import com.elf7.utils.*;
public dynamic class MapMenu extends MovieClip {
public const MAP_WIDTH:Number = 170;
public const FIELD_WIDTH:Number = 1590;
public const FIELD_HEIGHT:Number = 1590;
public const CANVAS_X:Number = 0;
public const CANVAS_Y:Number = 0;
public const MAP_HEIGHT:Number = 170;
public var fpsTimer:Number;// = 0
public var showBtn:SimpleButton;
public var bg:MovieClip;
public var btn:SimpleButton;
public var b:MovieClip;
public var canvas:MovieClip;
public var camera:MovieClip;
public var bg0:MovieClip;
public var hints:Array;
public var gf:GameField;
public var fps:TextField;
public var game:MovieClip;
public var castle:MovieClip;
public function MapMenu():void{
var _local1:MovieClip;
var _local2:XML;
fpsTimer = 0;
hints = new Array();
super();
_local1 = (getChildByName("bg0") as MovieClip);
game = (parent as Game);
gf = (game.getChildByName("gf") as GameField);
showBtn = (getChildByName("btn") as SimpleButton);
bg = (getChildByName("b") as MovieClip);
changeVisible(null);
bg.cacheAsBitmap = true;
_local1.cacheAsBitmap = true;
bg.cacheAsBitmap = true;
bg.mouseChildren = false;
bg.buttonMode = true;
showBtn.addEventListener(MouseEvent.CLICK, changeVisible, false, 0, true);
showBtn.addEventListener(MouseEvent.CLICK, game.onOver, false, 0, true);
bg.addEventListener(MouseEvent.CLICK, moveCam, false, 0, true);
castle = (bg.addChild(new CastleSymbol()) as MovieClip);
canvas = (bg.addChild(new MovieClip()) as MovieClip);
canvas.graphics.lineStyle(0, 0, 0);
canvas.x = CANVAS_X;
canvas.y = CANVAS_Y;
camera = (bg.addChild(new CamBorder()) as MovieClip);
camera.width = (stage.stageWidth * (MAP_WIDTH / FIELD_WIDTH));
camera.height = (stage.stageHeight * (MAP_HEIGHT / FIELD_HEIGHT));
castle.scaleX = (MAP_WIDTH / FIELD_WIDTH);
castle.scaleY = (MAP_HEIGHT / FIELD_HEIGHT);
castle.x = (((((gf.CELL_WIDTH * gf.CASTLE_X) - (2 * gf.CELL_WIDTH)) * MAP_WIDTH) / FIELD_WIDTH) + CANVAS_X);
castle.y = (((((gf.CELL_WIDTH * gf.CASTLE_Y) - (2 * gf.CELL_WIDTH)) * MAP_HEIGHT) / FIELD_HEIGHT) + CANVAS_Y);
_local2 = <hint name="hint0">
<bg x="0" y="0" w="150" h="40" t="0"/>
<text x="10" y="10" w="140" h="30">
<Font color="#FFFFFF" size="11">Click to hide or show map!</Font>
</text>
</hint>
;
hints.push(addChild(new Hint()));
hints[(hints.length - 1)].target = (showBtn as DisplayObject);
hints[(hints.length - 1)].create(_local2);
fpsTimer = getTimer();
addEventListener(Event.ENTER_FRAME, checkFPS, false, 0, true);
}
public function destroy():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < hints.length) {
hints[_local1].destroy();
_local1++;
};
hints = null;
removeEventListener(Event.ENTER_FRAME, checkFPS);
showBtn.removeEventListener(MouseEvent.CLICK, changeVisible);
bg.removeEventListener(MouseEvent.CLICK, moveCam);
while (numChildren) {
removeChildAt(0);
};
camera = null;
castle = null;
canvas = null;
bg = null;
showBtn = null;
gf = null;
game = null;
parent.removeChild(this);
}
public function drawBig(_arg1:Number, _arg2:Number):void{
canvas.graphics.beginFill(0xFF0000);
canvas.graphics.drawCircle((_arg1 * (MAP_WIDTH / FIELD_WIDTH)), (_arg2 * (MAP_HEIGHT / FIELD_HEIGHT)), 3);
canvas.graphics.endFill();
}
public function drawSmall(_arg1:Number, _arg2:Number):void{
canvas.graphics.beginFill(0xFF0000);
canvas.graphics.drawCircle((_arg1 * (MAP_WIDTH / FIELD_WIDTH)), (_arg2 * (MAP_HEIGHT / FIELD_HEIGHT)), 1);
canvas.graphics.endFill();
}
public function moveCam(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (gf.zoom){
return;
};
_local2 = (MAP_WIDTH / FIELD_WIDTH);
_local3 = (MAP_HEIGHT / FIELD_HEIGHT);
if ((((stage.mouseX - x) - bg.x) - CANVAS_X) < ((600 / 2) * _local2)){
_local4 = CANVAS_X;
} else {
if ((((stage.mouseX - x) - bg.x) - CANVAS_X) > (MAP_WIDTH - ((600 / 2) * _local2))){
_local4 = ((MAP_WIDTH - (600 * _local2)) + CANVAS_X);
} else {
_local4 = (((stage.mouseX - x) - bg.x) - ((600 / 2) * _local2));
};
};
if ((((stage.mouseY - y) - bg.y) - CANVAS_Y) < ((480 / 2) * _local3)){
_local5 = CANVAS_Y;
} else {
if ((((stage.mouseY - y) - bg.y) - CANVAS_Y) > (MAP_HEIGHT - ((480 / 2) * _local3))){
_local5 = ((MAP_HEIGHT - (480 * _local3)) + CANVAS_Y);
} else {
_local5 = (((stage.mouseY - y) - bg.y) - ((480 / 2) * _local3));
};
};
camera.x = _local4;
camera.y = _local5;
moveGameFieldByCam();
}
public function onZoom():void{
camera.visible = false;
}
public function moveCamByGameField():void{
var _local1:GameField;
var _local2:Number;
var _local3:Number;
_local1 = (game.getChildByName("gf") as GameField);
_local2 = (MAP_WIDTH / FIELD_WIDTH);
_local3 = (MAP_HEIGHT / FIELD_HEIGHT);
camera.x = ((-(_local1.x) * _local2) + CANVAS_X);
camera.y = ((-(_local1.y) * _local3) + CANVAS_Y);
}
public function clear():void{
canvas.graphics.clear();
}
public function changeVisible(_arg1:MouseEvent):void{
var _local2:MovieClip;
if (_arg1 != null){
if (!_arg1.target.enabled){
return;
};
if (game.pause){
return;
};
};
_local2 = (getChildByName("bg0") as MovieClip);
bg.visible = !(bg.visible);
_local2.visible = !(_local2.visible);
}
public function checkFPS(_arg1:Event):void{
var _local2:TextField;
_local2 = (getChildByName("fps") as TextField);
fpsTimer = (getTimer() - fpsTimer);
if (fpsTimer != 0){
_local2.text = ((("fps: " + String(Math.round((1000 / fpsTimer)))) + "/") + String(stage.frameRate));
} else {
_local2.text = ((("fps: " + String(stage.frameRate)) + "/") + String(stage.frameRate));
};
fpsTimer = getTimer();
}
public function drawMedium(_arg1:Number, _arg2:Number):void{
canvas.graphics.beginFill(0xFF0000);
canvas.graphics.drawCircle((_arg1 * (MAP_WIDTH / FIELD_WIDTH)), (_arg2 * (MAP_HEIGHT / FIELD_HEIGHT)), 2);
canvas.graphics.endFill();
}
public function onUnZoom():void{
camera.visible = true;
}
public function moveGameFieldByCam():void{
var _local1:Number;
var _local2:Number;
_local1 = (MAP_WIDTH / FIELD_WIDTH);
_local2 = (MAP_HEIGHT / FIELD_HEIGHT);
game.getChildByName("gf").x = (-((camera.x - CANVAS_X)) / _local1);
game.getChildByName("gf").y = (-((camera.y - CANVAS_Y)) / _local2);
}
}
}//package com.elf7.menu
Section 7
//RepairMenu (com.elf7.menu.RepairMenu)
package com.elf7.menu {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import com.elf7.*;
import com.elf7.level.*;
public class RepairMenu extends MovieClip {
public var tower_l_d:MovieClip;
public var game:Game;
public var tower_l_u:MovieClip;
public var tower_r_u_t:TextField;
public var tower_l_u_t:TextField;
public var rc:TextField;
public var wall_u_t:TextField;
public var ra:SimpleButton;
public var wall_d:MovieClip;
public var wall_r:MovieClip;
public var tower_l_d_t:TextField;
public var c:SimpleButton;
public var wall_l:MovieClip;
public var wall_l_t:TextField;
public var wall_d_t:TextField;
public var currentPart:String;
public var tower_r_d_t:TextField;
public var r:SimpleButton;
public var target:MovieClip;
public var price:Number;// = 0
public var tower_r_d:MovieClip;
public var tower_r_u:MovieClip;
public var vp:TextField;
public var wall_u:MovieClip;
public var parts:Object;
public var COST:Number;// = 0.1
public var gf:GameField;
public var wall_r_t:TextField;
public function RepairMenu():void{
COST = 0.1;
price = 0;
parts = {};
super();
visible = false;
}
public function destroy():void{
var _local1:MovieClip;
var _local2:MovieClip;
var _local3:*;
visible = false;
(getChildByName("ra") as SimpleButton).removeEventListener(MouseEvent.CLICK, repairAll);
(getChildByName("r") as SimpleButton).removeEventListener(MouseEvent.CLICK, repair);
(getChildByName("c") as SimpleButton).removeEventListener(MouseEvent.CLICK, onClose);
gf.repairMenu = null;
stage.removeEventListener(MouseEvent.MOUSE_UP, onUp);
for (_local3 in parts) {
_local2 = (getChildByName(_local3) as MovieClip);
_local1 = (_local2.getChildByName("s") as MovieClip);
_local1.removeEventListener(MouseEvent.MOUSE_DOWN, onDown);
};
parts = null;
while (numChildren) {
removeChildAt(0);
};
parent.removeChild(this);
}
public function init():void{
var _local1:MovieClip;
var _local2:MovieClip;
var _local3:TextField;
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:*;
game = (parent as Game);
gf = (game.getChildByName("gf") as GameField);
_local5 = 0;
_local6 = 0;
_local7 = ((gf["WALL_MAX_HEALTH"] / 100) * 0.1);
_local8 = ((gf["TOWER_MAX_HEALTH"] / 100) * 0.1);
parts.tower_r_d = {r:0, c:0, g:null};
parts.tower_r_u = {r:0, c:0, g:null};
parts.tower_l_d = {r:0, c:0, g:null};
parts.tower_l_u = {r:0, c:0, g:null};
parts.wall_l = {r:0, c:0, g:null};
parts.wall_d = {r:0, c:0, g:null};
parts.wall_r = {r:0, c:0, g:null};
parts.wall_u = {r:0, c:0, g:null};
for (_local9 in parts) {
_local2 = (getChildByName(_local9) as MovieClip);
_local1 = (_local2.getChildByName("s") as MovieClip);
if (_local9.indexOf("wall") > -1){
_local4 = "WALL_MAX_HEALTH";
} else {
_local4 = "TOWER_MAX_HEALTH";
};
_local5 = Math.floor(((gf[_local9].health / gf[_local4]) * 100));
_local2.gotoAndStop((101 - _local5));
_local1.addEventListener(MouseEvent.MOUSE_DOWN, onDown, false, 0, true);
_local1.buttonMode = true;
_local1.x = Math.floor(((_local5 * 200) / 100));
(getChildByName((_local9 + "_t")) as TextField).htmlText = ((String(Math.floor(gf[_local9].health)) + "/") + String((((gf[_local4] + " (") + String(_local5)) + "%)")));
};
(getChildByName("ra") as SimpleButton).addEventListener(MouseEvent.CLICK, repairAll, false, 0, true);
(getChildByName("r") as SimpleButton).addEventListener(MouseEvent.CLICK, repair, false, 0, true);
(getChildByName("c") as SimpleButton).addEventListener(MouseEvent.CLICK, onClose, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, onUp, false, 0, true);
(getChildByName("vp") as TextField).text = String(game.valourPoints);
(getChildByName("rc") as TextField).text = "0";
visible = true;
}
public function onDown(_arg1:MouseEvent):void{
target = (_arg1.target as MovieClip);
addEventListener(Event.ENTER_FRAME, onDrag, false, 0, true);
}
public function onClose(_arg1:MouseEvent):void{
gf.shopInit();
destroy();
}
public function repair(_arg1:MouseEvent):void{
var _local2:*;
for (_local2 in parts) {
gf.damageCastle(_local2, -(parts[_local2].r));
};
game.valourPoints = (game.valourPoints - price);
refresh();
}
public function onDrag(_arg1:Event):void{
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:Number;
var _local5:Number;
var _local6:String;
var _local7:int;
var _local8:*;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local2 = (target as MovieClip);
_local3 = (target.parent as MovieClip);
_local4 = ((gf["WALL_MAX_HEALTH"] / 100) * COST);
_local5 = ((gf["TOWER_MAX_HEALTH"] / 100) * COST);
_local7 = 0;
for (_local8 in parts) {
if (_local8 == _local3.name){
} else {
_local7 = (_local7 + parts[_local8].c);
};
};
if (_local3.name.indexOf("wall") > -1){
_local6 = "WALL_MAX_HEALTH";
} else {
_local6 = "TOWER_MAX_HEALTH";
};
_local9 = Math.floor(((gf[_local3.name].health / gf[_local6]) * 200));
_local10 = 0;
_local11 = Math.ceil(((gf[_local6] - Math.floor(gf[_local3.name].health)) * COST));
if (_local11 > (game.valourPoints - _local7)){
if (_local3.name.indexOf("wall") > -1){
_local11 = Math.floor((Math.floor(((game.valourPoints - _local7) / _local4)) * _local4));
} else {
_local11 = Math.floor((Math.floor(((game.valourPoints - _local7) / _local5)) * _local5));
};
if (_local3.name.indexOf("wall") > -1){
_local10 = Math.floor((_local9 + (((_local11 / _local4) * 200) / 100)));
} else {
_local10 = Math.floor((_local9 + (((_local11 / _local5) * 200) / 100)));
};
} else {
_local10 = 200;
};
if (((stage.mouseX - _local3.x) - x) < _local9){
_local2.x = _local9;
} else {
if (((stage.mouseX - _local3.x) - x) > _local10){
_local2.x = _local10;
} else {
_local2.x = ((stage.mouseX - _local3.x) - x);
};
};
refresh();
}
public function repairAll(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:*;
var _local10:MovieClip;
var _local11:MovieClip;
_local2 = ((gf["WALL_MAX_HEALTH"] / 100) * COST);
_local3 = ((gf["TOWER_MAX_HEALTH"] / 100) * COST);
_local5 = new Array();
_local6 = 0;
_local7 = 0;
_local8 = 0;
price = 0;
for (_local9 in parts) {
if (_local9.indexOf("wall") > -1){
_local4 = "WALL_MAX_HEALTH";
} else {
_local4 = "TOWER_MAX_HEALTH";
};
_local7 = Math.floor(((gf[_local9].health / gf[_local4]) * 100));
_local8 = (100 - _local7);
if ((gf[_local4] - Math.floor(gf[_local9].health)) > 0){
_local5.push({});
_local5[(_local5.length - 1)].name = _local9;
_local5[(_local5.length - 1)].ar = (gf[_local4] - Math.floor(gf[_local9].health));
if (_local9.indexOf("wall") > -1){
_local5[(_local5.length - 1)].p = Math.ceil(((gf[_local4] - Math.floor(gf[_local9].health)) * COST));
} else {
_local5[(_local5.length - 1)].p = Math.ceil(((gf[_local4] - Math.floor(gf[_local9].health)) * COST));
};
_local6 = (_local6 + (gf[_local4] - Math.floor(gf[_local9].health)));
};
};
if ((_local6 * COST) <= game.valourPoints){
for (_local9 in parts) {
if (_local9.indexOf("wall") > -1){
_local4 = "WALL_MAX_HEALTH";
} else {
_local4 = "TOWER_MAX_HEALTH";
};
parts[_local9].r = (gf[_local4] - Math.floor(gf[_local9].health));
price = (price + Math.ceil((parts[_local9].r * COST)));
};
} else {
_local6 = Math.floor((game.valourPoints / COST));
_local5.sortOn("ar", Array.NUMERIC);
while (_local5.length) {
if (_local5[0].ar < Math.floor((_local6 / _local5.length))){
parts[_local5[0].name].r = _local5[0].ar;
} else {
parts[_local5[0].name].r = Math.floor((_local6 / _local5.length));
};
price = (price + (parts[_local5[0].name].r * COST));
_local6 = (_local6 - parts[_local5[0].name].r);
_local5.splice(0, 1);
};
price = Math.ceil(price);
};
repair(null);
for (_local9 in parts) {
_local11 = (getChildByName(_local9) as MovieClip);
_local10 = (_local11.getChildByName("s") as MovieClip);
if (_local9.indexOf("wall") > -1){
_local4 = "WALL_MAX_HEALTH";
} else {
_local4 = "TOWER_MAX_HEALTH";
};
_local7 = Math.floor(((gf[_local9].health / gf[_local4]) * 100));
_local10.x = Math.floor(((_local7 * 200) / 100));
};
refresh();
}
public function onUp(_arg1:MouseEvent):void{
if (target != null){
removeEventListener(Event.ENTER_FRAME, onDrag);
};
target = null;
}
public function refresh():void{
var _local1:MovieClip;
var _local2:MovieClip;
var _local3:TextField;
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:*;
_local5 = 0;
_local6 = 0;
_local7 = ((gf["WALL_MAX_HEALTH"] / 100) * COST);
_local8 = ((gf["TOWER_MAX_HEALTH"] / 100) * COST);
for (_local9 in parts) {
_local2 = (getChildByName(_local9) as MovieClip);
_local1 = (_local2.getChildByName("s") as MovieClip);
if (_local9.indexOf("wall") > -1){
_local4 = "WALL_MAX_HEALTH";
} else {
_local4 = "TOWER_MAX_HEALTH";
};
_local5 = Math.floor(((gf[_local9].health / gf[_local4]) * 100));
_local2.gotoAndStop((101 - _local5));
if (_local1.x < Math.floor(((_local5 * 200) / 100))){
_local1.x = Math.floor(((_local5 * 200) / 100));
};
_local6 = Math.floor(((_local1.x / 200) * 100));
parts[_local9].r = (((_local6 - _local5) / 100) * gf[_local4]);
if (parts[_local9].r < 0){
parts[_local9].r = 0;
_local1.x = Math.floor(((_local5 * 200) / 100));
};
if (_local9.indexOf("wall") > -1){
parts[_local9].c = ((_local6 - _local5) * _local7);
} else {
parts[_local9].c = ((_local6 - _local5) * _local8);
};
if (parts[_local9].c < 0){
parts[_local9].c = 0;
};
if (_local9 == "tower_l_d"){
};
if ((_local6 - _local5) > 0){
(getChildByName((_local9 + "_t")) as TextField).htmlText = ((String(Math.floor(gf[_local9].health)) + "/") + String((((((gf[_local4] + " (") + String(_local5)) + "%) <Font color=\"#0AE44A\">+") + String((_local6 - _local5))) + "%</Font>")));
} else {
(getChildByName((_local9 + "_t")) as TextField).htmlText = ((String(Math.floor(gf[_local9].health)) + "/") + String((((gf[_local4] + " (") + String(_local5)) + "%)")));
};
};
price = 0;
for (_local9 in parts) {
price = (price + parts[_local9].c);
};
(getChildByName("rc") as TextField).text = String(price);
(getChildByName("vp") as TextField).text = String(game.valourPoints);
}
}
}//package com.elf7.menu
Section 8
//SoundController (com.elf7.sound.SoundController)
package com.elf7.sound {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import com.elf7.*;
public class SoundController extends MovieClip {
public var music:SoundChannel;
public var soundChannel:int;// = 0
public var nextTrack:Sound;
public var soundEnabled;// = true
public var sounds:Array;
public var sndLib:Object;
public var currentTrack:Sound;
public var dV:Number;// = 0.1
public var soundCounter:int;// = 0
public var game:Game;
public function SoundController(){
var _local1:Number;
music = new SoundChannel();
sounds = new Array();
sndLib = {};
dV = 0.1;
soundCounter = 0;
soundChannel = 0;
soundEnabled = true;
super();
_local1 = 0;
sndLib.main = new Main();
sndLib.light = new Light();
sndLib.hard = new Hard();
sndLib.logo = new Logo();
sndLib.openMenu = new OpenMenu();
sndLib.click = new ClickSound();
sndLib.over = new OverSound();
sndLib.doors = new DoorSound();
sndLib.bazooka = new BazookaShotSound();
sndLib.gun = new GunShotSound();
sndLib.aut = new AutShotSound();
sndLib.bugHit0 = new BugHitSound0();
sndLib.bugHit1 = new BugHitSound1();
sndLib.exp = new ExpSound();
sndLib.flyBomb = new FlyBombSound();
sndLib.clacb = new ClacBig();
sndLib.clacs = new ClacSmall();
sndLib.chain = new Chain();
sndLib.win = new WinSound();
sndLib.solderDie = new SolderDieSound();
sndLib.sendBomb = new SendBombSound();
sndLib.flash = new FlashSound();
sndLib.bul = new BulletSound();
sndLib.bioBomb = new BioBomb();
_local1 = 0;
while (_local1 < 10) {
sounds[_local1] = new SoundChannel();
_local1++;
};
}
public function startTrack(_arg1:Sound):void{
var _local2:Number;
_local2 = 0;
_local2 = (soundEnabled) ? 1 : 0;
if (nextTrack == null){
if (currentTrack == null){
currentTrack = _arg1;
music = _arg1.play(0, 10000, new SoundTransform(0));
addEventListener(Event.ENTER_FRAME, unmuteCurrentTrack);
return;
};
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, unmuteCurrentTrack);
};
if (soundEnabled){
nextTrack = _arg1;
addEventListener(Event.ENTER_FRAME, muteCurrentTrack);
} else {
currentTrack = _arg1;
music.stop();
music = _arg1.play(0, 10000, new SoundTransform(0));
};
} else {
if (soundEnabled){
nextTrack = _arg1;
} else {
currentTrack = _arg1;
music.stop();
music = _arg1.play(0, 10000, new SoundTransform(0));
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, muteCurrentTrack);
};
};
};
}
public function muteCurrentTrack(_arg1:Event):void{
if (music.soundTransform.volume <= 0){
currentTrack = nextTrack;
nextTrack = null;
music.stop();
music = currentTrack.play(0, 10000, new SoundTransform(0));
addEventListener(Event.ENTER_FRAME, unmuteCurrentTrack);
removeEventListener(Event.ENTER_FRAME, muteCurrentTrack);
} else {
music.soundTransform = new SoundTransform((music.soundTransform.volume - dV));
};
}
public function setVolume(_arg1:String, _arg2:Number):void{
var _local3:int;
_local3 = 0;
if ((((_arg1 == "sound")) || ((_arg1 == "all")))){
_local3 = 0;
while (_local3 < sounds.length) {
sounds[_local3].soundTransform = new SoundTransform(_arg2);
_local3++;
};
};
if ((((_arg1 == "music")) || ((_arg1 == "all")))){
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, unmuteCurrentTrack);
};
music.soundTransform = new SoundTransform(_arg2);
};
}
public function playSound(_arg1:String):void{
var _local2:Number;
_local2 = 0;
_local2 = (soundEnabled) ? 1 : 0;
soundCounter++;
if (soundCounter > 5){
soundChannel = ((soundChannel >= sounds.length)) ? 0 : (soundChannel + 1);
soundCounter = 0;
};
sounds[soundChannel] = sndLib[_arg1].play(0, 1, new SoundTransform(_local2));
}
public function playMusic(_arg1:String, _arg2:Number=0.1):void{
var _local3:Number;
_local3 = 0;
dV = _arg2;
_local3 = (soundEnabled) ? 1 : 0;
startTrack(sndLib[_arg1]);
}
public function unmuteCurrentTrack(_arg1:Event):void{
if (music.soundTransform.volume >= 1){
removeEventListener(Event.ENTER_FRAME, unmuteCurrentTrack);
} else {
music.soundTransform = new SoundTransform((music.soundTransform.volume + dV));
};
}
}
}//package com.elf7.sound
Section 9
//Tracer (com.elf7.spec.Tracer)
package com.elf7.spec {
import flash.events.*;
import flash.display.*;
public class Tracer extends MovieClip {
public var targetY:Number;// = 0
public var lifeTime:int;// = 6
public var targetX:Number;// = 0
public function Tracer():void{
targetX = 0;
targetY = 0;
lifeTime = 6;
super();
}
public function destroy():void{
removeEventListener(Event.ENTER_FRAME, animation);
if (parent != null){
parent.removeChild(this);
};
}
public function init():void{
graphics.lineStyle(1, 16705682);
graphics.moveTo(0, 0);
graphics.lineTo(targetX, targetY);
addEventListener(Event.ENTER_FRAME, animation, false, 0, true);
}
public function animation(_arg1:Event):void{
if (lifeTime > 0){
lifeTime--;
visible = !(visible);
} else {
destroy();
};
}
}
}//package com.elf7.spec
Section 10
//BigGun (com.elf7.units.BigGun)
package com.elf7.units {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import com.elf7.*;
import com.elf7.menu.*;
import com.elf7.level.*;
public class BigGun extends MovieClip {
public var des:String;
public var game:Game;
public var border:Boolean;// = false
public var old:Object;
public var rank:int;// = 0
public var tower:String;// = ""
public var fire:Object;
public var atackTime:int;// = 200
public var rotY:Number;// = 0
public var star:MovieClip;
public var experience:Number;// = 0
public var damage:Number;// = 110
public var rotX:Number;// = 0
public var killed:int;// = 0
public var target:Object;
public var radius:Number;// = 0
public var con:MovieClip;
public var type:int;// = 0
public var atackCounter:int;// = 200
public var posY:Number;// = 0
public var posX:Number;// = 0
public var rot:Number;// = 0
public var gf:GameField;
public function BigGun(){
border = false;
atackTime = 200;
atackCounter = 200;
type = 0;
rank = 0;
killed = 0;
experience = 0;
radius = 0;
damage = 110;
tower = "";
target = {x:-1, y:-1};
old = {x:-1, y:-1};
fire = {x:-1, y:-1};
rot = 0;
rotX = 0;
rotY = 0;
posX = 0;
posY = 0;
super();
}
public function destroy():void{
var _local1:InfoMenu;
_local1 = (game.getChildByName("im") as InfoMenu);
gf[tower].weapon = null;
removeEventListener(Event.ENTER_FRAME, ai);
removeEventListener(MouseEvent.CLICK, onClick);
if (parent != null){
if ((((gf.currentGun == this)) && (!((_local1 == null))))){
_local1.changeVisible(null);
};
removeChild(con);
parent.removeChild(this);
};
gf = null;
game = null;
con = null;
fire = null;
old = null;
target = null;
}
public function init():void{
gf = (parent.parent as GameField);
game = (gf.parent as Game);
if (type == 0){
radius = 300;
};
if (type == 1){
des = "Mortar automatically defines the enemy‘s location and causes great damages in the big territory. It can hit enemies only at a long range.";
radius = 400;
con = (addChildAt(new BigGun1(), 0) as MovieClip);
};
if (type == 2){
des = "Automatic machinegun. Attacks only air targets. Has phenomenal rate of fire.";
target.enemy = null;
atackTime = 2;
radius = 400;
con = (addChildAt(new BigGun2(), 0) as MovieClip);
};
(con.getChildByName("main") as MovieClip).gotoAndStop(1);
star = (addChild(new Star()) as MovieClip);
star.mouseEnabled = false;
damage = gf[("gun" + String(type))][rank].damage;
mouseChildren = false;
buttonMode = true;
rotateGun(true);
addEventListener(Event.ENTER_FRAME, ai, false, 0, true);
addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
public function getRotationAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if ((((_arg2 == _arg1)) && ((_arg4 == _arg3)))){
return (0);
};
if ((_arg2 - _arg1) == 0){
if ((_arg4 - _arg3) > 0){
return (90);
};
if ((_arg4 - _arg3) < 0){
return (-90);
};
};
if ((_arg4 - _arg3) == 0){
if ((_arg2 - _arg1) > 0){
return (180);
};
if ((_arg2 - _arg1) < 0){
return (0);
};
};
if ((_arg2 - _arg1) > 0){
return ((90 + ((Math.acos(((_arg4 - _arg3) / Math.sqrt(getL(_arg1, _arg2, _arg3, _arg4)))) * 180) / Math.PI)));
};
return ((90 - ((Math.acos(((_arg4 - _arg3) / Math.sqrt(getL(_arg1, _arg2, _arg3, _arg4)))) * 180) / Math.PI)));
}
public function ai(_arg1:Event):void{
if (game.pause){
return;
};
var _local2 = this;
_local2[("gun" + String(type))]();
}
public function createExplosion():void{
var _local1:MovieClip;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:Number;
game.soundController.playSound("exp");
_local1 = (gf.specialLayer.addChild(new Explosion()) as MovieClip);
_local1.x = fire.x;
_local1.y = fire.y;
_local1 = (gf.specialLayer.addChild(new Explosion()) as MovieClip);
_local1.x = (fire.x - 30);
_local1.y = (fire.y - 30);
_local1 = (gf.specialLayer.addChild(new Explosion()) as MovieClip);
_local1.x = (fire.x + 30);
_local1.y = (fire.y - 30);
_local1 = (gf.specialLayer.addChild(new Explosion()) as MovieClip);
_local1.x = fire.x;
_local1.y = (fire.y + 30);
_local2 = Math.floor((fire.x / 30));
_local3 = Math.floor((fire.y / 30));
_local4 = -3;
_local5 = -3;
_local6 = -3;
_local7 = -3;
_local8 = 0;
_local9 = 3;
_local10 = 3;
if ((_local2 + _local6) < 0){
_local6 = -(_local2);
};
if ((_local3 + _local7) < 0){
_local7 = -(_local3);
};
if ((_local2 + _local9) > (gf.map.length - 1)){
_local9 = ((gf.map.length - 1) - _local2);
};
if ((_local3 + _local10) > (gf.map[0].length - 1)){
_local10 = ((gf.map[0].length - 1) - _local3);
};
_local4 = _local6;
while (_local4 < (_local9 + 1)) {
_local5 = _local7;
while (_local5 < (_local10 + 1)) {
_local8 = 0;
while (_local8 < gf.dump[(_local4 + _local2)][(_local5 + _local3)].length) {
if (gf.dump[(_local4 + _local2)][(_local5 + _local3)][_local8].fly){
} else {
_local11 = gf.dump[(_local4 + _local2)][(_local5 + _local3)][_local8].experience;
if (gf.dump[(_local4 + _local2)][(_local5 + _local3)][_local8].damaged(damage)){
addExp(_local11);
killed++;
};
};
_local8++;
};
_local5++;
};
_local4++;
};
}
public function getL(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((Math.pow((_arg2 - _arg1), 2) + Math.pow((_arg4 - _arg3), 2)));
}
public function addExp(_arg1:Number):void{
if (rank >= (gf.gunRank.length - 1)){
return;
};
if ((experience + _arg1) >= gf.gunRank[(rank + 1)]){
game.levelStatistic.srised++;
experience = 0;
rank++;
star.play();
damage = gf[("gun" + String(type))][rank].damage;
} else {
experience = (experience + _arg1);
};
refresh();
}
public function drotate():Boolean{
var _local1:MovieClip;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:*;
var _local7:Number;
_local1 = (con.getChildByName("main") as MovieClip);
_local2 = (rotX - x);
_local3 = (rotY - y);
_local4 = Math.atan2(_local3, _local2);
_local5 = ((_local4 / Math.PI) * 180);
_local6 = ((_local1.rotation - 90) - _local5);
_local7 = 3;
if (_local6 > 180){
_local6 = (-360 + _local6);
} else {
if (_local6 < -180){
_local6 = (360 + _local6);
};
};
if (Math.abs(_local6) < _local7){
_local1.rotation = (_local1.rotation - _local6);
return (true);
};
if (_local6 > 0){
_local1.rotation = (_local1.rotation - _local7);
return (false);
};
_local1.rotation = (_local1.rotation + _local7);
return (false);
}
public function refresh():void{
var _local1:InfoMenu;
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:TextField;
var _local5:TextField;
var _local6:TextField;
var _local7:TextField;
var _local8:TextField;
var _local9:TextField;
var _local10:TextField;
var _local11:TextField;
var _local12:MovieClip;
var _local13:TextField;
var _local14:MovieClip;
if (gf.currentGun != this){
return;
};
_local1 = (game.getChildByName("im") as InfoMenu);
_local2 = (_local1.getChildByName("unit_screen") as MovieClip);
_local3 = (_local2.getChildByName("i") as MovieClip);
_local4 = (_local2.getChildByName("n_t") as TextField);
_local5 = (_local2.getChildByName("h_t") as TextField);
_local6 = (_local2.getChildByName("name_t") as TextField);
_local7 = (_local2.getChildByName("rank_t") as TextField);
_local8 = (_local2.getChildByName("d_t") as TextField);
_local9 = (_local2.getChildByName("damage_t") as TextField);
_local10 = (_local2.getChildByName("killed_t") as TextField);
_local11 = (_local2.getChildByName("des_t") as TextField);
_local12 = (_local2.getChildByName("bar") as MovieClip);
_local13 = (_local2.getChildByName("health_t") as TextField);
_local3.gotoAndStop((type + 3));
_local14 = (_local3.getChildByName("s") as MovieClip);
_local14.gotoAndStop((1 + (rank * 2)));
_local4.text = "type: ";
_local5.visible = false;
_local13.visible = false;
if (type == 1){
_local6.text = "mortar";
} else {
_local6.text = "machinegun";
};
_local8.text = "damage:";
_local7.text = String((rank + 1));
_local10.text = String(killed);
_local9.text = String(damage);
_local11.text = des;
if (rank == (gf.gunRank.length - 1)){
_local12.gotoAndStop(101);
} else {
_local12.gotoAndStop(Math.floor(((experience / (gf.gunRank[(rank + 1)] - gf.gunRank[rank])) * 100)));
};
}
public function rotateGun(_arg1:Boolean=false):void{
var _local2:MovieClip;
_local2 = (con.getChildByName("main") as MovieClip);
if (tower == "tower_l_u"){
rot = -45;
rotX = (x - 100);
rotY = (y - 100);
};
if (tower == "tower_r_u"){
rot = 45;
rotX = (x + 100);
rotY = (y - 100);
};
if (tower == "tower_l_d"){
rot = -135;
rotX = (x - 100);
rotY = (y + 100);
};
if (tower == "tower_r_d"){
rot = 135;
rot = (60 + (90 * Math.random()));
rotX = (x + 100);
rotY = (y + 100);
};
if (_arg1){
posX = rotX;
posY = rotY;
_local2.rotation = rot;
};
}
public function onClick(_arg1:MouseEvent):void{
var _local2:InfoMenu;
var _local3:MovieClip;
var _local4:MovieClip;
if (game.pause){
return;
};
gf.currentUnit = null;
gf.currentGun = this;
_local2 = (game.getChildByName("im") as InfoMenu);
_local3 = (_local2.getChildByName("unit_screen") as MovieClip);
_local4 = (_local2.getChildByName("bug_screen") as MovieClip);
refresh();
if (!_local2.visible){
_local2.visible = true;
};
_local3.visible = true;
_local4.visible = false;
if ((((type == 0)) || ((type == 1)))){
};
}
public function gun1():void{
var _local1:MovieClip;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Array;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
_local1 = (con.getChildByName("main") as MovieClip);
_local2 = 0;
_local3 = 0;
_local4 = 0;
if (target.link == null){
if (atackCounter <= atackTime){
if (gf.flies.length == gf.enemies.length){
return;
};
_local5 = new Array();
_local6 = (16 * gf.CELL_WIDTH);
_local7 = (14 * gf.CELL_WIDTH);
_local8 = (37 * gf.CELL_WIDTH);
_local9 = (35 * gf.CELL_WIDTH);
_local2 = 0;
while (_local2 < gf.enemies.length) {
if (!gf.enemies[_local2].fly){
_local3 = getL(x, gf.enemies[_local2].x, y, gf.enemies[_local2].y);
if ((((((gf.enemies[_local2].x < _local6)) || ((gf.enemies[_local2].x > _local7)))) && ((((gf.enemies[_local2].y < _local8)) || ((gf.enemies[_local2].y > _local9)))))){
if (_local3 >= (radius * radius)){
_local5.push(gf.enemies[_local2]);
};
};
};
if (_local5.length > 4){
break;
};
_local2++;
};
if (_local5.length > 0){
_local10 = Math.floor((Math.random() * (_local5.length - 0.01)));
target.link = _local5[_local10];
target.x = _local5[_local10].x;
target.y = _local5[_local10].y;
rotX = target.x;
rotY = target.y;
} else {
drotate();
return;
};
};
} else {
if (target.link.parent == null){
target.link = null;
rotateGun();
return;
};
_local3 = getL(x, target.link.x, y, target.link.y);
if (_local3 < (radius * radius)){
target.link = null;
rotateGun();
return;
};
rotX = target.x;
rotY = target.y;
};
if (atackCounter == atackTime){
if (!drotate()){
return;
};
if (target.link != null){
game.soundController.playSound("gun");
_local1.play();
target.x = target.link.x;
target.y = target.link.y;
};
fire.x = target.x;
fire.y = target.y;
};
if (atackCounter > (atackTime + 20)){
if (!drotate()){
return;
};
createExplosion();
target.link = null;
atackCounter = 0;
} else {
atackCounter++;
if (((!((target.link == null))) && ((atackCounter < atackTime)))){
drotate();
};
if ((((target.link == null)) && ((atackCounter == atackTime)))){
atackCounter--;
};
};
}
public function gun2():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:MovieClip;
var _local9:Bullet;
var _local10:Number;
var _local11:Number;
var _local12:Number;
if (gf.dump == null){
return;
};
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = (radius * radius);
_local5 = (90 * 90);
_local6 = 0;
_local7 = 0;
_local8 = (con.getChildByName("main") as MovieClip);
atackCounter++;
if (target.enemy == null){
if (_local8.currentFrame != 1){
_local8.gotoAndStop(1);
};
_local7 = gf.flies.length;
_local1 = 0;
while (_local1 < _local7) {
_local6 = getL(x, gf.flies[_local1].x, y, gf.flies[_local1].y);
if ((((_local6 < _local4)) && ((_local6 > _local5)))){
target.enemy = gf.flies[_local1];
rotX = target.enemy.x;
rotY = target.enemy.y;
return;
};
_local1++;
};
if ((((_local7 == 0)) || ((target == null)))){
drotate();
};
} else {
if (target.enemy.parent == null){
target.enemy = null;
rotateGun();
return;
};
_local6 = getL(x, target.enemy.x, y, target.enemy.y);
if ((((_local6 > _local4)) || ((_local6 < _local5)))){
target.enemy = null;
rotateGun();
return;
};
rotX = target.enemy.x;
rotY = target.enemy.y;
if (atackCounter >= atackTime){
if (!drotate()){
if (_local8.currentFrame != 1){
_local8.gotoAndStop(1);
};
return;
};
if (_local8.currentFrame == 1){
_local8.play();
};
game.soundController.playSound("bul");
atackCounter = 0;
_local9 = (gf.specialLayer.addChild(new Bullet()) as Bullet);
_local10 = 85;
_local11 = ((target.enemy.x - x) / Math.sqrt(_local6));
_local12 = ((target.enemy.y - y) / Math.sqrt(_local6));
_local9.x = (x + (_local10 * _local11));
_local9.y = (y + (_local10 * _local12));
_local9.rotation = _local8.rotation;
_local9.speedX = (20 * _local11);
_local9.speedY = (20 * _local12);
_local9.damage = damage;
_local9.gun = this;
_local9.init();
};
};
}
public function gun0():void{
}
}
}//package com.elf7.units
Section 11
//Bomb (com.elf7.units.Bomb)
package com.elf7.units {
import flash.events.*;
import flash.display.*;
import com.elf7.*;
import com.elf7.level.*;
public class Bomb extends MovieClip {
public const FLY_TIME:int = 44;
public var expDamage:Number;// = 5
public var counter:int;// = 0
public var destinationY:Number;// = 0
public var destinationX:Number;// = 0
public var speedY:Number;
public var speed:Number;// = 20
public var solder:Solder;
public var radius:Number;// = 60
public var gf:GameField;
public var speedX:Number;
public var game:Game;
public function Bomb(){
radius = 60;
counter = 0;
expDamage = 5;
speed = 20;
destinationX = 0;
destinationY = 0;
super();
addFrameScript(0, frame1, 6, frame7);
}
public function destroy():void{
removeEventListener(Event.ENTER_FRAME, fly);
play();
if (parent != null){
expl();
};
}
public function init():void{
gf = (parent.parent as GameField);
game = (gf.parent as Game);
mouseEnabled = false;
speedX = ((destinationX - x) / FLY_TIME);
speedY = ((destinationY - y) / FLY_TIME);
counter = FLY_TIME;
addEventListener(Event.ENTER_FRAME, fly, false, 0, true);
}
public function onRemove(_arg1:Event):void{
if (_arg1.target != this){
return;
};
destroy();
}
function frame7(){
stop();
if (parent != null){
parent.removeChild(this);
};
}
function frame1(){
stop();
}
public function fly(_arg1:Event):void{
if (parent == null){
destroy();
return;
};
if (counter < 0){
destroy();
} else {
x = (x + speedX);
y = (y + speedY);
if (counter > (FLY_TIME / 2)){
scaleX = (scaleX + 0.02);
scaleY = (scaleY + 0.02);
} else {
scaleX = (scaleX - 0.02);
scaleY = (scaleY - 0.02);
};
counter--;
};
}
public function expl():void{
var _local1:int;
var _local2:int;
game.soundController.playSound("bioBomb");
_local1 = Math.floor((x / gf.CELL_WIDTH));
_local2 = Math.floor((y / gf.CELL_WIDTH));
if (gf.unitsDump[_local1][_local2].length > 0){
if (gf.unitsDump[_local1][_local2][0].parent == null){
return;
};
gf.unitsDump[_local1][_local2][0].damaged(expDamage);
};
if (gf.quick[((String(_local1) + "_") + String(_local2))] != undefined){
gf.damageCastle(gf.quick[((String(_local1) + "_") + String(_local2))], (expDamage * 4));
};
}
}
}//package com.elf7.units
Section 12
//Bug (com.elf7.units.Bug)
package com.elf7.units {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import com.elf7.algo.*;
import flash.utils.*;
import com.elf7.*;
import com.elf7.menu.*;
import com.elf7.level.*;
public class Bug extends MovieClip {
public const ACTION_ATACK:String = "ATACK";
public const ACTION_MOVE:String = "MOVE";
public const ACTION_REST:String = "REST";
public const TILE_WIDTH:Number = 30;
public var run_first:int;// = 0
public var flyCounter:int;// = 0
public var arrow:MovieClip;
public var ATACK_TIME:Number;// = 42
public var healthBar:MovieClip;
public var ccx:Number;// = 0
public var deadRadius:Number;// = 130
public var ccy:Number;// = 0
public var des:String;// = ""
public var path:Array;
public var action:String;// = "MOVE"
public var activeRound:MovieClip;
public var wallPos:Object;
public var speed:Number;// = 2
public var health:Number;// = 0
public var fly:Boolean;// = false
public var pos:Object;
public var free:Boolean;// = false
public var inCastle:Boolean;// = false
public var rPos:Object;
public var clickMask:MovieClip;
public var dv:Object;
public var bombDir:int;// = 1
public var dx:Number;// = 0
public var dy:Number;// = 0
public var atack_first:int;// = 0
public var waitCounter:int;// = 0
public var maxWaitCounter:int;
public var currentWall:String;// = "none"
public var gf:GameField;
public var speedX:Number;// = 0
public var speedY:Number;// = 0
public var stand_first:int;// = 0
public var flyDir:int;// = 0
public var bugName:String;// = ""
public var type:int;// = 0
public var click_mask:MovieClip;
public var nearCastle:Boolean;// = false
public var currentSolder:Solder;
public var experience:Number;// = 0
public var vcx:Number;// = 0
public var vcy:Number;// = 0
public var damage:Number;// = 0
public var con:MovieClip;
public var target:String;// = ""
public var flySpeed:Object;
public var atackCounter:Number;// = 0
public var health_bar:MovieClip;
public var MAX_HEALTH:Number;// = 0
public var run_last:int;// = 0
public var atack_last:int;// = 0
public var walkPos:Object;
public var hideHealthCounter:int;// = 0
public var game:Game;
public var inside:Boolean;// = false
public function Bug(){
MAX_HEALTH = 0;
ATACK_TIME = (21 * 2);
ccx = 0;
ccy = 0;
vcx = 0;
vcy = 0;
deadRadius = 130;
flyDir = 0;
flyCounter = 0;
dv = {x:0, y:0};
flySpeed = {};
inside = false;
bombDir = 1;
speed = 2;
currentWall = "none";
wallPos = {x:0, y:0};
atack_first = 0;
atack_last = 0;
run_first = 0;
run_last = 0;
stand_first = 0;
damage = 0;
health = 0;
atackCounter = 0;
type = 0;
target = "";
fly = false;
free = false;
inCastle = false;
experience = 0;
bugName = "";
des = "";
maxWaitCounter = Math.round((60 + (Math.random() * 60)));
waitCounter = 0;
hideHealthCounter = 0;
path = new Array();
pos = {x:0, y:0};
dx = 0;
dy = 0;
rPos = {x:0, y:0};
walkPos = {sx:0, sy:0, ex:0, ey:0};
action = ACTION_MOVE;
speedX = 0;
speedY = 0;
nearCastle = false;
super();
}
public function getNewWalkPos():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = ((pos.x + 0.5) * TILE_WIDTH);
_local2 = ((pos.y + 0.5) * TILE_WIDTH);
_local3 = ((Math.random() > 0.5)) ? -1 : 1;
_local4 = ((Math.random() > 0.5)) ? -1 : 1;
_local5 = 15;
walkPos.ex = (_local1 + Math.round(((Math.random() * _local5) * _local3)));
walkPos.ey = (_local2 + Math.round(((Math.random() * _local5) * _local4)));
}
public function ai(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:Number;
var _local6:Number;
var _local7:Object;
var _local8:int;
var _local9:int;
var _local10:Bug;
var _local11:int;
var _local12:int;
var _local13:Bomb;
if (game.pause){
return;
};
if (parent == null){
return;
};
if (gf.zoom){
if (arrow.visible){
arrow.visible = false;
};
} else {
if (!arrow.visible){
arrow.visible = true;
};
showArrow();
};
if (action == "alldone"){
if (con.currentFrame != stand_first){
con.gotoAndPlay("STAND");
};
return;
};
if ((((((((((pos.x > (gf.CASTLE_X - 3))) && ((pos.x < (gf.CASTLE_X + 13))))) && ((pos.y > (gf.CASTLE_Y - 3))))) && ((pos.y < (gf.CASTLE_Y + 13))))) && (!(fly)))){
inCastle = true;
} else {
inCastle = false;
};
_local2 = 0;
_local3 = 2;
if (gf.currentUnit == this){
};
if (healthBar.currentFrame != (101 - Math.floor(((health / MAX_HEALTH) * 100)))){
healthBar.gotoAndStop((101 - Math.floor(((health / MAX_HEALTH) * 100))));
};
if (hideHealthCounter > 0){
hideHealthCounter++;
if (hideHealthCounter > 20){
hideHealthCounter = 0;
healthBar.visible = false;
};
};
if (fly){
if (type == 5){
if (inside){
_local5 = (ccx + (deadRadius * Math.cos(flySpeed.angle)));
_local6 = (ccy + (deadRadius * Math.sin(flySpeed.angle)));
con.rotation = getRotationAngle(y, _local6, x, _local5);
x = _local5;
y = _local6;
flySpeed.angle = (flySpeed.angle + ((flyDir * Math.PI) / 360));
if (atackCounter < ATACK_TIME){
atackCounter++;
};
if (atackCounter >= ATACK_TIME){
atackCounter = 0;
if (gf.units.length > 0){
dropBomb();
};
};
} else {
x = (x + flySpeed.x);
y = (y + flySpeed.y);
if (getL(x, ccx, y, ccy) < (deadRadius * deadRadius)){
inside = true;
flySpeed.angle = Math.atan2((y - ccy), (x - ccx));
};
};
return;
};
if (getL(x, ccx, y, ccy) < (deadRadius * deadRadius)){
if (atackCounter < ATACK_TIME){
atackCounter++;
};
if (atackCounter >= ATACK_TIME){
atackCounter = 0;
if (gf.units.length > 0){
dropBomb();
};
};
if (!inside){
if (flyCounter > 20){
flyCounter = 0;
inside = true;
_local7 = {x:((50 * flyDir) * flySpeed.y), y:((-50 * flyDir) * flySpeed.x)};
vcx = (x + _local7.x);
vcy = (y + _local7.y);
} else {
flyCounter++;
};
};
} else {
if (inside){
if (flyCounter > 20){
flyCounter = 0;
inside = false;
} else {
flyCounter++;
};
};
};
_local4 = {x:0, y:0};
if (!inside){
_local4.x = (ccx - x);
_local4.y = (ccy - y);
dv = {x:(_local4.x - flySpeed.x), y:(_local4.y - flySpeed.y)};
_local2 = Math.sqrt(((dv.x * dv.x) + (dv.y * dv.y)));
dv = {x:(dv.x / _local2), y:(dv.y / _local2)};
} else {
_local4.x = (vcx - x);
_local4.y = (vcy - y);
dv = {x:(_local4.x - flySpeed.x), y:(_local4.y - flySpeed.y)};
_local2 = Math.sqrt(((dv.x * dv.x) + (dv.y * dv.y)));
dv = {x:(dv.x / _local2), y:(dv.y / _local2)};
};
flySpeed.x = (flySpeed.x + dv.x);
flySpeed.y = (flySpeed.y + dv.y);
_local2 = Math.sqrt(((flySpeed.x * flySpeed.x) + (flySpeed.y * flySpeed.y)));
flySpeed = {x:((_local3 * flySpeed.x) / _local2), y:((_local3 * flySpeed.y) / _local2)};
x = (x + flySpeed.x);
y = (y + flySpeed.y);
con.rotation = getRotationAngle(y, (y + flySpeed.y), x, (x + flySpeed.x));
return;
};
if (atackCounter < ATACK_TIME){
atackCounter++;
};
if (((!((target == ""))) && ((atackCounter >= ATACK_TIME)))){
action = ACTION_ATACK;
atackCounter = 0;
};
if (action == ACTION_ATACK){
if (((!((type == 7))) && (!((type == 6))))){
if ((((target.indexOf("tower") > -1)) || ((target.indexOf("wall") > -1)))){
if ((((type == 3)) || ((type == 0)))){
game.soundController.playSound("clacs");
};
if (type == 2){
game.soundController.playSound("clacb");
};
if (!gf.damageCastle(target, damage)){
action = ACTION_MOVE;
free = true;
return;
};
} else {
if (atackCounter < (ATACK_TIME - 1)){
return;
};
if (currentSolder != null){
if (currentSolder.parent == null){
currentSolder = null;
target = "";
action = ACTION_MOVE;
return;
};
con.rotation = getRotationAngle(y, currentSolder.y, x, currentSolder.x);
if (atackCounter >= (ATACK_TIME - 1)){
currentSolder.damaged(damage);
if ((((con.currentFrame < atack_first)) || ((con.currentFrame > atack_last)))){
con.gotoAndPlay("ATACK");
};
return;
};
return;
} else {
action = ACTION_MOVE;
target = "";
return;
};
};
};
if (type == 7){
if (atackCounter >= ATACK_TIME){
if (gf.enemies.length > (gf.MAX_ENEMIES - 3)){
return;
};
_local8 = dx;
_local9 = dy;
if ((((currentWall == "wall_u")) || ((currentWall == "wall_d")))){
_local8 = (-2 + Math.floor((Math.random() * 4.99)));
};
if ((((currentWall == "wall_r")) || ((currentWall == "wall_l")))){
_local9 = (-2 + Math.floor((Math.random() * 4.99)));
};
_local10 = gf.createEnemy(pos.x, pos.y, "3");
_local10.path.push({x:(pos.x + _local8), y:(pos.y + _local9)});
parent.setChildIndex(_local10, parent.getChildIndex(this));
atackCounter = 0;
};
return;
};
if (type == 6){
if (atackCounter >= ATACK_TIME){
game.soundController.playSound("sendBomb");
_local11 = (((pos.x + (dx * 8)) * 30) + (random() * 100));
_local12 = (((pos.y + (dy * 8)) * 30) + (random() * 100));
_local13 = (gf.specialLayer.addChild(new Bomb()) as Bomb);
_local13.x = (rPos.x + (random() * 30));
_local13.y = (rPos.y + (random() * 30));
_local13.destinationX = _local11;
_local13.destinationY = _local12;
_local13.expDamage = damage;
_local13.init();
atackCounter = 0;
};
return;
};
action = ACTION_REST;
if ((((con.currentFrame < atack_first)) || ((con.currentFrame > atack_last)))){
con.gotoAndPlay("ATACK");
};
};
if (action == ACTION_MOVE){
if ((((con.currentFrame < run_first)) || ((con.currentFrame > run_last)))){
con.gotoAndPlay("WALK");
};
if (!free){
moveByPath();
} else {
freeMove();
};
};
}
public function dropBomb():void{
var _local1:FlyBomb;
var _local2:int;
game.soundController.playSound("sendBomb");
_local1 = (gf.specialLayer.addChild(new FlyBomb()) as FlyBomb);
_local2 = Math.floor((Math.random() * (gf.units.length - 0.01)));
_local1.x = x;
_local1.y = y;
_local1.mouseEnabled = false;
_local1.destinationX = gf.units[_local2].x;
_local1.destinationY = gf.units[_local2].y;
_local1.expDamage = damage;
_local1.dir = bombDir;
bombDir = -(bombDir);
_local1.init();
}
public function getRotationAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if ((((_arg2 == _arg1)) && ((_arg4 == _arg3)))){
return (0);
};
if ((_arg2 - _arg1) == 0){
if ((_arg4 - _arg3) > 0){
return (90);
};
if ((_arg4 - _arg3) < 0){
return (-90);
};
};
if ((_arg4 - _arg3) == 0){
if ((_arg2 - _arg1) > 0){
return (180);
};
if ((_arg2 - _arg1) < 0){
return (0);
};
};
if ((_arg2 - _arg1) > 0){
return ((90 + ((Math.acos(((_arg4 - _arg3) / Math.sqrt(getL(_arg1, _arg2, _arg3, _arg4)))) * 180) / Math.PI)));
};
return ((90 - ((Math.acos(((_arg4 - _arg3) / Math.sqrt(getL(_arg1, _arg2, _arg3, _arg4)))) * 180) / Math.PI)));
}
public function convertToBitMap(_arg1:MovieClip):Bitmap{
var _local2:BitmapData;
var _local3:Bitmap;
_local2 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local2.draw(_arg1);
_local3 = new Bitmap(_local2);
return (_local3);
}
public function onMove(_arg1:MouseEvent):void{
if (game.pause){
return;
};
hideHealthCounter = 1;
healthBar.visible = true;
}
function createBrains():void{
var _local1:Number;
var _local2:Bitmap;
var _local3:MovieClip;
_local1 = 0;
if (type == 0){
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart0())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart1())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart2())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
return;
};
if (type == 1){
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart3())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.scaleX = 0.5;
_local2.scaleY = 0.5;
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart4())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart9())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
return;
};
if (type == 2){
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart8())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart8())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart5())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
return;
};
if (type == 3){
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart3())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.scaleX = 0.5;
_local2.scaleY = 0.5;
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart4())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart7())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
return;
};
if (type == 4){
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart6())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart10())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart12())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
return;
};
if (type == 5){
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart9())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart3())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart4())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
return;
};
if (type == 6){
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart6())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart10())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart12())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
return;
};
if (type == 7){
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart6())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart10())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
_local2 = (gf.bloodLayer.addChild(convertToBitMap(new BugPart11())) as Bitmap);
_local2.x = (x + (random() * 20));
_local2.y = (y + (random() * 20));
_local2.rotation = (360 * Math.random());
return;
};
}
public function freeMove():void{
var _local1:Solder;
var _local2:int;
var _local3:Wave;
var _local4:Array;
var _local5:int;
var _local6:Object;
if ((((Math.abs((walkPos.ex - rPos.x)) < (speed + 2))) && ((Math.abs((walkPos.ey - rPos.y)) < (speed + 2))))){
x = walkPos.ex;
y = walkPos.ey;
rPos.x = x;
rPos.y = y;
walkPos.sx = walkPos.ex;
walkPos.sy = walkPos.ey;
if (gf.castleCrash){
_local1 = searchSolders();
if (_local1 != null){
currentSolder = _local1;
action = ACTION_ATACK;
target = "solder";
path.splice(1);
con.gotoAndStop("STAND");
return;
};
};
if (path.length == 1){
if (gf[currentWall].health <= 0){
if (gf.units.length == 0){
action = "alldone";
return;
};
_local2 = 0;
_local3 = new Wave();
_local2 = Math.floor((Math.random() * (gf.units.length - 0.01)));
_local4 = _local3.findPath(gf.map, pos.x, pos.y, gf.units[_local2].pos.x, gf.units[_local2].pos.y);
if (path.length > 1){
path.splice(1);
};
if (_local4 == null){
return;
};
_local5 = 1;
while (_local5 < _local4.length) {
path.push(_local4[_local5]);
_local5++;
};
} else {
_local6 = {};
if (currentWall == "wall_u"){
_local2 = Math.floor((Math.random() * 4.99));
_local6.x = ((gf.CASTLE_X + 3) + _local2);
_local6.y = (gf.CASTLE_Y - 3);
};
if (currentWall == "wall_d"){
_local2 = Math.floor((Math.random() * 4.99));
_local6.x = ((gf.CASTLE_X + 3) + _local2);
_local6.y = (gf.CASTLE_Y + 13);
};
if (currentWall == "wall_r"){
_local2 = Math.floor((Math.random() * 4.99));
_local6.x = (gf.CASTLE_X + 13);
_local6.y = ((gf.CASTLE_Y + 3) + _local2);
};
if (currentWall == "wall_l"){
_local2 = Math.floor((Math.random() * 4.99));
_local6.x = (gf.CASTLE_X - 3);
_local6.y = ((gf.CASTLE_Y + 3) + _local2);
};
if (gf.quick[((String((pos.x + dx)) + "_") + String((pos.y + dy)))] == currentWall){
con.gotoAndStop("STAND");
target = currentWall;
con.rotation = getRotationAngle(y, (((pos.y + dy) + 0.5) * gf.CELL_WIDTH), x, (((pos.x + dx) + 0.5) * gf.CELL_WIDTH));
return;
};
_local3 = new Wave();
_local4 = _local3.findPath(gf.map, pos.x, pos.y, _local6.x, _local6.y);
if (path.length > 1){
path.splice(1);
};
if (_local4 == null){
return;
};
_local5 = 1;
while (_local5 < _local4.length) {
path.push(_local4[_local5]);
_local5++;
};
path.splice((path.length - 1));
};
};
if (path.length < 2){
return;
};
walkPos.ex = (gf.real[path[1].x][path[1].y].x + (random() * 10));
walkPos.ey = (gf.real[path[1].x][path[1].y].y + (random() * 10));
path.splice(0, 1);
pos.x = path[0].x;
pos.y = path[0].y;
con.rotation = getRotationAngle(walkPos.sy, walkPos.ey, walkPos.sx, walkPos.ex);
speedX = (((walkPos.ex - walkPos.sx) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * speed);
speedY = (((walkPos.ey - walkPos.sy) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * speed);
} else {
move();
};
}
public function meleeBug(_arg1:Event):void{
var _local2:Solder;
if (game.pause){
return;
};
if (parent == null){
return;
};
if (gf.zoom){
if (arrow.visible){
arrow.visible = false;
};
} else {
if (!arrow.visible){
arrow.visible = true;
};
showArrow();
};
if ((((((((((pos.x > (gf.CASTLE_X - 3))) && ((pos.x < (gf.CASTLE_X + 13))))) && ((pos.y > (gf.CASTLE_Y - 3))))) && ((pos.y < (gf.CASTLE_Y + 13))))) && (!(fly)))){
inCastle = true;
} else {
inCastle = false;
};
if (healthBar.currentFrame != (101 - Math.floor(((health / MAX_HEALTH) * 100)))){
healthBar.gotoAndStop((101 - Math.floor(((health / MAX_HEALTH) * 100))));
};
if (hideHealthCounter > 0){
hideHealthCounter++;
if (hideHealthCounter > 20){
hideHealthCounter = 0;
healthBar.visible = false;
};
};
if (atackCounter < ATACK_TIME){
atackCounter++;
};
if (action == ACTION_MOVE){
if ((((con.currentFrame < run_first)) || ((con.currentFrame > run_last)))){
con.gotoAndPlay("WALK");
};
move0();
};
if (action == ACTION_ATACK){
if (con.currentFrame >= atack_first){
return;
};
if (target.indexOf("tower") > -1){
if (gf[target].health <= 0){
target = currentWall;
action = ACTION_MOVE;
return;
};
};
if (target.indexOf("wall") > -1){
if (gf[target].health <= 0){
target = "solder";
action = ACTION_MOVE;
return;
};
};
if (target == "solder"){
_local2 = searchSolders();
if (gf.enemies[0] == this){
};
if (_local2 == null){
action = ACTION_MOVE;
return;
};
};
if (atackCounter >= ATACK_TIME){
if ((((type == 3)) || ((type == 0)))){
game.soundController.playSound("clacs");
};
if (type == 2){
game.soundController.playSound("clacb");
};
atackCounter = 0;
con.gotoAndPlay("ATACK");
if ((((target.indexOf("wall") > -1)) || ((target.indexOf("tower") > -1)))){
gf.damageCastle(target, damage);
};
if (target == "solder"){
_local2.damaged(damage);
};
};
};
if (action == ACTION_REST){
if (con.currentFrame != 1){
con.gotoAndStop(1);
};
};
}
public function moveByPath():void{
if ((((Math.abs((walkPos.ex - rPos.x)) < (speed + 2))) && ((Math.abs((walkPos.ey - rPos.y)) < (speed + 2))))){
x = walkPos.ex;
y = walkPos.ey;
rPos.x = x;
rPos.y = y;
walkPos.sx = walkPos.ex;
walkPos.sy = walkPos.ey;
if (path.length == 1){
if (type == 7){
if (gf.quick[((String((pos.x + (5 * dx))) + "_") + String((pos.y + (5 * dy))))] != undefined){
con.gotoAndPlay("ATACK");
action = ACTION_ATACK;
return;
};
};
if (type == 6){
if (gf.quick[((String((pos.x + (5 * dx))) + "_") + String((pos.y + (5 * dy))))] != undefined){
con.gotoAndStop("STAND");
action = ACTION_ATACK;
return;
};
};
if (!isWallPoint((pos.x + dx), (pos.y + dy))){
findNextPoint();
} else {
if (type != 4){
walkPos.ex = walkPos.sx;
walkPos.ey = walkPos.sy;
gf.searchTargetForBug(this);
} else {
if ((((gf.enemies.length < 2)) && ((gf.melody == "h")))){
gf.melody = "l";
game.soundController.playMusic("light");
};
exploted();
destroy();
};
return;
};
};
if (gf.quick[((String((path[1].x + dx)) + "_") + String((path[1].y + dy)))] != undefined){
walkPos.ex = (gf.real[path[1].x][path[1].y].x + (random() * 10));
walkPos.ey = (gf.real[path[1].x][path[1].y].y + (random() * 10));
} else {
walkPos.ex = gf.real[path[1].x][path[1].y].x;
walkPos.ey = gf.real[path[1].x][path[1].y].y;
};
path.splice(0, 1);
pos.x = path[0].x;
pos.y = path[0].y;
con.rotation = getRotationAngle(walkPos.sy, walkPos.ey, walkPos.sx, walkPos.ex);
speedX = (((walkPos.ex - walkPos.sx) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * speed);
speedY = (((walkPos.ey - walkPos.sy) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * speed);
} else {
move();
};
}
public function move0():void{
if ((((Math.abs((walkPos.ex - rPos.x)) < (speed + 2))) && ((Math.abs((walkPos.ey - rPos.y)) < (speed + 2))))){
x = walkPos.ex;
y = walkPos.ey;
rPos.x = x;
rPos.y = y;
walkPos.sx = walkPos.ex;
walkPos.sy = walkPos.ey;
onEnterNewCell0();
} else {
move();
};
}
public function getTarget():void{
var _local1:int;
var _local2:int;
var _local3:Boolean;
_local1 = pos.x;
_local2 = pos.y;
_local3 = false;
while (!(_local3)) {
if (gf.quick[((String(_local1) + "_") + String(_local2))] != undefined){
target = gf.quick[((String(_local1) + "_") + String(_local2))];
return;
};
_local1 = (_local1 + dx);
_local2 = (_local2 + dy);
};
}
public function findNextPoint():void{
var _local1:int;
var _local2:int;
var _local3:Array;
var _local4:Number;
_local1 = ((dx == 0)) ? 0 : (dx / Math.abs(dx));
_local2 = ((dy == 0)) ? 0 : (dy / Math.abs(dy));
while (true) {
if (gf.map[(pos.x + _local1)][(pos.y + _local2)] == 1){
if (dx != 0){
_local1 = (_local1 + (dx / Math.abs(dx)));
};
if (dy != 0){
_local2 = (_local2 + (dy / Math.abs(dy)));
};
} else {
_local3 = new Wave().findPath(gf.map, pos.x, pos.y, (pos.x + _local1), (pos.y + _local2));
if (path.length > 1){
path.splice(1);
};
_local4 = 1;
while (_local4 < _local3.length) {
path.push(_local3[_local4]);
_local4++;
};
return;
};
};
}
public function onEnterNewCell0():void{
var _local1:int;
var _local2:Object;
var _local3:Number;
var _local4:int;
var _local5:Wave;
var _local6:Array;
var _local7:Solder;
_local1 = 0;
if (!nearCastle){
if (path.length == 1){
if (gf.quick[((String((path[0].x + dx)) + "_") + String((path[0].y + dy)))] == undefined){
findNextPoint();
} else {
walkPos.ex = walkPos.sx;
walkPos.ey = walkPos.sy;
nearCastle = true;
action = ACTION_ATACK;
return;
};
} else {
if (gf.quick[((String((path[1].x + dx)) + "_") + String((path[1].y + dy)))] != undefined){
walkPos.ex = (gf.real[path[1].x][path[1].y].x + (random() * 10));
walkPos.ey = (gf.real[path[1].x][path[1].y].y + (random() * 10));
} else {
walkPos.ex = gf.real[path[1].x][path[1].y].x;
walkPos.ey = gf.real[path[1].x][path[1].y].y;
};
path.splice(0, 1);
pos.x = path[0].x;
pos.y = path[0].y;
con.rotation = getRotationAngle(walkPos.sy, walkPos.ey, walkPos.sx, walkPos.ex);
speedX = (((walkPos.ex - walkPos.sx) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * speed);
speedY = (((walkPos.ey - walkPos.sy) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * speed);
};
return;
};
if (target.indexOf("wall") > -1){
if (path.length == 1){
if (gf.quick[((String((path[0].x + dx)) + "_") + String((path[0].y + dy)))] != currentWall){
_local2 = {};
_local3 = 0;
if (currentWall == "wall_u"){
_local3 = Math.floor((Math.random() * 4.99));
_local2.x = ((gf.CASTLE_X + 3) + _local3);
_local2.y = (gf.CASTLE_Y - 3);
};
if (currentWall == "wall_d"){
_local3 = Math.floor((Math.random() * 4.99));
_local2.x = ((gf.CASTLE_X + 3) + _local3);
_local2.y = (gf.CASTLE_Y + 13);
};
if (currentWall == "wall_r"){
_local3 = Math.floor((Math.random() * 4.99));
_local2.x = (gf.CASTLE_X + 13);
_local2.y = ((gf.CASTLE_Y + 3) + _local3);
};
if (currentWall == "wall_l"){
_local3 = Math.floor((Math.random() * 4.99));
_local2.x = (gf.CASTLE_X - 3);
_local2.y = ((gf.CASTLE_Y + 3) + _local3);
};
_local5 = new Wave();
_local6 = _local5.findPath(gf.map, pos.x, pos.y, _local2.x, _local2.y);
_local1 = 1;
while (_local1 < _local6.length) {
path.push(_local6[_local1]);
_local1++;
};
action = ACTION_MOVE;
return;
} else {
action = ACTION_ATACK;
con.rotation = getRotationAngle(y, (y + dy), x, (x + dx));
return;
};
} else {
walkPos.ex = gf.real[path[1].x][path[1].y].x;
walkPos.ey = gf.real[path[1].x][path[1].y].y;
path.splice(0, 1);
pos.x = path[0].x;
pos.y = path[0].y;
con.rotation = getRotationAngle(walkPos.sy, walkPos.ey, walkPos.sx, walkPos.ex);
speedX = (((walkPos.ex - walkPos.sx) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * speed);
speedY = (((walkPos.ey - walkPos.sy) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * speed);
};
};
if (target == "solder"){
if (path.length < 2){
if (gf.units.length == 0){
action = ACTION_REST;
return;
};
_local4 = Math.floor((Math.random() * (gf.units.length - 0.01)));
_local5 = new Wave();
_local6 = _local5.findPath(gf.map, pos.x, pos.y, gf.units[_local4].pos.x, gf.units[_local4].pos.y);
if (_local6 == null){
return;
};
_local1 = 1;
while (_local1 < _local6.length) {
path.push(_local6[_local1]);
_local1++;
};
} else {
_local7 = searchSolders();
if (_local7 == null){
walkPos.ex = gf.real[path[1].x][path[1].y].x;
walkPos.ey = gf.real[path[1].x][path[1].y].y;
path.splice(0, 1);
pos.x = path[0].x;
pos.y = path[0].y;
con.rotation = getRotationAngle(walkPos.sy, walkPos.ey, walkPos.sx, walkPos.ex);
speedX = (((walkPos.ex - walkPos.sx) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * speed);
speedY = (((walkPos.ey - walkPos.sy) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * speed);
} else {
con.rotation = getRotationAngle(y, _local7.y, x, _local7.x);
path.splice(1);
action = ACTION_ATACK;
con.gotoAndStop("STAND");
};
};
};
}
public function random():Number{
var _local1:Number;
_local1 = 1;
if (Math.random() > 0.5){
_local1 = -1;
};
return ((Math.random() * _local1));
}
public function damaged(_arg1:Number):Boolean{
var _local2:int;
var _local3:int;
var _local4:Class;
var _local5:MovieClip;
var _local6:Class;
var _local7:MovieClip;
if (parent == null){
return (false);
};
refresh();
if ((health - _arg1) <= 0){
game.levelStatistic.ekilled++;
if ((((gf.enemies.length < 2)) && ((gf.melody == "h")))){
gf.melody = "l";
game.soundController.playMusic("light");
};
health = 0;
_local2 = 0;
_local3 = 0;
_local4 = (getDefinitionByName(("BugExplosion" + String(Math.floor((Math.random() * 0.99))))) as Class);
_local5 = (gf.bloodLayer.addChild(new (_local4)) as MovieClip);
_local5.x = x;
_local5.y = y;
_local5.rotation = (_local5.rotation + (Math.random() * 360));
_local5.mouseEnabled = false;
_local5.cacheAsBitmap = true;
createBrains();
game.soundController.playSound("bugHit0");
destroy();
return (true);
} else {
hideHealthCounter = 1;
healthBar.visible = true;
if (Math.random() < 0.3){
game.soundController.playSound("bugHit1");
};
health = (health - _arg1);
if (Math.random() > 0.3){
return (false);
};
_local6 = (getDefinitionByName(("GreenBlood" + String(Math.floor((Math.random() * 2.99))))) as Class);
_local7 = (gf.bloodLayer.addChild(new (_local6)) as MovieClip);
_local7.x = x;
_local7.y = y;
_local7.rotation = (Math.random() * 360);
_local7.mouseEnabled = false;
_local7.cacheAsBitmap = true;
};
return (!NULL!);
}
public function refresh():void{
var _local1:InfoMenu;
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:TextField;
var _local5:TextField;
var _local6:TextField;
var _local7:TextField;
if (parent == null){
return;
};
if (gf.currentUnit != this){
return;
};
_local1 = (game.getChildByName("im") as InfoMenu);
_local2 = (_local1.getChildByName("bug_screen") as MovieClip);
_local3 = (_local2.getChildByName("i") as MovieClip);
_local4 = (_local2.getChildByName("name_t") as TextField);
_local5 = (_local2.getChildByName("damage_t") as TextField);
_local6 = (_local2.getChildByName("des_t") as TextField);
_local7 = (_local2.getChildByName("health_t") as TextField);
_local3.gotoAndStop((type + 1));
_local7.text = ((String(health) + "/") + String(MAX_HEALTH));
_local4.text = bugName;
_local5.text = String(damage);
_local6.text = des;
}
public function onClick(_arg1:MouseEvent):void{
var _local2:InfoMenu;
var _local3:MovieClip;
var _local4:MovieClip;
if (game.pause){
return;
};
hideHealthCounter = 1;
healthBar.visible = true;
gf.currentUnit = this;
gf.currentGun = null;
refresh();
_local2 = (game.getChildByName("im") as InfoMenu);
_local3 = (_local2.getChildByName("unit_screen") as MovieClip);
_local4 = (_local2.getChildByName("bug_screen") as MovieClip);
if (!_local2.visible){
_local2.visible = true;
};
_local4.visible = true;
_local3.visible = false;
}
public function init(_arg1:int, _arg2:int, _arg3:String):void{
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:Class;
_local4 = 0;
_local5 = 0;
_local6 = 0;
pos.x = _arg1;
pos.y = _arg2;
gf = (parent.parent as GameField);
game = (gf.parent as Game);
type = int(_arg3);
healthBar = (getChildByName("health_bar") as MovieClip);
clickMask = (getChildByName("click_mask") as MovieClip);
healthBar.visible = false;
healthBar.mouseEnabled = false;
clickMask.buttonMode = true;
activeRound = (addChildAt(new MovieClip(), 0) as MovieClip);
activeRound.graphics.lineStyle(2, 0xCC00);
activeRound.graphics.drawCircle(0, 0, 60);
activeRound.graphics.drawCircle(0, 0, 60);
activeRound.visible = false;
arrow = (game.addChildAt(new Arrow(), game.getChildIndex(game.doors)) as MovieClip);
arrow.visible = false;
arrow.mouseEnabled = false;
arrow.mouseChildren = false;
path.push({x:pos.x, y:pos.y});
walkPos.ex = ((_arg1 + 0.5) * TILE_WIDTH);
walkPos.ey = ((_arg2 + 0.5) * TILE_WIDTH);
walkPos.sx = walkPos.ex;
walkPos.sy = walkPos.ey;
rPos.x = walkPos.ex;
rPos.y = walkPos.ey;
x = rPos.x;
y = rPos.y;
_local7 = (getDefinitionByName(("BAni" + String(type))) as Class);
con = (addChildAt(new (_local7), getChildIndex(clickMask)) as MovieClip);
con.mouseEnabled = false;
if ((((((pos.x > (gf.CASTLE_X - 3))) && ((pos.x < (gf.CASTLE_X + 13))))) && ((pos.y > (gf.CASTLE_Y + 13))))){
currentWall = "wall_d";
dy = -1;
};
if ((((((pos.x > (gf.CASTLE_X - 3))) && ((pos.x < (gf.CASTLE_X + 13))))) && ((pos.y < (gf.CASTLE_Y - 3))))){
currentWall = "wall_u";
dy = 1;
};
if ((((((pos.y > (gf.CASTLE_Y - 3))) && ((pos.y < (gf.CASTLE_Y + 13))))) && ((pos.x > (gf.CASTLE_X + 13))))){
currentWall = "wall_r";
dx = -1;
};
if ((((((pos.y > (gf.CASTLE_Y - 3))) && ((pos.y < (gf.CASTLE_Y + 13))))) && ((pos.x < (gf.CASTLE_X - 3))))){
currentWall = "wall_l";
dx = 1;
};
if (type == 0){
bugName = "Horned";
des = "It is armed with weighty claws, it can tear a person to pieces in one movement.";
experience = 6;
damage = 20;
MAX_HEALTH = (200 + (game.currentLevel * 10));
stand_first = 1;
atack_first = 14;
atack_last = 19;
run_first = 2;
run_last = 13;
} else {
if (type == 1){
bugName = "Locust ";
des = "A small flying bug, attacks with flying bombs.";
fly = true;
experience = 2;
_local6 = 0;
if (Math.random() > 0.5){
_local6 = -1;
} else {
_local6 = 1;
};
flyDir = -(_local6);
ccx = (((gf.CASTLE_X + 4) * 30) + ((_local6 * Math.random()) * 100));
ccy = (((gf.CASTLE_Y + 4) * 30) + ((_local6 * Math.random()) * 100));
_local4 = 0;
_local5 = 2;
flySpeed = {x:(ccx - x), y:(ccy - y)};
_local4 = Math.sqrt(((flySpeed.x * flySpeed.x) + (flySpeed.y * flySpeed.y)));
flySpeed = {x:((_local5 * flySpeed.x) / _local4), y:((_local5 * flySpeed.y) / _local4)};
con.gotoAndPlay("WALK");
damage = 5;
ATACK_TIME = 42;
MAX_HEALTH = (40 + (game.currentLevel * 3));
stand_first = 1;
atack_first = 5;
atack_last = 7;
run_first = 2;
run_last = 4;
} else {
if (type == 2){
bugName = "The giant";
des = "A huge size bug. Covered with a thick reservation also armed with huge horns.";
experience = 50;
damage = 150;
MAX_HEALTH = (1500 + (game.currentLevel * 20));
stand_first = 1;
atack_first = 12;
atack_last = 16;
run_first = 2;
run_last = 11;
} else {
if (type == 3){
bugName = "Small bug";
des = "A small bug. Possibly baby bug, but is mortally dangerous and hungry.";
experience = 1;
damage = 10;
MAX_HEALTH = (20 + (game.currentLevel * 4));
stand_first = 1;
atack_first = 8;
atack_last = 11;
run_first = 2;
run_last = 7;
} else {
if (type == 4){
bugName = "Kamikaze";
des = "A viable bug, blows up causing a huge damage.";
experience = 10;
damage = 100;
MAX_HEALTH = (50 + (game.currentLevel * 5));
stand_first = 1;
atack_first = 8;
atack_last = 11;
run_first = 2;
run_last = 7;
} else {
if (type == 5){
bugName = "Bomber";
des = "A huge flying bug, has a thick reservation, bombards a fortifying of the enemy.";
experience = 20;
damage = 3;
MAX_HEALTH = (1000 + (game.currentLevel * 10));
stand_first = 1;
atack_first = 8;
atack_last = 11;
run_first = 2;
run_last = 7;
fly = true;
deadRadius = (150 + Math.floor((Math.random() * 150)));
if (Math.random() > 0.5){
flyDir = -1;
} else {
flyDir = 1;
};
ccx = (((gf.CASTLE_X + 4) * 30) + ((_local6 * Math.random()) * 150));
ccy = (((gf.CASTLE_Y + 4) * 30) + ((_local6 * Math.random()) * 150));
_local4 = 0;
_local5 = 2;
flySpeed = {x:(ccx - x), y:(ccy - y)};
_local4 = Math.sqrt(((flySpeed.x * flySpeed.x) + (flySpeed.y * flySpeed.y)));
flySpeed = {x:((_local5 * flySpeed.x) / _local4), y:((_local5 * flySpeed.y) / _local4)};
con.rotation = getRotationAngle(y, ccy, x, ccx);
ccx = ((gf.CASTLE_X + 6.5) * gf.CELL_WIDTH);
ccy = ((gf.CASTLE_Y + 6.5) * gf.CELL_WIDTH);
con.gotoAndPlay("WALK");
damage = 10;
ATACK_TIME = 21;
stand_first = 1;
atack_first = 5;
atack_last = 7;
run_first = 2;
run_last = 4;
} else {
if (type == 6){
bugName = "Bombardier";
des = "Attacks enemies by means of biobombs growing on its body.";
experience = 20;
ATACK_TIME = 10;
damage = 10;
MAX_HEALTH = (1500 + (game.currentLevel * 10));
stand_first = 1;
atack_first = 8;
atack_last = 11;
run_first = 2;
run_last = 7;
} else {
if (type == 7){
bugName = "Carrier";
des = "A bug with a thick skin, transports a heap of bugs in a belly.";
experience = 20;
ATACK_TIME = 16;
damage = 0;
MAX_HEALTH = (1700 + (game.currentLevel * 30));
stand_first = 1;
atack_first = 8;
atack_last = 11;
run_first = 2;
run_last = 7;
};
};
};
};
};
};
};
};
if (isMeleeBug()){
getTarget();
addEventListener(Event.ENTER_FRAME, meleeBug, false, 0, true);
} else {
addEventListener(Event.ENTER_FRAME, ai, false, 0, true);
};
health = MAX_HEALTH;
atackCounter = ATACK_TIME;
clickMask.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
clickMask.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
clickMask.addEventListener(MouseEvent.MOUSE_MOVE, onMove, false, 0, true);
}
public function showArrow():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = 100;
_local2 = (x + gf.x);
_local3 = (y + gf.y);
_local4 = (game.SWF_WIDTH / 2);
_local5 = (game.SWF_HEIGHT / 2);
_local6 = 0;
_local7 = 0;
arrow.visible = false;
if ((((((((((x + gf.x) + (_local1 / 2)) < 0)) || ((((x + gf.x) - (_local1 / 2)) > game.SWF_WIDTH)))) || ((((y + gf.y) + (_local1 / 2)) < 0)))) || ((((y + gf.y) - (_local1 / 2)) > game.SWF_HEIGHT)))){
_local6 = 0;
_local7 = (_local5 - (((_local4 - _local6) * (_local5 - _local3)) / (_local4 - _local2)));
if ((((((_local7 > 0)) && ((_local7 < game.SWF_HEIGHT)))) && (((_local4 - _local2) > 0)))){
arrow.visible = true;
arrow.x = _local6;
arrow.y = _local7;
arrow.rotation = getRotationAngle(_local5, _local3, _local4, _local2);
return;
};
_local6 = game.SWF_WIDTH;
_local7 = (_local5 - (((_local6 - _local4) * (_local5 - _local3)) / (_local2 - _local4)));
if ((((((_local7 > 0)) && ((_local7 < game.SWF_HEIGHT)))) && (((_local4 - _local2) < 0)))){
arrow.visible = true;
arrow.x = _local6;
arrow.y = _local7;
arrow.rotation = getRotationAngle(_local5, _local3, _local4, _local2);
return;
};
_local7 = 0;
_local6 = (_local4 - (((_local5 - _local7) * (_local4 - _local2)) / (_local5 - _local3)));
if ((((((_local6 > 0)) && ((_local6 < game.SWF_WIDTH)))) && (((_local5 - _local3) > 0)))){
arrow.visible = true;
arrow.x = _local6;
arrow.y = _local7;
arrow.rotation = getRotationAngle(_local5, _local3, _local4, _local2);
return;
};
_local7 = game.SWF_HEIGHT;
_local6 = (_local4 - (((_local7 - _local5) / (_local3 - _local5)) * (_local4 - _local2)));
if ((((((_local6 > 0)) && ((_local6 < game.SWF_WIDTH)))) && (((_local5 - _local3) < 0)))){
arrow.visible = true;
arrow.x = _local6;
arrow.y = _local7;
arrow.rotation = getRotationAngle(_local5, _local3, _local4, _local2);
return;
};
};
}
public function onOver(_arg1:MouseEvent):void{
if (game.pause){
return;
};
hideHealthCounter = 1;
healthBar.visible = true;
}
public function searchSolders():Solder{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
_local1 = -1;
_local2 = -1;
if (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)].length > 0){
return (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)][0]);
};
_local1 = -1;
_local2 = 0;
if (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)].length > 0){
return (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)][0]);
};
_local1 = -1;
_local2 = 1;
if (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)].length > 0){
return (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)][0]);
};
_local1 = 0;
_local2 = 1;
if (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)].length > 0){
return (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)][0]);
};
_local1 = 1;
_local2 = 1;
if (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)].length > 0){
return (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)][0]);
};
_local1 = 1;
_local2 = 0;
if (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)].length > 0){
return (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)][0]);
};
_local1 = 1;
_local2 = -1;
if (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)].length > 0){
return (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)][0]);
};
_local1 = 0;
_local2 = -1;
if (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)].length > 0){
return (gf.unitsDump[(pos.x + _local1)][(pos.y + _local2)][0]);
};
return (null);
}
public function isMeleeBug():Boolean{
var _local1:Array;
var _local2:int;
_local1 = [0, 2, 3];
_local2 = 0;
_local2 = 0;
while (_local2 < _local1.length) {
if (type == _local1[_local2]){
return (true);
};
_local2++;
};
return (false);
}
public function exploted():void{
var _local1:MovieClip;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:Object;
var _local14:Array;
game.soundController.playSound("bioBomb");
_local1 = (gf.bloodLayer.addChild(new BugExplosion1()) as MovieClip);
_local1.x = x;
_local1.y = y;
_local1.rotation = (Math.random() * 360);
_local1.cacheAsBitmap = true;
createBrains();
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = 1;
_local10 = _local9;
_local11 = Math.floor((x / 30));
_local12 = Math.floor((y / 30));
_local2 = (_local11 - _local9);
_local3 = (_local11 + _local9);
_local4 = (_local12 - _local10);
_local5 = (_local12 + _local10);
_local13 = {};
_local13.wall_l = {name:"wall_l", d:0};
_local13.wall_r = {name:"wall_r", d:0};
_local13.wall_u = {name:"wall_u", d:0};
_local13.wall_d = {name:"wall_d", d:0};
_local13.tower_l_u = {name:"tower_l_u", d:0};
_local13.tower_l_d = {name:"tower_l_d", d:0};
_local13.tower_r_u = {name:"tower_r_u", d:0};
_local13.tower_r_d = {name:"tower_r_d", d:0};
_local14 = new Array();
_local6 = _local2;
while (_local6 < (_local3 + 1)) {
_local7 = _local4;
while (_local7 < (_local5 + 1)) {
if (gf.quick[((String(_local6) + "_") + String(_local7))] != undefined){
if (_local13[gf.quick[((String(_local6) + "_") + String(_local7))]].d == 0){
gf.damageCastle(gf.quick[((String(_local6) + "_") + String(_local7))], damage);
_local13[gf.quick[((String(_local6) + "_") + String(_local7))]].d = 1;
};
};
_local7++;
};
_local6++;
};
_local6 = 0;
while (_local6 < _local14.length) {
if (_local14[_local6].parent == null){
} else {
if (_local14[_local6].damaged(damage)){
};
};
_local6++;
};
_local14 = null;
}
public function getL(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((Math.pow((_arg2 - _arg1), 2) + Math.pow((_arg4 - _arg3), 2)));
}
public function move():void{
rPos.x = (rPos.x + speedX);
rPos.y = (rPos.y + speedY);
x = rPos.x;
y = rPos.y;
}
public function isWallPoint(_arg1:int, _arg2:int):Boolean{
if ((((((((_arg1 >= (gf.CASTLE_X - 2))) && ((_arg1 <= (gf.CASTLE_X + 12))))) && ((_arg2 >= (gf.CASTLE_Y - 2))))) && ((_arg2 <= (gf.CASTLE_Y + 12))))){
return (true);
};
return (false);
}
public function destroy(_arg1:Boolean=false):void{
var _local2:int;
var _local3:InfoMenu;
_local2 = 0;
if (isMeleeBug()){
removeEventListener(Event.ENTER_FRAME, meleeBug);
} else {
removeEventListener(Event.ENTER_FRAME, ai);
};
clickMask.removeEventListener(MouseEvent.CLICK, onClick);
clickMask.removeEventListener(MouseEvent.MOUSE_OVER, onOver);
clickMask.removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
game.removeChild(arrow);
removeChild(con);
removeChild(healthBar);
removeChild(clickMask);
con = null;
healthBar = null;
clickMask = null;
arrow = null;
currentSolder = null;
wallPos = null;
path = null;
pos = null;
rPos = null;
walkPos = null;
_local2 = 0;
while (_local2 < gf.units.length) {
if (gf.units[_local2].target == this){
gf.units[_local2].target = null;
};
_local2++;
};
_local2 = 0;
while (_local2 < gf.enemies.length) {
if (gf.enemies[_local2] == this){
gf.enemies.splice(_local2, 1);
break;
};
_local2++;
};
if (fly){
_local2 = 0;
while (_local2 < gf.flies.length) {
if (gf.flies[_local2] == this){
gf.flies.splice(_local2, 1);
break;
};
_local2++;
};
};
if (!_arg1){
gf.checkGameResult();
};
_local3 = (game.getChildByName("im") as InfoMenu);
if (parent != null){
if ((((gf.currentUnit == this)) && (!((_local3 == null))))){
_local3.changeVisible(null);
};
while (numChildren) {
removeChildAt(0);
};
parent.removeChild(this);
};
gf = null;
game = null;
}
}
}//package com.elf7.units
Section 13
//Bullet (com.elf7.units.Bullet)
package com.elf7.units {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import com.elf7.*;
import com.elf7.level.*;
public class Bullet extends MovieClip {
public var speedY:Number;// = 0
public var gun:BigGun;
public var damage:Number;// = 4
public var lifeCounter:Number;// = 0
public var gf:GameField;
public var speedX:Number;// = 0
public var game:Game;
public function Bullet(){
speedX = 0;
damage = 4;
speedY = 0;
lifeCounter = 0;
super();
}
public function destroy():void{
gf = null;
game = null;
removeEventListener(Event.ENTER_FRAME, ai);
if (parent != null){
parent.removeChild(this);
};
}
public function init():void{
gf = (parent.parent as GameField);
game = (gf.parent as Game);
addEventListener(Event.ENTER_FRAME, ai, false, 0, true);
}
public function getRotationAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if ((((_arg2 == _arg1)) && ((_arg4 == _arg3)))){
return (0);
};
if ((_arg2 - _arg1) == 0){
if ((_arg4 - _arg3) > 0){
return (90);
};
if ((_arg4 - _arg3) < 0){
return (-90);
};
};
if ((_arg4 - _arg3) == 0){
if ((_arg2 - _arg1) > 0){
return (180);
};
if ((_arg2 - _arg1) < 0){
return (0);
};
};
if ((_arg2 - _arg1) > 0){
return ((90 + ((Math.acos(((_arg4 - _arg3) / Math.sqrt(getL(_arg1, _arg2, _arg3, _arg4)))) * 180) / Math.PI)));
};
return ((90 - ((Math.acos(((_arg4 - _arg3) / Math.sqrt(getL(_arg1, _arg2, _arg3, _arg4)))) * 180) / Math.PI)));
}
public function onRemove(_arg1:Event):void{
if (_arg1.target != this){
return;
};
destroy();
}
public function ai(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Boolean;
var _local9:Number;
var _local10:Class;
var _local11:MovieClip;
if (game.pause){
return;
};
if (parent == null){
destroy();
return;
};
if (gf == null){
return;
};
x = (x + speedX);
y = (y + speedY);
if (lifeCounter > 60){
destroy();
return;
};
lifeCounter++;
if (gf == null){
return;
};
_local2 = Math.floor(((x - 15) / gf.CELL_WIDTH));
_local3 = Math.floor(((x + 15) / gf.CELL_WIDTH));
_local4 = Math.floor(((y - 15) / gf.CELL_WIDTH));
_local5 = Math.floor(((y + 15) / gf.CELL_WIDTH));
if (_local2 < 0){
destroy();
return;
};
if (_local3 > (gf.map.length - 1)){
destroy();
return;
};
if (_local4 < 0){
destroy();
return;
};
if (_local5 > (gf.map[0].length - 1)){
destroy();
return;
};
_local6 = 0;
_local7 = 0;
_local8 = false;
_local6 = _local2;
while (_local6 < (_local3 + 1)) {
_local7 = _local4;
while (_local7 < (_local5 + 1)) {
if (gf.dump[_local6][_local7].length > 0){
if (gf.dump[_local6][_local7][0].parent == null){
return;
};
_local9 = gf.dump[_local6][_local7][0].experience;
if (gf.dump[_local6][_local7][0].damaged(damage)){
gun.addExp(_local9);
gun.killed++;
};
_local8 = true;
break;
};
_local7++;
};
if (_local8){
break;
};
_local6++;
};
if (_local8){
if (Math.random() > 0.4){
destroy();
return;
};
_local10 = (getDefinitionByName(("GreenBlood" + String(Math.floor((Math.random() * 2.99))))) as Class);
_local11 = (gf.bloodLayer.addChild(new (_local10)) as MovieClip);
_local11.x = x;
_local11.y = y;
_local11.rotation = (Math.random() * 360);
_local11.mouseEnabled = false;
_local11.cacheAsBitmap = true;
destroy();
};
}
public function getL(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((Math.pow((_arg2 - _arg1), 2) + Math.pow((_arg4 - _arg3), 2)));
}
}
}//package com.elf7.units
Section 14
//FlyBomb (com.elf7.units.FlyBomb)
package com.elf7.units {
import flash.events.*;
import flash.display.*;
import com.elf7.*;
import com.elf7.level.*;
public class FlyBomb extends MovieClip {
public var expDamage:Number;// = 20
public var counter:Number;// = 20
public var destinationY:Number;// = 0
public var destinationX:Number;// = 0
public var speedY:Number;
public var speed:Object;
public var solder:Solder;
public var dv:Object;
public var radius:Number;// = 60
public var dir:int;// = 0
public var gf:GameField;
public var speedX:Number;
public var game:Game;
public function FlyBomb(){
dv = {};
speed = {};
dir = 0;
radius = 60;
expDamage = 20;
counter = 20;
destinationX = 0;
destinationY = 0;
super();
addFrameScript(8, frame9, 15, frame16);
}
public function destroy():void{
if (parent != null){
expl();
};
removeEventListener(Event.ENTER_FRAME, fly);
dv = null;
speed = null;
solder = null;
gf = null;
game = null;
gotoAndPlay(10);
}
public function init():void{
var _local1:Object;
var _local2:Number;
var _local3:Number;
gf = (parent.parent as GameField);
game = (gf.parent as Game);
_local1 = {x:0, y:0};
_local2 = 0;
_local3 = 6;
_local1.x = (destinationX - x);
_local1.y = (destinationY - y);
speed = {x:((_local1.y * dir) / _local3), y:((-(_local1.x) * dir) / _local3)};
_local2 = Math.sqrt(((speed.x * speed.x) + (speed.y * speed.y)));
speed = {x:((_local3 * speed.x) / _local2), y:((_local3 * speed.y) / _local2)};
dv = {x:(_local1.x - speed.x), y:(_local1.y - speed.y)};
_local2 = Math.sqrt(((dv.x * dv.x) + (dv.y * dv.y)));
dv = {x:(dv.x / _local2), y:(dv.y / _local2)};
addEventListener(Event.ENTER_FRAME, fly, false, 0, true);
}
public function onRemove(_arg1:Event):void{
if (_arg1.target != this){
return;
};
destroy();
}
function frame16(){
stop();
if (parent != null){
parent.removeChild(this);
};
}
function frame9(){
gotoAndPlay(1);
}
public function fly(_arg1:Event):void{
var _local2:Number;
var _local3:Object;
var _local4:Number;
var _local5:MovieClip;
_local2 = 6;
if (parent == null){
destroy();
return;
};
if (game.pause){
return;
};
if (counter > 100){
destroy();
return;
};
counter++;
if ((((Math.abs((destinationX - x)) < _local2)) && ((Math.abs((destinationY - y)) < _local2)))){
destroy();
return;
};
_local5 = (gf.addChild(new Smoke()) as MovieClip);
_local5.x = x;
_local5.y = y;
_local5.mouseEnabled = false;
_local3 = {x:0, y:0};
_local4 = 0;
_local3.x = (destinationX - x);
_local3.y = (destinationY - y);
_local4 = Math.sqrt(((speed.x * speed.x) + (speed.y * speed.y)));
speed = {x:((_local2 * speed.x) / _local4), y:((_local2 * speed.y) / _local4)};
dv = {x:(_local3.x - speed.x), y:(_local3.y - speed.y)};
_local4 = Math.sqrt(((dv.x * dv.x) + (dv.y * dv.y)));
dv = {x:(dv.x / _local4), y:(dv.y / _local4)};
x = (x + speed.x);
y = (y + speed.y);
speed.x = (speed.x + dv.x);
speed.y = (speed.y + dv.y);
}
public function expl():void{
var _local1:int;
var _local2:int;
game.soundController.playSound("bioBomb");
_local1 = Math.floor((x / gf.CELL_WIDTH));
_local2 = Math.floor((y / gf.CELL_WIDTH));
if (gf.unitsDump[_local1][_local2].length > 0){
if (gf.unitsDump[_local1][_local2][0].parent == null){
return;
};
gf.unitsDump[_local1][_local2][0].damaged(expDamage);
} else {
if (gf.quick[((String(_local1) + "_") + String(_local2))] != undefined){
gf.damageCastle(gf.quick[((String(_local1) + "_") + String(_local2))], (expDamage * 4));
};
};
}
}
}//package com.elf7.units
Section 15
//Shell (com.elf7.units.Shell)
package com.elf7.units {
import flash.events.*;
import flash.display.*;
import com.elf7.*;
import com.elf7.level.*;
public class Shell extends MovieClip {
public var expDamage:Number;// = 100
public var destinationY:Number;// = 0
public var destinationX:Number;// = 0
public var speedY:Number;
public var speed:Number;// = 20
public var solder:Solder;
public var radius:Number;// = 70
public var gf:GameField;
public var speedX:Number;
public var game:Game;
public function Shell(){
radius = 70;
expDamage = 100;
speed = 20;
destinationX = 0;
destinationY = 0;
super();
}
public function destroy():void{
var _local1:MovieClip;
removeEventListener(Event.ENTER_FRAME, fly);
if (parent != null){
_local1 = (parent.addChild(new Explosion()) as MovieClip);
_local1.x = destinationX;
_local1.y = destinationY;
_local1.mouseEnabled = false;
expl();
parent.removeChild(this);
};
solder = null;
}
public function init():void{
var _local1:Number;
gf = (parent as GameField);
game = (gf.parent as Game);
_local1 = Math.sqrt((Math.pow((x - destinationX), 2) + Math.pow((y - destinationY), 2)));
speedX = ((speed * (destinationX - x)) / _local1);
speedY = ((speed * (destinationY - y)) / _local1);
addEventListener(Event.ENTER_FRAME, fly, false, 0, true);
}
public function onRemove(_arg1:Event):void{
if (_arg1.target != this){
return;
};
destroy();
}
public function fly(_arg1:Event):void{
if (parent == null){
destroy();
return;
};
if ((((Math.abs((x - destinationX)) < speed)) && ((Math.abs((y - destinationY)) < speed)))){
destroy();
} else {
x = (x + speedX);
y = (y + speedY);
};
}
public function expl():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:Array;
var _local13:Number;
game.soundController.playSound("exp");
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = Math.floor((radius / 30));
_local9 = _local8;
_local10 = Math.floor((x / 30));
_local11 = Math.floor((y / 30));
_local1 = (_local10 - _local8);
_local2 = (_local10 + _local8);
_local3 = (_local11 - _local9);
_local4 = (_local11 + _local9);
_local12 = new Array();
_local5 = _local1;
while (_local5 < (_local2 + 1)) {
_local6 = _local3;
while (_local6 < (_local4 + 1)) {
_local7 = 0;
while (_local7 < gf.dump[_local5][_local6].length) {
if (!gf.dump[_local5][_local6][_local7].fly){
_local12.push(gf.dump[_local5][_local6][_local7]);
};
_local7++;
};
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < _local12.length) {
if (_local12[_local5].parent == null){
} else {
_local13 = _local12[_local5].experience;
if (_local12[_local5].damaged(expDamage)){
solder.killed++;
solder.addExp(_local13);
};
};
_local5++;
};
_local12 = null;
}
}
}//package com.elf7.units
Section 16
//Solder (com.elf7.units.Solder)
package com.elf7.units {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import com.elf7.*;
import com.elf7.menu.*;
import com.elf7.level.*;
import com.elf7.spec.*;
public dynamic class Solder extends MovieClip {
public const ACTION_ATACK:String = "ATACK";
public const ACTION_REST:String = "REST";
public const ACTION_MOVE:String = "MOVE";
public const TILE_WIDTH:Number = 30;
public const RANKS:Array;
public const EXP:Array;
public var des:String;// = ""
public var healthBar:MovieClip;
public var path:Array;
public var selectedMask:MovieClip;
public var refreshInfo:Boolean;// = false
public var wallPos:Object;
public var rank:int;// = 0
public var action:String;// = "REST"
public var star:MovieClip;
public var health:Number;// = 0
public var sm:MovieClip;
public var pos:Object;
public var runSpeed:Number;// = 2.5
public var killed:int;// = 0
public var rPos:Object;
public var clickMask:MovieClip;
public var waitCounter:int;// = 0
public var maxWaitCounter:int;
public var gf:GameField;
public var currentWall:String;// = "none"
public var speedX:Number;// = 0
public var speedY:Number;// = 0
public var maxRadius:Number;// = 0
public var type:int;// = 0
public var click_mask:MovieClip;
public var atackTime:int;// = 0
public var experience:Number;// = 0
public var damage:Number;// = 0
public var con:MovieClip;
public var minRadius:Number;// = 0
public var restoreCounter:int;// = 0
public var target:Bug;
public var atackCounter:int;// = 0
public var health_bar:MovieClip;
public var MAX_HEALTH:Number;// = 0
public var walkPos:Object;
public var hideHealthCounter:int;// = 0
public var game:Game;
public var rangeMovie:MovieClip;
public function Solder(){
RANKS = ["Rookie", "Fighter", "Veteran"];
EXP = [0, 1000, 5000];
MAX_HEALTH = 0;
health = 0;
restoreCounter = 0;
minRadius = 0;
maxRadius = 0;
damage = 0;
type = 0;
rank = 0;
killed = 0;
experience = 0;
des = "";
currentWall = "none";
wallPos = {x:0, y:0};
atackTime = 0;
atackCounter = 0;
maxWaitCounter = Math.round((60 + (Math.random() * 60)));
waitCounter = 0;
hideHealthCounter = 0;
path = new Array();
pos = {x:0, y:0};
rPos = {x:0, y:0};
walkPos = {sx:0, sy:0, ex:0, ey:0};
action = ACTION_REST;
runSpeed = 2.5;
speedX = 0;
speedY = 0;
refreshInfo = false;
super();
}
public function getNewWalkPos():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = ((pos.x + 0.5) * TILE_WIDTH);
_local2 = ((pos.y + 0.5) * TILE_WIDTH);
_local3 = ((Math.random() > 0.5)) ? -1 : 1;
_local4 = ((Math.random() > 0.5)) ? -1 : 1;
_local5 = 5;
walkPos.ex = (_local1 + Math.round(((Math.random() * _local5) * _local3)));
walkPos.ey = (_local2 + Math.round(((Math.random() * _local5) * _local4)));
}
public function ai(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
if (game.pause){
return;
};
if (parent == null){
return;
};
if (healthBar.currentFrame != (101 - Math.floor(((health / MAX_HEALTH) * 100)))){
healthBar.gotoAndStop((101 - Math.floor(((health / MAX_HEALTH) * 100))));
};
if (restoreCounter < 22){
restoreCounter++;
};
if ((((restoreCounter > 21)) && ((health < MAX_HEALTH)))){
restoreCounter = 0;
health++;
refresh();
};
if ((((atackCounter < atackTime)) && (!((type == 2))))){
atackCounter++;
};
if (target != null){
if (atackCounter > 6){
con.rotation = getRotationAngle(y, target.y, x, target.x);
};
if (atackCounter >= atackTime){
_local2 = getL(target.x, x, target.y, y);
if ((((_local2 > (maxRadius * maxRadius))) || ((_local2 < (minRadius * minRadius))))){
target = null;
action = ACTION_REST;
} else {
action = ACTION_ATACK;
atackCounter = 0;
con.rotation = getRotationAngle(y, target.y, x, target.x);
if (type == 0){
showTracer();
_local3 = target.experience;
if (target.damaged(damage)){
killed++;
addExp(_local3);
};
} else {
if (type == 1){
createShell();
};
};
};
};
} else {
if ((((action == ACTION_ATACK)) && (!((type == 2))))){
action = ACTION_REST;
};
};
if (hideHealthCounter > 0){
hideHealthCounter++;
if (hideHealthCounter > 20){
hideHealthCounter = 0;
healthBar.visible = false;
};
};
if (action == ACTION_ATACK){
if ((((con.currentFrame < 16)) && ((atackCounter == 0)))){
con.gotoAndPlay("ATACK");
};
};
if (action == ACTION_MOVE){
if (target != null){
(target == null);
};
if ((((con.currentFrame < 2)) || ((con.currentFrame > 15)))){
con.gotoAndPlay(2);
};
moveByPath();
};
if ((((type == 2)) && ((action == ACTION_ATACK)))){
if (con.currentFrame < 16){
con.gotoAndPlay("ATACK");
};
atackCounter++;
if (atackCounter > 10){
action = ACTION_REST;
};
};
if (action == ACTION_REST){
if (type == 2){
if (atackCounter < atackTime){
if (atackCounter > 10){
if (con.currentFrame != 1){
con.gotoAndStop("STAND");
};
wait();
};
atackCounter++;
} else {
if (repairCastle()){
action = ACTION_ATACK;
atackCounter = 0;
} else {
if (con.currentFrame != 1){
con.gotoAndStop("STAND");
};
wait();
};
};
return;
};
if (target == null){
if (con.currentFrame != 1){
con.gotoAndStop("STAND");
};
wait();
};
};
}
public function getRotationAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if ((((_arg2 == _arg1)) && ((_arg4 == _arg3)))){
return (0);
};
if ((_arg2 - _arg1) == 0){
if ((_arg4 - _arg3) > 0){
return (90);
};
if ((_arg4 - _arg3) < 0){
return (-90);
};
};
if ((_arg4 - _arg3) == 0){
if ((_arg2 - _arg1) > 0){
return (180);
};
if ((_arg2 - _arg1) < 0){
return (0);
};
};
if ((_arg2 - _arg1) > 0){
return ((90 + ((Math.acos(((_arg4 - _arg3) / Math.sqrt(getL(_arg1, _arg2, _arg3, _arg4)))) * 180) / Math.PI)));
};
return ((90 - ((Math.acos(((_arg4 - _arg3) / Math.sqrt(getL(_arg1, _arg2, _arg3, _arg4)))) * 180) / Math.PI)));
}
public function onMove(_arg1:MouseEvent):void{
if (game.pause){
return;
};
hideHealthCounter = 1;
healthBar.visible = true;
}
public function rotateByPath():void{
walkPos.ex = ((pos.x + 0.5) * TILE_WIDTH);
walkPos.ey = ((pos.y + 0.5) * TILE_WIDTH);
walkPos.sx = rPos.x;
walkPos.sy = rPos.y;
con.rotation = getRotationAngle(walkPos.sy, walkPos.ey, walkPos.sx, walkPos.ex);
speedX = (((walkPos.ex - walkPos.sx) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * runSpeed);
speedY = (((walkPos.ey - walkPos.sy) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * runSpeed);
}
public function moveByPath():void{
if ((((Math.abs((gf.real[path[0].x][path[0].y].x - rPos.x)) < 2)) && ((Math.abs((gf.real[path[0].x][path[0].y].y - rPos.y)) < runSpeed)))){
x = gf.real[path[0].x][path[0].y].x;
y = gf.real[path[0].x][path[0].y].y;
rPos.x = x;
rPos.y = y;
walkPos.sx = gf.real[path[0].x][path[0].y].x;
walkPos.sy = gf.real[path[0].x][path[0].y].y;
if (path.length == 1){
walkPos.ex = walkPos.sx;
walkPos.ey = walkPos.sy;
action = ACTION_REST;
return;
};
walkPos.ex = gf.real[path[1].x][path[1].y].x;
walkPos.ey = gf.real[path[1].x][path[1].y].y;
path.splice(0, 1);
pos.x = path[0].x;
pos.y = path[0].y;
con.rotation = getRotationAngle(walkPos.sy, walkPos.ey, walkPos.sx, walkPos.ex);
speedX = (((walkPos.ex - walkPos.sx) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * runSpeed);
speedY = (((walkPos.ey - walkPos.sy) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey))) * runSpeed);
} else {
move();
};
}
public function createShell():void{
var _local1:Shell;
var _local2:Number;
var _local3:Number;
_local1 = (gf.addChild(new Shell()) as Shell);
_local2 = 31;
_local3 = 10;
_local1.x = ((x + (_local2 * Math.sin(((con.rotation * Math.PI) / 180)))) + (Math.cos(((con.rotation * Math.PI) / 180)) * _local3));
_local1.y = ((y - (_local2 * Math.cos(((con.rotation * Math.PI) / 180)))) + (_local3 * Math.sin(((con.rotation * Math.PI) / 180))));
_local1.destinationX = target.x;
_local1.destinationY = target.y;
_local1.rotation = getRotationAngle(_local1.y, _local1.destinationY, _local1.x, _local1.destinationX);
_local1.solder = this;
_local1.mouseEnabled = false;
_local1.expDamage = damage;
_local1.init();
game.soundController.playSound("bazooka");
}
public function random():Number{
var _local1:Number;
_local1 = 1;
if (Math.random() > 0.5){
_local1 = -1;
};
return ((Math.random() * _local1));
}
public function damaged(_arg1:Number):Boolean{
if (parent == null){
return (false);
};
if ((health - _arg1) < 0){
game.soundController.playSound("solderDie");
game.levelStatistic.slost++;
game.deadHallOfFame.push({name:name, killed:killed, level:rank, type:type});
destroy();
return (true);
};
hideHealthCounter = 1;
healthBar.visible = true;
health = (health - _arg1);
return (false);
}
public function refresh():void{
var _local1:InfoMenu;
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:TextField;
var _local5:TextField;
var _local6:TextField;
var _local7:TextField;
var _local8:TextField;
var _local9:TextField;
var _local10:TextField;
var _local11:TextField;
var _local12:MovieClip;
var _local13:TextField;
var _local14:MovieClip;
if (gf.currentUnit != this){
return;
};
_local1 = (game.getChildByName("im") as InfoMenu);
_local2 = (_local1.getChildByName("unit_screen") as MovieClip);
_local3 = (_local2.getChildByName("i") as MovieClip);
_local4 = (_local2.getChildByName("n_t") as TextField);
_local5 = (_local2.getChildByName("h_t") as TextField);
_local6 = (_local2.getChildByName("name_t") as TextField);
_local7 = (_local2.getChildByName("rank_t") as TextField);
_local8 = (_local2.getChildByName("d_t") as TextField);
_local9 = (_local2.getChildByName("damage_t") as TextField);
_local10 = (_local2.getChildByName("killed_t") as TextField);
_local11 = (_local2.getChildByName("des_t") as TextField);
_local12 = (_local2.getChildByName("bar") as MovieClip);
_local13 = (_local2.getChildByName("health_t") as TextField);
_local3.gotoAndStop((type + 1));
_local14 = (_local3.getChildByName("s") as MovieClip);
_local14.gotoAndStop((rank + 1));
_local13.text = ((String(health) + "/") + String(MAX_HEALTH));
_local4.text = "name: ";
_local5.text = "health: ";
_local5.visible = true;
_local13.visible = true;
_local6.text = name;
_local7.text = String((rank + 1));
_local10.text = String(killed);
_local9.text = String(damage);
_local11.text = des;
if (type == 2){
_local8.text = "repaired:";
} else {
_local8.text = "damage:";
};
if (rank == (gf.solderRank.length - 1)){
_local12.gotoAndStop(101);
} else {
_local12.gotoAndStop(Math.floor(((experience / gf.solderRank[(rank + 1)]) * 100)));
};
}
public function repairCastle():Boolean{
var _local1:Array;
var _local2:Number;
var _local3:int;
var _local4:String;
_local1 = new Array();
_local2 = damage;
_local3 = 0;
_local1.push({wall:currentWall, p:(gf[currentWall].health / gf.WALL_MAX_HEALTH)});
if (currentWall == "wall_u"){
_local1.push({wall:"tower_l_u", p:0});
_local1.push({wall:"tower_r_u", p:0});
} else {
if (currentWall == "wall_d"){
_local1.push({wall:"tower_l_d", p:0});
_local1.push({wall:"tower_r_d", p:0});
} else {
if (currentWall == "wall_r"){
_local1.push({wall:"tower_r_u", p:0});
_local1.push({wall:"tower_r_d", p:0});
} else {
if (currentWall == "wall_l"){
_local1.push({wall:"tower_l_u", p:0});
_local1.push({wall:"tower_l_d", p:0});
};
};
};
};
_local3 = 1;
while (_local3 < _local1.length) {
if (gf[_local1[_local3].wall].health <= 0){
_local1.splice(_local3, 1);
_local3--;
} else {
_local1[_local3].p = (gf[_local1[_local3].wall].health / gf.TOWER_MAX_HEALTH);
};
_local3++;
};
_local1.sortOn("p", Array.NUMERIC);
_local4 = ((_local1[0].wall.indexOf("wall") > -1)) ? "WALL_MAX_HEALTH" : "TOWER_MAX_HEALTH";
if (gf[_local1[0].wall].health == gf[_local4]){
return (false);
};
if ((gf[_local1[0].wall].health + _local2) > gf[_local4]){
_local2 = (gf[_local4] - gf[_local1[0].wall].health);
};
gf.damageCastle(_local1[0].wall, -(_local2));
if (Math.random() > 0.6){
addExp(1);
};
game.soundController.playSound("flash");
return (true);
}
public function onClick(_arg1:MouseEvent):void{
var _local2:InfoMenu;
var _local3:MovieClip;
var _local4:MovieClip;
if (game.pause){
return;
};
if (gf.selected.length > 0){
while (gf.selected.length) {
gf.selected[0].selectedMask.visible = false;
gf.selected.splice(0, 1);
};
};
gf.selected.push(this);
selectedMask.visible = true;
gf.currentGun = null;
gf.currentUnit = this;
refresh();
_local2 = (game.getChildByName("im") as InfoMenu);
_local3 = (_local2.getChildByName("unit_screen") as MovieClip);
_local4 = (_local2.getChildByName("bug_screen") as MovieClip);
if (!_local2.visible){
_local2.visible = true;
};
_local3.visible = true;
_local4.visible = false;
gf.currentUnit = this;
}
public function init(_arg1:int, _arg2:int):void{
var _local3:Class;
var _local4:Number;
pos.x = _arg1;
pos.y = _arg2;
gf = (parent.parent as GameField);
game = (gf.parent as Game);
selectedMask = (getChildByName("sm") as MovieClip);
selectedMask.visible = false;
healthBar = (getChildByName("health_bar") as MovieClip);
clickMask = (getChildByName("click_mask") as MovieClip);
healthBar.visible = false;
healthBar.mouseEnabled = false;
if (type == 0){
des = "Gunner is armed with an automatic rifle. A fine fighter in a face-to-face combat.";
atackTime = 21;
atackCounter = atackTime;
minRadius = 0;
maxRadius = 300;
MAX_HEALTH = 100;
} else {
if (type == 1){
des = "He is armed with a grenade launcher. Can attack enemies only on a remote distance. Recharges for a long time.";
atackTime = 150;
atackCounter = atackTime;
minRadius = 200;
maxRadius = 500;
MAX_HEALTH = 100;
} else {
if (type == 2){
des = "Repairs the damaged fortifications. Can’t restore the destroyed fortifications.";
atackTime = 80;
atackCounter = atackTime;
MAX_HEALTH = 100;
};
};
};
damage = gf[("sol" + String(type))][rank].damage;
MAX_HEALTH = gf[("sol" + String(type))][rank].health;
health = MAX_HEALTH;
path.push({x:pos.x, y:pos.y});
walkPos.ex = ((_arg1 + 0.5) * TILE_WIDTH);
walkPos.ey = ((_arg2 + 0.5) * TILE_WIDTH);
getNewWalkPos();
walkPos.sx = walkPos.ex;
walkPos.sy = walkPos.ey;
rPos.x = walkPos.ex;
rPos.y = walkPos.ey;
x = rPos.x;
y = rPos.y;
clickMask.buttonMode = true;
_local3 = (getDefinitionByName(("Ani" + String(type))) as Class);
con = (addChildAt(new (_local3), getChildIndex(clickMask)) as MovieClip);
con.mouseEnabled = false;
star = (addChild(new Star()) as MovieClip);
star.mouseEnabled = false;
_local4 = ((Math.random() > 0.5)) ? -1 : 1;
con.rotation = ((_local4 * Math.random()) * 180);
addEventListener(Event.ENTER_FRAME, ai, false, 0, true);
clickMask.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
clickMask.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
clickMask.addEventListener(MouseEvent.MOUSE_MOVE, onMove, false, 0, true);
}
public function showTracer():void{
var _local1:Number;
var _local2:Number;
var _local3:Tracer;
_local1 = 28;
_local2 = 8;
_local3 = (addChildAt(new Tracer(), getChildIndex(con)) as Tracer);
_local3.x = ((_local1 * Math.sin(((con.rotation * Math.PI) / 180))) + (Math.cos(((con.rotation * Math.PI) / 180)) * _local2));
_local3.y = ((-(_local1) * Math.cos(((con.rotation * Math.PI) / 180))) + (_local2 * Math.sin(((con.rotation * Math.PI) / 180))));
_local3.targetX = ((target.x - x) - _local3.x);
_local3.targetY = ((target.y - y) - _local3.y);
_local3.mouseEnabled = false;
_local3.init();
game.soundController.playSound("aut");
}
public function onOver(_arg1:MouseEvent):void{
if (game.pause){
return;
};
hideHealthCounter = 1;
healthBar.visible = true;
}
public function wait():void{
if (waitCounter > maxWaitCounter){
waitCounter = 0;
getNewWalkPos();
con.rotation = getRotationAngle(walkPos.sy, walkPos.ey, walkPos.sx, walkPos.ex);
speedX = ((walkPos.ex - walkPos.sx) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey)));
speedY = ((walkPos.ey - walkPos.sy) / Math.sqrt(getL(walkPos.sx, walkPos.ex, walkPos.sy, walkPos.ey)));
} else {
if ((((Math.abs((walkPos.ex - rPos.x)) >= 1)) && ((Math.abs((walkPos.ey - rPos.y)) >= 1)))){
move();
} else {
if (((!((walkPos.sx == walkPos.ex))) || (!((walkPos.sy == walkPos.ey))))){
walkPos.sx = walkPos.ex;
walkPos.sy = walkPos.ey;
};
};
waitCounter++;
};
}
public function getL(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((Math.pow((_arg2 - _arg1), 2) + Math.pow((_arg4 - _arg3), 2)));
}
public function addExp(_arg1:Number):void{
if (rank >= (gf.solderRank.length - 1)){
return;
};
if ((experience + _arg1) >= gf.solderRank[(rank + 1)]){
game.levelStatistic.srised++;
experience = 0;
rank++;
star.play();
damage = gf[("sol" + String(type))][rank].damage;
MAX_HEALTH = gf[("sol" + String(type))][rank].health;
health = MAX_HEALTH;
} else {
experience = (experience + _arg1);
};
refresh();
}
public function move():void{
rPos.x = (rPos.x + speedX);
rPos.y = (rPos.y + speedY);
x = rPos.x;
y = rPos.y;
}
public function destroy(_arg1:Boolean=false):void{
var _local2:Number;
var _local3:InfoMenu;
var _local4:MovieClip;
var _local5:Number;
var _local6:Number;
var _local7:MovieClip;
var _local8:Class;
_local2 = 0;
removeEventListener(Event.ENTER_FRAME, ai);
clickMask.removeEventListener(MouseEvent.CLICK, onClick);
clickMask.removeEventListener(MouseEvent.MOUSE_OVER, onOver);
clickMask.removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
_local2 = 0;
while (_local2 < gf.units.length) {
if (gf.units[_local2] == this){
gf.units.splice(_local2, 1);
};
_local2++;
};
_local3 = (game.getChildByName("im") as InfoMenu);
_local2 = 0;
while (_local2 < gf[currentWall].solders[((String(wallPos.x) + "_") + String(wallPos.y))].length) {
if (gf[currentWall].solders[((String(wallPos.x) + "_") + String(wallPos.y))][_local2] == this){
gf[currentWall].solders[((String(wallPos.x) + "_") + String(wallPos.y))].splice(_local2, 1);
break;
};
_local2++;
};
if (_arg1){
while (numChildren) {
removeChildAt(0);
};
parent.removeChild(this);
gf = null;
game = null;
return;
};
if (parent != null){
if ((((gf.currentUnit == this)) && (!((_local3 == null))))){
_local3.changeVisible(null);
};
if (game.gameResult == "none"){
gf.checkGameResult();
};
_local4 = (gf.bloodLayer.addChild(new SolderExplosion0()) as MovieClip);
_local4.x = x;
_local4.y = y;
_local4.cacheAsBitmap = true;
_local5 = Math.floor((Math.random() * 6.99));
_local6 = Math.floor((_local5 + (Math.random() * (6.99 - _local5))));
_local2 = _local5;
while (_local2 < _local6) {
_local8 = (getDefinitionByName(("SolderPart" + String(_local2))) as Class);
_local7 = (gf.bloodLayer.addChild(new (_local8)) as MovieClip);
_local7.x = (x + (random() * 30));
_local7.y = (y + (random() * 30));
_local7.rotation = (_local7.rotation + (Math.random() * 360));
_local7.cacheAsBitmap = true;
_local2++;
};
while (numChildren) {
removeChildAt(0);
};
parent.removeChild(this);
};
gf = null;
game = null;
}
}
}//package com.elf7.units
Section 17
//Hint (com.elf7.utils.Hint)
package com.elf7.utils {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class Hint extends MovieClip {
private const tileW:Number = 10;
private const tileH:Number = 10;
private var counter:Number;// = 0
private var TEXT_FORMAT:TextFormat;
public var target:DisplayObject;
private var _parent:MovieClip;
private var time:Number;// = 10
public var textField:TextField;
public function Hint(){
TEXT_FORMAT = new TextFormat("Tahoma", 10, 0xFF0000, null, null, null, null, null, TextFormatAlign.JUSTIFY);
counter = 0;
time = 10;
super();
}
public function destroy():void{
textField = null;
target.removeEventListener(MouseEvent.MOUSE_OVER, onOver);
target.removeEventListener(MouseEvent.MOUSE_OUT, onOut);
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, timer);
};
if (target.hasEventListener(MouseEvent.CLICK)){
target.removeEventListener(MouseEvent.CLICK, onClick);
};
if (target.hasEventListener(MouseEvent.MOUSE_MOVE)){
target.removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
};
target = null;
while (numChildren) {
removeChildAt(0);
};
parent.removeChild(this);
}
public function create(_arg1:XML):TextField{
var _local2:Number;
_local2 = 0;
while (_local2 < _arg1.children().length()) {
if (_arg1.children()[_local2].name() == "bg"){
createBG(Number(_arg1.children()[_local2].attribute("x")), Number(_arg1.children()[_local2].attribute("y")), Number(_arg1.children()[_local2].attribute("w")), Number(_arg1.children()[_local2].attribute("h")), Number(_arg1.children()[_local2].attribute("t")));
};
if (_arg1.children()[_local2].name() == "text"){
createText(Number(_arg1.children()[_local2].attribute("x")), Number(_arg1.children()[_local2].attribute("y")), Number(_arg1.children()[_local2].attribute("w")), Number(_arg1.children()[_local2].attribute("h")), _arg1.children()[_local2].children()[0]);
};
_local2++;
};
target.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
target.addEventListener(MouseEvent.MOUSE_OUT, onOut, false, 0, true);
visible = false;
return (textField);
}
private function timer(_arg1:Event):void{
if (counter > time){
if (!visible){
visible = true;
if ((stage.mouseX - width) < 0){
x = ((stage.mouseX - parent.x) + 2);
} else {
x = (((stage.mouseX - parent.x) - width) - 2);
};
if ((stage.mouseY - height) < 0){
y = ((stage.mouseY - parent.y) + 2);
} else {
y = (((stage.mouseY - height) - parent.y) - 2);
};
};
} else {
counter++;
};
}
private function createBG(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0):void{
var _local6:MovieClip;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local7 = 0;
_local8 = 0;
_local7 = Math.floor(((_arg3 - (tileW * 2)) / tileW));
_local8 = Math.floor(((_arg4 - (tileH * 2)) / tileH));
_local9 = 0;
while (_local9 < _local7) {
_local10 = 0;
while (_local10 < _local8) {
_local6 = (addChild(c(_arg5, 2)) as MovieClip);
_local6.x = (_arg1 + (tileW * (_local9 + 1)));
_local6.y = (_arg2 + (tileH * (_local10 + 1)));
_local10++;
};
_local9++;
};
_local9 = 0;
while (_local9 < _local7) {
_local6 = (addChild(c(_arg5, 1)) as MovieClip);
_local6.x = (_arg1 + ((_local9 + 2) * tileW));
_local6.y = _arg2;
_local6.rotation = 90;
_local9++;
};
_local9 = 0;
while (_local9 < _local7) {
_local6 = (addChild(c(_arg5, 1)) as MovieClip);
_local6.x = (_arg1 + (tileW * (_local9 + 1)));
_local6.y = (_arg2 + _arg4);
_local6.rotation = -90;
_local9++;
};
_local9 = 0;
while (_local9 < _local8) {
_local6 = (addChild(c(_arg5, 1)) as MovieClip);
_local6.x = _arg1;
_local6.y = (_arg2 + (tileH * (_local9 + 1)));
_local9++;
};
_local9 = 0;
while (_local9 < _local8) {
_local6 = (addChild(c(_arg5, 1)) as MovieClip);
_local6.x = (_arg1 + _arg3);
_local6.y = (_arg2 + (tileH * (_local9 + 1)));
_local6.scaleX = -1;
_local9++;
};
_local6 = (addChild(c(_arg5, 0)) as MovieClip);
_local6.x = _arg1;
_local6.y = _arg2;
_local6 = (addChild(c(_arg5, 0)) as MovieClip);
_local6.x = (_arg1 + _arg3);
_local6.y = _arg2;
_local6.scaleX = -1;
_local6 = (addChild(c(_arg5, 0)) as MovieClip);
_local6.x = _arg1;
_local6.y = (_arg2 + _arg4);
_local6.scaleY = -1;
_local6 = (addChild(c(_arg5, 0)) as MovieClip);
_local6.x = (_arg1 + _arg3);
_local6.y = (_arg2 + _arg4);
_local6.scaleY = -1;
_local6.scaleX = -1;
_local6 = null;
}
public function onMove(_arg1:MouseEvent):void{
if (visible){
visible = false;
};
counter = 0;
}
private function c(_arg1:Number, _arg2:Number):MovieClip{
var _local3:Class;
var _local4:MovieClip;
if ((((_arg1 == 0)) && ((_arg2 == 0)))){
_local3 = (getDefinitionByName("HintBg0") as Class);
};
if ((((_arg1 == 0)) && ((_arg2 == 1)))){
_local3 = (getDefinitionByName("HintBg1") as Class);
};
if ((((_arg1 == 0)) && ((_arg2 == 2)))){
_local3 = (getDefinitionByName("HintBg2") as Class);
};
_local4 = (new (_local3) as MovieClip);
return (_local4);
}
private function createText(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:XML):void{
var _local6:TextField;
_local6 = (addChild(new TextField()) as TextField);
_local6.x = _arg1;
_local6.y = _arg2;
_local6.width = _arg3;
_local6.height = _arg4;
_local6.multiline = true;
_local6.wordWrap = true;
_local6.selectable = false;
_local6.htmlText = _arg5.toXMLString();
TEXT_FORMAT.color = 0xFFFFFF;
_local6.setTextFormat(TEXT_FORMAT);
textField = _local6;
_local6 = null;
}
public function onOver(_arg1:MouseEvent):void{
addEventListener(Event.ENTER_FRAME, timer, false, 0, true);
target.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
target.addEventListener(MouseEvent.MOUSE_MOVE, onMove, false, 0, true);
}
public function onClick(_arg1:MouseEvent):void{
if (visible){
visible = false;
};
counter = 0;
}
public function onOut(_arg1:MouseEvent):void{
if (visible){
visible = false;
};
counter = 0;
removeEventListener(Event.ENTER_FRAME, timer);
target.removeEventListener(MouseEvent.CLICK, onClick);
target.removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
}
}
}//package com.elf7.utils
Section 18
//Game (com.elf7.Game)
package com.elf7 {
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
import flash.text.*;
import fl.transitions.easing.*;
import flash.utils.*;
import CPMStar.*;
import com.elf7.sound.*;
import com.elf7.menu.*;
import com.elf7.level.*;
import flash.net.*;
import flash.ui.*;
public dynamic class Game extends MovieClip {
public const MAX_LEVEL:Number = 39;
public const SWF_WIDTH:Number = 600;
public const SWF_HEIGHT:Number = 480;
public var adTween:Tween;
public var ssb:MovieClip;
public var level_preview:MovieClip;
public var soundController:SoundController;
public var play_b:SimpleButton;
public var weaponeTween:Tween;
public var levelStatistic:Object;
public var t0:MovieClip;
public var t2:MovieClip;
public var ship:MovieClip;
public var t1:MovieClip;
public var ammoTween:Tween;
public var bm:MovieClip;
public var repair_cursor:UpgradeImg;
public var ss:MovieClip;
public var sb:SimpleButton;
public var d:MovieClip;
public var m:MovieClip;
public var mapTween:Tween;
public var p:MovieClip;
public var cm:CastleMenu;
public var w:MovieClip;
public var adBox2:MovieClip;
public var doors:MovieClip;
public var currentTarget:String;// = ""
public var currentMenu:String;// = ""
public var fgnbtn2:SimpleButton;
public var adBox:MovieClip;
public var stateTween:Tween;
public var gameResult:String;// = "none"
public var menuTween:Tween;
public var mmb:SimpleButton;
public var saveData:Object;
public var waitTimer:Timer;
public var gf:GameField;
public var shop:MovieClip;
public var fgnlogo:SimpleButton;
public var im:InfoMenu;
public var options_screen:MovieClip;
public var deadHallOfFame:Array;
public var zi:SimpleButton;
public var frameInc:Number;// = 1
public var guns:Array;
public var zo:SimpleButton;
public var valourPoints:Number;// = 0
public var names:Array;
public var statistic:Object;
public var mainMenuTimer:Timer;
public var fgnbtn:SimpleButton;
public var currentLevel:int;// = 0
public var withAd:Boolean;// = true
public var units:Array;
public var mm:MapMenu;
public var skip_b:SimpleButton;
public var wcounter:int;// = 0
public var credits_screen:MovieClip;
public var logo:SimpleButton;
public var lsb:SimpleButton;
public var img:MovieClip;
public var gmenuTween:Tween;
public var tutorialOn:Boolean;// = true
public var fncbtn:SimpleButton;
public var pause:Boolean;// = false
public function Game():void{
withAd = true;
pause = false;
levelStatistic = {};
statistic = {};
valourPoints = 0;
gameResult = "none";
currentLevel = 0;
waitTimer = new Timer(2000, 1);
mainMenuTimer = new Timer(500, 1);
frameInc = 1;
currentTarget = "";
currentMenu = "";
tutorialOn = true;
units = new Array();
guns = new Array();
deadHallOfFame = new Array();
names = new Array();
wcounter = 0;
super();
stop();
addFrameScript(0, frame1);
addFrameScript(1, frame2);
addFrameScript(2, frame3);
addFrameScript(3, frame4);
addFrameScript(4, frame5);
addFrameScript(5, frame6);
addFrameScript(6, frame7);
addFrameScript(7, frame8);
waitTimer.addEventListener(TimerEvent.TIMER, wait, false, 0, true);
setNames();
}
public function setNames():void{
names.push("Anthony");
names.push("Amadeus");
names.push("Amdis");
names.push("Antal");
names.push("Augustus");
names.push("Benedict");
names.push("Ceasar");
names.push("Constantine");
names.push("Cornelius");
names.push("Faust");
names.push("Gaius");
names.push("Janus");
names.push("Klaud");
names.push("Maximilian");
names.push("Modestus");
names.push("Octavius");
names.push("Sergius");
names.push("Claudius");
names.push("Jurgen");
names.push("Oskar");
names.push("Cyrus");
names.push("Yngvar");
names.push("Rutger");
names.push("Klaas");
names.push("Walter");
names.push("Zeeman");
names.push("Adolph");
names.push("Gandolf");
names.push("Harman");
names.push("Ingram");
names.push("Lamar");
names.push("Rocky");
names.push("Roland");
}
public function onWinClick(_arg1:MouseEvent):void{
var _local2:SimpleButton;
_local2 = (getChildByName("sb") as SimpleButton);
frameInc = -4;
doors.play();
_local2.removeEventListener(MouseEvent.CLICK, onWinClick);
}
public function checkDownloading(_arg1:Event):void{
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:TextField;
var _local5:int;
var _local6:DisplayObject;
_local2 = (getChildByName("p") as MovieClip);
_local3 = (_local2.getChildByName("bar") as MovieClip);
_local4 = (_local2.getChildByName("txt") as TextField);
_local5 = Math.floor(((loaderInfo.bytesLoaded / loaderInfo.bytesTotal) * 100));
if (_local5 < 100){
_local3.gotoAndStop((_local5 + 1));
_local4.text = (("LOADING " + _local5) + "%");
} else {
_local6 = getChildByName("play_b");
_local6.visible = true;
_local2.visible = false;
removeEventListener(Event.ENTER_FRAME, checkDownloading);
};
}
public function initLastMenu():void{
var _local1:MovieClip;
var _local2:SimpleButton;
var _local3:SimpleButton;
var _local4:Number;
var _local5:SharedObject;
_local1 = (getChildByName("m") as MovieClip);
_local2 = (_local1.getChildByName("continue_b") as SimpleButton);
_local3 = (_local1.getChildByName("mm_b") as SimpleButton);
_local2.addEventListener(MouseEvent.CLICK, lastClick, false, 0, true);
_local3.addEventListener(MouseEvent.CLICK, lastClick, false, 0, true);
_local2.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local2.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
_local3.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local3.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
if (gameResult == "win"){
(_local1.getChildByName("t") as TextField).text = "WAVE CLEARED!";
} else {
(_local1.getChildByName("t") as TextField).text = "CASTLE DESTROYED!";
};
(_local1.getChildByName("t00") as TextField).text = String(levelStatistic.ekilled);
(_local1.getChildByName("t01") as TextField).text = String(levelStatistic.srised);
(_local1.getChildByName("t02") as TextField).text = String(levelStatistic.slost);
(_local1.getChildByName("t03") as TextField).text = String(levelStatistic.tlost);
(_local1.getChildByName("t04") as TextField).text = String(levelStatistic.wlost);
(_local1.getChildByName("t10") as TextField).text = String(Math.floor((levelStatistic.ekilled * 2)));
(_local1.getChildByName("t11") as TextField).text = String((levelStatistic.srised * 60));
(_local1.getChildByName("t12") as TextField).text = String((-(levelStatistic.slost) * 10));
(_local1.getChildByName("t13") as TextField).text = String((-(levelStatistic.tlost) * 20));
(_local1.getChildByName("t14") as TextField).text = String((-(levelStatistic.wlost) * 10));
_local4 = Math.floor((((((levelStatistic.ekilled * 2) + (levelStatistic.srised * 60)) - (levelStatistic.slost * 10)) - (levelStatistic.tlost * 20)) - (levelStatistic.wlost * 10)));
(_local1.getChildByName("t15") as TextField).text = String(_local4);
valourPoints = (valourPoints + _local4);
if (valourPoints < 0){
valourPoints = 0;
};
if (gameResult == "win"){
if (currentLevel != MAX_LEVEL){
_local5 = SharedObject.getLocal("TheLastFrontier");
saveData.units = units;
saveData.guns = guns;
saveData.currentLevel = (currentLevel + 1);
saveData.valourPoints = valourPoints;
_local5.data.saveData = saveData;
};
(_local1.getChildByName("t23") as TextField).visible = false;
units.sortOn("killed", Array.NUMERIC);
(_local1.getChildByName("t20") as TextField).text = units[(units.length - 1)].name;
(_local1.getChildByName("t21") as TextField).text = String((units[(units.length - 1)].level + 1));
(_local1.getChildByName("t22") as TextField).text = String(units[(units.length - 1)].killed);
(_local1.getChildByName("i") as MovieClip).gotoAndStop((units[(units.length - 1)].type + 1));
((_local1.getChildByName("i") as MovieClip).getChildByName("s") as MovieClip).gotoAndStop((units[(units.length - 1)].level + 1));
} else {
(_local1.getChildByName("t23") as TextField).visible = false;
deadHallOfFame.sortOn("killed", Array.NUMERIC);
(_local1.getChildByName("t20") as TextField).text = deadHallOfFame[(deadHallOfFame.length - 1)].name;
(_local1.getChildByName("t21") as TextField).text = String((deadHallOfFame[(deadHallOfFame.length - 1)].level + 1));
(_local1.getChildByName("t22") as TextField).text = String(deadHallOfFame[(deadHallOfFame.length - 1)].killed);
(_local1.getChildByName("i") as MovieClip).gotoAndStop((deadHallOfFame[(deadHallOfFame.length - 1)].type + 1));
((_local1.getChildByName("i") as MovieClip).getChildByName("s") as MovieClip).gotoAndStop((deadHallOfFame[(deadHallOfFame.length - 1)].level + 1));
};
}
public function onLoseClick(_arg1:MouseEvent):void{
var _local2:SimpleButton;
var _local3:SimpleButton;
_local2 = (getChildByName("lsb") as SimpleButton);
_local3 = (getChildByName("mmb") as SimpleButton);
if (_arg1.target.name == "mmb"){
frameInc = -5;
doors.play();
} else {
loadLastGame();
frameInc = -3;
doors.play();
};
_local2.removeEventListener(MouseEvent.CLICK, onLoseClick);
_local3.removeEventListener(MouseEvent.CLICK, onLoseClick);
}
public function frame3():void{
var _local1:DisplayObject;
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:SimpleButton;
var _local5:SimpleButton;
var _local6:SimpleButton;
var _local7:SimpleButton;
var _local8:SimpleButton;
var _local9:SharedObject;
if (stage.loaderInfo.url.indexOf("www.7thelf.com") == -1){
};
_local1 = getChildByName("fgnbtn2");
_local1.addEventListener(MouseEvent.CLICK, gotoSponsorPage, false, 0, true);
_local1 = getChildByName("fncbtn");
_local1.addEventListener(MouseEvent.CLICK, gotoSponsorPage, false, 0, true);
_local2 = (getChildByName("bm") as MovieClip);
_local3 = (getChildByName("w") as MovieClip);
_local4 = (_local2.getChildByName("play_b") as SimpleButton);
_local5 = (_local2.getChildByName("continue_b") as SimpleButton);
_local6 = (_local2.getChildByName("options_b") as SimpleButton);
_local7 = (_local2.getChildByName("credits_b") as SimpleButton);
_local8 = (_local2.getChildByName("more_b") as SimpleButton);
_local4.addEventListener(MouseEvent.CLICK, mainMenuBtnClick, false, 0, true);
_local5.addEventListener(MouseEvent.CLICK, mainMenuBtnClick, false, 0, true);
_local6.addEventListener(MouseEvent.CLICK, mainMenuBtnClick, false, 0, true);
_local7.addEventListener(MouseEvent.CLICK, mainMenuBtnClick, false, 0, true);
_local8.addEventListener(MouseEvent.CLICK, mainMenuBtnClick, false, 0, true);
_local4.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
_local4.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local5.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
_local5.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local6.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
_local6.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local7.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
_local7.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local8.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
_local8.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local2.mask = (getChildByName("m") as MovieClip);
weaponeTween = new Tween(_local3, "y", Strong.easeIn, -50, 10, 2, true);
weaponeTween.addEventListener("motionFinish", onTweenEnd, false, 0, true);
soundController.playMusic("main", 0.025);
_local9 = SharedObject.getLocal("TheLastFrontier");
if (_local9.size == 0){
_local5.enabled = false;
_local5.alpha = 0.5;
} else {
_local5.addEventListener(MouseEvent.CLICK, continueGame, false, 0, true);
};
}
public function frame5():void{
var _local1:MapMenu;
_local1 = (getChildByName("mm") as MapMenu);
pause = false;
(getChildByName("gf") as GameField).init();
_local1.moveCamByGameField();
soundController.playMusic("light", 0.05);
}
public function frame6():void{
var _local1:MovieClip;
var _local2:String;
var _local3:DisplayObject;
var _local4:MovieClip;
soundController.playMusic("main", 0.025);
_local1 = (getChildByName("m") as MovieClip);
initLastMenu();
menuTween = new Tween(_local1, "y", Strong.easeOut, 1200, 200, 3, true);
if ((1.5 + (currentLevel / 2)) != Math.floor((1.5 + (currentLevel / 2)))){
return;
};
if (!withAd){
return;
};
_local2 = "1172Q765FE602";
_local3 = new AdLoader(_local2);
_local4 = (getChildByName("adBox2") as MovieClip);
_local4.addChild(_local3);
adTween = new Tween(_local4, "x", Strong.easeOut, 617, 338, 3, true);
}
public function frame4():void{
var _local1:SimpleButton;
if (stage.loaderInfo.url.indexOf("www.7thelf.com") == -1){
};
_local1 = (getChildByName("skip_b") as SimpleButton);
_local1.addEventListener(MouseEvent.CLICK, toGame, false, 0, true);
_local1.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
}
public function frame1():void{
var _local1:String;
var _local2:MovieClip;
var _local3:DisplayObject;
var _local4:ContextMenu;
var _local5:DisplayObject;
MochiBot.track(this, "e1e6a95f");
if (loaderInfo.url.indexOf("kongregate.com") > -1){
withAd = false;
};
_local1 = "1171Q98A9FCA0";
_local2 = (getChildByName("adBox") as MovieClip);
if (withAd){
_local5 = new AdLoader(_local1);
_local2.addChild(_local5);
} else {
(_local2.getChildByName("adMask") as MovieClip).gotoAndStop(2);
};
_local3 = getChildByName("fgnlogo");
_local3.visible = false;
_local3.addEventListener(MouseEvent.CLICK, gotoSponsorPage, false, 0, true);
_local3 = getChildByName("fgnbtn");
_local3.addEventListener(MouseEvent.CLICK, gotoSponsorPage, false, 0, true);
_local3 = getChildByName("play_b");
_local3.visible = false;
_local3.addEventListener(MouseEvent.CLICK, startGame, false, 0, true);
_local4 = new ContextMenu();
_local4.hideBuiltInItems();
stage.quality = "MEDIUM";
contextMenu = _local4;
addEventListener(Event.ENTER_FRAME, checkDownloading, false, 0, true);
}
public function frame2():void{
var _local1:SimpleButton;
MochiBot.track(this, "3ffbf7ca");
_local1 = (getChildByName("logo") as SimpleButton);
soundController = new SoundController();
doors = (getChildByName("d") as MovieClip);
_local1.addEventListener(MouseEvent.CLICK, naviget7thelf, false, 0, true);
if (stage.loaderInfo.url.indexOf("www.7thelf.com") == -1){
};
waitTimer.start();
soundController.playMusic("logo", 1);
}
public function frame8():void{
var _local1:SimpleButton;
var _local2:SimpleButton;
var _local3:SharedObject;
soundController.playMusic("main", 0.025);
_local1 = (getChildByName("lsb") as SimpleButton);
_local2 = (getChildByName("mmb") as SimpleButton);
_local3 = SharedObject.getLocal("TheLastFrontier");
if (_local3.size == 0){
_local1.visible = false;
} else {
_local1.addEventListener(MouseEvent.CLICK, onLoseClick, false, 0, true);
_local1.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
};
_local2.addEventListener(MouseEvent.CLICK, onLoseClick, false, 0, true);
_local2.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local2.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
}
public function frame7():void{
var _local1:SimpleButton;
soundController.playMusic("main", 0.025);
_local1 = (getChildByName("sb") as SimpleButton);
_local1.addEventListener(MouseEvent.CLICK, onWinClick, false, 0, true);
_local1.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local1.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
}
public function lastClick(_arg1:MouseEvent):void{
var _local2:MovieClip;
doors.play();
if (_arg1.target.name == "mm_b"){
frameInc = -3;
currentLevel = 0;
} else {
if (currentLevel >= MAX_LEVEL){
frameInc = 1;
currentLevel = 0;
} else {
if (gameResult == "win"){
frameInc = -1;
currentLevel++;
} else {
frameInc = 1;
};
};
};
_local2 = (getChildByName("adBox2") as MovieClip);
_local2.visible = false;
_local2.x = 2000;
if (adTween != null){
adTween.stop();
adTween = null;
};
removeChild(_local2);
}
public function loadLastGame():void{
var _local1:Array;
var _local2:Array;
var _local3:int;
var _local4:SharedObject;
_local1 = ["tower_l_u", "tower_r_u", "tower_l_d", "tower_r_d"];
_local2 = ["wall_l", "wall_r", "wall_d", "wall_u"];
_local3 = 0;
_local4 = SharedObject.getLocal("TheLastFrontier");
saveData = _local4.data.saveData;
units = saveData.units;
guns = saveData.guns;
currentLevel = saveData.currentLevel;
valourPoints = saveData.valourPoints;
_local3 = 0;
while (_local3 < _local1.length) {
saveData[_local1[_local3]] = _local4.data.saveData[_local1[_local3]];
_local3++;
};
_local3 = 0;
while (_local3 < _local2.length) {
saveData[_local2[_local3]] = _local4.data.saveData[_local2[_local3]];
_local3++;
};
}
public function onClick(_arg1:MouseEvent):void{
soundController.playSound("click");
}
public function startNewGame():void{
currentLevel = 0;
valourPoints = 0;
units = new Array();
deadHallOfFame = new Array();
guns = new Array();
units.push({name:names[Math.floor((Math.random() * (names.length - 0.01)))], killed:0, level:0, type:0, exp:0});
units.push({name:names[Math.floor((Math.random() * (names.length - 0.01)))], killed:0, level:0, type:0, exp:0});
units.push({name:names[Math.floor((Math.random() * (names.length - 0.01)))], killed:0, level:0, type:0, exp:0});
units.push({name:names[Math.floor((Math.random() * (names.length - 0.01)))], killed:0, level:0, type:0, exp:0});
units.push({name:names[Math.floor((Math.random() * (names.length - 0.01)))], killed:0, level:0, type:2, exp:0});
}
public function toGame(_arg1:MouseEvent):void{
var _local2:SimpleButton;
_local2 = (getChildByName("skip_b") as SimpleButton);
if (_arg1 != null){
if (!_arg1.target.enabled){
return;
};
};
startNewGame();
_local2.enabled = false;
frameInc = 1;
doors.play();
}
public function waitSponsorLogo(_arg1:Event):void{
if (wcounter > 50){
removeEventListener(Event.ENTER_FRAME, waitSponsorLogo);
nextFrame();
} else {
wcounter++;
};
}
public function continueGame(_arg1:MouseEvent):void{
if (!_arg1.target.enabled){
return;
};
loadLastGame();
_arg1.target.enabled = false;
frameInc = 2;
doors.play();
}
public function onOver(_arg1:MouseEvent):void{
soundController.playSound("over");
}
public function mainMenuBtnClick(_arg1:MouseEvent):void{
var _local2:MovieClip;
var _local3:SimpleButton;
var _local4:SimpleButton;
var _local5:SimpleButton;
var _local6:SimpleButton;
var _local7:SimpleButton;
var _local8:SimpleButton;
var _local9:Boolean;
var _local10:String;
if (!_arg1.target.enabled){
return;
};
_local2 = (getChildByName("bm") as MovieClip);
_local3 = (_local2.getChildByName("play_b") as SimpleButton);
_local4 = (_local2.getChildByName("continue_b") as SimpleButton);
_local5 = (_local2.getChildByName("options_b") as SimpleButton);
_local6 = (_local2.getChildByName("credits_b") as SimpleButton);
_local7 = (_local2.getChildByName("more_b") as SimpleButton);
_local8 = (_arg1.target as SimpleButton);
_local9 = false;
_local10 = "";
if (_local8 == _local3){
frameInc = 1;
doors.play();
};
if (_local8 == _local4){
};
if ((((_local8 == _local5)) && (!((currentMenu == "options"))))){
_local9 = true;
_local10 = "options";
};
if ((((_local8 == _local6)) && (!((currentMenu == "credits"))))){
_local9 = true;
_local10 = "credits";
};
if (_local8 == _local7){
navigateToURL(new URLRequest("http://www.flashgamesnexus.com/"), "_blank");
};
if (_local9){
if (currentMenu == ""){
currentMenu = _local10;
currentTarget = _local10;
menuTween = new Tween(getChildByName((currentMenu + "_screen")), "x", Strong.easeInOut, 600, 260, 1, true);
menuTween.addEventListener("motionFinish", onTweenEnd, false, 0, true);
soundController.playSound("openMenu");
} else {
if (currentTarget == ""){
currentTarget = currentMenu;
menuTween = new Tween(getChildByName((currentMenu + "_screen")), "x", Strong.easeInOut, 260, 600, 0.5, true);
menuTween.addEventListener("motionFinish", onTweenEnd, false, 0, true);
soundController.playSound("openMenu");
};
};
currentMenu = _local10;
};
}
public function gotoSponsorPage(_arg1:MouseEvent):void{
if (_arg1.target.name.indexOf("fgn") > -1){
navigateToURL(new URLRequest("http://www.flashgamesnexus.com/"), "_blank");
};
if (_arg1.target.name.indexOf("fnc") > -1){
navigateToURL(new URLRequest("http://www.flashninjaclan.com/fncgames.php"), "_blank");
};
}
public function wait(_arg1:TimerEvent):void{
doors.play();
waitTimer.removeEventListener(TimerEvent.TIMER, wait);
waitTimer.stop();
waitTimer = null;
}
public function startGame(_arg1:MouseEvent):void{
var _local2:DisplayObject;
_local2 = getChildByName("fgnlogo");
_local2.visible = true;
_local2 = getChildByName("play_b");
_local2.visible = false;
_local2 = getChildByName("fgnbtn");
_local2.visible = false;
_local2 = getChildByName("adBox");
_local2.visible = false;
addEventListener(Event.ENTER_FRAME, waitSponsorLogo);
}
public function onTweenEnd(_arg1:TweenEvent):void{
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:MovieClip;
_local2 = (getChildByName("bm") as MovieClip);
_local3 = (getChildByName("credits_screen") as MovieClip);
_local4 = (getChildByName("options_screen") as MovieClip);
if (_arg1.target == weaponeTween){
ammoTween = new Tween(_local2, "y", Strong.easeInOut, -135, 198, 1.5, true);
ammoTween.addEventListener("motionFinish", onTweenEnd, false, 0, true);
soundController.playSound("chain");
};
if (_arg1.target == ammoTween){
weaponeTween.removeEventListener("motionFinish", onTweenEnd);
ammoTween.removeEventListener("motionFinish", onTweenEnd);
ammoTween = null;
weaponeTween = null;
};
if (_arg1.target == menuTween){
if (_arg1.position == 600){
currentTarget = currentMenu;
menuTween = new Tween(getChildByName((currentMenu + "_screen")), "x", Strong.easeInOut, 600, 260, 1, true);
menuTween.addEventListener("motionFinish", onTweenEnd, false, 0, true);
soundController.playSound("openMenu");
};
if (_arg1.position == 260){
if (currentMenu != currentTarget){
menuTween = new Tween(getChildByName((currentTarget + "_screen")), "x", Strong.easeInOut, 260, 600, 0.5, true);
menuTween.addEventListener("motionFinish", onTweenEnd, false, 0, true);
currentTarget = currentMenu;
soundController.playSound("openMenu");
} else {
currentTarget = "";
};
};
};
}
public function naviget7thelf(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.7thelf.com"), "_blank");
}
}
}//package com.elf7
Section 19
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(_arg1:Event):void{
var _local2:String;
var _local3:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
_local2 = "http://server.cpmstar.com/adviewas3.swf";
_local3 = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
}
}//package CPMStar
Section 20
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 21
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 22
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 23
//ad300x250_5 (Game_fla.ad300x250_5)
package Game_fla {
import flash.display.*;
public dynamic class ad300x250_5 extends MovieClip {
public var adMask:MovieClip;
}
}//package Game_fla
Section 24
//adMask_10 (Game_fla.adMask_10)
package Game_fla {
import flash.display.*;
public dynamic class adMask_10 extends MovieClip {
public function adMask_10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 25
//BtnMenuBg_195 (Game_fla.BtnMenuBg_195)
package Game_fla {
import flash.display.*;
public dynamic class BtnMenuBg_195 extends MovieClip {
public var sound_b:SimpleButton;
public var help_b:SimpleButton;
public var pause_b:SimpleButton;
public var quit_b:SimpleButton;
public var more_b:SimpleButton;
}
}//package Game_fla
Section 26
//Bugs_217 (Game_fla.Bugs_217)
package Game_fla {
import flash.display.*;
public dynamic class Bugs_217 extends MovieClip {
public function Bugs_217(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 27
//BugScreen_216 (Game_fla.BugScreen_216)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class BugScreen_216 extends MovieClip {
public var h_t:TextField;
public var i:MovieClip;
public var d_t:TextField;
public var health_t:TextField;
public var des_t:TextField;
public var damage_t:TextField;
public var name_t:TextField;
}
}//package Game_fla
Section 28
//CastleMenuBg_190 (Game_fla.CastleMenuBg_190)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class CastleMenuBg_190 extends MovieClip {
public var tower_l_d:MovieClip;
public var tower_l_u:MovieClip;
public var tower_r_u_t:TextField;
public var tower_l_u_t:TextField;
public var wall_u_t:TextField;
public var wall_d:MovieClip;
public var wall_r:MovieClip;
public var tower_l_d_t:TextField;
public var wall_l:MovieClip;
public var wall_l_t:TextField;
public var wall_d_t:TextField;
public var tower_r_d_t:TextField;
public var tower_r_d:MovieClip;
public var tower_r_u:MovieClip;
public var wall_u:MovieClip;
public var wall_r_t:TextField;
}
}//package Game_fla
Section 29
//CheckBox_43 (Game_fla.CheckBox_43)
package Game_fla {
import flash.display.*;
public dynamic class CheckBox_43 extends MovieClip {
public function CheckBox_43(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 30
//Doors_17 (Game_fla.Doors_17)
package Game_fla {
import flash.display.*;
import com.elf7.*;
import com.elf7.level.*;
public dynamic class Doors_17 extends MovieClip {
public function Doors_17(){
addFrameScript(0, frame1, 1, frame2, 12, frame13, 28, frame29, 66, frame67);
}
function frame1(){
stop();
}
function frame13(){
(parent as Game).soundController.playSound("doors");
}
function frame29(){
if ((parent as MovieClip).currentFrame == 5){
((parent as Game).getChildByName("gf") as GameField).destroy();
};
(parent as Game).gotoAndStop(((parent as Game).currentFrame + (parent as Game).frameInc));
}
function frame2(){
}
function frame67(){
gotoAndStop(1);
}
}
}//package Game_fla
Section 31
//EndGameImage_225 (Game_fla.EndGameImage_225)
package Game_fla {
import flash.display.*;
public dynamic class EndGameImage_225 extends MovieClip {
public function EndGameImage_225(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 32
//ExpBar_214 (Game_fla.ExpBar_214)
package Game_fla {
import flash.display.*;
public dynamic class ExpBar_214 extends MovieClip {
public function ExpBar_214(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 33
//HealthBar_56 (Game_fla.HealthBar_56)
package Game_fla {
import flash.display.*;
public dynamic class HealthBar_56 extends MovieClip {
public function HealthBar_56(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 34
//Help0_157 (Game_fla.Help0_157)
package Game_fla {
import flash.display.*;
public dynamic class Help0_157 extends MovieClip {
public function Help0_157(){
addFrameScript(337, frame338);
}
function frame338(){
if (parent == null){
stop();
return;
};
(parent as MovieClip).nextFrame();
}
}
}//package Game_fla
Section 35
//Help1_160 (Game_fla.Help1_160)
package Game_fla {
import flash.display.*;
public dynamic class Help1_160 extends MovieClip {
public function Help1_160(){
addFrameScript(359, frame360);
}
function frame360(){
if (parent == null){
stop();
return;
};
(parent as MovieClip).nextFrame();
}
}
}//package Game_fla
Section 36
//Help2_161 (Game_fla.Help2_161)
package Game_fla {
import flash.display.*;
public dynamic class Help2_161 extends MovieClip {
public function Help2_161(){
addFrameScript(199, frame200);
}
function frame200(){
if (parent == null){
stop();
return;
};
(parent as MovieClip).nextFrame();
}
}
}//package Game_fla
Section 37
//Help3_162 (Game_fla.Help3_162)
package Game_fla {
import flash.display.*;
public dynamic class Help3_162 extends MovieClip {
public function Help3_162(){
addFrameScript(321, frame322);
}
function frame322(){
if (parent == null){
stop();
return;
};
(parent as MovieClip).nextFrame();
}
}
}//package Game_fla
Section 38
//Help4_164 (Game_fla.Help4_164)
package Game_fla {
import flash.display.*;
public dynamic class Help4_164 extends MovieClip {
public function Help4_164(){
addFrameScript(200, frame201);
}
function frame201(){
if (parent == null){
stop();
return;
};
(parent as MovieClip).nextFrame();
}
}
}//package Game_fla
Section 39
//Help5_165 (Game_fla.Help5_165)
package Game_fla {
import flash.display.*;
public dynamic class Help5_165 extends MovieClip {
public function Help5_165(){
addFrameScript(263, frame264);
}
function frame264(){
if (parent == null){
stop();
return;
};
(parent as MovieClip).nextFrame();
}
}
}//package Game_fla
Section 40
//Help6_166 (Game_fla.Help6_166)
package Game_fla {
import flash.display.*;
public dynamic class Help6_166 extends MovieClip {
public function Help6_166(){
addFrameScript(214, frame215);
}
function frame215(){
if (parent == null){
stop();
return;
};
(parent as MovieClip).nextFrame();
}
}
}//package Game_fla
Section 41
//Help7_167 (Game_fla.Help7_167)
package Game_fla {
import flash.display.*;
public dynamic class Help7_167 extends MovieClip {
public function Help7_167(){
addFrameScript(114, frame115);
}
function frame115(){
if (parent == null){
stop();
return;
};
(parent as MovieClip).gotoAndStop(1);
}
}
}//package Game_fla
Section 42
//HelpAni_156 (Game_fla.HelpAni_156)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HelpAni_156 extends MovieClip {
public function HelpAni_156(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
}
function frame3(){
if (parent == null){
return;
};
(parent.getChildByName("title") as TextField).text = "HELP - CAMERA CONTROL";
(parent.getChildByName("b1") as MovieClip).gotoAndStop(1);
(parent.getChildByName("b2") as MovieClip).gotoAndStop(2);
}
function frame6(){
if (parent == null){
return;
};
(parent.getChildByName("title") as TextField).text = "HELP - REPAIRMAN";
(parent.getChildByName("b4") as MovieClip).gotoAndStop(1);
(parent.getChildByName("b5") as MovieClip).gotoAndStop(2);
}
function frame7(){
if (parent == null){
return;
};
(parent.getChildByName("title") as TextField).text = "HELP - MORTAR";
(parent.getChildByName("b5") as MovieClip).gotoAndStop(1);
(parent.getChildByName("b6") as MovieClip).gotoAndStop(2);
}
function frame1(){
stop();
if (parent == null){
return;
};
(parent.getChildByName("title") as TextField).text = "HELP - SELECTING SOLDIERS";
(parent.getChildByName("b7") as MovieClip).gotoAndStop(1);
(parent.getChildByName("b0") as MovieClip).gotoAndStop(2);
}
function frame4(){
if (parent == null){
return;
};
(parent.getChildByName("title") as TextField).text = "HELP - GUNNER";
(parent.getChildByName("b2") as MovieClip).gotoAndStop(1);
(parent.getChildByName("b3") as MovieClip).gotoAndStop(2);
}
function frame5(){
if (parent == null){
return;
};
(parent.getChildByName("title") as TextField).text = "HELP - HEAVY INFANTRY";
(parent.getChildByName("b3") as MovieClip).gotoAndStop(1);
(parent.getChildByName("b4") as MovieClip).gotoAndStop(2);
}
function frame8(){
if (parent == null){
return;
};
(parent.getChildByName("title") as TextField).text = "HELP - MACHINEGUN";
(parent.getChildByName("b6") as MovieClip).gotoAndStop(1);
(parent.getChildByName("b7") as MovieClip).gotoAndStop(2);
}
function frame2(){
if (parent == null){
return;
};
(parent.getChildByName("title") as TextField).text = "HELP - MOVEMENT OF SOLDIERS";
(parent.getChildByName("b0") as MovieClip).gotoAndStop(1);
(parent.getChildByName("b1") as MovieClip).gotoAndStop(2);
}
}
}//package Game_fla
Section 43
//History_132 (Game_fla.History_132)
package Game_fla {
import flash.display.*;
import com.elf7.*;
public dynamic class History_132 extends MovieClip {
public function History_132(){
addFrameScript(596, frame597);
}
function frame597(){
stop();
(parent as Game).toGame(null);
}
}
}//package Game_fla
Section 44
//Icons_204 (Game_fla.Icons_204)
package Game_fla {
import flash.display.*;
public dynamic class Icons_204 extends MovieClip {
public var s:MovieClip;
public function Icons_204(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 45
//LevelPreview_220 (Game_fla.LevelPreview_220)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LevelPreview_220 extends MovieClip {
public var day:TextField;
}
}//package Game_fla
Section 46
//LevelResult_226 (Game_fla.LevelResult_226)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LevelResult_226 extends MovieClip {
public var i:MovieClip;
public var t01:TextField;
public var t02:TextField;
public var t03:TextField;
public var t00:TextField;
public var t04:TextField;
public var mm_b:SimpleButton;
public var t12:TextField;
public var t14:TextField;
public var t15:TextField;
public var t10:TextField;
public var t13:TextField;
public var t:TextField;
public var t21:TextField;
public var t23:TextField;
public var t20:TextField;
public var t22:TextField;
public var t11:TextField;
public var continue_b:SimpleButton;
}
}//package Game_fla
Section 47
//MainMenu_24 (Game_fla.MainMenu_24)
package Game_fla {
import flash.display.*;
public dynamic class MainMenu_24 extends MovieClip {
public var options_b:SimpleButton;
public var play_b:SimpleButton;
public var continue_b:SimpleButton;
public var credits_b:SimpleButton;
public var more_b:SimpleButton;
}
}//package Game_fla
Section 48
//MapScreen_183 (Game_fla.MapScreen_183)
package Game_fla {
import flash.display.*;
public dynamic class MapScreen_183 extends MovieClip {
public var bg:MovieClip;
}
}//package Game_fla
Section 49
//morter_92 (Game_fla.morter_92)
package Game_fla {
import flash.display.*;
public dynamic class morter_92 extends MovieClip {
public function morter_92(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 50
//Preloader_1 (Game_fla.Preloader_1)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Preloader_1 extends MovieClip {
public var bar:MovieClip;
public var txt:TextField;
}
}//package Game_fla
Section 51
//PreloaderBar_2 (Game_fla.PreloaderBar_2)
package Game_fla {
import flash.display.*;
public dynamic class PreloaderBar_2 extends MovieClip {
public function PreloaderBar_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 52
//SelectBtn_169 (Game_fla.SelectBtn_169)
package Game_fla {
import flash.display.*;
public dynamic class SelectBtn_169 extends MovieClip {
public function SelectBtn_169(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 53
//Shop_221 (Game_fla.Shop_221)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Shop_221 extends MovieClip {
public var close:SimpleButton;
public var sell0:SimpleButton;
public var sell4:SimpleButton;
public var sell1:SimpleButton;
public var sell3:SimpleButton;
public var sell2:SimpleButton;
public var buy0:SimpleButton;
public var buy1:SimpleButton;
public var sq:TextField;
public var buy4:SimpleButton;
public var t02:TextField;
public var buy3:SimpleButton;
public var t00:TextField;
public var buy2:SimpleButton;
public var t12:TextField;
public var t01:TextField;
public var t10:TextField;
public var t11:TextField;
public var repair:SimpleButton;
public var t21:TextField;
public var t22:TextField;
public var t20:TextField;
public var t30:TextField;
public var t31:TextField;
public var t32:TextField;
public var vpoints:TextField;
public var t41:TextField;
public var t42:TextField;
public var t40:TextField;
}
}//package Game_fla
Section 54
//SoundLibrary_16 (Game_fla.SoundLibrary_16)
package Game_fla {
import flash.display.*;
public dynamic class SoundLibrary_16 extends MovieClip {
public function SoundLibrary_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 55
//Stars_207 (Game_fla.Stars_207)
package Game_fla {
import flash.display.*;
public dynamic class Stars_207 extends MovieClip {
public function Stars_207(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 56
//StateBar_137 (Game_fla.StateBar_137)
package Game_fla {
import flash.display.*;
public dynamic class StateBar_137 extends MovieClip {
public var s:MovieClip;
public function StateBar_137(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 57
//Type0_178 (Game_fla.Type0_178)
package Game_fla {
import flash.display.*;
public dynamic class Type0_178 extends MovieClip {
public function Type0_178(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 58
//Type1_180 (Game_fla.Type1_180)
package Game_fla {
import flash.display.*;
public dynamic class Type1_180 extends MovieClip {
public function Type1_180(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 59
//Type2_181 (Game_fla.Type2_181)
package Game_fla {
import flash.display.*;
public dynamic class Type2_181 extends MovieClip {
public function Type2_181(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 60
//UnitScreen_203 (Game_fla.UnitScreen_203)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UnitScreen_203 extends MovieClip {
public var n_t:TextField;
public var bar:MovieClip;
public var rank_t:TextField;
public var killed_t:TextField;
public var h_t:TextField;
public var i:MovieClip;
public var d_t:TextField;
public var health_t:TextField;
public var des_t:TextField;
public var damage_t:TextField;
public var name_t:TextField;
}
}//package Game_fla
Section 61
//WallClickMask_45 (Game_fla.WallClickMask_45)
package Game_fla {
import flash.display.*;
public dynamic class WallClickMask_45 extends MovieClip {
public function WallClickMask_45(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 62
//Win_228 (Game_fla.Win_228)
package Game_fla {
import flash.display.*;
public dynamic class Win_228 extends MovieClip {
public function Win_228(){
addFrameScript(777, frame778);
}
function frame778(){
stop();
}
}
}//package Game_fla
Section 63
//Window_0_35 (Game_fla.Window_0_35)
package Game_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class Window_0_35 extends MovieClip {
public var j0x:SimpleButton;
public var j:SimpleButton;
public function Window_0_35(){
addFrameScript(0, frame1);
}
function frame1(){
j = (getChildByName("j0x") as SimpleButton);
j.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
public function onClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://joxflash.ru/"), "_blank");
}
}
}//package Game_fla
Section 64
//Window_1_42 (Game_fla.Window_1_42)
package Game_fla {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import com.elf7.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Window_1_42 extends MovieClip {
public var s1:MovieClip;
public var s0:MovieClip;
public var t0:MovieClip;
public var t1:MovieClip;
public var i:int;
public var q1:MovieClip;
public var q2:MovieClip;
public var q0:MovieClip;
public var game:Game;
public function Window_1_42(){
addFrameScript(0, frame1);
}
function frame1(){
game = (parent as Game);
i = 0;
i = 0;
while (i < 3) {
(getChildByName(("q" + String(i))) as MovieClip).buttonMode = true;
(getChildByName(("q" + String(i))) as MovieClip).gotoAndStop(1);
getChildByName(("q" + String(i))).addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
getChildByName(("q" + String(i))).addEventListener(MouseEvent.CLICK, game.onClick, false, 0, true);
getChildByName(("q" + String(i))).addEventListener(MouseEvent.MOUSE_OVER, game.onOver, false, 0, true);
i++;
};
i = 0;
while (i < 2) {
(getChildByName(("s" + String(i))) as MovieClip).buttonMode = true;
(getChildByName(("s" + String(i))) as MovieClip).gotoAndStop(1);
getChildByName(("s" + String(i))).addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
getChildByName(("s" + String(i))).addEventListener(MouseEvent.CLICK, game.onClick, false, 0, true);
getChildByName(("s" + String(i))).addEventListener(MouseEvent.MOUSE_OVER, game.onOver, false, 0, true);
i++;
};
i = 0;
while (i < 2) {
(getChildByName(("t" + String(i))) as MovieClip).buttonMode = true;
(getChildByName(("t" + String(i))) as MovieClip).gotoAndStop(1);
getChildByName(("t" + String(i))).addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
getChildByName(("t" + String(i))).addEventListener(MouseEvent.CLICK, game.onClick, false, 0, true);
getChildByName(("t" + String(i))).addEventListener(MouseEvent.MOUSE_OVER, game.onOver, false, 0, true);
i++;
};
if (stage.quality == "LOW"){
(getChildByName("q0") as MovieClip).gotoAndStop(2);
} else {
if (stage.quality == "MEDIUM"){
(getChildByName("q1") as MovieClip).gotoAndStop(2);
} else {
if (stage.quality == "HIGH"){
(getChildByName("q2") as MovieClip).gotoAndStop(2);
};
};
};
if (game.soundController.soundEnabled){
(getChildByName("s0") as MovieClip).gotoAndStop(2);
} else {
(getChildByName("s1") as MovieClip).gotoAndStop(2);
};
if (game.tutorialOn){
(getChildByName("t0") as MovieClip).gotoAndStop(2);
} else {
(getChildByName("t1") as MovieClip).gotoAndStop(2);
};
}
public function onClick(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
var _local4:int;
var _local5:Array;
_local2 = _arg1.target.name.substr(0, 1);
_local3 = ((_local2 == "q")) ? 3 : 2;
_local4 = int(_arg1.target.name.substr(1));
_local5 = ["LOW", "MEDIUM", "HIGH"];
i = 0;
while (i < _local3) {
(getChildByName((_local2 + String(i))) as MovieClip).gotoAndStop(1);
i++;
};
if (_local2 == "q"){
stage.quality = _local5[_local4];
};
if (_local2 == "s"){
if (_local4 == 0){
game.soundController.soundEnabled = true;
game.soundController.setVolume("all", 1);
} else {
game.soundController.soundEnabled = false;
game.soundController.setVolume("all", 0);
};
};
if (_local2 == "t"){
if (_local4 == 0){
game.tutorialOn = true;
} else {
game.tutorialOn = false;
};
};
(_arg1.target as MovieClip).gotoAndStop(2);
}
}
}//package Game_fla
Section 65
//zenitOrudie_94 (Game_fla.zenitOrudie_94)
package Game_fla {
import flash.display.*;
public dynamic class zenitOrudie_94 extends MovieClip {
public function zenitOrudie_94(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
stop();
}
function frame5(){
gotoAndPlay(2);
}
}
}//package Game_fla
Section 66
//Ani0 (Ani0)
package {
import flash.display.*;
public dynamic class Ani0 extends MovieClip {
public function Ani0(){
addFrameScript(0, frame1, 14, frame15, 21, frame22);
}
function frame15(){
gotoAndPlay("MOVE");
}
function frame1(){
stop();
}
function frame22(){
gotoAndStop("STAND");
}
}
}//package
Section 67
//Ani1 (Ani1)
package {
import flash.display.*;
public dynamic class Ani1 extends MovieClip {
public function Ani1(){
addFrameScript(0, frame1, 14, frame15, 22, frame23);
}
function frame15(){
gotoAndPlay("MOVE");
}
function frame1(){
stop();
}
function frame23(){
gotoAndStop("STAND");
}
}
}//package
Section 68
//Ani2 (Ani2)
package {
import flash.display.*;
public dynamic class Ani2 extends MovieClip {
public function Ani2(){
addFrameScript(0, frame1, 14, frame15, 24, frame25);
}
function frame15(){
gotoAndPlay("MOVE");
}
function frame1(){
stop();
}
function frame25(){
gotoAndStop("STAND");
}
}
}//package
Section 69
//Arrow (Arrow)
package {
import flash.display.*;
public dynamic class Arrow extends MovieClip {
}
}//package
Section 70
//AtackCursor (AtackCursor)
package {
import flash.display.*;
public dynamic class AtackCursor extends MovieClip {
public function AtackCursor(){
addFrameScript(0, frame1, 40, frame41);
}
function frame1(){
stop();
}
function frame41(){
gotoAndPlay(2);
}
}
}//package
Section 71
//AutShotSound (AutShotSound)
package {
import flash.media.*;
public dynamic class AutShotSound extends Sound {
}
}//package
Section 72
//BAni0 (BAni0)
package {
import flash.display.*;
public dynamic class BAni0 extends MovieClip {
public function BAni0(){
addFrameScript(0, frame1, 12, frame13, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
gotoAndStop("STAND");
}
function frame13(){
gotoAndPlay("WALK");
}
}
}//package
Section 73
//BAni1 (BAni1)
package {
import flash.display.*;
public dynamic class BAni1 extends MovieClip {
public function BAni1(){
addFrameScript(0, frame1, 3, frame4, 6, frame7);
}
function frame7(){
gotoAndStop("STAND");
}
function frame1(){
stop();
}
function frame4(){
gotoAndPlay("WALK");
}
}
}//package
Section 74
//BAni2 (BAni2)
package {
import flash.display.*;
public dynamic class BAni2 extends MovieClip {
public function BAni2(){
addFrameScript(0, frame1, 10, frame11, 15, frame16);
}
function frame16(){
gotoAndStop("STAND");
}
function frame1(){
stop();
}
function frame11(){
gotoAndPlay("WALK");
}
}
}//package
Section 75
//BAni3 (BAni3)
package {
import flash.display.*;
public dynamic class BAni3 extends MovieClip {
public function BAni3(){
addFrameScript(0, frame1, 6, frame7, 10, frame11);
}
function frame7(){
gotoAndPlay("WALK");
}
function frame1(){
stop();
}
function frame11(){
gotoAndStop("STAND");
}
}
}//package
Section 76
//BAni4 (BAni4)
package {
import flash.display.*;
public dynamic class BAni4 extends MovieClip {
public function BAni4(){
addFrameScript(0, frame1, 6, frame7, 12, frame13);
}
function frame7(){
gotoAndPlay("WALK");
}
function frame1(){
stop();
}
function frame13(){
gotoAndStop("STAND");
}
}
}//package
Section 77
//BAni5 (BAni5)
package {
import flash.display.*;
public dynamic class BAni5 extends MovieClip {
public function BAni5(){
addFrameScript(0, frame1, 7, frame8, 13, frame14);
}
function frame14(){
gotoAndStop("STAND");
}
function frame1(){
stop();
}
function frame8(){
gotoAndPlay("WALK");
}
}
}//package
Section 78
//BAni6 (BAni6)
package {
import flash.display.*;
public dynamic class BAni6 extends MovieClip {
public function BAni6(){
addFrameScript(0, frame1, 6, frame7, 12, frame13);
}
function frame7(){
gotoAndPlay("WALK");
}
function frame1(){
stop();
}
function frame13(){
gotoAndStop("STAND");
}
}
}//package
Section 79
//BAni7 (BAni7)
package {
import flash.display.*;
public dynamic class BAni7 extends MovieClip {
public function BAni7(){
addFrameScript(0, frame1, 6, frame7, 12, frame13);
}
function frame7(){
gotoAndPlay("WALK");
}
function frame1(){
stop();
}
function frame13(){
stop();
}
}
}//package
Section 80
//BazookaShotSound (BazookaShotSound)
package {
import flash.media.*;
public dynamic class BazookaShotSound extends Sound {
}
}//package
Section 81
//BigGun1 (BigGun1)
package {
import flash.display.*;
public dynamic class BigGun1 extends MovieClip {
public var main:MovieClip;
}
}//package
Section 82
//BigGun2 (BigGun2)
package {
import flash.display.*;
public dynamic class BigGun2 extends MovieClip {
public var main:MovieClip;
}
}//package
Section 83
//BioBomb (BioBomb)
package {
import flash.media.*;
public dynamic class BioBomb extends Sound {
}
}//package
Section 84
//BugExplosion0 (BugExplosion0)
package {
import flash.display.*;
public dynamic class BugExplosion0 extends MovieClip {
public function BugExplosion0(){
addFrameScript(3, frame4);
}
function frame4(){
stop();
}
}
}//package
Section 85
//BugExplosion1 (BugExplosion1)
package {
import flash.display.*;
public dynamic class BugExplosion1 extends MovieClip {
public function BugExplosion1(){
addFrameScript(6, frame7, 7, frame8);
}
function frame7(){
stop();
}
function frame8(){
stop();
if (parent != null){
removeChild(this);
};
}
}
}//package
Section 86
//BugHitSound0 (BugHitSound0)
package {
import flash.media.*;
public dynamic class BugHitSound0 extends Sound {
}
}//package
Section 87
//BugHitSound1 (BugHitSound1)
package {
import flash.media.*;
public dynamic class BugHitSound1 extends Sound {
}
}//package
Section 88
//BugPart0 (BugPart0)
package {
import flash.display.*;
public dynamic class BugPart0 extends MovieClip {
}
}//package
Section 89
//BugPart1 (BugPart1)
package {
import flash.display.*;
public dynamic class BugPart1 extends MovieClip {
}
}//package
Section 90
//BugPart10 (BugPart10)
package {
import flash.display.*;
public dynamic class BugPart10 extends MovieClip {
}
}//package
Section 91
//BugPart11 (BugPart11)
package {
import flash.display.*;
public dynamic class BugPart11 extends MovieClip {
}
}//package
Section 92
//BugPart12 (BugPart12)
package {
import flash.display.*;
public dynamic class BugPart12 extends MovieClip {
}
}//package
Section 93
//BugPart2 (BugPart2)
package {
import flash.display.*;
public dynamic class BugPart2 extends MovieClip {
}
}//package
Section 94
//BugPart3 (BugPart3)
package {
import flash.display.*;
public dynamic class BugPart3 extends MovieClip {
}
}//package
Section 95
//BugPart4 (BugPart4)
package {
import flash.display.*;
public dynamic class BugPart4 extends MovieClip {
}
}//package
Section 96
//BugPart5 (BugPart5)
package {
import flash.display.*;
public dynamic class BugPart5 extends MovieClip {
}
}//package
Section 97
//BugPart6 (BugPart6)
package {
import flash.display.*;
public dynamic class BugPart6 extends MovieClip {
}
}//package
Section 98
//BugPart7 (BugPart7)
package {
import flash.display.*;
public dynamic class BugPart7 extends MovieClip {
}
}//package
Section 99
//BugPart8 (BugPart8)
package {
import flash.display.*;
public dynamic class BugPart8 extends MovieClip {
}
}//package
Section 100
//BugPart9 (BugPart9)
package {
import flash.display.*;
public dynamic class BugPart9 extends MovieClip {
}
}//package
Section 101
//BulletSound (BulletSound)
package {
import flash.media.*;
public dynamic class BulletSound extends Sound {
}
}//package
Section 102
//CamBorder (CamBorder)
package {
import flash.display.*;
public dynamic class CamBorder extends MovieClip {
}
}//package
Section 103
//Castle (Castle)
package {
import flash.display.*;
public dynamic class Castle extends MovieClip {
public var wall_d_mask:MovieClip;
public var wall_u_hint:MovieClip;
public var wall_l_mask:MovieClip;
public var wall_r_hint:MovieClip;
public var tower_l_d_plant:MovieClip;
public var wall_d_hint:MovieClip;
public var tower_l_u_plant:MovieClip;
public var wall_u_mask:MovieClip;
public var tower_r_d_plant:MovieClip;
public var wall_l_hint:MovieClip;
public var tower_r_u_plant:MovieClip;
public var wall_r_mask:MovieClip;
}
}//package
Section 104
//CastleSymbol (CastleSymbol)
package {
import flash.display.*;
public dynamic class CastleSymbol extends MovieClip {
}
}//package
Section 105
//Chain (Chain)
package {
import flash.media.*;
public dynamic class Chain extends Sound {
}
}//package
Section 106
//ClacBig (ClacBig)
package {
import flash.media.*;
public dynamic class ClacBig extends Sound {
}
}//package
Section 107
//ClacSmall (ClacSmall)
package {
import flash.media.*;
public dynamic class ClacSmall extends Sound {
}
}//package
Section 108
//ClickSound (ClickSound)
package {
import flash.media.*;
public dynamic class ClickSound extends Sound {
}
}//package
Section 109
//DoorSound (DoorSound)
package {
import flash.media.*;
public dynamic class DoorSound extends Sound {
}
}//package
Section 110
//Explosion (Explosion)
package {
import flash.display.*;
public dynamic class Explosion extends MovieClip {
public function Explosion(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 111
//ExpSound (ExpSound)
package {
import flash.media.*;
public dynamic class ExpSound extends Sound {
}
}//package
Section 112
//FlashSound (FlashSound)
package {
import flash.media.*;
public dynamic class FlashSound extends Sound {
}
}//package
Section 113
//FlyBombSound (FlyBombSound)
package {
import flash.media.*;
public dynamic class FlyBombSound extends Sound {
}
}//package
Section 114
//GreenBlood0 (GreenBlood0)
package {
import flash.display.*;
public dynamic class GreenBlood0 extends MovieClip {
}
}//package
Section 115
//GreenBlood1 (GreenBlood1)
package {
import flash.display.*;
public dynamic class GreenBlood1 extends MovieClip {
}
}//package
Section 116
//GreenBlood2 (GreenBlood2)
package {
import flash.display.*;
public dynamic class GreenBlood2 extends MovieClip {
}
}//package
Section 117
//GunShotSound (GunShotSound)
package {
import flash.media.*;
public dynamic class GunShotSound extends Sound {
}
}//package
Section 118
//Halo (Halo)
package {
import flash.display.*;
public dynamic class Halo extends MovieClip {
}
}//package
Section 119
//Hard (Hard)
package {
import flash.media.*;
public dynamic class Hard extends Sound {
}
}//package
Section 120
//Help (Help)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import com.elf7.*;
import com.elf7.level.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Help extends MovieClip {
public var b0:MovieClip;
public var b2:MovieClip;
public var b4:MovieClip;
public var b5:MovieClip;
public var b6:MovieClip;
public var b1:MovieClip;
public var b3:MovieClip;
public var titles:Array;
public var closeBtn:SimpleButton;
public var b7:MovieClip;
public var title:TextField;
public var close_b:SimpleButton;
public var help_ani:MovieClip;
public var game:Game;
public function Help(){
addFrameScript(0, frame1);
}
public function init():void{
var _local1:*;
_local1 = 0;
while (_local1 < 8) {
(getChildByName(("b" + String(_local1))) as MovieClip).addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
(getChildByName(("b" + String(_local1))) as MovieClip).buttonMode = true;
(getChildByName(("b" + String(_local1))) as MovieClip).mouseChildren = false;
(getChildByName(("b" + String(_local1))) as MovieClip).stop();
_local1++;
};
(getChildByName("help_ani") as MovieClip).stop();
(getChildByName("b0") as MovieClip).gotoAndStop(2);
(getChildByName("title") as TextField).text = "HELP - SELECTING SOLDIERS";
if ((parent as Game).currentFrame != 5){
onClose(null);
} else {
(getChildByName("close_b") as SimpleButton).addEventListener(MouseEvent.CLICK, onClose, false, 0, true);
};
}
function frame1(){
titles = ["HELP - SELECTING SOLDIERS", "HELP - MOVEMENT OF SOLDIERS", "HELP - CAMERA CONTROL", "HELP - GUNNER", "HELP - HEAVY INFANTRY", "HELP - REPAIRMAN", "HELP - MORTAR", "HELP - MACHINEGUN"];
closeBtn = (getChildByName("close_b") as SimpleButton);
game = (parent as Game);
}
public function onClose(_arg1:MouseEvent):void{
var _local2:*;
_local2 = 0;
while (_local2 < 8) {
(getChildByName(("b" + String(_local2))) as MovieClip).removeEventListener(MouseEvent.CLICK, onClick);
_local2++;
};
closeBtn.removeEventListener(MouseEvent.CLICK, onClose);
while (numChildren) {
removeChildAt(0);
};
titles = null;
(game.getChildByName("gf") as GameField).onHelpClose();
game = null;
closeBtn = null;
parent.removeChild(this);
}
public function onClick(_arg1:MouseEvent):void{
var _local2:MovieClip;
var _local3:int;
var _local4:int;
_local2 = (getChildByName("help_ani") as MovieClip);
_local3 = int(_arg1.target.name.substr(1));
_local4 = 0;
_local2.gotoAndStop((_local3 + 1));
_local4 = 0;
while (_local4 < 8) {
(getChildByName(("b" + String(_local4))) as MovieClip).gotoAndStop(1);
_local4++;
};
(getChildByName("title") as TextField).text = titles[_local3];
(_arg1.target as MovieClip).gotoAndStop(2);
}
}
}//package
Section 121
//HintBg0 (HintBg0)
package {
import flash.display.*;
public dynamic class HintBg0 extends MovieClip {
}
}//package
Section 122
//HintBg1 (HintBg1)
package {
import flash.display.*;
public dynamic class HintBg1 extends MovieClip {
}
}//package
Section 123
//HintBg2 (HintBg2)
package {
import flash.display.*;
public dynamic class HintBg2 extends MovieClip {
}
}//package
Section 124
//Light (Light)
package {
import flash.media.*;
public dynamic class Light extends Sound {
}
}//package
Section 125
//Logo (Logo)
package {
import flash.media.*;
public dynamic class Logo extends Sound {
}
}//package
Section 126
//Main (Main)
package {
import flash.media.*;
public dynamic class Main extends Sound {
}
}//package
Section 127
//Mark (Mark)
package {
import flash.display.*;
public dynamic class Mark extends MovieClip {
}
}//package
Section 128
//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 = _local3.root.loaderInfo.loaderURL;
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 129
//OpenMenu (OpenMenu)
package {
import flash.media.*;
public dynamic class OpenMenu extends Sound {
}
}//package
Section 130
//OverSound (OverSound)
package {
import flash.media.*;
public dynamic class OverSound extends Sound {
}
}//package
Section 131
//RedBlood0 (RedBlood0)
package {
import flash.display.*;
public dynamic class RedBlood0 extends MovieClip {
}
}//package
Section 132
//RockWall (RockWall)
package {
import flash.display.*;
public dynamic class RockWall extends MovieClip {
}
}//package
Section 133
//SendBombSound (SendBombSound)
package {
import flash.media.*;
public dynamic class SendBombSound extends Sound {
}
}//package
Section 134
//Smoke (Smoke)
package {
import flash.display.*;
public dynamic class Smoke extends MovieClip {
public function Smoke(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 135
//SolderDieSound (SolderDieSound)
package {
import flash.media.*;
public dynamic class SolderDieSound extends Sound {
}
}//package
Section 136
//SolderExplosion0 (SolderExplosion0)
package {
import flash.display.*;
public dynamic class SolderExplosion0 extends MovieClip {
public function SolderExplosion0(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package
Section 137
//SolderPart0 (SolderPart0)
package {
import flash.display.*;
public dynamic class SolderPart0 extends MovieClip {
}
}//package
Section 138
//SolderPart1 (SolderPart1)
package {
import flash.display.*;
public dynamic class SolderPart1 extends MovieClip {
}
}//package
Section 139
//SolderPart2 (SolderPart2)
package {
import flash.display.*;
public dynamic class SolderPart2 extends MovieClip {
}
}//package
Section 140
//SolderPart3 (SolderPart3)
package {
import flash.display.*;
public dynamic class SolderPart3 extends MovieClip {
}
}//package
Section 141
//SolderPart4 (SolderPart4)
package {
import flash.display.*;
public dynamic class SolderPart4 extends MovieClip {
}
}//package
Section 142
//SolderPart5 (SolderPart5)
package {
import flash.display.*;
public dynamic class SolderPart5 extends MovieClip {
}
}//package
Section 143
//Star (Star)
package {
import flash.display.*;
public dynamic class Star extends MovieClip {
public function Star(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 144
//Tile0 (Tile0)
package {
import flash.display.*;
public dynamic class Tile0 extends MovieClip {
}
}//package
Section 145
//Tile1 (Tile1)
package {
import flash.display.*;
public dynamic class Tile1 extends MovieClip {
}
}//package
Section 146
//Tower1 (Tower1)
package {
import flash.display.*;
public dynamic class Tower1 extends MovieClip {
}
}//package
Section 147
//Tower2 (Tower2)
package {
import flash.display.*;
public dynamic class Tower2 extends MovieClip {
}
}//package
Section 148
//Tower3 (Tower3)
package {
import flash.display.*;
public dynamic class Tower3 extends MovieClip {
}
}//package
Section 149
//Tower4 (Tower4)
package {
import flash.display.*;
public dynamic class Tower4 extends MovieClip {
}
}//package
Section 150
//Tower5 (Tower5)
package {
import flash.display.*;
public dynamic class Tower5 extends MovieClip {
}
}//package
Section 151
//UpgradeImg (UpgradeImg)
package {
import flash.display.*;
public dynamic class UpgradeImg extends MovieClip {
public function UpgradeImg(){
addFrameScript(31, frame32);
}
function frame32(){
stop();
parent.removeChild(this);
}
}
}//package
Section 152
//Wall1 (Wall1)
package {
import flash.display.*;
public dynamic class Wall1 extends MovieClip {
}
}//package
Section 153
//Wall2 (Wall2)
package {
import flash.display.*;
public dynamic class Wall2 extends MovieClip {
}
}//package
Section 154
//Wall3 (Wall3)
package {
import flash.display.*;
public dynamic class Wall3 extends MovieClip {
}
}//package
Section 155
//Wall4 (Wall4)
package {
import flash.display.*;
public dynamic class Wall4 extends MovieClip {
}
}//package
Section 156
//Wall5 (Wall5)
package {
import flash.display.*;
public dynamic class Wall5 extends MovieClip {
}
}//package
Section 157
//WinSound (WinSound)
package {
import flash.media.*;
public dynamic class WinSound extends Sound {
}
}//package